Skip to content

Commit

Permalink
Updated CMake script. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerEnderlein committed Dec 18, 2023
1 parent 788792a commit 2885cff
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0)

set (CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)

set(SIMVOLEON_MAJOR_VERSION 2)
set(SIMVOLEON_MINOR_VERSION 1)
Expand Down Expand Up @@ -77,7 +77,7 @@ function(executable executable_name)
target_compile_options(${executable_name} PUBLIC "-fsanitize=address")
set_target_properties(${executable_name} PROPERTIES LINK_FLAGS "-fsanitize=address")
endif()
endfunction(executable)
endfunction()

function(report_prepare)
set(multiValueArgs IF_APPLE IF_WIN32)
Expand All @@ -91,7 +91,7 @@ function(report_prepare)
list(APPEND res ${REPORT_UNPARSED_ARGUMENTS})
list(APPEND PACKAGE_OPTIONS ${res})
set(PACKAGE_OPTIONS "${PACKAGE_OPTIONS}" PARENT_SCOPE)
endfunction(report_prepare)
endfunction()

# ############################################################################
# Provide options to customise the build
Expand Down Expand Up @@ -125,30 +125,21 @@ find_package(OpenGL REQUIRED) # FIXME really needed?
find_package(Coin REQUIRED)
if (SIMVOLEON_BUILD_TESTS)
set(Gui "Qt" CACHE STRING "Target GUI for the example code")
set(GuiValues "Qt;Xt;Win;Wx" CACHE INTERNAL "List of possible values for the GUI cache variable")
set(GuiValues "Qt;Xt;Win;Wx" CACHE INTERNAL "List of supported values for the GUI cache variable")
set_property(CACHE Gui PROPERTY STRINGS ${GuiValues})
message(STATUS "Example Gui set to '${Gui}'")
if (Gui STREQUAL "Qt")
message(WARNING "SoQt GUI binding examples WILL CRASH")
set(GUI QT)
find_package(SoQt)
set(EXAMPLE_LINK_LIB SoQt::SoQt)
elseif(Gui STREQUAL "Xt")
set(GUI XT)
find_package(SoXt)
set(EXAMPLE_LINK_LIB SoXt::SoXt)
elseif(Gui STREQUAL "Wx")
set(GUI WX)
find_package(SoWx)
set(EXAMPLE_LINK_LIB SoWx::SoWx)
elseif(Gui STREQUAL "Win")
message(WARNING "SoWin GUI binding NOT TESTED")
set(GUI WIN)
find_package(SoWin)
set(EXAMPLE_LINK_LIB SoWin::SoWin)
else()
message(FATAL_ERROR "Only Qt,Win, Wx and Xt supported: please set Gui at one of these values")
endif()
string(TOUPPER ${Gui} GUI)
find_package(So${Gui})
set(EXAMPLE_LINK_LIB So${Gui}::So${Gui})
find_package(GLUT) # needed only for testcode/tabula/glutclut.c
endif()

Expand Down

0 comments on commit 2885cff

Please sign in to comment.