Skip to content

Commit bb0a7a7

Browse files
bakpaulfredroy
andauthored
Add way to deactivate gui bindings (#409)
* Deactivate gui bindings when lib is not found * Changed activaiton mechanism to be more axplicit and follows SOFAEXPORTER one * fix comment --------- Co-authored-by: Frederick Roy <froy@lnrobo.com>
1 parent 3252458 commit bb0a7a7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ endif()
4444
sofa_find_package(Sofa.Component.IO.Mesh QUIET)
4545
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAEXPORTER "Bind the SOFA exporter component." ON "Sofa.Component.IO.Mesh_FOUND" OFF)
4646

47+
48+
sofa_find_package(Sofa.GUI.Common QUIET)
49+
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUI "Bind the SOFA gui component." ON "Sofa.GUI.Common_FOUND" OFF)
50+
51+
4752
# BUILD OPTIONS
4853
if (NOT SP3_COMPILED_AS_SUBPROJECT)
4954
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

bindings/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
project(Bindings)
22

3-
set(BINDINGS_MODULE_LIST Sofa SofaRuntime SofaGui SofaTypes Modules)
3+
set(BINDINGS_MODULE_LIST Sofa SofaRuntime SofaTypes Modules)
4+
5+
if(SP3_WITH_SOFAGUI)
6+
list(APPEND BINDINGS_MODULE_LIST SofaGui)
7+
endif()
8+
49
if(SP3_WITH_SOFAEXPORTER)
510
list(APPEND BINDINGS_MODULE_LIST SofaExporter)
611
endif()
@@ -25,6 +30,7 @@ if(UNIX)
2530
endif()
2631
endif()
2732

33+
2834
foreach(bindings_module ${BINDINGS_MODULE_LIST})
2935
add_subdirectory(${bindings_module})
3036
endforeach()

0 commit comments

Comments
 (0)