From b8c33386113318611df89514a198768615c42c70 Mon Sep 17 00:00:00 2001 From: Andrea Michelotti Date: Thu, 8 Jan 2015 18:23:06 +0100 Subject: [PATCH 1/2] enable shared lib --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47c3b71fb6..b63bb1a00d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ option (ENABLE_STATS option (ENABLE_REGEX_URL "Enable url regex matching dispatcher" OFF) +option (SHAREDLIB + "Generate a shared library" OFF) + set (JSONCPP_DIR "${PROJECT_SOURCE_DIR}/../jsoncpp" CACHE STRING "Json C++ directory") @@ -95,7 +98,12 @@ if (WIN32) endif (WIN32) # Compiling library -add_library (mongoose ${SOURCES}) +if (SHAREDLIB) + add_library (mongoose SHARED ${SOURCES}) +else() + add_library (mongoose ${SOURCES}) +endif() + target_link_libraries (mongoose ${EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) if (HAS_JSONCPP) From 6a90e0a97cc717d8560dc380875bb4d2a81c07da Mon Sep 17 00:00:00 2001 From: Andrea Michelotti Date: Fri, 9 Jan 2015 14:57:34 +0100 Subject: [PATCH 2/2] wrong jsoncpp library name --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b63bb1a00d..ba2d445af7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,7 @@ endif() target_link_libraries (mongoose ${EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) if (HAS_JSONCPP) - target_link_libraries (mongoose json) + target_link_libraries (mongoose jsoncpp) endif (HAS_JSONCPP) if (EXAMPLES OR MAIN)