From 2885cff604e10a56d9c094e679aae333a1d42fcd Mon Sep 17 00:00:00 2001 From: Volker Enderlein Date: Mon, 18 Dec 2023 22:35:43 +0100 Subject: [PATCH] Updated CMake script. [skip ci] --- CMakeLists.txt | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a406f8..02ba83d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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) @@ -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 @@ -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()