From 54531547801f18d5980b8d0663bf7e795631b3f8 Mon Sep 17 00:00:00 2001 From: Maxime Schoemans Date: Sat, 19 Oct 2024 16:42:27 +0200 Subject: [PATCH] Add BUILD_SHARED_LIBS for shared or static library build --- meos/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meos/CMakeLists.txt b/meos/CMakeLists.txt index ef6c04a6a..4df67ed70 100644 --- a/meos/CMakeLists.txt +++ b/meos/CMakeLists.txt @@ -23,6 +23,12 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) add_definitions(-DSYSTEMTZDIR="/usr/share/zoneinfo") message(STATUS "Directory of the time zone database: /usr/share/zoneinfo") +# Option to build MEOS as a shared or static library +option(BUILD_SHARED_LIBS + "Set to OFF to build MEOS as a static library (default is ON)" + ON +) + # Option to show debug messages for analyzing the expandable data structures option(DEBUG_EXPAND "Set DEBUG_EXPAND (default=OFF) to show debug messages for analyzing the @@ -168,7 +174,7 @@ set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") # Build the library: All -add_library(${MEOS_LIB_NAME} SHARED ${PROJECT_OBJECTS}) +add_library(${MEOS_LIB_NAME} ${PROJECT_OBJECTS}) if(APPLE) set_target_properties(${MEOS_LIB_NAME} PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup")