summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Docs/cmake-mode.el1
-rw-r--r--Modules/CMakeCCompiler.cmake.in1
-rw-r--r--Modules/CMakeCCompilerId.c.in86
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in1
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in86
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake18
-rw-r--r--Modules/CMakePlatformId.h.in40
-rw-r--r--Modules/CPackRPM.cmake19
-rw-r--r--Modules/CheckSymbolExists.cmake2
-rw-r--r--Modules/ExternalProject.cmake3
-rw-r--r--Modules/FindCURL.cmake19
-rw-r--r--Modules/FindCups.cmake65
-rw-r--r--Modules/FindEXPAT.cmake24
-rw-r--r--Modules/FindFLEX.cmake6
-rw-r--r--Modules/FindGit.cmake17
-rw-r--r--Modules/FindGnuTLS.cmake9
-rw-r--r--Modules/FindJasper.cmake30
-rw-r--r--Modules/FindLibXml2.cmake14
-rw-r--r--Modules/FindLibXslt.cmake2
-rw-r--r--Modules/FindMPI.cmake2
-rw-r--r--Modules/FindOpenSSL.cmake46
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake6
-rw-r--r--Modules/FindPkgConfig.cmake6
-rw-r--r--Modules/FindProtobuf.cmake13
-rw-r--r--Modules/FindPythonInterp.cmake55
-rw-r--r--Modules/FindPythonLibs.cmake7
-rw-r--r--Modules/FindThreads.cmake47
-rw-r--r--Modules/GetPrerequisites.cmake29
-rw-r--r--Source/cmArchiveWrite.cxx10
-rw-r--r--Source/cmComputeLinkDepends.cxx22
-rw-r--r--Source/cmComputeLinkDepends.h4
-rw-r--r--Source/cmDocumentVariables.cxx9
-rw-r--r--Source/cmIfCommand.cxx1
-rw-r--r--Source/cmInstallCommand.cxx196
-rw-r--r--Source/cmInstallCommand.h4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/BundleUtilities/CMakeLists.txt49
-rw-r--r--Tests/BundleUtilities/testbundleutils3.cpp33
-rw-r--r--Tests/CMakeCommands/target_link_libraries/depC.cpp2
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt39
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt18
-rw-r--r--Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt62
-rw-r--r--Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt51
-rw-r--r--Tests/CMakeOnly/CheckSymbolExists/cm_cse.h6
-rw-r--r--Tests/CMakeOnly/LinkInterfaceLoop/CMakeLists.txt27
-rw-r--r--Tests/CMakeOnly/LinkInterfaceLoop/lib.c1
-rw-r--r--Tests/CMakeOnly/LinkInterfaceLoop/main.c1
-rw-r--r--Tests/CMakeOnly/Test.cmake.in12
-rw-r--r--Tests/CMakeTests/If-Invalid-Argument.cmake2
-rw-r--r--Tests/CMakeTests/IfTest.cmake.in8
-rw-r--r--Tests/LoadCommand/CMakeCommands/CMakeLists.txt3
-rw-r--r--Tests/LoadCommand/CMakeLists.txt6
-rw-r--r--Tests/LoadCommand/LoadedCommand.h.in6
-rw-r--r--Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp2
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/main.cpp2
-rw-r--r--Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp2
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/main.cpp2
-rw-r--r--Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp2
-rw-r--r--Tests/SystemInformation/SystemInformation.in4
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake4
-rw-r--r--Utilities/cmThirdParty.h.in1
-rw-r--r--Utilities/cm_bzlib.h23
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c2
-rwxr-xr-xbootstrap94
71 files changed, 1075 insertions, 304 deletions
diff --git a/Docs/cmake-mode.el b/Docs/cmake-mode.el
index 2f51f83..4418bfa 100644
--- a/Docs/cmake-mode.el
+++ b/Docs/cmake-mode.el
@@ -99,6 +99,7 @@ set the path with these commands:
(setq region (buffer-substring-no-properties (point) point-start))
(while (and (not (bobp))
(or (looking-at cmake-regex-blank)
+ (cmake-line-starts-inside-string)
(not (and (string-match cmake-regex-indented region)
(= (length region) (match-end 0))))))
(forward-line -1)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 04a5cec..b14cf34 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -1,6 +1,7 @@
SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
+SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 4cc690a..b0f5eb6 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -2,27 +2,62 @@
# error "A C++ compiler has been selected for C."
#endif
+/* Version number components: V=Version, R=Revision, P=Patch
+ Version date components: YYYY=Year, MM=Month, DD=Day */
+
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+ /* __INTEL_COMPILER = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
+# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
#elif defined(__clang__)
# define COMPILER_ID "Clang"
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
+ /* __BORLANDC__ = 0xVRR */
+# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
+# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
#elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro"
+# if __SUNPRO_C >= 0x5100
+ /* __SUNPRO_C = 0xVRRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# else
+ /* __SUNPRO_C = 0xVRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# endif
#elif defined(__HP_cc)
# define COMPILER_ID "HP"
+ /* __HP_cc = VVRRPP */
+# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
+# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
+# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
#elif defined(__DECC)
# define COMPILER_ID "Compaq"
@@ -30,14 +65,25 @@
#elif defined(__IBMC__)
# if defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
-# elif __IBMC__ >= 800
-# define COMPILER_ID "XL"
# else
-# define COMPILER_ID "VisualAge"
+# if __IBMC__ >= 800
+# define COMPILER_ID "XL"
+# else
+# define COMPILER_ID "VisualAge"
+# endif
+ /* __IBMC__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
+# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
+# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
@@ -56,9 +102,29 @@
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
+# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
+# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
+ /* _MSC_VER = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+ /* _MSC_FULL_VER = VVRRPPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+ /* _MSC_FULL_VER = VVRRPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
@@ -78,6 +144,17 @@
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
+# if defined(_SGI_COMPILER_VERSION)
+ /* _SGI_COMPILER_VERSION = VRP */
+# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
+# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
+# else
+ /* _COMPILER_VERSION = VRP */
+# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
+# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
+# endif
/* This compiler is either not known or is too old to define an
identification macro. Try to identify the platform and guess that
@@ -112,6 +189,9 @@ int main(int argc, char* argv[])
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
+#ifdef COMPILER_VERSION_MAJOR
+ require += info_version[argc];
+#endif
(void)argv;
return require;
}
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index ea06526..bc3bc2e 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -1,6 +1,7 @@
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
+SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 4c8f497..927f7f4 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -5,26 +5,61 @@
# error "A C compiler has been selected for C++."
#endif
+/* Version number components: V=Version, R=Revision, P=Patch
+ Version date components: YYYY=Year, MM=Month, DD=Day */
+
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+ /* __INTEL_COMPILER = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# if defined(__INTEL_COMPILER_BUILD_DATE)
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
+# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# endif
#elif defined(__clang__)
# define COMPILER_ID "Clang"
+# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
+# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
+# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
+ /* __BORLANDC__ = 0xVRR */
+# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
+# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
+# if __SUNPRO_CC >= 0x5100
+ /* __SUNPRO_CC = 0xVRRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# else
+ /* __SUNPRO_CC = 0xVRP */
+# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
+# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
+# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# endif
#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
+ /* __HP_aCC = VVRRPP */
+# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
+# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
+# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
@@ -32,14 +67,25 @@
#elif defined(__IBMCPP__)
# if defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
-# elif __IBMCPP__ >= 800
-# define COMPILER_ID "XL"
# else
-# define COMPILER_ID "VisualAge"
+# if __IBMCPP__ >= 800
+# define COMPILER_ID "XL"
+# else
+# define COMPILER_ID "VisualAge"
+# endif
+ /* __IBMCPP__ = VRP */
+# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
+# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
# endif
#elif defined(__PGI)
# define COMPILER_ID "PGI"
+# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
+# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# if defined(__PGIC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
@@ -55,9 +101,29 @@
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
+# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
+# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# endif
#elif defined(_MSC_VER)
# define COMPILER_ID "MSVC"
+ /* _MSC_VER = VVRR */
+# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
+# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# if defined(_MSC_FULL_VER)
+# if _MSC_VER >= 1400
+ /* _MSC_FULL_VER = VVRRPPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# else
+ /* _MSC_FULL_VER = VVRRPPPP */
+# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# endif
+# endif
+# if defined(_MSC_BUILD)
+# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# endif
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
@@ -66,6 +132,17 @@
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
+# if defined(_SGI_COMPILER_VERSION)
+ /* _SGI_COMPILER_VERSION = VRP */
+# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
+# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
+# else
+ /* _COMPILER_VERSION = VRP */
+# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
+# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
+# endif
/* This compiler is either not known or is too old to define an
identification macro. Try to identify the platform and guess that
@@ -96,6 +173,9 @@ int main(int argc, char* argv[])
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
+#ifdef COMPILER_VERSION_MAJOR
+ require += info_version[argc];
+#endif
(void)argv;
return require;
}
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index b160dee..686cc9b 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -55,8 +55,13 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Display the final identification result.
IF(CMAKE_${lang}_COMPILER_ID)
+ IF(CMAKE_${lang}_COMPILER_VERSION)
+ SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
+ ELSE()
+ SET(_version "")
+ ENDIF()
MESSAGE(STATUS "The ${lang} compiler identification is "
- "${CMAKE_${lang}_COMPILER_ID}")
+ "${CMAKE_${lang}_COMPILER_ID}${_version}")
ELSE(CMAKE_${lang}_COMPILER_ID)
MESSAGE(STATUS "The ${lang} compiler identification is unknown")
ENDIF(CMAKE_${lang}_COMPILER_ID)
@@ -65,6 +70,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
+ SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
#-----------------------------------------------------------------------------
@@ -177,9 +183,10 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
IF(NOT CMAKE_${lang}_COMPILER_ID)
# Read the compiler identification string from the executable file.
SET(COMPILER_ID)
+ SET(COMPILER_VERSION)
SET(PLATFORM_ID)
FILE(STRINGS ${file}
- CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 3 REGEX "INFO:")
+ CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
@@ -197,6 +204,11 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
+ IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
+ STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
+ STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+ STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
+ ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
ENDFOREACH(info)
# Check if a valid compiler and platform were found.
@@ -204,6 +216,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
+ SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
# Check the compiler identification string.
@@ -251,6 +264,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
+ SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index cb3f40a..b69bf63 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -105,6 +105,46 @@
# define ARCHITECTURE_ID ""
#endif
+/* Convert integer to decimal digit literals. */
+#define DEC(n) \
+ ('0' + (((n) / 10000000)%10)), \
+ ('0' + (((n) / 1000000)%10)), \
+ ('0' + (((n) / 100000)%10)), \
+ ('0' + (((n) / 10000)%10)), \
+ ('0' + (((n) / 1000)%10)), \
+ ('0' + (((n) / 100)%10)), \
+ ('0' + (((n) / 10)%10)), \
+ ('0' + ((n) % 10))
+
+/* Convert integer to hex digit literals. */
+#define HEX(n) \
+ ('0' + ((n)>>28 & 0xF)), \
+ ('0' + ((n)>>24 & 0xF)), \
+ ('0' + ((n)>>20 & 0xF)), \
+ ('0' + ((n)>>16 & 0xF)), \
+ ('0' + ((n)>>12 & 0xF)), \
+ ('0' + ((n)>>8 & 0xF)), \
+ ('0' + ((n)>>4 & 0xF)), \
+ ('0' + ((n) & 0xF))
+
+/* Construct a string literal encoding the version number components. */
+#ifdef COMPILER_VERSION_MAJOR
+char const info_version[] = {
+ 'I', 'N', 'F', 'O', ':',
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
+ COMPILER_VERSION_MAJOR,
+# ifdef COMPILER_VERSION_MINOR
+ '.', COMPILER_VERSION_MINOR,
+# ifdef COMPILER_VERSION_PATCH
+ '.', COMPILER_VERSION_PATCH,
+# ifdef COMPILER_VERSION_TWEAK
+ '.', COMPILER_VERSION_TWEAK,
+# endif
+# endif
+# endif
+ ']','\0'};
+#endif
+
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index bf476ad..e1e76ed 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -714,6 +714,25 @@ else()
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
+# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
+# This is necessary to avoid duplicate files since rpmbuild do
+# recursion on its own when encountering a pathname which is a directory
+# which is not flagged as %dir
+string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
+string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST
+ "${CPACK_RPM_INSTALL_FILES_LIST}")
+string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST
+ "${CPACK_RPM_INSTALL_FILES_LIST}")
+set(CPACK_RPM_INSTALL_FILES "")
+foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
+ if(IS_DIRECTORY "${WDIR}/${F}")
+ set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}%dir \"${F}\"\n")
+ else()
+ set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
+ endif()
+endforeach(F)
+set(CPACK_RPM_INSTALL_FILES_LIST "")
+
# The name of the final spec file to be used by rpmbuild
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 183b2bb..515319d 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -60,7 +60,7 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
ENDFOREACH(FILE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT
- "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n")
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef ${SYMBOL}\n return ((int*)(&${SYMBOL}))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n")
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY IMMEDIATE)
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index a37771b..fb55d3b 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -144,7 +144,7 @@
# set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
#=============================================================================
-# Copyright 2008-2009 Kitware, Inc.
+# Copyright 2008-2012 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -954,6 +954,7 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var)
execute_process(
COMMAND "${git_EXECUTABLE}" --version
OUTPUT_VARIABLE ov
+ ERROR_VARIABLE ev
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}")
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 36f3841..517638a 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -1,12 +1,14 @@
# - Find curl
# Find the native CURL headers and libraries.
#
-# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
-# CURL_LIBRARIES - List of libraries when using curl.
-# CURL_FOUND - True if curl found.
+# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# CURL_LIBRARIES - List of libraries when using curl.
+# CURL_FOUND - True if curl found.
+# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -32,10 +34,19 @@ FIND_LIBRARY(CURL_LIBRARY NAMES
)
MARK_AS_ADVANCED(CURL_LIBRARY)
+IF(CURL_INCLUDE_DIR AND EXISTS "${CURL_INCLUDE_DIR}/curl/curlver.h")
+ FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/curlver.h" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
+
+ STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
+ UNSET(curl_version_str)
+ENDIF()
+
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
+ REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
+ VERSION_VAR CURL_VERSION_STRING)
IF(CURL_FOUND)
SET(CURL_LIBRARIES ${CURL_LIBRARY})
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 7e3e10a..3862f7d 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -4,12 +4,14 @@
# CUPS_FOUND - system has Cups
# CUPS_INCLUDE_DIR - the Cups include directory
# CUPS_LIBRARIES - Libraries needed to use Cups
+# CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
# Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
# features this function (i.e. at least 1.1.19)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -21,36 +23,47 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-INCLUDE(CheckLibraryExists)
+find_path(CUPS_INCLUDE_DIR cups/cups.h )
-FIND_PATH(CUPS_INCLUDE_DIR cups/cups.h )
+find_library(CUPS_LIBRARIES NAMES cups )
-FIND_LIBRARY(CUPS_LIBRARIES NAMES cups )
+if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+ include(CheckLibraryExists)
-IF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
- SET(CUPS_FOUND TRUE)
+ # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
+ CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
+endif (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
- # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint)
- CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE)
- IF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
- SET(CUPS_FOUND FALSE)
- ENDIF (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE AND NOT CUPS_HAS_IPP_DELETE_ATTRIBUTE)
+if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
+ file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str
+ REGEX "^#[\t ]*define[\t ]+CUPS_VERSION_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
-ELSE (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
- SET(CUPS_FOUND FALSE)
-ENDIF (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES)
+ unset(CUPS_VERSION_STRING)
+ foreach(VPART MAJOR MINOR PATCH)
+ foreach(VLINE ${cups_version_str})
+ if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}")
+ string(REGEX REPLACE "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$" "\\1"
+ CUPS_VERSION_PART "${VLINE}")
+ if(CUPS_VERSION_STRING)
+ set(CUPS_VERSION_STRING "${CUPS_VERSION_STRING}.${CUPS_VERSION_PART}")
+ else(CUPS_VERSION_STRING)
+ set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}")
+ endif(CUPS_VERSION_STRING)
+ endif()
+ endforeach(VLINE)
+ endforeach(VPART)
+endif (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h")
-IF (CUPS_FOUND)
- IF (NOT Cups_FIND_QUIETLY)
- MESSAGE(STATUS "Found Cups: ${CUPS_LIBRARIES}")
- ENDIF (NOT Cups_FIND_QUIETLY)
-ELSE (CUPS_FOUND)
- SET(CUPS_LIBRARIES )
- IF (Cups_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could NOT find Cups")
- ENDIF (Cups_FIND_REQUIRED)
-ENDIF (CUPS_FOUND)
-
-
-MARK_AS_ADVANCED(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
+ REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE
+ VERSION_VAR CUPS_VERSION_STRING)
+else (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups
+ REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR
+ VERSION_VAR CUPS_VERSION_STRING)
+endif (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE)
+mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 8551fd6..1bf0743 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -24,10 +24,32 @@ FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
# Look for the library.
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
+if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+ file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
+ REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$")
+
+ unset(EXPAT_VERSION_STRING)
+ foreach(VPART MAJOR MINOR MICRO)
+ foreach(VLINE ${expat_version_str})
+ if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION")
+ string(REGEX REPLACE "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$" "\\1"
+ EXPAT_VERSION_PART "${VLINE}")
+ if(EXPAT_VERSION_STRING)
+ set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
+ else(EXPAT_VERSION_STRING)
+ set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
+ endif(EXPAT_VERSION_STRING)
+ endif()
+ endforeach(VLINE)
+ endforeach(VPART)
+endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
+ REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
+ VERSION_VAR EXPAT_VERSION_STRING)
# Copy the results to the output variables.
IF(EXPAT_FOUND)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 6a70b40..586f77a 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -91,8 +91,12 @@ IF(FLEX_EXECUTABLE)
MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
ENDIF()
ELSE()
- STRING(REGEX REPLACE "^flex (.*)$" "\\1"
+ # older versions of flex printed "/full/path/to/executable version X.Y"
+ # newer versions use "basename(executable) X.Y"
+ GET_FILENAME_COMPONENT(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
+ STRING(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2"
FLEX_VERSION "${FLEX_version_output}")
+ UNSET(FLEX_EXE_NAME)
ENDIF()
#============================================================
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index 503b640..f89d1af 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -1,6 +1,7 @@
# The module defines the following variables:
# GIT_EXECUTABLE - path to git command line client
# GIT_FOUND - true if the command line client was found
+# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
# Example usage:
# find_package(Git)
# if(GIT_FOUND)
@@ -9,6 +10,7 @@
#=============================================================================
# Copyright 2010 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -40,8 +42,21 @@ find_program(GIT_EXECUTABLE
)
mark_as_advanced(GIT_EXECUTABLE)
+if(GIT_EXECUTABLE)
+ execute_process(COMMAND ${GIT_EXECUTABLE} --version
+ OUTPUT_VARIABLE git_version
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (git_version MATCHES "^git version [0-9]")
+ string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
+ endif()
+ unset(git_version)
+endif(GIT_EXECUTABLE)
+
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
+find_package_handle_standard_args(Git
+ REQUIRED_VARS GIT_EXECUTABLE
+ VERSION_VAR GIT_VERSION_STRING)
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index a437a1f..02f2964 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -35,9 +35,10 @@ IF (NOT WIN32)
# try using pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
# also fills in GNUTLS_DEFINITIONS, although that isn't normally useful
- FIND_PACKAGE(PkgConfig)
- PKG_CHECK_MODULES(PC_GNUTLS gnutls)
+ FIND_PACKAGE(PkgConfig QUIET)
+ PKG_CHECK_MODULES(PC_GNUTLS QUIET gnutls)
SET(GNUTLS_DEFINITIONS ${PC_GNUTLS_CFLAGS_OTHER})
+ SET(GNUTLS_VERSION_STRING ${PC_GNUTLS_VERSION})
ENDIF (NOT WIN32)
FIND_PATH(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
@@ -57,7 +58,9 @@ MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS
+ REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR
+ VERSION_VAR GNUTLS_VERSION_STRING)
IF(GNUTLS_FOUND)
SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARY})
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index bae4c05..48e2736 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -3,11 +3,13 @@
#
# JASPER_FOUND - system has Jasper
# JASPER_INCLUDE_DIR - the Jasper include directory
-# JASPER_LIBRARIES - The libraries needed to use Jasper
+# JASPER_LIBRARIES - the libraries needed to use Jasper
+# JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -19,19 +21,33 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PACKAGE(JPEG)
-
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
-FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper)
+IF (NOT JASPER_LIBRARIES)
+ FIND_PACKAGE(JPEG)
+
+ FIND_LIBRARY(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
+ FIND_LIBRARY(JASPER_LIBRARY_DEBUG NAMES japserd)
+
+ INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ SELECT_LIBRARY_CONFIGURATIONS(JASPER)
+ENDIF (NOT JASPER_LIBRARIES)
+
+IF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
+ FILE(STRINGS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" jasper_version_str REGEX "^#define[\t ]+JAS_VERSION[\t ]+\".*\".*")
+
+ STRING(REGEX REPLACE "^#define[\t ]+JAS_VERSION[\t ]+\"([^\"]+)\".*" "\\1" JASPER_VERSION_STRING "${jasper_version_str}")
+ENDIF (JASPER_INCLUDE_DIR AND EXISTS "${JASPER_INCLUDE_DIR}/jasper/jas_config.h")
# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper DEFAULT_MSG JASPER_LIBRARY JASPER_INCLUDE_DIR JPEG_LIBRARIES)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper
+ REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
+ VERSION_VAR JASPER_VERSION_STRING)
IF (JASPER_FOUND)
- SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
+ SET(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES} )
ENDIF (JASPER_FOUND)
-MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARY)
+MARK_AS_ADVANCED(JASPER_INCLUDE_DIR)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 95ae180..a797b12 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -6,6 +6,7 @@
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
+# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -23,8 +24,8 @@
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBXML libxml-2.0 QUIET)
+FIND_PACKAGE(PkgConfig QUIET)
+PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
@@ -47,7 +48,12 @@ SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
+ REQUIRED_VARS LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR
+ VERSION_VAR PC_LIBXML_VERSION)
-MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+IF(LIBXML2_FOUND)
+ SET(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
+ENDIF()
+MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index 1f49c3b..1e42f42 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -25,7 +25,7 @@
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
-FIND_PACKAGE(PkgConfig)
+FIND_PACKAGE(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 250d8a6..1be4ccf 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -413,7 +413,7 @@ function (interrogate_mpi_compiler lang try_libs)
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
PATH_SUFFIXES lib)
if (MPI_LIBRARIES_WORK AND MPI_LIB)
- set(MPI_LIBRARIES_WORK "${MPI_LIBRARIES_WORK} ${MPI_LIB}")
+ list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
endif()
endif()
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index af799d6..59efe4b 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -7,7 +7,7 @@
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
-# OPENSSL_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
+# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -25,10 +25,8 @@
# License text for the above reference.)
if (UNIX)
- find_package(PkgConfig)
- if (PKG_CONFIG_FOUND)
- pkg_check_modules(_OPENSSL openssl)
- endif (PKG_CONFIG_FOUND)
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(_OPENSSL QUIET openssl)
endif (UNIX)
# http://www.slproweb.com/products/Win32OpenSSL.html
@@ -216,16 +214,40 @@ ELSE(WIN32 AND NOT CYGWIN)
ENDIF(WIN32 AND NOT CYGWIN)
if (OPENSSL_INCLUDE_DIR)
- file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*")
+ if (_OPENSSL_VERSION)
+ set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
+ elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
+ file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
+ REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
- string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" OPENSSL_VERSION_MAJOR "${openssl_version_str}")
- string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_MINOR "${openssl_version_str}")
- string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_PATCH "${openssl_version_str}")
+ # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
+ # The status gives if this is a developer or prerelease and is ignored here.
+ # Major, minor, and fix directly translate into the version numbers shown in
+ # the string. The patch field translates to the single character suffix that
+ # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
+ # on.
- string(REGEX REPLACE "^0" "" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
- string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}")
+ string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
+ "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
+ list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
+ list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
+ list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
+ list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
- set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}")
+ string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
+ string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_FIX "${OPENSSL_VERSION_FIX}")
+
+ if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+ # 96 is the ASCII code of 'a' minus 1
+ math(EXPR OPENSSL_VERSION_PATCH_ASCII "${OPENSSL_VERSION_PATCH} + 96")
+ # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
+ # this should be updated to handle that, too. This has not happened yet
+ # so it is simply ignored here for now.
+ string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
+ endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+
+ set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
+ endif (_OPENSSL_VERSION)
endif (OPENSSL_INCLUDE_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 1acb021..b503357 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -33,9 +33,9 @@
# messages include information about the required version and the version
# which has been actually found, both if the version is ok or not.
# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
-# a find_package(... NO_MODULE) call, in this case all the information
-# provided by the config-mode of find_package() will be evaluated
-# automatically.
+# a find_package(... NO_MODULE) call. In this case VERSION_VAR will be set
+# to <NAME>_VERSION and the macro will automatically check whether the
+# Config module was found.
# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
# used, the default message will be displayed.
#
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index c47f583..ce58899 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -85,14 +85,12 @@
### Common stuff ####
set(PKG_CONFIG_VERSION 1)
-set(PKG_CONFIG_FOUND 0)
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
-if(PKG_CONFIG_EXECUTABLE)
- set(PKG_CONFIG_FOUND 1)
-endif(PKG_CONFIG_EXECUTABLE)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(PkgConfig DEFAULT_MSG PKG_CONFIG_EXECUTABLE)
# Unsets the given variables
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 5344304..1e1e493 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -7,6 +7,9 @@
# (vsprojects/Debug & vsprojects/Release) will be searched
# for libraries and binaries.
#
+# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for
+# imported .proto files. (New in CMake 2.8.8)
+#
# Defines the following variables:
#
# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
@@ -91,6 +94,16 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
+ if(DEFINED PROTOBUF_IMPORT_DIRS)
+ foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+ get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
+ list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+ if(${_contains_already} EQUAL -1)
+ list(APPEND _protobuf_include_path -I ${ABS_PATH})
+ endif()
+ endforeach()
+ endif()
+
set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index a10ec23..d5a2a5e 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -26,14 +26,51 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+unset(_Python_NAMES)
+
+set(_PYTHON1_VERSIONS 1.6 1.5)
+set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
+set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
+
+if(PythonInterp_FIND_VERSION)
+ if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}")
+ string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
+ list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ})
+ unset(_PYTHON_FIND_OTHER_VERSIONS)
+ if(NOT PythonInterp_FIND_VERSION_EXACT)
+ foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
+ if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
+ list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
+ endif()
+ endforeach()
+ endif(NOT PythonInterp_FIND_VERSION_EXACT)
+ unset(_PYTHON_FIND_MAJ_MIN)
+ unset(_PYTHON_FIND_MAJ)
+ else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
+ endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+else(PythonInterp_FIND_VERSION)
+ set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+endif(PythonInterp_FIND_VERSION)
+
+list(APPEND _Python_NAMES python)
+
# Search for the current active python version first
-find_program(PYTHON_EXECUTABLE NAMES python)
+find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
# Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front.
set(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS}
- 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+
+unset(_PYTHON_FIND_OTHER_VERSIONS)
+unset(_PYTHON1_VERSIONS)
+unset(_PYTHON2_VERSIONS)
+unset(_PYTHON3_VERSIONS)
# Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE)
@@ -52,11 +89,15 @@ endif()
# determine python version string
if(PYTHON_EXECUTABLE)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" --version ERROR_VARIABLE _VERSION OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
- string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}")
- string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
- string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
- string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
-endif()
+ if(_VERSION MATCHES "^Python [0-9]+\\.[0-9]+.*")
+ string(REPLACE "Python " "" PYTHON_VERSION_STRING "${_VERSION}")
+ string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
+ if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
+ endif()
+ endif()
+endif(PYTHON_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index adcec46..da7a1ac 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -40,13 +40,17 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs )
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ )
ENDIF(WIN32)
FIND_LIBRARY(PYTHON_LIBRARY
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
# Avoid finding the .dll in the PATH. We want the .lib.
NO_SYSTEM_ENVIRONMENT_PATH
)
@@ -79,6 +83,7 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
PATHS
${PYTHON_FRAMEWORK_INCLUDES}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
PATH_SUFFIXES
python${_CURRENT_VERSION}
)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index a6c2df8..21614fb 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -23,6 +23,7 @@
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
+INCLUDE (CheckSymbolExists)
SET(Threads_FOUND FALSE)
# Do we have sproc?
@@ -44,33 +45,41 @@ ELSE()
#
SET(CMAKE_HAVE_THREADS_LIBRARY)
IF(NOT THREADS_HAVE_PTHREAD_ARG)
-
- # Do we have -lpthreads
- CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
- IF(CMAKE_HAVE_PTHREADS_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
+ # Check if pthread functions are in normal C library
+ CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
+ IF(CMAKE_HAVE_LIBC_CREATE)
+ SET(CMAKE_THREAD_LIBS_INIT "")
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
SET(Threads_FOUND TRUE)
ENDIF()
- # Ok, how about -lpthread
- CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
- IF(CMAKE_HAVE_PTHREAD_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
- SET(Threads_FOUND TRUE)
- SET(CMAKE_HAVE_THREADS_LIBRARY 1)
- ENDIF()
+ IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
+ # Do we have -lpthreads
+ CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
+ IF(CMAKE_HAVE_PTHREADS_CREATE)
+ SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
+ SET(CMAKE_HAVE_THREADS_LIBRARY 1)
+ SET(Threads_FOUND TRUE)
+ ENDIF()
- IF(CMAKE_SYSTEM MATCHES "SunOS.*")
- # On sun also check for -lthread
- CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
- IF(CMAKE_HAVE_THR_CREATE)
- SET(CMAKE_THREAD_LIBS_INIT "-lthread")
+ # Ok, how about -lpthread
+ CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
+ IF(CMAKE_HAVE_PTHREAD_CREATE)
+ SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
SET(CMAKE_HAVE_THREADS_LIBRARY 1)
SET(Threads_FOUND TRUE)
ENDIF()
- ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
+ IF(CMAKE_SYSTEM MATCHES "SunOS.*")
+ # On sun also check for -lthread
+ CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
+ IF(CMAKE_HAVE_THR_CREATE)
+ SET(CMAKE_THREAD_LIBS_INIT "-lthread")
+ SET(CMAKE_HAVE_THREADS_LIBRARY 1)
+ SET(Threads_FOUND TRUE)
+ ENDIF()
+ ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
+ ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
ENDIF(NOT THREADS_HAVE_PTHREAD_ARG)
IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
@@ -111,7 +120,7 @@ ELSE()
ENDIF(CMAKE_HAVE_PTHREAD_H)
ENDIF()
-IF(CMAKE_THREAD_LIBS_INIT)
+IF(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
ENDIF()
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 2efa079..8761f40 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -304,6 +304,26 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
endif(NOT resolved)
if(NOT resolved)
+ if(item MATCHES "@rpath")
+ #
+ # @rpath references are relative to the paths built into the binaries with -rpath
+ # We handle this case like we do for other Unixes
+ #
+ string(REPLACE "@rpath/" "" norpath_item "${item}")
+
+ set(ri "ri-NOTFOUND")
+ find_file(ri "${norpath_item}" ${exepath} ${dirs} NO_DEFAULT_PATH)
+ if(ri)
+ #message(STATUS "info: 'find_file' in exepath/dirs (${ri})")
+ set(resolved 1)
+ set(resolved_item "${ri}")
+ set(ri "ri-NOTFOUND")
+ endif(ri)
+
+ endif(item MATCHES "@rpath")
+ endif(NOT resolved)
+
+ if(NOT resolved)
set(ri "ri-NOTFOUND")
find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH)
find_file(ri "${item}" ${exepath} ${dirs} /usr/lib)
@@ -461,6 +481,15 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
get_filename_component(path "${lower}" PATH)
if("${original_path}" STREQUAL "${path}")
set(is_local 1)
+ else()
+ string(LENGTH "${original_path}/" original_length)
+ string(LENGTH "${lower}" path_length)
+ if(${path_length} GREATER ${original_length})
+ string(SUBSTRING "${lower}" 0 ${original_length} path)
+ if("${original_path}/" STREQUAL "${path}")
+ set(is_embedded 1)
+ endif()
+ endif()
endif()
endif()
endif()
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index eab8a59..dc6b749 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -247,10 +247,14 @@ bool cmArchiveWrite::AddFile(const char* file,
return false;
}
- // Content.
- if(size_t size = static_cast<size_t>(archive_entry_size(e)))
+ // do not copy content of symlink
+ if (!archive_entry_symlink(e))
{
- return this->AddData(file, size);
+ // Content.
+ if(size_t size = static_cast<size_t>(archive_entry_size(e)))
+ {
+ return this->AddData(file, size);
+ }
}
return true;
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 802cfcf..9a075bd 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -358,7 +358,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
this->AddLinkEntries(depender_index, iface->Libraries);
// Handle dependent shared libraries.
- this->QueueSharedDependencies(depender_index, iface->SharedDeps);
+ this->FollowSharedDeps(depender_index, iface);
// Support for CMP0003.
for(std::vector<std::string>::const_iterator
@@ -379,6 +379,23 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
//----------------------------------------------------------------------------
void
cmComputeLinkDepends
+::FollowSharedDeps(int depender_index, cmTarget::LinkInterface const* iface,
+ bool follow_interface)
+{
+ // Follow dependencies if we have not followed them already.
+ if(this->SharedDepFollowed.insert(depender_index).second)
+ {
+ if(follow_interface)
+ {
+ this->QueueSharedDependencies(depender_index, iface->Libraries);
+ }
+ this->QueueSharedDependencies(depender_index, iface->SharedDeps);
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+cmComputeLinkDepends
::QueueSharedDependencies(int depender_index,
std::vector<std::string> const& deps)
{
@@ -430,8 +447,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
entry.Target->GetLinkInterface(this->Config))
{
// Follow public and private dependencies transitively.
- this->QueueSharedDependencies(index, iface->Libraries);
- this->QueueSharedDependencies(index, iface->SharedDeps);
+ this->FollowSharedDeps(index, iface, true);
}
}
}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index e196e00..80a0454 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -105,6 +105,10 @@ private:
int DependerIndex;
};
std::queue<SharedDepEntry> SharedDepQueue;
+ std::set<int> SharedDepFollowed;
+ void FollowSharedDeps(int depender_index,
+ cmTarget::LinkInterface const* iface,
+ bool follow_interface = false);
void QueueSharedDependencies(int depender_index,
std::vector<std::string> const& deps);
void HandleSharedDependency(SharedDepEntry const& dep);
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index fe29df9..687debc 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1301,6 +1301,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables for Languages");
cm->DefineProperty
+ ("CMAKE_<LANG>_COMPILER_VERSION", cmProperty::VARIABLE,
+ "An internal variable subject to change.",
+ "Compiler version in major[.minor[.patch[.tweak]]] format. "
+ "This variable is reserved for internal use by CMake and is not "
+ "guaranteed to be set.",
+ false,
+ "Variables for Languages");
+
+ cm->DefineProperty
("CMAKE_INTERNAL_PLATFORM_ABI", cmProperty::VARIABLE,
"An internal variable subject to change.",
"This is used in determining the compiler ABI and is subject to change.",
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 22ba28f..4eed477 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -910,6 +910,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
if (newArgs.size() != 1)
{
errorString = "Unknown arguments specified";
+ status = cmake::FATAL_ERROR;
return false;
}
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 14deb24..dca528d 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -350,33 +350,33 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
targetIt!=targetList.GetVector().end();
++targetIt)
{
- // Lookup this target in the current directory.
- if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str()))
- {
- // Found the target. Check its type.
- if(target->GetType() != cmTarget::EXECUTABLE &&
- target->GetType() != cmTarget::STATIC_LIBRARY &&
- target->GetType() != cmTarget::SHARED_LIBRARY &&
- target->GetType() != cmTarget::MODULE_LIBRARY)
- {
- cmOStringStream e;
- e << "TARGETS given target \"" << (*targetIt)
- << "\" which is not an executable, library, or module.";
- this->SetError(e.str().c_str());
- return false;
- }
- // Store the target in the list to be installed.
- targets.push_back(target);
- }
- else
+ // Lookup this target in the current directory.
+ if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str()))
+ {
+ // Found the target. Check its type.
+ if(target->GetType() != cmTarget::EXECUTABLE &&
+ target->GetType() != cmTarget::STATIC_LIBRARY &&
+ target->GetType() != cmTarget::SHARED_LIBRARY &&
+ target->GetType() != cmTarget::MODULE_LIBRARY)
{
- // Did not find the target.
cmOStringStream e;
e << "TARGETS given target \"" << (*targetIt)
- << "\" which does not exist in this directory.";
+ << "\" which is not an executable, library, or module.";
this->SetError(e.str().c_str());
return false;
}
+ // Store the target in the list to be installed.
+ targets.push_back(target);
+ }
+ else
+ {
+ // Did not find the target.
+ cmOStringStream e;
+ e << "TARGETS given target \"" << (*targetIt)
+ << "\" which does not exist in this directory.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
}
// Keep track of whether we will be performing an installation of
@@ -602,98 +602,98 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
break;
}
- // These well-known sets of files are installed *automatically* for FRAMEWORK
- // SHARED library targets on the Mac as part of installing the FRAMEWORK.
- // For other target types or on other platforms, they are not installed
- // automatically and so we need to create install files generators for them.
- //
- bool createInstallGeneratorsForTargetFileSets = true;
-
- if(target.IsFrameworkOnApple())
- {
- createInstallGeneratorsForTargetFileSets = false;
- }
+ // These well-known sets of files are installed *automatically* for
+ // FRAMEWORK SHARED library targets on the Mac as part of installing the
+ // FRAMEWORK. For other target types or on other platforms, they are not
+ // installed automatically and so we need to create install files
+ // generators for them.
+ bool createInstallGeneratorsForTargetFileSets = true;
- if(createInstallGeneratorsForTargetFileSets && !namelinkOnly)
- {
- const char* files = target.GetProperty("PRIVATE_HEADER");
- if ((files) && (*files))
+ if(target.IsFrameworkOnApple())
{
- std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
- std::vector<std::string> absFiles;
- if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles))
- {
- return false;
- }
-
- // Create the files install generator.
- if (!privateHeaderArgs.GetDestination().empty())
- {
- privateHeaderGenerator = CreateInstallFilesGenerator(absFiles,
- privateHeaderArgs, false);
- }
- else
- {
- cmOStringStream e;
- e << "INSTALL TARGETS - target " << target.GetName() << " has "
- << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
- }
+ createInstallGeneratorsForTargetFileSets = false;
}
- files = target.GetProperty("PUBLIC_HEADER");
- if ((files) && (*files))
+ if(createInstallGeneratorsForTargetFileSets && !namelinkOnly)
{
- std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
- std::vector<std::string> absFiles;
- if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles))
+ const char* files = target.GetProperty("PRIVATE_HEADER");
+ if ((files) && (*files))
{
- return false;
- }
+ std::vector<std::string> relFiles;
+ cmSystemTools::ExpandListArgument(files, relFiles);
+ std::vector<std::string> absFiles;
+ if (!this->MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles))
+ {
+ return false;
+ }
- // Create the files install generator.
- if (!publicHeaderArgs.GetDestination().empty())
- {
- publicHeaderGenerator = CreateInstallFilesGenerator(absFiles,
- publicHeaderArgs, false);
- }
- else
- {
- cmOStringStream e;
- e << "INSTALL TARGETS - target " << target.GetName() << " has "
- << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
+ // Create the files install generator.
+ if (!privateHeaderArgs.GetDestination().empty())
+ {
+ privateHeaderGenerator =
+ CreateInstallFilesGenerator(absFiles, privateHeaderArgs, false);
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "INSTALL TARGETS - target " << target.GetName() << " has "
+ << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
+ cmSystemTools::Message(e.str().c_str(), "Warning");
+ }
}
- }
- files = target.GetProperty("RESOURCE");
- if ((files) && (*files))
- {
- std::vector<std::string> relFiles;
- cmSystemTools::ExpandListArgument(files, relFiles);
- std::vector<std::string> absFiles;
- if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles))
+ files = target.GetProperty("PUBLIC_HEADER");
+ if ((files) && (*files))
{
- return false;
- }
+ std::vector<std::string> relFiles;
+ cmSystemTools::ExpandListArgument(files, relFiles);
+ std::vector<std::string> absFiles;
+ if (!this->MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles))
+ {
+ return false;
+ }
- // Create the files install generator.
- if (!resourceArgs.GetDestination().empty())
- {
- resourceGenerator = CreateInstallFilesGenerator(absFiles,
- resourceArgs, false);
+ // Create the files install generator.
+ if (!publicHeaderArgs.GetDestination().empty())
+ {
+ publicHeaderGenerator =
+ CreateInstallFilesGenerator(absFiles, publicHeaderArgs, false);
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "INSTALL TARGETS - target " << target.GetName() << " has "
+ << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
+ cmSystemTools::Message(e.str().c_str(), "Warning");
+ }
}
- else
+
+ files = target.GetProperty("RESOURCE");
+ if ((files) && (*files))
{
- cmOStringStream e;
- e << "INSTALL TARGETS - target " << target.GetName() << " has "
- << "RESOURCE files but no RESOURCE DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
+ std::vector<std::string> relFiles;
+ cmSystemTools::ExpandListArgument(files, relFiles);
+ std::vector<std::string> absFiles;
+ if (!this->MakeFilesFullPath("RESOURCE", relFiles, absFiles))
+ {
+ return false;
+ }
+
+ // Create the files install generator.
+ if (!resourceArgs.GetDestination().empty())
+ {
+ resourceGenerator = CreateInstallFilesGenerator(absFiles,
+ resourceArgs, false);
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "INSTALL TARGETS - target " << target.GetName() << " has "
+ << "RESOURCE files but no RESOURCE DESTINATION.";
+ cmSystemTools::Message(e.str().c_str(), "Warning");
+ }
}
}
- }
// Keep track of whether we're installing anything in each category
installsArchive = installsArchive || archiveGenerator != 0;
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 8f62322..377b43a 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -168,9 +168,7 @@ public:
"On non-DLL platforms mySharedLib will be installed to <prefix>/lib "
"and /some/full/path. On DLL platforms the mySharedLib DLL will be "
"installed to <prefix>/bin and /some/full/path and its import library "
- "will be installed to <prefix>/lib/static and /some/full/path. "
- "On non-DLL platforms mySharedLib will be installed to <prefix>/lib "
- "and /some/full/path."
+ "will be installed to <prefix>/lib/static and /some/full/path."
"\n"
"The EXPORT option associates the installed target files with an "
"export called <export-name>. "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a219ae9..449adc1 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1490,7 +1490,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
imLib += targetNameImport;
linkOptions.AddFlag("ImportLibrary", imLib.c_str());
- linkOptions.AddFlag("ProgramDataBaseFileName", pdb.c_str());
+ linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str());
linkOptions.Parse(flags.c_str());
if(!this->ModuleDefinitionFile.empty())
{
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 6aae00f..764dc38 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012)
SET(KWSYS_DATE_STAMP_MONTH 01)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 10)
+SET(KWSYS_DATE_STAMP_DAY 25)
diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt
index 6209c8f..8f24afe 100644
--- a/Tests/BundleUtilities/CMakeLists.txt
+++ b/Tests/BundleUtilities/CMakeLists.txt
@@ -82,3 +82,52 @@ add_custom_target(testbundleutils2_test ALL
DEPENDS testbundleutils1 module2
)
add_dependencies(testbundleutils2_test testbundleutils2)
+
+
+if(APPLE AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 9.0)
+###### Test a Bundle application using dependencies
+###### and @rpaths on Mac OS X 10.5 or greater
+
+ # a shared library
+ add_library(shared-3 SHARED shared.cpp shared.h)
+
+ # another shared library
+ add_library(shared2-3 SHARED shared2.cpp shared2.h)
+
+ # a framework library
+ add_library(framework-3 SHARED framework.cpp framework.h)
+ set_target_properties(framework-3 PROPERTIES FRAMEWORK 1)
+
+ # build dependencies with @rpath install name
+ set_target_properties(shared-3 shared2-3 framework-3 PROPERTIES
+ INSTALL_NAME_DIR "@rpath"
+ BUILD_WITH_INSTALL_RPATH 1)
+
+ # a loadable module (depends on shared2)
+ # testbundleutils1 will load this at runtime
+ add_library(module3 MODULE module.cpp module.h)
+ set_target_properties(module3 PROPERTIES PREFIX "" LINK_FLAGS "-Wl,-rpath,@loader_path/")
+ get_target_property(module_loc module3 LOCATION)
+ target_link_libraries(module3 shared2-3)
+
+ # a non-bundle application
+ add_executable(testbundleutils3 testbundleutils3.cpp)
+ target_link_libraries(testbundleutils3 shared-3 framework-3 ${CMAKE_DL_LIBS})
+ get_target_property(loc testbundleutils3 LOCATION)
+
+ set_target_properties(testbundleutils3 module3 PROPERTIES
+ LINK_FLAGS "-Wl,-rpath,@loader_path/")
+
+ # add custom target to install and test the app
+ add_custom_target(testbundleutils3_test ALL
+ COMMAND ${CMAKE_COMMAND}
+ "-DINPUT=${loc}"
+ "-DMODULE=${module_loc}"
+ "-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
+ "-DOUTPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/testdir3"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake"
+ DEPENDS testbundleutils3 module3
+ )
+
+ add_dependencies(testbundleutils3_test testbundleutils3)
+endif()
diff --git a/Tests/BundleUtilities/testbundleutils3.cpp b/Tests/BundleUtilities/testbundleutils3.cpp
new file mode 100644
index 0000000..9df13e9
--- /dev/null
+++ b/Tests/BundleUtilities/testbundleutils3.cpp
@@ -0,0 +1,33 @@
+
+#include "framework.h"
+#include "shared.h"
+#include "stdio.h"
+
+#if defined(WIN32)
+#include <windows.h>
+#else
+#include "dlfcn.h"
+#endif
+
+int main(int, char**)
+{
+ framework();
+ shared();
+
+#if defined(WIN32)
+ HANDLE lib = LoadLibraryA("module3.dll");
+ if(!lib)
+ {
+ printf("Failed to open module3\n");
+ }
+#else
+ void* lib = dlopen("module3.so", RTLD_LAZY);
+ if(!lib)
+ {
+ printf("Failed to open module3\n%s\n", dlerror());
+ }
+#endif
+
+
+ return lib == 0 ? 1 : 0;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/depC.cpp b/Tests/CMakeCommands/target_link_libraries/depC.cpp
index 93410a8..60bed59 100644
--- a/Tests/CMakeCommands/target_link_libraries/depC.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/depC.cpp
@@ -10,4 +10,4 @@ DepA DepC::getA()
{
DepA a;
return a;
-} \ No newline at end of file
+}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 00c9ac7..badc76b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -47,6 +47,7 @@ IF(BUILD_TESTING)
ENDIF()
ADD_SUBDIRECTORY(CMakeLib)
+ ADD_SUBDIRECTORY(CMakeOnly)
ADD_SUBDIRECTORY(FindPackageModeMakefileTest)
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
new file mode 100644
index 0000000..8a38f06
--- /dev/null
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -0,0 +1,39 @@
+cmake_minimum_required (VERSION 2.8)
+project(AllFindModules)
+
+if (POLICY CMP0017)
+ cmake_policy(SET CMP0017 NEW)
+endif ()
+
+# Avoid ctest truncation of output
+message(STATUS "CTEST_FULL_OUTPUT")
+
+file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake" )
+
+macro(do_find MODULE_NAME)
+ message(STATUS " Checking Find${MODULE_NAME}")
+ find_package(${MODULE_NAME})
+endmacro(do_find)
+
+foreach(FIND_MODULE ${FIND_MODULES})
+ string(REGEX REPLACE ".*/Find(.*)\\.cmake$" "\\1" MODULE_NAME "${FIND_MODULE}")
+
+ # It is only possible to use either Qt3 or Qt4 in one project.
+ # Since FindQt will complain if both are found we explicitely
+ # filter out this and FindQt3. FindKDE3 also depends on Qt3 and
+ # is therefore also blocked
+
+ if (NOT MODULE_NAME STREQUAL "Qt" AND
+ NOT MODULE_NAME STREQUAL "Qt3" AND
+ NOT MODULE_NAME STREQUAL "KDE3")
+ do_find(${MODULE_NAME})
+ endif ()
+
+endforeach(FIND_MODULE)
+
+# Qt4 is not present, so we can check Qt3
+if(NOT QT4_FOUND)
+ foreach(FIND_MODULE "Qt3" "Qt" "KDE3")
+ do_find(${FIND_MODULE})
+ endforeach(FIND_MODULE)
+endif(NOT QT4_FOUND)
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
new file mode 100644
index 0000000..20e6a3a
--- /dev/null
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -0,0 +1,18 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Test.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake @ONLY)
+
+macro(add_CMakeOnly_test test)
+ add_test(CMakeOnly.${test} ${CMAKE_CMAKE_COMMAND}
+ -DTEST=${test}
+ -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
+ )
+endmacro()
+
+add_CMakeOnly_test(LinkInterfaceLoop)
+set_property(TEST CMakeOnly.LinkInterfaceLoop PROPERTY TIMEOUT 90)
+
+add_CMakeOnly_test(CheckSymbolExists)
+
+add_CMakeOnly_test(CheckCXXSymbolExists)
+
+add_CMakeOnly_test(AllFindModules)
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
new file mode 100644
index 0000000..1c978c1
--- /dev/null
+++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
@@ -0,0 +1,62 @@
+# This test will verify if CheckCXXSymbolExists only report symbols available
+# for linking that really are. You can find some documentation on this in
+# bug 11333 where we found out that gcc would optimize out the actual
+# reference to the symbol, so symbols that are in fact _not_ available in the
+# given libraries (but seen in header) were reported as present.
+#
+# If you change this test do not forget to change the CheckSymbolExists
+# test, too.
+
+PROJECT(CheckCXXSymbolExists CXX)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+
+SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists")
+
+INCLUDE(CheckCXXSymbolExists)
+
+foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
+ set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type})
+ unset(CSE_RESULT_${_config_type} CACHE)
+ MESSAGE(STATUS "Testing configuration ${_config_type}")
+ check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type})
+
+ IF (CSE_RESULT_${_config_type})
+ MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
+ ENDIF (CSE_RESULT_${_config_type})
+endforeach()
+
+set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+unset(CSE_RESULT_ERRNO_CERRNO CACHE)
+
+MESSAGE(STATUS "Checking <cerrno>")
+
+check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO_CERRNO)
+
+IF (NOT CSE_RESULT_ERRNO_CERRNO)
+ unset(CSE_RESULT_ERRNO_ERRNOH CACHE)
+
+ MESSAGE(STATUS "Checking <errno.h>")
+
+ check_cxx_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO_ERRNOH)
+
+ IF (NOT CSE_RESULT_ERRNO_ERRNOH)
+ MESSAGE(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>")
+ ELSE (NOT CSE_RESULT_ERRNO_ERRNOH)
+ MESSAGE(STATUS "errno found in <errno.h>")
+ ENDIF (NOT CSE_RESULT_ERRNO_ERRNOH)
+ELSE (NOT CSE_RESULT_ERRNO_CERRNO)
+ MESSAGE(STATUS "errno found in <cerrno>")
+ENDIF (NOT CSE_RESULT_ERRNO_CERRNO)
+
+IF (CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ unset(CSE_RESULT_O3 CACHE)
+ MESSAGE(STATUS "Testing with optimization -O3")
+
+ check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3)
+
+ IF (CSE_RESULT_O3)
+ MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3")
+ ENDIF (CSE_RESULT_O3)
+ENDIF (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
new file mode 100644
index 0000000..7c969d3
--- /dev/null
+++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
@@ -0,0 +1,51 @@
+# This test will verify if CheckSymbolExists only report symbols available
+# for linking that really are. You can find some documentation on this in
+# bug 11333 where we found out that gcc would optimize out the actual
+# reference to the symbol, so symbols that are in fact _not_ available in the
+# given libraries (but seen in header) were reported as present.
+#
+# If you change this test do not forget to change the CheckCXXSymbolExists
+# test, too.
+
+PROJECT(CheckSymbolExists C)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+
+SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+INCLUDE(CheckSymbolExists)
+
+foreach(_config_type Release RelWithDebInfo MinSizeRel Debug)
+ set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type})
+ unset(CSE_RESULT_${_config_type} CACHE)
+ MESSAGE(STATUS "Testing configuration ${_config_type}")
+
+ check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type})
+
+ IF (CSE_RESULT_${_config_type})
+ MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}")
+ ENDIF (CSE_RESULT_${_config_type})
+endforeach()
+
+set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+unset(CSE_RESULT_ERRNO CACHE)
+
+check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO)
+
+IF (NOT CSE_RESULT_ERRNO)
+ MESSAGE(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>")
+ELSE (NOT CSE_RESULT_ERRNO)
+ MESSAGE(STATUS "errno found as expected")
+ENDIF (NOT CSE_RESULT_ERRNO)
+
+IF (CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+ unset(CSE_RESULT_O3 CACHE)
+ MESSAGE(STATUS "Testing with optimization -O3")
+
+ check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3)
+
+ IF (CSE_RESULT_O3)
+ MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3")
+ ENDIF (CSE_RESULT_O3)
+ENDIF (CMAKE_COMPILER_IS_GNUCC)
diff --git a/Tests/CMakeOnly/CheckSymbolExists/cm_cse.h b/Tests/CMakeOnly/CheckSymbolExists/cm_cse.h
new file mode 100644
index 0000000..4f41c76
--- /dev/null
+++ b/Tests/CMakeOnly/CheckSymbolExists/cm_cse.h
@@ -0,0 +1,6 @@
+#ifndef _CSE_DUMMY_H
+#define _CSE_DUMMY_H
+
+int non_existent_function_for_symbol_test();
+
+#endif
diff --git a/Tests/CMakeOnly/LinkInterfaceLoop/CMakeLists.txt b/Tests/CMakeOnly/LinkInterfaceLoop/CMakeLists.txt
new file mode 100644
index 0000000..56e449a
--- /dev/null
+++ b/Tests/CMakeOnly/LinkInterfaceLoop/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required (VERSION 2.8)
+project(LinkInterfaceLoop C)
+
+# Add a shared library that incorrectly names itself as a
+# dependency, thus forming a cycle.
+add_library(A SHARED IMPORTED)
+set_target_properties(A PROPERTIES
+ IMPORTED_LINK_DEPENDENT_LIBRARIES A
+ IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/dirA/A"
+ )
+
+# Add a shared library that incorrectly names itself in
+# its link interface, thus forming a cycle.
+add_library(B SHARED IMPORTED)
+set_target_properties(B PROPERTIES
+ IMPORTED_LINK_INTERFACE_LIBRARIES B
+ IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/dirB/B"
+ )
+
+# Add a shared library with an empty link interface
+# that depends on two shared libraries.
+add_library(C SHARED lib.c)
+set_property(TARGET C PROPERTY LINK_INTERFACE_LIBRARIES "")
+target_link_libraries(C B A)
+
+add_executable(main main.c)
+target_link_libraries(main C)
diff --git a/Tests/CMakeOnly/LinkInterfaceLoop/lib.c b/Tests/CMakeOnly/LinkInterfaceLoop/lib.c
new file mode 100644
index 0000000..fede1d6
--- /dev/null
+++ b/Tests/CMakeOnly/LinkInterfaceLoop/lib.c
@@ -0,0 +1 @@
+int lib(void) { return 0; }
diff --git a/Tests/CMakeOnly/LinkInterfaceLoop/main.c b/Tests/CMakeOnly/LinkInterfaceLoop/main.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/CMakeOnly/LinkInterfaceLoop/main.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in
new file mode 100644
index 0000000..aa2d093
--- /dev/null
+++ b/Tests/CMakeOnly/Test.cmake.in
@@ -0,0 +1,12 @@
+set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST}")
+set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build")
+file(REMOVE_RECURSE "${binary_dir}")
+file(MAKE_DIRECTORY "${binary_dir}")
+execute_process(
+ COMMAND ${CMAKE_COMMAND} "${source_dir}" -G "@CMAKE_TEST_GENERATOR@"
+ WORKING_DIRECTORY "${binary_dir}"
+ RESULT_VARIABLE result
+ )
+if(result)
+ message(FATAL_ERROR "CMake failed to configure ${TEST}")
+endif()
diff --git a/Tests/CMakeTests/If-Invalid-Argument.cmake b/Tests/CMakeTests/If-Invalid-Argument.cmake
new file mode 100644
index 0000000..b4fb97f
--- /dev/null
+++ b/Tests/CMakeTests/If-Invalid-Argument.cmake
@@ -0,0 +1,2 @@
+if (NOT foo bar STREQUAL "foo bar")
+endif()
diff --git a/Tests/CMakeTests/IfTest.cmake.in b/Tests/CMakeTests/IfTest.cmake.in
index e5211b4..639e226 100644
--- a/Tests/CMakeTests/IfTest.cmake.in
+++ b/Tests/CMakeTests/IfTest.cmake.in
@@ -156,3 +156,11 @@ foreach(_bad 2x -2x)
endforeach()
test_vars("")
+
+set(Invalid-Argument-RESULT 1)
+set(Invalid-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*")
+
+include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
+check_cmake_test(If
+ Invalid-Argument
+)
diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
index 953d05c..5cdbc59b 100644
--- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt
@@ -5,9 +5,6 @@ IF (MUDSLIDE_TYPE MATCHES MUCHO)
ADD_DEFINITIONS(-DMUCHO_MUDSLIDE)
ENDIF (MUDSLIDE_TYPE MATCHES MUCHO)
-IF(WATCOM)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-ENDIF(WATCOM)
INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source)
ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c)
diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt
index e99105a..846cbb0 100644
--- a/Tests/LoadCommand/CMakeLists.txt
+++ b/Tests/LoadCommand/CMakeLists.txt
@@ -12,12 +12,6 @@ INCLUDE (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF)
CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA)
-INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
-CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H)
-
-INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
-CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM)
-
CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in
${LoadCommand_BINARY_DIR}/LoadedCommand.h)
diff --git a/Tests/LoadCommand/LoadedCommand.h.in b/Tests/LoadCommand/LoadedCommand.h.in
index 7a0a15d..7516a66 100644
--- a/Tests/LoadCommand/LoadedCommand.h.in
+++ b/Tests/LoadCommand/LoadedCommand.h.in
@@ -5,9 +5,3 @@
/* Check for functions */
#cmakedefine HAVE_PRINTF
#cmakedefine HAVE_VSBLABLA
-
-/* Check for headers */
-#cmakedefine HAVE_SYS_PRCTL_H
-
-/* Check for libraries */
-#cmakedefine HAVE_LIBM
diff --git a/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp b/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp
index 445a652..eec46d3 100644
--- a/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp
+++ b/Tests/Module/GenerateExportHeader/nodeprecated/src/main.cpp
@@ -6,4 +6,4 @@ int main(int, char**)
SomeClass sc;
sc.someMethod();
return 0;
-} \ No newline at end of file
+}
diff --git a/Tests/Module/GenerateExportHeader/override_symbol/main.cpp b/Tests/Module/GenerateExportHeader/override_symbol/main.cpp
index 445a652..eec46d3 100644
--- a/Tests/Module/GenerateExportHeader/override_symbol/main.cpp
+++ b/Tests/Module/GenerateExportHeader/override_symbol/main.cpp
@@ -6,4 +6,4 @@ int main(int, char**)
SomeClass sc;
sc.someMethod();
return 0;
-} \ No newline at end of file
+}
diff --git a/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp b/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp
index 7326b78..427ec29 100644
--- a/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp
+++ b/Tests/Module/GenerateExportHeader/override_symbol/someclass.cpp
@@ -4,4 +4,4 @@
void SomeClass::someMethod() const
{
-} \ No newline at end of file
+}
diff --git a/Tests/Module/GenerateExportHeader/prefix/main.cpp b/Tests/Module/GenerateExportHeader/prefix/main.cpp
index d04ae3c..507f6fd 100644
--- a/Tests/Module/GenerateExportHeader/prefix/main.cpp
+++ b/Tests/Module/GenerateExportHeader/prefix/main.cpp
@@ -5,4 +5,4 @@ int main(int argc, char **argv)
{
UsePrefixClass upc;
return upc.someMethod();
-} \ No newline at end of file
+}
diff --git a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
index 8337ab8..1fd2cb2 100644
--- a/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
+++ b/Tests/Module/GenerateExportHeader/prefix/useprefixclass.cpp
@@ -4,4 +4,4 @@
int UsePrefixClass::someMethod() const
{
return 0;
-} \ No newline at end of file
+}
diff --git a/Tests/SystemInformation/SystemInformation.in b/Tests/SystemInformation/SystemInformation.in
index 1055d07..90ae20a 100644
--- a/Tests/SystemInformation/SystemInformation.in
+++ b/Tests/SystemInformation/SystemInformation.in
@@ -17,6 +17,10 @@ CMAKE_CXX_COMPILER == "${CMAKE_CXX_COMPILER}"
CMAKE_C_COMPILER == "${CMAKE_C_COMPILER}"
CMAKE_COMPILER_IS_GNUCC == "${CMAKE_COMPILER_IS_GNUCC}"
CMAKE_COMPILER_IS_GNUCXX == "${CMAKE_COMPILER_IS_GNUCXX}"
+CMAKE_C_COMPILER_ID == "${CMAKE_C_COMPILER_ID}"
+CMAKE_C_COMPILER_VERSION == "${CMAKE_C_COMPILER_VERSION}"
+CMAKE_CXX_COMPILER_ID == "${CMAKE_CXX_COMPILER_ID}"
+CMAKE_CXX_COMPILER_VERSION == "${CMAKE_CXX_COMPILER_VERSION}"
// C shared library flag
CMAKE_SHARED_LIBRARY_C_FLAGS == "${CMAKE_SHARED_LIBRARY_C_FLAGS}"
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
index 115181d..522ee76 100644
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ b/Utilities/Release/dashmacmini2_release.cmake
@@ -5,14 +5,14 @@ set(INSTALL_PREFIX /)
set(HOST dashmacmini2)
set(MAKE_PROGRAM "make")
set(MAKE "${MAKE_PROGRAM} -j2")
-set(CPACK_BINARY_GENERATORS "PackageMaker TGZ TZ")
+set(CPACK_BINARY_GENERATORS "PackageMaker TGZ TZ")
set(INITIAL_CACHE "
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_OSX_ARCHITECTURES:STRING=ppc;i386
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CPACK_SYSTEM_NAME:STRING=Darwin-universal
BUILD_QtDialog:BOOL=TRUE
-QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Software/QtBinUniversal/bin/qmake
+QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Dashboards/Support/qt-4.6.3/bin/bin/qmake
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${path}/release_cmake.cmake)
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index daf8114..c824085 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -16,6 +16,7 @@
#cmakedefine CMAKE_USE_SYSTEM_CURL
#cmakedefine CMAKE_USE_SYSTEM_EXPAT
#cmakedefine CMAKE_USE_SYSTEM_ZLIB
+#cmakedefine CMAKE_USE_SYSTEM_BZIP2
#cmakedefine CMAKE_USE_SYSTEM_LIBARCHIVE
#cmakedefine CTEST_USE_XMLRPC
diff --git a/Utilities/cm_bzlib.h b/Utilities/cm_bzlib.h
new file mode 100644
index 0000000..d1fffa1
--- /dev/null
+++ b/Utilities/cm_bzlib.h
@@ -0,0 +1,23 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef __cm_bzlib_h
+#define __cm_bzlib_h
+
+/* Use the bzip2 library configured for CMake. */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_BZIP2
+# include <bzlib.h>
+#else
+# include <cmbzip2/bzlib.h>
+#endif
+
+#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c
index 8d5bd1c..af618b0 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
index 1580c92..2be2267 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#ifdef HAVE_LZMA_H
#include <lzma.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
index 00f283d..0834e6f 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <expat.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#if HAVE_LZMA_H
#include <lzma.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
index e0d07a9..096a6a4 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_bzip2.c 20
#include <string.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#include "archive.h"
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
index ce3298b..5bb248c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
#endif
#include <stdlib.h>
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#if HAVE_LZMA_H
#include <lzma.h>
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
index 0f003a8..96b7b2f 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include <libxml/xmlwriter.h>
#endif
#ifdef HAVE_BZLIB_H
-#include <bzlib.h>
+#include <cm_bzlib.h>
#endif
#if HAVE_LZMA_H
#include <lzma.h>
diff --git a/bootstrap b/bootstrap
index 3daac2a..f5eacbd 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,7 +1,7 @@
#!/bin/sh
#=============================================================================
# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -11,6 +11,10 @@
# See the License for more information.
#=============================================================================
+die() {
+ echo "$@" 1>&2 ; exit 1
+}
+
# Version number extraction function.
cmake_version_component()
{
@@ -292,7 +296,7 @@ KWSYS_IOS_FILES="
cmake_usage()
{
echo '
-Usage: '"$0"' [options]
+Usage: '"$0"' [<options>...] [-- <cmake-options>...]
Options: [defaults in brackets after descriptions]
Configuration:
--help print this message
@@ -337,7 +341,7 @@ Directory and file names:
# Display CMake bootstrap usage
cmake_version_display()
{
- echo "CMake ${cmake_version}, Copyright 2000-2009 Kitware, Inc."
+ echo "CMake ${cmake_version}, Copyright 2000-2011 Kitware, Inc."
}
# Display CMake bootstrap error, display the log file and exit
@@ -527,63 +531,31 @@ cmake_verbose=
cmake_parallel_make=
cmake_ccache_enabled=
cmake_prefix_dir="${cmake_default_prefix}"
-for a in "$@"; do
- if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
- cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
- cmake_prefix_dir=`cmake_fix_slashes "${cmake_prefix_dir}"`
- fi
- if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
- cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
- fi
- if echo $a | grep "^--datadir=" > /dev/null 2> /dev/null; then
- cmake_data_dir=`echo $a | sed "s/^--datadir=//"`
- fi
- if echo $a | grep "^--docdir=" > /dev/null 2> /dev/null; then
- cmake_doc_dir=`echo $a | sed "s/^--docdir=//"`
- fi
- if echo $a | grep "^--mandir=" > /dev/null 2> /dev/null; then
- cmake_man_dir=`echo $a | sed "s/^--mandir=//"`
- fi
- if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
- cmake_init_file=`echo $a | sed "s/^--init=//"`
- fi
- for lib in bzip2 curl expat libarchive zlib; do
- if echo $a | grep "^--system-${lib}" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${lib}`=1"
- break
- elif echo $a | grep "^--no-system-${lib}" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${lib}`=0"
- break
- fi
- done
- if echo $a | grep "^--system-libs" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1"
- fi
- if echo $a | grep "^--no-system-libs" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0"
- fi
- if echo $a | grep "^--qt-gui" > /dev/null 2> /dev/null; then
- cmake_bootstrap_qt_gui="1"
- fi
- if echo $a | grep "^--no-qt-gui" > /dev/null 2> /dev/null; then
- cmake_bootstrap_qt_gui="0"
- fi
- if echo $a | grep "^--qt-qmake=" > /dev/null 2> /dev/null; then
- cmake_bootstrap_qt_qmake=`echo $a | sed "s/^--qt-qmake=//"`
- fi
- if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
- cmake_usage
- fi
- if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
- cmake_version_display
- exit 2
- fi
- if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
- cmake_verbose=TRUE
- fi
- if echo $a | grep "^--enable-ccache" > /dev/null 2> /dev/null; then
- cmake_ccache_enabled=TRUE
- fi
+while test $# != 0; do
+ case "$1" in
+ --prefix=*) cmake_prefix_dir=`cmake_fix_slashes "${1#*=}"` ;;
+ --parallel=*) cmake_parallel_make="${1#*=}" ;;
+ --datadir=*) cmake_data_dir="${1#*=}" ;;
+ --docdir=*) cmake_doc_dir="${1#*=}" ;;
+ --mandir=*) cmake_man_dir="${1#*=}" ;;
+ --init=*) cmake_init_file="${1#*=}" ;;
+ --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
+ --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
+ --system-bzip2|--system-curl|--system-expat|--system-libarchive|--system-zlib)
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${1#--system-}`=1" ;;
+ --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-libarchive|--no-system-zlib)
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${1#--no-system-}`=0" ;;
+ --qt-gui) cmake_bootstrap_qt_gui="1" ;;
+ --no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
+ --qt-qmake=*) cmake_bootstrap_qt_qmake="${1#*=}" ;;
+ --help) cmake_usage ;;
+ --version) cmake_version_display ; exit 2 ;;
+ --verbose) cmake_verbose=TRUE ;;
+ --enable-ccache) cmake_ccache_enabled=TRUE ;;
+ --) shift; break ;;
+ *) die "Unknown option: $1" ;;
+ esac
+ shift
done
# If verbose, display some information about bootstrap
@@ -1533,7 +1505,7 @@ cmake_options="-DCMAKE_BOOTSTRAP=1"
if [ -n "${cmake_verbose}" ]; then
cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
fi
-"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs}
+"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
RES=$?
if [ "${RES}" -ne "0" ]; then
cmake_error 11 "Problem while running initial CMake"