File tree Expand file tree Collapse file tree 3 files changed +48
-12
lines changed Expand file tree Collapse file tree 3 files changed +48
-12
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,40 @@ cmake_minimum_required(VERSION 3.10)
33
44find_package (pybind11 REQUIRED)
55
6- pybind11_add_module(gmds
7- src/binding_math.cpp
8- src/binding_mesh.cpp
9- src/binding_geometry.cpp
10- src/binding_blocking.cpp
11- src/gmds_facade.cpp
12- )
6+ if (ENABLE_BLOCKING)
7+ pybind11_add_module(gmds
8+ src/binding_math.cpp
9+ src/binding_mesh.cpp
10+ src/binding_geometry.cpp
11+ src/binding_blocking.cpp
12+ src/gmds_facade.cpp
13+ )
14+ else ()
15+ pybind11_add_module(gmds
16+ src/binding_math.cpp
17+ src/binding_mesh.cpp
18+ src/binding_geometry.cpp
19+ src/gmds_facade.cpp
20+ )
21+ endif ()
1322
1423target_link_libraries (gmds PRIVATE
1524 ${LIB_GMDS_IG}
1625 ${LIB_GMDS_CADFAC}
17- LIB_GMDS_BLOCKING
1826 ${LIB_GMDS_IO}
1927 )
28+ if (ENABLE_BLOCKING)
29+ target_link_libraries (gmds PRIVATE
30+ ${LIB_GMDS_BLOCKING}
31+ )
32+ # it should not be necessary
33+ add_dependencies (gmds ${LIB_GMDS_BLOCKING} )
34+ endif ()
35+
2036target_compile_definitions (gmds PUBLIC cxx_std_14)
37+ if (ENABLE_BLOCKING)
38+ target_compile_definitions (gmds PUBLIC ENABLE_BLOCKING=1)
39+ endif ()
2140
2241install (TARGETS gmds
2342 COMPONENT python
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ namespace py = pybind11;
66void bind_math (py::module &);
77void bind_mesh (py::module &);
88void bind_geometry (py::module &);
9+ #if ENABLE_BLOCKING
910void bind_blocking (py::module &);
11+ #endif
1012/* ----------------------------------------------------------------------------*/
1113// ig is the submodule name
1214PYBIND11_MODULE (gmds, m)
@@ -22,6 +24,8 @@ PYBIND11_MODULE(gmds, m)
2224 bind_mesh (sub_mesh);
2325 auto sub_geom = m.def_submodule (" cad" , " cad interface" );
2426 bind_geometry (sub_geom);
27+ #if ENABLE_BLOCKING
2528 auto sub_block = m.def_submodule (" blocking" , " blocking kernel" );
2629 bind_blocking (sub_block);
30+ #endif
2731}
Original file line number Diff line number Diff line change 11#==============================================================================
22message ("ENVIRONMENT ENVPYTHONPATH $ENV{PYTHONPATH} " )
33
4- add_test (NAME test_pygmds
5- COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_SAMPLES_DIR} -v
6- )
7- set_tests_properties (test_pygmds
4+ add_test (NAME test_pygmds_geometry
5+ COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR} /test_mesh.py ${TEST_SAMPLES_DIR} -v
6+ )
7+ add_test (NAME test_pygmds_mesh
8+ COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR} /test_geometry.py ${TEST_SAMPLES_DIR} -v
9+ )
10+ set_tests_properties (test_pygmds_geometry
11+ PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /pygmds:$ENV{PYTHONPATH} " )
12+ set_tests_properties (test_pygmds_mesh
813 PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /pygmds:$ENV{PYTHONPATH} " )
14+
15+ if (ENABLE_BLOCKING)
16+ add_test (NAME test_pygmds_blocking
17+ COMMAND pytest ${CMAKE_CURRENT_SOURCE_DIR} /test_blocking.py ${TEST_SAMPLES_DIR} -v
18+ )
19+ set_tests_properties (test_pygmds_blocking
20+ PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR} /pygmds:$ENV{PYTHONPATH} " )
21+ endif ()
922#==============================================================================
You can’t perform that action at this time.
0 commit comments