Fix CMake issues when disabling unit tests, Add new CMake flag OPENSPACE_ENABLE_ALL_MODULES to change default behavior of module inclusion

This commit is contained in:
Alexander Bock
2023-04-15 22:39:35 +02:00
parent 27ba567af8
commit db002d4cf7
5 changed files with 13 additions and 9 deletions

View File

@@ -121,7 +121,9 @@ target_link_libraries(OpenSpace PRIVATE sgct)
set_target_properties(sgct PROPERTIES FOLDER "External")
set_target_properties(glfw PROPERTIES FOLDER "External")
set_target_properties(SGCTTest PROPERTIES FOLDER "External")
if (TARGET SGCTTest)
set_target_properties(SGCTTest PROPERTIES FOLDER "External")
endif ()
if (UNIX AND (NOT APPLE))
target_link_libraries(OpenSpace PRIVATE Xcursor Xinerama X11)

View File

@@ -46,7 +46,9 @@ endif ()
# Ghoul
add_subdirectory(ghoul)
set_target_properties(GhoulTest PROPERTIES FOLDER "Unit Tests")
if (TARGET GhoulTest)
set_target_properties(GhoulTest PROPERTIES FOLDER "Unit Tests")
endif ()
# Spice
begin_dependency("Spice")

View File

@@ -162,7 +162,7 @@ endfunction ()
option(OPENSPACE_ENABLE_ALL_MODULES "If this is ON, all modules will be enabled by default")
set(OPENSPACE_EXTERNAL_MODULES_PATHS "" CACHE STRING "List of external modules")
set(internal_module_path "${PROJECT_SOURCE_DIR}/modules")
set(all_enabled_modules "")
@@ -209,7 +209,11 @@ foreach(val RANGE ${all_module_names_count})
get_module_attribute_default(${path} is_default_module)
create_option_name(${name} optionName)
option(${optionName} "Build ${path} Module" ${is_default_module})
if (${OPENSPACE_ENABLE_ALL_MODULES})
option(${optionName} "Build ${path} Module" ON)
else ()
option(${optionName} "Build ${path} Module" ${is_default_module})
endif ()
if (${optionName})
list(APPEND enabled_module_names ${name})

View File

@@ -1,4 +0,0 @@
if os.getenv("OPENSPACE_DEVELOPER")
then
openspace.setPropertyValueSingle('OpenSpaceEngine.PropertyVisibility', 4)
end