[Cmake-commits] CMake branch, next, updated. v3.4.1-1788-g50e3373
Brad King
brad.king at kitware.com
Fri Dec 18 10:07:37 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 50e3373bfe154b3fd37d9e74f728552a1c012bfc (commit)
via a5dd0c9d427d66f7e361b0aa714a0a41b65ae4f0 (commit)
from 22504521bd226abdb85db22fb036dea49d9816e0 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50e3373bfe154b3fd37d9e74f728552a1c012bfc
commit 50e3373bfe154b3fd37d9e74f728552a1c012bfc
Merge: 2250452 a5dd0c9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 18 10:07:37 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 18 10:07:37 2015 -0500
Merge topic 'import-kwiml' into next
a5dd0c9d Add option to use a system-installed KWIML
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5dd0c9d427d66f7e361b0aa714a0a41b65ae4f0
commit a5dd0c9d427d66f7e361b0aa714a0a41b65ae4f0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 18 09:57:55 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 18 10:02:28 2015 -0500
Add option to use a system-installed KWIML
Do not activate it with the general use-system-libs options for now
because KWIML is not commonly distributed or available.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 932d07e..9381f35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,8 +138,13 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
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}")
+ # For now use system KWIML only if explicitly requested rather
+ # than activating via the general system libs options.
+ option(CMAKE_USE_SYSTEM_KWIML "Use system-installed KWIML" OFF)
+ mark_as_advanced(CMAKE_USE_SYSTEM_KWIML)
+
# Mention to the user what system libraries are being used.
- foreach(util ${UTILITIES})
+ foreach(util ${UTILITIES} KWIML)
if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}")
endif()
@@ -270,6 +275,20 @@ macro (CMAKE_BUILD_UTILITIES)
# (a macro defined in this file)
CMAKE_HANDLE_SYSTEM_LIBRARIES()
+ if(CMAKE_USE_SYSTEM_KWIML)
+ find_package(KWIML 1.0)
+ if(NOT KWIML_FOUND)
+ message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
+ endif()
+ set(CMake_KWIML_LIBRARIES kwiml::kwiml)
+ else()
+ set(CMake_KWIML_LIBRARIES "")
+ if(BUILD_TESTING)
+ set(KWIML_TEST_ENABLE 1)
+ endif()
+ add_subdirectory(Utilities/KWIML)
+ endif()
+
#---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest.
set(CMAKE_ZLIB_HEADER "cm_zlib.h")
@@ -538,10 +557,10 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
endif()
-if(BUILD_TESTING)
+if(CMake_TEST_EXTERNAL_CMAKE)
set(KWIML_TEST_ENABLE 1)
+ add_subdirectory(Utilities/KWIML)
endif()
-add_subdirectory(Utilities/KWIML)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# build the utilities (a macro defined in this file)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index f23331b..ab70568 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -566,6 +566,7 @@ target_link_libraries(CMakeLib cmsys
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
${CMAKE_CURL_LIBRARIES}
${CMAKE_JSONCPP_LIBRARIES}
+ ${CMake_KWIML_LIBRARIES}
)
# On Apple we need CoreFoundation
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index 0cb6809..4c1177c 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -15,6 +15,7 @@
/* Whether CMake is using its own utility libraries. */
#cmakedefine CMAKE_USE_SYSTEM_CURL
#cmakedefine CMAKE_USE_SYSTEM_EXPAT
+#cmakedefine CMAKE_USE_SYSTEM_KWIML
#cmakedefine CMAKE_USE_SYSTEM_ZLIB
#cmakedefine CMAKE_USE_SYSTEM_BZIP2
#cmakedefine CMAKE_USE_SYSTEM_LIBARCHIVE
diff --git a/Utilities/cm_kwiml.h b/Utilities/cm_kwiml.h
index 2e1a108..ab2b80b 100644
--- a/Utilities/cm_kwiml.h
+++ b/Utilities/cm_kwiml.h
@@ -12,7 +12,14 @@
#ifndef cm_kwiml_h
#define cm_kwiml_h
-#include "KWIML/include/kwiml/abi.h"
-#include "KWIML/include/kwiml/int.h"
+/* Use the KWIML library configured for CMake. */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_KWIML
+# include <kwiml/abi.h>
+# include <kwiml/int.h>
+#else
+# include "KWIML/include/kwiml/abi.h"
+# include "KWIML/include/kwiml/int.h"
+#endif
#endif
diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt
index 1c863f8..d0114e7 100644
--- a/Utilities/cmjsoncpp/CMakeLists.txt
+++ b/Utilities/cmjsoncpp/CMakeLists.txt
@@ -23,3 +23,4 @@ include_directories(
)
add_library(cmjsoncpp ${JSONCPP_SOURCES})
+target_link_libraries(cmjsoncpp ${CMake_KWIML_LIBRARIES})
diff --git a/bootstrap b/bootstrap
index 860b5e4..9e30363 100755
--- a/bootstrap
+++ b/bootstrap
@@ -450,6 +450,18 @@ cmake_error()
exit ${res}
}
+cmake_generate_file ()
+{
+ OUTFILE="$1"
+ CONTENT="$2"
+ echo "$CONTENT" > "$OUTFILE.tmp"
+ if "${_diff}" "$OUTFILE.tmp" "$OUTFILE" > /dev/null 2> /dev/null ; then
+ rm -f "$OUTFILE.tmp"
+ else
+ mv -f "$OUTFILE.tmp" "$OUTFILE"
+ fi
+}
+
# Replace KWSYS_NAMESPACE with cmsys
cmake_replace_string ()
{
@@ -1270,6 +1282,8 @@ for a in ${KWSYS_FILES}; do
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
done
+cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" ""
+
# Generate Makefile
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
objs=""
-----------------------------------------------------------------------
Summary of changes:
CMakeLists.txt | 25 ++++++++++++++++++++++---
Source/CMakeLists.txt | 1 +
Utilities/cmThirdParty.h.in | 1 +
Utilities/cm_kwiml.h | 11 +++++++++--
Utilities/cmjsoncpp/CMakeLists.txt | 1 +
bootstrap | 14 ++++++++++++++
6 files changed, 48 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list