Skip to content

Commit

Permalink
[Sofa.Gui] Add dependant option to not bind qt/qglviewer to Sofa.Gui …
Browse files Browse the repository at this point in the history
…(even if present) (#445)

* Deactivate gui bindings when lib is not found

* Changed activaiton mechanism to be more axplicit and follows SOFAEXPORTER one

* fix comment

* add (dependant) option to not necessarily bind qt/qglviewer guis to Sofa.Gui

---------

Co-authored-by: bakpaul <bakpaul@hotmail.fr>
Co-authored-by: Paul Baksic <paul.baksic@outlook.fr>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent 4b0ce86 commit 9d57a6a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bindings/SofaGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ sofa_find_package(Sofa.Core REQUIRED)
sofa_find_package(Sofa.GUI.Common REQUIRED) # to get the GUI mechanism

sofa_find_package(Sofa.GUI.Batch QUIET)
if(Sofa.GUI.Batch_FOUND)
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIBATCH "Enable the SOFA batch gui component." ON "Sofa.GUI.Batch_FOUND" OFF)
if(Sofa.GUI.Batch_FOUND AND SP3_WITH_SOFAGUIBATCH)
list(APPEND SUPPORTED_GUIS Sofa.GUI.Batch)
endif()

sofa_find_package(Sofa.GUI.Qt QUIET)
if(Sofa.GUI.Qt_FOUND)
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIQT "Enable the SOFA Qt gui component." ON "Sofa.GUI.Qt_FOUND" OFF)
if(Sofa.GUI.Qt_FOUND AND SP3_WITH_SOFAGUIQT)
list(APPEND SUPPORTED_GUIS Sofa.GUI.Qt)
endif()

sofa_find_package(Sofa.GUI.HeadlessRecorder QUIET)
if(Sofa.GUI.HeadlessRecorder_FOUND)
CMAKE_DEPENDENT_OPTION(SP3_WITH_SOFAGUIHEADLESSRECORDER "Enable the SOFA HeadlessRecorder gui component." ON "Sofa.GUI.HeadlessRecorder_FOUND" OFF)
if(Sofa.GUI.HeadlessRecorder_FOUND AND SP3_WITH_SOFAGUIHEADLESSRECORDER)
list(APPEND SUPPORTED_GUIS Sofa.GUI.HeadlessRecorder)
endif()

Expand Down

0 comments on commit 9d57a6a

Please sign in to comment.