[Cmake-commits] CMake branch, next, updated. v3.1.0-2246-g895bc35
Brad King
brad.king at kitware.com
Tue Jan 20 11:03:29 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 895bc35c76bd9684e30ef29af5608e497392995a (commit)
via 27c6da933ec1dd4028bb80e4adf2fa7309ef4a04 (commit)
from 661541c4d9e363c1785299e359588a82b97d16f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=895bc35c76bd9684e30ef29af5608e497392995a
commit 895bc35c76bd9684e30ef29af5608e497392995a
Merge: 661541c 27c6da9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 20 11:03:28 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 20 11:03:28 2015 -0500
Merge topic 'jsoncpp-third-party' into next
27c6da93 Add option to build CMake against a system jsoncpp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27c6da933ec1dd4028bb80e4adf2fa7309ef4a04
commit 27c6da933ec1dd4028bb80e4adf2fa7309ef4a04
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 20 10:31:13 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 20 10:37:35 2015 -0500
Add option to build CMake against a system jsoncpp
Create a CMAKE_USE_SYSTEM_JSONCPP option.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3c424b..bdc160d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
- set(UTILITIES BZIP2 CURL EXPAT FORM LIBARCHIVE LIBLZMA ZLIB)
+ set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA ZLIB)
foreach(util ${UTILITIES})
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
@@ -104,6 +104,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma"
"${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
+ option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
# Mention to the user what system libraries are being used.
foreach(util ${UTILITIES})
@@ -373,8 +374,24 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
- add_subdirectory(Utilities/cmjsoncpp)
- CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
+ if(CMAKE_USE_SYSTEM_JSONCPP)
+ if(EXISTS ${CMAKE_ROOT}/Modules/FindJsonCpp.cmake)
+ find_package(JsonCpp)
+ elseif(NOT CMAKE_VERSION VERSION_LESS 3.0)
+ include(${CMake_SOURCE_DIR}/Modules/FindJsonCpp.cmake)
+ else()
+ message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0")
+ endif()
+ if(NOT JsonCpp_FOUND)
+ message(FATAL_ERROR
+ "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
+ endif()
+ set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
+ else()
+ set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
+ add_subdirectory(Utilities/cmjsoncpp)
+ CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
+ endif()
#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 435b654..af4c7cf 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -503,7 +503,7 @@ target_link_libraries(CMakeLib cmsys
${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
${CMAKE_CURL_LIBRARIES}
- cmjsoncpp
+ ${CMAKE_JSONCPP_LIBRARIES}
)
# On Apple we need CoreFoundation
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index b883284..0cb6809 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -20,6 +20,7 @@
#cmakedefine CMAKE_USE_SYSTEM_LIBARCHIVE
#cmakedefine CMAKE_USE_SYSTEM_LIBLZMA
#cmakedefine CMAKE_USE_SYSTEM_FORM
+#cmakedefine CMAKE_USE_SYSTEM_JSONCPP
#cmakedefine CTEST_USE_XMLRPC
#endif
diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h
index d7cb50e..22f2d81 100644
--- a/Utilities/cm_jsoncpp_reader.h
+++ b/Utilities/cm_jsoncpp_reader.h
@@ -13,6 +13,11 @@
#define cm_jsoncpp_reader_h
/* Use the jsoncpp library configured for CMake. */
-#include <cmjsoncpp/include/json/reader.h>
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/reader.h>
+#else
+# include <cmjsoncpp/include/json/reader.h>
+#endif
#endif
diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h
index 15e1088..b4cf620 100644
--- a/Utilities/cm_jsoncpp_value.h
+++ b/Utilities/cm_jsoncpp_value.h
@@ -13,6 +13,11 @@
#define cm_jsoncpp_value_h
/* Use the jsoncpp library configured for CMake. */
-#include <cmjsoncpp/include/json/value.h>
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/value.h>
+#else
+# include <cmjsoncpp/include/json/value.h>
+#endif
#endif
diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h
index c410369..c99a0d0 100644
--- a/Utilities/cm_jsoncpp_writer.h
+++ b/Utilities/cm_jsoncpp_writer.h
@@ -13,6 +13,11 @@
#define cm_jsoncpp_writer_h
/* Use the jsoncpp library configured for CMake. */
-#include <cmjsoncpp/include/json/writer.h>
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/writer.h>
+#else
+# include <cmjsoncpp/include/json/writer.h>
+#endif
#endif
-----------------------------------------------------------------------
Summary of changes:
CMakeLists.txt | 23 ++++++++++++++++++++---
Source/CMakeLists.txt | 2 +-
Utilities/cmThirdParty.h.in | 1 +
Utilities/cm_jsoncpp_reader.h | 7 ++++++-
Utilities/cm_jsoncpp_value.h | 7 ++++++-
Utilities/cm_jsoncpp_writer.h | 7 ++++++-
6 files changed, 40 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list