From 30bb4ccb670a02273e293b159c67238ae20ba459 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Thu, 23 Apr 2015 18:39:00 +0530 Subject: [PATCH] Use standard CMake variables - static/shared lib. Currently JSONCPP_LIB_BUILD_SHARED variable is used as option to build static/shared libraries. The current patch uses standard CMake variables for this. Such a workaround is done in https://github.com/open-source-parsers/jsoncpp/issues/51 Current patch will make it generic. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cf63ea..30038d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,8 @@ OPTION(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post OPTION(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occurs" OFF) OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON) OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF) +OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF) +OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON) # Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix IF(NOT WIN32)