diff --git a/CMakeLists.txt b/CMakeLists.txt index 609de99e36..8441b870af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,12 @@ if( T8CODE_ENABLE_NETCDF ) message("Found netCDF") include(cmake/CheckNetCDFPar.cmake) endif (netCDF_FOUND) + install( FILES + t8_cmesh_netcdf.h + t8_forest_netcdf.h + t8_netcdf.h + DESTINATION include + ) endif( T8CODE_ENABLE_NETCDF ) # Override default for this libsc option @@ -191,22 +197,16 @@ function(t8_add_cmake_properties target) endif() if( T8CODE_ENABLE_NETCDF ) - target_link_libraries( T8 PUBLIC netCDF::netcdf ) - target_compile_definitions(T8 PUBLIC + target_link_libraries( ${target} PUBLIC netCDF::netcdf ) + target_compile_definitions(${target} PUBLIC T8_WITH_NETCDF $<$,$>:T8_WITH_NETCDF_PAR> ) - target_sources( T8 PRIVATE + target_sources( ${target} PRIVATE t8_netcdf.c t8_cmesh/t8_cmesh_netcdf.c t8_forest/t8_forest_netcdf.cxx ) - install( FILES - t8_cmesh_netcdf.h - t8_forest_netcdf.h - t8_netcdf.h - DESTINATION include - ) endif() if( T8CODE_BUILD_WPEDANTIC )