Skip to content

Commit

Permalink
Only compile and install netcdf files if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasdreyer committed Feb 27, 2025
1 parent 22cbdc6 commit 2789335
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 6 additions & 3 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ add_t8_example( NAME t8_example_geometries SOURCES geometry/t8_exam
add_t8_example( NAME t8_cmesh_load_save SOURCES IO/cmesh/t8_cmesh_load_save.cxx )
add_t8_example( NAME t8_read_msh_file SOURCES IO/cmesh/gmsh/t8_read_msh_file.cxx )
add_t8_example( NAME t8_load_and_refine_square_w_hole SOURCES IO/cmesh/gmsh/t8_load_and_refine_square_w_hole.cxx )
add_t8_example( NAME t8_write_cmesh_netcdf SOURCES IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx )
add_t8_example( NAME t8_read_tetgen SOURCES IO/cmesh/tetgen/t8_read_tetgen_file.cxx )
add_t8_example( NAME t8_time_tetgen SOURCES IO/cmesh/tetgen/t8_time_tetgen_file.cxx )
add_t8_example( NAME t8_forest_tetgen SOURCES IO/cmesh/tetgen/t8_forest_from_tetgen.cxx )
add_t8_example( NAME t8_read_triangle SOURCES IO/cmesh/triangle/t8_read_triangle_file.cxx )
add_t8_example( NAME t8_cmesh_read_from_vtk SOURCES IO/cmesh/vtk/t8_cmesh_read_from_vtk.cxx )

add_t8_example( NAME t8_netcdf_compilation_status SOURCES IO/forest/netcdf/t8_netcdf_status.c )
add_t8_example( NAME t8_write_forest_netcdf SOURCES IO/forest/netcdf/t8_write_forest_netcdf.cxx )
if(T8CODE_ENABLE_NETCDF)
add_t8_example( NAME t8_write_cmesh_netcdf SOURCES IO/cmesh/netcdf/t8_write_cmesh_netcdf.cxx )
add_t8_example( NAME t8_netcdf_compilation_status SOURCES IO/forest/netcdf/t8_netcdf_status.c )
add_t8_example( NAME t8_write_forest_netcdf SOURCES IO/forest/netcdf/t8_write_forest_netcdf.cxx )
endif()

add_t8_example( NAME t8_gmsh_to_vtk SOURCES IO/forest/gmsh/t8_gmsh_to_vtk.cxx )

add_t8_example( NAME t8_example_spheres SOURCES remove/t8_example_spheres.cxx )
Expand Down
16 changes: 10 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ if( T8CODE_ENABLE_NETCDF )
target_compile_definitions(T8 PUBLIC
T8_WITH_NETCDF
$<$<AND:$<BOOL:${NETCDF_HAVE_NETCDF_PAR}>,$<BOOL:${T8CODE_ENABLE_MPI}>>:T8_WITH_NETCDF_PAR> )
target_sources( T8 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
)
endif()

set_target_properties( T8 PROPERTIES OUTPUT_NAME t8 )
Expand Down Expand Up @@ -89,7 +99,6 @@ target_sources( T8 PRIVATE
t8_element_shape.c
t8_element.cxx
t8_mesh.c
t8_netcdf.c
t8_refcount.c
t8_version.c
t8_vtk.c
Expand All @@ -99,7 +108,6 @@ target_sources( T8 PRIVATE
t8_cmesh/t8_cmesh_stash.c
t8_cmesh/t8_cmesh_vtk_reader.cxx
t8_cmesh/t8_cmesh_save.cxx
t8_cmesh/t8_cmesh_netcdf.c
t8_cmesh/t8_cmesh_trees.cxx
t8_cmesh/t8_cmesh_commit.cxx
t8_cmesh/t8_cmesh_partition.cxx
Expand All @@ -118,7 +126,6 @@ target_sources( T8 PRIVATE
t8_forest/t8_forest_ghost.cxx
t8_forest/t8_forest_iterate.cxx
t8_forest/t8_forest_balance.cxx
t8_forest/t8_forest_netcdf.cxx
t8_forest/t8_forest_search/t8_forest_search.cxx
t8_geometry/t8_geometry.cxx
t8_geometry/t8_geometry_helpers.c
Expand Down Expand Up @@ -185,18 +192,15 @@ install( FILES
t8.h
t8_cmesh.h
t8_cmesh.hxx
t8_cmesh_netcdf.h
t8_cmesh_readmshfile.h
t8_cmesh_tetgen.h
t8_cmesh_triangle.h
t8_cmesh_vtk_reader.hxx
t8_eclass.h
t8_element.h
t8_element_shape.h
t8_forest_netcdf.h
t8_mat.h
t8_mesh.h
t8_netcdf.h
t8_refcount.h
t8_types/t8_vec.hxx
t8_version.h
Expand Down

0 comments on commit 2789335

Please sign in to comment.