git repos / PlatformFolders

commit 158fba39

Olivier LDff · 2021-08-16 13:17
158fba3920a81ddf6c3c1690f0111b8745f83b81 patch · browse files
parent 2eed66df99a1358e6b55c1c2c6b96a99818aa9d2

Use scoped PLATFORMFOLDERS_BUILD_SHARED_LIBS option instead of BUILD_SHARED_LIBS

Changed files

M CMakeLists.txt before
diff --git a/CMakeLists.txt b/CMakeLists.txt index d5056cc..08bff96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -2,10 +2,14 @@
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(platform_folders VERSION 4.1.0 LANGUAGES CXX)
-# Since it's off, the library will be static by default
-option(BUILD_SHARED_LIBS "Build shared instead of static." OFF)
+# BUILD_SHARED_LIBS is off by default, the library will be static by default
+option(PLATFORMFOLDERS_BUILD_SHARED_LIBS "Build platform_folders shared library" ${BUILD_SHARED_LIBS})
+set(PLATFORMFOLDERS_TYPE STATIC)
+if(PLATFORMFOLDERS_BUILD_SHARED_LIBS)
+ set(PLATFORMFOLDERS_TYPE SHARED)
+endif()
-add_library(platform_folders
+add_library(platform_folders ${PLATFORMFOLDERS_TYPE}
sago/platform_folders.cpp
)