summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake15
-rw-r--r--CMakeLists.txt30
-rw-r--r--ChangeLog.manual84
-rw-r--r--Modules/CMakeVS8FindMake.cmake3
-rw-r--r--Modules/CMakeVS9FindMake.cmake4
-rw-r--r--Modules/CPackRPM.cmake222
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/ExternalProject.cmake161
-rw-r--r--Modules/FindCUDA.cmake29
-rw-r--r--Modules/FindDCMTK.cmake266
-rw-r--r--Modules/FindMPI.cmake28
-rw-r--r--Modules/FindOpenSSL.cmake38
-rw-r--r--Modules/FindPostgreSQL.cmake181
-rw-r--r--Modules/FindQt4.cmake504
-rw-r--r--Modules/FindThreads.cmake6
-rw-r--r--Modules/FindZLIB.cmake2
-rw-r--r--Modules/GetPrerequisites.cmake13
-rw-r--r--Modules/Platform/OSF1.cmake1
-rw-r--r--Modules/Platform/Windows-GNU-Fortran.cmake1
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake123
-rw-r--r--Modules/UseQt4.cmake4
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx2
-rw-r--r--Source/CTest/cmCTestBuildCommand.h8
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx29
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx8
-rw-r--r--Source/CTest/cmCTestGIT.cxx107
-rw-r--r--Source/CTest/cmCTestGIT.h4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx151
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h6
-rw-r--r--Source/CTest/cmCTestRunTest.cxx29
-rw-r--r--Source/CTest/cmCTestRunTest.h3
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx12
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx2
-rw-r--r--Source/CTest/cmProcess.cxx6
-rw-r--r--Source/CTest/cmProcess.h2
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx8
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx26
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h2
-rw-r--r--Source/cmCTest.cxx4
-rw-r--r--Source/cmCoreTryCompile.cxx17
-rw-r--r--Source/cmDocumentVariables.cxx4
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx5
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx12
-rw-r--r--Source/cmMakefileTargetGenerator.cxx24
-rw-r--r--Source/cmProcessTools.cxx6
-rw-r--r--Source/cmProcessTools.h1
-rw-r--r--Source/cmSetPropertyCommand.h4
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h36
-rw-r--r--Source/cmStandardIncludes.cxx16
-rw-r--r--Source/cmStandardIncludes.h3
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmSystemTools.cxx14
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx49
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h4
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx13
-rw-r--r--Source/cm_utf8.c6
-rw-r--r--Source/cmake.cxx23
-rw-r--r--Source/kwsys/CMakeLists.txt39
-rw-r--r--Source/kwsys/Configure.hxx.in9
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Source/kwsys/testProcess.c4
-rw-r--r--Tests/CMakeLists.txt45
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in105
-rw-r--r--Tests/CTestTestCycle/CMakeLists.txt13
-rw-r--r--Tests/CTestTestCycle/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestCycle/simple.cxx5
-rw-r--r--Tests/CTestTestCycle/test.cmake.in22
-rw-r--r--Tests/CTestTestDepends/CMakeLists.txt12
-rw-r--r--Tests/CTestTestDepends/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestDepends/simple.cxx5
-rw-r--r--Tests/CTestTestDepends/test.cmake.in22
-rw-r--r--Tests/CTestTestParallel/CMakeLists.txt2
-rw-r--r--Tests/CTestUpdateBZR.cmake.in4
-rw-r--r--Tests/CTestUpdateCVS.cmake.in4
-rw-r--r--Tests/CTestUpdateCommon.cmake18
-rw-r--r--Tests/CTestUpdateGIT.cmake.in77
-rwxr-xr-xTests/CTestUpdateGIT.sh.in2
-rw-r--r--Tests/CTestUpdateHG.cmake.in4
-rw-r--r--Tests/CTestUpdateSVN.cmake.in4
-rw-r--r--Tests/ExternalProject/CMakeLists.txt6
-rw-r--r--Tests/bootstrap.bat.in2
-rw-r--r--Utilities/CMakeLists.txt22
-rw-r--r--Utilities/cmcompress/cmcompress.c2
-rw-r--r--Utilities/cmcurl/CMakeLists.txt1
-rw-r--r--Utilities/xml/xhtml-lat1.ent196
-rw-r--r--Utilities/xml/xhtml-special.ent80
-rw-r--r--Utilities/xml/xhtml-symbol.ent237
-rw-r--r--Utilities/xml/xhtml1-strict.dtd977
-rwxr-xr-xbootstrap72
97 files changed, 3445 insertions, 949 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index ce88d2f..692befa 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -27,9 +27,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
SET(CPACK_PACKAGE_VENDOR "Kitware")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
- SET(CPACK_PACKAGE_VERSION_MAJOR "${CMake_VERSION_MAJOR}")
- SET(CPACK_PACKAGE_VERSION_MINOR "${CMake_VERSION_MINOR}")
- SET(CPACK_PACKAGE_VERSION_PATCH "${CMake_VERSION_PATCH}")
+ SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
@@ -68,17 +66,6 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# cygwin specific packaging stuff
IF(CYGWIN)
- # if we are on cygwin and have cpack, then force the
- # doc, data and man dirs to conform to cygwin style directories
- SET(CMAKE_DOC_DIR "/share/doc/${CPACK_PACKAGE_FILE_NAME}")
- SET(CMAKE_DATA_DIR "/share/${CPACK_PACKAGE_FILE_NAME}")
- SET(CMAKE_MAN_DIR "/share/man")
- # let the user know we just forced these values
- MESSAGE(STATUS "Setup for Cygwin packaging")
- MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
- MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
- MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
-
# setup the cygwin package name
SET(CPACK_PACKAGE_NAME cmake)
# setup the name of the package for cygwin cmake-2.4.3
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69b45a4..fc1f4a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -271,6 +271,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(HAVE_ZLIB_H 1)
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
SET(ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
+ SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE)
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
ADD_SUBDIRECTORY(Utilities/cmlibarchive)
@@ -329,7 +330,21 @@ MACRO (CMAKE_BUILD_UTILITIES)
ENDIF(BUILD_CursesDialog)
ENDMACRO (CMAKE_BUILD_UTILITIES)
-
+#-----------------------------------------------------------------------
+IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
+ ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE _GXX_VERSION
+ )
+ STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+ _GXX_VERSION_SHORT ${_GXX_VERSION})
+ IF(_GXX_VERSION_SHORT EQUAL 33)
+ MESSAGE(FATAL_ERROR
+ "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
+ "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
+ "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
+ ENDIF()
+ENDIF()
#-----------------------------------------------------------------------
# The main section of the CMakeLists file
@@ -338,7 +353,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
# The CMake version number.
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
-SET(CMake_VERSION_PATCH 1)
+SET(CMake_VERSION_PATCH 2)
#SET(CMake_VERSION_TWEAK 0)
#SET(CMake_VERSION_RC 1)
@@ -395,6 +410,17 @@ SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CAC
SET(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).")
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
+IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+ # Force doc, data and man dirs to conform to cygwin layout.
+ SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
+ SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
+ SET(CMAKE_MAN_DIR "/share/man")
+ # let the user know we just forced these values
+ MESSAGE(STATUS "Setup for Cygwin packaging")
+ MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
+ MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
+ MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
+ENDIF()
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
diff --git a/ChangeLog.manual b/ChangeLog.manual
index 29162e9..7b0a901 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,4 +1,85 @@
-Changes since CMake 2.8.1
+No changes in CMake 2.8.2 since 2.8.2-rc4.
+
+Changes in CMake 2.8.2-rc4 (since 2.8.2-rc3)
+--------------------------------------------
+Bill Hoffman (1):
+ Fix for bug #10859, ctest exit exception incorrectly reported.
+
+Brad King (3):
+ Run CMake.HTML test without net access (#10857)
+ Run CMake.HTML test with older xmllint (#10857)
+ CTest: Parse empty Git commits correctly
+
+David Cole (2):
+ Qualify name of extraction location with ExternalProject name.
+ For VS10: Really use full path file names.
+
+James Bigler (1):
+ Add support for the emulation version of the cudart library.
+
+Mathieu Malaterre (1):
+ Cleanup FindOpenSSL. Add support for win64 installation.
+
+Zach Mullen (1):
+ Parallel CTest hangs if serial test has depends
+
+Changes in CMake 2.8.2-rc3 (since 2.8.2-rc2)
+--------------------------------------------
+Brad King (1):
+ Preserve ENV{MAKEFLAGS} in CMake script mode
+
+David Cole (4):
+ Remove "Microsoft Visual Studio .NET" from VS8 and VS9 find modules.
+ Use full path file names in generate.stamp.list.
+ Use full path file names to express dependencies.
+ Look in the ctest ini file for GitCommand.
+
+James Bigler (2):
+ Fixed: CUDA_VERSION_MAJOR/MINOR now computed after first run.
+ CUDA_VERSION variable passed to REGEX needs quotes to work when not defined.
+
+Mathieu Malaterre (1):
+ Cleanup FindDCMTK (using foreach). Fix linking on win32 static libs.
+
+Zach Mullen (2):
+ Do not exit if stoptime is passed.
+ Document ctest_build() TARGET option
+
+Changes in CMake 2.8.2-rc2 (since 2.8.2-rc1)
+--------------------------------------------
+
+Bill Hoffman (1):
+ Make sure libarchive uses cmzlib and not the system libz if found.
+
+Brad King (12):
+ Use forward slashes for objects in response files
+ Use platform variable for response file flag
+ Use response file for objects on MinGW and MSYS
+ Generalize CTest.Update* test dashboard script helpers
+ ctest_update: Support custom Git update command
+ ctest_update: Support Git upstream branch rewrites
+ Fix CMake data and doc paths in Cygwin package
+ Document scope of source file properties
+ Run CTest.NoNewline test using built CMake
+ Tru64: Place cmOStringStream vtable uniquely (#10541)
+ Enable BootstrapTest on MSYS
+ Tru64: Use full-path include directives in Makefiles (#10569)
+
+Christoph Watzl (1):
+ Fix nested source groups with VS 10 (#9863)
+
+Clinton Stimpson (2):
+ Support pthreads on irix.
+ Remove macro for querying qmake for qmake variables.
+
+David Cole (2):
+ Fix issue #10346. Error if SOURCE_DIR is empty.
+ Remove CTestTest3.
+
+Zach Mullen (1):
+ Extra coverage glob should subtract the explicitly defined excluded files
+
+Changes in CMake 2.8.2-rc1 (since 2.8.1):
- Build on Tru64 (#10542)
- Build on mingw-w64
- Build on old Sun (#10550, #10543)
@@ -15,6 +96,7 @@ Changes since CMake 2.8.1
- CTest: Report failure in Update.xml
- CTest: Submit author email in Update.xml
- CTest: Teach ctest_update about Git submodules
+- CTest: Teach ctest_update to handle Git upstream branch rewrites
- Cygwin: Export all symbols with ENABLE_EXPORTS (#10122)
- Do not list file names during 'cmake -E tar xz'
- Documentation: Comply with "XHTML 1.0 Strict"
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
index 6f45ed5..2f03e60 100644
--- a/Modules/CMakeVS8FindMake.cmake
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -28,9 +28,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 8/Common7/IDE"
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
"/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
- PATHS
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC80 1)
diff --git a/Modules/CMakeVS9FindMake.cmake b/Modules/CMakeVS9FindMake.cmake
index 2741f77..4704bcc 100644
--- a/Modules/CMakeVS9FindMake.cmake
+++ b/Modules/CMakeVS9FindMake.cmake
@@ -33,10 +33,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE"
"/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/"
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
- PATHS
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE"
-
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC90 1)
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 3bf8e0e..7ab1181 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -4,14 +4,14 @@
# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
#
# However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
-# the wiki:
+# the specifics CPACK_RPM_XXX variables. You'll find a detailed usage on
+# the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
# However as a handy reminder here comes the list of specific variables:
#
-# CPACK_RPM_PACKAGE_SUMMARY
+# CPACK_RPM_PACKAGE_SUMMARY
# Mandatory : YES
-# Default : CPACK_PACKAGE_DESCRIPTION
+# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The RPM package summary
# CPACK_RPM_PACKAGE_NAME
# Mandatory : YES
@@ -24,14 +24,14 @@
# CPACK_RPM_PACKAGE_ARCHITECTURE
# Mandatory : NO
# Default : -
-# The RPM package architecture. This may be set to "noarch" if you
+# The RPM package architecture. This may be set to "noarch" if you
# know you are building a noarch package.
# CPACK_RPM_PACKAGE_RELEASE
# Mandatory : YES
# Default : 1
-# The RPM package release. This is the numbering of the RPM package
-# itself, i.e. the version of the packaging and not the version of the
-# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
+# The RPM package release. This is the numbering of the RPM package
+# itself, i.e. the version of the packaging and not the version of the
+# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
# value if the previous packaging was buggy and/or you want to put here
# a fancy Linux distro specific numbering.
# CPACK_RPM_PACKAGE_LICENSE
@@ -42,10 +42,14 @@
# Mandatory : YES
# Default : "unknown"
# The RPM package group.
-# CPACK_RPM_PACKAGE_VENDOR
+# CPACK_RPM_PACKAGE_VENDOR
# Mandatory : YES
# Default : CPACK_PACKAGE_VENDOR if set or "unknown"
-# The RPM package group.
+# The RPM package vendor.
+# CPACK_RPM_PACKAGE_URL
+# Mandatory : NO
+# Default : -
+# The projects URL.
# CPACK_RPM_PACKAGE_DESCRIPTION
# Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
@@ -61,18 +65,39 @@
# Mandatory : NO
# Default : -
# May be used to set RPM dependencies (requires).
-# Note that you must enclose the complete requires string between quotes,
+# Note that you must enclose the complete requires string between quotes,
# for example:
# set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
-# CPACK_RPM_PACKAGES_PROVIDES
+# CPACK_RPM_PACKAGE_SUGGESTS
+# Mandatory : NO
+# Default : -
+# May be used to set weak RPM dependencies (suggests).
+# Note that you must enclose the complete requires string between quotes.
+# CPACK_RPM_PACKAGE_PROVIDES
# Mandatory : NO
# Default : -
# May be used to set RPM dependencies (provides).
+# CPACK_RPM_PACKAGE_OBSOLETES
+# Mandatory : NO
+# Default : -
+# May be used to set RPM packages that are obsoleted by this one.
+# CPACK_RPM_PACKAGE_RELOCATABLE
+# Mandatory : NO
+# Default : -
+# If this variable is set to TRUE or ON CPackRPM will try
+# to build a relocatable RPM package. A relocatable RPM may
+# be installed using rpm --prefix or --relocate in order to
+# install it at an alternate place see rpm(8).
+# Note that currently this may fail if the package contains
+# files installed with absolute path or CPACK_SET_DESTDIR is set to ON.
+# If CPACK_SET_DESTDIR is set then you will get a warning message
+# but if there is file installed with absolute path you'll get
+# unexpected behavior.
# CPACK_RPM_SPEC_INSTALL_POST
# Mandatory : NO
# Default : -
-# May be used to set an RPM post-install command inside the spec file.
-# For example setting it to "/bin/true" may be used to prevent
+# May be used to set an RPM post-install command inside the spec file.
+# For example setting it to "/bin/true" may be used to prevent
# rpmbuild to strip binaries.
# CPACK_RPM_SPEC_MORE_DEFINE
# Mandatory : NO
@@ -81,19 +106,19 @@
# CPACK_RPM_PACKAGE_DEBUG
# Mandatory : NO
# Default : -
-# May be set when invoking cpack in order to trace debug informations
-# during CPack RPM run. For example you may launch CPack like this
+# May be set when invoking cpack in order to trace debug informations
+# during CPack RPM run. For example you may launch CPack like this
# cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
# CPACK_RPM_USER_BINARY_SPECFILE
# Mandatory : NO
-# Default : -
+# Default : -
# May be set by the user in order to specify a USER binary spec file
# to be used by CPackRPM instead of generating the file.
# The specified file will be processed by CONFIGURE_FILE( @ONLY).
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
# Mandatory : NO
# Default : -
-# If set CPack will generate a template for USER specified binary
+# If set CPack will generate a template for USER specified binary
# spec file and stop with an error. For example launch CPack like this
# cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
# The user may then use this file in order to hand-craft is own
@@ -116,6 +141,12 @@
# put after the %post or %postun section
# One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm
+# CPACK_RPM_CHANGELOG_FILE
+# Mandatory : NO
+# Default : -
+# May be used to embbed a changelog in the spec file.
+# The refered file will be read and directly put after the %changelog
+# section.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -141,23 +172,23 @@ IF(NOT UNIX)
ENDIF(NOT UNIX)
# rpmbuild is the basic command for building RPM package
-# it may be a simple (symbolic) link to rpmb command.
+# it may be a simple (symbolic) link to rpm command.
FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)
-# Check version of the rpmbuild tool this would be easier to
+# Check version of the rpmbuild tool this would be easier to
# track bugs with users and CPackRPM debug mode.
-# We may use RPM version in order to check for available version dependent features
+# We may use RPM version in order to check for available version dependent features
IF(RPMBUILD_EXECUTABLE)
execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "^.*\ " ""
+ string(REGEX REPLACE "^.*\ " ""
RPMBUILD_EXECUTABLE_VERSION
- ${_TMP_VERSION})
+ ${_TMP_VERSION})
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ENDIF(RPMBUILD_EXECUTABLE)
IF(NOT RPMBUILD_EXECUTABLE)
@@ -165,14 +196,14 @@ IF(NOT RPMBUILD_EXECUTABLE)
ENDIF(NOT RPMBUILD_EXECUTABLE)
# We may use RPM version in the future in order
-# to shut down warning about space in buildtree
+# to shut down warning about space in buildtree
# some recent RPM version should support space in different places.
# not checked [yet].
IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
-# If rpmbuild is found
+# If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian.
# In this case we may try to to use more advanced features
# like generating RPM directly from DEB using alien.
@@ -182,7 +213,7 @@ IF(ALIEN_EXECUTABLE)
MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
ENDIF(ALIEN_EXECUTABLE)
-#
+#
# Use user-defined RPM specific variables value
# or generate reasonable default value from
# CPACK_xxx generic values.
@@ -197,10 +228,10 @@ IF(NOT CPACK_RPM_PACKAGE_SUMMARY)
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+ SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
-
+
# CPACK_RPM_PACKAGE_NAME (mandatory)
IF(NOT CPACK_RPM_PACKAGE_NAME)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
@@ -213,6 +244,11 @@ IF(NOT CPACK_RPM_PACKAGE_VERSION)
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
+# Replace '-' in version with '_'
+# '-' character is an Illegal RPM version character
+# it is illegal because it is used to separate
+# RPM "Version" from RPM "Release"
+STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
@@ -294,25 +330,33 @@ IF (CPACK_RPM_COMPRESSION_TYPE)
ELSE(CPACK_RPM_COMPRESSION_TYPE)
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
-# CPACK_RPM_PACKAGE_REQUIRES
-# Placeholder used to specify binary RPM dependencies (if any)
-# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
-IF(CPACK_RPM_PACKAGE_REQUIRES)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined Requires:\n ${CPACK_RPM_PACKAGE_REQUIRES}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}")
-ENDIF(CPACK_RPM_PACKAGE_REQUIRES)
-# CPACK_RPM_PACKAGE_PROVIDES
-# Placeholder used to specify binary RPM dependencies (if any)
-# see http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
-IF(CPACK_RPM_PACKAGE_PROVIDES)
- IF(CPACK_RPM_PACKAGE_DEBUG)
- MESSAGE("CPackRPM:Debug: User defined Provides:\n ${CPACK_RPM_PACKAGE_PROVIDES}")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
- SET(TMP_RPM_PROVIDES "Provides: ${CPACK_RPM_PACKAGE_PROVIDES}")
-ENDIF(CPACK_RPM_PACKAGE_PROVIDES)
+if(CPACK_RPM_PACKAGE_RELOCATABLE)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Trying to build a relocatable package")
+ endif(CPACK_RPM_PACKAGE_DEBUG)
+ if(CPACK_SET_DESTDIR)
+ message(SEND_ERROR "CPackRPM:Warning: CPACK_SET_DESTDIR is set while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
+ else(CPACK_SET_DESTDIR)
+ set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
+ endif(CPACK_SET_DESTDIR)
+endif(CPACK_RPM_PACKAGE_RELOCATABLE)
+
+# check if additional fields for RPM spec header are given
+FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX)
+ IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
+ MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
+ STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
+ STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
+ STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
+ SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
+ IF(CPACK_RPM_PACKAGE_DEBUG)
+ MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}")
+ ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ENDFOREACH(_RPM_SPEC_HEADER)
# CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script
@@ -348,7 +392,7 @@ endif(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
-# May be used to embbed a pre (un)installation script in the spec file.
+# May be used to embed a pre (un)installation script in the spec file.
# The refered script file(s) will be read and directly
# put after the %pre or %preun section
if(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE)
@@ -367,6 +411,19 @@ if(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE)
+# CPACK_RPM_CHANGELOG_FILE
+# May be used to embed a changelog in the spec file.
+# The refered file will be read and directly put after the %changelog section
+if(CPACK_RPM_CHANGELOG_FILE)
+ if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+ file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
+ else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+ message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
+ endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
+else(CPACK_RPM_CHANGELOG_FILE)
+ set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)")
+endif(CPACK_RPM_CHANGELOG_FILE)
+
# CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder
IF(CPACK_RPM_SPEC_MORE_DEFINE)
@@ -396,18 +453,19 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# Use files tree to construct files command (spec file)
# We should not forget to include symlinks (thus -o -type l)
-# We must remove the './' due to the local search (thus the sed)
+# We must remove the './' due to the local search and escape the
+# file name by enclosing it between double quotes (thus the sed)
# Then we must authorize any man pages extension (adding * at the end)
# because rpmbuild may automatically compress those files
EXECUTE_PROCESS(COMMAND find -type f -o -type l
- COMMAND sed {s/\\.//}
- COMMAND sed {s/.*man.*\\/.*/&*/}
+ COMMAND sed {s:.*/man.*/.*:&*:}
+ COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
# 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}.spec")
-
+
# Print out some debug information if we were asked for that
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
@@ -420,7 +478,7 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
-
+
# USER generated spec file handling.
# We should generate a spec file template:
# - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
@@ -429,7 +487,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
"# -*- rpm-spec -*-
-Buildroot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
+BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
Version: \@CPACK_RPM_PACKAGE_VERSION\@
@@ -437,11 +495,13 @@ Release: \@CPACK_RPM_PACKAGE_RELEASE\@
License: \@CPACK_RPM_PACKAGE_LICENSE\@
Group: \@CPACK_RPM_PACKAGE_GROUP\@
Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
+\@TMP_RPM_URL\@
\@TMP_RPM_REQUIRES\@
\@TMP_RPM_PROVIDES\@
+\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_BUILDARCH\@
-
-#p define prefix \@CMAKE_INSTALL_PREFIX\@
+\@TMP_RPM_PREFIX\@
+
%define _rpmdir \@CPACK_RPM_DIRECTORY\@
%define _rpmfilename \@CPACK_RPM_FILE_NAME\@
%define _unpackaged_files_terminate_build 0
@@ -449,7 +509,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@TMP_RPM_SPEC_INSTALL_POST\@
\@CPACK_RPM_SPEC_MORE_DEFINE\@
\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
-
+
%description
\@CPACK_RPM_PACKAGE_DESCRIPTION\@
@@ -461,14 +521,14 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
mv $RPM_BUILD_ROOT \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot
#p build
-
+
%install
if [ -e $RPM_BUILD_ROOT ];
then
- mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT
+ mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT
else
- mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT
-fi
+ mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT
+fi
%clean
@@ -489,61 +549,39 @@ fi
${CPACK_RPM_INSTALL_FILES}
%changelog
-* Sun Apr 4 2010 Erk <eric.noulard@gmail.com>
- Add support for specifying RPM compression type
-* Sat Nov 28 2009 Erk <eric.noulard@gmail.com>
- Refix backup/restore install tree for OpenSuSE 11.2
-* Sun Nov 22 2009 Erk <eric.noulard@gmail.com>
- Include symlinks in the file list.
-* Sat Nov 14 2009 Erk <eric.noulard@gmail.com>
- Replace prep and build step with backup and restore
- of the previously CPack installed tree. This should
- mimic what is expected in rpmbuild usual steps
-* Wed Nov 11 2009 Erk <eric.noulard@gmail.com>
- Add support for USER defined pre/post[un]install scripts
-* Wed Oct 07 2009 Erk <eric.noulard@gmail.com>
- Add user custom spec file support
-* Sat Oct 03 2009 Kami <cmoidavid@gmail.com>
- Update to handle more precisely the files section
-* Mon Oct 03 2008 Erk <eric.noulard@gmail.com>
- Update generator to handle optional dependencies using Requires
- Update DEBUG output typos.
-* Mon Aug 25 2008 Erk <eric.noulard@gmail.com>
- Update generator to handle optional post-install
-* Tue Aug 16 2007 Erk <eric.noulard@gmail.com>
- Generated by CPack RPM Generator and associated macros
+\@CPACK_RPM_SPEC_CHANGELOG\@
")
# Stop here if we were asked to only generate a template USER spec file
# The generated file may then be used as a template by user who wants
- # to customize their own spec file.
+ # to customize their own spec file.
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
# After that we may either use a user provided spec file
-# or generate one using appropriate variables value.
+# or generate one using appropriate variables value.
IF(CPACK_RPM_USER_BINARY_SPECFILE)
# User may have specified SPECFILE just use it
MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
# The user provided file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
- # No User specified spec file, will use the generated spec file
- MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
- # Note the just created file is processed for @var replacement
+ # No User specified spec file, will use the generated spec file
+ MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
+ # Note the just created file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
IF(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS(
- COMMAND "${RPMBUILD_EXECUTABLE}" -bb
- --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+ COMMAND "${RPMBUILD_EXECUTABLE}" -bb
+ --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
"${CPACK_RPM_BINARY_SPECFILE}"
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err"
- OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err")
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index cbb9a32..caf0afe 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -49,6 +49,7 @@ SVNUpdateOptions: @SVN_UPDATE_OPTIONS@
# Git options
GITCommand: @GITCOMMAND@
GITUpdateOptions: @GIT_UPDATE_OPTIONS@
+GITUpdateCustom: @CTEST_GIT_UPDATE_CUSTOM@
# Generic update command
UpdateCommand: @UPDATE_COMMAND@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 15749f2..b74f207 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -43,6 +43,13 @@
# [TEST_BEFORE_INSTALL 1] # Add test step executed before install step
# [TEST_AFTER_INSTALL 1] # Add test step executed after install step
# [TEST_COMMAND cmd...] # Command to drive test
+# #--Output logging-------------
+# [LOG_DOWNLOAD 1] # Wrap download in script to log output
+# [LOG_UPDATE 1] # Wrap update in script to log output
+# [LOG_CONFIGURE 1] # Wrap configure in script to log output
+# [LOG_BUILD 1] # Wrap build in script to log output
+# [LOG_TEST 1] # Wrap test in script to log output
+# [LOG_INSTALL 1] # Wrap install in script to log output
# )
# The *_DIR options specify directories for the project, with default
# directories computed as follows.
@@ -86,6 +93,7 @@
# [DEPENDS files...] # Files on which this step depends
# [ALWAYS 1] # No stamp file, step always runs
# [WORKING_DIRECTORY dir] # Working directory for command
+# [LOG 1] # Wrap step in script to log output
# )
# The command line, comment, and working directory of every standard
# and custom step is processed to replace tokens
@@ -358,7 +366,7 @@ endif()
endfunction(_ep_write_verifyfile_script)
-function(_ep_write_extractfile_script script_filename filename directory)
+function(_ep_write_extractfile_script script_filename name filename directory)
set(args "")
if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$")
@@ -391,10 +399,10 @@ endif()
# Prepare a space for extracting:
#
set(i 1234)
-while(EXISTS \"\${directory}/../ex\${i}\")
+while(EXISTS \"\${directory}/../ex-${name}\${i}\")
math(EXPR i \"\${i} + 1\")
endwhile()
-set(ut_dir \"\${directory}/../ex\${i}\")
+set(ut_dir \"\${directory}/../ex-${name}\${i}\")
file(MAKE_DIRECTORY \"\${ut_dir}\")
# Extract it:
@@ -606,6 +614,81 @@ function(_ep_get_build_command name step cmd_var)
set(${cmd_var} "${cmd}" PARENT_SCOPE)
endfunction(_ep_get_build_command)
+function(_ep_write_log_script name step cmd_var)
+ ExternalProject_Get_Property(${name} stamp_dir)
+ set(command "${${cmd_var}}")
+
+ set(make "")
+ if("${command}" MATCHES "^\\$\\(MAKE\\)")
+ # GNU make recognizes the string "$(MAKE)" as recursive make, so
+ # ensure that it appears directly in the makefile.
+ string(REGEX REPLACE "^\\$\\(MAKE\\)" "\${make}" command "${command}")
+ set(make "-Dmake=$(MAKE)")
+ endif()
+
+ set(config "")
+ if("${CMAKE_CFG_INTDIR}" MATCHES "^\\$")
+ string(REPLACE "${CMAKE_CFG_INTDIR}" "\${config}" command "${command}")
+ set(config "-Dconfig=${CMAKE_CFG_INTDIR}")
+ endif()
+
+ # Wrap multiple 'COMMAND' lines up into a second-level wrapper
+ # script so all output can be sent to one log file.
+ if("${command}" MATCHES ";COMMAND;")
+ set(code_execute_process "
+execute_process(COMMAND \${command} RESULT_VARIABLE result)
+if(result)
+ set(msg \"Command failed (\${result}):\\n\")
+ foreach(arg IN LISTS command)
+ set(msg \"\${msg} '\${arg}'\")
+ endforeach(arg)
+ message(FATAL_ERROR \"\${msg}\")
+endif()
+")
+ set(code "")
+ set(cmd "")
+ set(sep "")
+ foreach(arg IN LISTS command)
+ if("x${arg}" STREQUAL "xCOMMAND")
+ set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ set(cmd "")
+ set(sep "")
+ else()
+ set(cmd "${cmd}${sep}${arg}")
+ set(sep ";")
+ endif()
+ endforeach()
+ set(code "${code}set(command \"${cmd}\")${code_execute_process}")
+ file(WRITE ${stamp_dir}/${name}-${step}-impl.cmake "${code}")
+ set(command ${CMAKE_COMMAND} "-Dmake=\${make}" "-Dconfig=\${config}" -P ${stamp_dir}/${name}-${step}-impl.cmake)
+ endif()
+
+ # Wrap the command in a script to log output to files.
+ set(script ${stamp_dir}/${name}-${step}.cmake)
+ set(logbase ${stamp_dir}/${name}-${step})
+ file(WRITE ${script} "
+set(command \"${command}\")
+execute_process(
+ COMMAND \${command}
+ RESULT_VARIABLE result
+ OUTPUT_FILE \"${logbase}-out.log\"
+ ERROR_FILE \"${logbase}-err.log\"
+ )
+if(result)
+ set(msg \"Command failed: \${result}\\n\")
+ foreach(arg IN LISTS command)
+ set(msg \"\${msg} '\${arg}'\")
+ endforeach(arg)
+ set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\\n\")
+ message(FATAL_ERROR \"\${msg}\")
+else()
+ set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\\n\")
+ message(STATUS \"\${msg}\")
+endif()
+")
+ set(command ${CMAKE_COMMAND} ${make} ${config} -P ${script})
+ set(${cmd_var} "${command}" PARENT_SCOPE)
+endfunction(_ep_write_log_script)
# This module used to use "/${CMAKE_CFG_INTDIR}" directly and produced
# makefiles with "/./" in paths for custom command dependencies. Which
@@ -695,6 +778,12 @@ function(ExternalProject_Add_Step name step)
set(touch ${CMAKE_COMMAND} -E touch ${stamp_dir}${cfgdir}/${name}-${step})
endif()
+ # Wrap with log script?
+ get_property(log TARGET ${name} PROPERTY _EP_${step}_LOG)
+ if(command AND log)
+ _ep_write_log_script(${name} ${step} command)
+ endif()
+
add_custom_command(
OUTPUT ${stamp_dir}${cfgdir}/${name}-${step}
COMMENT ${comment}
@@ -738,6 +827,16 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var)
endfunction()
+function(_ep_is_dir_empty dir empty_var)
+ file(GLOB gr "${dir}/*")
+ if("${gr}" STREQUAL "")
+ set(${empty_var} 1 PARENT_SCOPE)
+ else()
+ set(${empty_var} 0 PARENT_SCOPE)
+ endif()
+endfunction()
+
+
function(_ep_add_download_command name)
ExternalProject_Get_Property(${name} source_dir stamp_dir download_dir tmp_dir)
@@ -885,12 +984,21 @@ function(_ep_add_download_command name)
endif()
_ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}")
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake)
- # TODO: Support other archive formats.
- _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${file}" "${source_dir}")
+ _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${name}" "${file}" "${source_dir}")
list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake)
endif()
else()
- message(SEND_ERROR "error: no download info for '${name}' -- please specify existing SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY or DOWNLOAD_COMMAND")
+ _ep_is_dir_empty("${source_dir}" empty)
+ if(${empty})
+ message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND")
+ endif()
+ endif()
+
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_DOWNLOAD)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
endif()
ExternalProject_Add_Step(${name} download
@@ -899,6 +1007,7 @@ function(_ep_add_download_command name)
WORKING_DIRECTORY ${work_dir}
DEPENDS ${depends}
DEPENDEES mkdir
+ ${log}
)
endfunction(_ep_add_download_command)
@@ -956,12 +1065,20 @@ function(_ep_add_update_command name)
set(always 1)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_UPDATE)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} update
COMMENT ${comment}
COMMAND ${cmd}
ALWAYS ${always}
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
+ ${log}
)
endfunction(_ep_add_update_command)
@@ -1032,11 +1149,19 @@ function(_ep_add_configure_command name)
configure_file(${tmp_dir}/${name}-cfgcmd.txt.in ${tmp_dir}/${name}-cfgcmd.txt)
list(APPEND file_deps ${tmp_dir}/${name}-cfgcmd.txt)
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_CONFIGURE)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} configure
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES update patch
DEPENDS ${file_deps}
+ ${log}
)
endfunction(_ep_add_configure_command)
@@ -1051,10 +1176,18 @@ function(_ep_add_build_command name)
_ep_get_build_command(${name} BUILD cmd)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_BUILD)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} build
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES configure
+ ${log}
)
endfunction(_ep_add_build_command)
@@ -1069,10 +1202,18 @@ function(_ep_add_install_command name)
_ep_get_build_command(${name} INSTALL cmd)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_INSTALL)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} install
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
DEPENDEES build
+ ${log}
)
endfunction(_ep_add_install_command)
@@ -1100,10 +1241,18 @@ function(_ep_add_test_command name)
set(dep_args DEPENDEES install)
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_TEST)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} test
COMMAND ${cmd}
WORKING_DIRECTORY ${binary_dir}
${dep_args}
+ ${log}
)
endif()
endfunction(_ep_add_test_command)
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 6539057..7099609 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -418,6 +418,10 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_VERSION CACHE)
unset(CUDA_TOOLKIT_INCLUDE CACHE)
unset(CUDA_CUDART_LIBRARY CACHE)
+ if(CUDA_VERSION VERSION_EQUAL "3.0")
+ # This only existed in the 3.0 version of the CUDA toolkit
+ unset(CUDA_CUDARTEMU_LIBRARY CACHE)
+ endif()
unset(CUDA_CUDA_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE)
@@ -484,6 +488,10 @@ if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION)
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.")
mark_as_advanced(CUDA_VERSION)
+else()
+ # Need to set these based off of the cached value
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}")
endif()
# Always set this convenience variable
@@ -545,11 +553,28 @@ endmacro()
# CUDA_LIBRARIES
find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")
-set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+if(CUDA_VERSION VERSION_EQUAL "3.0")
+ # The cudartemu library only existed for the 3.0 version of CUDA.
+ find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library")
+ mark_as_advanced(
+ CUDA_CUDARTEMU_LIBRARY
+ )
+endif()
+# If we are using emulation mode and we found the cudartemu library then use
+# that one instead of cudart.
+if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+ set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
+else()
+ set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+endif()
if(APPLE)
# We need to add the path to cudart to the linker using rpath, since the
# library name for the cuda libraries is prepended with @rpath.
- get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+ get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
+ else()
+ get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+ endif()
if(_cuda_path_to_cudart)
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
endif()
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index 2c3fce5..d35433a 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -1,7 +1,7 @@
# - find DCMTK libraries and applications
#
-# DCMTK_INCLUDE_DIR - Directories to include to use DCMTK
+# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
@@ -13,7 +13,8 @@
#=============================================================================
# Copyright 2004-2009 Kitware, Inc.
-# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+# Copyright 2010 Thomas Sondergaard <ts@medical-insight.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -28,155 +29,124 @@
#
# Written for VXL by Amitha Perera.
# Upgraded for GDCM by Mathieu Malaterre.
-#
-
-IF( NOT DCMTK_FOUND )
- SET( DCMTK_DIR "/usr/include/dcmtk/"
- CACHE PATH "Root of DCMTK source tree (optional)." )
- MARK_AS_ADVANCED( DCMTK_DIR )
-ENDIF( NOT DCMTK_FOUND )
-
-
-FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
- ${DCMTK_DIR}/config/include
- ${DCMTK_DIR}/config
- ${DCMTK_DIR}/include
-)
-
-FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
- ${DCMTK_DIR}/ofstd/include
- ${DCMTK_DIR}/ofstd
- ${DCMTK_DIR}/include/ofstd
-)
-
-FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
- ${DCMTK_DIR}/ofstd/libsrc
- ${DCMTK_DIR}/ofstd/libsrc/Release
- ${DCMTK_DIR}/ofstd/libsrc/Debug
- ${DCMTK_DIR}/ofstd/Release
- ${DCMTK_DIR}/ofstd/Debug
- ${DCMTK_DIR}/lib
-)
-
-
-FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
- ${DCMTK_DIR}/include/dcmdata
- ${DCMTK_DIR}/dcmdata
- ${DCMTK_DIR}/dcmdata/include
-)
-
-FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
- ${DCMTK_DIR}/dcmdata/libsrc
- ${DCMTK_DIR}/dcmdata/libsrc/Release
- ${DCMTK_DIR}/dcmdata/libsrc/Debug
- ${DCMTK_DIR}/dcmdata/Release
- ${DCMTK_DIR}/dcmdata/Debug
- ${DCMTK_DIR}/lib
-)
-
-
-FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
- ${DCMTK_DIR}/dcmimgle/include
- ${DCMTK_DIR}/dcmimgle
- ${DCMTK_DIR}/include/dcmimgle
-)
-
-FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
- ${DCMTK_DIR}/dcmimgle/libsrc
- ${DCMTK_DIR}/dcmimgle/libsrc/Release
- ${DCMTK_DIR}/dcmimgle/libsrc/Debug
- ${DCMTK_DIR}/dcmimgle/Release
- ${DCMTK_DIR}/dcmimgle/Debug
- ${DCMTK_DIR}/lib
-)
-
-# MM: I could not find this library on debian system / dcmtk 3.5.4
-FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
- ${DCMTK_DIR}/imagectn/libsrc/Release
- ${DCMTK_DIR}/imagectn/libsrc/
- ${DCMTK_DIR}/imagectn/libsrc/Debug
- )
-
-FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
- ${DCMTK_DIR}/dcmnet/libsrc/Release
- ${DCMTK_DIR}/dcmnet/libsrc/Debug
- ${DCMTK_DIR}/dcmnet/libsrc/
- )
-
-
-IF( DCMTK_config_INCLUDE_DIR
- AND DCMTK_ofstd_INCLUDE_DIR
- AND DCMTK_ofstd_LIBRARY
- AND DCMTK_dcmdata_INCLUDE_DIR
- AND DCMTK_dcmdata_LIBRARY
- AND DCMTK_dcmimgle_INCLUDE_DIR
- AND DCMTK_dcmimgle_LIBRARY )
-
- SET( DCMTK_FOUND "YES" )
- SET( DCMTK_INCLUDE_DIR
- ${DCMTK_config_INCLUDE_DIR}
+# Modified for EasyViz by Thomas Sondergaard.
+#
+
+if(NOT DCMTK_FOUND AND NOT DCMTK_DIR)
+ set(DCMTK_DIR
+ "/usr/include/dcmtk/"
+ CACHE
+ PATH
+ "Root of DCMTK source tree (optional).")
+ mark_as_advanced(DCMTK_DIR)
+endif()
+
+
+foreach(lib
+ dcmdata
+ dcmimage
+ dcmimgle
+ dcmjpeg
+ dcmnet
+ dcmpstat
+ dcmqrdb
+ dcmsign
+ dcmsr
+ dcmtls
+ ijg12
+ ijg16
+ ijg8
+ ofstd)
+
+ find_library(DCMTK_${lib}_LIBRARY
+ ${lib}
+ PATHS
+ ${DCMTK_DIR}/${lib}/libsrc
+ ${DCMTK_DIR}/${lib}/libsrc/Release
+ ${DCMTK_DIR}/${lib}/libsrc/Debug
+ ${DCMTK_DIR}/${lib}/Release
+ ${DCMTK_DIR}/${lib}/Debug
+ ${DCMTK_DIR}/lib)
+
+ mark_as_advanced(DCMTK_${lib}_LIBRARY)
+
+ if(DCMTK_${lib}_LIBRARY)
+ list(APPEND DCMTK_LIBRARIES ${DCMTK_${lib}_LIBRARY})
+ endif()
+
+endforeach()
+
+
+set(DCMTK_config_TEST_HEADER osconfig.h)
+set(DCMTK_dcmdata_TEST_HEADER dctypes.h)
+set(DCMTK_dcmimage_TEST_HEADER dicoimg.h)
+set(DCMTK_dcmimgle_TEST_HEADER dcmimage.h)
+set(DCMTK_dcmjpeg_TEST_HEADER djdecode.h)
+set(DCMTK_dcmnet_TEST_HEADER assoc.h)
+set(DCMTK_dcmpstat_TEST_HEADER dcmpstat.h)
+set(DCMTK_dcmqrdb_TEST_HEADER dcmqrdba.h)
+set(DCMTK_dcmsign_TEST_HEADER sicert.h)
+set(DCMTK_dcmsr_TEST_HEADER dsrtree.h)
+set(DCMTK_dcmtls_TEST_HEADER tlslayer.h)
+set(DCMTK_ofstd_TEST_HEADER ofstdinc.h)
+
+foreach(dir
+ config
+ dcmdata
+ dcmimage
+ dcmimgle
+ dcmjpeg
+ dcmnet
+ dcmpstat
+ dcmqrdb
+ dcmsign
+ dcmsr
+ dcmtls
+ ofstd)
+ find_path(DCMTK_${dir}_INCLUDE_DIR
+ ${DCMTK_${dir}_TEST_HEADER}
+ PATHS
+ ${DCMTK_DIR}/${dir}/include
+ ${DCMTK_DIR}/${dir}
+ ${DCMTK_DIR}/include/${dir})
+
+ mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
+
+ if(DCMTK_${dir}_INCLUDE_DIR)
+ list(APPEND
+ DCMTK_INCLUDE_DIRS
+ ${DCMTK_${dir}_INCLUDE_DIR})
+ endif()
+endforeach()
+
+if(WIN32)
+ list(APPEND DCMTK_LIBRARIES netapi32 wsock32)
+endif()
+
+if(DCMTK_ofstd_INCLUDE_DIR)
+ get_filename_component(DCMTK_dcmtk_INCLUDE_DIR
${DCMTK_ofstd_INCLUDE_DIR}
- ${DCMTK_dcmdata_INCLUDE_DIR}
- ${DCMTK_dcmimgle_INCLUDE_DIR}
- )
-
- SET( DCMTK_LIBRARIES
- ${DCMTK_dcmimgle_LIBRARY}
- ${DCMTK_dcmdata_LIBRARY}
- ${DCMTK_ofstd_LIBRARY}
- ${DCMTK_config_LIBRARY}
- )
-
- IF(DCMTK_imagedb_LIBRARY)
- SET( DCMTK_LIBRARIES
- ${DCMTK_LIBRARIES}
- ${DCMTK_imagedb_LIBRARY}
- )
- ENDIF(DCMTK_imagedb_LIBRARY)
-
- IF(DCMTK_dcmnet_LIBRARY)
- SET( DCMTK_LIBRARIES
- ${DCMTK_LIBRARIES}
- ${DCMTK_dcmnet_LIBRARY}
- )
- ENDIF(DCMTK_dcmnet_LIBRARY)
-
- IF( WIN32 )
- SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
- ENDIF( WIN32 )
-
-ENDIF( DCMTK_config_INCLUDE_DIR
- AND DCMTK_ofstd_INCLUDE_DIR
- AND DCMTK_ofstd_LIBRARY
- AND DCMTK_dcmdata_INCLUDE_DIR
- AND DCMTK_dcmdata_LIBRARY
- AND DCMTK_dcmimgle_INCLUDE_DIR
- AND DCMTK_dcmimgle_LIBRARY )
-
-FIND_PROGRAM(DCMTK_DCMDUMP_EXECUTABLE dcmdump
- ${DCMTK_DIR}/bin
- )
-
-FIND_PROGRAM(DCMTK_DCMDJPEG_EXECUTABLE dcmdjpeg
- ${DCMTK_DIR}/bin
- )
-
-FIND_PROGRAM(DCMTK_DCMDRLE_EXECUTABLE dcmdrle
- ${DCMTK_DIR}/bin
- )
-
-MARK_AS_ADVANCED(
- DCMTK_DCMDUMP_EXECUTABLE
- DCMTK_DCMDJPEG_EXECUTABLE
- DCMTK_DCMDRLE_EXECUTABLE
+ PATH
+ CACHE)
+ list(APPEND DCMTK_INCLUDE_DIRS ${DCMTK_dcmtk_INCLUDE_DIR})
+ mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DCMTK DEFAULT_MSG
DCMTK_config_INCLUDE_DIR
+ DCMTK_ofstd_INCLUDE_DIR
+ DCMTK_ofstd_LIBRARY
DCMTK_dcmdata_INCLUDE_DIR
DCMTK_dcmdata_LIBRARY
DCMTK_dcmimgle_INCLUDE_DIR
- DCMTK_dcmimgle_LIBRARY
- DCMTK_imagedb_LIBRARY
- DCMTK_dcmnet_LIBRARY
- DCMTK_ofstd_INCLUDE_DIR
- DCMTK_ofstd_LIBRARY
- )
+ DCMTK_dcmimgle_LIBRARY)
+
+# Compatibility: This variable is deprecated
+set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
+foreach(executable dcmdump dcmdjpeg dcmdrle)
+ string(TOUPPER ${executable} EXECUTABLE)
+ find_program(DCMTK_${EXECUTABLE}_EXECUTABLE ${executable} ${DCMTK_DIR}/bin)
+ mark_as_advanced(DCMTK_${EXECUTABLE}_EXECUTABLE)
+endforeach()
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 481b0e9..21dadd9 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -188,7 +188,7 @@ if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
# the cache, and we don't want to override those settings.
elseif (MPI_COMPILE_CMDLINE)
# Extract compile flags from the compile command line.
- string(REGEX MATCHALL "-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
set(MPI_COMPILE_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
if (MPI_COMPILE_FLAGS_WORK)
@@ -199,10 +199,10 @@ elseif (MPI_COMPILE_CMDLINE)
endforeach(FLAG)
# Extract include paths from compile command line
- string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
set(MPI_INCLUDE_PATH_WORK)
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
- string(REGEX REPLACE "^-I" "" IPATH ${IPATH})
+ string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
string(REGEX REPLACE "//" "/" IPATH ${IPATH})
list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
endforeach(IPATH)
@@ -230,10 +230,10 @@ elseif (MPI_COMPILE_CMDLINE)
endif (NOT MPI_INCLUDE_PATH_WORK)
# Extract linker paths from the link command line
- string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_PATH)
foreach(LPATH ${MPI_ALL_LINK_PATHS})
- string(REGEX REPLACE "^-L" "" LPATH ${LPATH})
+ string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
list(APPEND MPI_LINK_PATH ${LPATH})
endforeach(LPATH)
@@ -251,7 +251,7 @@ elseif (MPI_COMPILE_CMDLINE)
endif (NOT MPI_LINK_PATH)
# Extract linker flags from the link command line
- string(REGEX MATCHALL "-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
if (MPI_LINK_FLAGS_WORK)
@@ -263,20 +263,20 @@ elseif (MPI_COMPILE_CMDLINE)
# Extract the set of libraries to link against from the link command
# line
- string(REGEX MATCHALL "-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
# Determine full path names for all of the libraries that one needs
# to link against in an MPI program
set(MPI_LIBRARIES)
foreach(LIB ${MPI_LIBNAMES})
- string(REGEX REPLACE "^-l" "" LIB ${LIB})
+ string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
if (MPI_LIB)
list(APPEND MPI_LIBRARIES ${MPI_LIB})
- else (MPI_LIB)
- message(SEND_ERROR "Unable to find MPI library ${LIB}")
- endif (MPI_LIB)
+ elseif (NOT MPI_FIND_QUIETLY)
+ message(WARNING "Unable to find MPI library ${LIB}")
+ endif ()
endforeach(LIB)
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)
@@ -332,12 +332,6 @@ else (MPI_COMPILE_CMDLINE)
set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags")
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
-# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required
-if("${MPI_LIBRARY}" MATCHES "mpich.rts")
- set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
- set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
-endif("${MPI_LIBRARY}" MATCHES "mpich.rts")
-
# Set up extra variables to conform to
if (MPI_EXTRA_LIBRARY)
set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index b056020..826ae09 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -1,6 +1,9 @@
# - Try to find the OpenSSL encryption library
# Once done this will define
#
+# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
+#
+# Read-Only variables:
# OPENSSL_FOUND - system has the OpenSSL library
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
@@ -8,7 +11,7 @@
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
-# Copyright 2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -21,8 +24,23 @@
# License text for the above reference.)
# http://www.slproweb.com/products/Win32OpenSSL.html
+SET(_OPENSSL_ROOT_HINTS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+ )
+SET(_OPENSSL_ROOT_PATHS
+ "C:/OpenSSL/"
+ )
+FIND_PATH(OPENSSL_ROOT_DIR
+ NAMES include/openssl/ssl.h
+ HINTS ${_OPENSSL_ROOT_HINTS}
+ PATHS ${_OPENSSL_ROOT_PATHS}
+)
+MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
+
+# Re-use the previous path:
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/include"
+ ${OPENSSL_ROOT_DIR}/include
)
IF(WIN32 AND NOT CYGWIN)
@@ -43,16 +61,16 @@ IF(WIN32 AND NOT CYGWIN)
# libeay32MD.lib is identical to ../libeay32.lib, and
# ssleay32MD.lib is identical to ../ssleay32.lib
FIND_LIBRARY(LIB_EAY_DEBUG NAMES libeay32MDd libeay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
+ ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(LIB_EAY_RELEASE NAMES libeay32MD libeay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
+ ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_DEBUG NAMES ssleay32MDd ssleay32 ssl
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
+ ${OPENSSL_ROOT_DIR}/lib/VC
)
FIND_LIBRARY(SSL_EAY_RELEASE NAMES ssleay32MD ssleay32 ssl
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/VC"
+ ${OPENSSL_ROOT_DIR}/lib/VC
)
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( OPENSSL_LIBRARIES
@@ -67,20 +85,20 @@ IF(WIN32 AND NOT CYGWIN)
ELSEIF(MINGW)
# same player, for MingW
FIND_LIBRARY(LIB_EAY NAMES libeay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/MinGW"
+ ${OPENSSL_ROOT_DIR}/lib/MinGW
)
FIND_LIBRARY(SSL_EAY NAMES ssleay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib/MinGW"
+ ${OPENSSL_ROOT_DIR}/lib/MinGW
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
ELSE(MSVC)
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
FIND_LIBRARY(LIB_EAY NAMES libeay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib"
+ ${OPENSSL_ROOT_DIR}/lib
)
FIND_LIBRARY(SSL_EAY NAMES ssleay32
- PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]/lib"
+ ${OPENSSL_ROOT_DIR}/lib
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
new file mode 100644
index 0000000..e96e1d9
--- /dev/null
+++ b/Modules/FindPostgreSQL.cmake
@@ -0,0 +1,181 @@
+# Find the PostgreSQL installation.
+#
+# ----------------------------------------------------------------------------
+# Usage:
+# In your CMakeLists.txt file do something like this:
+# ...
+# # PostgreSQL
+# FIND_PACKAGE(PostgreSQL)
+# ...
+# if( PostgreSQL_FOUND )
+# include_directories(${PostgreSQL_INCLUDE_DIRS})
+# link_directories(${PostgreSQL_LIBRARY_DIRS})
+# endif( PostgreSQL_FOUND )
+# ...
+# Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement.
+#
+#
+# In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory
+# will be C:\Program Files\PostgreSQL.
+#
+
+#=============================================================================
+# Copyright 2004-2009 Kitware, Inc.
+#
+# 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.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# ----------------------------------------------------------------------------
+# History:
+# This module is derived from the module originally found in the VTK source tree.
+#
+# ----------------------------------------------------------------------------
+# Note:
+# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
+# version mumber of the implementation of PostgreSQL.
+# In Windows the default installation of PostgreSQL uses that as part of the path.
+# E.g C:\Program Files\PostgreSQL\8.4.
+# Currently, the following version numbers are known to this module:
+# "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
+#
+# To use this variable just do something like this:
+# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
+# before calling FIND_PACKAGE(PostgreSQL) in your CMakeLists.txt file.
+# This will mean that the versions you set here will be found first in the order
+# specified before the default ones are searched.
+#
+# ----------------------------------------------------------------------------
+# You may need to manually set:
+# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are.
+# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are.
+# If FindPostgreSQL.cmake cannot find the include files or the library files.
+#
+# ----------------------------------------------------------------------------
+# The following variables are set if PostgreSQL is found:
+# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
+# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
+# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
+# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
+#
+# ----------------------------------------------------------------------------
+# If you have installed PostgreSQL in a non-standard location.
+# (Please note that in the following comments, it is assumed that <Your Path>
+# points to the root directory of the include directory of PostgreSQL.)
+# Then you have three options.
+# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
+# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
+# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
+# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
+# SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
+# installed PostgreSQL, e.g. <Your Path>.
+#
+# ----------------------------------------------------------------------------
+
+set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
+set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
+set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
+set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
+set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
+
+
+set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
+if(PostgreSQL_ROOT_DIRECTORIES)
+ file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
+endif(PostgreSQL_ROOT_DIRECTORIES)
+
+set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
+ "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+
+# Define additional search paths for root directories.
+if ( WIN32 )
+ foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
+ set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
+ endforeach(suffix)
+endif( WIN32 )
+set( PostgreSQL_ROOT_DIRECTORIES
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ ${PostgreSQL_ROOT}
+ ${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
+)
+
+#
+# Look for an installation.
+#
+find_path(PostgreSQL_INCLUDE_DIR
+ NAMES libpq-fe.h
+ PATHS
+ # Look in other places.
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ PATH_SUFFIXES
+ postgresql
+ include
+ # Help the user find it if we cannot.
+ DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
+)
+
+# The PostgreSQL library.
+set (PostgreSQL_LIBRARY_TO_FIND pq)
+# Setting some more prefixes for the library
+set (PostgreSQL_LIB_PREFIX "")
+if ( WIN32 )
+ set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
+ set ( PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
+endif()
+
+find_library( PostgreSQL_LIBRARY
+ NAMES ${PostgreSQL_LIBRARY_TO_FIND}
+ PATHS
+ ${PostgreSQL_ROOT_DIRECTORIES}
+ PATH_SUFFIXES
+ lib
+)
+get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
+
+# Did we find anything?
+set( PostgreSQL_FOUND 0 )
+if ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+ set( PostgreSQL_FOUND 1 )
+else ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+ if ( POSTGRES_REQUIRED )
+ message( FATAL_ERROR "PostgreSQL is required. ${PostgreSQL_ROOT_DIR_MESSAGE}" )
+ endif ( POSTGRES_REQUIRED )
+endif (EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" )
+
+# Now try to get the include and library path.
+if(PostgreSQL_FOUND)
+
+ if(EXISTS "${PostgreSQL_INCLUDE_DIR}")
+ set(PostgreSQL_INCLUDE_DIRS
+ ${PostgreSQL_INCLUDE_DIR}
+ )
+ endif(EXISTS "${PostgreSQL_INCLUDE_DIR}")
+
+ if(EXISTS "${PostgreSQL_LIBRARY_DIR}")
+ set(PostgreSQL_LIBRARY_DIRS
+ ${PostgreSQL_LIBRARY_DIR}
+ )
+ set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND})
+ endif(EXISTS "${PostgreSQL_LIBRARY_DIR}")
+
+ #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}")
+ #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}")
+ #message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}")
+endif(PostgreSQL_FOUND)
+
+if(NOT PostgreSQL_FOUND)
+ if(NOT PostgreSQL_FIND_QUIETLY)
+ message(STATUS "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}")
+ else(NOT PostgreSQL_FIND_QUIETLY)
+ if(PostgreSQL_FIND_REQUIRED)
+ message(FATAL_ERROR "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}")
+ endif(PostgreSQL_FIND_REQUIRED)
+ endif(NOT PostgreSQL_FIND_QUIETLY)
+endif(NOT PostgreSQL_FOUND)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index f2de4c9..5f0bfe7 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -358,35 +358,95 @@ SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
SET( QT_DEFINITIONS "")
-SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+# convenience macro for dealing with debug/release library names
+MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
+
+ STRING(TOUPPER "${_camelCaseBasename}" basename)
+
+ # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
+ # since it is stored in EXPORT-files as name of a required library. If the name would change
+ # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
+ IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF(NOT TARGET Qt4::${_camelCaseBasename})
+ ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
+
+ IF (QT_${basename}_LIBRARY_RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+ ENDIF (QT_${basename}_LIBRARY_RELEASE)
+
+ IF (QT_${basename}_LIBRARY_DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+ ENDIF (QT_${basename}_LIBRARY_DEBUG)
+ ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
+
+ # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
+ # imported targets. This works better in general, and is also in almost all cases fully
+ # backward compatible. The only issue is when a project A which had this enabled then exports its
+ # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
+ # A will depend on the imported Qt targets, and the names of these imported targets will be stored
+ # in the dependency files on disk. This means when a project B then uses project A, these imported
+ # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
+ # library file on disk, and not as a target, and linking will fail:
+ IF(QT_USE_IMPORTED_TARGETS)
+ SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
+ SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
+ ELSE(QT_USE_IMPORTED_TARGETS)
+
+ # if the release- as well as the debug-version of the library have been found:
+ IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+
+ # if only the release version was found, set the debug variable also to the release version
+ IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
+ ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+
+ # put the value in the cache:
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
+
+ ENDIF(QT_USE_IMPORTED_TARGETS)
+
+ SET(QT_${basename}_FOUND 1)
+
+ ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE)
+
+ ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF (QT_${basename}_INCLUDE_DIR)
+ #add the include directory to QT_INCLUDES
+ SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+ ENDIF (QT_${basename}_INCLUDE_DIR)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+ENDMACRO (_QT4_ADJUST_LIB_VARS)
-# macro for asking qmake to process pro files
-MACRO(QT_QUERY_QMAKE outvar invar)
- IF(QT_QMAKE_EXECUTABLE)
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
- "message(CMAKE_MESSAGE<$$${invar}>)")
-
- # Invoke qmake with the tmp.pro program to get the desired
- # information. Use the same variable for both stdout and stderr
- # to make sure we get the output on all platforms.
- EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
- WORKING_DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
- OUTPUT_VARIABLE _qmake_query_output
- RESULT_VARIABLE _qmake_result
- ERROR_VARIABLE _qmake_query_output )
-
- FILE(REMOVE_RECURSE
- "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
-
- IF(_qmake_result)
- MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}")
- ELSE(_qmake_result)
- STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
- ENDIF(_qmake_result)
-
- ENDIF(QT_QMAKE_EXECUTABLE)
-ENDMACRO(QT_QUERY_QMAKE)
+
+SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
# check for qmake
@@ -496,53 +556,147 @@ ENDIF (QT_QMAKE_EXECUTABLE)
IF (QT4_QMAKE_FOUND)
- # ask qmake for the library dir
- # Set QT_LIBRARY_DIR
- IF (NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
+ # ask qmake for the mkspecs directory
+ # we do this first because QT_LIBINFIX might be set
+ IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
+ EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
+ ARGS "-query QMAKE_MKSPECS"
+ OUTPUT_VARIABLE qt_mkspecs_dirs )
+ # do not replace : on windows as it might be a drive letter
+ # and windows should already use ; as a separator
+ IF(NOT WIN32)
+ STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
+ ENDIF(NOT WIN32)
+ set(qt_cross_paths)
+ foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
+ set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs")
+ endforeach(qt_cross_path)
+ SET(QT_MKSPECS_DIR NOTFOUND)
+ FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
+ HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
+ DOC "The location of the Qt mkspecs containing qconfig.pri")
+ ENDIF()
+
+ IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+ STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
+ STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
+ ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ IF("${QT_EDITION}" MATCHES "DesktopLight")
+ SET(QT_EDITION_DESKTOPLIGHT 1)
+ ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
+
+ # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
+ # others and for setting QT_LIBRARY_DIR
+ IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_LIBS"
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP)
- IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
- SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir" FORCE)
- ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
- MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
- MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
- ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
- ENDIF(NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
-
+ SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+ NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ )
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+ NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
+ HINTS ${QT_LIBRARY_DIR_TMP}
+ )
+ ENDIF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
+
+ _QT4_ADJUST_LIB_VARS(QtCore)
+
+ # set QT_LIBRARY_DIR based on location of QtCore found.
+ IF(QT_QTCORE_LIBRARY_RELEASE)
+ GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH)
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ SET(QT_QTCORE_FOUND 1)
+ ELSEIF(QT_QTCORE_LIBRARY_DEBUG)
+ GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH)
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
+ SET(QT_QTCORE_FOUND 1)
+ ELSE()
+ MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
+ MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
+
+ # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+ IF(QT_LIBRARY_DIR AND MSVC)
+ IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+ MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.")
+ ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a)
+ ENDIF(QT_LIBRARY_DIR AND MSVC)
+
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+ ENDIF(Qt4_FIND_REQUIRED)
+ ENDIF()
+
IF (APPLE)
IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS ON
- CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE)
ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
- SET(QT_USE_FRAMEWORKS OFF
- CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE)
ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
-
MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
ENDIF (APPLE)
# ask qmake for the binary dir
- IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_BINS"
OUTPUT_VARIABLE qt_bins )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins)
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the include dir
- IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+ IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers)
- SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "" FORCE)
- ENDIF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+ SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
+ FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
+ HINTS ${qt_headers}
+ ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ PATH_SUFFIXES QtCore
+ )
+
+ # Set QT_HEADERS_DIR based on finding QtCore header
+ IF(QT_QTCORE_INCLUDE_DIR)
+ IF(QT_USE_FRAMEWORKS)
+ SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ ELSE(QT_USE_FRAMEWORKS)
+ GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE)
+ SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE)
+ ENDIF(QT_USE_FRAMEWORKS)
+ ELSEIF()
+ MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}")
+ MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.")
+ ENDIF()
+ ENDIF()
+
+ # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR
+ IF(QT_HEADERS_DIR)
+ IF(QT_USE_FRAMEWORKS)
+ # Qt/Mac frameworks has two include dirs.
+ # One is the framework include for which CMake will add a -F flag
+ # and the other is an include dir for non-framework Qt modules
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY} )
+ ELSE(QT_USE_FRAMEWORKS)
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+ ENDIF(QT_USE_FRAMEWORKS)
+ ENDIF(QT_HEADERS_DIR)
+
+ # Set QT_INCLUDES
+ SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
# ask qmake for the documentation directory
@@ -555,21 +709,6 @@ IF (QT4_QMAKE_FOUND)
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
- # ask qmake for the mkspecs directory
- IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
- EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
- ARGS "-query QMAKE_MKSPECS"
- OUTPUT_VARIABLE qt_mkspecs_dirs )
- # do not replace : on windows as it might be a drive letter
- # and windows should already use ; as a separator
- IF(UNIX)
- STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
- ENDIF(UNIX)
- SET(QT_MKSPECS_DIR NOTFOUND)
- FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs}
- DOC "The location of the Qt mkspecs containing qconfig.pri"
- NO_DEFAULT_PATH )
- ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the plugins directory
IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
@@ -578,7 +717,13 @@ IF (QT4_QMAKE_FOUND)
OUTPUT_VARIABLE qt_plugins_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir)
- SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins" FORCE)
+ SET(QT_PLUGINS_DIR NOTFOUND)
+ foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
+ set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
+ endforeach(qt_cross_path)
+ FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
+ HINTS ${qt_cross_paths} ${qt_plugins_dir}
+ DOC "The location of the Qt plugins")
ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the translations directory
@@ -596,6 +741,8 @@ IF (QT4_QMAKE_FOUND)
QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
+
+
#############################################
#
# Find out what window system we're using
@@ -605,11 +752,7 @@ IF (QT4_QMAKE_FOUND)
SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
- SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_HEADERS_DIR}")
- # On Mac OS X when Qt has framework support, also add the framework path
- IF( QT_USE_FRAMEWORKS )
- SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
- ENDIF( QT_USE_FRAMEWORKS )
+ SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
# Check for Window system symbols (note: only one should end up being set)
CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
@@ -643,7 +786,7 @@ IF (QT4_QMAKE_FOUND)
#
########################################
- SET(QT_MODULES QtCore QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
+ SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia
QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
QtDeclarative)
@@ -676,10 +819,10 @@ IF (QT4_QMAKE_FOUND)
SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
- IF(WIN32)
+ IF(Q_WS_WIN)
SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
- ENDIF(WIN32)
+ ENDIF(Q_WS_WIN)
ENDIF(QT_QMAKE_CHANGED)
FOREACH(QT_MODULE ${QT_MODULES})
@@ -702,20 +845,18 @@ IF (QT4_QMAKE_FOUND)
ENDIF(${QT_MODULE} STREQUAL "phonon")
ENDFOREACH(QT_MODULE)
- IF(WIN32)
+ IF(Q_WS_WIN)
SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
- PATHS
- ${QT_HEADERS_DIR}/ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH
)
FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
- PATHS
- ${QT_HEADERS_DIR}/ActiveQt
+ PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH
)
- ENDIF(WIN32)
+ ENDIF(Q_WS_WIN)
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
@@ -741,49 +882,6 @@ IF (QT4_QMAKE_FOUND)
NO_DEFAULT_PATH
)
- # Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
- IF( QT_QTCORE_INCLUDE_DIR )
- IF (QT_USE_FRAMEWORKS)
- SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
- ELSE (QT_USE_FRAMEWORKS)
- STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
- SET( QT_INCLUDE_DIR ${qt4_include_dir})
- ENDIF (QT_USE_FRAMEWORKS)
- ENDIF( QT_QTCORE_INCLUDE_DIR )
-
- IF( NOT QT_INCLUDE_DIR)
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could NOT find QtCore header")
- ENDIF(Qt4_FIND_REQUIRED)
- ENDIF( NOT QT_INCLUDE_DIR)
-
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED( QT_INCLUDE_DIR )
-
- # Set QT_INCLUDES
- SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
-
-
-
-
-
- #######################################
- #
- # Qt configuration
- #
- #######################################
- IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
- STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
- STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
- STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
- ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
- IF("${QT_EDITION}" MATCHES "DesktopLight")
- SET(QT_EDITION_DESKTOPLIGHT 1)
- ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
-
########################################
#
# Setting the LIBRARY-Variables
@@ -808,48 +906,32 @@ IF (QT4_QMAKE_FOUND)
FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
- IF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
-
- # try dropping a hint if trying to use Visual Studio with Qt built by mingw
- IF(QT_LIBRARY_DIR AND MSVC)
- IF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
- MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw")
- ENDIF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
- ENDIF(QT_LIBRARY_DIR AND MSVC)
-
- IF(Qt4_FIND_REQUIRED)
- MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
- ENDIF(Qt4_FIND_REQUIRED)
- ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
-
# Set QT_QTDESIGNERCOMPONENTS_LIBRARY
- FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTMAIN_LIBRARY
- IF(WIN32)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}
- NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR}
- NO_DEFAULT_PATH)
- ENDIF(WIN32)
+ IF(Q_WS_WIN)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ ENDIF(Q_WS_WIN)
# Set QT_QTASSISTANTCLIENT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTASSISTANT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTHELP_LIBRARY
- FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- # QtCLucene not with other frameworks with binary installation (in /usr/lib)
IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+
############################################
#
# Check the existence of the libraries.
@@ -863,137 +945,23 @@ IF (QT4_QMAKE_FOUND)
ENDIF(QT_USE_FRAMEWORKS)
- MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
-
- STRING(TOUPPER "${_camelCaseBasename}" basename)
-
- # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
- # since it is stored in EXPORT-files as name of a required library. If the name would change
- # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
- IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
-
- IF(NOT TARGET Qt4::${_camelCaseBasename})
- ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
-
- IF (QT_${basename}_LIBRARY_RELEASE)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
- ENDIF (QT_${basename}_LIBRARY_RELEASE)
-
- IF (QT_${basename}_LIBRARY_DEBUG)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
- ENDIF (QT_${basename}_LIBRARY_DEBUG)
- ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
-
- # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
- # imported targets. This works better in general, and is also in almost all cases fully
- # backward compatible. The only issue is when a project A which had this enabled then exports its
- # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
- # A will depend on the imported Qt targets, and the names of these imported targets will be stored
- # in the dependency files on disk. This means when a project B then uses project A, these imported
- # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
- # library file on disk, and not as a target, and linking will fail:
- IF(QT_USE_IMPORTED_TARGETS)
- SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
- SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
- ELSE(QT_USE_IMPORTED_TARGETS)
-
- # if the release- as well as the debug-version of the library have been found:
- IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
- # if the generator supports configuration types then set
- # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- # then just use the release libraries
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
- ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
- SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
-
- # if only the release version was found, set the debug variable also to the release version
- IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
- SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
- ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
-
- # if only the debug version was found, set the release variable also to the debug version
- IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
- SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
- SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
- ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
-
- # put the value in the cache:
- SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
-
- ENDIF(QT_USE_IMPORTED_TARGETS)
-
-# message(STATUS "QT_${basename}_LIBRARY: ${QT_${basename}_LIBRARY}")
-
- SET(QT_${basename}_FOUND 1)
-
- ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
-
- IF (QT_${basename}_INCLUDE_DIR)
- #add the include directory to QT_INCLUDES
- SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
- ENDIF (QT_${basename}_INCLUDE_DIR)
-
- # Make variables changeble to the advanced user
- MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
- ENDMACRO (_QT4_ADJUST_LIB_VARS)
-
-
# Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
- _QT4_ADJUST_LIB_VARS(QtCore)
- _QT4_ADJUST_LIB_VARS(QtGui)
- _QT4_ADJUST_LIB_VARS(Qt3Support)
+ FOREACH(QT_MODULE ${QT_MODULES})
+ _QT4_ADJUST_LIB_VARS(${QT_MODULE})
+ ENDFOREACH(QT_MODULE)
+
_QT4_ADJUST_LIB_VARS(QtAssistant)
_QT4_ADJUST_LIB_VARS(QtAssistantClient)
_QT4_ADJUST_LIB_VARS(QtCLucene)
- _QT4_ADJUST_LIB_VARS(QtDBus)
- _QT4_ADJUST_LIB_VARS(QtDeclarative)
- _QT4_ADJUST_LIB_VARS(QtDesigner)
_QT4_ADJUST_LIB_VARS(QtDesignerComponents)
- _QT4_ADJUST_LIB_VARS(QtHelp)
- _QT4_ADJUST_LIB_VARS(QtMultimedia)
- _QT4_ADJUST_LIB_VARS(QtNetwork)
- _QT4_ADJUST_LIB_VARS(QtNsPlugin)
- _QT4_ADJUST_LIB_VARS(QtOpenGL)
- _QT4_ADJUST_LIB_VARS(QtScript)
- _QT4_ADJUST_LIB_VARS(QtScriptTools)
- _QT4_ADJUST_LIB_VARS(QtSql)
- _QT4_ADJUST_LIB_VARS(QtSvg)
- _QT4_ADJUST_LIB_VARS(QtTest)
- _QT4_ADJUST_LIB_VARS(QtUiTools)
- _QT4_ADJUST_LIB_VARS(QtWebKit)
- _QT4_ADJUST_LIB_VARS(QtXml)
- _QT4_ADJUST_LIB_VARS(QtXmlPatterns)
- _QT4_ADJUST_LIB_VARS(phonon)
# platform dependent libraries
- IF(Q_WS_X11)
- _QT4_ADJUST_LIB_VARS(QtMotif)
- ENDIF(Q_WS_X11)
- IF(WIN32)
+ IF(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain)
_QT4_ADJUST_LIB_VARS(QAxServer)
_QT4_ADJUST_LIB_VARS(QAxContainer)
- ENDIF(WIN32)
-
- # If Qt is installed as a framework, we need to add QT_QTCORE_LIBRARY here (which
- # is the framework directory in that case), since this will make the cmake include_directories()
- # command recognize that we need the framework flag with the respective directory (-F)
- IF(QT_USE_FRAMEWORKS)
- SET(QT_INCLUDES ${QT_INCLUDES} ${QT_QTCORE_LIBRARY} )
- SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_QTCORE_LIBRARY} )
- ENDIF(QT_USE_FRAMEWORKS)
-
+ ENDIF(Q_WS_WIN)
#######################################
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 459129b..2a74304 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -5,6 +5,8 @@
# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
# CMAKE_USE_PTHREADS_INIT - are we using pthreads
# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
+# For systems with multiple thread libraries, caller can set
+# CMAKE_THREAD_PREFER_PTHREADS
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -24,11 +26,11 @@ INCLUDE (CheckLibraryExists)
SET(Threads_FOUND FALSE)
# Do we have sproc?
-IF(CMAKE_SYSTEM MATCHES IRIX)
+IF(CMAKE_SYSTEM MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
ENDIF()
-IF(CMAKE_HAVE_SPROC_H)
+IF(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
# We have sproc
SET(CMAKE_USE_SPROC_INIT 1)
ELSE()
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index b437e6b..7432257 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -38,7 +38,7 @@ MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
IF (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
FILE(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H)
- STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
+ STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 24cee55..f984c58 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -526,6 +526,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "ldd")
set(gp_cmd_args "")
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t ]+).*${eol_char}$")
+ set(gp_regex_error "not found${eol_char}$")
+ set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
endif("${gp_tool}" STREQUAL "ldd")
@@ -533,6 +535,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "otool")
set(gp_cmd_args "-L")
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$")
+ set(gp_regex_error "")
+ set(gp_regex_fallback "")
set(gp_regex_cmp_count 3)
set(gp_tool_known 1)
endif("${gp_tool}" STREQUAL "otool")
@@ -540,6 +544,8 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if("${gp_tool}" STREQUAL "dumpbin")
set(gp_cmd_args "/dependents")
set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$")
+ set(gp_regex_error "")
+ set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
set(gp_tool_known 1)
set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE.
@@ -629,8 +635,13 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
foreach(candidate ${candidates})
if("${candidate}" MATCHES "${gp_regex}")
+
# Extract information from each candidate:
- string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
+ if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}")
+ else(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
+ string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}")
+ endif(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}")
if(gp_regex_cmp_count GREATER 1)
string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}")
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index 652bed4..076410a 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -25,6 +25,7 @@ IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
+SET(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
IF(CMAKE_COMPILER_IS_GNUCXX)
# include the gcc flags
diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake
index c66feed..8273a19 100644
--- a/Modules/Platform/Windows-GNU-Fortran.cmake
+++ b/Modules/Platform/Windows-GNU-Fortran.cmake
@@ -1,2 +1,3 @@
include(Platform/Windows-GNU)
__windows_compiler_gnu(Fortran)
+set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 6d84940..af03841 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -68,6 +68,8 @@ macro(__windows_compiler_gnu lang)
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
# Binary link rules.
set(CMAKE_${lang}_CREATE_SHARED_MODULE
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index ccbc828..2e03716 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -34,12 +34,12 @@ SET(QT_QTDBUS_LIB_DEPENDENCIES "")
SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
-IF(WIN32)
+IF(Q_WS_WIN)
# On Windows, qconfig.pri has "static" for static library builds
IF(QT_CONFIG MATCHES "static")
SET(QT_IS_STATIC 1)
ENDIF(QT_CONFIG MATCHES "static")
-ELSE(WIN32)
+ELSE(Q_WS_WIN)
# On other platforms, check file extension to know if its static
IF(QT_QTCORE_LIBRARY_RELEASE)
GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
@@ -53,12 +53,12 @@ ELSE(WIN32)
SET(QT_IS_STATIC 1)
ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
ENDIF(QT_QTCORE_LIBRARY_DEBUG)
-ENDIF(WIN32)
+ENDIF(Q_WS_WIN)
# build using shared Qt needs -DQT_DLL on Windows
-IF(WIN32 AND NOT QT_IS_STATIC)
+IF(Q_WS_WIN AND NOT QT_IS_STATIC)
SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
-ENDIF(WIN32 AND NOT QT_IS_STATIC)
+ENDIF(Q_WS_WIN AND NOT QT_IS_STATIC)
IF(NOT QT_IS_STATIC)
RETURN()
@@ -71,11 +71,8 @@ SET (QT_QTOPENGL_LIB_DEPENDENCIES ${OPENGL_glu_LIBRARY} ${OPENGL_gl_LIBRARY})
## system png
IF(QT_QCONFIG MATCHES "system-png")
- FIND_LIBRARY(QT_PNG_LIBRARY NAMES png)
- MARK_AS_ADVANCED(QT_PNG_LIBRARY)
- IF(QT_PNG_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY})
- ENDIF(QT_PNG_LIBRARY)
+ find_package(PNG)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
ENDIF(QT_QCONFIG MATCHES "system-png")
@@ -141,16 +138,6 @@ IF(QT_QCONFIG MATCHES "xfixes")
ENDIF(QT_QCONFIG MATCHES "xfixes")
-## system-freetype
-IF(QT_QCONFIG MATCHES "system-freetype")
- FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype)
- MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY)
- IF(QT_FREETYPE_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY})
- ENDIF(QT_FREETYPE_LIBRARY)
-ENDIF(QT_QCONFIG MATCHES "system-freetype")
-
-
## fontconfig
IF(QT_QCONFIG MATCHES "fontconfig")
FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
@@ -161,13 +148,19 @@ IF(QT_QCONFIG MATCHES "fontconfig")
ENDIF(QT_QCONFIG MATCHES "fontconfig")
+## system-freetype
+IF(QT_QCONFIG MATCHES "system-freetype")
+ find_package(Freetype)
+ if(FREETYPE_LIBRARIES)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${FREETYPE_LIBRARIES})
+ endif(FREETYPE_LIBRARIES)
+ENDIF(QT_QCONFIG MATCHES "system-freetype")
+
+
## system-zlib
IF(QT_QCONFIG MATCHES "system-zlib")
- FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
- MARK_AS_ADVANCED(QT_ZLIB_LIBRARY)
- IF(QT_ZLIB_LIBRARY)
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY})
- ENDIF(QT_ZLIB_LIBRARY)
+ find_package(ZLIB)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${ZLIB_LIBRARIES})
ENDIF(QT_QCONFIG MATCHES "system-zlib")
@@ -192,29 +185,11 @@ ENDIF(NOT Q_WS_WIN)
## dbus
IF(QT_QCONFIG MATCHES "dbus")
- # if the dbus library isn't found, we'll assume its not required to build
- # shared Qt on Linux doesn't require it
- IF(NOT QT_DBUS_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L dbus-1
- OUTPUT_VARIABLE _dbus_query_output
- RESULT_VARIABLE _dbus_result
- ERROR_VARIABLE _dbus_query_output )
-
- IF(_dbus_result MATCHES 0)
- STRING(REPLACE "-L" "" _dbus_query_output "${_dbus_query_output}")
- SEPARATE_ARGUMENTS(_dbus_query_output)
- ELSE(_dbus_result MATCHES 0)
- SET(_dbus_query_output)
- ENDIF(_dbus_result MATCHES 0)
-
- FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 PATHS ${_dbus_query_output} )
-
- IF(QT_DBUS_LIBRARY)
- SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
- ENDIF(QT_DBUS_LIBRARY)
-
- MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
- ENDIF(NOT QT_DBUS_LIBRARY)
+ FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 )
+ IF(QT_DBUS_LIBRARY)
+ SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
+ ENDIF(QT_DBUS_LIBRARY)
+ MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
ENDIF(QT_QCONFIG MATCHES "dbus")
@@ -222,29 +197,11 @@ ENDIF(QT_QCONFIG MATCHES "dbus")
## glib
IF(QT_QCONFIG MATCHES "glib")
- # if the glib libraries aren't found, we'll assume its not required to build
- # shared Qt on Linux doesn't require it
-
# Qt 4.2.0+ uses glib-2.0
- IF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L glib-2.0 gthread-2.0
- OUTPUT_VARIABLE _glib_query_output
- RESULT_VARIABLE _glib_result
- ERROR_VARIABLE _glib_query_output )
-
- IF(_glib_result MATCHES 0)
- STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
- SEPARATE_ARGUMENTS(_glib_query_output)
- ELSE(_glib_result MATCHES 0)
- SET(_glib_query_output)
- ENDIF(_glib_result MATCHES 0)
-
- FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 PATHS ${_glib_query_output} )
- FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 PATHS ${_glib_query_output} )
-
- MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
- MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
- ENDIF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
+ FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 )
+ FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 )
+ MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
+ MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
@@ -254,23 +211,8 @@ IF(QT_QCONFIG MATCHES "glib")
# Qt 4.5+ also links to gobject-2.0
IF(QT_VERSION_MINOR GREATER 4)
- IF(NOT QT_GOBJECT_LIBRARY)
- EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L gobject-2.0
- OUTPUT_VARIABLE _glib_query_output
- RESULT_VARIABLE _glib_result
- ERROR_VARIABLE _glib_query_output )
-
- IF(_glib_result MATCHES 0)
- STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
- SEPARATE_ARGUMENTS(_glib_query_output)
- ELSE(_glib_result MATCHES 0)
- SET(_glib_query_output)
- ENDIF(_glib_result MATCHES 0)
-
- FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
-
- MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
- ENDIF(NOT QT_GOBJECT_LIBRARY)
+ FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
+ MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
IF(QT_GOBJECT_LIBRARY)
SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
@@ -301,8 +243,11 @@ IF(Q_WS_X11)
# X11 libraries Qt always depends on
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
- QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
+ set(CMAKE_THREAD_PREFER_PTHREADS 1)
+ find_package(Threads)
+ if(CMAKE_USE_PTHREADS_INIT)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
+ endif(CMAKE_USE_PTHREADS_INIT)
SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index 63a0919..ea0ab95 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -27,9 +27,9 @@ INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
SET(QT_LIBRARIES "")
IF (QT_USE_QTMAIN)
- IF (WIN32)
+ IF (Q_WS_WIN)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
- ENDIF (WIN32)
+ ENDIF (Q_WS_WIN)
ENDIF (QT_USE_QTMAIN)
IF(QT_DONT_USE_QTGUI)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index dc73cec..dbbb558 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -111,6 +111,7 @@ ENDIF(CMAKE_USE_ELF_PARSER)
# Sources for CMakeLib
#
SET(SRCS
+ cmStandardIncludes.cxx
cmBootstrapCommands.cxx
cmCacheManager.cxx
cmCacheManager.h
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 9c77cc1..cee24ef 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -135,7 +135,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
// now add all directories which have to be compressed
// collect all top level install dirs for that
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would give /usr and /opt
- int topLevelLength = strlen(toplevel);
+ size_t topLevelLength = strlen(toplevel);
std::set<std::string> installDirs;
for (std::vector<std::string>::const_iterator fileIt = files.begin();
fileIt != files.end(); ++ fileIt )
@@ -371,7 +371,7 @@ static const char * ar_rname(const char *path)
typedef struct ar_hdr HDR;
static char ar_hb[sizeof(HDR) + 1]; /* real header */
-static int ar_already_written;
+static size_t ar_already_written;
/* copy_ar --
* Copy size bytes from one file to another - taking care to handle the
@@ -431,7 +431,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
/* If not truncating names and the name is too long or contains
* a space, use extended format 1. */
- unsigned int lname = strlen(name);
+ size_t lname = strlen(name);
uid_t uid = sb->st_uid;
gid_t gid = sb->st_gid;
if (uid > USHRT_MAX) {
@@ -441,7 +441,7 @@ static int put_arobj(CF *cfp, struct stat *sb)
gid = USHRT_MAX;
}
if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
- (void)sprintf(ar_hb, HDR1, AR_EFMT1, lname,
+ (void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname,
(long int)sb->st_mtime, uid, gid, sb->st_mode,
(long long)sb->st_size + lname, ARFMAG);
else {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index ad77386..8329546 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -758,7 +758,7 @@ CreateComponentDescription(cmCPackComponent *component,
}
// Create the NSIS code to download this file on-the-fly.
- unsigned totalSizeInKbytes = (totalSize + 512) / 1024;
+ unsigned long totalSizeInKbytes = (totalSize + 512) / 1024;
if (totalSizeInKbytes == 0)
{
totalSizeInKbytes = 1;
diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h
index 228067e..9eb4907 100644
--- a/Source/CTest/cmCTestBuildCommand.h
+++ b/Source/CTest/cmCTestBuildCommand.h
@@ -60,10 +60,12 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " ctest_build([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
- " [NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
+ " ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res]\n"
+ " [APPEND][NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
"Builds the given build directory and stores results in Build.xml. "
- "If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used. "
+ "If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used.\n"
+ "The TARGET variable can be used to specify a build target. If none "
+ "is specified, the \"all\" target will be built.\n"
"The RETURN_VALUE option specifies a variable in which to store the "
"return value of the native build tool. "
"The NUMBER_ERRORS and NUMBER_WARNINGS options specify variables in "
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index bc02fbc..3c5993d 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -65,7 +65,7 @@ static const char* cmCTestErrorMatches[] = {
"^Unresolved:",
"Undefined symbols:",
"^Undefined[ \\t]+first referenced",
- "^CMake Error:",
+ "^CMake Error.*:",
":[ \\t]cannot find",
":[ \\t]can't find",
": \\*\\*\\* No rule to make target \\`.*\\'. Stop",
@@ -129,6 +129,7 @@ static const char* cmCTestWarningMatches[] = {
"\\([0-9]*\\): remark #[0-9]*",
"\".*\", line [0-9]+: remark\\([0-9]*\\):",
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
+ "^CMake Warning.*:",
0
};
@@ -174,8 +175,8 @@ cmCTestWarningErrorFileLine[] = {
//----------------------------------------------------------------------
cmCTestBuildHandler::cmCTestBuildHandler()
{
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->MaxErrors = 50;
this->MaxWarnings = 50;
@@ -214,8 +215,8 @@ void cmCTestBuildHandler::Initialize()
this->ErrorsAndWarnings.clear();
this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
this->PostContextCount = 0;
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->PreContext.clear();
this->TotalErrors = 0;
@@ -249,6 +250,20 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile *mf)
"CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS",
this->MaxWarnings);
+ int n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_PRE_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPreContext = static_cast<size_t>(n);
+ }
+
+ n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_POST_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPostContext = static_cast<size_t>(n);
+ }
+
// Record the user-specified custom warning rules.
if(const char* customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH"))
@@ -959,7 +974,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
this->ProcessBuffer(0, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue);
cmCTestLog(this->CTest, OUTPUT, " Size of output: "
- << int(this->BuildOutputLogSize / 1024.0) << "K" << std::endl);
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl);
// Properly handle output of the build command
cmsysProcess_WaitForExit(cp, 0);
@@ -1171,7 +1186,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Size: "
- << int((this->BuildOutputLogSize / 1024.0) + 1) << "K" << std::endl
+ << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl
<< " ");
}
}
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 3235bfd..55a5225 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -2038,8 +2038,12 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
for(std::vector<std::string>::iterator f = files.begin();
f != files.end(); ++f)
{
- extraMatches.insert(this->CTest->GetShortPathToFile(
- f->c_str()));
+ if(this->ShouldIDoCoverage(f->c_str(),
+ cont->SourceDir.c_str(), cont->BinaryDir.c_str()))
+ {
+ extraMatches.insert(this->CTest->GetShortPathToFile(
+ f->c_str()));
+ }
}
}
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index f5ba361..a49c852 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -85,16 +85,14 @@ void cmCTestGIT::NoteNewRevision()
}
//----------------------------------------------------------------------------
-bool cmCTestGIT::UpdateImpl()
+bool cmCTestGIT::UpdateByFetchAndReset()
{
const char* git = this->CommandLineTool.c_str();
- // Use "git pull" to update the working tree.
- std::vector<char const*> git_pull;
- git_pull.push_back(git);
- git_pull.push_back("pull");
-
- // TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
+ // Use "git fetch" to get remote commits.
+ std::vector<char const*> git_fetch;
+ git_fetch.push_back(git);
+ git_fetch.push_back("fetch");
// Add user-specified update options.
std::string opts = this->CTest->GetCTestConfiguration("UpdateOptions");
@@ -106,22 +104,88 @@ bool cmCTestGIT::UpdateImpl()
for(std::vector<cmStdString>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
- git_pull.push_back(ai->c_str());
+ git_fetch.push_back(ai->c_str());
}
// Sentinel argument.
- git_pull.push_back(0);
+ git_fetch.push_back(0);
- OutputLogger out(this->Log, "pull-out> ");
- OutputLogger err(this->Log, "pull-err> ");
- if(this->RunUpdateCommand(&git_pull[0], &out, &err))
+ // Fetch upstream refs.
+ OutputLogger fetch_out(this->Log, "fetch-out> ");
+ OutputLogger fetch_err(this->Log, "fetch-err> ");
+ if(!this->RunUpdateCommand(&git_fetch[0], &fetch_out, &fetch_err))
{
- char const* git_submodule[] = {git, "submodule", "update", 0};
- OutputLogger out2(this->Log, "submodule-out> ");
- OutputLogger err2(this->Log, "submodule-err> ");
- return this->RunChild(git_submodule, &out2, &err2);
+ return false;
}
- return false;
+
+ // Identify the merge head that would be used by "git pull".
+ std::string sha1;
+ {
+ std::string fetch_head = this->SourceDirectory + "/.git/FETCH_HEAD";
+ std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
+ std::string line;
+ while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
+ {
+ if(line.find("\tnot-for-merge\t") == line.npos)
+ {
+ std::string::size_type pos = line.find('\t');
+ if(pos != line.npos)
+ {
+ sha1 = line.substr(0, pos);
+ }
+ }
+ }
+ }
+
+ // Reset the local branch to point at that tracked from upstream.
+ char const* git_reset[] = {git, "reset", "--hard", sha1.c_str(), 0};
+ OutputLogger reset_out(this->Log, "reset-out> ");
+ OutputLogger reset_err(this->Log, "reset-err> ");
+ return this->RunChild(&git_reset[0], &reset_out, &reset_err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateByCustom(std::string const& custom)
+{
+ std::vector<std::string> git_custom_command;
+ cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
+ std::vector<char const*> git_custom;
+ for(std::vector<std::string>::const_iterator
+ i = git_custom_command.begin(); i != git_custom_command.end(); ++i)
+ {
+ git_custom.push_back(i->c_str());
+ }
+ git_custom.push_back(0);
+
+ OutputLogger custom_out(this->Log, "custom-out> ");
+ OutputLogger custom_err(this->Log, "custom-err> ");
+ return this->RunUpdateCommand(&git_custom[0], &custom_out, &custom_err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateInternal()
+{
+ std::string custom = this->CTest->GetCTestConfiguration("GITUpdateCustom");
+ if(!custom.empty())
+ {
+ return this->UpdateByCustom(custom);
+ }
+ return this->UpdateByFetchAndReset();
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateImpl()
+{
+ if(!this->UpdateInternal())
+ {
+ return false;
+ }
+
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_submodule[] = {git, "submodule", "update", 0};
+ OutputLogger submodule_out(this->Log, "submodule-out> ");
+ OutputLogger submodule_err(this->Log, "submodule-err> ");
+ return this->RunChild(git_submodule, &submodule_out, &submodule_err);
}
//----------------------------------------------------------------------------
@@ -253,8 +317,12 @@ protected:
\n
Log message indented by (4) spaces\n
(even blank lines have the spaces)\n
+ [[
\n
[Diff format]
+ OR
+ \0
+ ]]
The header may have more fields. See 'git help diff-tree'.
*/
@@ -308,6 +376,11 @@ private:
{
if(this->Line.empty())
{
+ if(this->Section == SectionBody && this->LineEnd == '\0')
+ {
+ // Skip SectionDiff
+ this->NextSection();
+ }
this->NextSection();
}
else
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index 0b6ad2e..d8681fe 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -32,6 +32,10 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
+ bool UpdateByFetchAndReset();
+ bool UpdateByCustom(std::string const& custom);
+ bool UpdateInternal();
+
void LoadRevisions();
void LoadModifications();
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 8a69780..d50eaaa 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -18,11 +18,29 @@
#include <stack>
#include <float.h>
+class TestComparator
+{
+public:
+ TestComparator(cmCTestMultiProcessHandler* handler) : Handler(handler) {}
+ ~TestComparator() {}
+
+ // Sorts tests in descending order of cost
+ bool operator() (int index1, int index2) const
+ {
+ return Handler->Properties[index1]->Cost >
+ Handler->Properties[index2]->Cost;
+ }
+
+private:
+ cmCTestMultiProcessHandler* Handler;
+};
+
cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
{
this->ParallelLevel = 1;
this->Completed = 0;
this->RunningCount = 0;
+ this->StopTimePassed = false;
}
cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
@@ -69,6 +87,10 @@ void cmCTestMultiProcessHandler::RunTests()
this->StartNextTests();
while(this->Tests.size() != 0)
{
+ if(this->StopTimePassed)
+ {
+ return;
+ }
this->CheckOutput();
this->StartNextTests();
}
@@ -87,6 +109,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
this->TestRunningMap[test] = true; // mark the test as running
// now remove the test itself
this->EraseTest(test);
+ this->RunningCount += GetProcessorsUsed(test);
cmCTestRunTest* testRun = new cmCTestRunTest(this->TestHandler);
testRun->SetIndex(test);
@@ -102,6 +125,12 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
{
this->RunningTests.insert(testRun);
}
+ else if(testRun->IsStopTimePassed())
+ {
+ this->StopTimePassed = true;
+ delete testRun;
+ return;
+ }
else
{
this->UnlockResources(test);
@@ -142,15 +171,8 @@ void cmCTestMultiProcessHandler::UnlockResources(int index)
void cmCTestMultiProcessHandler::EraseTest(int test)
{
this->Tests.erase(test);
- for(TestCostMap::iterator i = this->TestCosts.begin();
- i != this->TestCosts.end(); ++i)
- {
- if(i->second.find(test) != i->second.end())
- {
- i->second.erase(test);
- return;
- }
- }
+ this->SortedTests.erase(
+ std::find(this->SortedTests.begin(), this->SortedTests.end(), test));
}
//---------------------------------------------------------
@@ -232,38 +254,36 @@ void cmCTestMultiProcessHandler::StartNextTests()
return;
}
- for(TestCostMap::reverse_iterator i = this->TestCosts.rbegin();
- i != this->TestCosts.rend(); ++i)
+ TestList copy = this->SortedTests;
+ for(TestList::iterator test = copy.begin(); test != copy.end(); ++test)
{
- TestSet tests = i->second; //copy the test set
- for(TestSet::iterator test = tests.begin();
- test != tests.end(); ++test)
+ //in case this test has already been started due to dependency
+ if(this->TestRunningMap[*test] || this->TestFinishMap[*test])
{
- //in case this test has already been started due to dependency
- if(this->TestRunningMap[*test] || this->TestFinishMap[*test])
- {
- continue;
- }
- size_t processors = GetProcessorsUsed(*test);
- if(processors > numToStart)
- {
- return;
- }
- if(this->StartTest(*test))
- {
- numToStart -= processors;
- this->RunningCount += processors;
- }
- else
- {
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
- << "Test did not start waiting on depends to finish: "
- << *test << "\n");
- }
- if(numToStart == 0)
+ continue;
+ }
+ size_t processors = GetProcessorsUsed(*test);
+ if(processors > numToStart)
+ {
+ return;
+ }
+ if(this->StartTest(*test))
+ {
+ if(this->StopTimePassed)
{
return;
}
+ numToStart -= processors;
+ }
+ else
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
+ << "Test did not start waiting on depends to finish: "
+ << *test << "\n");
+ }
+ if(numToStart == 0)
+ {
+ return;
}
}
}
@@ -453,26 +473,22 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
for(TestMap::iterator i = this->Tests.begin();
i != this->Tests.end(); ++i)
{
- //We only want to schedule them by cost in a parallel situation
- if(this->ParallelLevel > 1)
- {
- std::string name = this->Properties[i->first]->Name;
- if(std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(),
- name) != this->LastTestsFailed.end())
- {
- this->TestCosts[FLT_MAX].insert(i->first);
- }
- else
- {
- this->TestCosts[this->Properties[i->first]->Cost].insert(i->first);
- }
- }
- else //we ignore their cost
+ SortedTests.push_back(i->first);
+
+ //If the test failed last time, it should be run first, so max the cost
+ if(std::find(this->LastTestsFailed.begin(),
+ this->LastTestsFailed.end(),
+ this->Properties[i->first]->Name)
+ != this->LastTestsFailed.end())
{
- this->TestCosts[this->Tests.size()
- - this->Properties[i->first]->Index].insert(i->first);
+ this->Properties[i->first]->Cost = FLT_MAX;
}
}
+ if(this->ParallelLevel > 1)
+ {
+ TestComparator comp(this);
+ std::sort(SortedTests.begin(), SortedTests.end(), comp);
+ }
}
//---------------------------------------------------------
@@ -595,7 +611,7 @@ int cmCTestMultiProcessHandler::FindMaxIndex()
//Returns true if no cycles exist in the dependency graph
bool cmCTestMultiProcessHandler::CheckCycles()
{
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Checking test dependency graph..." << std::endl);
for(TestMap::iterator it = this->Tests.begin();
it != this->Tests.end(); ++it)
@@ -603,34 +619,29 @@ bool cmCTestMultiProcessHandler::CheckCycles()
//DFS from each element to itself
std::stack<int> s;
std::vector<int> visited;
+
s.push(it->first);
- visited.push_back(it->first);
while(!s.empty())
{
int test = s.top();
s.pop();
-
+
for(TestSet::iterator d = this->Tests[test].begin();
d != this->Tests[test].end(); ++d)
{
- s.push(*d);
- for(std::vector<int>::iterator v = visited.begin();
- v != visited.end(); ++v)
+ if(std::find(visited.begin(), visited.end(), *d) != visited.end())
{
- if(*v == *d)
- {
- //cycle exists
- cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
- "the test dependency graph for the test \""
- << this->Properties[*d]->Name << "\"." << std::endl
- << "Please fix the cycle and run ctest again." << std::endl);
- return false;
- }
+ //cycle exists
+ cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
+ "the test dependency graph for the test \""
+ << this->Properties[it->first]->Name << "\"." << std::endl
+ << "Please fix the cycle and run ctest again." << std::endl);
+ return false;
}
- visited.push_back(*d);
+ s.push(*d);
}
- visited.pop_back();
+ visited.push_back(test);
}
}
return true;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index d4f6c71..cc330f7 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -23,10 +23,11 @@
*/
class cmCTestMultiProcessHandler
{
+ friend class TestComparator;
public:
struct TestSet : public std::set<int> {};
struct TestMap : public std::map<int, TestSet> {};
- struct TestCostMap : public std::map<float, TestSet> {};
+ struct TestList : public std::vector<int> {};
struct PropertiesMap : public
std::map<int, cmCTestTestHandler::cmCTestTestProperties*> {};
@@ -88,12 +89,13 @@ protected:
void UnlockResources(int index);
// map from test number to set of depend tests
TestMap Tests;
- TestCostMap TestCosts;
+ TestList SortedTests;
//Total number of tests we'll be running
size_t Total;
//Number of tests that are complete
size_t Completed;
size_t RunningCount;
+ bool StopTimePassed;
//list of test properties (indices concurrent to the test map)
PropertiesMap Properties;
std::map<int, bool> TestRunningMap;
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 4c9675b..ce44097 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -32,6 +32,7 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
this->ProcessOutput = "";
this->CompressedOutput = "";
this->CompressionRatio = 2;
+ this->StopTimePassed = false;
}
cmCTestRunTest::~cmCTestRunTest()
@@ -82,7 +83,8 @@ void cmCTestRunTest::CompressOutput()
reinterpret_cast<unsigned char*>(
const_cast<char*>(this->ProcessOutput.c_str()));
//zlib makes the guarantee that this is the maximum output size
- int outSize = static_cast<int>(this->ProcessOutput.size() * 1.001 + 13);
+ int outSize = static_cast<int>(
+ static_cast<double>(this->ProcessOutput.size()) * 1.001 + 13.0);
unsigned char* out = new unsigned char[outSize];
strm.zalloc = Z_NULL;
@@ -220,7 +222,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
{
outputTestErrorsToConsole = this->CTest->OutputTestOutputOnTestFailure;
cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Exception: ");
- switch ( retVal )
+ switch(this->TestProcess->GetExitException())
{
case cmsysProcess_Exception_Fault:
cmCTestLog(this->CTest, HANDLER_OUTPUT, "SegFault");
@@ -341,13 +343,14 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
//----------------------------------------------------------------------
void cmCTestRunTest::ComputeWeightedCost()
{
- int prev = this->TestProperties->PreviousRuns;
- float avgcost = this->TestProperties->Cost;
+ double prev = static_cast<double>(this->TestProperties->PreviousRuns);
+ double avgcost = static_cast<double>(this->TestProperties->Cost);
double current = this->TestResult.ExecutionTime;
if(this->TestResult.Status == cmCTestTestHandler::COMPLETED)
{
- this->TestProperties->Cost = ((prev * avgcost) + current) / (prev + 1);
+ this->TestProperties->Cost =
+ static_cast<float>(((prev * avgcost) + current) / (prev + 1.0));
this->TestProperties->PreviousRuns++;
}
}
@@ -436,8 +439,13 @@ bool cmCTestRunTest::StartTest(size_t total)
}
this->StartTime = this->CTest->CurrentTime();
- return this->ForkProcess(this->ResolveTimeout(),
- &this->TestProperties->Environment);
+ double timeout = this->ResolveTimeout();
+
+ if(this->StopTimePassed)
+ {
+ return false;
+ }
+ return this->ForkProcess(timeout, &this->TestProperties->Environment);
}
//----------------------------------------------------------------------
@@ -563,14 +571,15 @@ double cmCTestRunTest::ResolveTimeout()
{
stop_time += 24*60*60;
}
- int stop_timeout = (stop_time - current_time) % (24*60*60);
+ int stop_timeout = static_cast<int>(stop_time - current_time) % (24*60*60);
this->CTest->LastStopTimeout = stop_timeout;
if(stop_timeout <= 0 || stop_timeout > this->CTest->LastStopTimeout)
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "The stop time has been passed. "
- "Exiting ctest." << std::endl);
- exit(-1);
+ "Stopping all tests." << std::endl);
+ this->StopTimePassed = true;
+ return 0;
}
return timeout == 0 ? stop_timeout :
(timeout < stop_timeout ? timeout : stop_timeout);
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index d7d3a2f..e0cb888 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -39,6 +39,8 @@ public:
std::string GetProcessOutput() { return this->ProcessOutput; }
+ bool IsStopTimePassed() { return this->StopTimePassed; }
+
cmCTestTestHandler::cmCTestTestResult GetTestResults()
{ return this->TestResult; }
@@ -90,6 +92,7 @@ private:
std::string TestCommand;
std::string ActualCommand;
std::vector<std::string> Arguments;
+ bool StopTimePassed;
};
inline int getNumWidth(size_t n)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b9cee6c..a4a4863 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1036,9 +1036,9 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
bool randomSchedule = this->CTest->GetScheduleType() == "Random";
if(randomSchedule)
- {
+ {
srand((unsigned)time(0));
- }
+ }
for (ListOfTests::iterator it = this->TestList.begin();
it != this->TestList.end(); ++it)
@@ -1048,7 +1048,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
if(randomSchedule)
{
- p.Cost = rand();
+ p.Cost = static_cast<float>(rand());
}
if(p.Timeout == 0 && this->CTest->GetGlobalTimeout() != 0)
@@ -1309,7 +1309,8 @@ std::string cmCTestTestHandler::EncodeFile(std::string file)
cmSystemTools::RemoveFile(tarFile.c_str());
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
@@ -1881,7 +1882,8 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
unsigned char *file_buffer = new unsigned char [ len + 1 ];
ifs.read(reinterpret_cast<char*>(file_buffer), len);
unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(len * 1.5 + 5) ];
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
unsigned long rlen
= cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 571745d..8414349 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -52,6 +52,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
+ "GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM");
+ this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"HGCommand", "CTEST_HG_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"HGUpdateOptions", "CTEST_HG_UPDATE_OPTIONS");
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 9aa40d6..0ee631f 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -264,3 +264,9 @@ int cmProcess::ReportStatus()
return result;
}
+
+
+int cmProcess::GetExitException()
+{
+ return cmsysProcess_GetExitException(this->Process);
+}
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 01dacf9..ff99ca2 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -43,7 +43,7 @@ public:
void SetId(int id) { this->Id = id;}
int GetExitValue() { return this->ExitValue;}
double GetTotalTime() { return this->TotalTime;}
-
+ int GetExitException();
/**
* Read one line of output but block for no more than timeout.
* Returns:
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index c66147b..1c48d8c 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -53,13 +53,13 @@ void cmCursesLongMessageForm::UpdateStatusBar()
getmaxyx(stdscr, y, x);
char bar[cmCursesMainForm::MAX_WIDTH];
- int size = strlen(this->Title.c_str());
+ size_t size = strlen(this->Title.c_str());
if ( size >= cmCursesMainForm::MAX_WIDTH )
{
size = cmCursesMainForm::MAX_WIDTH-1;
}
strncpy(bar, this->Title.c_str(), size);
- for(int i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
+ for(size_t i=size-1; i<cmCursesMainForm::MAX_WIDTH; i++) bar[i] = ' ';
int width;
if (x < cmCursesMainForm::MAX_WIDTH )
@@ -76,8 +76,8 @@ void cmCursesLongMessageForm::UpdateStatusBar()
char version[cmCursesMainForm::MAX_WIDTH];
char vertmp[128];
sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
- int sideSpace = (width-strlen(vertmp));
- for(int i=0; i<sideSpace; i++) { version[i] = ' '; }
+ size_t sideSpace = (width-strlen(vertmp));
+ for(size_t i=0; i<sideSpace; i++) { version[i] = ' '; }
sprintf(version+sideSpace, "%s", vertmp);
version[width] = '\0';
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index cd231ad..389ec7f 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -242,7 +242,7 @@ void cmCursesMainForm::RePost()
// Assign the fields: 3 for each entry: label, new entry marker
// ('*' or ' ') and entry widget
this->Fields = new FIELD*[3*this->NumberOfVisibleEntries+1];
- int cc;
+ size_t cc;
for ( cc = 0; cc < 3 * this->NumberOfVisibleEntries+1; cc ++ )
{
this->Fields[cc] = 0;
@@ -454,7 +454,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
if (cw)
{
sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
- curses_move(0,65-strlen(firstLine)-1);
+ curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1);
printw(firstLine);
}
// }
@@ -526,10 +526,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
// Join the key, help string and pad with spaces
// (or truncate) as necessary
char bar[cmCursesMainForm::MAX_WIDTH];
- int i, curFieldLen = strlen(curField);
- int helpLen = strlen(help);
+ size_t i, curFieldLen = strlen(curField);
+ size_t helpLen = strlen(help);
- int width;
+ size_t width;
if (x < cmCursesMainForm::MAX_WIDTH )
{
width = x;
@@ -592,7 +592,7 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
char version[cmCursesMainForm::MAX_WIDTH];
char vertmp[128];
sprintf(vertmp,"CMake Version %s", cmVersion::GetCMakeVersion());
- int sideSpace = (width-strlen(vertmp));
+ size_t sideSpace = (width-strlen(vertmp));
for(i=0; i<sideSpace; i++) { version[i] = ' '; }
sprintf(version+sideSpace, "%s", vertmp);
version[width] = '\0';
@@ -795,8 +795,8 @@ void cmCursesMainForm::RemoveEntry(const char* value)
// copy from the list box to the cache manager
void cmCursesMainForm::FillCacheManagerFromUI()
{
- int size = this->Entries->size();
- for(int i=0; i < size; i++)
+ size_t size = this->Entries->size();
+ for(size_t i=0; i < size; i++)
{
cmCacheManager::CacheIterator it =
this->CMakeInstance->GetCacheManager()->GetCacheIterator(
@@ -866,7 +866,7 @@ void cmCursesMainForm::HandleInput()
std::string searchstr = "Search: " + this->SearchString;
this->UpdateStatusBar( searchstr.c_str() );
this->PrintKeys(1);
- curses_move(y-5,searchstr.size());
+ curses_move(y-5,static_cast<unsigned int>(searchstr.size()));
//curses_move(1,1);
touchwin(stdscr);
refresh();
@@ -961,7 +961,7 @@ void cmCursesMainForm::HandleInput()
else if ( key == KEY_DOWN || key == ctrl('n') )
{
FIELD* cur = current_field(this->Form);
- int findex = field_index(cur);
+ size_t findex = field_index(cur);
if ( findex == 3*this->NumberOfVisibleEntries-1 )
{
continue;
@@ -1108,7 +1108,7 @@ void cmCursesMainForm::HandleInput()
{
this->OkToGenerate = false;
FIELD* cur = current_field(this->Form);
- int findex = field_index(cur);
+ size_t findex = field_index(cur);
// make the next or prev. current field after deletion
// each entry consists of fields: label, isnew, value
@@ -1199,7 +1199,7 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
str = cmSystemTools::LowerCase(astr);
}
- if ( idx > this->NumberOfVisibleEntries )
+ if ( size_t(idx) > this->NumberOfVisibleEntries )
{
return;
}
@@ -1232,7 +1232,7 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
}
}
}
- if ( findex >= 3* this->NumberOfVisibleEntries-1 )
+ if ( size_t(findex) >= 3* this->NumberOfVisibleEntries-1 )
{
set_current_field(this->Form, this->Fields[2]);
}
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 9751999..4084415 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -147,7 +147,7 @@ protected:
// Where is cmake executable
std::string WhereCMake;
// Number of entries shown (depends on mode -normal or advanced-)
- int NumberOfVisibleEntries;
+ size_t NumberOfVisibleEntries;
bool AdvancedMode;
// Did the iteration converge (no new entries) ?
bool OkToGenerate;
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index bd69d6c..4d56257 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1169,7 +1169,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
if ( tick % tick_line_len == 0 && tick > 0 )
{
cmCTestLog(this, HANDLER_OUTPUT, " Size: "
- << int((output->size() / 1024.0) + 1) << "K" << std::endl
+ << int((double(output->size()) / 1024.0) + 1) << "K" << std::endl
<< " " << std::flush);
}
}
@@ -1181,7 +1181,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
}
}
cmCTestLog(this, OUTPUT, " Size of output: "
- << int(output->size() / 1024.0) << "K" << std::endl);
+ << int(double(output->size()) / 1024.0) << "K" << std::endl);
cmsysProcess_WaitForExit(cp, 0);
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index dab0c0d..b8a0c95 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -175,6 +175,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
fprintf(fout, "SET(CMAKE_MODULE_PATH %s)\n", def);
}
+
+ const char* rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE";
+ std::string rulesOverrideLang =
+ rulesOverrideBase + (lang ? std::string("_") + lang : std::string(""));
+ if(const char* rulesOverridePath =
+ this->Makefile->GetDefinition(rulesOverrideLang.c_str()))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideLang.c_str(), rulesOverridePath);
+ }
+ else if(const char* rulesOverridePath2 =
+ this->Makefile->GetDefinition(rulesOverrideBase))
+ {
+ fprintf(fout, "SET(%s \"%s\")\n",
+ rulesOverrideBase, rulesOverridePath2);
+ }
+
if(lang)
{
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE %s)\n", lang);
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index e77119f..2ed959f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1324,6 +1324,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_LINK_FLAGS",
cmProperty::VARIABLE,0,0);
+ cm->DefineProperty("CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG",
+ cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES",
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_<LANG>_STANDARD_LIBRARIES_INIT",
@@ -1398,4 +1400,6 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cmProperty::VARIABLE,0,0);
cm->DefineProperty("CMAKE_LINK_DEPENDENT_LIBRARY_DIRS",
cmProperty::VARIABLE,0,0);
+ cm->DefineProperty("CMAKE_MAKE_INCLUDE_FROM_ROOT",
+ cmProperty::VARIABLE,0,0);
}
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 147f6ac..c198727 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -576,7 +576,7 @@ unsigned int cmELFInternalImpl<Types>::GetDynamicEntryCount()
return i;
}
}
- return this->DynamicSectionEntries.size();
+ return static_cast<unsigned int>(this->DynamicSectionEntries.size());
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index b687fe1..4e8e7e6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -750,8 +750,9 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::FULL,
cmLocalGenerator::SHELL);
progCmd << " ";
- std::vector<int> &progFiles = this->ProgressMap[&t->second].Marks;
- for (std::vector<int>::iterator i = progFiles.begin();
+ std::vector<unsigned long>& progFiles =
+ this->ProgressMap[&t->second].Marks;
+ for (std::vector<unsigned long>::iterator i = progFiles.begin();
i != progFiles.end(); ++i)
{
progCmd << " " << *i;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 401888f..f499536 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -177,7 +177,7 @@ protected:
TargetProgress(): NumberOfActions(0) {}
unsigned long NumberOfActions;
std::string VariableFile;
- std::vector<int> Marks;
+ std::vector<unsigned long> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current);
};
struct ProgressMapCompare { bool operator()(cmTarget*,cmTarget*) const; };
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index e423174..6e0f048 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -154,8 +154,6 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget()
stampFile += "/";
stampFile += cmake::GetCMakeFilesDirectoryPostSlash();
stampFile += "generate.stamp";
- stampFile = generators[0]->Convert(stampFile.c_str(),
- cmLocalGenerator::START_OUTPUT);
fout << stampFile << "\n";
stamps.push_back(stampFile);
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index fd3508e..13d875f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2249,6 +2249,10 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const char* source,
}
result = this->EscapeForShell(result.c_str(), true, false);
}
+ else if(output == RESPONSE)
+ {
+ result = this->EscapeForShell(result.c_str(), false, false);
+ }
return result;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 4c2fc22..43bf1e7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -102,7 +102,7 @@ public:
* path setting
*/
enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
- enum OutputFormat { UNCHANGED, MAKEFILE, SHELL };
+ enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
std::string ConvertToOutputFormat(const char* source, OutputFormat output);
std::string Convert(const char* remote, RelativeRoot local,
OutputFormat output = UNCHANGED,
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 136c177..e411d3e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -234,7 +234,9 @@ void cmLocalVisualStudio7Generator
//----------------------------------------------------------------------------
cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
{
- std::string stampName = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string stampName = this->Makefile->GetCurrentOutputDirectory();
+ stampName += "/";
+ stampName += cmake::GetCMakeFilesDirectoryPostSlash();
stampName += "generate.stamp";
const char* dsprule =
this->Makefile->GetRequiredDefinition("CMAKE_COMMAND");
@@ -270,9 +272,11 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
cmCustomCommandLines commandLines;
commandLines.push_back(commandLine);
const char* no_working_directory = 0;
- this->Makefile->AddCustomCommandToOutput(stampName.c_str(), listFiles,
- makefileIn.c_str(), commandLines,
- comment.c_str(),
+ std::string fullpathStampName = this->Convert(stampName.c_str(), FULL,
+ UNCHANGED);
+ this->Makefile->AddCustomCommandToOutput(fullpathStampName.c_str(),
+ listFiles, makefileIn.c_str(),
+ commandLines, comment.c_str(),
no_working_directory, true);
if(cmSourceFile* file = this->Makefile->GetSource(makefileIn.c_str()))
{
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ac727ac..d5d6585 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -189,12 +189,15 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
//----------------------------------------------------------------------------
void cmMakefileTargetGenerator::WriteCommonCodeRules()
{
+ const char* root = (this->Makefile->IsOn("CMAKE_MAKE_INCLUDE_FROM_ROOT")?
+ "$(CMAKE_BINARY_DIR)/" : "");
+
// Include the dependencies for the target.
std::string dependFileNameFull = this->TargetBuildDirectoryFull;
dependFileNameFull += "/depend.make";
*this->BuildFileStream
<< "# Include any dependencies generated for this target.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(dependFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -205,7 +208,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
// Include the progress variables for the target.
*this->BuildFileStream
<< "# Include the progress variables for this target.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(this->ProgressFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -238,7 +241,7 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
// Include the flags for the target.
*this->BuildFileStream
<< "# Include the compile flags for this target's objects.\n"
- << this->LocalGenerator->IncludeDirective << " "
+ << this->LocalGenerator->IncludeDirective << " " << root
<< this->Convert(this->FlagFileNameFull.c_str(),
cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE)
@@ -1327,7 +1330,7 @@ public:
this->NextObject =
this->LocalGenerator->Convert(obj.c_str(),
cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::SHELL);
+ cmLocalGenerator::RESPONSE);
// Roll over to next string if the limit will be exceeded.
if(this->LengthLimit != std::string::npos &&
@@ -1621,6 +1624,17 @@ cmMakefileTargetGenerator
std::vector<std::string> object_strings;
this->WriteObjectsStrings(object_strings, responseFileLimit);
+ // Lookup the response file reference flag.
+ std::string responseFlagVar = "CMAKE_";
+ responseFlagVar += this->Target->GetLinkerLanguage(this->ConfigName);
+ responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
+ const char* responseFlag =
+ this->Makefile->GetDefinition(responseFlagVar.c_str());
+ if(!responseFlag)
+ {
+ responseFlag = "@";
+ }
+
// Write a response file for each string.
const char* sep = "";
for(unsigned int i = 0; i < object_strings.size(); ++i)
@@ -1638,7 +1652,7 @@ cmMakefileTargetGenerator
sep = " ";
// Reference the response file.
- buildObjs += "@";
+ buildObjs += responseFlag;
buildObjs += this->Convert(objects_rsp.c_str(),
cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index cacd766..d2f7bf3 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -44,7 +44,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp,
//----------------------------------------------------------------------------
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR):
- Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0)
+ Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0), LineEnd('\0')
{
}
@@ -61,8 +61,10 @@ bool cmProcessTools::LineParser::ProcessChunk(const char* first, int length)
const char* last = first + length;
for(const char* c = first; c != last; ++c)
{
- if(*c == this->Separator)
+ if(*c == this->Separator || *c == '\0')
{
+ this->LineEnd = *c;
+
// Log this line.
if(this->Log && this->Prefix)
{
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index 0b210af..439726d 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -55,6 +55,7 @@ public:
bool IgnoreCR;
std::ostream* Log;
const char* Prefix;
+ char LineEnd;
std::string Line;
virtual bool ProcessChunk(const char* data, int length);
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 853e7ba..c477bb7 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -66,7 +66,9 @@ public:
"directory (already processed by CMake) may be named by full or "
"relative path.\n"
"TARGET scope may name zero or more existing targets.\n"
- "SOURCE scope may name zero or more source files.\n"
+ "SOURCE scope may name zero or more source files. "
+ "Note that source file properties are visible only to targets "
+ "added in the same directory (CMakeLists.txt).\n"
"TEST scope may name zero or more existing tests.\n"
"CACHE scope must name zero or more cache existing entries.\n"
"The required PROPERTY option is immediately followed by the name "
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index 7182152..392f168 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -48,35 +48,15 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " set_source_files_properties(file1 file2 ...\n"
+ " set_source_files_properties([file1 [file2 [...]]]\n"
" PROPERTIES prop1 value1\n"
- " prop2 value2 ...)\n"
- "Set properties on a file. The syntax for the command is to list all "
- "the files you want "
- "to change, and then provide the values you want to set next. You "
- "can make up your own properties as well. "
- "The following are used by CMake. "
- "The ABSTRACT flag (boolean) is used by some class wrapping "
- "commands. "
- "If WRAP_EXCLUDE (boolean) is true then many wrapping commands "
- "will ignore this file. If GENERATED (boolean) is true then it "
- "is not an error if this source file does not exist when it is "
- "added to a target. Obviously, "
- "it must be created (presumably by a custom command) before the "
- "target is built. "
- "If the HEADER_FILE_ONLY (boolean) property is true then the "
- "file is not compiled. This is useful if you want to add extra "
- "non build files to an IDE. "
- "OBJECT_DEPENDS (string) adds dependencies to the object file. "
- "COMPILE_FLAGS (string) is passed to the compiler as additional "
- "command line arguments when the source file is compiled. "
- "LANGUAGE (string) CXX|C will change the default compiler used "
- "to compile the source file. The languages used need to be enabled "
- "in the PROJECT command. "
- "If SYMBOLIC (boolean) is set to true the build system will be "
- "informed that the source file is not actually created on disk but "
- "instead used as a symbolic name for a build rule.";
-
+ " [prop2 value2 [...]])\n"
+ "Set properties associated with source files using a key/value "
+ "paired list. "
+ "See properties documentation for those known to CMake. "
+ "Unrecognized properties are ignored. "
+ "Source file properties are visible only to targets "
+ "added in the same directory (CMakeLists.txt).";
}
cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand);
diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx
new file mode 100644
index 0000000..a4bdb2e
--- /dev/null
+++ b/Source/cmStandardIncludes.cxx
@@ -0,0 +1,16 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2010 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.
+============================================================================*/
+#include "cmStandardIncludes.h"
+#if !defined(CMAKE_NO_ANSI_STRING_STREAM)
+cmOStringStream::cmOStringStream() {}
+cmOStringStream::~cmOStringStream() {}
+#endif
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 9b9cb3b..e8decbb 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -241,7 +241,8 @@ typedef cmsys::String cmStdString;
class cmOStringStream: public std::ostringstream
{
public:
- cmOStringStream() {}
+ cmOStringStream();
+ ~cmOStringStream();
private:
cmOStringStream(const cmOStringStream&);
void operator=(const cmOStringStream&);
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 3bd47a4..19f5c0f 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -739,7 +739,7 @@ bool cmStringCommand
alphabet = cmStringCommandDefaultAlphabet;
}
- double sizeofAlphabet = alphabet.size();
+ double sizeofAlphabet = static_cast<double>(alphabet.size());
if ( sizeofAlphabet < 1 )
{
this->SetError("sub-command RANDOM invoked with bad alphabet.");
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5f7cfa3..0badbba 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1204,6 +1204,7 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
// Should be efficient enough on most system:
const int bufferSize = 4096;
char buffer[bufferSize];
+ unsigned char const* buffer_uc = reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
// slightly broken stream libraries (like HPUX). Normally, it is
// incorrect to not check the error condition on the fin.read()
@@ -1212,10 +1213,9 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
while(fin)
{
fin.read(buffer, bufferSize);
- if(fin.gcount())
+ if(int gcount = static_cast<int>(fin.gcount()))
{
- cmsysMD5_Append(md5, reinterpret_cast<unsigned char const*>(buffer),
- fin.gcount());
+ cmsysMD5_Append(md5, buffer_uc, gcount);
}
}
cmsysMD5_FinalizeHex(md5, md5out);
@@ -1989,9 +1989,9 @@ namespace{
# pragma warn -8066 /* unreachable code */
#endif
-int copy_data(struct archive *ar, struct archive *aw)
+long copy_data(struct archive *ar, struct archive *aw)
{
- int r;
+ long r;
const void *buff;
size_t size;
off_t offset;
@@ -2136,7 +2136,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
}
else if(*outiter == '\n' || *outiter == '\0')
{
- int length = outiter-out.begin();
+ std::vector<char>::size_type length = outiter-out.begin();
if(length > 1 && *(outiter-1) == '\r')
{
--length;
@@ -2159,7 +2159,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
}
else if(*erriter == '\n' || *erriter == '\0')
{
- int length = erriter-err.begin();
+ std::vector<char>::size_type length = erriter-err.begin();
if(length > 1 && *(erriter-1) == '\r')
{
--length;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 53d6594..59e20d5 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -435,6 +435,9 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
none.push_back(sf);
}
}
+
+ this->AddMissingSourceGroups(groupsUsed, sourceGroups);
+
// Write out group file
std::string path = this->Makefile->GetStartOutputDirectory();
path += "/";
@@ -492,6 +495,52 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
}
}
+// Add to groupsUsed empty source groups that have non-empty children.
+void
+cmVisualStudio10TargetGenerator::AddMissingSourceGroups(
+ std::set<cmSourceGroup*>& groupsUsed,
+ const std::vector<cmSourceGroup>& allGroups
+ )
+{
+ for(std::vector<cmSourceGroup>::const_iterator current = allGroups.begin();
+ current != allGroups.end(); ++current)
+ {
+ std::vector<cmSourceGroup> const& children = current->GetGroupChildren();
+ if(children.empty())
+ {
+ continue; // the group is really empty
+ }
+
+ this->AddMissingSourceGroups(groupsUsed, children);
+
+ cmSourceGroup* current_ptr = const_cast<cmSourceGroup*>(&(*current));
+ if(groupsUsed.find(current_ptr) != groupsUsed.end())
+ {
+ continue; // group has already been added to set
+ }
+
+ // check if it least one of the group's descendants is not empty
+ // (at least one child must already have been added)
+ std::vector<cmSourceGroup>::const_iterator child_it = children.begin();
+ while(child_it != children.end())
+ {
+ cmSourceGroup* child_ptr = const_cast<cmSourceGroup*>(&(*child_it));
+ if(groupsUsed.find(child_ptr) != groupsUsed.end())
+ {
+ break; // found a child that was already added => add current group too
+ }
+ child_it++;
+ }
+
+ if(child_it == children.end())
+ {
+ continue; // no descendants have source files => ignore this group
+ }
+
+ groupsUsed.insert(current_ptr);
+ }
+}
+
void
cmVisualStudio10TargetGenerator::
WriteGroupSources(const char* name,
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 989db71..64b2361 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -77,6 +77,10 @@ private:
void WriteGroupSources(const char* name,
std::vector<cmSourceFile*> const& sources,
std::vector<cmSourceGroup>& );
+ void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed,
+ const std::vector<cmSourceGroup>& allGroups);
+
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<cmStdString, Options*> OptionsMap;
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 051cc1f..972af95 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -183,7 +183,7 @@ cmVisualStudioGeneratorOptions
{
fout << prefix << "PreprocessorDefinitions=\"";
}
- const char* comma = "";
+ const char* sep = "";
for(std::vector<std::string>::const_iterator di = this->Defines.begin();
di != this->Defines.end(); ++di)
{
@@ -208,15 +208,8 @@ cmVisualStudioGeneratorOptions
define = cmVisualStudioGeneratorOptionsEscapeForXML(define.c_str());
}
// Store the flag in the project file.
- fout << comma << define;
- if(this->Version == 10)
- {
- comma = ";";
- }
- else
- {
- comma = ",";
- }
+ fout << sep << define;
+ sep = ";";
}
if(this->Version == 10)
{
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c
index 3d4ca16..c9bf259 100644
--- a/Source/cm_utf8.c
+++ b/Source/cm_utf8.c
@@ -50,7 +50,7 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
unsigned int* pc)
{
/* Count leading ones in the first byte. */
- unsigned char c = *first++;
+ unsigned char c = (unsigned char)*first++;
unsigned char const ones = cm_utf8_ones[c];
switch(ones)
{
@@ -62,10 +62,10 @@ const char* cm_utf8_decode_character(const char* first, const char* last,
/* Extract bits from this multi-byte character. */
{
unsigned int uc = c & cm_utf8_mask[ones];
- unsigned char left;
+ int left;
for(left = ones-1; left && first != last; --left)
{
- c = *first++;
+ c = (unsigned char)*first++;
if(cm_utf8_ones[c] != 1)
{
return 0;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f766d47..cb20069 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -162,16 +162,6 @@ cmake::cmake()
}
#endif
- // If MAKEFLAGS are given in the environment, remove the environment
- // variable. This will prevent try-compile from succeeding when it
- // should fail (if "-i" is an option). We cannot simply test
- // whether "-i" is given and remove it because some make programs
- // encode the MAKEFLAGS variable in a strange way.
- if(getenv("MAKEFLAGS"))
- {
- cmSystemTools::PutEnv("MAKEFLAGS=");
- }
-
this->Verbose = false;
this->InTryCompile = false;
this->CacheManager = new cmCacheManager(this);
@@ -2231,6 +2221,16 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
}
}
+ // If MAKEFLAGS are given in the environment, remove the environment
+ // variable. This will prevent try-compile from succeeding when it
+ // should fail (if "-i" is an option). We cannot simply test
+ // whether "-i" is given and remove it because some make programs
+ // encode the MAKEFLAGS variable in a strange way.
+ if(getenv("MAKEFLAGS"))
+ {
+ cmSystemTools::PutEnv("MAKEFLAGS=");
+ }
+
this->PreLoadCMakeFiles();
std::string systemFile = this->GetHomeOutputDirectory();
@@ -3906,6 +3906,9 @@ static bool cmakeCheckStampFile(const char* stampName)
// build system is really out of date.
std::cout << "CMake is re-running because " << stampName
<< " is out-of-date.\n";
+ std::cout << " the file '" << dep << "'\n";
+ std::cout << " is newer than '" << stampDepends << "'\n";
+ std::cout << " result='" << result << "'\n";
return false;
}
}
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index f440ff9..bcc7a96 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY)
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
ENDIF(COMMAND SET_PROPERTY)
-# add option to disable memory cleanup at exit of putenv memory
-IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 1)
-ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
- SET(KWSYS_DO_NOT_CLEAN_PUTENV 0)
-ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
@@ -605,6 +599,23 @@ ELSE(KWSYS_BUILD_SHARED)
ENDIF(KWSYS_BUILD_SHARED)
#-----------------------------------------------------------------------------
+# Configure some implementation details.
+
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
+ "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
+KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
+ "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
+SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c System.c PROPERTIES
+ COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
+ )
+
+IF(KWSYS_DO_NOT_CLEAN_PUTENV)
+ # Disable cleanup of putenv memory for issues with GCOV.
+ SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
+ COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1)
+ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV)
+
+#-----------------------------------------------------------------------------
# Choose a directory for the generated headers.
IF(NOT KWSYS_HEADER_ROOT)
SET(KWSYS_HEADER_ROOT "${PROJECT_BINARY_DIR}")
@@ -782,15 +793,6 @@ IF(KWSYS_USE_Process)
ELSE(NOT UNIX)
# Use the UNIX implementation.
SET(KWSYS_C_SRCS ${KWSYS_C_SRCS} ProcessUNIX.c)
-
- # Help ProcessUNIX.c compile properly on all platforms.
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_PTRDIFF_T
- "Checking whether C compiler has ptrdiff_t in stddef.h" DIRECT)
- KWSYS_PLATFORM_C_TEST(KWSYS_C_HAS_SSIZE_T
- "Checking whether C compiler has ssize_t in unistd.h" DIRECT)
- SET_SOURCE_FILES_PROPERTIES(ProcessUNIX.c PROPERTIES
- COMPILE_FLAGS "-DKWSYS_C_HAS_PTRDIFF_T=${KWSYS_C_HAS_PTRDIFF_T} -DKWSYS_C_HAS_SSIZE_T=${KWSYS_C_HAS_SSIZE_T}"
- )
ENDIF(NOT UNIX)
ENDIF(KWSYS_USE_Process)
@@ -1095,6 +1097,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7})
ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n})
KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
+ SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120)
ENDFOREACH(n)
# Some Apple compilers produce bad optimizations in this source.
@@ -1122,5 +1125,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value")
MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}")
ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE)
+
+ # Suppress known consistent failures on buggy systems.
+ IF(KWSYS_TEST_BOGUS_FAILURES)
+ SET_TESTS_PROPERTIES(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON)
+ ENDIF()
+
ENDIF(BUILD_TESTING)
ENDIF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
diff --git a/Source/kwsys/Configure.hxx.in b/Source/kwsys/Configure.hxx.in
index 9310d94..716b84f 100644
--- a/Source/kwsys/Configure.hxx.in
+++ b/Source/kwsys/Configure.hxx.in
@@ -15,15 +15,6 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>
-/* Disable cleanup of putenv memory for issues with GCOV */
-#if @KWSYS_DO_NOT_CLEAN_PUTENV@
-#define KWSYS_DO_NOT_CLEAN_PUTENV
-#else
-#undef KWSYS_DO_NOT_CLEAN_PUTENV
-#endif
-
-
-
/* Whether ANSI C++ stream headers are to be used. */
#define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 77da3c2..40308e9 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2010)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 06)
+SET(KWSYS_DATE_STAMP_MONTH 07)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 13)
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 0060c4d..877002a 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -94,7 +94,11 @@ int test4(int argc, const char* argv[])
fprintf(stderr, "Output before crash on stderr from crash test.\n");
fflush(stdout);
fflush(stderr);
+#if defined(__clang__)
+ *(int*)1 = 0; /* Clang warns about 0-ptr; undefined behavior. */
+#else
*(int*)0 = 0;
+#endif
fprintf(stdout, "Output after crash on stdout from crash test.\n");
fprintf(stderr, "Output after crash on stderr from crash test.\n");
return 0;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 300b531..9865134 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1076,7 +1076,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# Make sure CTest can handle a test with no newline in output.
ADD_TEST(CTest.NoNewline
- ${CMAKE_COMMAND} -E echo_append "This line has no newline!")
+ ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!")
# A simple test for ctest in script mode
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in"
@@ -1373,7 +1373,29 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES
PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
-
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND}
+ -C "\${CTestTest_CONFIG}"
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log"
+ )
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND}
+ -C "\${CTestTest_CONFIG}"
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES
+ PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph")
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake"
@@ -1410,6 +1432,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
set(regex "${regex}|Error message was: ")
set(regex "${regex}([Cc]ould *n.t resolve host")
set(regex "${regex}|[Cc]ould *n.t connect to host")
+ set(regex "${regex}|Empty reply from server")
set(regex "${regex}|The requested URL returned error")
set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)")
set(regex "${regex}|Submission method .xmlrpc. not compiled into CTest")
@@ -1570,16 +1593,24 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# If there is CMakeLists.txt in the binary tree, assume in-source build
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
- IF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
-
-
+ SET(bootstrap "")
+ IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
+ IF(UNIX)
+ SET(bootstrap ${CMake_SOURCE_DIR}/bootstrap)
+ ELSEIF(MSYS)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in
+ ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat @ONLY)
+ SET(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat)
+ ENDIF()
+ ENDIF()
+ IF(bootstrap)
ADD_TEST(BootstrapTest ${CMAKE_CTEST_COMMAND}
--build-and-test
${CMake_SOURCE_DIR}
${CMake_BINARY_DIR}/Tests/BootstrapTest
--build-nocmake
--build-noclean
- --build-makeprogram ${CMake_SOURCE_DIR}/bootstrap
+ --build-makeprogram ${bootstrap}
--build-generator "${CMAKE_TEST_GENERATOR}"
--test-command
${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
@@ -1593,7 +1624,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES ( BootstrapTest
PROPERTIES TIMEOUT 5400)
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- ENDIF(UNIX AND CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST)
+ ENDIF()
# fortran does not work for IDE builds because
# CMAKE_STANDARD_LIBRARIES needs to be per language
diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 39289f0..73f8b01 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -128,6 +128,102 @@ if(is_cvs_checkout AND CVS_EXECUTABLE)
endif()
+# If no GIT_EXECUTABLE, see if we can figure out which git was used
+# for the ctest_update step on this dashboard...
+#
+if(is_git_checkout AND NOT GIT_EXECUTABLE)
+ set(ctest_ini_file "")
+ set(exe "")
+
+ # Use the old name:
+ if(EXISTS "${CMake_BINARY_DIR}/DartConfiguration.tcl")
+ set(ctest_ini_file "${CMake_BINARY_DIR}/DartConfiguration.tcl")
+ endif()
+
+ # But if it exists, prefer the new name:
+ if(EXISTS "${CMake_BINARY_DIR}/CTestConfiguration.ini")
+ set(ctest_ini_file "${CMake_BINARY_DIR}/CTestConfiguration.ini")
+ endif()
+
+ # If there is a ctest ini file, read the update command or git command
+ # from it:
+ #
+ if(ctest_ini_file)
+ file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$")
+ string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
+ if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
+ set(exe "")
+ endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'")
+ endif()
+
+ if(NOT exe)
+ file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$")
+ string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
+ if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
+ set(exe "")
+ endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'")
+ endif()
+ endif()
+ else()
+ message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...")
+ endif()
+
+ # If we have still not grokked the exe, look in the Update.xml file to see
+ # if we can parse it from there...
+ #
+ if(NOT exe)
+ file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml")
+ if(update_xml_file)
+ file(STRINGS "${update_xml_file}" line
+ REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1)
+ string(REPLACE "&quot\;" "\"" line "${line}")
+ string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ if(line)
+ set(exe "${line}")
+ endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'")
+ endif()
+ else()
+ message("info: no Update.xml file...")
+ endif()
+ endif()
+
+ if(exe)
+ set(GIT_EXECUTABLE "${exe}")
+ message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+ message("")
+
+ if(NOT EXISTS "${GIT_EXECUTABLE}")
+ message(FATAL_ERROR "GIT_EXECUTABLE does not exist...")
+ endif()
+ else()
+ message(FATAL_ERROR "could not determine GIT_EXECUTABLE...")
+ endif()
+endif()
+
+
if(is_git_checkout AND GIT_EXECUTABLE)
# Check with "git status" if there are any local modifications to the
# CMake source tree:
@@ -154,6 +250,15 @@ if(is_git_checkout AND GIT_EXECUTABLE)
message("=== end output ===")
message("")
+ execute_process(COMMAND ${GIT_EXECUTABLE} log -1
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ OUTPUT_VARIABLE git_log_output
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message("=== output of 'git log -1' ===")
+ message("${git_log_output}")
+ message("=== end output ===")
+ message("")
+
message("Copy/paste this command to reproduce:")
message("cd \"${CMake_SOURCE_DIR}\" && \"${GIT_EXECUTABLE}\" status")
message("")
diff --git a/Tests/CTestTestCycle/CMakeLists.txt b/Tests/CTestTestCycle/CMakeLists.txt
new file mode 100644
index 0000000..6ba6b8c
--- /dev/null
+++ b/Tests/CTestTestCycle/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required (VERSION 2.6)
+project(CTestTestCycle)
+include(CTest)
+
+add_executable (simple simple.cxx)
+add_test (one simple)
+add_test (two simple)
+add_test (three simple)
+
+# Add cyclical test dependency
+set_tests_properties(one PROPERTIES DEPENDS "two")
+set_tests_properties(two PROPERTIES DEPENDS "three")
+set_tests_properties(three PROPERTIES DEPENDS "one")
diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake
new file mode 100644
index 0000000..43e9986
--- /dev/null
+++ b/Tests/CTestTestCycle/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestCycle")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestCycle/simple.cxx b/Tests/CTestTestCycle/simple.cxx
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CTestTestCycle/simple.cxx
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in
new file mode 100644
index 0000000..a17adca
--- /dev/null
+++ b/Tests/CTestTestCycle/test.cmake.in
@@ -0,0 +1,22 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestDepends/CMakeLists.txt b/Tests/CTestTestDepends/CMakeLists.txt
new file mode 100644
index 0000000..26367a6
--- /dev/null
+++ b/Tests/CTestTestDepends/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required (VERSION 2.6)
+project(CTestTestDepends)
+include(CTest)
+
+add_executable (simple simple.cxx)
+add_test (one simple)
+add_test (two simple)
+add_test (three simple)
+
+# Add redundant (but not cyclical) dependencies
+set_tests_properties(two PROPERTIES DEPENDS "one")
+set_tests_properties(three PROPERTIES DEPENDS "one;two")
diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake
new file mode 100644
index 0000000..e3af7dd
--- /dev/null
+++ b/Tests/CTestTestDepends/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestDepends")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestDepends/simple.cxx b/Tests/CTestTestDepends/simple.cxx
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CTestTestDepends/simple.cxx
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in
new file mode 100644
index 0000000..ed4e182
--- /dev/null
+++ b/Tests/CTestTestDepends/test.cmake.in
@@ -0,0 +1,22 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestParallel/CMakeLists.txt b/Tests/CTestTestParallel/CMakeLists.txt
index 8fab44b..fc53f68 100644
--- a/Tests/CTestTestParallel/CMakeLists.txt
+++ b/Tests/CTestTestParallel/CMakeLists.txt
@@ -11,3 +11,5 @@ SET_TESTS_PROPERTIES(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true)
ADD_TEST (TestProcessorsGreaterThanMPL1 LockFile)
ADD_TEST (TestProcessorsGreaterThanMPL2 LockFile)
SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10)
+SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS
+ TestProcessorsGreaterThanMPL2)
diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in
index 7f90b50..c654f47 100644
--- a/Tests/CTestUpdateBZR.cmake.in
+++ b/Tests/CTestUpdateBZR.cmake.in
@@ -142,7 +142,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# bzr command configuration
set(CTEST_BZR_COMMAND \"${BZR}\")
set(CTEST_CHECKOUT_COMMAND
@@ -150,4 +150,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index 6f31a2c..a04673e 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -147,7 +147,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# CVS command configuration
set(CTEST_CVS_COMMAND \"${CVS}\")
set(CTEST_CVS_UPDATE_OPTIONS -dAP)
@@ -156,4 +156,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 266f4b3..a52cb14 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -165,15 +165,15 @@ endfunction(create_build_tree)
#-----------------------------------------------------------------------------
# Function to write the dashboard test script.
-function(create_dashboard_script name custom_text)
+function(create_dashboard_script bin_dir custom_text)
# Write the dashboard script.
- file(WRITE ${TOP}/dashboard.cmake
+ file(WRITE ${TOP}/${bin_dir}.cmake
"# CTest Dashboard Script
set(CTEST_DASHBOARD_ROOT \"${TOP}\")
set(CTEST_SITE test.site)
set(CTEST_BUILD_NAME dash-test)
set(CTEST_SOURCE_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-source)
-set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/dash-binary)
+set(CTEST_BINARY_DIRECTORY \${CTEST_DASHBOARD_ROOT}/${bin_dir})
${custom_text}
# Start a dashboard and run the update step
ctest_start(Experimental)
@@ -191,27 +191,31 @@ function(run_dashboard_command_line bin_dir)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
+ set(_modified Modified{CTestConfig.cmake})
+ if(UPDATE_NO_MODIFIED)
+ set(_modified "")
+ endif()
check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
Updated{subdir/foo.txt}
Updated{subdir/bar.txt}
- Modified{CTestConfig.cmake}
+ ${_modified}
)
endfunction(run_dashboard_command_line)
#-----------------------------------------------------------------------------
# Function to run the dashboard through a script
-function(run_dashboard_script name)
+function(run_dashboard_script bin_dir)
run_child(
WORKING_DIRECTORY ${TOP}
- COMMAND ${CMAKE_CTEST_COMMAND} -S ${name} -V
+ COMMAND ${CMAKE_CTEST_COMMAND} -S ${bin_dir}.cmake -V
)
# Verify the updates reported by CTest.
list(APPEND UPDATE_MAYBE Updated{subdir})
- check_updates(dash-binary
+ check_updates(${bin_dir}
Updated{foo.txt}
Updated{bar.txt}
Updated{zot.txt}
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index f0a5770..f672a52 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -131,6 +131,22 @@ run_child(
COMMAND ${GIT} submodule update
)
+# Save the first revision name.
+execute_process(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${GIT} rev-parse HEAD
+ OUTPUT_VARIABLE revision1
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+#-----------------------------------------------------------------------------
+# Create an empty commit.
+message("Creating empty commit...")
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${GIT} commit --allow-empty -m "Empty commit"
+ )
+
#-----------------------------------------------------------------------------
# Make changes in the working tree.
message("Changing content...")
@@ -192,15 +208,18 @@ run_child(
#-----------------------------------------------------------------------------
# Go back to before the changes so we can test updating.
-message("Backing up to revision 1...")
-run_child(
- WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} reset --hard master~2
- )
-run_child(
- WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} submodule update
- )
+macro(rewind_source src_dir)
+ message("Backing up to revision 1...")
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} reset --hard ${revision1}
+ )
+ run_child(
+ WORKING_DIRECTORY ${TOP}/${src_dir}
+ COMMAND ${GIT} submodule update
+ )
+endmacro(rewind_source)
+rewind_source(user-source)
# Make sure pull does not try to rebase (which does not work with
# modified files) even if ~/.gitconfig sets "branch.master.rebase".
@@ -224,13 +243,31 @@ UpdateCommand: ${GIT}
")
# Run the dashboard command line interface.
+set(UPDATE_NO_MODIFIED 1)
run_dashboard_command_line(user-binary)
+set(UPDATE_NO_MODIFIED 0)
+
+rewind_source(user-source)
+modify_content(user-source)
+
+message("Running CTest Dashboard Command Line (custom update)...")
+
+# Create the user build tree.
+create_build_tree(user-source user-binary-custom)
+file(APPEND ${TOP}/user-binary-custom/CTestConfiguration.ini
+ "# GIT command configuration
+UpdateCommand: ${GIT}
+GITUpdateCustom: ${GIT};pull;origin;master
+")
+
+# Run the dashboard command line interface.
+run_dashboard_command_line(user-binary-custom)
#-----------------------------------------------------------------------------
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# git command configuration
set(CTEST_GIT_COMMAND \"${GIT}\")
set(CTEST_GIT_UPDATE_OPTIONS)
@@ -240,7 +277,7 @@ execute_process(
)
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
- COMMAND \"${GIT}\" reset --hard master~2
+ COMMAND \"${GIT}\" reset --hard ${revision1}
)
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
@@ -253,4 +290,20 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
+
+rewind_source(dash-source)
+
+#-----------------------------------------------------------------------------
+# Test custom update with a dashboard script.
+message("Running CTest Dashboard Script (custom update)...")
+
+create_dashboard_script(dash-binary-custom
+ "# git command configuration
+set(CTEST_GIT_COMMAND \"${GIT}\")
+set(CTEST_GIT_UPDATE_OPTIONS)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+")
+
+# Run the dashboard script with CTest.
+run_dashboard_script(dash-binary-custom)
diff --git a/Tests/CTestUpdateGIT.sh.in b/Tests/CTestUpdateGIT.sh.in
index 4761d32..e7586d6 100755
--- a/Tests/CTestUpdateGIT.sh.in
+++ b/Tests/CTestUpdateGIT.sh.in
@@ -1,5 +1,5 @@
#!/bin/sh
-if test "x$1" = "xpull"; then
+if test "x$1" = "xpull" -o "x$1" = "xreset"; then
"@GIT@" "$@" && sleep 1 && touch foo.txt
else
exec "@GIT@" "$@"
diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in
index f2e5f83..543ddd9 100644
--- a/Tests/CTestUpdateHG.cmake.in
+++ b/Tests/CTestUpdateHG.cmake.in
@@ -145,7 +145,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# hg command configuration
set(CTEST_HG_COMMAND \"${HG}\")
set(CTEST_HG_UPDATE_OPTIONS)
@@ -160,4 +160,4 @@ execute_process(
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in
index 509597b..97b2a07 100644
--- a/Tests/CTestUpdateSVN.cmake.in
+++ b/Tests/CTestUpdateSVN.cmake.in
@@ -127,7 +127,7 @@ run_dashboard_command_line(user-binary)
# Test initial checkout and update with a dashboard script.
message("Running CTest Dashboard Script...")
-create_dashboard_script(dashboard.cmake
+create_dashboard_script(dash-binary
"# Subversion command configuration
set(CTEST_SVN_COMMAND \"${SVN}\")
set(CTEST_SVN_UPDATE_OPTIONS
@@ -137,4 +137,4 @@ set(CTEST_CHECKOUT_COMMAND
")
# Run the dashboard script with CTest.
-run_dashboard_script(dashboard.cmake)
+run_dashboard_script(dash-binary)
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 99da9c4..26c6deb 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -79,6 +79,7 @@ if(can_build_tutorial_step5)
URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
TEST_BEFORE_INSTALL 1
+ LOG_INSTALL 1
)
ExternalProject_Get_Property(${proj} install_dir)
set(TutorialStep5_install_dir ${install_dir})
@@ -88,6 +89,7 @@ if(can_build_tutorial_step5)
URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
TEST_AFTER_INSTALL 1
+ LOG_TEST 1
)
endif()
@@ -104,6 +106,7 @@ ExternalProject_Add(${proj}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DTEST_LIST:STRING=A::B::C
INSTALL_COMMAND ""
+ LOG_CONFIGURE 1
)
set(proj TutorialStep1-LocalNoDirTAR)
@@ -132,6 +135,7 @@ ExternalProject_Add(${proj}
URL_MD5 38c648e817339c356f6be00eeed79bd0
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
INSTALL_COMMAND ""
+ LOG_BUILD 1
)
set(proj TutorialStep1-LocalNoDirTGZ)
@@ -356,6 +360,7 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ LOG_DOWNLOAD 1
)
endif()
@@ -430,6 +435,7 @@ if(do_git_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
+ LOG_UPDATE 1
)
endif()
diff --git a/Tests/bootstrap.bat.in b/Tests/bootstrap.bat.in
new file mode 100644
index 0000000..aeb24b1
--- /dev/null
+++ b/Tests/bootstrap.bat.in
@@ -0,0 +1,2 @@
+@echo off
+sh "@CMake_SOURCE_DIR@/bootstrap" %*
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index ecae7b0..4c9202c 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -138,8 +138,24 @@ if(BUILD_TESTING)
endif()
mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE)
if(LIBXML2_XMLLINT_EXECUTABLE)
- add_test(CMake.HTML
- ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES}
- )
+ execute_process(COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --help
+ OUTPUT_VARIABLE _help ERROR_VARIABLE _err)
+ if("${_help}" MATCHES "--path" AND "${_help}" MATCHES "--nonet")
+ # We provide the XHTML DTD and its dependencies in the 'xml'
+ # directory so that xmllint can run without network access.
+ # However, it's --path option accepts a space-separated list of
+ # paths so it cannot handle spaces in the path to the source tree.
+ # Therefore we run the tool with the current work directory set to
+ # the 'xml' directory and use '.' as the path.
+ add_test(CMake.HTML
+ ${CMAKE_CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}/xml
+ ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout --nonet --path .
+ ${HTML_FILES}
+ )
+ else()
+ add_test(CMake.HTML
+ ${LIBXML2_XMLLINT_EXECUTABLE} --valid --noout ${HTML_FILES}
+ )
+ endif()
endif()
endif()
diff --git a/Utilities/cmcompress/cmcompress.c b/Utilities/cmcompress/cmcompress.c
index 59978f6..ea845ed 100644
--- a/Utilities/cmcompress/cmcompress.c
+++ b/Utilities/cmcompress/cmcompress.c
@@ -454,7 +454,7 @@ int cmcompress_compress(struct cmcompress_stream* cdata, void* buff, size_t n)
{
goto nomatch;
}
- disp = cdata->hsize_reg - i; /* secondary hash (after G. Knott) */
+ disp = (int)(cdata->hsize_reg - i); /* secondary hash (after G. Knott) */
if ( i == 0 )
{
disp = 1;
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 510851a..0f98e5a 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -731,6 +731,7 @@ FOREACH(var
SIZEOF_LONG_LONG
SIZEOF___INT64
SIZEOF_SIZE_T
+ SIZEOF_SSIZE_T
SIZEOF_TIME_T
)
IF(NOT ${var}_CODE)
diff --git a/Utilities/xml/xhtml-lat1.ent b/Utilities/xml/xhtml-lat1.ent
new file mode 100644
index 0000000..ffee223
--- /dev/null
+++ b/Utilities/xml/xhtml-lat1.ent
@@ -0,0 +1,196 @@
+<!-- Portions (C) International Organization for Standardization 1986
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+ %HTMLlat1;
+-->
+
+<!ENTITY nbsp "&#160;"> <!-- no-break space = non-breaking space,
+ U+00A0 ISOnum -->
+<!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
+<!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
+<!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
+<!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
+<!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
+<!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar,
+ U+00A6 ISOnum -->
+<!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
+<!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis,
+ U+00A8 ISOdia -->
+<!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
+<!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
+<!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark
+ = left pointing guillemet, U+00AB ISOnum -->
+<!ENTITY not "&#172;"> <!-- not sign = angled dash,
+ U+00AC ISOnum -->
+<!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen,
+ U+00AD ISOnum -->
+<!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign,
+ U+00AE ISOnum -->
+<!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline
+ = APL overbar, U+00AF ISOdia -->
+<!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
+<!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign,
+ U+00B1 ISOnum -->
+<!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two
+ = squared, U+00B2 ISOnum -->
+<!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three
+ = cubed, U+00B3 ISOnum -->
+<!ENTITY acute "&#180;"> <!-- acute accent = spacing acute,
+ U+00B4 ISOdia -->
+<!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
+<!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign,
+ U+00B6 ISOnum -->
+<!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma
+ = Greek middle dot, U+00B7 ISOnum -->
+<!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
+<!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one,
+ U+00B9 ISOnum -->
+<!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator,
+ U+00BA ISOnum -->
+<!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark
+ = right pointing guillemet, U+00BB ISOnum -->
+<!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter
+ = fraction one quarter, U+00BC ISOnum -->
+<!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half
+ = fraction one half, U+00BD ISOnum -->
+<!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters
+ = fraction three quarters, U+00BE ISOnum -->
+<!ENTITY iquest "&#191;"> <!-- inverted question mark
+ = turned question mark, U+00BF ISOnum -->
+<!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave
+ = latin capital letter A grave,
+ U+00C0 ISOlat1 -->
+<!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute,
+ U+00C1 ISOlat1 -->
+<!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex,
+ U+00C2 ISOlat1 -->
+<!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde,
+ U+00C3 ISOlat1 -->
+<!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis,
+ U+00C4 ISOlat1 -->
+<!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above
+ = latin capital letter A ring,
+ U+00C5 ISOlat1 -->
+<!ENTITY AElig "&#198;"> <!-- latin capital letter AE
+ = latin capital ligature AE,
+ U+00C6 ISOlat1 -->
+<!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla,
+ U+00C7 ISOlat1 -->
+<!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave,
+ U+00C8 ISOlat1 -->
+<!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute,
+ U+00C9 ISOlat1 -->
+<!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex,
+ U+00CA ISOlat1 -->
+<!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis,
+ U+00CB ISOlat1 -->
+<!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave,
+ U+00CC ISOlat1 -->
+<!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute,
+ U+00CD ISOlat1 -->
+<!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex,
+ U+00CE ISOlat1 -->
+<!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis,
+ U+00CF ISOlat1 -->
+<!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
+<!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde,
+ U+00D1 ISOlat1 -->
+<!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave,
+ U+00D2 ISOlat1 -->
+<!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute,
+ U+00D3 ISOlat1 -->
+<!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex,
+ U+00D4 ISOlat1 -->
+<!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde,
+ U+00D5 ISOlat1 -->
+<!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis,
+ U+00D6 ISOlat1 -->
+<!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
+<!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke
+ = latin capital letter O slash,
+ U+00D8 ISOlat1 -->
+<!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave,
+ U+00D9 ISOlat1 -->
+<!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute,
+ U+00DA ISOlat1 -->
+<!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex,
+ U+00DB ISOlat1 -->
+<!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis,
+ U+00DC ISOlat1 -->
+<!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute,
+ U+00DD ISOlat1 -->
+<!ENTITY THORN "&#222;"> <!-- latin capital letter THORN,
+ U+00DE ISOlat1 -->
+<!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed,
+ U+00DF ISOlat1 -->
+<!ENTITY agrave "&#224;"> <!-- latin small letter a with grave
+ = latin small letter a grave,
+ U+00E0 ISOlat1 -->
+<!ENTITY aacute "&#225;"> <!-- latin small letter a with acute,
+ U+00E1 ISOlat1 -->
+<!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex,
+ U+00E2 ISOlat1 -->
+<!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde,
+ U+00E3 ISOlat1 -->
+<!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis,
+ U+00E4 ISOlat1 -->
+<!ENTITY aring "&#229;"> <!-- latin small letter a with ring above
+ = latin small letter a ring,
+ U+00E5 ISOlat1 -->
+<!ENTITY aelig "&#230;"> <!-- latin small letter ae
+ = latin small ligature ae, U+00E6 ISOlat1 -->
+<!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla,
+ U+00E7 ISOlat1 -->
+<!ENTITY egrave "&#232;"> <!-- latin small letter e with grave,
+ U+00E8 ISOlat1 -->
+<!ENTITY eacute "&#233;"> <!-- latin small letter e with acute,
+ U+00E9 ISOlat1 -->
+<!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex,
+ U+00EA ISOlat1 -->
+<!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis,
+ U+00EB ISOlat1 -->
+<!ENTITY igrave "&#236;"> <!-- latin small letter i with grave,
+ U+00EC ISOlat1 -->
+<!ENTITY iacute "&#237;"> <!-- latin small letter i with acute,
+ U+00ED ISOlat1 -->
+<!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex,
+ U+00EE ISOlat1 -->
+<!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis,
+ U+00EF ISOlat1 -->
+<!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
+<!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde,
+ U+00F1 ISOlat1 -->
+<!ENTITY ograve "&#242;"> <!-- latin small letter o with grave,
+ U+00F2 ISOlat1 -->
+<!ENTITY oacute "&#243;"> <!-- latin small letter o with acute,
+ U+00F3 ISOlat1 -->
+<!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex,
+ U+00F4 ISOlat1 -->
+<!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde,
+ U+00F5 ISOlat1 -->
+<!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis,
+ U+00F6 ISOlat1 -->
+<!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
+<!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke,
+ = latin small letter o slash,
+ U+00F8 ISOlat1 -->
+<!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave,
+ U+00F9 ISOlat1 -->
+<!ENTITY uacute "&#250;"> <!-- latin small letter u with acute,
+ U+00FA ISOlat1 -->
+<!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex,
+ U+00FB ISOlat1 -->
+<!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis,
+ U+00FC ISOlat1 -->
+<!ENTITY yacute "&#253;"> <!-- latin small letter y with acute,
+ U+00FD ISOlat1 -->
+<!ENTITY thorn "&#254;"> <!-- latin small letter thorn,
+ U+00FE ISOlat1 -->
+<!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis,
+ U+00FF ISOlat1 -->
diff --git a/Utilities/xml/xhtml-special.ent b/Utilities/xml/xhtml-special.ent
new file mode 100644
index 0000000..3a83fb6
--- /dev/null
+++ b/Utilities/xml/xhtml-special.ent
@@ -0,0 +1,80 @@
+<!-- Special characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+ %HTMLspecial;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- C0 Controls and Basic Latin -->
+<!ENTITY quot "&#34;"> <!-- quotation mark, U+0022 ISOnum -->
+<!ENTITY amp "&#38;#38;"> <!-- ampersand, U+0026 ISOnum -->
+<!ENTITY lt "&#38;#60;"> <!-- less-than sign, U+003C ISOnum -->
+<!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
+<!ENTITY apos "&#39;"> <!-- apostrophe = APL quote, U+0027 ISOnum -->
+
+<!-- Latin Extended-A -->
+<!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
+ U+0152 ISOlat2 -->
+<!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
+<!-- ligature is a misnomer, this is a separate character in some languages -->
+<!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
+ U+0160 ISOlat2 -->
+<!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
+ U+0161 ISOlat2 -->
+<!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
+ U+0178 ISOlat2 -->
+
+<!-- Spacing Modifier Letters -->
+<!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
+ U+02C6 ISOpub -->
+<!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
+
+<!-- General Punctuation -->
+<!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
+<!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
+<!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
+<!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
+ U+200C NEW RFC 2070 -->
+<!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
+<!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
+<!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
+<!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
+<!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
+<!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
+ U+2018 ISOnum -->
+<!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
+ U+2019 ISOnum -->
+<!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
+<!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
+ U+201C ISOnum -->
+<!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
+ U+201D ISOnum -->
+<!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
+<!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
+<!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
+<!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
+<!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
+ U+2039 ISO proposed -->
+<!-- lsaquo is proposed but not yet ISO standardized -->
+<!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
+ U+203A ISO proposed -->
+<!-- rsaquo is proposed but not yet ISO standardized -->
+
+<!-- Currency Symbols -->
+<!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
diff --git a/Utilities/xml/xhtml-symbol.ent b/Utilities/xml/xhtml-symbol.ent
new file mode 100644
index 0000000..d0c77ee
--- /dev/null
+++ b/Utilities/xml/xhtml-symbol.ent
@@ -0,0 +1,237 @@
+<!-- Mathematical, Greek and Symbolic characters for XHTML -->
+
+<!-- Character entity set. Typical invocation:
+ <!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+ %HTMLsymbol;
+-->
+
+<!-- Portions (C) International Organization for Standardization 1986:
+ Permission to copy in any form is granted for use with
+ conforming SGML systems and applications as defined in
+ ISO 8879, provided this notice is included in all copies.
+-->
+
+<!-- Relevant ISO entity set is given unless names are newly introduced.
+ New names (i.e., not in ISO 8879 list) do not clash with any
+ existing ISO 8879 entity names. ISO 10646 character numbers
+ are given for each character, in hex. values are decimal
+ conversions of the ISO 10646 values and refer to the document
+ character set. Names are Unicode names.
+-->
+
+<!-- Latin Extended-B -->
+<!ENTITY fnof "&#402;"> <!-- latin small letter f with hook = function
+ = florin, U+0192 ISOtech -->
+
+<!-- Greek -->
+<!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
+<!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
+<!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
+ U+0393 ISOgrk3 -->
+<!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
+ U+0394 ISOgrk3 -->
+<!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
+<!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
+<!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
+<!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
+ U+0398 ISOgrk3 -->
+<!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
+<!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
+<!ENTITY Lambda "&#923;"> <!-- greek capital letter lamda,
+ U+039B ISOgrk3 -->
+<!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
+<!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
+<!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
+<!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
+<!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
+<!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
+<!-- there is no Sigmaf, and no U+03A2 character either -->
+<!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
+ U+03A3 ISOgrk3 -->
+<!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
+<!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
+ U+03A5 ISOgrk3 -->
+<!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
+ U+03A6 ISOgrk3 -->
+<!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
+<!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
+ U+03A8 ISOgrk3 -->
+<!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
+ U+03A9 ISOgrk3 -->
+
+<!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
+ U+03B1 ISOgrk3 -->
+<!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
+<!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
+ U+03B3 ISOgrk3 -->
+<!ENTITY delta "&#948;"> <!-- greek small letter delta,
+ U+03B4 ISOgrk3 -->
+<!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
+ U+03B5 ISOgrk3 -->
+<!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
+<!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
+<!ENTITY theta "&#952;"> <!-- greek small letter theta,
+ U+03B8 ISOgrk3 -->
+<!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
+<!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
+ U+03BA ISOgrk3 -->
+<!ENTITY lambda "&#955;"> <!-- greek small letter lamda,
+ U+03BB ISOgrk3 -->
+<!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
+<!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
+<!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
+<!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
+<!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
+<!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
+<!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
+ U+03C2 ISOgrk3 -->
+<!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
+ U+03C3 ISOgrk3 -->
+<!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
+<!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
+ U+03C5 ISOgrk3 -->
+<!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
+<!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
+<!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
+<!ENTITY omega "&#969;"> <!-- greek small letter omega,
+ U+03C9 ISOgrk3 -->
+<!ENTITY thetasym "&#977;"> <!-- greek theta symbol,
+ U+03D1 NEW -->
+<!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
+ U+03D2 NEW -->
+<!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
+
+<!-- General Punctuation -->
+<!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
+ U+2022 ISOpub -->
+<!-- bullet is NOT the same as bullet operator, U+2219 -->
+<!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
+ U+2026 ISOpub -->
+<!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
+<!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
+ U+2033 ISOtech -->
+<!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
+ U+203E NEW -->
+<!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
+
+<!-- Letterlike Symbols -->
+<!ENTITY weierp "&#8472;"> <!-- script capital P = power set
+ = Weierstrass p, U+2118 ISOamso -->
+<!ENTITY image "&#8465;"> <!-- black-letter capital I = imaginary part,
+ U+2111 ISOamso -->
+<!ENTITY real "&#8476;"> <!-- black-letter capital R = real part symbol,
+ U+211C ISOamso -->
+<!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
+<!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
+ U+2135 NEW -->
+<!-- alef symbol is NOT the same as hebrew letter alef,
+ U+05D0 although the same glyph could be used to depict both characters -->
+
+<!-- Arrows -->
+<!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
+<!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
+<!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
+<!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
+<!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
+<!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
+ = carriage return, U+21B5 NEW -->
+<!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
+<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow
+ but also does not have any other character for that function. So lArr can
+ be used for 'is implied by' as ISOtech suggests -->
+<!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
+<!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
+ U+21D2 ISOtech -->
+<!-- Unicode does not say this is the 'implies' character but does not have
+ another character with this function so rArr can be used for 'implies'
+ as ISOtech suggests -->
+<!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
+<!ENTITY hArr "&#8660;"> <!-- left right double arrow,
+ U+21D4 ISOamsa -->
+
+<!-- Mathematical Operators -->
+<!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
+<!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
+<!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
+<!ENTITY empty "&#8709;"> <!-- empty set = null set, U+2205 ISOamso -->
+<!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
+ U+2207 ISOtech -->
+<!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
+<!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
+<!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
+<!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
+ U+220F ISOamsb -->
+<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
+ the same glyph might be used for both -->
+<!ENTITY sum "&#8721;"> <!-- n-ary summation, U+2211 ISOamsb -->
+<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
+ though the same glyph might be used for both -->
+<!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
+<!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
+<!ENTITY radic "&#8730;"> <!-- square root = radical sign,
+ U+221A ISOtech -->
+<!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
+<!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
+<!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
+<!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
+<!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
+<!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
+<!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
+<!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
+<!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
+<!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
+ U+223C ISOtech -->
+<!-- tilde operator is NOT the same character as the tilde, U+007E,
+ although the same glyph might be used to represent both -->
+<!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
+<!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
+ U+2248 ISOamsr -->
+<!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
+<!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
+<!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
+<!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
+ U+2265 ISOtech -->
+<!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
+<!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
+<!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
+<!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
+<!ENTITY supe "&#8839;"> <!-- superset of or equal to,
+ U+2287 ISOtech -->
+<!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
+ U+2295 ISOamsb -->
+<!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
+ U+2297 ISOamsb -->
+<!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
+ U+22A5 ISOtech -->
+<!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
+<!-- dot operator is NOT the same character as U+00B7 middle dot -->
+
+<!-- Miscellaneous Technical -->
+<!ENTITY lceil "&#8968;"> <!-- left ceiling = APL upstile,
+ U+2308 ISOamsc -->
+<!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
+<!ENTITY lfloor "&#8970;"> <!-- left floor = APL downstile,
+ U+230A ISOamsc -->
+<!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
+<!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
+ U+2329 ISOtech -->
+<!-- lang is NOT the same character as U+003C 'less than sign'
+ or U+2039 'single left-pointing angle quotation mark' -->
+<!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
+ U+232A ISOtech -->
+<!-- rang is NOT the same character as U+003E 'greater than sign'
+ or U+203A 'single right-pointing angle quotation mark' -->
+
+<!-- Geometric Shapes -->
+<!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
+
+<!-- Miscellaneous Symbols -->
+<!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
+<!-- black here seems to mean filled as opposed to hollow -->
+<!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
+ U+2663 ISOpub -->
+<!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
+ U+2665 ISOpub -->
+<!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
diff --git a/Utilities/xml/xhtml1-strict.dtd b/Utilities/xml/xhtml1-strict.dtd
new file mode 100644
index 0000000..e48fbea
--- /dev/null
+++ b/Utilities/xml/xhtml1-strict.dtd
@@ -0,0 +1,977 @@
+<!--
+ Extensible HTML version 1.0 Strict DTD
+
+ This is the same as HTML 4 Strict except for
+ changes due to the differences between XML and SGML.
+
+ Namespace = http://www.w3.org/1999/xhtml
+
+ For further information, see: http://www.w3.org/TR/xhtml1
+
+ Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
+ All Rights Reserved.
+
+ This DTD module is identified by the PUBLIC and SYSTEM identifiers:
+
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+
+ $Revision: 1.1 $
+ $Date: 2002/08/01 13:56:03 $
+
+-->
+
+<!--================ Character mnemonic entities =========================-->
+
+<!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "xhtml-symbol.ent">
+%HTMLsymbol;
+
+<!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "xhtml-special.ent">
+%HTMLspecial;
+
+<!--================== Imported Names ====================================-->
+
+<!ENTITY % ContentType "CDATA">
+ <!-- media type, as per [RFC2045] -->
+
+<!ENTITY % ContentTypes "CDATA">
+ <!-- comma-separated list of media types, as per [RFC2045] -->
+
+<!ENTITY % Charset "CDATA">
+ <!-- a character encoding, as per [RFC2045] -->
+
+<!ENTITY % Charsets "CDATA">
+ <!-- a space separated list of character encodings, as per [RFC2045] -->
+
+<!ENTITY % LanguageCode "NMTOKEN">
+ <!-- a language code, as per [RFC3066] -->
+
+<!ENTITY % Character "CDATA">
+ <!-- a single character, as per section 2.2 of [XML] -->
+
+<!ENTITY % Number "CDATA">
+ <!-- one or more digits -->
+
+<!ENTITY % LinkTypes "CDATA">
+ <!-- space-separated list of link types -->
+
+<!ENTITY % MediaDesc "CDATA">
+ <!-- single or comma-separated list of media descriptors -->
+
+<!ENTITY % URI "CDATA">
+ <!-- a Uniform Resource Identifier, see [RFC2396] -->
+
+<!ENTITY % UriList "CDATA">
+ <!-- a space separated list of Uniform Resource Identifiers -->
+
+<!ENTITY % Datetime "CDATA">
+ <!-- date and time information. ISO date format -->
+
+<!ENTITY % Script "CDATA">
+ <!-- script expression -->
+
+<!ENTITY % StyleSheet "CDATA">
+ <!-- style sheet data -->
+
+<!ENTITY % Text "CDATA">
+ <!-- used for titles etc. -->
+
+<!ENTITY % Length "CDATA">
+ <!-- nn for pixels or nn% for percentage length -->
+
+<!ENTITY % MultiLength "CDATA">
+ <!-- pixel, percentage, or relative -->
+
+<!ENTITY % Pixels "CDATA">
+ <!-- integer representing length in pixels -->
+
+<!-- these are used for image maps -->
+
+<!ENTITY % Shape "(rect|circle|poly|default)">
+
+<!ENTITY % Coords "CDATA">
+ <!-- comma separated list of lengths -->
+
+<!--=================== Generic Attributes ===============================-->
+
+<!-- core attributes common to most elements
+ id document-wide unique id
+ class space separated list of classes
+ style associated style info
+ title advisory title/amplification
+-->
+<!ENTITY % coreattrs
+ "id ID #IMPLIED
+ class CDATA #IMPLIED
+ style %StyleSheet; #IMPLIED
+ title %Text; #IMPLIED"
+ >
+
+<!-- internationalization attributes
+ lang language code (backwards compatible)
+ xml:lang language code (as per XML 1.0 spec)
+ dir direction for weak/neutral text
+-->
+<!ENTITY % i18n
+ "lang %LanguageCode; #IMPLIED
+ xml:lang %LanguageCode; #IMPLIED
+ dir (ltr|rtl) #IMPLIED"
+ >
+
+<!-- attributes for common UI events
+ onclick a pointer button was clicked
+ ondblclick a pointer button was double clicked
+ onmousedown a pointer button was pressed down
+ onmouseup a pointer button was released
+ onmousemove a pointer was moved onto the element
+ onmouseout a pointer was moved away from the element
+ onkeypress a key was pressed and released
+ onkeydown a key was pressed down
+ onkeyup a key was released
+-->
+<!ENTITY % events
+ "onclick %Script; #IMPLIED
+ ondblclick %Script; #IMPLIED
+ onmousedown %Script; #IMPLIED
+ onmouseup %Script; #IMPLIED
+ onmouseover %Script; #IMPLIED
+ onmousemove %Script; #IMPLIED
+ onmouseout %Script; #IMPLIED
+ onkeypress %Script; #IMPLIED
+ onkeydown %Script; #IMPLIED
+ onkeyup %Script; #IMPLIED"
+ >
+
+<!-- attributes for elements that can get the focus
+ accesskey accessibility key character
+ tabindex position in tabbing order
+ onfocus the element got the focus
+ onblur the element lost the focus
+-->
+<!ENTITY % focus
+ "accesskey %Character; #IMPLIED
+ tabindex %Number; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED"
+ >
+
+<!ENTITY % attrs "%coreattrs; %i18n; %events;">
+
+<!--=================== Text Elements ====================================-->
+
+<!ENTITY % special.pre
+ "br | span | bdo | map">
+
+
+<!ENTITY % special
+ "%special.pre; | object | img ">
+
+<!ENTITY % fontstyle "tt | i | b | big | small ">
+
+<!ENTITY % phrase "em | strong | dfn | code | q |
+ samp | kbd | var | cite | abbr | acronym | sub | sup ">
+
+<!ENTITY % inline.forms "input | select | textarea | label | button">
+
+<!-- these can occur at block or inline level -->
+<!ENTITY % misc.inline "ins | del | script">
+
+<!-- these can only occur at block level -->
+<!ENTITY % misc "noscript | %misc.inline;">
+
+<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
+
+<!-- %Inline; covers inline or "text-level" elements -->
+<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">
+
+<!--================== Block level elements ==============================-->
+
+<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
+<!ENTITY % lists "ul | ol | dl">
+<!ENTITY % blocktext "pre | hr | blockquote | address">
+
+<!ENTITY % block
+ "p | %heading; | div | %lists; | %blocktext; | fieldset | table">
+
+<!ENTITY % Block "(%block; | form | %misc;)*">
+
+<!-- %Flow; mixes block and inline and is used for list items etc. -->
+<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
+
+<!--================== Content models for exclusions =====================-->
+
+<!-- a elements use %Inline; excluding a -->
+
+<!ENTITY % a.content
+ "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*">
+
+<!-- pre uses %Inline excluding big, small, sup or sup -->
+
+<!ENTITY % pre.content
+ "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;
+ | %inline.forms;)*">
+
+<!-- form uses %Block; excluding form -->
+
+<!ENTITY % form.content "(%block; | %misc;)*">
+
+<!-- button uses %Flow; but excludes a, form and form controls -->
+
+<!ENTITY % button.content
+ "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
+ table | %special; | %fontstyle; | %phrase; | %misc;)*">
+
+<!--================ Document Structure ==================================-->
+
+<!-- the namespace URI designates the document profile -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+ %i18n;
+ id ID #IMPLIED
+ xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
+ >
+
+<!--================ Document Head =======================================-->
+
+<!ENTITY % head.misc "(script|style|meta|link|object)*">
+
+<!-- content model is %head.misc; combined with a single
+ title and an optional base element in any order -->
+
+<!ELEMENT head (%head.misc;,
+ ((title, %head.misc;, (base, %head.misc;)?) |
+ (base, %head.misc;, (title, %head.misc;))))>
+
+<!ATTLIST head
+ %i18n;
+ id ID #IMPLIED
+ profile %URI; #IMPLIED
+ >
+
+<!-- The title element is not considered part of the flow of text.
+ It should be displayed, for example as the page header or
+ window title. Exactly one title is required per document.
+ -->
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title
+ %i18n;
+ id ID #IMPLIED
+ >
+
+<!-- document base URI -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+ href %URI; #REQUIRED
+ id ID #IMPLIED
+ >
+
+<!-- generic metainformation -->
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+ %i18n;
+ id ID #IMPLIED
+ http-equiv CDATA #IMPLIED
+ name CDATA #IMPLIED
+ content CDATA #REQUIRED
+ scheme CDATA #IMPLIED
+ >
+
+<!--
+ Relationship values can be used in principle:
+
+ a) for document specific toolbars/menus when used
+ with the link element in document head e.g.
+ start, contents, previous, next, index, end, help
+ b) to link to a separate style sheet (rel="stylesheet")
+ c) to make a link to a script (rel="script")
+ d) by stylesheets to control how collections of
+ html nodes are rendered into printed documents
+ e) to make a link to a printable version of this document
+ e.g. a PostScript or PDF version (rel="alternate" media="print")
+-->
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+ %attrs;
+ charset %Charset; #IMPLIED
+ href %URI; #IMPLIED
+ hreflang %LanguageCode; #IMPLIED
+ type %ContentType; #IMPLIED
+ rel %LinkTypes; #IMPLIED
+ rev %LinkTypes; #IMPLIED
+ media %MediaDesc; #IMPLIED
+ >
+
+<!-- style info, which may include CDATA sections -->
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+ %i18n;
+ id ID #IMPLIED
+ type %ContentType; #REQUIRED
+ media %MediaDesc; #IMPLIED
+ title %Text; #IMPLIED
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!-- script statements, which may include CDATA sections -->
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+ id ID #IMPLIED
+ charset %Charset; #IMPLIED
+ type %ContentType; #REQUIRED
+ src %URI; #IMPLIED
+ defer (defer) #IMPLIED
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!-- alternate content container for non script-based rendering -->
+
+<!ELEMENT noscript %Block;>
+<!ATTLIST noscript
+ %attrs;
+ >
+
+<!--=================== Document Body ====================================-->
+
+<!ELEMENT body %Block;>
+<!ATTLIST body
+ %attrs;
+ onload %Script; #IMPLIED
+ onunload %Script; #IMPLIED
+ >
+
+<!ELEMENT div %Flow;> <!-- generic language/style container -->
+<!ATTLIST div
+ %attrs;
+ >
+
+<!--=================== Paragraphs =======================================-->
+
+<!ELEMENT p %Inline;>
+<!ATTLIST p
+ %attrs;
+ >
+
+<!--=================== Headings =========================================-->
+
+<!--
+ There are six levels of headings from h1 (the most important)
+ to h6 (the least important).
+-->
+
+<!ELEMENT h1 %Inline;>
+<!ATTLIST h1
+ %attrs;
+ >
+
+<!ELEMENT h2 %Inline;>
+<!ATTLIST h2
+ %attrs;
+ >
+
+<!ELEMENT h3 %Inline;>
+<!ATTLIST h3
+ %attrs;
+ >
+
+<!ELEMENT h4 %Inline;>
+<!ATTLIST h4
+ %attrs;
+ >
+
+<!ELEMENT h5 %Inline;>
+<!ATTLIST h5
+ %attrs;
+ >
+
+<!ELEMENT h6 %Inline;>
+<!ATTLIST h6
+ %attrs;
+ >
+
+<!--=================== Lists ============================================-->
+
+<!-- Unordered list -->
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul
+ %attrs;
+ >
+
+<!-- Ordered (numbered) list -->
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol
+ %attrs;
+ >
+
+<!-- list item -->
+
+<!ELEMENT li %Flow;>
+<!ATTLIST li
+ %attrs;
+ >
+
+<!-- definition lists - dt for term, dd for its definition -->
+
+<!ELEMENT dl (dt|dd)+>
+<!ATTLIST dl
+ %attrs;
+ >
+
+<!ELEMENT dt %Inline;>
+<!ATTLIST dt
+ %attrs;
+ >
+
+<!ELEMENT dd %Flow;>
+<!ATTLIST dd
+ %attrs;
+ >
+
+<!--=================== Address ==========================================-->
+
+<!-- information on author -->
+
+<!ELEMENT address %Inline;>
+<!ATTLIST address
+ %attrs;
+ >
+
+<!--=================== Horizontal Rule ==================================-->
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr
+ %attrs;
+ >
+
+<!--=================== Preformatted Text ================================-->
+
+<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->
+
+<!ELEMENT pre %pre.content;>
+<!ATTLIST pre
+ %attrs;
+ xml:space (preserve) #FIXED 'preserve'
+ >
+
+<!--=================== Block-like Quotes ================================-->
+
+<!ELEMENT blockquote %Block;>
+<!ATTLIST blockquote
+ %attrs;
+ cite %URI; #IMPLIED
+ >
+
+<!--=================== Inserted/Deleted Text ============================-->
+
+<!--
+ ins/del are allowed in block and inline content, but its
+ inappropriate to include block content within an ins element
+ occurring in inline content.
+-->
+<!ELEMENT ins %Flow;>
+<!ATTLIST ins
+ %attrs;
+ cite %URI; #IMPLIED
+ datetime %Datetime; #IMPLIED
+ >
+
+<!ELEMENT del %Flow;>
+<!ATTLIST del
+ %attrs;
+ cite %URI; #IMPLIED
+ datetime %Datetime; #IMPLIED
+ >
+
+<!--================== The Anchor Element ================================-->
+
+<!-- content is %Inline; except that anchors shouldn't be nested -->
+
+<!ELEMENT a %a.content;>
+<!ATTLIST a
+ %attrs;
+ %focus;
+ charset %Charset; #IMPLIED
+ type %ContentType; #IMPLIED
+ name NMTOKEN #IMPLIED
+ href %URI; #IMPLIED
+ hreflang %LanguageCode; #IMPLIED
+ rel %LinkTypes; #IMPLIED
+ rev %LinkTypes; #IMPLIED
+ shape %Shape; "rect"
+ coords %Coords; #IMPLIED
+ >
+
+<!--===================== Inline Elements ================================-->
+
+<!ELEMENT span %Inline;> <!-- generic language/style container -->
+<!ATTLIST span
+ %attrs;
+ >
+
+<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
+<!ATTLIST bdo
+ %coreattrs;
+ %events;
+ lang %LanguageCode; #IMPLIED
+ xml:lang %LanguageCode; #IMPLIED
+ dir (ltr|rtl) #REQUIRED
+ >
+
+<!ELEMENT br EMPTY> <!-- forced line break -->
+<!ATTLIST br
+ %coreattrs;
+ >
+
+<!ELEMENT em %Inline;> <!-- emphasis -->
+<!ATTLIST em %attrs;>
+
+<!ELEMENT strong %Inline;> <!-- strong emphasis -->
+<!ATTLIST strong %attrs;>
+
+<!ELEMENT dfn %Inline;> <!-- definitional -->
+<!ATTLIST dfn %attrs;>
+
+<!ELEMENT code %Inline;> <!-- program code -->
+<!ATTLIST code %attrs;>
+
+<!ELEMENT samp %Inline;> <!-- sample -->
+<!ATTLIST samp %attrs;>
+
+<!ELEMENT kbd %Inline;> <!-- something user would type -->
+<!ATTLIST kbd %attrs;>
+
+<!ELEMENT var %Inline;> <!-- variable -->
+<!ATTLIST var %attrs;>
+
+<!ELEMENT cite %Inline;> <!-- citation -->
+<!ATTLIST cite %attrs;>
+
+<!ELEMENT abbr %Inline;> <!-- abbreviation -->
+<!ATTLIST abbr %attrs;>
+
+<!ELEMENT acronym %Inline;> <!-- acronym -->
+<!ATTLIST acronym %attrs;>
+
+<!ELEMENT q %Inline;> <!-- inlined quote -->
+<!ATTLIST q
+ %attrs;
+ cite %URI; #IMPLIED
+ >
+
+<!ELEMENT sub %Inline;> <!-- subscript -->
+<!ATTLIST sub %attrs;>
+
+<!ELEMENT sup %Inline;> <!-- superscript -->
+<!ATTLIST sup %attrs;>
+
+<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
+<!ATTLIST tt %attrs;>
+
+<!ELEMENT i %Inline;> <!-- italic font -->
+<!ATTLIST i %attrs;>
+
+<!ELEMENT b %Inline;> <!-- bold font -->
+<!ATTLIST b %attrs;>
+
+<!ELEMENT big %Inline;> <!-- bigger font -->
+<!ATTLIST big %attrs;>
+
+<!ELEMENT small %Inline;> <!-- smaller font -->
+<!ATTLIST small %attrs;>
+
+<!--==================== Object ======================================-->
+<!--
+ object is used to embed objects as part of HTML pages.
+ param elements should precede other content. Parameters
+ can also be expressed as attribute/value pairs on the
+ object element itself when brevity is desired.
+-->
+
+<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
+<!ATTLIST object
+ %attrs;
+ declare (declare) #IMPLIED
+ classid %URI; #IMPLIED
+ codebase %URI; #IMPLIED
+ data %URI; #IMPLIED
+ type %ContentType; #IMPLIED
+ codetype %ContentType; #IMPLIED
+ archive %UriList; #IMPLIED
+ standby %Text; #IMPLIED
+ height %Length; #IMPLIED
+ width %Length; #IMPLIED
+ usemap %URI; #IMPLIED
+ name NMTOKEN #IMPLIED
+ tabindex %Number; #IMPLIED
+ >
+
+<!--
+ param is used to supply a named property value.
+ In XML it would seem natural to follow RDF and support an
+ abbreviated syntax where the param elements are replaced
+ by attribute value pairs on the object start tag.
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+ id ID #IMPLIED
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ valuetype (data|ref|object) "data"
+ type %ContentType; #IMPLIED
+ >
+
+<!--=================== Images ===========================================-->
+
+<!--
+ To avoid accessibility problems for people who aren't
+ able to see the image, you should provide a text
+ description using the alt and longdesc attributes.
+ In addition, avoid the use of server-side image maps.
+ Note that in this DTD there is no name attribute. That
+ is only available in the transitional and frameset DTD.
+-->
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+ %attrs;
+ src %URI; #REQUIRED
+ alt %Text; #REQUIRED
+ longdesc %URI; #IMPLIED
+ height %Length; #IMPLIED
+ width %Length; #IMPLIED
+ usemap %URI; #IMPLIED
+ ismap (ismap) #IMPLIED
+ >
+
+<!-- usemap points to a map element which may be in this document
+ or an external document, although the latter is not widely supported -->
+
+<!--================== Client-side image maps ============================-->
+
+<!-- These can be placed in the same document or grouped in a
+ separate document although this isn't yet widely supported -->
+
+<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
+<!ATTLIST map
+ %i18n;
+ %events;
+ id ID #REQUIRED
+ class CDATA #IMPLIED
+ style %StyleSheet; #IMPLIED
+ title %Text; #IMPLIED
+ name NMTOKEN #IMPLIED
+ >
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+ %attrs;
+ %focus;
+ shape %Shape; "rect"
+ coords %Coords; #IMPLIED
+ href %URI; #IMPLIED
+ nohref (nohref) #IMPLIED
+ alt %Text; #REQUIRED
+ >
+
+<!--================ Forms ===============================================-->
+<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
+
+<!ATTLIST form
+ %attrs;
+ action %URI; #REQUIRED
+ method (get|post) "get"
+ enctype %ContentType; "application/x-www-form-urlencoded"
+ onsubmit %Script; #IMPLIED
+ onreset %Script; #IMPLIED
+ accept %ContentTypes; #IMPLIED
+ accept-charset %Charsets; #IMPLIED
+ >
+
+<!--
+ Each label must not contain more than ONE field
+ Label elements shouldn't be nested.
+-->
+<!ELEMENT label %Inline;>
+<!ATTLIST label
+ %attrs;
+ for IDREF #IMPLIED
+ accesskey %Character; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED
+ >
+
+<!ENTITY % InputType
+ "(text | password | checkbox |
+ radio | submit | reset |
+ file | hidden | image | button)"
+ >
+
+<!-- the name attribute is required for all but submit & reset -->
+
+<!ELEMENT input EMPTY> <!-- form control -->
+<!ATTLIST input
+ %attrs;
+ %focus;
+ type %InputType; "text"
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ checked (checked) #IMPLIED
+ disabled (disabled) #IMPLIED
+ readonly (readonly) #IMPLIED
+ size CDATA #IMPLIED
+ maxlength %Number; #IMPLIED
+ src %URI; #IMPLIED
+ alt CDATA #IMPLIED
+ usemap %URI; #IMPLIED
+ onselect %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ accept %ContentTypes; #IMPLIED
+ >
+
+<!ELEMENT select (optgroup|option)+> <!-- option selector -->
+<!ATTLIST select
+ %attrs;
+ name CDATA #IMPLIED
+ size %Number; #IMPLIED
+ multiple (multiple) #IMPLIED
+ disabled (disabled) #IMPLIED
+ tabindex %Number; #IMPLIED
+ onfocus %Script; #IMPLIED
+ onblur %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ >
+
+<!ELEMENT optgroup (option)+> <!-- option group -->
+<!ATTLIST optgroup
+ %attrs;
+ disabled (disabled) #IMPLIED
+ label %Text; #REQUIRED
+ >
+
+<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
+<!ATTLIST option
+ %attrs;
+ selected (selected) #IMPLIED
+ disabled (disabled) #IMPLIED
+ label %Text; #IMPLIED
+ value CDATA #IMPLIED
+ >
+
+<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
+<!ATTLIST textarea
+ %attrs;
+ %focus;
+ name CDATA #IMPLIED
+ rows %Number; #REQUIRED
+ cols %Number; #REQUIRED
+ disabled (disabled) #IMPLIED
+ readonly (readonly) #IMPLIED
+ onselect %Script; #IMPLIED
+ onchange %Script; #IMPLIED
+ >
+
+<!--
+ The fieldset element is used to group form fields.
+ Only one legend element should occur in the content
+ and if present should only be preceded by whitespace.
+-->
+<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
+<!ATTLIST fieldset
+ %attrs;
+ >
+
+<!ELEMENT legend %Inline;> <!-- fieldset label -->
+<!ATTLIST legend
+ %attrs;
+ accesskey %Character; #IMPLIED
+ >
+
+<!--
+ Content is %Flow; excluding a, form and form controls
+-->
+<!ELEMENT button %button.content;> <!-- push button -->
+<!ATTLIST button
+ %attrs;
+ %focus;
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED
+ type (button|submit|reset) "submit"
+ disabled (disabled) #IMPLIED
+ >
+
+<!--======================= Tables =======================================-->
+
+<!-- Derived from IETF HTML table standard, see [RFC1942] -->
+
+<!--
+ The border attribute sets the thickness of the frame around the
+ table. The default units are screen pixels.
+
+ The frame attribute specifies which parts of the frame around
+ the table should be rendered. The values are not the same as
+ CALS to avoid a name clash with the valign attribute.
+-->
+<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
+
+<!--
+ The rules attribute defines which rules to draw between cells:
+
+ If rules is absent then assume:
+ "none" if border is absent or border="0" otherwise "all"
+-->
+
+<!ENTITY % TRules "(none | groups | rows | cols | all)">
+
+<!-- horizontal alignment attributes for cell contents
+
+ char alignment char, e.g. char=':'
+ charoff offset for alignment char
+-->
+<!ENTITY % cellhalign
+ "align (left|center|right|justify|char) #IMPLIED
+ char %Character; #IMPLIED
+ charoff %Length; #IMPLIED"
+ >
+
+<!-- vertical alignment attributes for cell contents -->
+<!ENTITY % cellvalign
+ "valign (top|middle|bottom|baseline) #IMPLIED"
+ >
+
+<!ELEMENT table
+ (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
+<!ELEMENT caption %Inline;>
+<!ELEMENT thead (tr)+>
+<!ELEMENT tfoot (tr)+>
+<!ELEMENT tbody (tr)+>
+<!ELEMENT colgroup (col)*>
+<!ELEMENT col EMPTY>
+<!ELEMENT tr (th|td)+>
+<!ELEMENT th %Flow;>
+<!ELEMENT td %Flow;>
+
+<!ATTLIST table
+ %attrs;
+ summary %Text; #IMPLIED
+ width %Length; #IMPLIED
+ border %Pixels; #IMPLIED
+ frame %TFrame; #IMPLIED
+ rules %TRules; #IMPLIED
+ cellspacing %Length; #IMPLIED
+ cellpadding %Length; #IMPLIED
+ >
+
+<!ATTLIST caption
+ %attrs;
+ >
+
+<!--
+colgroup groups a set of col elements. It allows you to group
+several semantically related columns together.
+-->
+<!ATTLIST colgroup
+ %attrs;
+ span %Number; "1"
+ width %MultiLength; #IMPLIED
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!--
+ col elements define the alignment properties for cells in
+ one or more columns.
+
+ The width attribute specifies the width of the columns, e.g.
+
+ width=64 width in screen pixels
+ width=0.5* relative width of 0.5
+
+ The span attribute causes the attributes of one
+ col element to apply to more than one column.
+-->
+<!ATTLIST col
+ %attrs;
+ span %Number; "1"
+ width %MultiLength; #IMPLIED
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!--
+ Use thead to duplicate headers when breaking table
+ across page boundaries, or for static headers when
+ tbody sections are rendered in scrolling panel.
+
+ Use tfoot to duplicate footers when breaking table
+ across page boundaries, or for static footers when
+ tbody sections are rendered in scrolling panel.
+
+ Use multiple tbody sections when rules are needed
+ between groups of table rows.
+-->
+<!ATTLIST thead
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tfoot
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tbody
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST tr
+ %attrs;
+ %cellhalign;
+ %cellvalign;
+ >
+
+
+<!-- Scope is simpler than headers attribute for common tables -->
+<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
+
+<!-- th is for headers, td for data and for cells acting as both -->
+
+<!ATTLIST th
+ %attrs;
+ abbr %Text; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ scope %Scope; #IMPLIED
+ rowspan %Number; "1"
+ colspan %Number; "1"
+ %cellhalign;
+ %cellvalign;
+ >
+
+<!ATTLIST td
+ %attrs;
+ abbr %Text; #IMPLIED
+ axis CDATA #IMPLIED
+ headers IDREFS #IMPLIED
+ scope %Scope; #IMPLIED
+ rowspan %Number; "1"
+ colspan %Number; "1"
+ %cellhalign;
+ %cellvalign;
+ >
diff --git a/bootstrap b/bootstrap
index c018b3c..01d9e15 100755
--- a/bootstrap
+++ b/bootstrap
@@ -166,6 +166,7 @@ CMAKE_UNUSED_SOURCES="\
"
CMAKE_CXX_SOURCES="\
+ cmStandardIncludes \
cmake \
cmakemain \
cmakewizard \
@@ -649,11 +650,74 @@ if ${cmake_system_haiku}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
+#-----------------------------------------------------------------------------
+# Detect known toolchains on some platforms.
+cmake_toolchains=''
+case "${cmake_system}" in
+ *AIX*) cmake_toolchains='XL GNU' ;;
+ *CYGWIN*) cmake_toolchains='GNU' ;;
+ *Darwin*) cmake_toolchains='GNU Clang' ;;
+ *Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
+ *MINGW*) cmake_toolchains='GNU' ;;
+esac
+
+# Toolchain compiler name table.
+cmake_toolchain_Clang_CC='clang'
+cmake_toolchain_Clang_CXX='clang++'
+cmake_toolchain_GNU_CC='gcc'
+cmake_toolchain_GNU_CXX='g++'
+cmake_toolchain_PGI_CC='pgcc'
+cmake_toolchain_PGI_CXX='pgCC'
+cmake_toolchain_PathScale_CC='pathcc'
+cmake_toolchain_PathScale_CXX='pathCC'
+cmake_toolchain_XL_CC='xlc'
+cmake_toolchain_XL_CXX='xlC'
+
+cmake_toolchain_try()
+{
+ tc="$1"
+ TMPFILE=`cmake_tmp_file`
+
+ eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
+ echo 'int main() { return 0; }' > "${TMPFILE}.c"
+ cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
+ tc_result_CC="$?"
+ rm -f "${TMPFILE}.c"
+ test "${tc_result_CC}" = "0" || return 1
+
+ eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
+ echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
+ cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
+ tc_result_CXX="$?"
+ rm -f "${TMPFILE}.cpp"
+ test "${tc_result_CXX}" = "0" || return 1
+
+ cmake_toolchain="$tc"
+}
+
+cmake_toolchain_detect()
+{
+ cmake_toolchain=
+ for tc in ${cmake_toolchains}; do
+ echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
+ cmake_toolchain_try "$tc" &&
+ echo "Found $tc toolchain" &&
+ break
+ done
+}
+
+if [ -z "${CC}" -a -z "${CXX}" ]; then
+ cmake_toolchain_detect
+fi
+
+#-----------------------------------------------------------------------------
# Test C compiler
cmake_c_compiler=
# If CC is set, use that for compiler, otherwise use list of known compilers
-if [ -n "${CC}" ]; then
+if [ -n "${cmake_toolchain}" ]; then
+ eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
+elif [ -n "${CC}" ]; then
cmake_c_compilers="${CC}"
else
cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
@@ -696,13 +760,16 @@ See cmake_bootstrap.log for compilers attempted.
fi
echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
+#-----------------------------------------------------------------------------
# Test CXX compiler
cmake_cxx_compiler=
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
# If CC is set, use that for compiler, otherwise use list of known compilers
-if [ -n "${CXX}" ]; then
+if [ -n "${cmake_toolchain}" ]; then
+ eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
+elif [ -n "${CXX}" ]; then
cmake_cxx_compilers="${CXX}"
else
cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
@@ -753,6 +820,7 @@ See cmake_bootstrap.log for compilers attempted."
fi
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
+#-----------------------------------------------------------------------------
# Test Make
cmake_make_processor=