Automatically build as library if project is not toplevel

This commit is contained in:
momo5502
2025-08-24 12:56:15 +02:00
parent 318b3a99d6
commit 860f5d4cfc

View File

@@ -8,7 +8,6 @@ option(MOMO_ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF)
option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON) option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON)
option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF) option(MOMO_EMSCRIPTEN_MEMORY64 "Enable memory 64 support for emscripten builds" OFF)
option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF) option(MOMO_EMSCRIPTEN_SUPPORT_NODEJS "Enable Node.js filesystem for emscripten compilation" OFF)
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the sogen as a shared library (without the samples and tests)" OFF)
set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build") set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build")
message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}") message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}")
@@ -37,6 +36,18 @@ enable_testing()
########################################## ##########################################
if(PROJECT_IS_TOP_LEVEL)
set(MOMO_IS_SUBPROJECT OFF)
else()
set(MOMO_IS_SUBPROJECT ON)
endif()
##########################################
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the sogen as a shared library (without the samples and tests)" ${MOMO_IS_SUBPROJECT})
##########################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
########################################## ##########################################