From 390ca9aeddf74c8860b5c9db2bfe2bc0f1bf145b Mon Sep 17 00:00:00 2001 From: waqar-ukaea Date: Fri, 10 Oct 2025 14:20:50 +0100 Subject: [PATCH] Update CMakeLists.txt to respect parent scope for BUILD_SHARED_LIBS --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49c50ed6..74de7b10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,16 +55,17 @@ endif() # Configuration Options # ------------------------------------------------------------------ option(GPRT_BUILD_SHARED "Build GPRT as a shared library? (otherwise static)" OFF) -set(BUILD_SHARED_LIBS ${GPRT_BUILD_SHARED}) # use 'GPRT_' naming convention option(GPRT_USE_INCLUDED_GLFW "Build GPRT including the submoduled GLFW? (otherwise, system GLFW will be found)" ON) # ------------------------------------------------------------------ # External configuration variables # ------------------------------------------------------------------ -# provide these varaibles at both a local and parent scope +# provide these variables at both a local and parent scope if (GPRT_IS_SUBPROJECT) set(GPRT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gprt PARENT_SCOPE) +else() + set(BUILD_SHARED_LIBS ${GPRT_BUILD_SHARED}) endif() set(GPRT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gprt)