summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake24
-rw-r--r--CMakeLists.txt96
-rw-r--r--CTestConfig.cmake2
-rw-r--r--CTestCustom.cmake.in11
-rw-r--r--ChangeLog.manual480
-rw-r--r--Modules/BundleUtilities.cmake64
-rw-r--r--Modules/CMakeASMInformation.cmake35
-rw-r--r--Modules/CMakeCCompilerId.c.in3
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in3
-rw-r--r--Modules/CMakeCompilerABI.h10
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake1
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake7
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in4
-rw-r--r--Modules/CMakePrintSystemInformation.cmake2
-rw-r--r--Modules/CMakeTestCCompiler.cmake1
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake1
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake1
-rw-r--r--Modules/CMakeVS10FindMake.cmake32
-rw-r--r--Modules/CMakeVS8FindMake.cmake3
-rw-r--r--Modules/CMakeVS9FindMake.cmake4
-rw-r--r--Modules/CPackDeb.cmake145
-rw-r--r--Modules/CPackRPM.cmake254
-rw-r--r--Modules/CTest.cmake9
-rw-r--r--Modules/Compiler/Clang-C.cmake1
-rw-r--r--Modules/Compiler/Clang-CXX.cmake1
-rw-r--r--Modules/Compiler/SunPro-C.cmake4
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake4
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake3
-rw-r--r--Modules/Compiler/XL-Fortran.cmake1
-rw-r--r--Modules/DartConfiguration.tcl.in9
-rw-r--r--Modules/ExternalProject.cmake460
-rw-r--r--Modules/FindASPELL.cmake6
-rw-r--r--Modules/FindAVIFile.cmake20
-rw-r--r--Modules/FindBISON.cmake6
-rw-r--r--Modules/FindBZip2.cmake5
-rw-r--r--Modules/FindBoost.cmake3
-rw-r--r--Modules/FindCUDA.cmake33
-rw-r--r--Modules/FindCurses.cmake9
-rw-r--r--Modules/FindCygwin.cmake3
-rw-r--r--Modules/FindDCMTK.cmake266
-rw-r--r--Modules/FindDart.cmake7
-rw-r--r--Modules/FindEXPAT.cmake3
-rw-r--r--Modules/FindGCCXML.cmake5
-rw-r--r--Modules/FindGLU.cmake4
-rw-r--r--Modules/FindGit.cmake46
-rw-r--r--Modules/FindHSPELL.cmake29
-rw-r--r--Modules/FindJNI.cmake61
-rw-r--r--Modules/FindJasper.cmake11
-rw-r--r--Modules/FindJava.cmake57
-rw-r--r--Modules/FindKDE4.cmake2
-rw-r--r--Modules/FindLibArchive.cmake63
-rw-r--r--Modules/FindLibXml2.cmake5
-rw-r--r--Modules/FindLibXslt.cmake7
-rw-r--r--Modules/FindMPEG.cmake4
-rw-r--r--Modules/FindMPI.cmake29
-rw-r--r--Modules/FindOpenAL.cmake9
-rw-r--r--Modules/FindOpenSSL.cmake38
-rw-r--r--Modules/FindPNG.cmake2
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake248
-rw-r--r--Modules/FindPhysFS.cmake8
-rw-r--r--Modules/FindPkgConfig.cmake27
-rw-r--r--Modules/FindPostgreSQL.cmake181
-rw-r--r--Modules/FindQt4.cmake506
-rw-r--r--Modules/FindQuickTime.cmake10
-rw-r--r--Modules/FindSWIG.cmake2
-rw-r--r--Modules/FindSubversion.cmake22
-rw-r--r--Modules/FindTIFF.cmake2
-rw-r--r--Modules/FindThreads.cmake6
-rw-r--r--Modules/FindX11.cmake10
-rw-r--r--Modules/FindZLIB.cmake64
-rw-r--r--Modules/FindwxWidgets.cmake11
-rw-r--r--Modules/GetPrerequisites.cmake24
-rw-r--r--Modules/MacroAddFileDependencies.cmake2
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake1
-rw-r--r--Modules/Platform/GNU.cmake3
-rw-r--r--Modules/Platform/Generic.cmake6
-rw-r--r--Modules/Platform/Linux-Clang-C.cmake1
-rw-r--r--Modules/Platform/Linux-Clang-CXX.cmake1
-rw-r--r--Modules/Platform/Linux-SunPro-CXX.cmake9
-rw-r--r--Modules/Platform/OSF1.cmake1
-rw-r--r--Modules/Platform/OpenBSD.cmake16
-rw-r--r--Modules/Platform/Windows-G95-Fortran.cmake1
-rw-r--r--Modules/Platform/Windows-cl.cmake27
-rw-r--r--Modules/Platform/Windows-cl.cmake.in1
-rw-r--r--Modules/Platform/Windows-wcl386.cmake6
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake227
-rw-r--r--Modules/UseQt4.cmake9
-rw-r--r--Modules/readme.txt24
-rw-r--r--Source/CMakeLists.txt9
-rw-r--r--Source/CMakeVersionSource.cmake37
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx20
-rw-r--r--Source/CPack/cmCPackGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx2
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestBZR.cxx2
-rw-r--r--Source/CTest/cmCTestBuildCommand.h8
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx30
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx136
-rw-r--r--Source/CTest/cmCTestCoverageHandler.h63
-rw-r--r--Source/CTest/cmCTestGIT.cxx187
-rw-r--r--Source/CTest/cmCTestGIT.h8
-rw-r--r--Source/CTest/cmCTestHG.cxx2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx142
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h6
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.h2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx107
-rw-r--r--Source/CTest/cmCTestRunTest.h12
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx37
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h17
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx188
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h1
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx5
-rw-r--r--Source/CTest/cmCTestTestCommand.h7
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx12
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx2
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx1
-rw-r--r--Source/CTest/cmCTestVC.cxx1
-rw-r--r--Source/CTest/cmCTestVC.h1
-rw-r--r--Source/CTest/cmParsePHPCoverage.cxx252
-rw-r--r--Source/CTest/cmParsePHPCoverage.h48
-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/CursesDialog/form/fld_info.c2
-rw-r--r--Source/CursesDialog/form/fld_user.c4
-rw-r--r--Source/CursesDialog/form/frm_user.c4
-rw-r--r--Source/QtDialog/CMakeSetup.cxx19
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx42
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h3
-rw-r--r--Source/QtDialog/CMakeSetupDialog.ui240
-rw-r--r--Source/cmCMakeMinimumRequired.cxx19
-rw-r--r--Source/cmCMakeMinimumRequired.h4
-rw-r--r--Source/cmCMakePolicyCommand.h2
-rw-r--r--Source/cmCTest.cxx62
-rw-r--r--Source/cmCTest.h9
-rw-r--r--Source/cmComputeLinkInformation.cxx15
-rw-r--r--Source/cmComputeLinkInformation.h3
-rw-r--r--Source/cmCoreTryCompile.cxx17
-rw-r--r--Source/cmData.h38
-rw-r--r--Source/cmDocumentVariables.cxx20
-rw-r--r--Source/cmDocumentation.cxx43
-rw-r--r--Source/cmDocumentationFormatterText.cxx2
-rw-r--r--Source/cmELF.cxx4
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx4
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx1
-rw-r--r--Source/cmFileCommand.cxx339
-rw-r--r--Source/cmFileCommand.h10
-rw-r--r--Source/cmFindCommon.cxx14
-rw-r--r--Source/cmFindCommon.h2
-rw-r--r--Source/cmGetFilenameComponentCommand.h12
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx5
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx1
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx12
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx2
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.h5
-rw-r--r--Source/cmLocalGenerator.cxx18
-rw-r--r--Source/cmLocalGenerator.h2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx22
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx122
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx37
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx12
-rw-r--r--Source/cmMakefile.cxx65
-rw-r--r--Source/cmMakefile.h8
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileTargetGenerator.cxx24
-rw-r--r--Source/cmPolicies.cxx79
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmProcessTools.cxx6
-rw-r--r--Source/cmProcessTools.h1
-rw-r--r--Source/cmProjectCommand.h2
-rw-r--r--Source/cmSetCommand.cxx2
-rw-r--r--Source/cmSetPropertyCommand.h4
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.h36
-rw-r--r--Source/cmSourceFile.cxx6
-rw-r--r--Source/cmStandardIncludes.cxx16
-rw-r--r--Source/cmStandardIncludes.h4
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmSystemTools.cxx32
-rw-r--r--Source/cmSystemTools.h3
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmVersion.cxx3
-rw-r--r--Source/cmVersion.h1
-rw-r--r--Source/cmVersionConfig.h.in3
-rw-r--r--Source/cmVersionMacros.h19
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx86
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h4
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx13
-rw-r--r--Source/cmWin32ProcessExecution.cxx10
-rw-r--r--Source/cmWriteFileCommand.cxx21
-rw-r--r--Source/cm_utf8.c6
-rw-r--r--Source/cmake.cxx25
-rw-r--r--Source/ctest.cxx4
-rw-r--r--Source/kwsys/CMakeLists.txt47
-rw-r--r--Source/kwsys/Configure.h.in4
-rw-r--r--Source/kwsys/Configure.hxx.in9
-rw-r--r--Source/kwsys/DynamicLoader.cxx86
-rw-r--r--Source/kwsys/DynamicLoader.hxx.in8
-rw-r--r--Source/kwsys/ProcessUNIX.c14
-rw-r--r--Source/kwsys/ProcessWin32.c8
-rw-r--r--Source/kwsys/SharedForward.h.in6
-rw-r--r--Source/kwsys/SystemInformation.cxx12
-rw-r--r--Source/kwsys/SystemTools.cxx129
-rw-r--r--Source/kwsys/SystemTools.hxx.in23
-rw-r--r--Source/kwsys/hashtable.hxx.in16
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
-rw-r--r--Source/kwsys/testAutoPtr.cxx2
-rw-r--r--Source/kwsys/testProcess.c4
-rw-r--r--Templates/staticLibHeader.dsptemplate8
-rw-r--r--Tests/CMakeInstall.cmake2
-rw-r--r--Tests/CMakeLists.txt136
-rw-r--r--Tests/CMakeTests/CMakeLists.txt10
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in327
-rw-r--r--Tests/CMakeTests/FileDownloadInput.pngbin0 -> 358 bytes
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in41
-rw-r--r--Tests/CMakeTests/FindBaseTest.cmake.in2
-rw-r--r--Tests/CTestSubmitLargeOutput/test.cmake.in1
-rw-r--r--Tests/CTestTest2/test.cmake.in8
-rw-r--r--Tests/CTestTest3/test.cmake.in8
-rw-r--r--Tests/CTestTestChecksum/test.cmake.in28
-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/CTestTestScheduler/CMakeLists.txt4
-rw-r--r--Tests/CTestTestScheduler/sleep.c4
-rw-r--r--Tests/CTestTestStopTime/CMakeLists.txt11
-rw-r--r--Tests/CTestTestStopTime/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestStopTime/GetDate.cmake233
-rw-r--r--Tests/CTestTestStopTime/sleep.c21
-rw-r--r--Tests/CTestTestStopTime/test.cmake.in34
-rw-r--r--Tests/CTestUpdateBZR.cmake.in11
-rw-r--r--Tests/CTestUpdateCVS.cmake.in4
-rw-r--r--Tests/CTestUpdateCommon.cmake22
-rw-r--r--Tests/CTestUpdateGIT.cmake.in143
-rwxr-xr-xTests/CTestUpdateGIT.sh.in2
-rw-r--r--Tests/CTestUpdateHG.cmake.in4
-rw-r--r--Tests/CTestUpdateSVN.cmake.in4
-rw-r--r--Tests/CheckCompilerRelatedVariables/CMakeLists.txt85
-rw-r--r--Tests/ExternalProject/CMakeLists.txt156
-rw-r--r--Tests/ExternalProject/Example/CMakeLists.txt11
-rw-r--r--Tests/ExternalProject/Step1.tar.bz2bin0 -> 904 bytes
-rw-r--r--Tests/ExternalProject/Step1.zipbin0 -> 1074 bytes
-rw-r--r--Tests/ExternalProject/Step1NoDir.tar.bz2bin0 -> 852 bytes
-rw-r--r--Tests/ExternalProject/Step1NoDir.zipbin0 -> 1038 bytes
-rw-r--r--Tests/ExternalProject/gitrepo.tgzbin0 -> 1934 bytes
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt3
-rw-r--r--Tests/LinkFlags/CMakeLists.txt28
-rw-r--r--Tests/LinkFlags/LinkFlags.c1
-rw-r--r--Tests/LinkFlags/LinkFlagsExe.c6
-rw-r--r--Tests/LinkFlags/LinkFlagsLib.c6
-rw-r--r--Tests/bootstrap.bat.in2
-rw-r--r--Utilities/CMakeLists.txt22
-rw-r--r--Utilities/Doxygen/CMakeLists.txt10
-rwxr-xr-xUtilities/Doxygen/doc_makeall.sh.in4
-rw-r--r--Utilities/Doxygen/doxyfile.in20
-rw-r--r--Utilities/KWStyle/CMake.kws.xml.in2
-rw-r--r--Utilities/KWStyle/CMakeFiles.txt.in24
-rw-r--r--Utilities/KWStyle/CMakeLists.txt20
-rw-r--r--Utilities/KWStyle/CMakeMoreChecks.kws.xml.in2
-rw-r--r--Utilities/Release/dash2win64_release.cmake4
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake4
-rwxr-xr-xUtilities/Release/release_cmake.sh.in9
-rw-r--r--Utilities/Release/v20n250_aix_release.cmake4
-rw-r--r--Utilities/cmcompress/cmcompress.c2
-rw-r--r--Utilities/cmcurl/CMakeLists.txt1
-rw-r--r--Utilities/cmcurl/curl/multi.h2
-rw-r--r--Utilities/cmcurl/url.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_endian.h3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_copy_bhfi.c1
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_compression_program.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_windows.h16
-rw-r--r--Utilities/cmlibarchive/libarchive/config_windows.h7
-rw-r--r--Utilities/cmzlib/deflate.c8
-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-xbootstrap103
293 files changed, 8198 insertions, 2356 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 613bb9f..692befa 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -27,16 +27,9 @@ 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_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
- IF(CMake_VERSION_RC)
- SET(CPACK_SOURCE_PACKAGE_FILE_NAME
- "${CPACK_SOURCE_PACKAGE_FILE_NAME}-rc${CMake_VERSION_RC}")
- ENDIF(CMake_VERSION_RC)
+ SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
IF(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
@@ -73,22 +66,11 @@ 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
SET(CPACK_PACKAGE_FILE_NAME
- "${CPACK_PACKAGE_NAME}-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
+ "${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
# the source has the same name as the binary
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# Create a cygwin version number in case there are changes for cygwin
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4cd11c4..b318a0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,18 +69,25 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CACHE BOOL "Use system-installed expat" FORCE)
SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}"
CACHE BOOL "Use system-installed zlib" FORCE)
+ SET(CMAKE_USE_SYSTEM_BZIP2 "${CMAKE_USE_SYSTEM_LIBRARIES}"
+ CACHE BOOL "Use system-installed bzip2" FORCE)
+ SET(CMAKE_USE_SYSTEM_LIBARCHIVE "${CMAKE_USE_SYSTEM_LIBRARIES}"
+ CACHE BOOL "Use system-installed libarchive" FORCE)
ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
# Optionally use system utility libraries.
+ OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" ${CMAKE_USE_SYSTEM_LIBRARIES})
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
- ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
+ ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
+ CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
+ ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
# Mention to the user what system libraries are being used.
- FOREACH(util CURL EXPAT XMLRPC ZLIB)
+ FOREACH(util BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
IF(CMAKE_USE_SYSTEM_${util})
MESSAGE(STATUS "Using system-installed ${util}")
ENDIF(CMAKE_USE_SYSTEM_${util})
@@ -263,14 +270,26 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(BZIP2_LIBRARIES cmbzip2)
ADD_SUBDIRECTORY(Utilities/cmbzip2)
ENDIF()
+
+ #---------------------------------------------------------------------
+ # Build or use system libarchive for CMake and CTest.
IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
- FIND_PACKAGE(libarchive)
- SET(CMAKE_TAR_LIBRARIES libarchive)
+ IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake)
+ FIND_PACKAGE(LibArchive)
+ ELSE()
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
+ INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
+ ENDIF()
+ IF(NOT LibArchive_FOUND)
+ MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
+ ENDIF()
+ SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
SET(HAVE_LIBZ 1)
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 +348,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
@@ -337,20 +370,38 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
#-----------------------------------------------------------------------
# The CMake version number.
SET(CMake_VERSION_MAJOR 2)
-SET(CMake_VERSION_MINOR 9)
-SET(CMake_VERSION_PATCH 0)
-
-# We use odd minor numbers for development versions.
-# Use a date for the development patch level.
-IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
+SET(CMake_VERSION_MINOR 8)
+SET(CMake_VERSION_PATCH 2)
+#SET(CMake_VERSION_TWEAK 0)
+#SET(CMake_VERSION_RC 1)
+
+# Releases define a tweak level.
+IF(DEFINED CMake_VERSION_TWEAK)
+ SET(CMake_VERSION_IS_RELEASE 1)
+ SET(CMake_VERSION_SOURCE "")
+ELSE()
+ SET(CMake_VERSION_IS_RELEASE 0)
+
+ # Use the date as the tweak level.
INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake)
- SET(CMake_VERSION_PATCH
+ SET(CMake_VERSION_TWEAK
"${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
)
-ENDIF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
-SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
+ INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
+ENDIF()
+
+# Compute the full version string.
+SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
+IF(${CMake_VERSION_TWEAK} GREATER 0)
+ SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
+ENDIF()
+IF(CMake_VERSION_RC)
+ SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
+ENDIF()
+IF(CMake_VERSION_SOURCE)
+ SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
+ENDIF()
# Include the standard Dart testing module
ENABLE_TESTING()
@@ -370,13 +421,24 @@ SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
# install tree.
SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
-SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
+SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for data (relative to prefix).")
-SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
+SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for documentation (relative to prefix).")
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/CTestConfig.cmake b/CTestConfig.cmake
index 0add34b..3903222 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -10,7 +10,7 @@
# See the License for more information.
#=============================================================================
set(CTEST_PROJECT_NAME "CMake")
-set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index f69c532..d5789ed 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -24,11 +24,22 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"is not used for resolving any symbol"
"Clock skew detected"
"remark\\(1209"
+ "LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
+ "LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
+ "Warning: library was too large for page size.*"
+ "Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
+ "Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"
+ "Warning: public.*_archive.*clashes with prior module.*"
+ "Warning: LINN32: Last line.*is less.*"
+ "warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051"
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value"
"Parser.cxx.*warning.*2111-D.*statement is unreachable"
+ "warning:.*is.*very unsafe.*consider using.*"
+ "warning:.*is.*misused, please use.*"
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
+ "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
)
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
diff --git a/ChangeLog.manual b/ChangeLog.manual
new file mode 100644
index 0000000..7b0a901
--- /dev/null
+++ b/ChangeLog.manual
@@ -0,0 +1,480 @@
+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)
+- CPack: Add native BZip2 support
+- CPack: Set compression type in RPM spec (#10363)
+- CPack: Try harder to initialize staging directory (#10793)
+- CTest: Add --stop-time argument
+- CTest: Cost data with '-j'
+- CTest: Fix memory report
+- CTest: Glob for uncovered files during coverage tests
+- CTest: Option to specify cdash server
+- CTest: PHP Coverage support
+- CTest: Process tree kill for OpenBSD, FreeBSD, kFreeBSD, GNU/Hurd
+- 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"
+- Documentation: Fix typo in CMAKE_LIBRARY_PATH (#10291)
+- Documentation: Fix typo in HAS_CXX docs (#10578)
+- Documentation: More consistent command signatures
+- Eclipse: Do not add INCLUDE to environment twice
+- Enable extra CodeBlocks generator on Cygwin
+- ExternalProject: Support .zip and .bz2 archives, MD5 verification
+- ExternalProject: Reconfigure when args change (#10258)
+- ExternalProject: Support Git, SVN username/password
+- FindCurses: Fix for cygwin ncurses package
+- FindHSPELL: Version support
+- FindJava: Error if version is not found only when REQUIRED
+- FindJava: Support runtime and development components (#9840)
+- FindKDE4: Prefer kdeconfig results over system paths
+- FindMPEG: Check for 'vo' library
+- FindPNG: Support png 1.4 versioned lib names (#10551)
+- FindPkgConfig: Add QUIET keyword to pkgconfig macros (see #10469)
+- FindZLIB: GnuWin32 support, version support (#5588)
+- FindwxWidget: Fix CXX flag parsing (#10209)
+- Fix .pdb name attribute in VS project files (#10614)
+- Fix CodeBlocks to work with Fortran-only
+- Fix VS 2010 custom commands (#10503)
+- Fix VS 6 support for COMPILE_DEFINITIONS_MINSIZEREL (#10700)
+- Fix cross-compiling from Linux to iPhone (#10526)
+- Fix documentation typos
+- Fix g95 Fortran compiler support
+- Fix uname masking in file(WRITE) and write_file (#10789)
+- GetPrerequisites: Provide an override hook
+- Handle non-ASCII terminators in file(STRINGS)
+- Module fixes: FindPythonLibs, FindQt4, FindX11, FindwxWidgets
+- PathScale Fortran compiler tool detection
+- Qt4 OpenGL framework fix
+- Qt4ConfigDependentSettings.cmake Qt4Macros.cmake UseQt4.cmake
+- Recognize ARM ABI/EABI with GNU compilers
+- Recognize Clang compiler
+- Search basic directories on "Generic" platform
+- Set MSVC* variables consistently on all generators, and test
+- Support SunPro C++ 5.11 on Linux (new compiler)
+- Support VS 10 Express (related to #10670)
+- Support compression with 'cmake -E tar'
+- Support multiple arguments in CC,CXX,FC environment variables
+- Support per-configuration librarian flags (#10768)
+- Support per-platform initial ASM language flags (#10577)
+- Use Fortran ABI detection results conservatively
+- Use libarchive to replace the unmaintained libtar
+- UseQt4: Support QtMultimedia (#10675)
+- bootstrap: Fix make tool detection (#10544)
+- cmake-gui: Add simple grouped view
+- cmake-gui: Support build tree under symlink (#9975)
+- Cleanup modules FindASPELL, FindAVIFile, FindBZip2, FindDart,
+ FindEXPAT, FindGCCXML, FindGLU, FindHSPELL, FindJasper, FindLibXml2,
+ FindLibXslt, FindMPEG, FindOpenAL, FindPhysFS, FindQuickTime,
+ FindSubversion, FindZLIB.
+
+Changes in CMake 2.8.1
+- Fix failing test on cygwin
+- Add a new serach path for MPICH2
+
+Changes in CMake 2.8.1 RC 5
+- Fix FindQt4 to work with OpenGL on the mac
+- Add .git .bzr and .hg to the list of default CPack ignore directories.
+
+Changes in CMake 2.8.1 RC 4
+- CTest: Do not hide test GUI windows (fixes 2.8.0 regression)
+- Documentation: Clarify CMAKE_MODULE_PATH variable
+- FindQt4: Add support for QtDeclartive module
+- FortranCInterface: Fix PathScale detection
+- Suppress GNU flag -fPIC on Windows (fixes 2.8.1-rc1 regression)
+
+Changes in CMake 2.8.1 RC 3
+- Add CMAKE_XCODE_ATTRIBUTE_<attr> interface to set compiler (#9125)
+- Fix Eclipse files for targets in subdirectories (#9978)
+- Fix custom command rule hashes to avoid extra rebuilds
+- Print non-make generator name in initial compiler test
+
+Changes in CMake 2.8.1 RC 2
+- CPack: Avoid deleting long PATH values with NSIS (#10257)
+- CTest: Fix and test cost-based test scheduler
+- CTest: Fix and test git updates for case of out-dated index
+- CTest: Fix regression caused by fix for (#2336) in rc1
+- CTest: Setup command-line dashboard support with Git
+- FindCUDA: Improve docs, use -rpath on Apple, fix dependency scanning
+- Fix OS X deployment-target and sysroot defaults (#9959,#9898,#10155)
+- Recognize the Compaq Fortran compiler
+
+Changes in CMake 2.8.1 RC 1
+- Add "NMake Makefiles JOM" generator
+- Add PathScale compiler support
+- Add per-configuration OUTPUT_DIRECTORY properties
+- Add per-target OSX_ARCHITECTURES property
+- check_type_size(): Handle mixed-size universal binaries
+- CPack: Document Mac generators
+- CPack: Improve RPM spec files
+- Create CMAKE_FORCE_Fortran_COMPILER for cross-compiling
+- CTest: Add --http1.0 command-line option
+- CTest: Add --timeout command-line option
+- CTest: Do not munge UTF-8 output in XML files
+- CTest: Document CTEST_USE_LAUNCHERS option
+- CTest: Fix killing of whole test process trees
+- CTest: Handle failure of running invalid executables
+- CTest: Honor the -C arg to ctest (#2336)
+- CTest: Improve host system introspection
+- CTest: Optionally randomize test order (--schedule-random)
+- CTest: Skip tests with unsatisfied REQUIRED_FILES test property
+- CTest: Submit arbitrary results with ATTACHED_FILES test property
+- ctest_build(): Enhance signature
+- ctest_start(): Add APPEND option
+- ctest_start(): Move CTEST_CHECKOUT_COMMAND from ctest_update
+- ctest_update(): Submit global tree revision in Update.xml
+- Cygwin: Do not export all symbols from DLLs (#10122)
+- Cygwin: Name DLLs with SOVERSION, not VERSION (#10122)
+- Detect 32/64-bit Windows with Intel compiler
+- Eclipse generator enhancements
+- ExternalProject: Add TIMEOUT parameter
+- FindCUDA: Respect CUDA version differences
+- FindCURL: Find import libraries on Windows
+- FindDCMTK: Look in more places
+- FindGTest: Handle spaces better (#10065)
+- FindGTK2: Look in fink locations on Mac OS X
+- FindHDF5: Follow find-module API conventions
+- FindJava: Support for versioned find
+- FindJNI: Honor find_package() REQUIRED and QUIET options
+- FindMPI: Improve Windows support
+- FindOpenSSL: Fix MinGW support
+- FindPythonLibs: Look in config for static library
+- FindQt4: Misc enhancements, sync with KDE vesion
+- FindRuby: Fix version convention on Windows
+- FindX11: Improve documentation
+- Fortran: Detect address size (#10119)
+- FortranCInterface: Honor user flags
+- Improve VS 2010 beta2 support
+- link_directories(): Treat relative paths consistently (CMP0015)
+- Modernize FindLibXslt and FindLibXml.cmake
+- Refactor platform info to simplify adding new compilers
+- Support cross-compiling versioned DLLs
+- UseQt4: Provide dependencies only for static Qt (#10021)
+- Address issues:
+ #2336, #3571, #5041, #7541, #8725, #9011, #9042, #9054, #9163,
+ #9171, #9450, #9697, #9764, #9782, #9792, #9862, #9894, #9913,
+ #9916, #9917, #9918, #9949, #9965, #9970, #9982, #9985, #10003,
+ #10014, #10021, #10032, #10055, #10060, #10065, #10114, #10119,
+ #10122, #10126, #10136.
+
+Changes in CMake 2.8.0 Release
+- CPack: Honor CPACK_NSIS_DISPLAY_NAME (fixes regression)
+
+Changes in CMake 2.8.0 RC 7
+- Partially sync FindQt4 with KDE version
+- Improve implementation of fix for #9090
+- Fix CTest infinite loop when test executable could not be found
+- Fix #9833: Document ctest --help-command
+- FindCUDA: Fix -fPIC from being used on executable object files
+- Fix #9654: %files section in spec file should not list directories
+- Fix #9851: Better STRING(RANDOM) seeding
+- Fix double bootstrap build for in source builds
+- Fix CTest to use allowed value for valgrind --num-callers
+- Remove non-language implicit link dependencies
+- Implement LINK_FLAGS_<CONFIG> property on Xcode
+
+Changes in CMake 2.8.0 RC 6
+- Partially sync FindQt4 with KDE version
+- Fix #9090: Teach CTest subdirs() command to handle absolute paths
+- Fix CTest bug that could start a test twice
+
+Changes in CMake 2.8.0 RC 5
+- CTest now detects cycles in test dependency graph
+- Warn on set(PARENT_SCOPE) at top scope
+- Fix Xcode <= 2.0 projects with CMAKE_BUILD_TYPE
+- Fix flags for Intel Fortran on Windows
+- Fix #2199: UseSWIG documentation for swig_generated_file_fullname
+- Fix #7915: UseSWIG interaction with JNI
+- Fix #8971: FindOpenSSL now works on windows
+- Fix #9124: CPackDeb documentation
+- Fix #9722: cmake-gui reports error when not able to create build directory
+- Fix #9767: Match more valgrind-reported leaks in CTest memcheck
+- Fix #9777: Sync CMakeDetermineJavaCompiler paths with FindJava
+- Fix #9793: FindJNI should find matching jni.h and jni_md.h
+- Fix #9817: FindJNI on Solaris
+- Fix FindHDF5 when hdf5.h exists without H5pubconf.h
+- Fix FindZLIB to follow variable name conventions
+- Fix invalid use of auto_ptr on array
+- Mention temp var convention in Modules/readme.txt documentation
+
+Changes in CMake 2.8.0 RC 4
+- Fix try_compile when file cannot be found
+- Add new module to test manifest installation issues on windows.
+- Add more test coverage
+-Improvements in finding MPI on windows. ENH: reorganized searching mpi for mpi components (include,lib,bin) using a single set of search paths instead of seperately mainted lists of paths for each.
+- Look for nvcc in the 32 bit bin directory before the 64 bin directory.
+- BUG: hardcore some values so output matches cmVS10CLFlagTable.h (addresses bug #9753)
+- Avoid Intel linker crash in BuildDepends test
+- Fix Intel Fortran SHARED libraries on Linux
+- Fix working dir issue for ctest
+- Fix if() command and CMP0012 OLD/NEW behavior
+- Allow for /D to change install directory on the command line for NSIS
+- Move SetErrorMode around calls to generate and configure instead of setting it for the whole application for cmake-gui on windows. Allows for bad installs of windows shell programs to not break file completion.
+- Fix Intel and MinGW Fortran DLL import libraries
+- Fix Xcode dylib version default
+- Fix the showing of non-cpp files in the IDE for VS 10
+- Fix optionally-valued booleans in VS 10 flag table
+- Detect and set Unicode character set in VS 10
+- Add support for the g95 Fortran compiler
+- Test all target types in Fortran
+- Add Xcode file association for Fortran
+- Fix VS 10 flag table for precompiled headers
+- Fix VS 10 .sln files for Windows Explorer
+- Fix Microsoft.Cpp.$(Platform).user.props in VS10b2
+- Fix up file(DOWNLOAD ) a bit, better error checking and uses of long not double for timeout as curl needs, bug# 9748
+- Add a VS 10 Win64 generator
+- Fix for bug#9686 convert java_home to a cmake path before using.
+- fix for bug# 9751, add check for MSVC10
+- Fix for bugs #9756, #9690 and #9755, header files were not included, and link_directories we incorrect
+- Add a module to test an install tree to verify that the MS CRT version is correct.
+- Fix seg fault for empty ENV{} call bug #9747
+- Better fix for finding the MSBuild that matches the VS 10 install.
+- make testing the CodeBlocks and Eclipse generators easier by not requiring the CMAKE_EDIT_COMMAND variable
+- Do not link library dependencies in VS solutions
+- Ctest was broken for subdirs. Restored working directory state for tests so that their executables could be found.
+- Fixes version detection using osg/Version on Mac OSX when OSG is installed as a framework
+- Avoid C++ linker language in VS Fortran project
+- Avoid duplicate ZERO_CHECK in VS solutions
+- Fixed bug 8319, search for the Python shared library in the standard locations.
+- Fix bug#9714, should not crash when version file is not where it should be...
+- Fix ctest output alignment for cases where total tests run is not the same width as max test index.
+- make it more robust wrt. #9621
+- Add another possible error message that curl might emit with an empty drop location.
+- Fix issue #5668 - use CollapseFullPath when determining if covered file is within source or binary tree. Allows gcc/gcov coverage analysis using MinGW on Windows.
+- CTest-side support for compiler name and compiler version information. Requires CDash update to show on CDash.
+- Add a bunch more testing coverage.
+
+Changes in CMake 2.8.0 RC 3
+- CTest Added OS Platform (cpu architecture) detection support to windows system
+- Several minor FindBoost changes to address posts on mailing list
+- Resolve #9685: Fix include dir to be correct path for gnutils
+- Fix color check for dependency scanning
+- Remove CMP00015 for now as it breaks more things than it fixes
+- Reduce duration of ctest_sleep arguments. Add SmallAndFast project. Replace kwsys with SmallAndFast to make CTestTest faster. (I will keep an eye on coverage results after this commit and make sure we still have equivalent ctest coverage.)
+- Do not use -fPIC to link executables
+- Split Borland compiler information files
+- Trimmed off the newline from sw_vers output on mac, it could cause xml parsing errors if left in
+- Check for openssl-linked option with Qt 4.4+ before making ssl a dependency.
+- Make Complex test of CMakeLib more optional
+- Modernize FindVTK module
+- Fix find_package() when <pkg>_DIR is wrong
+- Do not collapse path of NOTFOUND values
+- More robust implicit link line detection regex
+- fix Xcode 30 generator
+- Use the correct CMake (the freshly built one) to drive the CMakeWizardTest.
+- Support more special characters in file(STRINGS)
+- Log implicit link line detection regex
+- speedup C dependency scanning even more
+- Avoid non-root copies of root-only targets
+- Added better OS information for Mac OS X
+- Use work-around from bug 4772 for C++ and Fortran
+- FortranCInterface: Mangling for Intel on Windows
+- cmake-gui don't allow consecutive generates without a configure.
+- Fix Preprocess test for Intel on Windows
+- Teach intel compiler on windows to place .lib files and .pdb files.
+- CPack: Fix bash-isms in launch script
+- BUG: #0009648 Change "The following tests FAILED" message to print on stdout rather than stderr
+- Avoid (Unix|Windows)Paths.cmake multiple include
+- When getting include dirs for moc, also watch for framework includes and use -F instead of -I.
+- Find locally installed software first
+- Add '#!/bin/sh' to cygwin-package.sh
+- Fix permsissions of installed SquishRunTestCase.sh
+- Fix module docs to be manpage (groff) friendly
+- Support GNU/kFreeBSD
+- Remove old Encoding field from CMake.desktop
+- FindQt3: Prefer (moc|uic)-qt3 names over (moc|uic)
+- Match width of ctest "Start xx: " line to line up with the end test line
+- Remove old license from FindPkgConfig.cmake module
+- Test target link information invalidation
+- Invalidate target link info when necessary
+- Use new style header generation and get rid of OBJECT_DEPENDS in tutorial
+- Fix issue #8649 - move the location of CPACK_NSIS_EXTRA_INSTALL_COMMANDS so that it is not excluded from execution when 'Do not create shortcuts' is checked.
+- add the additional features for the dbus macros from KDE's FindQt4.cmake
+fc9f7a5 Fix warnings in CMake source code.
+- Correct some typos in error messages in the string command. Add a test that covers more of the code implemented in cmStringCommand.cxx, especially the error handlers.
+- Create INTERPROCEDURAL_OPTIMIZATION build feature
+- Document CMAKE_CURRENT_LIST_FILE more precisely
+- Fix the documentation to say what it really does. Bug #9638
+- document how the minimum version can be specified
+- Fix warnings in CMake source code. Suppress rampant warnings emanating from Qt files.
+- Add documentation for Cocoa flag and move Motif under X11 flag.
+
+Changes in CMake 2.8.0 RC 2
+- Fix FindQt4 so that QtHelp depends on QtNetwork
+- Add missing copyright notice to CMake.cmake module
+- Add alternative _UTILITY targets to all VS solutions
+- FindGTest.cmake some bugfixes, also added public function for closer integration btwn GoogleTest & CTest, contributed by Dan Blezek.
+- Eliminate ExternalProject's use of CMAKE_CFG_INTDIR subdir for Makefile generators. It was causing problems with parallel make -j invocations. Keep it for multi-configuration build systems so that Debug and Release stamp files remain separate.
+- Fix for bug #9611, some more paths for OpenJDK.
+- Fix get_filename_component() registry view with wow64
+- Fix warnings in CMake source code.
+- Fix module definition file reference for VS6 NMake
+- Fix for bug #9611 do not hard code archs for search paths of java, look at the machine type.
+- Fix bug#9619 add a link to module maintainers page in readme.txt for Modules
+- Add cmake-help-command function to emacs-mode
+- Add initial XL C compiler flags for safer builds
+- Split XL compiler information files
+- Fix default install prefix on Haiku
+- Fix use of module .def files for MS tools
+- Add StringProperty options includeing /def: for VS 10 flag table
+- Convert copyright to OSI BSD and clean up licenses
+- ENH: Added ctest test coverage for a test timeout
+- CTest honors test timeouts again.
+- Remove ctest_submit from CTestTestParallel
+- Fix shared library creation flag for XL on Linux
+- Fix BUG: 0009612: --output-on-failure option doesn't work with
+ the new parallel CTest handler
+- Removed support for cutil library and header file.
+- Fixed CUDA_PROPAGATE_HOST_FLAGS, added path for Mac SDK.
+- Make sure LINK_FLAGS are seen by generator, fix for part of bug#9613
+- Fix issue #9412 - remove RPATH from files copied by
+ BundleUtilities.cmake on Linux. Thank
+- Fix support for OLD behavior of policy CMP0002
+- Fix issue #8818 - escape quotes in the license file when using the
+ DragNDrop cpack genera
+- Fix .vfproj file version for Intel Fortran 10.1
+- Use BeAPI for per-user package registry on Haiku
+- Correct comments and use ASM${ASM_DIALECT} env. var instead of ASM
+ env. var to initialize
+- Fix bug #9529.
+- Fix Windows GUI implib and image version in VS 6
+- Convert newlines from CRLF to LF
+- Oops. Last commit did not create subdir before doing a touch on a
+ file in it. So it fails of a type that is expected to have a
+ location...
+- Policies 14 and 15 will be first released in 2.8.0
+- Document full version number with policy default
+- Simplify bootstrap script source dir detection
+- Documentation fixes, new CUDA_PROPAGATE_HOST_FLAGS, changed output
+ directory.
+
+Changes in CMake 2.8.0 RC 1
+
+- Qt based GUI cmake-gui is now the default GUI, MFC CMakeSetup is no
+ longer included in CMake. ccmake is still supported.
+- cmake-gui supports multi-state values options.
+- CMake now has cmake --build command that can build any CMake generated
+ project from the command line.
+- Visual Studio 2010 beta support has been added.
+- KDevelop generator now has color output for builds.
+- CTest supports running tests in parallel with a -j N option.
+- A new CTest CTEST_USE_LAUNCHERS option can be used to get better
+ dashboard error reports with make based tools.
+- CTest has support for sub-projects and labels which can interact
+ with CDash.
+- CTest now supports Git, Mercurial, and Bazaar.
+- It is now possible to use DESTDIR in CPack for any CMake based projects
+ giving more flexibility on the final path names.
+- The CPack Deb generator now computes the arch instead of hard coding it.
+- Fortran/C mixed language projects made much easier. CMake now
+ automatically can compute the run time libraries for a compiler. In
+ addition, a new FortranCInterface module can determine the correct
+ name mangling needed to mix C and Fortran.
+- Intel compiler support added to OSX, and support for embedded
+ manifests in the windows intel compiler was added.
+- Depend scanning is now much faster with makefiles.
+- Many FindQt4 improvements to stay working with current Qt releases
+- FindMPI has improvements for windows.
+- FindBoost has been updated to work with the most recent boost releases.
+- New External Project Module. The 'ExternalProject_Add' function
+ creates a custom target to drive download, update/patch, configure,
+ build, install and test steps of an external project.
+- xmlrpc dependancy has been removed
+- CMAKE_OSX_DEPLOYMENT_TARGET cache variable has been created to set the
+ deployment OS for a build on OSX.
+- Several new policies were added:
+ CMP0012
+ The if() command can recognize named boolean constants.
+ CMP0013
+ Duplicate binary directories are not allowed.
+ CMP0014
+ Input directories must have CMakeLists.txt.
+ CMP0015
+ The set() CACHE mode and option() command make the cache value
+ visible.
+- Lots of bug fixes.
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index d9c41f4..4d3baf8 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -13,6 +13,7 @@
# set_bundle_key_values
# get_bundle_keys
# copy_resolved_item_into_bundle
+# copy_resolved_framework_into_bundle
# fixup_bundle_item
# fixup_bundle
# copy_and_fixup_bundle
@@ -433,6 +434,59 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
endfunction(copy_resolved_item_into_bundle)
+# copy_resolved_framework_into_bundle
+#
+# Copy a resolved framework into the bundle if necessary. Copy is not necessary
+# if the resolved_item is "the same as" the resolved_embedded_item.
+#
+# By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full
+# frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to
+# ON before calling fixup_bundle. By default,
+# copy_resolved_framework_into_bundle copies the framework dylib itself plus
+# any framework Resources.
+#
+function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
+ if(WIN32)
+ # ignore case on Windows
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
+ else()
+ set(resolved_item_compare "${resolved_item}")
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
+ endif()
+
+ if("${resolved_item_compare}" STREQUAL "${resolved_embedded_item_compare}")
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
+ else()
+ if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
+ # Full Framework (everything):
+ get_filename_component(resolved_dir "${resolved_item}" PATH)
+ get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
+ else()
+ # Framework lib itself:
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
+
+ # Plus Resources, if they exist:
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
+ if(EXISTS "${resolved_resources}")
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
+ endif()
+ endif()
+ endif()
+
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
+endfunction(copy_resolved_framework_into_bundle)
+
+
# fixup_bundle_item
#
# Get the direct/non-system prerequisites of the resolved embedded item. For each
@@ -528,8 +582,14 @@ function(fixup_bundle app libs dirs)
endif(show_status)
if(${${key}_COPYFLAG})
- copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
- "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ set(item "${${key}_ITEM}")
+ if(item MATCHES "[^/]+\\.framework/")
+ copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ else()
+ copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
+ endif()
endif(${${key}_COPYFLAG})
endforeach(key)
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index c495810..0fad25d 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -42,10 +42,45 @@ IF(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
+# Set default assembler file extensions:
IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
+
+# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
+SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
+# avoid just having a space as the initial value for the cache
+IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+ SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
+ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
+SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
+ "Flags used by the assembler during all build types.")
+
+IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+# default build type is none
+ IF(NOT CMAKE_NO_BUILD_TYPE)
+ SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
+ "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
+ ENDIF(NOT CMAKE_NO_BUILD_TYPE)
+ SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
+ "Flags used by the assembler during debug builds.")
+ SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
+ "Flags used by the assembler during release minsize builds.")
+ SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
+ "Flags used by the assembler during release builds.")
+ SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
+ "Flags used by the assembler during Release with Debug Info builds.")
+ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
+
+MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
+ CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
+ CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
+ CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
+ CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO
+ )
+
+
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 5d004c7..accda32 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -9,6 +9,9 @@
#if defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 00ab8e2..4a32823 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -11,6 +11,9 @@
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
+#elif defined(__clang__)
+# define COMPILER_ID "Clang"
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 8980abb..26ae4db 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -17,6 +17,16 @@ const char info_sizeof_dptr[] = {
# define ABI_ID "ELF N32"
#elif defined(__sgi) && defined(_ABI64)
# define ABI_ID "ELF 64"
+
+/* Check for (some) ARM ABIs.
+ * See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
+# define ABI_ID "ELF ARMEABI"
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
+# define ABI_ID "ELF ARM"
+#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
+# define ABI_ID "ELF ARM"
+
#elif defined(__ELF__)
# define ABI_ID "ELF"
#endif
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index c8f4c99..aa4733b 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -49,12 +49,10 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
IF(ABI_SIZEOF_DPTR)
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
- SET(CMAKE_SIZEOF_VOID_P "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
ENDIF(ABI_SIZEOF_DPTR)
IF(ABI_NAME)
SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
- SET(CMAKE_INTERNAL_PLATFORM_ABI "${ABI_NAME}" PARENT_SCOPE)
ENDIF(ABI_NAME)
# Parse implicit linker information for this language, if available.
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index bddd6a1..4a800a8 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -19,6 +19,7 @@
FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure the compiler arguments are clean.
STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
+ STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
# Make sure user-specified compiler flags are used.
IF(CMAKE_${lang}_FLAGS)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 0637d20..34477a1 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -49,6 +49,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
# gfortran: putative GNU Fortran 95+ compiler (in progress)
# fort77: native F77 compiler under HP-UX (and some older Crays)
# frt: Fujitsu F77 compiler
+ # pathf90/pathf95/pathf2003: PathScale Fortran compiler
# pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
# lf95: Lahey-Fujitsu F95 compiler
@@ -63,14 +64,16 @@ IF(NOT CMAKE_Fortran_COMPILER)
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
SET(CMAKE_Fortran_COMPILER_LIST
- ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran gfortran-4 g95 f90
- pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77
+ ifort ifc efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort
+ gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
+ frt pgf77 xlf fl32 af77 g77 f77
)
# Vendor-specific compiler names.
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77)
+ SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
SET(_Fortran_COMPILER_NAMES_XL xlf)
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index ba2b46d..5558651 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -34,9 +34,9 @@ ENDIF(UNIX)
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
-IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
+IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
-ENDIF(CMAKE_Fortran_SIZEOF_DATA_PTR)
+ENDIF()
IF(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 1d3d805..3f33ce8 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -27,7 +27,7 @@ MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
-MESSAGE("CMAKE_COMPILER_IS_GNUGCC = ${CMAKE_COMPILER_IS_GNUGCC}")
+MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index eeaff7d..bac9932 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -74,6 +74,7 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
+ INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
ENDIF(CMAKE_C_COMPILER_FORCED)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 72bb8f2..06ef301 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -67,5 +67,6 @@ ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
+ INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
ENDIF(CMAKE_CXX_COMPILER_FORCED)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index 6f419c2..61d6336 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -90,5 +90,6 @@ ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
+ INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
ENDIF(CMAKE_Fortran_COMPILER_FORCED)
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
index 8233e52..460de25 100644
--- a/Modules/CMakeVS10FindMake.cmake
+++ b/Modules/CMakeVS10FindMake.cmake
@@ -12,38 +12,14 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-# VCExpress does not support cross compiling, which is necessary for Win CE
-SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
-IF(NOT CMAKE_CROSSCOMPILING)
- SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
-ENDIF(NOT CMAKE_CROSSCOMPILING)
-
+# We use MSBuild as the build tool for VS 10
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
NAMES MSBuild
- HINTS
+ HINTS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
- )
-
-FIND_PROGRAM(CMAKE_MAKE_PROGRAM
- NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
- HINTS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path]
- "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE"
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE"
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE"
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE"
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE"
- "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/"
- "/Program Files/Microsoft Visual Studio 10/Common7/IDE/"
- PATHS
- "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE"
- "$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE"
-
+ "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
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/CPackDeb.cmake b/Modules/CPackDeb.cmake
index f5ca592..18acfb7 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -1,15 +1,18 @@
# - The builtin (binary) CPack Deb generator (Unix only)
# CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
-# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
+# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
+# CPackDeb generator should work on any linux host but it will
+# produce better deb package when Debian specific tools 'dpkg-xxx'
+# are usable on the build system.
#
-# However CPackRPM has specific features which are controlled by
-# the specifics CPACK_RPM_XXX variables.You'll find a detailed usage on
-# the wiki:
+# CPackDeb has specific features which are controlled by
+# the specifics CPACK_DEBIAN_XXX variables.You'll find a detailed usage on
+# the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
# However as a handy reminder here comes the list of specific variables:
#
-# CPACK_DEBIAN_PACKAGE_NAME
+# CPACK_DEBIAN_PACKAGE_NAME
# Mandatory : YES
# Default : CPACK_PACKAGE_NAME (lower case)
# The debian package summary
@@ -19,12 +22,12 @@
# The debian package version
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# Mandatory : YES
-# Default : Output of dpkg --print-architecture or i386
+# Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
# The debian package architecture
# CPACK_DEBIAN_PACKAGE_DEPENDS
# Mandatory : NO
# Default : -
-# May be used to set deb dependencies.
+# May be used to set deb dependencies.
# CPACK_DEBIAN_PACKAGE_MAINTAINER
# Mandatory : YES
# Default : CPACK_PACKAGE_CONTACT
@@ -41,6 +44,25 @@
# Mandatory : YES
# Default : 'optional'
# The debian package priority
+# CPACK_DEBIAN_PACKAGE_HOMEPAGE
+# Mandatory : NO
+# Default : -
+# The URL of the web site for this package
+# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
+# Mandatory : NO
+# Default : OFF
+# May be set to ON in order to use dpkg-shlibdeps to generate
+# better package dependency list.
+# You may need set CMAKE_INSTALL_RPATH toi appropriate value
+# if you use this feature, because if you don't dpkg-shlibdeps
+# may fail to find your own shared libs.
+# See http://www.cmake.org/Wiki/CMake_RPATH_handling.
+# CPACK_DEBIAN_PACKAGE_DEBUG
+# Mandatory : NO
+# Default : -
+# May be set when invoking cpack in order to trace debug informations
+# during CPackDeb run.
+
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -69,6 +91,103 @@ IF(NOT UNIX)
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
ENDIF(NOT UNIX)
+# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
+# If specify OFF, only user depends are used
+IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
+ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+
+IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ # dpkg-shlibdeps is a Debian utility for generating dependency list
+ FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
+
+ # Check version of the dpkg-shlibdeps tool using CPackRPM method
+ IF(SHLIBDEPS_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
+ OUTPUT_VARIABLE _TMP_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ STRING(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
+ SHLIBDEPS_EXECUTABLE_VERSION
+ ${_TMP_VERSION})
+ SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+
+ # Generating binary list - Get type of all install files
+ EXECUTE_PROCESS(COMMAND find -type f
+ COMMAND xargs file
+ WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
+
+ # Convert to CMake list
+ STRING(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
+
+ # Only dynamically linked ELF files are included
+ # Extract only file name infront of ":"
+ FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES})
+ IF ( ${_FILE} MATCHES "ELF.*dynamically linked")
+ STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
+ LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
+ ENDIF()
+ ENDFOREACH()
+
+ MESSAGE( "CPackDeb: - Generating dependency list")
+
+ # Create blank control file for running dpkg-shlibdeps
+ # There might be some other way to invoke dpkg-shlibdeps without creating this file
+ # but standard debian package should not have anything that can collide with this file or directory
+ FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
+ FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
+
+ # Execute dpkg-shlibdeps
+ # --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
+ # -O : print to STDOUT
+ EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
+ WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
+ RESULT_VARIABLE SHLIBDEPS_RESULT
+ ERROR_VARIABLE SHLIBDEPS_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ # dpkg-shlibdeps will throw some warnings if some input files are not binary
+ MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ IF (NOT SHLIBDEPS_RESULT EQUAL 0)
+ MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
+ ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0)
+
+ #Get rid of prefix generated by dpkg-shlibdeps
+ string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
+
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+
+ # Remove blank control file
+ # Might not be safe if package actual contain file or directory named debian
+ FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
+
+ # Append user depend if set
+ IF (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+ ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS)
+ SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
+ ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS)
+
+ ELSE (SHLIBDEPS_EXECUTABLE)
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ ENDIF(SHLIBDEPS_EXECUTABLE)
+
+ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+ IF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ MESSAGE( "CPackDeb Debug: Using only user-provided depends")
+ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
+ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
+
# Let's define the control file found in debian package:
# Binary package:
@@ -84,7 +203,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
# Version: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
IF(NOT CPACK_PACKAGE_VERSION)
- MESSAGE(FATAL_ERROR "Debian package requires a package version")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version")
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
@@ -95,7 +214,7 @@ IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# $ dpkg --print-architecture
FIND_PROGRAM(DPKG_CMD dpkg)
IF(NOT DPKG_CMD)
- MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
+ MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
ENDIF(NOT DPKG_CMD)
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
@@ -116,7 +235,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
# Maintainer: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
IF(NOT CPACK_PACKAGE_CONTACT)
- MESSAGE(FATAL_ERROR "Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
ENDIF(NOT CPACK_PACKAGE_CONTACT)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
@@ -124,7 +243,7 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
# Description: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- MESSAGE(FATAL_ERROR "Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
@@ -147,13 +266,13 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# This variable allow advanced user to add custom script to the control.tar.gz (inside the .deb archive)
-# Typical examples are:
+# Typical examples are:
# - conffiles
# - postinst
# - postrm
# - prerm"
# Usage:
-# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 29a1218..f7687e4 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,29 +42,62 @@
# 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"
+# CPACK_RPM_COMPRESSION_TYPE
+# Mandatory : NO
+# Default : -
+# May be used to override RPM compression type to be used
+# to build the RPM. For example some Linux distribution now default
+# to lzma or xz compression whereas older cannot use such RPM.
+# Using this one can enforce compression type to be used.
+# Possible value are: lzma, xz, bzip2 and gzip.
# CPACK_RPM_PACKAGE_REQUIRES
# 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
@@ -73,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 information
+# 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
@@ -108,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.
@@ -133,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)
@@ -157,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.
@@ -174,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.
@@ -189,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)
@@ -205,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)
@@ -252,7 +296,7 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
# CPACK_RPM_PACKAGE_DESCRIPTION
# The variable content may be either
-# - explicitely given by tthe user or
+# - explicitly given by the user or
# - filled with the content of CPACK_PACKAGE_DESCRIPTION_FILE
# if it is defined
# - set to a default value
@@ -265,25 +309,54 @@ IF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
-# 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)
+# CPACK_RPM_COMPRESSION_TYPE
+#
+IF (CPACK_RPM_COMPRESSION_TYPE)
+ IF(CPACK_RPM_PACKAGE_DEBUG)
+ MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+ SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
+ ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
+ IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+ SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+ ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
+ IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+ SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
+ ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
+ IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+ SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
+ ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
+ELSE(CPACK_RPM_COMPRESSION_TYPE)
+ SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
+ENDIF(CPACK_RPM_COMPRESSION_TYPE)
+
+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
@@ -319,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)
@@ -338,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)
@@ -367,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}")
@@ -391,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
@@ -400,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\@
@@ -408,18 +495,21 @@ 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
%define _topdir \@CPACK_RPM_DIRECTORY\@
\@TMP_RPM_SPEC_INSTALL_POST\@
\@CPACK_RPM_SPEC_MORE_DEFINE\@
-
+\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
+
%description
\@CPACK_RPM_PACKAGE_DESCRIPTION\@
@@ -431,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
@@ -459,59 +549,39 @@ fi
${CPACK_RPM_INSTALL_FILES}
%changelog
-* 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/CTest.cmake b/Modules/CTest.cmake
index 2d0702e..bdaf911 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -163,6 +163,11 @@ IF(BUILD_TESTING)
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
+ SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
+ "How long to wait between timed-out CTest submissions.")
+ SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
+ "How many times to retry timed-out CTest submissions.")
+
FIND_PROGRAM(MEMORYCHECK_COMMAND
NAMES purify valgrind boundscheck
PATHS
@@ -262,7 +267,9 @@ IF(BUILD_TESTING)
SCPCOMMAND
SLURM_SBATCH_COMMAND
SLURM_SRUN_COMMAND
- SITE
+ SITE
+ CTEST_SUBMIT_RETRY_DELAY
+ CTEST_SUBMIT_RETRY_COUNT
)
# BUILDNAME
IF(NOT RUN_FROM_DART)
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
new file mode 100644
index 0000000..f7baf68
--- /dev/null
+++ b/Modules/Compiler/Clang-C.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-C)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
new file mode 100644
index 0000000..d3c403a
--- /dev/null
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-CXX)
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 4ac918e..656eea6 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -1,11 +1,11 @@
+SET(CMAKE_C_VERBOSE_FLAG "-#")
+
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h")
-SET(CMAKE_C_VERBOSE_FLAG "-#")
-
SET(CMAKE_C_FLAGS_INIT "")
SET(CMAKE_C_FLAGS_DEBUG_INIT "-g")
SET(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index fe549d6..3e07e8e 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -1,11 +1,11 @@
+SET(CMAKE_CXX_VERBOSE_FLAG "-v")
+
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-h")
-SET(CMAKE_CXX_VERBOSE_FLAG "-v")
-
SET(CMAKE_CXX_FLAGS_INIT "")
SET(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
SET(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index ae38f86..a41b454 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -1,3 +1,5 @@
+SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
+
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
@@ -12,4 +14,3 @@ SET(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
SET(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
SET(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
SET(CMAKE_Fortran_MODPATH_FLAG "-M")
-SET(CMAKE_Fortran_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index 6133f56..cf9b2b6 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -1,4 +1,5 @@
SET(CMAKE_Fortran_VERBOSE_FLAG "-V")
+
SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
SET(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 0b05865..caf0afe 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -46,6 +46,11 @@ CVSUpdateOptions: @CVS_UPDATE_OPTIONS@
SVNCommand: @SVNCOMMAND@
SVNUpdateOptions: @SVN_UPDATE_OPTIONS@
+# Git options
+GITCommand: @GITCOMMAND@
+GITUpdateOptions: @GIT_UPDATE_OPTIONS@
+GITUpdateCustom: @CTEST_GIT_UPDATE_CUSTOM@
+
# Generic update command
UpdateCommand: @UPDATE_COMMAND@
UpdateOptions: @UPDATE_OPTIONS@
@@ -79,3 +84,7 @@ CurlOptions: @CTEST_CURL_OPTIONS@
# warning, if you add new options here that have to do with submit,
# you have to update cmCTestSubmitCommand.cxx
+# For CTest submissions that timeout, these options
+# specify behavior for retrying the submission
+CTestSubmitRetryDelay: @CTEST_SUBMIT_RETRY_DELAY@
+CTestSubmitRetryCount: @CTEST_SUBMIT_RETRY_COUNT@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 0302d5c..b42e42b 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -16,7 +16,12 @@
# [CVS_TAG tag] # Tag to checkout from CVS repo
# [SVN_REPOSITORY url] # URL of Subversion repo
# [SVN_REVISION rev] # Revision to checkout from Subversion repo
+# [SVN_USERNAME john ] # Username for Subversion checkout and update
+# [SVN_PASSWORD doe ] # Password for Subversion checkout and update
+# [GIT_REPOSITORY url] # URL of git repo
+# [GIT_TAG tag] # Git branch name, commit id or tag
# [URL /.../src.tgz] # Full path or URL of source
+# [URL_MD5 md5] # MD5 checksum of file at URL
# [TIMEOUT seconds] # Time allowed for file download operations
# #--Update/Patch step----------
# [UPDATE_COMMAND cmd...] # Source work-tree update command
@@ -38,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.
@@ -81,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
@@ -111,19 +124,19 @@
# License text for the above reference.)
# Pre-compute a regex to match documented keywords for each command.
-file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT 100
- REGEX "^# ( \\[[A-Z_]+ [^]]*\\] +#.*$|[A-Za-z_]+\\()")
+file(STRINGS "${CMAKE_CURRENT_LIST_FILE}" lines LIMIT_COUNT 103
+ REGEX "^# ( \\[[A-Z0-9_]+ [^]]*\\] +#.*$|[A-Za-z0-9_]+\\()")
foreach(line IN LISTS lines)
- if("${line}" MATCHES "^# [A-Za-z_]+\\(")
+ if("${line}" MATCHES "^# [A-Za-z0-9_]+\\(")
if(_ep_func)
set(_ep_keywords_${_ep_func} "${_ep_keywords_${_ep_func}})$")
endif()
- string(REGEX REPLACE "^# ([A-Za-z_]+)\\(.*" "\\1" _ep_func "${line}")
+ string(REGEX REPLACE "^# ([A-Za-z0-9_]+)\\(.*" "\\1" _ep_func "${line}")
#message("function [${_ep_func}]")
set(_ep_keywords_${_ep_func} "^(")
set(_ep_keyword_sep)
else()
- string(REGEX REPLACE "^# \\[([A-Z_]+) .*" "\\1" _ep_key "${line}")
+ string(REGEX REPLACE "^# \\[([A-Z0-9_]+) .*" "\\1" _ep_key "${line}")
#message(" keyword [${_ep_key}]")
set(_ep_keywords_${_ep_func}
"${_ep_keywords_${_ep_func}}${_ep_keyword_sep}${_ep_key}")
@@ -141,25 +154,18 @@ function(_ep_parse_arguments f name ns args)
# correctly based on target properties.
#
# We loop through ARGN and consider the namespace starting with an
- # upper-case letter followed by at least two more upper-case letters
- # or underscores to be keywords.
+ # upper-case letter followed by at least two more upper-case letters,
+ # numbers or underscores to be keywords.
set(key)
foreach(arg IN LISTS args)
set(is_value 1)
- if(arg MATCHES "^[A-Z][A-Z_][A-Z_]+$" AND
+ if(arg MATCHES "^[A-Z][A-Z0-9_][A-Z0-9_]+$" AND
NOT ((arg STREQUAL "${key}") AND (key STREQUAL "COMMAND")) AND
NOT arg MATCHES "^(TRUE|FALSE)$")
if(_ep_keywords_${f} AND arg MATCHES "${_ep_keywords_${f}}")
set(is_value 0)
- else()
- if(NOT (key STREQUAL "COMMAND")
- AND NOT (key STREQUAL "CVS_MODULE")
- AND NOT (key STREQUAL "DEPENDS")
- )
- message(AUTHOR_WARNING "unknown ${f} keyword: ${arg}")
- endif()
endif()
endif()
@@ -203,7 +209,63 @@ define_property(DIRECTORY PROPERTY "EP_PREFIX" INHERITED
)
-function(_ep_write_downloadfile_script script_filename remote local timeout)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir)
+ file(WRITE ${script_filename}
+"if(\"${git_tag}\" STREQUAL \"\")
+ message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
+endif()
+
+execute_process(
+ COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
+endif()
+
+execute_process(
+ COMMAND \"${git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\"
+ WORKING_DIRECTORY \"${work_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to clone repository: '${git_repository}'\")
+endif()
+
+execute_process(
+ COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to checkout tag: '${git_tag}'\")
+endif()
+
+execute_process(
+ COMMAND \"${git_EXECUTABLE}\" submodule init
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to init submodules in: '${work_dir}/${src_name}'\")
+endif()
+
+execute_process(
+ COMMAND \"${git_EXECUTABLE}\" submodule update --recursive
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to update submodules in: '${work_dir}/${src_name}'\")
+endif()
+
+"
+)
+
+endfunction(_ep_write_gitclone_script)
+
+
+function(_ep_write_downloadfile_script script_filename remote local timeout md5)
if(timeout)
set(timeout_args TIMEOUT ${timeout})
set(timeout_msg "${timeout} seconds")
@@ -212,6 +274,12 @@ function(_ep_write_downloadfile_script script_filename remote local timeout)
set(timeout_msg "none")
endif()
+ if(md5)
+ set(md5_args EXPECTED_MD5 ${md5})
+ else()
+ set(md5_args "# no EXPECTED_MD5")
+ endif()
+
file(WRITE ${script_filename}
"message(STATUS \"downloading...
src='${remote}'
@@ -221,6 +289,8 @@ function(_ep_write_downloadfile_script script_filename remote local timeout)
file(DOWNLOAD
\"${remote}\"
\"${local}\"
+ SHOW_PROGRESS
+ ${md5_args}
${timeout_args}
STATUS status
LOG log)
@@ -243,23 +313,64 @@ message(STATUS \"downloading... done\")
endfunction(_ep_write_downloadfile_script)
-function(_ep_write_extractfile_script script_filename filename tmp directory)
- set(args "")
+function(_ep_write_verifyfile_script script_filename local md5)
+ file(WRITE ${script_filename}
+"message(STATUS \"verifying file...
+ file='${local}'\")
- if(filename MATCHES ".tar$")
- set(args xf)
+set(verified 0)
+
+# If an expected md5 checksum exists, compare against it:
+#
+if(NOT \"${md5}\" STREQUAL \"\")
+ execute_process(COMMAND \${CMAKE_COMMAND} -E md5sum \"${local}\"
+ OUTPUT_VARIABLE ov
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE rv)
+
+ if(NOT rv EQUAL 0)
+ message(FATAL_ERROR \"error: computing md5sum of '${local}' failed\")
endif()
- if(filename MATCHES ".tgz$")
- set(args xfz)
+ string(REGEX MATCH \"^([0-9A-Fa-f]+)\" md5_actual \"\${ov}\")
+
+ string(TOLOWER \"\${md5_actual}\" md5_actual)
+ string(TOLOWER \"${md5}\" md5)
+
+ if(NOT \"\${md5}\" STREQUAL \"\${md5_actual}\")
+ message(FATAL_ERROR \"error: md5sum of '${local}' does not match expected value
+ md5_expected: \${md5}
+ md5_actual: \${md5_actual}
+\")
endif()
- if(filename MATCHES ".tar.gz$")
+ set(verified 1)
+endif()
+
+if(verified)
+ message(STATUS \"verifying file... done\")
+else()
+ message(STATUS \"verifying file... warning: did not verify file - no URL_MD5 checksum argument? corrupt file?\")
+endif()
+"
+)
+
+endfunction(_ep_write_verifyfile_script)
+
+
+function(_ep_write_extractfile_script script_filename name filename directory)
+ set(args "")
+
+ if(filename MATCHES "(\\.bz2|\\.tar\\.gz|\\.tgz|\\.zip)$")
set(args xfz)
endif()
+ if(filename MATCHES "\\.tar$")
+ set(args xf)
+ endif()
+
if(args STREQUAL "")
- message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .tar, .tgz and .tar.gz")
+ message(SEND_ERROR "error: do not know how to extract '${filename}' -- known types are .bz2, .tar, .tar.gz, .tgz and .zip")
return()
endif()
@@ -267,20 +378,23 @@ function(_ep_write_extractfile_script script_filename filename tmp directory)
"# Make file names absolute:
#
get_filename_component(filename \"${filename}\" ABSOLUTE)
-get_filename_component(tmp \"${tmp}\" ABSOLUTE)
get_filename_component(directory \"${directory}\" ABSOLUTE)
message(STATUS \"extracting...
src='\${filename}'
dst='\${directory}'\")
+if(NOT EXISTS \"\${filename}\")
+ message(FATAL_ERROR \"error: file to extract does not exist: '\${filename}'\")
+endif()
+
# Prepare a space for extracting:
#
-set(i 1)
-while(EXISTS \"\${tmp}/extract\${i}\")
+set(i 1234)
+while(EXISTS \"\${directory}/../ex-${name}\${i}\")
math(EXPR i \"\${i} + 1\")
endwhile()
-set(ut_dir \"\${tmp}/extract\${i}\")
+set(ut_dir \"\${directory}/../ex-${name}\${i}\")
file(MAKE_DIRECTORY \"\${ut_dir}\")
# Extract it:
@@ -305,10 +419,12 @@ if(NOT n EQUAL 1 OR NOT IS_DIRECTORY \"\${contents}\")
set(contents \"\${ut_dir}\")
endif()
-# Copy \"the one\" directory to the final directory:
+# Move \"the one\" directory to the final directory:
#
-message(STATUS \"extracting... [copy]\")
-file(COPY \"\${contents}/\" DESTINATION \${directory})
+message(STATUS \"extracting... [rename]\")
+file(REMOVE_RECURSE \${directory})
+get_filename_component(contents \${contents} ABSOLUTE)
+file(RENAME \${contents} \${directory})
# Clean up:
#
@@ -439,8 +555,9 @@ function(_ep_get_build_command name step cmd_var)
if(cfg_cmd_id STREQUAL "cmake")
# CMake project. Select build command based on generator.
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
- if("${cmake_generator}" MATCHES "Make" AND
- "${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}")
+ if("${CMAKE_GENERATOR}" MATCHES "Make" AND
+ ("${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}" OR
+ NOT cmake_generator))
# The project uses the same Makefile generator. Use recursive make.
set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL")
@@ -469,7 +586,8 @@ function(_ep_get_build_command name step cmd_var)
endif()
else() # if(cfg_cmd_id STREQUAL "configure")
# Non-CMake project. Guess "make" and "make install" and "make test".
- set(cmd "make")
+ # But use "$(MAKE)" to get recursive parallel make.
+ set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL")
set(args install)
endif()
@@ -490,6 +608,101 @@ 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 "")
+ set(code_cygpath_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)")
+
+ if(WIN32 AND NOT CYGWIN)
+ set(code_cygpath_make "
+if(\${make} MATCHES \"^/\")
+ execute_process(
+ COMMAND cygpath -w \${make}
+ OUTPUT_VARIABLE cygpath_make
+ ERROR_VARIABLE cygpath_make
+ RESULT_VARIABLE cygpath_error
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT cygpath_error)
+ set(make \${cygpath_make})
+ endif()
+endif()
+")
+ endif()
+ 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 "
+${code_cygpath_make}
+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} "
+${code_cygpath_make}
+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
@@ -579,6 +792,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}
@@ -609,6 +828,29 @@ function(_ep_add_mkdir_command name)
endfunction(_ep_add_mkdir_command)
+function(_ep_get_git_version git_EXECUTABLE git_version_var)
+ if(git_EXECUTABLE)
+ execute_process(
+ COMMAND "${git_EXECUTABLE}" --version
+ OUTPUT_VARIABLE ov
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}")
+ set(${git_version_var} "${version}" PARENT_SCOPE)
+ endif()
+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)
@@ -616,6 +858,7 @@ function(_ep_add_download_command name)
get_property(cmd TARGET ${name} PROPERTY _EP_DOWNLOAD_COMMAND)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
+ get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
get_property(url TARGET ${name} PROPERTY _EP_URL)
# TODO: Perhaps file:// should be copied to download dir before extraction.
@@ -661,8 +904,10 @@ function(_ep_add_download_command name)
endif()
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
+ get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
+ get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
- set(repository ${svn_repository})
+ set(repository "${svn_repository} user=${svn_username} password=${svn_password}")
set(module)
set(tag ${svn_revision})
configure_file(
@@ -674,13 +919,55 @@ function(_ep_add_download_command name)
get_filename_component(src_name "${source_dir}" NAME)
get_filename_component(work_dir "${source_dir}" PATH)
set(comment "Performing download step (SVN checkout) for '${name}'")
- set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} ${src_name})
+ set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision}
+ --username=${svn_username} --password=${svn_password} ${src_name})
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
+ elseif(git_repository)
+ find_package(Git)
+ if(NOT GIT_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find git for clone of ${name}")
+ endif()
+
+ # The git submodule update '--recursive' flag requires git >= v1.6.5
+ #
+ _ep_get_git_version("${GIT_EXECUTABLE}" git_version)
+ if(git_version VERSION_LESS 1.6.5)
+ message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': git_version='${git_version}'")
+ endif()
+
+ get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
+ if(NOT git_tag)
+ set(git_tag "master")
+ endif()
+
+ set(repository ${git_repository})
+ set(module)
+ set(tag ${git_tag})
+ configure_file(
+ "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
+ "${stamp_dir}/${name}-gitinfo.txt"
+ @ONLY
+ )
+
+ get_filename_component(src_name "${source_dir}" NAME)
+ get_filename_component(work_dir "${source_dir}" PATH)
+
+ # Since git clone doesn't succeed if the non-empty source_dir exists,
+ # create a cmake script to invoke as download command.
+ # The script will delete the source directory and then call git clone.
+ #
+ _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
+ ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${src_name} ${work_dir}
+ )
+ set(comment "Performing download step (git clone) for '${name}'")
+ set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
+ list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt)
elseif(url)
get_filename_component(work_dir "${source_dir}" PATH)
+ get_property(md5 TARGET ${name} PROPERTY _EP_URL_MD5)
set(repository "external project URL")
set(module "${url}")
- set(tag "")
+ set(tag "${md5}")
configure_file(
"${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
"${stamp_dir}/${name}-urlinfo.txt"
@@ -696,25 +983,36 @@ function(_ep_add_download_command name)
if("${url}" MATCHES "^[a-z]+://")
# TODO: Should download and extraction be different steps?
string(REGEX MATCH "[^/]*$" fname "${url}")
- if(NOT "${fname}" MATCHES "\\.(tar|tgz|tar\\.gz)$")
+ if(NOT "${fname}" MATCHES "\\.(bz2|tar|tgz|tar\\.gz|zip)$")
message(FATAL_ERROR "Could not extract tarball filename from url:\n ${url}")
endif()
set(file ${download_dir}/${fname})
get_property(timeout TARGET ${name} PROPERTY _EP_TIMEOUT)
- _ep_write_downloadfile_script("${stamp_dir}/download-${name}.cmake" "${url}" "${file}" "${timeout}")
+ _ep_write_downloadfile_script("${stamp_dir}/download-${name}.cmake" "${url}" "${file}" "${timeout}" "${md5}")
set(cmd ${CMAKE_COMMAND} -P ${stamp_dir}/download-${name}.cmake
COMMAND)
- set(comment "Performing download step (download and extract) for '${name}'")
+ set(comment "Performing download step (download, verify and extract) for '${name}'")
else()
set(file "${url}")
- set(comment "Performing download step (extract) for '${name}'")
+ set(comment "Performing download step (verify and extract) for '${name}'")
endif()
- # TODO: Support other archive formats.
- _ep_write_extractfile_script("${stamp_dir}/extract-${name}.cmake" "${file}" "${tmp_dir}" "${source_dir}")
+ _ep_write_verifyfile_script("${stamp_dir}/verify-${name}.cmake" "${file}" "${md5}")
+ list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/verify-${name}.cmake)
+ _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
@@ -723,6 +1021,7 @@ function(_ep_add_download_command name)
WORKING_DIRECTORY ${work_dir}
DEPENDS ${depends}
DEPENDEES mkdir
+ ${log}
)
endfunction(_ep_add_download_command)
@@ -734,6 +1033,7 @@ function(_ep_add_update_command name)
get_property(cmd TARGET ${name} PROPERTY _EP_UPDATE_COMMAND)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
+ get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
set(work_dir)
set(comment)
@@ -757,8 +1057,33 @@ function(_ep_add_update_command name)
set(work_dir ${source_dir})
set(comment "Performing update step (SVN update) for '${name}'")
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
- set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision})
+ get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
+ get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
+ set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision}
+ --username=${svn_username} --password=${svn_password})
set(always 1)
+ elseif(git_repository)
+ if(NOT GIT_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find git for fetch of ${name}")
+ endif()
+ set(work_dir ${source_dir})
+ set(comment "Performing update step (git fetch) for '${name}'")
+ get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
+ if(NOT git_tag)
+ set(git_tag "master")
+ endif()
+ set(cmd ${GIT_EXECUTABLE} fetch
+ COMMAND ${GIT_EXECUTABLE} checkout ${git_tag}
+ COMMAND ${GIT_EXECUTABLE} submodule update --recursive
+ )
+ 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
@@ -767,6 +1092,7 @@ function(_ep_add_update_command name)
ALWAYS ${always}
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
+ ${log}
)
endfunction(_ep_add_update_command)
@@ -793,7 +1119,7 @@ endfunction(_ep_add_patch_command)
# TODO: Make sure external projects use the proper compiler
function(_ep_add_configure_command name)
- ExternalProject_Get_Property(${name} source_dir binary_dir)
+ ExternalProject_Get_Property(${name} source_dir binary_dir tmp_dir)
_ep_get_configuration_subdir_suffix(cfgdir)
@@ -827,11 +1153,29 @@ function(_ep_add_configure_command name)
endif()
endif()
+ # If anything about the configure command changes, (command itself, cmake
+ # used, cmake args or cmake generator) then re-run the configure step.
+ # Fixes issue http://public.kitware.com/Bug/view.php?id=10258
+ #
+ if(NOT EXISTS ${tmp_dir}/${name}-cfgcmd.txt.in)
+ file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='@cmd@'\n")
+ endif()
+ 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)
@@ -846,10 +1190,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)
@@ -864,10 +1216,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)
@@ -895,10 +1255,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/FindASPELL.cmake b/Modules/FindASPELL.cmake
index c11c2e3..a211ab0 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -20,11 +20,6 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
- # Already in cache, be silent
- SET(ASPELL_FIND_QUIETLY TRUE)
-ENDIF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
-
FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )
FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
@@ -34,5 +29,4 @@ FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASPELL DEFAULT_MSG ASPELL_LIBRARIES ASPELL_INCLUDE_DIR)
-
MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES)
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index ff140f6..7272ba6 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -35,16 +35,14 @@ IF (UNIX)
ENDIF (UNIX)
-SET (AVIFILE_FOUND "NO")
-
-IF(AVIFILE_INCLUDE_DIR)
- IF(AVIFILE_AVIPLAY_LIBRARY)
- SET( AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY} )
- SET( AVIFILE_FOUND "YES" )
- SET( AVIFILE_DEFINITIONS "")
-
- ENDIF(AVIFILE_AVIPLAY_LIBRARY)
-ENDIF(AVIFILE_INCLUDE_DIR)
-
+# handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
+
+IF (AVIFILE_FOUND)
+ SET(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
+ SET(AVIFILE_DEFINITIONS "")
+ENDIF()
MARK_AS_ADVANCED(AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index b604d0b..b1b5010 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -5,6 +5,9 @@
# BISON_VERSION - version of bison
# BISON_FOUND - true if the program was found
#
+# The minimum required version of bison can be specified using the
+# standard CMake syntax, e.g. find_package(BISON 2.1.3)
+#
# If bison is found, the module defines the macros:
# BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
# [COMPILE_FLAGS <string>])
@@ -149,6 +152,7 @@ IF(BISON_EXECUTABLE)
ENDIF(BISON_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON DEFAULT_MSG BISON_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+ VERSION_VAR BISON_VERSION)
# FindBISON.cmake ends here
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index c969e43..2dcc9b4 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -4,7 +4,6 @@
# BZIP2_FOUND - system has BZip2
# BZIP2_INCLUDE_DIR - the BZip2 include directory
# BZIP2_LIBRARIES - Link these to use BZip2
-# BZIP2_DEFINITIONS - Compiler switches required for using BZip2
# BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
#=============================================================================
@@ -21,10 +20,6 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
- SET(BZip2_FIND_QUIETLY TRUE)
-ENDIF (BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
-
FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h )
FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index ea9eb25..0b47843 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -63,7 +63,7 @@
# Currently this module searches for the following version numbers:
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
-# 1.40, 1.40.0, 1.41, 1.41.0
+# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0
#
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above. Official Boost include directories
@@ -297,6 +297,7 @@ else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+ "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 6539057..81d082a 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -165,7 +165,7 @@
# and will link in the resulting object file automatically.
#
# This script will also generate a separate cmake script that is used at
-# build time to invoke nvcc. This is for serveral reasons.
+# build time to invoke nvcc. This is for several reasons.
#
# 1. nvcc can return negative numbers as return values which confuses
# Visual Studio into thinking that the command succeeded. The script now
@@ -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()
@@ -786,7 +811,7 @@ endfunction()
##############################################################################
# This helper macro populates the following variables and setups up custom
# commands and targets to invoke the nvcc compiler to generate C or PTX source
-# dependant upon the format parameter. The compiler is invoked once with -M
+# dependent upon the format parameter. The compiler is invoked once with -M
# to generate a dependency file and a second time with -cuda or -ptx to generate
# a .cpp or .ptx file.
# INPUT:
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index fa68190..791e6a9 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -33,6 +33,15 @@ SET(CURSES_USE_NCURSES FALSE)
IF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
SET(CURSES_USE_NCURSES TRUE)
ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
+# cygwin ncurses stopped providing curses.h symlinks see above
+# message. Cygwin is an ncurses package, so force ncurses on
+# cygwin if the curses.h is missing
+IF(CYGWIN)
+ IF(NOT EXISTS /usr/include/curses.h)
+ SET(CURSES_USE_NCURSES TRUE)
+ ENDIF()
+ENDIF()
# Not sure the logic is correct here.
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 5b2bc59..7bf481f 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -17,7 +17,8 @@
IF (WIN32)
FIND_PATH(CYGWIN_INSTALL_PATH
cygwin.bat
- "C:/Cygwin"
+ "C:/Cygwin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]"
)
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/FindDart.cmake b/Modules/FindDart.cmake
index f8c2747..65da21a 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -27,3 +27,10 @@ FIND_PATH(DART_ROOT README.INSTALL
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
DOC "If you have Dart installed, where is it located?"
)
+
+# handle the QUIETLY and REQUIRED arguments and set DART_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Dart DEFAULT_MSG DART_ROOT)
+
+MARK_AS_ADVANCED(DART_ROOT)
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 1c4c163..22743b1 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -33,9 +33,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_
IF(EXPAT_FOUND)
SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
-ELSE(EXPAT_FOUND)
- SET(EXPAT_LIBRARIES)
- SET(EXPAT_INCLUDE_DIRS)
ENDIF(EXPAT_FOUND)
MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index d618487..52390c3 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -1,4 +1,7 @@
# - Find the GCC-XML front-end executable.
+#
+# This module will define the following variables:
+# GCCXML - the GCC-XML front-end executable.
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -20,3 +23,5 @@ FIND_PROGRAM(GCCXML
"$ENV{ProgramFiles}/GCC_XML"
"C:/Program Files/GCC_XML"
)
+
+MARK_AS_ADVANCED(GCCXML)
diff --git a/Modules/FindGLU.cmake b/Modules/FindGLU.cmake
index 96b6dc9..81b3364 100644
--- a/Modules/FindGLU.cmake
+++ b/Modules/FindGLU.cmake
@@ -15,7 +15,9 @@
# Use of this file is deprecated, and is here for backwards compatibility with CMake 1.4
# GLU library is now found by FindOpenGL.cmake
#
-#
+
+MESSAGE(STATUS
+ "WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead")
INCLUDE(FindOpenGL)
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
new file mode 100644
index 0000000..2d82142
--- /dev/null
+++ b/Modules/FindGit.cmake
@@ -0,0 +1,46 @@
+# The module defines the following variables:
+# GIT_EXECUTABLE - path to git command line client
+# GIT_FOUND - true if the command line client was found
+# Example usage:
+# find_package(Git)
+# if(GIT_FOUND)
+# message("git found: ${GIT_EXECUTABLE}")
+# endif()
+
+#=============================================================================
+# Copyright 2010 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.)
+
+# Look for 'git' or 'eg' (easy git)
+#
+set(git_names git eg)
+
+# Prefer .cmd variants on Windows unless running in a Makefile
+# in the MSYS shell.
+#
+if(WIN32)
+ if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+ set(git_names git.cmd git eg.cmd eg)
+ endif()
+endif()
+
+find_program(GIT_EXECUTABLE
+ NAMES ${git_names}
+ DOC "git command line client"
+ )
+mark_as_advanced(GIT_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# all listed variables are TRUE
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 9ae4a52..21bc5fd 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -1,10 +1,14 @@
-# - Try to find HSPELL
+# - Try to find Hspell
# Once done this will define
#
-# HSPELL_FOUND - system has HSPELL
-# HSPELL_INCLUDE_DIR - the HSPELL include directory
-# HSPELL_LIBRARIES - The libraries needed to use HSPELL
-# HSPELL_DEFINITIONS - Compiler switches required for using HSPELL
+# HSPELL_FOUND - system has Hspell
+# HSPELL_INCLUDE_DIR - the Hspell include directory
+# HSPELL_LIBRARIES - The libraries needed to use Hspell
+# HSPELL_DEFINITIONS - Compiler switches required for using Hspell
+#
+# HSPELL_VERSION_STRING - The version of Hspell found (x.y)
+# HSPELL_MAJOR_VERSION - the major version of Hspell
+# HSPELL_MINOR_VERSION - The minor version of Hspell
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -20,21 +24,20 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
- # Already in cache, be silent
- SET(HSPELL_FIND_QUIETLY TRUE)
-ENDIF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
-
+FIND_PATH(HSPELL_INCLUDE_DIR hspell.h)
-FIND_PATH(HSPELL_INCLUDE_DIR hspell.h )
+FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell)
-FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell )
+IF (HSPELL_INCLUDE_DIR)
+ FILE(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
+ STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
+ STRING(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
+ENDIF()
# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL DEFAULT_MSG HSPELL_LIBRARIES HSPELL_INCLUDE_DIR)
-
MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index a61c683..edb76cb 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -29,24 +29,49 @@
# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var}
MACRO(java_append_library_directories _var)
# Determine java arch-specific library subdir
- IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
- # Based on openjdk/jdk/make/common/shared/Platform.gmk as of 6b16
- # and kaffe as of 1.1.8 which uses the first part of the
- # GNU config.guess platform triplet.
- IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "i386")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
- SET(_java_libarch "amd64" "x86_64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
- SET(_java_libarch "ppc" "powerpc" "ppc64")
- ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
- SET(_java_libarch "sparc" "sparcv9")
- ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
- ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i[3-9]86$")
- ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux")
- SET(_java_libarch "i386" "amd64" "ppc") # previous default
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk
+ # 1.6.0_18 + icedtea patches. However, it would be much better to base the
+ # guess on the first part of the GNU config.guess platform triplet.
+ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "amd64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
+ SET(_java_libarch "i386")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
+ SET(_java_libarch "alpha")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+ # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
+ SET(_java_libarch "arm")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
+ # mips* machines are bi-endian mostly so processor does not tell
+ # endianess of the underlying system.
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
+ SET(_java_libarch "ppc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
+ SET(_java_libarch "ppc")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
+ # Both flavours can run on the same processor
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
+ SET(_java_libarch "parisc" "parisc64")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
+ # s390 binaries can run on s390x machines
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
+ ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
+ SET(_java_libarch "sh")
+ ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ SET(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}")
+ ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+
+ # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
+ # system is non-Linux (where the code above has not been well tested)
+ IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+ LIST(APPEND _java_libarch "i386" "amd64" "ppc")
+ ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+
+ # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
+ # current value to a hardcoded list. Remove possible duplicates.
+ LIST(REMOVE_DUPLICATES _java_libarch)
FOREACH(_path ${ARGN})
IF(_path MATCHES "{libarch}")
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 553654e..4f8ccb7 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -21,19 +21,10 @@
FIND_PACKAGE(JPEG)
-IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)
- # Already in cache, be silent
- SET(Jasper_FIND_QUIETLY TRUE)
-ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARIES AND JPEG_LIBRARIES)
-
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h)
FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper)
-IF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
- SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
-ENDIF (JASPER_INCLUDE_DIR AND JASPER_LIBRARY AND JPEG_LIBRARIES)
-
# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -43,4 +34,4 @@ IF (JASPER_FOUND)
SET(JASPER_LIBRARIES ${JASPER_LIBRARY} ${JPEG_LIBRARIES} )
ENDIF (JASPER_FOUND)
-MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARIES JASPER_LIBRARY)
+MARK_AS_ADVANCED(JASPER_INCLUDE_DIR JASPER_LIBRARY)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 7eb6d900c..4cd4389 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -24,9 +24,18 @@
# and
# Java_VERSION = 1.6.0
#
-# NOTE: At the moment this script will look for javac and jar component,
-# which means it will fail if javac or jar is not found.:w
-# See Bug #9840
+# For these components the following variables are set:
+#
+# Java_FOUND - TRUE if all components are found.
+# Java_INCLUDE_DIRS - Full paths to all include dirs.
+# Java_LIBRARIES - Full paths to all libraries.
+# Java_<component>_FOUND - TRUE if <component> is found.
+#
+# Example Usages:
+# FIND_PACKAGE(Java)
+# FIND_PACKAGE(Java COMPONENTS Runtime)
+# FIND_PACKAGE(Java COMPONENTS Development)
+#
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
@@ -82,7 +91,11 @@ IF(Java_JAVA_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
IF( res )
- MESSAGE( FATAL_ERROR "Error executing java -version" )
+ IF(${Java_FIND_REQUIRED})
+ MESSAGE( FATAL_ERROR "Error executing java -version" )
+ ELSE()
+ MESSAGE( STATUS "Warning, could not run java --version")
+ ENDIF()
ELSE()
# extract major/minor version and patch level from "java -version" output
# Tested on linux using
@@ -148,12 +161,36 @@ FIND_PROGRAM(Java_JAVAC_EXECUTABLE
)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
-)
+if(Java_FIND_COMPONENTS)
+ foreach(component ${Java_FIND_COMPONENTS})
+ # User just want to execute some Java byte-compiled
+ if(component STREQUAL "Runtime")
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ _java_version_acceptable
+ )
+ elseif(component STREQUAL "Development")
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ Java_JAR_EXECUTABLE
+ Java_JAVAC_EXECUTABLE
+ _java_version_acceptable
+ )
+ else()
+ message(FATAL_ERROR "Comp: ${component} is not handled")
+ endif()
+ set(Java_${component}_FOUND TRUE)
+ endforeach(component)
+else()
+ # Check for everything
+ find_package_handle_standard_args(Java DEFAULT_MSG
+ Java_JAVA_EXECUTABLE
+ Java_JAR_EXECUTABLE
+ Java_JAVAC_EXECUTABLE
+ _java_version_acceptable
+ )
+endif()
+
MARK_AS_ADVANCED(
Java_JAVA_EXECUTABLE
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index 12fd304..42a1530 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -73,7 +73,7 @@ IF(NOT KDE4_DATA_DIR)
EXECUTE_PROCESS(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
# then check the data dirs for FindKDE4Internal.cmake
- FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake ${_data_DIR})
+ FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake HINTS ${_data_DIR})
ENDIF(KDE4_KDECONFIG_EXECUTABLE)
ENDIF(CMAKE_CROSSCOMPILING)
ENDIF(NOT KDE4_DATA_DIR)
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
new file mode 100644
index 0000000..fab5160
--- /dev/null
+++ b/Modules/FindLibArchive.cmake
@@ -0,0 +1,63 @@
+# - Find libarchive library and headers
+# The module defines the following variables:
+#
+# LibArchive_FOUND - true if libarchive was found
+# LibArchive_INCLUDE_DIRS - include search path
+# LibArchive_LIBRARIES - libraries to link
+# LibArchive_VERSION - libarchive 3-component version number
+
+#=============================================================================
+# Copyright 2010 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.)
+
+find_path(LibArchive_INCLUDE_DIR
+ NAMES archive.h
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/include"
+ )
+
+find_library(LibArchive_LIBRARY
+ NAMES archive libarchive
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/lib"
+ )
+
+mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY)
+
+# Extract the version number from the header.
+if(LibArchive_INCLUDE_DIR AND EXISTS "${LibArchive_INCLUDE_DIR}/archive.h")
+ # The version string appears in one of two known formats in the header:
+ # #define ARCHIVE_LIBRARY_VERSION "libarchive 2.4.12"
+ # #define ARCHIVE_VERSION_STRING "libarchive 2.8.4"
+ # Match either format.
+ set(_LibArchive_VERSION_REGEX "^#define[ \t]+ARCHIVE[_A-Z]+VERSION[_A-Z]*[ \t]+\"libarchive +([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*\".*$")
+ file(STRINGS "${LibArchive_INCLUDE_DIR}/archive.h" _LibArchive_VERSION_STRING LIMIT_COUNT 1 REGEX "${_LibArchive_VERSION_REGEX}")
+ if(_LibArchive_VERSION_STRING)
+ string(REGEX REPLACE "${_LibArchive_VERSION_REGEX}" "\\1.\\2.\\3" LibArchive_VERSION "${_LibArchive_VERSION_STRING}")
+ endif()
+ unset(_LibArchive_VERSION_REGEX)
+ unset(_LibArchive_VERSION_STRING)
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set LIBARCHIVE_FOUND
+# to TRUE if all listed variables are TRUE.
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibArchive DEFAULT_MSG
+ LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+ )
+set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
+unset(LIBARCHIVE_FOUND)
+
+if(LibArchive_FOUND)
+ set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR})
+ set(LibArchive_LIBRARIES ${LibArchive_LIBRARY})
+endif()
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 9139aad..67db321 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -24,7 +24,7 @@
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBXML libxml-2.0)
+PKG_CHECK_MODULES(PC_LIBXML libxml-2.0 QUIET)
SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
@@ -44,10 +44,9 @@ FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
# for backwards compat. with KDE 4.0.x:
SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
-INCLUDE(FindPackageHandleStandardArgs)
-
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index d16d1ff..a03aa7c 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -26,9 +26,8 @@ FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBXSLT libxslt)
SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
-
FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
- HINTS
+ HINTS
${PC_LIBXSLT_INCLUDEDIR}
${PC_LIBXSLT_INCLUDE_DIRS}
)
@@ -39,12 +38,10 @@ FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
${PC_LIBXSLT_LIBRARY_DIRS}
)
-INCLUDE(FindPackageHandleStandardArgs)
-
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR)
-
MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index a19f73e..0c06c94 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -35,8 +35,10 @@ FIND_LIBRARY( MPEG_vo_LIBRARY vo
# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
IF(MPEG_FOUND)
SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
ENDIF(MPEG_FOUND)
+
+MARK_AS_ADVANCED(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 094f9e6..21dadd9 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -86,6 +86,7 @@ set(_MPI_PACKAGE_DIR
set(_MPI_PREFIX_PATH)
if(WIN32)
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
+ list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]")
endif()
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
@@ -187,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)
@@ -198,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)
@@ -229,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)
@@ -250,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)
@@ -262,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)
@@ -331,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/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index b9b7078..f42a69a 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -95,8 +95,9 @@ FIND_LIBRARY(OPENAL_LIBRARY
)
-SET(OPENAL_FOUND "NO")
-IF(OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
- SET(OPENAL_FOUND "YES")
-ENDIF(OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
+# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+MARK_AS_ADVANCED(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index b056020..bf47ab8 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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${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"
+ PATHS ${OPENSSL_ROOT_DIR}/lib
)
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 8df3573..bfc5d4a 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -33,7 +33,7 @@ if(ZLIB_FOUND)
/usr/local/include/libpng # OpenBSD
)
- set(PNG_NAMES ${PNG_NAMES} png libpng png12 libpng12)
+ set(PNG_NAMES ${PNG_NAMES} png libpng png14 libpng14 png14d libpng14d png12 libpng12 png12d libpng12d)
find_library(PNG_LIBRARY NAMES ${PNG_NAMES} )
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index e17105c..389697e 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -1,21 +1,58 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
-# This macro is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
-# it also sets the <UPPERCASED_NAME>_FOUND variable.
-# The package is found if all variables listed are TRUE.
-# Example:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
#
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It also sets the <UPPERCASED_NAME>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
#
-# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
-# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
-# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
-# independent whether QUIET was used or not.
-# If it is found, the location is reported using the VAR1 argument, so
-# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
-# If the second argument is DEFAULT_MSG, the message in the failure case will
-# be "Could NOT find LibXml2", if you don't like this message you can specify
-# your own custom failure message there.
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
+# [VERSION_VAR <versionvar>
+# [FAIL_MESSAGE "Custom failure message"] )
+#
+# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+#
+# Example for mode 1:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+# VERSION_VAR BISON_VERSION)
+# In this case, BISON is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
+# Also the version of BISON will be checked by using the version contained
+# in BISON_VERSION.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -31,13 +68,89 @@
# License text for the above reference.)
INCLUDE(FindPackageMessage)
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
- IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+# Checks a list of strings (typically function/macro parameters) whether it contains a keyword
+# (_keyword) and return the value(s) following this keyword in _outputVar.
+# If _multipleValues is true, this can be more than one value.
+# Then end of the values for a keyword is then determined by checking whether the
+# next argument is contained in _allKeywordsList.
+FUNCTION(FPHSA_GET_OPTION_VALUE _keyword _outputVar _allArgsList _allKeywordsList _multipleValues)
+ UNSET(${_outputVar})
+ UNSET(_removeIndices)
+
+ SET(_insideValues FALSE)
+ SET(_counter 0)
+ FOREACH(_currentArg ${${_allArgsList}})
+ IF(NOT _insideValues) # first check that we find the keyword we are currently interested in...
+ IF("${_currentArg}" STREQUAL "${_keyword}")
+ SET(_insideValues TRUE)
+ LIST(APPEND _removeIndices ${_counter})
+ ENDIF("${_currentArg}" STREQUAL "${_keyword}")
+ ELSE(NOT _insideValues)
+
+ LIST(FIND ${_allKeywordsList} "${_currentArg}" _index) # ... then this marks the end of the arguments belonging to this keyword
+ IF(${_index} EQUAL -1)
+ LIST(APPEND _result ${_currentArg})
+ LIST(APPEND _removeIndices ${_counter}) # collect the indices of the strings we found to remove them from the list afterwards
+ IF(NOT _multipleValues)
+ BREAK()
+ ENDIF(NOT _multipleValues)
+ ELSE(${_index} EQUAL -1)
+ SET(_insideValues FALSE)
+ BREAK()
+ ENDIF(${_index} EQUAL -1)
+ ENDIF(NOT _insideValues)
+
+ MATH(EXPR _counter "${_counter} + 1")
+
+ ENDFOREACH(_currentArg ${${_allArgsList}})
+
+ IF(DEFINED _removeIndices)
+ LIST(REMOVE_AT ${_allArgsList} ${_removeIndices})
+ ENDIF(DEFINED _removeIndices)
+
+ SET(${_outputVar} ${_result} PARENT_SCOPE)
+ SET(${_allArgsList} ${${_allArgsList}} PARENT_SCOPE)
+
+ENDFUNCTION(FPHSA_GET_OPTION_VALUE _keyword _outputVar _allArgsList _allKeywordsList _multipleValues)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
+
+ SET(_KEYWORDS_FOR_EXTENDED_MODE FAIL_MESSAGE REQUIRED_VARS VERSION_VAR )
+ LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ IF(${INDEX} EQUAL -1)
+ SET(_FAIL_MESSAGE ${_FIRST_ARG})
+ SET(_REQUIRED_VARS ${_VAR1} ${ARGN})
+ SET(_VERSION_VAR)
+ ELSE(${INDEX} EQUAL -1)
+ SET(ALL_ARGS ${_FIRST_ARG} ${_VAR1} ${ARGN})
+
+ FPHSA_GET_OPTION_VALUE("FAIL_MESSAGE" _FAIL_MESSAGE ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE FALSE)
+ FPHSA_GET_OPTION_VALUE("REQUIRED_VARS" _REQUIRED_VARS ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE TRUE)
+ FPHSA_GET_OPTION_VALUE("VERSION_VAR" _VERSION_VAR ALL_ARGS _KEYWORDS_FOR_EXTENDED_MODE FALSE)
+
+ IF(ALL_ARGS)
+ MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${ALL_ARGS}\"")
+ ENDIF(ALL_ARGS)
+
+ IF(NOT _FAIL_MESSAGE)
+ SET(_FAIL_MESSAGE "DEFAULT_MSG")
+ ENDIF(NOT _FAIL_MESSAGE)
+ ENDIF(${INDEX} EQUAL -1)
+
+# now that we collected all arguments, process them
+
+ IF("${_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
- ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
- SET(_FAIL_MESSAGE "${_FAIL_MSG}")
- ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+ ENDIF("${_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+
+ IF(NOT _REQUIRED_VARS)
+ MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ ENDIF(NOT _REQUIRED_VARS)
+
+ LIST(GET _REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
STRING(TOUPPER ${_NAME} _NAME_UPPER)
@@ -46,15 +159,8 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
SET(MISSING_VARS "")
SET(DETAILS "")
SET(${_NAME_UPPER}_FOUND TRUE)
- IF(NOT ${_VAR1})
- SET(${_NAME_UPPER}_FOUND FALSE)
- SET(MISSING_VARS " ${_VAR1}")
- ELSE(NOT ${_VAR1})
- SET(DETAILS "${DETAILS}[${${_VAR1}}]")
- ENDIF(NOT ${_VAR1})
-
# check if all passed variables are valid
- FOREACH(_CURRENT_VAR ${ARGN})
+ FOREACH(_CURRENT_VAR ${_REQUIRED_VARS})
IF(NOT ${_CURRENT_VAR})
SET(${_NAME_UPPER}_FOUND FALSE)
SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
@@ -63,18 +169,84 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
ENDIF(NOT ${_CURRENT_VAR})
ENDFOREACH(_CURRENT_VAR)
+
+ # version handling:
+ SET(VERSION_MSG "")
+ SET(VERSION_OK TRUE)
+ IF (${_NAME}_FIND_VERSION)
+
+ # if the package was found, check for the version using <NAME>_FIND_VERSION
+ IF (${_NAME_UPPER}_FOUND)
+ SET(VERSION ${${_VERSION_VAR}} )
+
+ IF(VERSION)
+
+ IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG " (found exact version \"${VERSION}\")")
+ ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+ ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
+ IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+# Uncomment the following two lines to see to which Find-modules the VERSION_VAR keywords still need to be added:
+# ELSE(VERSION)
+# SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)")
+ ENDIF(VERSION)
+
+ # if the package was not found, but a version was given, add that to the output:
+ ELSE (${_NAME_UPPER}_FOUND)
+ IF(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG " (Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ ELSE(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG " (Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+ ENDIF (${_NAME_UPPER}_FOUND)
+ ENDIF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION_OK)
+ SET(DETAILS "${DETAILS}[v${${VERSION}}]")
+ ELSE(VERSION_OK)
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ ENDIF(VERSION_OK)
+
+
+ # print the result:
IF (${_NAME_UPPER}_FOUND)
- FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_VAR1}}" "${DETAILS}")
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
ELSE (${_NAME_UPPER}_FOUND)
- IF (${_NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
- ELSE (${_NAME}_FIND_REQUIRED)
- IF (NOT ${_NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
- ENDIF (NOT ${_NAME}_FIND_QUIETLY)
- ENDIF (${_NAME}_FIND_REQUIRED)
+ IF(NOT VERSION_OK)
+
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+
+ ELSE(NOT VERSION_OK)
+
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ ENDIF(NOT VERSION_OK)
+
ENDIF (${_NAME_UPPER}_FOUND)
SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index 4775a8e..98bebe6 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -54,8 +54,8 @@ FIND_LIBRARY(PHYSFS_LIBRARY
/opt
)
-SET(PHYSFS_FOUND "NO")
-IF(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
- SET(PHYSFS_FOUND "YES")
-ENDIF(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
+# handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS DEFAULT_MSG PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 6e6b802..3cbb7af 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -1,15 +1,17 @@
# - a pkg-config module for CMake
#
# Usage:
-# pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+# pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
# checks for all the given modules
#
-# pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+# pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
# checks for given modules and uses the first working one
#
# When the 'REQUIRED' argument was set, macros will fail with an error
# when module(s) could not be found
#
+# When the 'QUIET' argument is set, no status messages will be printed.
+#
# It sets the following variables:
# PKG_CONFIG_FOUND ... true if pkg-config works on the system
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
@@ -138,17 +140,22 @@ macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
endmacro(_pkgconfig_invoke_dyn)
# Splits given arguments into options and a package list
-macro(_pkgconfig_parse_options _result _is_req)
+macro(_pkgconfig_parse_options _result _is_req _is_silent)
set(${_is_req} 0)
+ set(${_is_silent} 0)
foreach(_pkg ${ARGN})
if (_pkg STREQUAL "REQUIRED")
set(${_is_req} 1)
endif (_pkg STREQUAL "REQUIRED")
+ if (_pkg STREQUAL "QUIET")
+ set(${_is_silent} 1)
+ endif (_pkg STREQUAL "QUIET")
endforeach(_pkg ${ARGN})
set(${_result} ${ARGN})
list(REMOVE_ITEM ${_result} "REQUIRED")
+ list(REMOVE_ITEM ${_result} "QUIET")
endmacro(_pkgconfig_parse_options)
###
@@ -279,7 +286,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir )
- message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
+ if (NOT ${_is_silent})
+ message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
+ endif (NOT ${_is_silent})
endforeach(_pkg_check_modules_pkg)
# set variables which are combined for multiple modules
@@ -307,8 +316,8 @@ endmacro(_pkg_check_modules_internal)
macro(pkg_check_modules _prefix _module0)
# check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
- _pkgconfig_parse_options (_pkg_modules _pkg_is_required "${_module0}" ${ARGN})
- _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules})
+ _pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
+ _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
@@ -319,9 +328,11 @@ macro(pkg_search_module _prefix _module0)
# check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
set(_pkg_modules_found 0)
- _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN})
+ _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
- message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
+ if (NOT ${_pkg_is_silent})
+ message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
+ endif (NOT ${_pkg_is_silent})
# iterate through all modules and stop at the first working one.
foreach(_pkg_alt ${_pkg_modules_alt})
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 76d7950..0a813a4 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
@@ -397,6 +457,7 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
$ENV{QTDIR}/bin
+ DOC "The qmake executable for the Qt installation to use"
)
IF (QT_QMAKE_EXECUTABLE)
@@ -418,6 +479,7 @@ IF (QT_QMAKE_EXECUTABLE)
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
$ENV{QTDIR}/bin
+ DOC "The qmake executable for the Qt installation to use"
)
IF(QT_QMAKE_EXECUTABLE)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
@@ -494,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}
+ )
+
+ # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+ IF(NOT QT_QTCORE_LIBRARY_RELEASE 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(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC)
+
+ 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.")
+ 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
@@ -553,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)
@@ -576,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
@@ -594,6 +741,8 @@ IF (QT4_QMAKE_FOUND)
QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
+
+
#############################################
#
# Find out what window system we're using
@@ -603,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)
@@ -641,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)
@@ -674,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})
@@ -700,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
@@ -739,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
@@ -806,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.
@@ -861,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/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index aa13ae9..f693543 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -41,9 +41,7 @@ ELSE(APPLE)
)
ENDIF(APPLE)
-SET(QUICKTIME_FOUND "NO")
-IF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
- SET(QUICKTIME_FOUND "YES")
-ENDIF(QUICKTIME_LIBRARY AND QUICKTIME_INCLUDE_DIR)
-
-
+# handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(QuickTime DEFAULT_MSG QUICKTIME_LIBRARY QUICKTIME_INCLUDE_DIR)
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 05c09b4..6edcb72 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -5,7 +5,7 @@
# SWIG_EXECUTABLE - the path to the swig executable
# SWIG_VERSION - the version number of the swig executable
#
-# All informations are collected from the SWIG_EXECUTABLE so the
+# All information is collected from the SWIG_EXECUTABLE so the
# version to be found can be changed from the command line by
# means of setting SWIG_EXECUTABLE
#
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index c33df1d..687aa19 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -38,16 +38,11 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(Subversion_FOUND FALSE)
-SET(Subversion_SVN_FOUND FALSE)
-
FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
DOC "subversion command line client")
MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
IF(Subversion_SVN_EXECUTABLE)
- SET(Subversion_SVN_FOUND TRUE)
- SET(Subversion_FOUND TRUE)
MACRO(Subversion_WC_INFO dir prefix)
# the subversion commands should be executed with the C locale, otherwise
@@ -109,14 +104,9 @@ IF(Subversion_SVN_EXECUTABLE)
ENDIF(Subversion_SVN_EXECUTABLE)
-IF(NOT Subversion_FOUND)
- IF(NOT Subversion_FIND_QUIETLY)
- MESSAGE(STATUS "Subversion was not found.")
- ELSE(NOT Subversion_FIND_QUIETLY)
- IF(Subversion_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Subversion was not found.")
- ENDIF(Subversion_FIND_REQUIRED)
- ENDIF(NOT Subversion_FIND_QUIETLY)
-ENDIF(NOT Subversion_FOUND)
-
-# FindSubversion.cmake ends here.
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion DEFAULT_MSG Subversion_SVN_EXECUTABLE)
+
+# for compatibility
+SET(Subversion_FOUND ${SUBVERSION_FOUND})
+SET(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 8711634..62cc5c5 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -22,7 +22,7 @@
FIND_PATH(TIFF_INCLUDE_DIR tiff.h)
-SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff libtiff3)
+SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
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/FindX11.cmake b/Modules/FindX11.cmake
index c084df0..f056413 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -22,6 +22,7 @@
# X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND
# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
+# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
@@ -91,6 +92,7 @@ IF (UNIX)
FIND_PATH(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
@@ -120,6 +122,7 @@ IF (UNIX)
FIND_LIBRARY(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
@@ -219,6 +222,11 @@ IF (UNIX)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
ENDIF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+ IF (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
+ SET(X11_Xi_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
+ ENDIF (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
+
IF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
SET(X11_Xinerama_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
@@ -396,6 +404,8 @@ IF (UNIX)
X11_Xxf86misc_LIB
X11_xf86misc_INCLUDE_PATH
X11_xf86vmode_INCLUDE_PATH
+ X11_Xi_LIB
+ X11_Xi_INCLUDE_PATH
X11_Xinerama_LIB
X11_Xinerama_INCLUDE_PATH
X11_XTest_LIB
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 8066343..3891be4 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -1,9 +1,22 @@
# - Find zlib
-# Find the native ZLIB includes and library
+# Find the native ZLIB includes and library.
+# Once done this will define
#
-# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
-# ZLIB_LIBRARIES - List of libraries when using zlib.
-# ZLIB_FOUND - True if zlib found.
+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+#
+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# The following variable are provided for backward compatibility
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
+# ZLIB_MINOR_VERSION - The minor version of zlib
+# ZLIB_PATCH_VERSION - The patch version of zlib
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -18,23 +31,42 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
-IF (ZLIB_INCLUDE_DIR)
- # Already in cache, be silent
- SET(ZLIB_FIND_QUIETLY TRUE)
-ENDIF (ZLIB_INCLUDE_DIR)
-
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
+FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
+)
SET(ZLIB_NAMES z zlib zdll)
-FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} )
-MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
+FIND_LIBRARY(ZLIB_LIBRARY
+ NAMES
+ ${ZLIB_NAMES}
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
+)
+MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-# Per-recommendation
-SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}")
-SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
+IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_TWEAK "${ZLIB_H}")
+
+ SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}.${ZLIB_VERSION_TWEAK}")
+
+ SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+ENDIF()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_INCLUDE_DIR ZLIB_LIBRARY
+ VERSION_VAR ZLIB_VERSION_STRING)
+
+IF(ZLIB_FOUND)
+ SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+ENDIF()
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 05c6625..4533c01 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -57,14 +57,14 @@
# FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
# IF(wxWidgets_FOUND)
# INCLUDE(${wxWidgets_USE_FILE})
-# # and for each of your dependant executable/library targets:
+# # and for each of your dependent executable/library targets:
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
# ENDIF(wxWidgets_FOUND)
#
# If wxWidgets is required (i.e., not an optional part):
# FIND_PACKAGE(wxWidgets REQUIRED base core gl net)
# INCLUDE(${wxWidgets_USE_FILE})
-# # and for each of your dependant executable/library targets:
+# # and for each of your dependent executable/library targets:
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
#=============================================================================
@@ -723,10 +723,13 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
- # parse definitions from cxxflags; drop -D* from CXXFLAGS and the -D prefix
+ # parse definitions from cxxflags;
+ # drop -D* from CXXFLAGS and the -D prefix
STRING(REGEX MATCHALL "-D[^;]+"
wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}")
- STRING(REGEX REPLACE "-D[^;]+;" ""
+ STRING(REGEX REPLACE "-D[^;]+(;|$)" ""
+ wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
+ STRING(REGEX REPLACE ";$" ""
wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
STRING(REPLACE "-D" ""
wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 123b433..f984c58 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -16,6 +16,7 @@
# gp_resolve_item
# (projects can override with gp_resolve_item_override)
# gp_resolved_file_type
+# (projects can override with gp_resolved_file_type_override)
# gp_file_type
# get_prerequisites
# list_prerequisites
@@ -345,6 +346,9 @@ endfunction(gp_resolve_item)
# embedded
# other
#
+# Override on a per-project basis by providing a project-specific
+# gp_resolved_file_type_override function.
+#
function(gp_resolved_file_type original_file file exepath dirs type_var)
#message(STATUS "**")
@@ -428,6 +432,13 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
endif()
endif()
+ # Provide a hook so that projects can override the decision on whether a
+ # library belongs to the system or not by whatever logic they choose:
+ #
+ if(COMMAND gp_resolved_file_type_override)
+ gp_resolved_file_type_override("${resolved_file}" type)
+ endif()
+
set(${type_var} "${type}" PARENT_SCOPE)
#message(STATUS "**")
@@ -515,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")
@@ -522,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")
@@ -529,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.
@@ -618,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/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index e4a82d1..785352e 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -1,6 +1,6 @@
# - MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
# Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually
-# better ways to specifiy the correct dependencies.
+# better ways to specify the correct dependencies.
#
# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
# wrapper around the OBJECT_DEPENDS source file property. You can just
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 6a80f62..24bb92a 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -45,6 +45,7 @@ macro(__cygwin_compiler_gnu lang)
SET(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
ENDFOREACH(type)
+ set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-all-symbols")
# TODO: Is -Wl,--enable-auto-import now always default?
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--enable-auto-import")
set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}")
diff --git a/Modules/Platform/GNU.cmake b/Modules/Platform/GNU.cmake
index fe3d47b..e0ed86c 100644
--- a/Modules/Platform/GNU.cmake
+++ b/Modules/Platform/GNU.cmake
@@ -4,5 +4,8 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+
INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/Generic.cmake b/Modules/Platform/Generic.cmake
index 00508b2..a4e2ec6 100644
--- a/Modules/Platform/Generic.cmake
+++ b/Modules/Platform/Generic.cmake
@@ -9,3 +9,9 @@
# (embedded) targets without operating system usually don't support shared libraries
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+
+# To help the find_xxx() commands, set at least the following so CMAKE_FIND_ROOT_PATH
+# works at least for some simple cases:
+SET(CMAKE_SYSTEM_INCLUDE_PATH /include )
+SET(CMAKE_SYSTEM_LIBRARY_PATH /lib )
+SET(CMAKE_SYSTEM_PROGRAM_PATH /bin )
diff --git a/Modules/Platform/Linux-Clang-C.cmake b/Modules/Platform/Linux-Clang-C.cmake
new file mode 100644
index 0000000..dbf8956
--- /dev/null
+++ b/Modules/Platform/Linux-Clang-C.cmake
@@ -0,0 +1 @@
+INCLUDE(Platform/Linux-GNU-C)
diff --git a/Modules/Platform/Linux-Clang-CXX.cmake b/Modules/Platform/Linux-Clang-CXX.cmake
new file mode 100644
index 0000000..8fe251c
--- /dev/null
+++ b/Modules/Platform/Linux-Clang-CXX.cmake
@@ -0,0 +1 @@
+INCLUDE(Platform/Linux-GNU-CXX)
diff --git a/Modules/Platform/Linux-SunPro-CXX.cmake b/Modules/Platform/Linux-SunPro-CXX.cmake
index 5490473..8ee9658 100644
--- a/Modules/Platform/Linux-SunPro-CXX.cmake
+++ b/Modules/Platform/Linux-SunPro-CXX.cmake
@@ -1,2 +1,9 @@
-SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG "-rpath-link ")
+# Sun C++ 5.9 does not support -Wl, but Sun C++ 5.11 does not work without it.
+# Query the compiler flags to detect whether to use -Wl.
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} -flags OUTPUT_VARIABLE _cxx_flags ERROR_VARIABLE _cxx_error)
+if("${_cxx_flags}" MATCHES "\n-W[^\n]*component")
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG "-Wl,-rpath-link,")
+else()
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG "-rpath-link ")
+endif()
SET(CMAKE_EXE_EXPORTS_CXX_FLAG "--export-dynamic")
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/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index e7df46d..b4ed66f 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -1,2 +1,18 @@
INCLUDE(Platform/NetBSD)
+
+# On OpenBSD, the compile time linker does not share it's configuration with
+# the runtime linker. This will extract the library search paths from the
+# system's ld.so.hints file which will allow CMake to set the appropriate
+# -rpath-link flags
+IF(NOT CMAKE_PLATFORM_RUNTIME_PATH)
+ EXECUTE_PROCESS(COMMAND /sbin/ldconfig -r
+ OUTPUT_VARIABLE LDCONFIG_HINTS
+ ERROR_QUIET)
+ STRING(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
+ LDCONFIG_HINTS "${LDCONFIG_HINTS}")
+ STRING(REGEX REPLACE ":" ";"
+ CMAKE_PLATFORM_RUNTIME_PATH
+ "${LDCONFIG_HINTS}")
+ENDIF()
+
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
diff --git a/Modules/Platform/Windows-G95-Fortran.cmake b/Modules/Platform/Windows-G95-Fortran.cmake
new file mode 100644
index 0000000..af08008
--- /dev/null
+++ b/Modules/Platform/Windows-G95-Fortran.cmake
@@ -0,0 +1 @@
+include(Platform/Windows-GNU-Fortran)
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index e369ac1..7463c62 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -23,19 +23,15 @@ ENDIF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_COMPILER_2005 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 9")
- SET(CMAKE_COMPILER_2005 1)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 9")
-
# make sure to enable languages after setting configuration types
ENABLE_LANGUAGE(RC)
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
-# for nmake we need to compute some information about the compiler
+# for nmake we need to compute some information about the compiler
# that is being used.
# the compiler may be free command line, 6, 7, or 71, and
-# each have properties that must be determined.
+# each have properties that must be determined.
# to avoid running these tests with each cmake run, the
# test results are saved in CMakeCPlatform.cmake, a file
# that is automatically copied into try_compile directories
@@ -87,25 +83,12 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
SET(MSVC80 1)
SET(CMAKE_COMPILER_2005 1)
ENDIF("${compilerVersion}" EQUAL 1400)
- IF("${compilerVersion}" GREATER 1400)
- SET(MSVC80 1)
- SET(CMAKE_COMPILER_2005 1)
- ENDIF("${compilerVersion}" GREATER 1400)
- IF("${compilerVersion}" GREATER 1400)
- SET(MSVC80 1)
- SET(CMAKE_COMPILER_2005 1)
- ENDIF("${compilerVersion}" GREATER 1400)
IF("${compilerVersion}" EQUAL 1500)
SET(MSVC90 1)
- SET(MSVC80 0)
ENDIF("${compilerVersion}" EQUAL 1500)
- IF("${compilerVersion}" GREATER 1500)
- SET(MSVC90 1)
- SET(MSVC80 0)
- ENDIF("${compilerVersion}" GREATER 1500)
IF("${compilerVersion}" EQUAL 1600)
SET(MSVC10 1)
- ENDIF()
+ ENDIF("${compilerVersion}" EQUAL 1600)
SET(MSVC_VERSION "${compilerVersion}")
ELSE(NOT CMAKE_COMPILER_RETURN)
MESSAGE(STATUS "Check for CL compiler version - failed")
@@ -224,7 +207,7 @@ ENDIF(NOT _MACHINE_ARCH_FLAG)
SET (CMAKE_EXE_LINKER_FLAGS_INIT
"${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
-# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp
+# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
# on versions that support it
SET( MSVC_INCREMENTAL_YES_FLAG "")
IF(NOT MSVC_INCREMENTAL_DEFAULT)
@@ -256,7 +239,6 @@ SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELW
SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
-
# save computed information for this platform
IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
@@ -267,4 +249,3 @@ IF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
-
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
index 1a889f2..82a0e59 100644
--- a/Modules/Platform/Windows-cl.cmake.in
+++ b/Modules/Platform/Windows-cl.cmake.in
@@ -8,6 +8,7 @@ SET(MSVC70 @MSVC70@)
SET(MSVC71 @MSVC71@)
SET(MSVC80 @MSVC80@)
SET(MSVC90 @MSVC90@)
+SET(MSVC10 @MSVC10@)
SET(MSVC_IDE @MSVC_IDE@)
SET(MSVC_VERSION @MSVC_VERSION@)
SET(WIN32 1)
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index b260489..7fc345f 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -31,7 +31,7 @@ SET(CMAKE_C_CREATE_IMPORT_LIBRARY
SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
SET(CMAKE_C_LINK_EXECUTABLE
- "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
@@ -52,7 +52,7 @@ SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -d+ <DEFINES> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE
- "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
${CMAKE_CXX_CREATE_SHARED_MODULE}
${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
@@ -64,7 +64,7 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b '<TARGET_UNQUOTED>' <OBJECTS> ")
+SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b '<TARGET_UNQUOTED>' <LINK_FLAGS> <OBJECTS> ")
# create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index 1c5293d..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,133 +53,91 @@ 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()
+ENDIF(NOT QT_IS_STATIC)
# QtOpenGL dependencies
-QT_QUERY_QMAKE(QMAKE_LIBS_OPENGL "QMAKE_LIBS_OPENGL")
-IF(Q_WS_MAC)
-# On the Mac OpenGL is probably frameworks and QMAKE_LIBS_OPENGL can be
-# e.g. "-framework OpenGL -framework AGL". The separate_arguments() call in
-# the other branch makes "-framework;-OpenGL;-framework;-lAGL" appear in the
-# linker command. So we need to protect the "-framework foo" as
-# non-separatable strings. We do this by replacing the space after
-# "-framework" with an underscore, then calling separate_arguments(), and
-# then we replace the underscores again with spaces. So we get proper linker
-# commands. Alex
- STRING(REGEX REPLACE "-framework +" "-framework_" QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
- SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
- STRING(REGEX REPLACE "-framework_" "-framework " QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
-ELSE(Q_WS_MAC)
- SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
-ENDIF(Q_WS_MAC)
-SET (QT_QTOPENGL_LIB_DEPENDENCIES ${QT_QTOPENGL_LIB_DEPENDENCIES} ${QMAKE_LIBS_OPENGL})
+find_package(OpenGL)
+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")
# for X11, get X11 library directory
IF(Q_WS_X11)
- QT_QUERY_QMAKE(QMAKE_LIBDIR_X11 "QMAKE_LIBDIR_X11")
+ FIND_PACKAGE(X11)
ENDIF(Q_WS_X11)
## X11 SM
IF(QT_QCONFIG MATCHES "x11sm")
- # ask qmake where the x11 libs are
- FIND_LIBRARY(QT_X11_SM_LIBRARY NAMES SM PATHS ${QMAKE_LIBDIR_X11})
- FIND_LIBRARY(QT_X11_ICE_LIBRARY NAMES ICE PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_X11_SM_LIBRARY)
- MARK_AS_ADVANCED(QT_X11_ICE_LIBRARY)
- IF(QT_X11_SM_LIBRARY AND QT_X11_ICE_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_X11_SM_LIBRARY} ${QT_X11_ICE_LIBRARY})
- ENDIF(QT_X11_SM_LIBRARY AND QT_X11_ICE_LIBRARY)
+ IF(X11_SM_LIB AND X11_ICE_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_SM_LIB} ${X11_ICE_LIB})
+ ENDIF(X11_SM_LIB AND X11_ICE_LIB)
ENDIF(QT_QCONFIG MATCHES "x11sm")
## Xi
IF(QT_QCONFIG MATCHES "tablet")
- FIND_LIBRARY(QT_XI_LIBRARY NAMES Xi PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XI_LIBRARY)
- IF(QT_XI_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XI_LIBRARY})
- ENDIF(QT_XI_LIBRARY)
+ IF(X11_Xi_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xi_LIB})
+ ENDIF(X11_Xi_LIB)
ENDIF(QT_QCONFIG MATCHES "tablet")
## Xrender
IF(QT_QCONFIG MATCHES "xrender")
- FIND_LIBRARY(QT_XRENDER_LIBRARY NAMES Xrender PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XRENDER_LIBRARY)
- IF(QT_XRENDER_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRENDER_LIBRARY})
- ENDIF(QT_XRENDER_LIBRARY)
+ IF(X11_Xrender_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrender_LIB})
+ ENDIF(X11_Xrender_LIB)
ENDIF(QT_QCONFIG MATCHES "xrender")
## Xrandr
IF(QT_QCONFIG MATCHES "xrandr")
- FIND_LIBRARY(QT_XRANDR_LIBRARY NAMES Xrandr PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XRANDR_LIBRARY)
- IF(QT_XRANDR_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRANDR_LIBRARY})
- ENDIF(QT_XRANDR_LIBRARY)
+ IF(X11_Xrandr_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xrandr_LIB})
+ ENDIF(X11_Xrandr_LIB)
ENDIF(QT_QCONFIG MATCHES "xrandr")
## Xcursor
IF(QT_QCONFIG MATCHES "xcursor")
- FIND_LIBRARY(QT_XCURSOR_LIBRARY NAMES Xcursor PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XCURSOR_LIBRARY)
- IF(QT_XCURSOR_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XCURSOR_LIBRARY})
- ENDIF(QT_XCURSOR_LIBRARY)
+ IF(X11_Xcursor_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xcursor_LIB})
+ ENDIF(X11_Xcursor_LIB)
ENDIF(QT_QCONFIG MATCHES "xcursor")
## Xinerama
IF(QT_QCONFIG MATCHES "xinerama")
- FIND_LIBRARY(QT_XINERAMA_LIBRARY NAMES Xinerama PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XINERAMA_LIBRARY)
- IF(QT_XINERAMA_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XINERAMA_LIBRARY})
- ENDIF(QT_XINERAMA_LIBRARY)
+ IF(X11_Xinerama_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xinerama_LIB})
+ ENDIF(X11_Xinerama_LIB)
ENDIF(QT_QCONFIG MATCHES "xinerama")
## Xfixes
IF(QT_QCONFIG MATCHES "xfixes")
- FIND_LIBRARY(QT_XFIXES_LIBRARY NAMES Xfixes PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(QT_XFIXES_LIBRARY)
- IF(QT_XFIXES_LIBRARY)
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XFIXES_LIBRARY})
- ENDIF(QT_XFIXES_LIBRARY)
+ IF(X11_Xfixes_LIB)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xfixes_LIB})
+ ENDIF(X11_Xfixes_LIB)
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)
@@ -190,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")
@@ -221,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")
@@ -251,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}
@@ -283,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}
@@ -327,24 +240,16 @@ ENDIF(QT_QCONFIG MATCHES "clock-monotonic")
IF(Q_WS_X11)
- # X11 libraries Qt absolutely depends on
- QT_QUERY_QMAKE(QT_LIBS_X11 "QMAKE_LIBS_X11")
- SEPARATE_ARGUMENTS(QT_LIBS_X11)
- FOREACH(QT_X11_LIB ${QT_LIBS_X11})
- STRING(REGEX REPLACE "-l" "" QT_X11_LIB "${QT_X11_LIB}")
- SET(QT_TMP_STR "QT_X11_${QT_X11_LIB}_LIBRARY")
- FIND_LIBRARY(${QT_TMP_STR} NAMES "${QT_X11_LIB}" PATHS ${QMAKE_LIBDIR_X11})
- MARK_AS_ADVANCED(${QT_TMP_STR})
- IF(${QT_TMP_STR})
- SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${${QT_TMP_STR}})
- ENDIF(${QT_TMP_STR})
- ENDFOREACH(QT_X11_LIB)
-
- QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
- SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
-
- QT_QUERY_QMAKE(QMAKE_LIBS_DYNLOAD "QMAKE_LIBS_DYNLOAD")
- SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QMAKE_LIBS_DYNLOAD})
+ # X11 libraries Qt always depends on
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
+
+ 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})
ENDIF(Q_WS_X11)
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index baa0571..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)
@@ -65,11 +65,12 @@ SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTWEBKIT QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTXML QTOPENGL QTGUI QTNETWORK QTCORE)
+SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
# Qt modules (in order of dependence)
FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
- QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
- QTWEBKIT PHONON QTSCRIPTTOOLS QTGUI QTTEST QTDBUS QTXML QTSQL
+ QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
+ QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTGUI QTTEST QTDBUS QTXML QTSQL
QTXMLPATTERNS QTNETWORK QTCORE)
IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
diff --git a/Modules/readme.txt b/Modules/readme.txt
index a292e20..dd52000 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -8,16 +8,16 @@ We would like all FindXXX.cmake files to produce consistent variable names.
Please use the following consistent variable names for general use.
XXX_INCLUDE_DIRS The final set of include directories listed in one variable for use by client code. This should not be a cache entry.
-XXX_LIBRARIES The libraries to link against to use XXX. These should include full paths. This should not be a cache entry.
-XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include <jpeg.h>
-XXX_EXECUTABLE Where to find the XXX tool.
-XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX.
+XXX_LIBRARIES The libraries to link against to use XXX. These should include full paths. This should not be a cache entry.
+XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG)that a client source-code file uses to decide whether to #include <jpeg.h>
+XXX_EXECUTABLE Where to find the XXX tool.
+XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX.
XXX_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry.
-XXX_ROOT_DIR Where to find the base directory of XXX.
-XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true.
-XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
-XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
-XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
+XXX_ROOT_DIR Where to find the base directory of XXX.
+XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true.
+XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
+XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
+XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.
The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.
This should not be a cache entry.
@@ -30,9 +30,9 @@ You do not have to provide all of the above variables. You should provide XXX_FO
The following names should not usually be used in CMakeLists.txt files, but they may be usefully modified in users' CMake Caches to control stuff.
-XXX_LIBRARY Name of XXX Library. A User may set this and XXX_INCLUDE_DIR to ignore to force non-use of XXX.
-XXX_YY_LIBRARY Name of YY library that is part of the XXX system. It may or may not be required to use XXX.
-XXX_INCLUDE_DIR Where to find xxx.h, etc. (XXX_INCLUDE_PATH was considered bad because a path includes an actual filename.)
+XXX_LIBRARY Name of XXX Library. A User may set this and XXX_INCLUDE_DIR to ignore to force non-use of XXX.
+XXX_YY_LIBRARY Name of YY library that is part of the XXX system. It may or may not be required to use XXX.
+XXX_INCLUDE_DIR Where to find xxx.h, etc. (XXX_INCLUDE_PATH was considered bad because a path includes an actual filename.)
XXX_YY_INCLUDE_DIR Where to find xxx_yy.h, etc.
For tidiness's sake, try to keep as many options as possible out of the cache, leaving at least one option which can be used to disable use of the module, or locate a not-found library (e.g. XXX_ROOT_DIR). For the same reason, mark most cache options as advanced.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 49cbda7..b098da1 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
@@ -349,7 +350,7 @@ ENDIF(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW)
# CTestLib
#
INCLUDE_DIRECTORIES(
- "${CMAKE_SOURCE_DIR}/Source/CTest"
+ "${CMake_SOURCE_DIR}/Source/CTest"
${CMAKE_XMLRPC_INCLUDES}
${CMAKE_CURL_INCLUDES}
)
@@ -366,6 +367,7 @@ SET(CTEST_SRCS cmCTest.cxx
CTest/cmCTestConfigureHandler.cxx
CTest/cmCTestCoverageCommand.cxx
CTest/cmCTestCoverageHandler.cxx
+ CTest/cmParsePHPCoverage.cxx
CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
CTest/cmCTestGenericHandler.cxx
CTest/cmCTestHandlerCommand.cxx
@@ -491,8 +493,8 @@ IF(BUILD_QtDialog)
SUBDIRS(QtDialog)
ENDIF(BUILD_QtDialog)
-INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
-INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+INCLUDE (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
+INCLUDE (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL)
INSTALL_TARGETS(/bin cmake)
INSTALL_TARGETS(/bin ctest)
@@ -502,4 +504,3 @@ IF(APPLE)
ENDIF(APPLE)
INSTALL_FILES(${CMAKE_DATA_DIR}/include cmCPluginAPI.h)
-
diff --git a/Source/CMakeVersionSource.cmake b/Source/CMakeVersionSource.cmake
new file mode 100644
index 0000000..05e265c
--- /dev/null
+++ b/Source/CMakeVersionSource.cmake
@@ -0,0 +1,37 @@
+# Try to identify the current development source version.
+set(CMake_VERSION_SOURCE "")
+if(EXISTS ${CMake_SOURCE_DIR}/.git/HEAD)
+ find_program(GIT_EXECUTABLE NAMES git git.cmd)
+ mark_as_advanced(GIT_EXECUTABLE)
+ if(GIT_EXECUTABLE)
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --verify -q --short=4 HEAD
+ OUTPUT_VARIABLE head
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ )
+ if(head)
+ set(CMake_VERSION_SOURCE "g${head}")
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ )
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
+ OUTPUT_VARIABLE dirty
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ )
+ if(dirty)
+ set(CMake_VERSION_SOURCE "${CMake_VERSION_SOURCE}-dirty")
+ endif()
+ endif()
+ endif()
+elseif(EXISTS ${CMake_SOURCE_DIR}/CVS/Repository)
+ file(READ ${CMake_SOURCE_DIR}/CVS/Repository repo)
+ set(branch "")
+ if("${repo}" MATCHES "\\.git/")
+ string(REGEX REPLACE ".*\\.git/([^\r\n]*).*" "-\\1" branch "${repo}")
+ endif()
+ set(CMake_VERSION_SOURCE "cvs${branch}")
+endif()
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 9c77cc1..a8fed1d 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -87,10 +87,12 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
// optional entries
const char* debian_pkg_dep = this->GetOption("CPACK_DEBIAN_PACKAGE_DEPENDS");
- const char* debian_pkg_rec =
+ const char* debian_pkg_rec =
this->GetOption("CPACK_DEBIAN_PACKAGE_RECOMMENDS");
- const char* debian_pkg_sug =
+ const char* debian_pkg_sug =
this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS");
+ const char* debian_pkg_url =
+ this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE");
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(ctlfilename.c_str());
@@ -111,6 +113,10 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
{
out << "Suggests: " << debian_pkg_sug << "\n";
}
+ if(debian_pkg_url)
+ {
+ out << "Homepage: " << debian_pkg_url << "\n";
+ }
unsigned long totalSize = 0;
{
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
@@ -121,7 +127,7 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName,
totalSize += cmSystemTools::FileLength(fileIt->c_str());
}
}
- out << "Installed-Size: " << totalSize << "\n";
+ out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n";
out << "Maintainer: " << maintainer << "\n";
out << "Description: " << desc << "\n";
out << std::endl;
@@ -135,7 +141,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 +377,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 +437,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 +447,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/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 6224b40..4a4b428 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -789,7 +789,7 @@ int cmCPackGenerator::DoPackage()
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: "
<< toplevelDirectory << std::endl);
- if ( !cmSystemTools::RemoveADirectory(toplevelDirectory) )
+ if ( !cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem removing toplevel directory: "
@@ -1084,7 +1084,7 @@ int cmCPackGenerator::CleanTemporaryDirectory()
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Clean temporary : "
<< tempInstallDirectory << std::endl);
- if(!cmsys::SystemTools::RemoveADirectory(tempInstallDirectory))
+ if(!cmSystemTools::RepeatedRemoveDirectory(tempInstallDirectory))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem removing temporary directory: " <<
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/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 243d9c9..9163af81 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -203,7 +203,7 @@ int main (int argc, char *argv[])
if ( verbose )
{
log.SetVerbose(verbose);
- cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbse" << std::endl);
+ cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbose" << std::endl);
}
if ( debug )
{
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 55b8d5b..36302df 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -292,7 +292,7 @@ private:
if(this->EmailRegex.find(this->Rev.Author))
{
this->Rev.Author = this->EmailRegex.match(1);
- //email = email_regex.match(2);
+ this->Rev.EMail = this->EmailRegex.match(2);
}
}
else if(strcmp(name, "timestamp") == 0 && !this->CData.empty())
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 a125459..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"))
@@ -551,6 +566,7 @@ class cmCTestBuildHandler::FragmentCompare
{
public:
FragmentCompare(cmFileTimeComparison* ftc): FTC(ftc) {}
+ FragmentCompare(): FTC(0) {}
bool operator()(std::string const& l, std::string const& r)
{
// Order files by modification time. Use lexicographic order
@@ -958,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);
@@ -1170,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 1076886..6863adc 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -10,6 +10,7 @@
See the License for more information.
============================================================================*/
#include "cmCTestCoverageHandler.h"
+#include "cmParsePHPCoverage.h"
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
@@ -126,20 +127,6 @@ private:
//----------------------------------------------------------------------
-//**********************************************************************
-class cmCTestCoverageHandlerContainer
-{
-public:
- int Error;
- std::string SourceDir;
- std::string BinaryDir;
- typedef std::vector<int> SingleFileCoverageVector;
- typedef std::map<std::string, SingleFileCoverageVector> TotalCoverageMap;
- TotalCoverageMap TotalCoverage;
- std::ostream* OFS;
-};
-//**********************************************************************
-//----------------------------------------------------------------------
//----------------------------------------------------------------------
cmCTestCoverageHandler::cmCTestCoverageHandler()
@@ -380,7 +367,6 @@ int cmCTestCoverageHandler::ProcessHandler()
cmsys::RegularExpression(rexIt->c_str()));
}
-
if(this->HandleBullseyeCoverage(&cont))
{
return cont.Error;
@@ -396,8 +382,14 @@ int cmCTestCoverageHandler::ProcessHandler()
{
return error;
}
+ file_count += this->HandlePHPCoverage(&cont);
+ if ( file_count < 0 )
+ {
+ return error;
+ }
error = cont.Error;
+ std::set<std::string> uncovered = this->FindUncoveredFiles(&cont);
if ( file_count == 0 )
{
@@ -437,7 +429,7 @@ int cmCTestCoverageHandler::ProcessHandler()
//std::string fullBinaryDir = binaryDir + "/";
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl);
cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " Acumulating results (each . represents one file):" << std::endl);
+ " Accumulating results (each . represents one file):" << std::endl);
cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
std::vector<std::string> errorsWhileAccumulating;
@@ -516,7 +508,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cmCTestCoverageHandlerContainer::SingleFileCoverageVector::size_type cc;
std::string line;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Actually perfoming coverage for: " << fullFileName << std::endl);
+ "Actually performing coverage for: " << fullFileName << std::endl);
for ( cc= 0; cc < fcov.size(); cc ++ )
{
if ( !cmSystemTools::GetLineFromStream(ifs, line) &&
@@ -524,7 +516,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{
cmOStringStream ostr;
ostr << "Problem reading source file: " << fullFileName.c_str()
- << " line:" << cc;
+ << " line:" << cc << " out total: " << fcov.size()-1;
errorsWhileAccumulating.push_back(ostr.str());
error ++;
break;
@@ -577,13 +569,58 @@ int cmCTestCoverageHandler::ProcessHandler()
this->WriteXMLLabels(covSumFile, shortFileName);
covSumFile << "\t</File>" << std::endl;
}
+
+ //Handle all the files in the extra coverage globs that have no cov data
+ for(std::set<std::string>::iterator i = uncovered.begin();
+ i != uncovered.end(); ++i)
+ {
+ std::string fileName = cmSystemTools::GetFilenameName(*i);
+ std::string fullPath = cont.SourceDir + "/" + *i;
+
+ covLogFile << "\t<File Name=\"" << cmXMLSafe(fileName)
+ << "\" FullPath=\"" << cmXMLSafe(*i) << "\">\n"
+ << "\t\t<Report>" << std::endl;
+
+ std::ifstream ifs(fullPath.c_str());
+ if (!ifs)
+ {
+ cmOStringStream ostr;
+ ostr << "Cannot open source file: " << fullPath.c_str();
+ errorsWhileAccumulating.push_back(ostr.str());
+ error ++;
+ continue;
+ }
+ int untested = 0;
+ std::string line;
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Actually performing coverage for: " << i->c_str() << std::endl);
+ while (cmSystemTools::GetLineFromStream(ifs, line))
+ {
+ covLogFile << "\t\t<Line Number=\"" << untested << "\" Count=\"0\">"
+ << cmXMLSafe(line) << "</Line>" << std::endl;
+ untested ++;
+ }
+ covLogFile << "\t\t</Report>\n\t</File>" << std::endl;
+
+ total_untested += untested;
+ covSumFile << "\t<File Name=\"" << cmXMLSafe(fileName)
+ << "\" FullPath=\"" << cmXMLSafe(i->c_str())
+ << "\" Covered=\"true\">\n"
+ << "\t\t<LOCTested>0</LOCTested>\n"
+ << "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
+ << "\t\t<PercentCoverage>0</PercentCoverage>\n"
+ << "\t\t<CoverageMetric>0</CoverageMetric>\n";
+ this->WriteXMLLabels(covSumFile, *i);
+ covSumFile << "\t</File>" << std::endl;
+ }
+
this->EndCoverageLogFile(covLogFile, logFileCount);
if ( errorsWhileAccumulating.size() > 0 )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Error(s) while acumulating results:" << std::endl);
+ "Error(s) while accumulating results:" << std::endl);
std::vector<std::string>::iterator erIt;
for ( erIt = errorsWhileAccumulating.begin();
erIt != errorsWhileAccumulating.end();
@@ -654,6 +691,8 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
" Add coverage exclude regular expressions." << std::endl);
this->CTest->PopulateCustomVector(mf, "CTEST_CUSTOM_COVERAGE_EXCLUDE",
this->CustomCoverageExclude);
+ this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB",
+ this->ExtraCoverageGlobs);
std::vector<cmStdString>::iterator it;
for ( it = this->CustomCoverageExclude.begin();
it != this->CustomCoverageExclude.end();
@@ -662,6 +701,12 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage exclude: "
<< it->c_str() << std::endl);
}
+ for ( it = this->ExtraCoverageGlobs.begin();
+ it != this->ExtraCoverageGlobs.end(); ++it)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage glob: "
+ << it->c_str() << std::endl);
+ }
}
//----------------------------------------------------------------------
@@ -695,6 +740,18 @@ bool IsFileInDir(const std::string &infile, const std::string &indir)
}
//----------------------------------------------------------------------
+int cmCTestCoverageHandler::HandlePHPCoverage(
+ cmCTestCoverageHandlerContainer* cont)
+{
+ cmParsePHPCoverage cov(*cont, this->CTest);
+ std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage";
+ if(cmSystemTools::FileIsDirectory(coverageDir.c_str()))
+ {
+ cov.ReadPHPCoverageDirectory(coverageDir.c_str());
+ }
+ return static_cast<int>(cont->TotalCoverage.size());
+}
+//----------------------------------------------------------------------
int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestCoverageHandlerContainer* cont)
{
@@ -1703,6 +1760,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
<< "</ElapsedMinutes>"
<< "</Coverage>" << std::endl;
this->CTest->EndXML(covSumFile);
+
// Now create the coverage information for each file
return this->RunBullseyeCoverageBranch(cont,
coveredFileNames,
@@ -1961,3 +2019,43 @@ bool cmCTestCoverageHandler::IsFilteredOut(std::string const& source)
}
return true;
}
+
+//----------------------------------------------------------------------
+std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
+ cmCTestCoverageHandlerContainer* cont)
+{
+ std::set<std::string> extraMatches;
+
+ for(std::vector<cmStdString>::iterator i = this->ExtraCoverageGlobs.begin();
+ i != this->ExtraCoverageGlobs.end(); ++i)
+ {
+ cmsys::Glob gl;
+ gl.RecurseOn();
+ gl.RecurseThroughSymlinksOff();
+ std::string glob = cont->SourceDir + "/" + *i;
+ gl.FindFiles(glob);
+ std::vector<std::string> files = gl.GetFiles();
+ for(std::vector<std::string>::iterator f = files.begin();
+ f != files.end(); ++f)
+ {
+ if(this->ShouldIDoCoverage(f->c_str(),
+ cont->SourceDir.c_str(), cont->BinaryDir.c_str()))
+ {
+ extraMatches.insert(this->CTest->GetShortPathToFile(
+ f->c_str()));
+ }
+ }
+ }
+
+ if(extraMatches.size())
+ {
+ for(cmCTestCoverageHandlerContainer::TotalCoverageMap::iterator i =
+ cont->TotalCoverage.begin(); i != cont->TotalCoverage.end(); ++i)
+ {
+ std::string shortPath = this->CTest->GetShortPathToFile(
+ i->first.c_str());
+ extraMatches.erase(shortPath);
+ }
+ }
+ return extraMatches;
+}
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index b3e4db6..d3e8503 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -20,8 +20,17 @@
#include <cmsys/RegularExpression.hxx>
class cmGeneratedFileStream;
-class cmCTestCoverageHandlerContainer;
-
+class cmCTestCoverageHandlerContainer
+{
+public:
+ int Error;
+ std::string SourceDir;
+ std::string BinaryDir;
+ typedef std::vector<int> SingleFileCoverageVector;
+ typedef std::map<std::string, SingleFileCoverageVector> TotalCoverageMap;
+ TotalCoverageMap TotalCoverage;
+ std::ostream* OFS;
+};
/** \class cmCTestCoverageHandler
* \brief A class that handles coverage computaiton for ctest
*
@@ -59,6 +68,9 @@ private:
int HandleGCovCoverage(cmCTestCoverageHandlerContainer* cont);
void FindGCovFiles(std::vector<std::string>& files);
+ //! Handle coverage using xdebug php coverage
+ int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont);
+
//! Handle coverage using Bullseye
int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont);
int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont);
@@ -66,6 +78,7 @@ private:
std::set<cmStdString>& coveredFileNames,
std::vector<std::string>& files,
std::vector<std::string>& filesFullPath);
+
int RunBullseyeCommand(
cmCTestCoverageHandlerContainer* cont,
const char* cmd,
@@ -91,52 +104,12 @@ private:
std::string FindFile(cmCTestCoverageHandlerContainer* cont,
std::string fileName);
- struct cmCTestCoverage
- {
- cmCTestCoverage()
- {
- this->AbsolutePath = "";
- this->FullPath = "";
- this->Covered = false;
- this->Tested = 0;
- this->UnTested = 0;
- this->Lines.clear();
- this->Show = false;
- }
- cmCTestCoverage(const cmCTestCoverage& rhs) :
- AbsolutePath(rhs.AbsolutePath),
- FullPath(rhs.FullPath),
- Covered(rhs.Covered),
- Tested(rhs.Tested),
- UnTested(rhs.UnTested),
- Lines(rhs.Lines),
- Show(rhs.Show)
- {
- }
- cmCTestCoverage& operator=(const cmCTestCoverage& rhs)
- {
- this->AbsolutePath = rhs.AbsolutePath;
- this->FullPath = rhs.FullPath;
- this->Covered = rhs.Covered;
- this->Tested = rhs.Tested;
- this->UnTested = rhs.UnTested;
- this->Lines = rhs.Lines;
- this->Show = rhs.Show;
- return *this;
- }
- std::string AbsolutePath;
- std::string FullPath;
- bool Covered;
- int Tested;
- int UnTested;
- std::vector<int> Lines;
- bool Show;
- };
-
+ std::set<std::string> FindUncoveredFiles(
+ cmCTestCoverageHandlerContainer* cont);
std::vector<cmStdString> CustomCoverageExclude;
std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex;
+ std::vector<cmStdString> ExtraCoverageGlobs;
- typedef std::map<std::string, cmCTestCoverage> CoverageMap;
// Map from source file to label ids.
class LabelSet: public std::set<int> {};
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 6d5bf65..a6f10ec 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -85,14 +85,83 @@ void cmCTestGIT::NoteNewRevision()
}
//----------------------------------------------------------------------------
-bool cmCTestGIT::UpdateImpl()
+std::string cmCTestGIT::FindGitDir()
+{
+ std::string git_dir;
+
+ // Run "git rev-parse --git-dir" to locate the real .git directory.
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_rev_parse[] = {git, "rev-parse", "--git-dir", 0};
+ std::string git_dir_line;
+ OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
+ OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
+ if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err))
+ {
+ git_dir = git_dir_line;
+ }
+ if(git_dir.empty())
+ {
+ git_dir = ".git";
+ }
+
+ // Git reports a relative path only when the .git directory is in
+ // the current directory.
+ if(git_dir[0] == '.')
+ {
+ git_dir = this->SourceDirectory + "/" + git_dir;
+ }
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ else if(git_dir[0] == '/')
+ {
+ // Cygwin Git reports a full path that Cygwin understands, but we
+ // are a Windows application. Run "cygpath" to get Windows path.
+ std::string cygpath_exe = cmSystemTools::GetFilenamePath(git);
+ cygpath_exe += "/cygpath.exe";
+ if(cmSystemTools::FileExists(cygpath_exe.c_str()))
+ {
+ char const* cygpath[] = {cygpath_exe.c_str(), "-w", git_dir.c_str(), 0};
+ OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line);
+ OutputLogger cygpath_err(this->Log, "cygpath-err> ");
+ if(this->RunChild(cygpath, &cygpath_out, &cygpath_err))
+ {
+ git_dir = git_dir_line;
+ }
+ }
+ }
+#endif
+ return git_dir;
+}
+
+//----------------------------------------------------------------------------
+std::string cmCTestGIT::FindTopDir()
+{
+ std::string top_dir = this->SourceDirectory;
+
+ // Run "git rev-parse --show-cdup" to locate the top of the tree.
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_rev_parse[] = {git, "rev-parse", "--show-cdup", 0};
+ std::string cdup;
+ OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
+ OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
+ if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err) &&
+ !cdup.empty())
+ {
+ top_dir += "/";
+ top_dir += cdup;
+ top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str());
+ }
+ return top_dir;
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestGIT::UpdateByFetchAndReset()
{
- // Use "git pull" to update the working tree.
- std::vector<char const*> git_pull;
- git_pull.push_back(this->CommandLineTool.c_str());
- git_pull.push_back("pull");
+ const char* git = this->CommandLineTool.c_str();
- // 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");
@@ -104,15 +173,101 @@ 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);
+
+ // 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))
+ {
+ return false;
+ }
+
+ // Identify the merge head that would be used by "git pull".
+ std::string sha1;
+ {
+ std::string fetch_head = this->FindGitDir() + "/FETCH_HEAD";
+ std::ifstream fin(fetch_head.c_str(), std::ios::in | std::ios::binary);
+ if(!fin)
+ {
+ this->Log << "Unable to open " << fetch_head << "\n";
+ return false;
+ }
+ std::string line;
+ while(sha1.empty() && cmSystemTools::GetLineFromStream(fin, line))
+ {
+ this->Log << "FETCH_HEAD> " << line << "\n";
+ 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);
+ }
+ }
+ }
+ if(sha1.empty())
+ {
+ this->Log << "FETCH_HEAD has no upstream branch candidate!\n";
+ return false;
+ }
+ }
+
+ // 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 out(this->Log, "pull-out> ");
- OutputLogger err(this->Log, "pull-err> ");
- return this->RunUpdateCommand(&git_pull[0], &out, &err);
+ 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;
+ }
+
+ std::string top_dir = this->FindTopDir();
+ 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,
+ top_dir.c_str());
}
//----------------------------------------------------------------------------
@@ -244,8 +399,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'.
*/
@@ -299,6 +458,11 @@ private:
{
if(this->Line.empty())
{
+ if(this->Section == SectionBody && this->LineEnd == '\0')
+ {
+ // Skip SectionDiff
+ this->NextSection();
+ }
this->NextSection();
}
else
@@ -338,6 +502,7 @@ private:
Person author;
this->ParsePerson(this->Line.c_str()+7, author);
this->Rev.Author = author.Name;
+ this->Rev.EMail = author.EMail;
// Convert the time to a human-readable format that is also easy
// to machine-parse: "CCYY-MM-DD hh:mm:ss".
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index 2561ed4..1765340 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -32,9 +32,17 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
+ std::string FindGitDir();
+ std::string FindTopDir();
+
+ bool UpdateByFetchAndReset();
+ bool UpdateByCustom(std::string const& custom);
+ bool UpdateInternal();
+
void LoadRevisions();
void LoadModifications();
+public: // needed by older Sun compilers
// Parsing helper classes.
class OneLineParser;
class DiffParser;
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index b263677..86a7617 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -220,7 +220,7 @@ private:
}
else if ( strcmp(name, "email") == 0 && !this->CData.empty())
{
- // this->Rev.Email.assign(&this->CData[0], this->CData.size());
+ this->Rev.EMail.assign(&this->CData[0], this->CData.size());
}
else if(strcmp(name, "date") == 0 && !this->CData.empty())
{
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index c1ca9ea..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,17 +473,22 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
for(TestMap::iterator i = this->Tests.begin();
i != this->Tests.end(); ++i)
{
- 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
+ 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->Properties[i->first]->Cost].insert(i->first);
+ this->Properties[i->first]->Cost = FLT_MAX;
}
}
+ if(this->ParallelLevel > 1)
+ {
+ TestComparator comp(this);
+ std::sort(SortedTests.begin(), SortedTests.end(), comp);
+ }
}
//---------------------------------------------------------
@@ -586,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)
@@ -594,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/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index c2cda66..5765150 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -68,7 +68,7 @@ public:
"Runs a script or scripts much like if it was run from ctest -S. "
"If no argument is provided then the current script is run using "
"the current settings of the variables. If NEW_PROCESS is specified "
- "then each script will be run in a seperate process."
+ "then each script will be run in a separate process."
"If RETURN_VALUE is specified the return value of the last script "
"run will be put into var.";
}
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 659cb73..ce44097 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -14,6 +14,7 @@
#include "cmCTestMemCheckHandler.h"
#include "cmCTest.h"
#include "cmSystemTools.h"
+#include "cm_curl.h"
#include <cm_zlib.h>
#include <cmsys/Base64.h>
@@ -22,7 +23,6 @@ cmCTestRunTest::cmCTestRunTest(cmCTestTestHandler* handler)
{
this->CTest = handler->CTest;
this->TestHandler = handler;
- this->ModifyEnv = false;
this->TestProcess = 0;
this->TestResult.ExecutionTime =0;
this->TestResult.ReturnValue = 0;
@@ -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;
@@ -138,11 +140,6 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
this->CompressOutput();
}
- //restore the old environment
- if (this->ModifyEnv)
- {
- cmSystemTools::RestoreEnv(this->OrigEnv);
- }
this->WriteLogOutputTop(completed, total);
std::string reason;
bool passed = true;
@@ -225,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");
@@ -346,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++;
}
}
@@ -441,8 +439,13 @@ bool cmCTestRunTest::StartTest(size_t total)
}
this->StartTime = this->CTest->CurrentTime();
- return this->CreateProcess(this->TestProperties->Timeout,
- &this->TestProperties->Environment);
+ double timeout = this->ResolveTimeout();
+
+ if(this->StopTimePassed)
+ {
+ return false;
+ }
+ return this->ForkProcess(timeout, &this->TestProperties->Environment);
}
//----------------------------------------------------------------------
@@ -518,7 +521,72 @@ void cmCTestRunTest::DartProcessing()
}
//----------------------------------------------------------------------
-bool cmCTestRunTest::CreateProcess(double testTimeOut,
+double cmCTestRunTest::ResolveTimeout()
+{
+ double timeout = this->TestProperties->Timeout;
+
+ if(this->CTest->GetStopTime() == "")
+ {
+ return timeout;
+ }
+ struct tm* lctime;
+ time_t current_time = time(0);
+ lctime = gmtime(&current_time);
+ int gm_hour = lctime->tm_hour;
+ time_t gm_time = mktime(lctime);
+ lctime = localtime(&current_time);
+ int local_hour = lctime->tm_hour;
+
+ int tzone_offset = local_hour - gm_hour;
+ if(gm_time > current_time && gm_hour < local_hour)
+ {
+ // this means gm_time is on the next day
+ tzone_offset -= 24;
+ }
+ else if(gm_time < current_time && gm_hour > local_hour)
+ {
+ // this means gm_time is on the previous day
+ tzone_offset += 24;
+ }
+
+ tzone_offset *= 100;
+ char buf[1024];
+ // add todays year day and month to the time in str because
+ // curl_getdate no longer assumes the day is today
+ sprintf(buf, "%d%02d%02d %s %+05i",
+ lctime->tm_year + 1900,
+ lctime->tm_mon + 1,
+ lctime->tm_mday,
+ this->CTest->GetStopTime().c_str(),
+ tzone_offset);
+
+ time_t stop_time = curl_getdate(buf, &current_time);
+ if(stop_time == -1)
+ {
+ return timeout;
+ }
+
+ //the stop time refers to the next day
+ if(this->CTest->NextDayStopTime)
+ {
+ stop_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. "
+ "Stopping all tests." << std::endl);
+ this->StopTimePassed = true;
+ return 0;
+ }
+ return timeout == 0 ? stop_timeout :
+ (timeout < stop_timeout ? timeout : stop_timeout);
+}
+
+//----------------------------------------------------------------------
+bool cmCTestRunTest::ForkProcess(double testTimeOut,
std::vector<std::string>* environment)
{
this->TestProcess = new cmProcess;
@@ -528,9 +596,6 @@ bool cmCTestRunTest::CreateProcess(double testTimeOut,
this->TestProcess->SetCommand(this->ActualCommand.c_str());
this->TestProcess->SetCommandArguments(this->Arguments);
- std::vector<std::string> origEnv;
- this->ModifyEnv = (environment && environment->size()>0);
-
// determine how much time we have
double timeout = this->CTest->GetRemainingTimeAllowed() - 120;
if (this->CTest->GetTimeOut() > 0 && this->CTest->GetTimeOut() < timeout)
@@ -553,9 +618,13 @@ bool cmCTestRunTest::CreateProcess(double testTimeOut,
this->TestProcess->SetTimeout(timeout);
- if (this->ModifyEnv)
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ cmSystemTools::SaveRestoreEnvironment sre;
+#endif
+
+ if (environment && environment->size()>0)
{
- this->OrigEnv = cmSystemTools::AppendEnv(environment);
+ cmSystemTools::AppendEnv(environment);
}
return this->TestProcess->StartProcess();
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 1e4c1cc..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; }
@@ -59,7 +61,9 @@ public:
private:
void DartProcessing();
void ExeNotFound(std::string exe);
- bool CreateProcess(double testTimeOut,
+ // Figures out a final timeout which is min(STOP_TIME, NOW+TIMEOUT)
+ double ResolveTimeout();
+ bool ForkProcess(double testTimeOut,
std::vector<std::string>* environment);
void WriteLogOutputTop(size_t completed, size_t total);
//Run post processing of the process output for MemCheck
@@ -75,14 +79,9 @@ private:
//if this option is set to false.)
//bool OptimizeForCTest;
- //flag for whether the env was modified for this run
- bool ModifyEnv;
-
bool UsePrefixCommand;
std::string PrefixCommand;
- //stores the original environment if we are modifying it
- std::vector<std::string> OrigEnv;
std::string ProcessOutput;
std::string CompressedOutput;
double CompressionRatio;
@@ -93,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/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index d1226da..24974e3 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -147,6 +147,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
static_cast<cmCTestSubmitHandler*>(handler)->SelectParts(this->Parts);
}
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("RetryDelay",
+ this->RetryDelay.c_str());
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("RetryCount",
+ this->RetryCount.c_str());
+ static_cast<cmCTestSubmitHandler*>(handler)->SetOption("InternalTest",
+ this->InternalTest ? "ON" : "OFF");
+
return handler;
}
@@ -169,6 +176,24 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
return true;
}
+ if(arg == "RETRY_COUNT")
+ {
+ this->ArgumentDoing = ArgumentDoingRetryCount;
+ return true;
+ }
+
+ if(arg == "RETRY_DELAY")
+ {
+ this->ArgumentDoing = ArgumentDoingRetryDelay;
+ return true;
+ }
+
+ if(arg == "INTERNAL_TEST_CHECKSUM")
+ {
+ this->InternalTest = true;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentKeyword(arg);
}
@@ -213,6 +238,18 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
return true;
}
+ if(this->ArgumentDoing == ArgumentDoingRetryCount)
+ {
+ this->RetryCount = arg;
+ return true;
+ }
+
+ if(this->ArgumentDoing == ArgumentDoingRetryDelay)
+ {
+ this->RetryDelay = arg;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentValue(arg);
}
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index ccaef7e..edc9c65 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -29,6 +29,9 @@ public:
{
this->PartsMentioned = false;
this->FilesMentioned = false;
+ this->InternalTest = false;
+ this->RetryCount = "";
+ this->RetryDelay = "";
}
/**
@@ -61,7 +64,8 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " ctest_submit([PARTS ...] [FILES ...] [RETURN_VALUE res])\n"
+ " ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] "
+ " [RETRY_DELAY delay][RETURN_VALUE res])\n"
"By default all available parts are submitted if no PARTS or FILES "
"are specified. "
"The PARTS option lists a subset of parts to be submitted. "
@@ -77,7 +81,11 @@ public:
" ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES\n"
" Submit = nothing\n"
"The FILES option explicitly lists specific files to be submitted. "
- "Each individual file must exist at the time of the call.\n";
+ "Each individual file must exist at the time of the call.\n"
+ "The RETRY_DELAY option specifies how long in seconds to wait after "
+ "a timed-out submission before attempting to re-submit.\n"
+ "The RETRY_COUNT option specifies how many times to retry a timed-out "
+ "submission.\n";
}
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
@@ -92,13 +100,18 @@ protected:
{
ArgumentDoingParts = Superclass::ArgumentDoingLast1,
ArgumentDoingFiles,
+ ArgumentDoingRetryDelay,
+ ArgumentDoingRetryCount,
ArgumentDoingLast2
};
bool PartsMentioned;
std::set<cmCTest::Part> Parts;
bool FilesMentioned;
+ bool InternalTest;
cmCTest::SetOfStrings Files;
+ std::string RetryCount;
+ std::string RetryDelay;
};
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 7b4f38b..9f9f85a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -15,6 +15,7 @@
#include "cmVersion.h"
#include "cmGeneratedFileStream.h"
#include "cmCTest.h"
+#include "cmXMLParser.h"
#include <cmsys/Process.h>
#include <cmsys/Base64.h>
@@ -31,6 +32,90 @@
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
+//----------------------------------------------------------------------------
+class cmCTestSubmitHandler::ResponseParser: public cmXMLParser
+{
+public:
+ ResponseParser() { this->Status = STATUS_OK; }
+ ~ResponseParser() {}
+
+public:
+
+ enum StatusType
+ {
+ STATUS_OK,
+ STATUS_WARNING,
+ STATUS_ERROR
+ };
+
+ StatusType Status;
+ std::string CDashVersion;
+ std::string Filename;
+ std::string MD5;
+ std::string Message;
+
+private:
+
+ std::vector<char> CurrentValue;
+
+ std::string GetCurrentValue()
+ {
+ std::string val;
+ if(this->CurrentValue.size())
+ {
+ val.assign(&this->CurrentValue[0], this->CurrentValue.size());
+ }
+ return val;
+ }
+
+ virtual void StartElement(const char* name, const char** atts)
+ {
+ this->CurrentValue.clear();
+ if(strcmp(name, "cdash") == 0)
+ {
+ this->CDashVersion = this->FindAttribute(atts, "version");
+ }
+ }
+
+ virtual void CharacterDataHandler(const char* data, int length)
+ {
+ this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
+ }
+
+ virtual void EndElement(const char* name)
+ {
+ if(strcmp(name, "status") == 0)
+ {
+ std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
+ if(status == "OK" || status == "SUCCESS")
+ {
+ this->Status = STATUS_OK;
+ }
+ else if(status == "WARNING")
+ {
+ this->Status = STATUS_WARNING;
+ }
+ else
+ {
+ this->Status = STATUS_ERROR;
+ }
+ }
+ else if(strcmp(name, "filename") == 0)
+ {
+ this->Filename = this->GetCurrentValue();
+ }
+ else if(strcmp(name, "md5") == 0)
+ {
+ this->MD5 = this->GetCurrentValue();
+ }
+ else if(strcmp(name, "message") == 0)
+ {
+ this->Message = this->GetCurrentValue();
+ }
+ }
+};
+
+
static size_t
cmCTestSubmitHandlerWriteMemoryCallback(void *ptr, size_t size, size_t nmemb,
void *data)
@@ -367,6 +452,20 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
+ "FileName=" + ofile;
+ upload_as += "&MD5=";
+
+ if(cmSystemTools::IsOn(this->GetOption("InternalTest")))
+ {
+ upload_as += "bad_md5sum";
+ }
+ else
+ {
+ char md5[33];
+ cmSystemTools::ComputeFileMD5(local_file.c_str(), md5);
+ md5[32] = 0;
+ upload_as += md5;
+ }
+
struct stat st;
if ( ::stat(local_file.c_str(), &st) )
{
@@ -382,7 +481,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
<< local_file.c_str() << " to "
<< upload_as.c_str() << " Size: " << st.st_size << std::endl);
-
// specify target
::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str());
@@ -411,6 +509,19 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
+ if(cmSystemTools::IsOn(this->GetOption("InternalTest")) &&
+ cmSystemTools::VersionCompare(cmSystemTools::OP_LESS,
+ this->CTest->GetCDashVersion().c_str(), "1.7"))
+ {
+ // mock failure output for internal test case
+ std::string mock_output = "<cdash version=\"1.7.0\">\n"
+ " <status>ERROR</status>\n"
+ " <message>Checksum failed for file.</message>\n"
+ "</cdash>\n";
+ chunk.clear();
+ chunk.assign(mock_output.begin(), mock_output.end());
+ }
+
if ( chunk.size() > 0 )
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
@@ -425,6 +536,60 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
<< std::endl);
}
+ // If curl failed for any reason, or checksum fails, wait and retry
+ //
+ if(res != CURLE_OK || this->HasErrors)
+ {
+ std::string retryDelay = this->GetOption("RetryDelay") == NULL ?
+ "" : this->GetOption("RetryDelay");
+ std::string retryCount = this->GetOption("RetryCount") == NULL ?
+ "" : this->GetOption("RetryCount");
+
+ int delay = retryDelay == "" ? atoi(this->CTest->GetCTestConfiguration(
+ "CTestSubmitRetryDelay").c_str()) : atoi(retryDelay.c_str());
+ int count = retryCount == "" ? atoi(this->CTest->GetCTestConfiguration(
+ "CTestSubmitRetryCount").c_str()) : atoi(retryCount.c_str());
+
+ for(int i = 0; i < count; i++)
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Submit failed, waiting " << delay << " seconds...\n");
+
+ double stop = cmSystemTools::GetTime() + delay;
+ while(cmSystemTools::GetTime() < stop)
+ {
+ cmSystemTools::Delay(100);
+ }
+
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Retry submission: Attempt " << (i + 1) << " of "
+ << count << std::endl);
+
+ ::fclose(ftpfile);
+ ftpfile = ::fopen(local_file.c_str(), "rb");
+ ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile);
+
+ chunk.clear();
+ chunkDebug.clear();
+ this->HasErrors = false;
+
+ res = ::curl_easy_perform(curl);
+
+ if ( chunk.size() > 0 )
+ {
+ cmCTestLog(this->CTest, DEBUG, "CURL output: ["
+ << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
+ << std::endl);
+ this->ParseResponse(chunk);
+ }
+
+ if(res == CURLE_OK && !this->HasErrors)
+ {
+ break;
+ }
+ }
+ }
+
fclose(ftpfile);
if ( res )
{
@@ -467,14 +632,22 @@ void cmCTestSubmitHandler
::ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk)
{
std::string output = "";
+ output.append(chunk.begin(), chunk.end());
- for(cmCTestSubmitHandlerVectorOfChar::iterator i = chunk.begin();
- i != chunk.end(); ++i)
+ if(output.find("<cdash") != output.npos)
{
- output += *i;
+ ResponseParser parser;
+ parser.Parse(output.c_str());
+
+ if(parser.Status != ResponseParser::STATUS_OK)
+ {
+ this->HasErrors = true;
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission failed: " <<
+ parser.Message << std::endl);
+ return;
+ }
}
output = cmSystemTools::UpperCase(output);
-
if(output.find("WARNING") != std::string::npos)
{
this->HasWarnings = true;
@@ -483,13 +656,12 @@ void cmCTestSubmitHandler
{
this->HasErrors = true;
}
-
+
if(this->HasWarnings || this->HasErrors)
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Server Response:\n" <<
cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "\n");
}
-
}
//----------------------------------------------------------------------------
@@ -589,7 +761,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
<< turl.c_str() << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
<< error_buffer << std::endl);
- *this->LogFile << "\tTrigerring failed with error: " << error_buffer
+ *this->LogFile << "\tTriggering failed with error: " << error_buffer
<< std::endl
<< " Error message was: " << error_buffer
<< std::endl;
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 8b011ea..e7755b1 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -79,6 +79,7 @@ private:
std::string GetSubmitResultsPrefix();
+ class ResponseParser;
cmStdString HTTPProxy;
int HTTPProxyType;
cmStdString HTTPProxyAuth;
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index b0adf22..5aee035 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -25,6 +25,7 @@ cmCTestTestCommand::cmCTestTestCommand()
this->Arguments[ctt_INCLUDE_LABEL] = "INCLUDE_LABEL";
this->Arguments[ctt_PARALLEL_LEVEL] = "PARALLEL_LEVEL";
this->Arguments[ctt_SCHEDULE_RANDOM] = "SCHEDULE_RANDOM";
+ this->Arguments[ctt_STOP_TIME] = "STOP_TIME";
this->Arguments[ctt_LAST] = 0;
this->Last = ctt_LAST;
}
@@ -98,6 +99,10 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
handler->SetOption("ScheduleRandom",
this->Values[ctt_SCHEDULE_RANDOM]);
}
+ if(this->Values[ctt_STOP_TIME])
+ {
+ this->CTest->SetStopTime(this->Values[ctt_STOP_TIME]);
+ }
return handler;
}
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 12314df..c6fd631 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -62,7 +62,8 @@ public:
" [EXCLUDE_LABEL exclude regex] \n"
" [INCLUDE_LABEL label regex] \n"
" [PARALLEL_LEVEL level] \n"
- " [SCHEDULE_RANDOM on]) \n"
+ " [SCHEDULE_RANDOM on] \n"
+ " [STOP_TIME time of day]) \n"
"Tests the given build directory and stores results in Test.xml. The "
"second argument is a variable that will hold value. Optionally, "
"you can specify the starting test number START, the ending test number "
@@ -73,7 +74,8 @@ public:
"property LABEL. PARALLEL_LEVEL should be set to a positive number "
"representing the number of tests to be run in parallel. "
"SCHEDULE_RANDOM will launch tests in a random order, and is "
- "typically used to detect implicit test dependencies."
+ "typically used to detect implicit test dependencies. STOP_TIME is the "
+ "time of day at which the tests should all stop running."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
@@ -96,6 +98,7 @@ protected:
ctt_INCLUDE_LABEL,
ctt_PARALLEL_LEVEL,
ctt_SCHEDULE_RANDOM,
+ ctt_STOP_TIME,
ctt_LAST
};
};
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/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index f87b37c..9eae3f3 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -306,6 +306,7 @@ int cmCTestUpdateHandler::ProcessHandler()
}
if(!updated)
{
+ os << "Update command failed:\n" << vc->GetUpdateCommandLine();
cmCTestLog(this->CTest, ERROR_MESSAGE, " Update command failed: "
<< vc->GetUpdateCommandLine() << "\n");
}
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 35f567a..f9ad79a 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -227,6 +227,7 @@ void cmCTestVC::WriteXMLEntry(std::ostream& xml,
<< "\t\t\t<FullName>" << cmXMLSafe(full) << "</FullName>\n"
<< "\t\t\t<CheckinDate>" << cmXMLSafe(rev.Date) << "</CheckinDate>\n"
<< "\t\t\t<Author>" << cmXMLSafe(rev.Author) << "</Author>\n"
+ << "\t\t\t<Email>" << cmXMLSafe(rev.EMail) << "</Email>\n"
<< "\t\t\t<Log>" << cmXMLSafe(rev.Log) << "</Log>\n"
<< "\t\t\t<Revision>" << cmXMLSafe(rev.Rev) << "</Revision>\n"
<< "\t\t\t<PriorRevision>" << cmXMLSafe(prior) << "</PriorRevision>\n"
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index e6ea76d..d36bc8f 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -73,6 +73,7 @@ protected:
std::string Rev;
std::string Date;
std::string Author;
+ std::string EMail;
std::string Log;
};
diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx
new file mode 100644
index 0000000..32c1ec1
--- /dev/null
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -0,0 +1,252 @@
+#include "cmStandardIncludes.h"
+#include "cmSystemTools.h"
+#include "cmParsePHPCoverage.h"
+#include <cmsys/Directory.hxx>
+
+/*
+ To setup coverage for php.
+
+ - edit php.ini to add auto prepend and append php files from phpunit
+ auto_prepend_file =
+ auto_append_file =
+ - run the tests
+ - run this program on all the files in c:/tmp
+
+*/
+
+cmParsePHPCoverage::cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont,
+ cmCTest* ctest)
+ :Coverage(cont), CTest(ctest)
+{
+}
+
+bool cmParsePHPCoverage::ReadUntil(std::ifstream& in, char until)
+{
+ char c = 0;
+ while(in.get(c) && c != until)
+ {
+ }
+ if(c != until)
+ {
+ return false;
+ }
+ return true;
+}
+bool cmParsePHPCoverage::ReadCoverageArray(std::ifstream& in,
+ cmStdString const& fileName)
+{
+ cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector
+ = this->Coverage.TotalCoverage[fileName];
+
+ char c;
+ char buf[4];
+ in.read(buf, 3);
+ buf[3] = 0;
+ if(strcmp(buf, ";a:") != 0)
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read start of coverage array, found : "
+ << buf << "\n");
+ return false;
+ }
+ int size = 0;
+ if(!this->ReadInt(in, size))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read size ");
+ return false;
+ }
+ if(!in.get(c) && c == '{')
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read open {\n");
+ return false;
+ }
+ for(int i =0; i < size; i++)
+ {
+ this->ReadUntil(in, ':');
+ int line = 0;
+ this->ReadInt(in, line);
+ // ok xdebug may have a bug here
+ // it seems to be 1 based but often times
+ // seems to have a 0'th line.
+ line--;
+ if(line < 0)
+ {
+ line = 0;
+ }
+ this->ReadUntil(in, ':');
+ int value = 0;
+ this->ReadInt(in, value);
+ // make sure the vector is the right size and is
+ // initialized with -1 for each line
+ while(coverageVector.size() <= static_cast<size_t>(line) )
+ {
+ coverageVector.push_back(-1);
+ }
+ // if value is less than 0, set it to zero
+ // TODO figure out the difference between
+ // -1 and -2 in xdebug coverage?? For now
+ // assume less than 0 is just not covered
+ // CDash expects -1 for non executable code (like comments)
+ // and 0 for uncovered code, and a positive value
+ // for number of times a line was executed
+ if(value < 0)
+ {
+ value = 0;
+ }
+ // if unset then set it to value
+ if(coverageVector[line] == -1)
+ {
+ coverageVector[line] = value;
+ }
+ // otherwise increment by value
+ else
+ {
+ coverageVector[line] += value;
+ }
+ }
+ return true;
+}
+
+bool cmParsePHPCoverage::ReadInt(std::ifstream& in, int& v)
+{
+ std::string s;
+ char c = 0;
+ while(in.get(c) && c != ':' && c != ';')
+ {
+ s += c;
+ }
+ v = atoi(s.c_str());
+ return true;
+}
+
+bool cmParsePHPCoverage::ReadArraySize(std::ifstream& in, int& size)
+{
+ char c = 0;
+ in.get(c);
+ if(c != 'a')
+ {
+ return false;
+ }
+ if(in.get(c) && c == ':')
+ {
+ if(this->ReadInt(in, size))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in)
+{
+ char buf[4];
+ in.read(buf, 2);
+ buf[2] = 0;
+ if(strcmp(buf, "s:") != 0)
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read start of file info found: [" << buf << "]\n");
+ return false;
+ }
+ char c;
+ int size = 0;
+ if(this->ReadInt(in, size))
+ {
+ size++; // add one for null termination
+ char* s = new char[size+1];
+ // read open quote
+ if(in.get(c) && c != '"')
+ {
+ return false;
+ }
+ // read the string data
+ in.read(s, size-1);
+ s[size-1] = 0;
+ cmStdString fileName = s;
+ delete [] s;
+ // read close quote
+ if(in.get(c) && c != '"')
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read close quote\n"
+ << "read [" << c << "]\n");
+ return false;
+ }
+ if(!this->ReadCoverageArray(in, fileName) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read coverage array for file: "
+ << fileName << "\n");
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+
+bool cmParsePHPCoverage::ReadPHPData(const char* file)
+{
+ std::ifstream in(file);
+ if(!in)
+ {
+ return false;
+ }
+ int size = 0;
+ this->ReadArraySize(in, size);
+ char c = 0;
+ in.get(c);
+ if(c != '{')
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read open array\n");
+ return false;
+ }
+ for(int i =0; i < size; i++)
+ {
+ if(!this->ReadFileInformation(in))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Failed to read file #" << i << "\n");
+ return false;
+ }
+ in.get(c);
+ if(c != '}')
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "failed to read close array\n");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool cmParsePHPCoverage::ReadPHPCoverageDirectory(const char* d)
+{
+ cmsys::Directory dir;
+ if(!dir.Load(d))
+ {
+ return false;
+ }
+ size_t numf;
+ unsigned int i;
+ numf = dir.GetNumberOfFiles();
+ for (i = 0; i < numf; i++)
+ {
+ std::string file = dir.GetFile(i);
+ if(file != "." && file != ".."
+ && !cmSystemTools::FileIsDirectory(file.c_str()))
+ {
+ std::string path = d;
+ path += "/";
+ path += file;
+ if(!this->ReadPHPData(path.c_str()))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+}
diff --git a/Source/CTest/cmParsePHPCoverage.h b/Source/CTest/cmParsePHPCoverage.h
new file mode 100644
index 0000000..ce5741d
--- /dev/null
+++ b/Source/CTest/cmParsePHPCoverage.h
@@ -0,0 +1,48 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-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.
+============================================================================*/
+
+#ifndef cmParsePHPCoverage_h
+#define cmParsePHPCoverage_h
+
+#include "cmStandardIncludes.h"
+#include "cmCTestCoverageHandler.h"
+
+/** \class cmParsePHPCoverage
+ * \brief Parse xdebug PHP coverage information
+ *
+ * This class is used to parse php coverage information produced
+ * by xdebug. The data is stored as a php dump of the array
+ * return by xdebug coverage. It is an array of arrays.
+ */
+class cmParsePHPCoverage
+{
+public:
+ cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont,
+ cmCTest* ctest);
+ bool ReadPHPCoverageDirectory(const char* dir);
+ void PrintCoverage();
+private:
+ bool ReadPHPData(const char* file);
+ bool ReadArraySize(std::ifstream& in, int& size);
+ bool ReadFileInformation(std::ifstream& in);
+ bool ReadInt(std::ifstream& in, int& v);
+ bool ReadCoverageArray(std::ifstream& in, cmStdString const&);
+ bool ReadUntil(std::ifstream& in, char until);
+ typedef std::map<int, int> FileLineCoverage;
+ std::map<cmStdString, FileLineCoverage> FileToCoverage;
+ std::map<int, int> FileCoverage;
+ cmCTestCoverageHandlerContainer& Coverage;
+ cmCTest* CTest;
+};
+
+
+#endif
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/CursesDialog/form/fld_info.c b/Source/CursesDialog/form/fld_info.c
index 7c50b1d..1ba92c8 100644
--- a/Source/CursesDialog/form/fld_info.c
+++ b/Source/CursesDialog/form/fld_info.c
@@ -69,7 +69,7 @@ int field_info(const FIELD *field,
| int *drows, int *dcols,
| int *maxgrow)
|
-| Description : Retrieve informations about a dynamic fields current
+| Description : Retrieve information about a dynamic fields current
| dynamic parameters.
|
| Return Values : E_OK - success
diff --git a/Source/CursesDialog/form/fld_user.c b/Source/CursesDialog/form/fld_user.c
index 7ffca9c..3287b5b 100644
--- a/Source/CursesDialog/form/fld_user.c
+++ b/Source/CursesDialog/form/fld_user.c
@@ -39,7 +39,7 @@ MODULE_ID("$Id$")
| Function : int set_field_userptr(FIELD *field, void *usrptr)
|
| Description : Set the pointer that is reserved in any field to store
-| application relevant informations
+| application relevant information
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ int set_field_userptr(FIELD * field, void *usrptr)
| Function : void *field_userptr(const FIELD *field)
|
| Description : Return the pointer that is reserved in any field to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
diff --git a/Source/CursesDialog/form/frm_user.c b/Source/CursesDialog/form/frm_user.c
index 8f0edbc..f38bbbb 100644
--- a/Source/CursesDialog/form/frm_user.c
+++ b/Source/CursesDialog/form/frm_user.c
@@ -39,7 +39,7 @@ MODULE_ID("$Id$")
| Function : int set_form_userptr(FORM *form, void *usrptr)
|
| Description : Set the pointer that is reserved in any form to store
-| application relevant informations
+| application relevant information
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ int set_form_userptr(FORM * form, void *usrptr)
| Function : void *form_userptr(const FORM *form)
|
| Description : Return the pointer that is reserved in any form to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index e613a78..28f4697 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -11,7 +11,6 @@
============================================================================*/
#include "QCMake.h" // include to disable MS warnings
#include <QApplication>
-#include <QFileInfo>
#include <QDir>
#include <QTranslator>
#include <QLocale>
@@ -21,6 +20,7 @@
#include "cmake.h"
#include "cmVersion.h"
#include <cmsys/CommandLineArguments.hxx>
+#include <cmsys/SystemTools.hxx>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][3] =
@@ -164,16 +164,19 @@ int main(int argc, char** argv)
QStringList args = app.arguments();
if(args.count() == 2)
{
- QFileInfo buildFileInfo(args[1], "CMakeCache.txt");
- QFileInfo srcFileInfo(args[1], "CMakeLists.txt");
- if(buildFileInfo.exists())
+ cmsys_stl::string filePath = cmSystemTools::CollapseFullPath(args[1].toAscii().data());
+ cmsys_stl::string buildFilePath =
+ cmSystemTools::CollapseFullPath("CMakeCache.txt", filePath.c_str());
+ cmsys_stl::string srcFilePath =
+ cmSystemTools::CollapseFullPath("CMakeLists.txt", filePath.c_str());
+ if(cmSystemTools::FileExists(buildFilePath.c_str()))
{
- dialog.setBinaryDirectory(buildFileInfo.absolutePath());
+ dialog.setBinaryDirectory(filePath.c_str());
}
- else if(srcFileInfo.exists())
+ else if(cmSystemTools::FileExists(srcFilePath.c_str()))
{
- dialog.setSourceDirectory(srcFileInfo.absolutePath());
- dialog.setBinaryDirectory(QDir::currentPath());
+ dialog.setSourceDirectory(filePath.c_str());
+ dialog.setBinaryDirectory(cmSystemTools::CollapseFullPath(".").c_str());
}
}
}
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index eb82f2a..74a3d35 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -81,11 +81,8 @@ CMakeSetupDialog::CMakeSetupDialog()
this->Splitter->restoreState(p);
bool groupView = settings.value("GroupView", false).toBool();
- if(groupView)
- {
- this->setViewType(2);
- this->ViewType->setCurrentIndex(2);
- }
+ this->setGroupedView(groupView);
+ this->groupedCheck->setCheckState(groupView ? Qt::Checked : Qt::Unchecked);
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
@@ -217,8 +214,10 @@ void CMakeSetupDialog::initialize()
SIGNAL(outputMessage(QString)),
this, SLOT(message(QString)));
- QObject::connect(this->ViewType, SIGNAL(currentIndexChanged(int)),
- this, SLOT(setViewType(int)));
+ QObject::connect(this->groupedCheck, SIGNAL(toggled(bool)),
+ this, SLOT(setGroupedView(bool)));
+ QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)),
+ this, SLOT(setAdvancedView(bool)));
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
this, SLOT(setSearchFilter(QString)));
@@ -950,33 +949,22 @@ void CMakeSetupDialog::setDebugOutput(bool flag)
"setDebugOutput", Qt::QueuedConnection, Q_ARG(bool, flag));
}
-void CMakeSetupDialog::setViewType(int v)
+void CMakeSetupDialog::setGroupedView(bool v)
{
- if(v == 0) // simple view
- {
- this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::FlatView);
- this->CacheValues->setRootIsDecorated(false);
- this->CacheValues->setShowAdvanced(false);
- }
- else if(v == 1) // advanced view
- {
- this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::FlatView);
- this->CacheValues->setRootIsDecorated(false);
- this->CacheValues->setShowAdvanced(true);
- }
- else if(v == 2) // grouped view
- {
- this->CacheValues->cacheModel()->setViewType(QCMakeCacheModel::GroupView);
- this->CacheValues->setRootIsDecorated(true);
- this->CacheValues->setShowAdvanced(true);
- }
+ this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
+ this->CacheValues->setRootIsDecorated(v);
QSettings settings;
settings.beginGroup("Settings/StartPath");
- settings.setValue("GroupView", v == 2);
+ settings.setValue("GroupView", v);
}
+void CMakeSetupDialog::setAdvancedView(bool v)
+{
+ this->CacheValues->setShowAdvanced(v);
+}
+
void CMakeSetupDialog::showUserChanges()
{
QSet<QCMakeProperty> changes =
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index de7922a..0e3caec 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -70,7 +70,8 @@ protected slots:
void addCacheEntry();
void startSearch();
void setDebugOutput(bool);
- void setViewType(int);
+ void setAdvancedView(bool);
+ void setGroupedView(bool);
void showUserChanges();
void setSearchFilter(const QString& str);
diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui
index ae0dca2..dc8ee3f 100644
--- a/Source/QtDialog/CMakeSetupDialog.ui
+++ b/Source/QtDialog/CMakeSetupDialog.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>CMakeSetupDialog</class>
- <widget class="QWidget" name="CMakeSetupDialog" >
- <property name="geometry" >
+ <widget class="QWidget" name="CMakeSetupDialog">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,115 +10,111 @@
<height>582</height>
</rect>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <layout class="QGridLayout" >
- <property name="margin" >
+ <item row="0" column="0">
+ <layout class="QGridLayout">
+ <property name="margin">
<number>0</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Where is the source code:</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="SourceDirectory" />
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="SourceDirectory"/>
</item>
- <item row="0" column="2" >
- <widget class="QPushButton" name="BrowseSourceDirectoryButton" >
- <property name="text" >
+ <item row="0" column="2">
+ <widget class="QPushButton" name="BrowseSourceDirectoryButton">
+ <property name="text">
<string>Browse &amp;Source...</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Where to build the binaries:</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QComboBox" name="BinaryDirectory" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Ignored" >
+ <item row="1" column="1">
+ <widget class="QComboBox" name="BinaryDirectory">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="editable" >
+ <property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="1" column="2" >
- <widget class="QPushButton" name="BrowseBinaryDirectoryButton" >
- <property name="text" >
+ <item row="1" column="2">
+ <widget class="QPushButton" name="BrowseBinaryDirectoryButton">
+ <property name="text">
<string>Browse &amp;Build...</string>
</property>
</widget>
</item>
</layout>
</item>
- <item row="1" column="0" >
- <widget class="QSplitter" name="Splitter" >
- <property name="orientation" >
+ <item row="1" column="0">
+ <widget class="QSplitter" name="Splitter">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QLabel" name="label_4" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text" >
+ <property name="text">
<string>Search:</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="Search" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
+ <widget class="QLineEdit" name="Search">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -125,33 +122,14 @@
</widget>
</item>
<item>
- <widget class="QComboBox" name="ViewType" >
- <item>
- <property name="text" >
- <string>Simple View</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Advanced View</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Grouped View</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>23</height>
@@ -160,33 +138,49 @@
</spacer>
</item>
<item>
- <widget class="QToolButton" name="AddEntry" >
- <property name="toolTip" >
+ <widget class="QCheckBox" name="groupedCheck">
+ <property name="text">
+ <string>Grouped</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="advancedCheck">
+ <property name="text">
+ <string>Advanced</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="AddEntry">
+ <property name="toolTip">
<string>Add New Entry</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Add Entry</string>
</property>
- <property name="icon" >
- <iconset resource="CMakeSetup.qrc" >:/Icons/Plus16.png</iconset>
+ <property name="icon">
+ <iconset resource="CMakeSetup.qrc">
+ <normaloff>:/Icons/Plus16.png</normaloff>:/Icons/Plus16.png</iconset>
</property>
- <property name="toolButtonStyle" >
+ <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
- <widget class="QToolButton" name="RemoveEntry" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="RemoveEntry">
+ <property name="toolTip">
<string>Remove Selected Entries</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Remove Entry</string>
</property>
- <property name="icon" >
- <iconset resource="CMakeSetup.qrc" >:/Icons/Delete16.png</iconset>
+ <property name="icon">
+ <iconset resource="CMakeSetup.qrc">
+ <normaloff>:/Icons/Delete16.png</normaloff>:/Icons/Delete16.png</iconset>
</property>
- <property name="toolButtonStyle" >
+ <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
@@ -194,69 +188,69 @@
</layout>
</item>
<item>
- <widget class="QCMakeCacheView" name="CacheValues" >
- <property name="alternatingRowColors" >
+ <widget class="QCMakeCacheView" name="CacheValues">
+ <property name="alternatingRowColors">
<bool>true</bool>
</property>
- <property name="selectionMode" >
+ <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
- <property name="selectionBehavior" >
+ <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="label_3" >
- <property name="text" >
+ <widget class="QLabel" name="label_3">
+ <property name="text">
<string>Press Configure to update and display new values in red, then press Generate to generate selected build files.</string>
</property>
- <property name="alignment" >
+ <property name="alignment">
<set>Qt::AlignCenter</set>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <layout class="QHBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QPushButton" name="ConfigureButton" >
- <property name="text" >
+ <widget class="QPushButton" name="ConfigureButton">
+ <property name="text">
<string>&amp;Configure</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="GenerateButton" >
- <property name="text" >
+ <widget class="QPushButton" name="GenerateButton">
+ <property name="text">
<string>&amp;Generate</string>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="Generator" >
- <property name="text" >
+ <widget class="QLabel" name="Generator">
+ <property name="text">
<string>Current Generator:</string>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>121</width>
<height>27</height>
@@ -265,23 +259,23 @@
</spacer>
</item>
<item>
- <widget class="QProgressBar" name="ProgressBar" >
- <property name="minimum" >
+ <widget class="QProgressBar" name="ProgressBar">
+ <property name="minimum">
<number>0</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>100</number>
</property>
- <property name="value" >
+ <property name="value">
<number>0</number>
</property>
- <property name="textVisible" >
+ <property name="textVisible">
<bool>false</bool>
</property>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="textDirection" >
+ <property name="textDirection">
<enum>QProgressBar::BottomToTop</enum>
</property>
</widget>
@@ -290,11 +284,11 @@
</item>
</layout>
</widget>
- <widget class="QTextEdit" name="Output" >
- <property name="lineWrapMode" >
+ <widget class="QTextEdit" name="Output">
+ <property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
- <property name="readOnly" >
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
@@ -310,7 +304,7 @@
</customwidget>
</customwidgets>
<resources>
- <include location="CMakeSetup.qrc" />
+ <include location="CMakeSetup.qrc"/>
</resources>
<connections/>
</ui>
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index b7e939e..126934c 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -66,14 +66,17 @@ bool cmCMakeMinimumRequired
int current_major = cmVersion::GetMajorVersion();
int current_minor = cmVersion::GetMinorVersion();
int current_patch = cmVersion::GetPatchVersion();
+ int current_tweak = cmVersion::GetTweakVersion();
- // Parse the required version number. If no patch-level is given
- // use zero.
+ // Parse at least two components of the version number.
+ // Use zero for those not specified.
int required_major = 0;
int required_minor = 0;
int required_patch = 0;
- if(sscanf(version_string.c_str(), "%d.%d.%d",
- &required_major, &required_minor, &required_patch) < 2)
+ int required_tweak = 0;
+ if(sscanf(version_string.c_str(), "%u.%u.%u.%u",
+ &required_major, &required_minor,
+ &required_patch, &required_tweak) < 2)
{
cmOStringStream e;
e << "could not parse VERSION \"" << version_string.c_str() << "\".";
@@ -87,13 +90,17 @@ bool cmCMakeMinimumRequired
current_minor < required_minor) ||
(current_major == required_major &&
current_minor == required_minor &&
- current_patch < required_patch))
+ current_patch < required_patch) ||
+ (current_major == required_major &&
+ current_minor == required_minor &&
+ current_patch == required_patch &&
+ current_tweak < required_tweak))
{
// The current version is too low.
cmOStringStream e;
e << "CMake " << version_string.c_str()
<< " or higher is required. You are running version "
- << current_major << "." << current_minor << "." << current_patch;
+ << cmVersion::GetCMakeVersion();
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return true;
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index 05c2505..9bf7ef8 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -61,13 +61,13 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " cmake_minimum_required(VERSION major[.minor[.patch]]\n"
+ " cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]\n"
" [FATAL_ERROR])\n"
"If the current version of CMake is lower than that required "
"it will stop processing the project and report an error. "
"When a version higher than 2.4 is specified the command implicitly "
"invokes\n"
- " cmake_policy(VERSION major[.minor[.patch]])\n"
+ " cmake_policy(VERSION major[.minor[.patch[.tweak]]])\n"
"which sets the cmake policy version level to the version specified. "
"When version 2.4 or lower is given the command implicitly invokes\n"
" cmake_policy(VERSION 2.4)\n"
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index ffd0f44..b326865 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -80,7 +80,7 @@ public:
"behavior. "
"While setting policies individually is supported, we encourage "
"projects to set policies based on CMake versions.\n"
- " cmake_policy(VERSION major.minor[.patch])\n"
+ " cmake_policy(VERSION major.minor[.patch[.tweak]])\n"
"Specify that the current CMake list file is written for the "
"given version of CMake. "
"All policies introduced in the specified version or earlier "
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index e417e1b..3a777d5 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -311,9 +311,12 @@ cmCTest::cmCTest()
this->InteractiveDebugMode = true;
this->TimeOut = 0;
this->GlobalTimeout = 0;
+ this->LastStopTimeout = 24 * 60 * 60;
this->CompressXMLFiles = false;
this->CTestConfigFile = "";
this->ScheduleType = "";
+ this->StopTime = "";
+ this->NextDayStopTime = false;
this->OutputLogFile = 0;
this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false;
@@ -1166,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);
}
}
@@ -1178,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);
@@ -1881,6 +1884,12 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
double timeout = (double)atof(args[i].c_str());
this->GlobalTimeout = timeout;
}
+
+ if(this->CheckArgument(arg, "--stop-time") && i < args.size() - 1)
+ {
+ i++;
+ this->SetStopTime(args[i]);
+ }
if(this->CheckArgument(arg, "-C", "--build-config") &&
i < args.size() - 1)
@@ -2112,7 +2121,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
i++;
std::string targ = args[i];
// AddTestsForDashboard parses the dashborad type and converts it
- // into the seperate stages
+ // into the separate stages
if (!this->AddTestsForDashboardType(targ))
{
performSomeTest = false;
@@ -2335,6 +2344,13 @@ void cmCTest::SetNotesFiles(const char* notes)
}
//----------------------------------------------------------------------
+void cmCTest::SetStopTime(std::string time)
+{
+ this->StopTime = time;
+ this->DetermineNextDayStop();
+}
+
+//----------------------------------------------------------------------
int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
{
bool found = false;
@@ -2536,6 +2552,46 @@ void cmCTest::EmptyCTestConfiguration()
}
//----------------------------------------------------------------------
+void cmCTest::DetermineNextDayStop()
+{
+ struct tm* lctime;
+ time_t current_time = time(0);
+ lctime = gmtime(&current_time);
+ int gm_hour = lctime->tm_hour;
+ time_t gm_time = mktime(lctime);
+ lctime = localtime(&current_time);
+ int local_hour = lctime->tm_hour;
+
+ int tzone_offset = local_hour - gm_hour;
+ if(gm_time > current_time && gm_hour < local_hour)
+ {
+ // this means gm_time is on the next day
+ tzone_offset -= 24;
+ }
+ else if(gm_time < current_time && gm_hour > local_hour)
+ {
+ // this means gm_time is on the previous day
+ tzone_offset += 24;
+ }
+
+ tzone_offset *= 100;
+ char buf[1024];
+ sprintf(buf, "%d%02d%02d %s %+05i",
+ lctime->tm_year + 1900,
+ lctime->tm_mon + 1,
+ lctime->tm_mday,
+ this->StopTime.c_str(),
+ tzone_offset);
+
+ time_t stop_time = curl_getdate(buf, &current_time);
+
+ if(stop_time < current_time)
+ {
+ this->NextDayStopTime = true;
+ }
+}
+
+//----------------------------------------------------------------------
void cmCTest::SetCTestConfiguration(const char *name, const char* value)
{
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "SetCTestConfiguration:"
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index adf359c..3d7d117 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -214,6 +214,9 @@ public:
std::string GetCDashVersion();
+ std::string GetStopTime() { return this->StopTime; }
+ void SetStopTime(std::string time);
+
//Used for parallel ctest job scheduling
std::string GetScheduleType() { return this->ScheduleType; }
void SetScheduleType(std::string type) { this->ScheduleType = type; }
@@ -403,6 +406,8 @@ public:
private:
std::string ConfigType;
std::string ScheduleType;
+ std::string StopTime;
+ bool NextDayStopTime;
bool Verbose;
bool ExtraVerbose;
bool ProduceXML;
@@ -420,6 +425,8 @@ private:
int GenerateNotesFile(const char* files);
+ void DetermineNextDayStop();
+
// these are helper classes
typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers;
t_TestingHandlers TestingHandlers;
@@ -450,6 +457,8 @@ private:
double GlobalTimeout;
+ int LastStopTimeout;
+
int MaxTestNameWidth;
int ParallelLevel;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 69a4d22..1cabed2 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -376,6 +376,8 @@ cmComputeLinkInformation
{
this->OrderDependentRPath
->SetImplicitDirectories(this->ImplicitLinkDirs);
+ this->OrderDependentRPath
+ ->AddLanguageDirectories(this->RuntimeLinkDirs);
}
// Decide whether to enable compatible library search path mode.
@@ -1324,13 +1326,12 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
//----------------------------------------------------------------------------
void cmComputeLinkInformation::AddDirectoryItem(std::string const& item)
{
-#ifdef __APPLE__
- if(cmSystemTools::IsPathToFramework(item.c_str()))
+ if(this->Makefile->IsOn("APPLE")
+ && cmSystemTools::IsPathToFramework(item.c_str()))
{
this->AddFrameworkItem(item);
}
else
-#endif
{
this->DropDirectoryItem(item);
}
@@ -1642,6 +1643,14 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
this->ImplicitLinkLibs.insert(item);
}
}
+
+ // Get platform specific rpath link directories
+ if(const char *rpathDirs =
+ (this->Makefile->GetDefinition
+ ("CMAKE_PLATFORM_RUNTIME_PATH")))
+ {
+ cmSystemTools::ExpandListArgument(rpathDirs, this->RuntimeLinkDirs);
+ }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index ad2026b..bbeed68 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -163,6 +163,9 @@ private:
std::set<cmStdString> ImplicitLinkDirs;
std::set<cmStdString> ImplicitLinkLibs;
+ // Additional paths configured by the runtime linker
+ std::vector<std::string> RuntimeLinkDirs;
+
// Linker search path compatibility mode.
std::set<cmStdString> OldLinkDirMask;
std::vector<std::string> OldLinkDirItems;
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/cmData.h b/Source/cmData.h
deleted file mode 100644
index 3ae32f5..0000000
--- a/Source/cmData.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*============================================================================
- CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
- Distributed under the OSI-approved BSD License (the "License");
- see accompanying file Copyright.txt for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License for more information.
-============================================================================*/
-#ifndef cmData_h
-#define cmData_h
-
-#include "cmStandardIncludes.h"
-
-/** \class cmData
- * \brief Hold extra data on a cmMakefile instance for a command.
- *
- * When CMake commands need to store extra information in a cmMakefile
- * instance, but the information is not needed by the makefile generators,
- * it can be held in a subclass of cmData. The cmMakefile class has a map
- * from std::string to cmData*. On its destruction, it destroys all the
- * extra data through the virtual destructor of cmData.
- */
-class cmData
-{
-public:
- cmData(const char* name): Name(name) {}
- virtual ~cmData() {}
-
- const std::string& GetName() const
- { return this->Name; }
-protected:
- std::string Name;
-};
-
-#endif
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 6957334..2ed959f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -251,12 +251,22 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
" executable being run.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_TWEAK_VERSION", cmProperty::VARIABLE,
+ "The tweak version of cmake (i.e. the 1 in X.X.X.1).",
+ "This specifies the tweak version of the CMake executable being run. "
+ "Releases use tweak < 20000000 and development versions use the date "
+ "format CCYYMMDD for the tweak level."
+ ,false, "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_VERSION", cmProperty::VARIABLE,
- "The full version of cmake in major.minor.patch format.",
+ "The full version of cmake in major.minor.patch[.tweak[-id]] format.",
"This specifies the full version of the CMake executable being run. "
"This variable is defined by versions 2.6.3 and higher. "
- "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, and "
- "CMAKE_PATCH_VERSION for individual version components.", false,
+ "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, "
+ "CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION "
+ "for individual version components. "
+ "The [-id] component appears in non-release versions "
+ "and may be arbitrary text.", false,
"Variables that Provide Information");
cm->DefineProperty
@@ -598,7 +608,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"will check each of the contained directories for the existence of the "
"library which is currently searched. By default it contains the "
"standard directories for the current system. It is NOT intended to be "
- "modified by the project, use CMAKE_SYSTEM_LIBRARY_PATH for this. See "
+ "modified by the project, use CMAKE_LIBRARY_PATH for this. See "
"also CMAKE_SYSTEM_PREFIX_PATH.", false,
"Variables That Change Behavior");
@@ -1390,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/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index fc2fb14..bfe11c1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -606,20 +606,22 @@ bool cmDocumentation::CreateSingleModule(const char* fname,
}
else
{
- if(text.length() < 2 && brief.length() == 1)
- {
- return false;
- }
- char* pname = strcpy(new char[strlen(moduleName)+1], moduleName);
- char* ptext = strcpy(new char[text.length()+1], text.c_str());
- this->ModuleStrings.push_back(pname);
- this->ModuleStrings.push_back(ptext);
- char* pbrief = strcpy(new char[brief.length()+1], brief.c_str());
- this->ModuleStrings.push_back(pbrief);
- moduleSection.Append(pname, pbrief, ptext);
- return true;
+ break;
}
}
+
+ if(text.length() < 2 && brief.length() == 1)
+ {
+ return false;
+ }
+
+ char* pname = strcpy(new char[strlen(moduleName)+1], moduleName);
+ char* ptext = strcpy(new char[text.length()+1], text.c_str());
+ this->ModuleStrings.push_back(pname);
+ this->ModuleStrings.push_back(ptext);
+ char* pbrief = strcpy(new char[brief.length()+1], brief.c_str());
+ this->ModuleStrings.push_back(pbrief);
+ moduleSection.Append(pname, pbrief, ptext);
return true;
}
@@ -1177,11 +1179,18 @@ bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os)
this->CurrentArgument.c_str(),
*this->AllSections["Modules"]))
{
- this->PrintDocumentationCommand
- (os, this->AllSections["Modules"]->GetEntries()[0]);
- os << "\n Defined in: ";
- os << moduleName << "\n";
- return true;
+ if(this->AllSections["Modules"]->GetEntries().size())
+ {
+ this->PrintDocumentationCommand
+ (os, this->AllSections["Modules"]->GetEntries()[0]);
+ os << "\n Defined in: ";
+ os << moduleName << "\n";
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
}
diff --git a/Source/cmDocumentationFormatterText.cxx b/Source/cmDocumentationFormatterText.cxx
index 078b890..0b04b73 100644
--- a/Source/cmDocumentationFormatterText.cxx
+++ b/Source/cmDocumentationFormatterText.cxx
@@ -96,7 +96,7 @@ void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
{
// Print text arranged in an indented column of fixed witdh.
const char* l = text;
- int column = 0;
+ long column = 0;
bool newSentence = false;
bool firstLine = true;
int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent));
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 763fdd8..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());
}
//----------------------------------------------------------------------------
@@ -687,7 +687,7 @@ cmELFInternalImpl<Types>::GetDynamicSectionString(int tag)
// The value has been read successfully. Report it.
se.Position = static_cast<unsigned long>(strtab.sh_offset + first);
se.Size = last - first;
- se.IndexInSection = di - this->DynamicSectionEntries.begin();
+ se.IndexInSection = static_cast<int>(di - this->DynamicSectionEntries.begin());
return &se;
}
}
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 5cbef8c..4cb2b48 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -630,8 +630,8 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
std::string hostSystemName = mf->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME");
std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
- std::string compilerId = mf->GetRequiredDefinition(compilerIdVar.c_str());
- std::string compiler = "gcc";
+ std::string compilerId = mf->GetSafeDefinition(compilerIdVar.c_str());
+ std::string compiler = "gcc"; // default to gcc
if (compilerId == "MSVC")
{
compiler = "msvc8";
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index fe914fd..204d5d7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -292,7 +292,6 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
AddEnvVar(fout, "INCLUDE", mf);
AddEnvVar(fout, "LIB", mf);
AddEnvVar(fout, "LIBPATH", mf);
- AddEnvVar(fout, "INCLUDE", mf);
}
else if (compilerId == "Intel")
{
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index c2e90b6..133c1a1 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -183,24 +183,18 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
std::string dir = cmSystemTools::GetFilenamePath(fileName);
cmSystemTools::MakeDirectory(dir.c_str());
- mode_t mode =
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
- S_IREAD | S_IWRITE
-#elif defined( __BORLANDC__ )
- S_IRUSR | S_IWUSR
-#else
- 0666
-#endif
- ;
+ mode_t mode = 0;
// Set permissions to writable
if ( cmSystemTools::GetPermissions(fileName.c_str(), mode) )
{
cmSystemTools::SetPermissions(fileName.c_str(),
#if defined( _MSC_VER ) || defined( __MINGW32__ )
- S_IREAD | S_IWRITE
+ mode | S_IWRITE
+#elif defined( __BORLANDC__ )
+ mode | S_IWUSR
#else
- 0666
+ mode | S_IWUSR | S_IWGRP
#endif
);
}
@@ -217,7 +211,10 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
}
file << message;
file.close();
- cmSystemTools::SetPermissions(fileName.c_str(), mode);
+ if(mode)
+ {
+ cmSystemTools::SetPermissions(fileName.c_str(), mode);
+ }
return true;
}
@@ -529,13 +526,6 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
return false;
}
- // At least one compiler (Portland Group Fortran) produces binaries
- // with some extra characters in strings.
- char extra[256]; // = {}; // some compilers do not like this
- memset(extra, 0, sizeof(extra));
- extra[0x0c] = 1; // FF (form feed)
- extra[0x14] = 1; // DC4 (device control 4)
-
// Parse strings out of the file.
int output_size = 0;
std::vector<std::string> strings;
@@ -545,28 +535,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
(limit_input < 0 || static_cast<int>(fin.tellg()) < limit_input) &&
(c = fin.get(), fin))
{
- if(c == '\0')
- {
- // A terminating null character has been found. Check if the
- // current string matches the requirements. Since it was
- // terminated by a null character, we require that the length be
- // at least one no matter what the user specified.
- if(s.length() >= minlen && s.length() >= 1 &&
- (!have_regex || regex.find(s.c_str())))
- {
- output_size += static_cast<int>(s.size()) + 1;
- if(limit_output >= 0 && output_size >= limit_output)
- {
- s = "";
- break;
- }
- strings.push_back(s);
- }
-
- // Reset the string to empty.
- s = "";
- }
- else if(c == '\n' && !newline_consume)
+ if(c == '\n' && !newline_consume)
{
// The current line has been terminated. Check if the current
// string matches the requirements. The length may now be as
@@ -590,7 +559,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
{
// Ignore CR character to make output always have UNIX newlines.
}
- else if((c >= 0x20 && c < 0x7F) || c == '\t' || extra[c] ||
+ else if((c >= 0x20 && c < 0x7F) || c == '\t' ||
(c == '\n' && newline_consume))
{
// This is an ASCII character that may be part of a string.
@@ -600,7 +569,23 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
}
else
{
- // This is a non-string character. Reset the string to emtpy.
+ // TODO: Support ENCODING option. See issue #10519.
+ // A non-string character has been found. Check if the current
+ // string matches the requirements. We require that the length
+ // be at least one no matter what the user specified.
+ if(s.length() >= minlen && s.length() >= 1 &&
+ (!have_regex || regex.find(s.c_str())))
+ {
+ output_size += static_cast<int>(s.size()) + 1;
+ if(limit_output >= 0 && output_size >= limit_output)
+ {
+ s = "";
+ break;
+ }
+ strings.push_back(s);
+ }
+
+ // Reset the string to empty.
s = "";
}
@@ -1519,7 +1504,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
this->ReportCopy(toFile, TypeFile, copy);
// Copy the file.
- if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true, false))
+ if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true))
{
cmOStringStream e;
e << this->Name << " cannot copy file \"" << fromFile
@@ -1531,6 +1516,13 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
// Set the file modification time of the destination file.
if(copy && !this->Always)
{
+ // Add write permission so we can set the file time.
+ // Permissions are set unconditionally below anyway.
+ mode_t perm = 0;
+ if(cmSystemTools::GetPermissions(toFile, perm))
+ {
+ cmSystemTools::SetPermissions(toFile, perm | mode_owner_write);
+ }
if (!cmSystemTools::CopyFileTime(fromFile, toFile))
{
cmOStringStream e;
@@ -2455,7 +2447,8 @@ namespace{
fout->write(chPtr, realsize);
return realsize;
}
-
+
+
static size_t
cmFileCommandCurlDebugCallback(CURL *, curl_infotype, char *chPtr,
size_t size, void *data)
@@ -2468,6 +2461,72 @@ namespace{
}
+ class cURLProgressHelper
+ {
+ public:
+ cURLProgressHelper(cmFileCommand *fc)
+ {
+ this->CurrentPercentage = -1;
+ this->FileCommand = fc;
+ }
+
+ bool UpdatePercentage(double value, double total, std::string &status)
+ {
+ int OldPercentage = this->CurrentPercentage;
+
+ if (0.0 == total)
+ {
+ this->CurrentPercentage = 100;
+ }
+ else
+ {
+ this->CurrentPercentage = static_cast<int>(value/total*100.0 + 0.5);
+ }
+
+ bool updated = (OldPercentage != this->CurrentPercentage);
+
+ if (updated)
+ {
+ cmOStringStream oss;
+ oss << "[download " << this->CurrentPercentage << "% complete]";
+ status = oss.str();
+ }
+
+ return updated;
+ }
+
+ cmFileCommand *GetFileCommand()
+ {
+ return this->FileCommand;
+ }
+
+ private:
+ int CurrentPercentage;
+ cmFileCommand *FileCommand;
+ };
+
+
+ static int
+ cmFileCommandCurlProgressCallback(void *clientp,
+ double dltotal, double dlnow,
+ double ultotal, double ulnow)
+ {
+ cURLProgressHelper *helper =
+ reinterpret_cast<cURLProgressHelper *>(clientp);
+
+ static_cast<void>(ultotal);
+ static_cast<void>(ulnow);
+
+ std::string status;
+ if (helper->UpdatePercentage(dlnow, dltotal, status))
+ {
+ cmFileCommand *fc = helper->GetFileCommand();
+ cmMakefile *mf = fc->GetMakefile();
+ mf->DisplayStatus(status.c_str(), -1);
+ }
+
+ return 0;
+ }
}
#endif
@@ -2481,8 +2540,8 @@ namespace {
cURLEasyGuard(CURL * easy)
: Easy(easy)
{}
-
- ~cURLEasyGuard(void)
+
+ ~cURLEasyGuard(void)
{
if (this->Easy)
{
@@ -2503,6 +2562,7 @@ namespace {
}
#endif
+
bool
cmFileCommand::HandleDownloadCommand(std::vector<std::string>
const& args)
@@ -2520,9 +2580,13 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
std::string file = *i;
++i;
+
long timeout = 0;
std::string verboseLog;
std::string statusVar;
+ std::string expectedMD5sum;
+ bool showProgress = false;
+
while(i != args.end())
{
if(*i == "TIMEOUT")
@@ -2561,9 +2625,65 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
}
statusVar = *i;
}
+ else if(*i == "EXPECTED_MD5")
+ {
+ ++i;
+ if( i == args.end())
+ {
+ this->SetError("FILE(DOWNLOAD url file EXPECTED_MD5 sum) missing "
+ "sum value for EXPECTED_MD5.");
+ return false;
+ }
+ expectedMD5sum = cmSystemTools::LowerCase(*i);
+ }
+ else if(*i == "SHOW_PROGRESS")
+ {
+ showProgress = true;
+ }
++i;
}
+ // If file exists already, and caller specified an expected md5 sum,
+ // and the existing file already has the expected md5 sum, then simply
+ // return.
+ //
+ if(cmSystemTools::FileExists(file.c_str()) &&
+ !expectedMD5sum.empty())
+ {
+ char computedMD5[32];
+
+ if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
+ {
+ this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
+ "pre-existing file");
+ return false;
+ }
+
+ std::string actualMD5sum = cmSystemTools::LowerCase(
+ std::string(computedMD5, 32));
+
+ if (expectedMD5sum == actualMD5sum)
+ {
+ this->Makefile->DisplayStatus(
+ "FILE(DOWNLOAD ) returning early: file already exists with "
+ "expected MD5 sum", -1);
+
+ if(statusVar.size())
+ {
+ cmOStringStream result;
+ result << (int)0 << ";\""
+ "returning early: file already exists with expected MD5 sum\"";
+ this->Makefile->AddDefinition(statusVar.c_str(),
+ result.str().c_str());
+ }
+
+ return true;
+ }
+ }
+
+ // Make sure parent directory exists so we can write to the file
+ // as we receive downloaded bits from curl...
+ //
std::string dir = cmSystemTools::GetFilenamePath(file.c_str());
if(!cmSystemTools::FileExists(dir.c_str()) &&
!cmSystemTools::MakeDirectory(dir.c_str()))
@@ -2582,6 +2702,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
"file for write.");
return false;
}
+
::CURL *curl;
::curl_global_init(CURL_GLOBAL_DEFAULT);
curl = ::curl_easy_init();
@@ -2597,28 +2718,31 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set url: ";
- errstring += ::curl_easy_strerror(res);
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set url: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
- cmFileCommandWriteMemoryCallback);
+ cmFileCommandWriteMemoryCallback);
if (res != CURLE_OK)
- {
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set write function: ";
- errstring += ::curl_easy_strerror(res);
+ {
+ std::string errstring =
+ "FILE(DOWNLOAD ) error; cannot set write function: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION,
- cmFileCommandCurlDebugCallback);
+ cmFileCommandCurlDebugCallback);
if (res != CURLE_OK)
{
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set debug function: ";
- errstring += ::curl_easy_strerror(res);
+ std::string errstring =
+ "FILE(DOWNLOAD ) error; cannot set debug function: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
@@ -2630,14 +2754,25 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
{
std::string errstring = "FILE(DOWNLOAD ) error; cannot set write data: ";
errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set write data: ";
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set debug data: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
+ return false;
+ }
+
+ res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+ if (res != CURLE_OK)
+ {
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set follow-redirect option: ";
errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
@@ -2649,24 +2784,70 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
{
std::string errstring = "FILE(DOWNLOAD ) error; cannot set verbose: ";
errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
}
+
if(timeout > 0)
{
res = ::curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout );
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set verbose: ";
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set timeout: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
+ return false;
+ }
+ }
+
+ // Need the progress helper's scope to last through the duration of
+ // the curl_easy_perform call... so this object is declared at function
+ // scope intentionally, rather than inside the "if(showProgress)"
+ // block...
+ //
+ cURLProgressHelper helper(this);
+
+ if(showProgress)
+ {
+ res = ::curl_easy_setopt(curl,
+ CURLOPT_NOPROGRESS, 0);
+ if (res != CURLE_OK)
+ {
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set noprogress value: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
+ return false;
+ }
+
+ res = ::curl_easy_setopt(curl,
+ CURLOPT_PROGRESSFUNCTION, cmFileCommandCurlProgressCallback);
+ if (res != CURLE_OK)
+ {
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress function: ";
+ errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
+ return false;
+ }
+
+ res = ::curl_easy_setopt(curl,
+ CURLOPT_PROGRESSDATA, reinterpret_cast<void*>(&helper));
+ if (res != CURLE_OK)
+ {
+ std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress data: ";
errstring += ::curl_easy_strerror(res);
+ this->SetError(errstring.c_str());
return false;
}
}
+
res = ::curl_easy_perform(curl);
+
/* always cleanup */
g_curl.release();
::curl_easy_cleanup(curl);
+
if(statusVar.size())
{
cmOStringStream result;
@@ -2674,7 +2855,44 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
this->Makefile->AddDefinition(statusVar.c_str(),
result.str().c_str());
}
+
::curl_global_cleanup();
+
+ // Explicitly flush/close so we can measure the md5 accurately.
+ //
+ fout.flush();
+ fout.close();
+
+ // Verify MD5 sum if requested:
+ //
+ if (!expectedMD5sum.empty())
+ {
+ char computedMD5[32];
+
+ if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
+ {
+ this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
+ "downloaded file");
+ return false;
+ }
+
+ std::string actualMD5sum = cmSystemTools::LowerCase(
+ std::string(computedMD5, 32));
+
+ if (expectedMD5sum != actualMD5sum)
+ {
+ cmOStringStream oss;
+ oss << "FILE(DOWNLOAD ) error; expected and actual MD5 sums differ"
+ << std::endl
+ << " for file: [" << file << "]" << std::endl
+ << " expected MD5 sum: [" << expectedMD5sum << "]" << std::endl
+ << " actual MD5 sum: [" << actualMD5sum << "]" << std::endl
+ ;
+ this->SetError(oss.str().c_str());
+ return false;
+ }
+ }
+
if(chunkDebug.size())
{
chunkDebug.push_back(0);
@@ -2692,6 +2910,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
this->Makefile->AddDefinition(verboseLog.c_str(),
&*chunkDebug.begin());
}
+
return true;
#else
this->SetError("FILE(DOWNLOAD ) "
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index c6da301..e771092 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -80,7 +80,8 @@ public:
" file(RELATIVE_PATH variable directory file)\n"
" file(TO_CMAKE_PATH path result)\n"
" file(TO_NATIVE_PATH path result)\n"
- " file(DOWNLOAD url file [TIMEOUT timeout] [STATUS status] [LOG log])\n"
+ " file(DOWNLOAD url file [TIMEOUT timeout] [STATUS status] [LOG log]\n"
+ " [EXPECTED_MD5 sum] [SHOW_PROGRESS])\n"
"WRITE will write a message into a file called 'filename'. It "
"overwrites the file if it already exists, and creates the file "
"if it does not exist.\n"
@@ -152,7 +153,12 @@ public:
"and the second element is a string value for the error. A 0 "
"numeric error means no error in the operation. "
"If TIMEOUT time is specified, the operation will "
- "timeout after time seconds, time should be specified as an integer."
+ "timeout after time seconds, time should be specified as an integer. "
+ "If EXPECTED_MD5 sum is specified, the operation will verify that the "
+ "downloaded file's actual md5 sum matches the expected value. If it "
+ "does not match, the operation fails with an error. "
+ "If SHOW_PROGRESS is specified, progress information will be printed "
+ "as status messages until the operation is complete."
"\n"
"The file() command also provides COPY and INSTALL signatures:\n"
" file(<COPY|INSTALL> files... DESTINATION <dir>\n"
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index f4c0064..f352172 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -423,3 +423,17 @@ void cmFindCommon::AddTrailingSlashes(std::vector<std::string>& paths)
}
}
}
+
+//----------------------------------------------------------------------------
+void cmFindCommon::SetMakefile(cmMakefile* makefile)
+{
+ cmCommand::SetMakefile(makefile);
+
+ // If we are building for Apple (OSX or also iphone), make sure
+ // that frameworks and bundles are searched first.
+ if(this->Makefile->IsOn("APPLE"))
+ {
+ this->SearchFrameworkFirst = true;
+ this->SearchAppBundleFirst = true;
+ }
+}
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 08d2158..2ffbd00 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -61,6 +61,8 @@ protected:
PathType pathType);
void AddPathInternal(std::string const& in_path, PathType pathType);
+ void SetMakefile(cmMakefile* makefile);
+
bool NoDefaultPath;
bool NoCMakePath;
bool NoCMakeEnvironmentPath;
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index c85b296..aff4d7e 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -62,10 +62,10 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " get_filename_component(VarName FileName\n"
+ " get_filename_component(<VAR> FileName\n"
" PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH\n"
" [CACHE])\n"
- "Set VarName to be the path (PATH), file name (NAME), file "
+ "Set <VAR> to be the path (PATH), file name (NAME), file "
"extension (EXT), file name without extension (NAME_WE) of FileName, "
"the full path (ABSOLUTE), or the full path with all symlinks "
"resolved (REALPATH). "
@@ -73,14 +73,14 @@ public:
"trailing slashes. The longest file extension is always considered. "
"If the optional CACHE argument is specified, the result variable is "
"added to the cache.\n"
- " get_filename_component(VarName FileName\n"
- " PROGRAM [PROGRAM_ARGS ArgVar]\n"
+ " get_filename_component(<VAR> FileName\n"
+ " PROGRAM [PROGRAM_ARGS <ARG_VAR>]\n"
" [CACHE])\n"
"The program in FileName will be found in the system search path or "
"left as a full path. If PROGRAM_ARGS is present with PROGRAM, then "
"any command-line arguments present in the FileName string are split "
- "from the program name and stored in ArgVar. This is used to separate "
- "a program name from its arguments in a command line string.";
+ "from the program name and stored in <ARG_VAR>. This is used to "
+ "separate a program name from its arguments in a command line string.";
}
cmTypeMacro(cmGetFilenameComponentCommand, cmCommand);
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/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index d608aac..1191575 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -37,6 +37,7 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator()
void cmGlobalVisualStudio71Generator::AddPlatformDefinitions(cmMakefile* mf)
{
this->cmGlobalVisualStudio7Generator::AddPlatformDefinitions(mf);
+ mf->RemoveDefinition("MSVC70");
mf->AddDefinition("MSVC71", "1");
}
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/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0d6e389..537a88f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1514,8 +1514,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
extraLinkOptions = this->CurrentMakefile->
GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
}
-
- const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
+
+ const char* linkFlagsProp = "LINK_FLAGS";
+ if(target.GetType() == cmTarget::STATIC_LIBRARY)
+ {
+ linkFlagsProp = "STATIC_LIBRARY_FLAGS";
+ }
+ const char* targetLinkFlags = target.GetProperty(linkFlagsProp);
if(targetLinkFlags)
{
extraLinkOptions += " ";
@@ -1523,7 +1528,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
if(configName && *configName)
{
- std::string linkFlagsVar = "LINK_FLAGS_";
+ std::string linkFlagsVar = linkFlagsProp;
+ linkFlagsVar += "_";
linkFlagsVar += cmSystemTools::UpperCase(configName);
if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
{
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 1c1444b..9e6f4b6 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -63,7 +63,7 @@ bool cmIncludeDirectoryCommand
// " /foo/bar
// /boo/hoo /dingle/berry "
//
-// ideally that should be three seperate arguments but when sucking the
+// ideally that should be three separate arguments but when sucking the
// output from a program and passing it into a command the cleanup doesn't
// always happen
//
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index d14d564..5269041 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -62,9 +62,8 @@ public:
" dep1 dep2 ...)\n"
"Includes an external Microsoft project in the generated workspace "
"file. Currently does nothing on UNIX. This will create a "
- "target named INCLUDE_EXTERNAL_MSPROJECT_[projectname]. This can "
- "be used in the add_dependencies command to make things depend "
- "on the external project.";
+ "target named [projectname]. This can be used in the add_dependencies "
+ "command to make things depend on the external project.";
}
cmTypeMacro(cmIncludeExternalMSProjectCommand, cmCommand);
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4156f32..07c92e5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -712,9 +712,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
std::string langFlags;
this->AddLanguageFlags(langFlags, llang, 0);
-#ifdef __APPLE__
this->AddArchitectureFlags(langFlags, &target, llang, 0);
-#endif /* __APPLE__ */
vars.LanguageCompileFlags = langFlags.c_str();
cmCustomCommandLines commandLines;
@@ -1272,8 +1270,8 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
#endif
for(i = includes.begin(); i != includes.end(); ++i)
{
-#ifdef __APPLE__
- if(cmSystemTools::IsPathToFramework(i->c_str()))
+ if(this->Makefile->IsOn("APPLE")
+ && cmSystemTools::IsPathToFramework(i->c_str()))
{
std::string frameworkDir = *i;
frameworkDir += "/../";
@@ -1288,7 +1286,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
}
continue;
}
-#endif
+
std::string include = *i;
if(!flagUsed || repeatFlag)
{
@@ -1766,12 +1764,17 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
//----------------------------------------------------------------------------
-#ifdef __APPLE__
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
cmTarget* target,
const char *lang,
const char* config)
{
+ // Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
+ if(!this->Makefile->IsOn("APPLE"))
+ {
+ return;
+ }
+
if(this->EmitUniversalBinaryFlags)
{
std::vector<std::string> archs;
@@ -1828,7 +1831,6 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
}
}
}
-#endif /* __APPLE__ */
//----------------------------------------------------------------------------
@@ -3043,7 +3045,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
if(define.find_first_of("#") != define.npos)
{
cmOStringStream e;
- e << "WARNING: Peprocessor definitions containing '#' may not be "
+ e << "WARNING: Preprocessor definitions containing '#' may not be "
<< "passed on the compiler command line because many compilers "
<< "do not support it.\n"
<< "CMake is dropping a preprocessor definition: " << define << "\n"
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 489b613..43bf1e7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -133,10 +133,8 @@ public:
std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; };
-#ifdef __APPLE__
void AddArchitectureFlags(std::string& flags, cmTarget* target,
const char *lang, const char* config);
-#endif /* __APPLE__ */
void AddLanguageFlags(std::string& flags, const char* lang,
const char* config);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index fce5a9c..004d19a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -973,6 +973,24 @@ cmLocalUnixMakefileGenerator3
this->ConfigurationName.c_str());
if (cmd.size())
{
+ // Use "call " before any invocations of .bat or .cmd files
+ // invoked as custom commands in the WindowsShell.
+ //
+ bool useCall = false;
+
+ if (this->WindowsShell)
+ {
+ std::string suffix;
+ if (cmd.size() > 4)
+ {
+ suffix = cmSystemTools::LowerCase(cmd.substr(cmd.size()-4));
+ if (suffix == ".bat" || suffix == ".cmd")
+ {
+ useCall = true;
+ }
+ }
+ }
+
cmSystemTools::ReplaceString(cmd, "/./", "/");
// Convert the command to a relative path only if the current
// working directory will be the start-output directory.
@@ -1044,6 +1062,10 @@ cmLocalUnixMakefileGenerator3
}
}
}
+ if (useCall && launcher.empty())
+ {
+ cmd = "call " + cmd;
+ }
commands1.push_back(cmd);
}
}
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 8df0ffa..57d8653 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -37,7 +37,7 @@ class cmVS10XMLParser : public cmXMLParser
{
return;
}
- if(strcmp("ProjectGUID", name) == 0)
+ if(strcmp("ProjectGUID", name) == 0 || strcmp("ProjectGuid", name) == 0)
{
this->DoGUID = true;
}
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 2cf840d..539816d 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1142,6 +1142,10 @@ void cmLocalVisualStudio6Generator
// Get extra linker options for this target type.
std::string extraLinkOptions;
+ std::string extraLinkOptionsDebug;
+ std::string extraLinkOptionsRelease;
+ std::string extraLinkOptionsMinSizeRel;
+ std::string extraLinkOptionsRelWithDebInfo;
if(target.GetType() == cmTarget::EXECUTABLE)
{
extraLinkOptions =
@@ -1165,6 +1169,33 @@ void cmLocalVisualStudio6Generator
extraLinkOptions += targetLinkFlags;
}
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_DEBUG"))
+ {
+ extraLinkOptionsDebug += " ";
+ extraLinkOptionsDebug += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELEASE"))
+ {
+ extraLinkOptionsRelease += " ";
+ extraLinkOptionsRelease += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_MINSIZEREL"))
+ {
+ extraLinkOptionsMinSizeRel += " ";
+ extraLinkOptionsMinSizeRel += targetLinkFlags;
+ }
+
+ if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
+ {
+ extraLinkOptionsRelWithDebInfo += " ";
+ extraLinkOptionsRelWithDebInfo += targetLinkFlags;
+ }
+
+
+
+
// Get standard libraries for this language.
if(targetBuilds)
{
@@ -1259,13 +1290,21 @@ void cmLocalVisualStudio6Generator
target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY)
{
- this->ComputeLinkOptions(target, "Debug", extraLinkOptions,
+ extraLinkOptionsDebug =
+ extraLinkOptions + " " + extraLinkOptionsDebug;
+ extraLinkOptionsRelease =
+ extraLinkOptions + " " + extraLinkOptionsRelease;
+ extraLinkOptionsMinSizeRel =
+ extraLinkOptions + " " + extraLinkOptionsMinSizeRel;
+ extraLinkOptionsRelWithDebInfo =
+ extraLinkOptions + " " + extraLinkOptionsRelWithDebInfo;
+ this->ComputeLinkOptions(target, "Debug", extraLinkOptionsDebug,
optionsDebug);
- this->ComputeLinkOptions(target, "Release", extraLinkOptions,
+ this->ComputeLinkOptions(target, "Release", extraLinkOptionsRelease,
optionsRelease);
- this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptions,
+ this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel,
optionsMinSizeRel);
- this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptions,
+ this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptionsRelWithDebInfo,
optionsRelWithDebInfo);
}
@@ -1342,11 +1381,43 @@ void cmLocalVisualStudio6Generator
cmSystemTools::Error("Error Reading ", this->DSPHeaderTemplate.c_str());
}
std::string staticLibOptions;
+ std::string staticLibOptionsDebug;
+ std::string staticLibOptionsRelease;
+ std::string staticLibOptionsMinSizeRel;
+ std::string staticLibOptionsRelWithDebInfo;
if(target.GetType() == cmTarget::STATIC_LIBRARY )
{
if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
{
staticLibOptions = libflags;
+ staticLibOptionsDebug = libflags;
+ staticLibOptionsRelease = libflags;
+ staticLibOptionsMinSizeRel = libflags;
+ staticLibOptionsRelWithDebInfo = libflags;
+ }
+ if(const char* libflagsDebug =
+ target.GetProperty("STATIC_LIBRARY_FLAGS_DEBUG"))
+ {
+ staticLibOptionsDebug += " ";
+ staticLibOptionsDebug = libflagsDebug;
+ }
+ if(const char* libflagsRelease =
+ target.GetProperty("STATIC_LIBRARY_FLAGS_RELEASE"))
+ {
+ staticLibOptionsRelease += " ";
+ staticLibOptionsRelease = libflagsRelease;
+ }
+ if(const char* libflagsMinSizeRel =
+ target.GetProperty("STATIC_LIBRARY_FLAGS_MINSIZEREL"))
+ {
+ staticLibOptionsMinSizeRel += " ";
+ staticLibOptionsMinSizeRel = libflagsMinSizeRel;
+ }
+ if(const char* libflagsRelWithDebInfo =
+ target.GetProperty("STATIC_LIBRARY_FLAGS_RELWITHDEBINFO"))
+ {
+ staticLibOptionsRelWithDebInfo += " ";
+ staticLibOptionsRelWithDebInfo = libflagsRelWithDebInfo;
}
}
@@ -1378,6 +1449,14 @@ void cmLocalVisualStudio6Generator
mfcFlag);
if(target.GetType() == cmTarget::STATIC_LIBRARY )
{
+ cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_DEBUG",
+ staticLibOptionsDebug.c_str());
+ cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_RELEASE",
+ staticLibOptionsRelease.c_str());
+ cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_MINSIZEREL",
+ staticLibOptionsMinSizeRel.c_str());
+ cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS_RELWITHDEBINFO",
+ staticLibOptionsRelWithDebInfo.c_str());
cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS",
staticLibOptions.c_str());
}
@@ -1420,7 +1499,7 @@ void cmLocalVisualStudio6Generator
outputNameDebug.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELEASE",
outputNameRelease.c_str());
- cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL",
+ cmSystemTools::ReplaceString(line, "OUTPUT_NAME_MINSIZEREL",
outputNameMinSizeRel.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO",
outputNameRelWithDebInfo.c_str());
@@ -1431,7 +1510,7 @@ void cmLocalVisualStudio6Generator
optionsDebug.c_str());
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE",
optionsRelease.c_str());
- cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL",
+ cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL",
optionsMinSizeRel.c_str());
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO",
optionsRelWithDebInfo.c_str());
@@ -1519,41 +1598,18 @@ void cmLocalVisualStudio6Generator
std::string flagVar = baseFlagVar + "_RELEASE";
flagsRelease = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsRelease += " -DCMAKE_INTDIR=\\\"Release\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_RELEASE"))
- {
- flagsRelease += targetLinkFlags;
- flagsRelease += " ";
- }
+
flagVar = baseFlagVar + "_MINSIZEREL";
flagsMinSize = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsMinSize += " -DCMAKE_INTDIR=\\\"MinSizeRel\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_MINSIZEREL"))
- {
- flagsMinSize += targetLinkFlags;
- flagsMinSize += " ";
- }
-
+
flagVar = baseFlagVar + "_DEBUG";
flagsDebug = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsDebug += " -DCMAKE_INTDIR=\\\"Debug\\\" ";
- if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_DEBUG"))
- {
- flagsDebug += targetLinkFlags;
- flagsDebug += " ";
- }
flagVar = baseFlagVar + "_RELWITHDEBINFO";
flagsDebugRel = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsDebugRel += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
- if(const char* targetLinkFlags =
- target.GetProperty("LINK_FLAGS_RELWITHDEBINFO"))
- {
- flagsDebugRel += targetLinkFlags;
- flagsDebugRel += " ";
- }
-
}
// if unicode is not found, then add -D_MBCS
@@ -1619,7 +1675,7 @@ void cmLocalVisualStudio6Generator
// There are not separate CXX and C template files, so we use the same
// variable names. The previous code sets up flags* variables to contain
// the correct C or CXX flags
- cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL",
+ cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_MINSIZEREL",
flagsMinSize.c_str());
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS_DEBUG",
flagsDebug.c_str());
@@ -1629,7 +1685,7 @@ void cmLocalVisualStudio6Generator
flagsRelease.c_str());
cmSystemTools::ReplaceString(line, "CMAKE_CXX_FLAGS", flags.c_str());
- cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_MINSIZE",
+ cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_MINSIZEREL",
minsizeDefines.c_str());
cmSystemTools::ReplaceString(line, "COMPILE_DEFINITIONS_DEBUG",
debugDefines.c_str());
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1af0d1d..e411d3e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -234,9 +234,11 @@ 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 =
+ const char* dsprule =
this->Makefile->GetRequiredDefinition("CMAKE_COMMAND");
cmCustomCommandLine commandLine;
commandLine.push_back(dsprule);
@@ -261,16 +263,20 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
START_OUTPUT, UNCHANGED, true);
commandLine.push_back(args);
commandLine.push_back("--check-stamp-file");
- commandLine.push_back(stampName.c_str());
+ std::string stampFilename = this->Convert(stampName.c_str(), FULL,
+ SHELL);
+ commandLine.push_back(stampFilename.c_str());
std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
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()))
{
@@ -913,7 +919,20 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
}
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"" << tool << "\"\n";
- if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
+
+ std::string libflags;
+ if(const char* flags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
+ {
+ libflags += flags;
+ }
+ std::string libFlagsConfig = "STATIC_LIBRARY_FLAGS_";
+ libFlagsConfig += configTypeUpper;
+ if(const char* flagsConfig = target.GetProperty(libFlagsConfig.c_str()))
+ {
+ libflags += " ";
+ libflags += flagsConfig;
+ }
+ if(!libflags.empty())
{
fout << "\t\t\t\tAdditionalOptions=\"" << libflags << "\"\n";
}
@@ -978,7 +997,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
temp = target.GetDirectory(configName);
temp += "/";
temp += targetNamePDB;
- fout << "\t\t\t\tProgramDataBaseFile=\"" <<
+ fout << "\t\t\t\tProgramDatabaseFile=\"" <<
this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
if(isDebug)
{
@@ -1053,7 +1072,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\"\n";
std::string path = this->ConvertToXMLOutputPathSingle(
target.GetDirectory(configName).c_str());
- fout << "\t\t\t\tProgramDataBaseFile=\""
+ fout << "\t\t\t\tProgramDatabaseFile=\""
<< path << "/" << targetNamePDB
<< "\"\n";
if(isDebug)
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 83d8dec..ed0b07f 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -169,7 +169,7 @@ cmLocalVisualStudioGenerator
script += newline;
newline = newline_text;
script += "cd ";
- script += this->Convert(workingDirectory, START_OUTPUT, SHELL);
+ script += this->Convert(workingDirectory, FULL, SHELL);
// Change the working drive.
if(workingDirectory[0] && workingDirectory[1] == ':')
@@ -230,7 +230,15 @@ cmLocalVisualStudioGenerator
escapeAllowMakeVars);
}
}
+
+ // After each custom command, check for an error result.
+ // If there was an error, jump to the VCReportError label,
+ // skipping the run of any subsequent commands in this
+ // sequence.
+ //
+ script += newline_text;
+ script += "if errorlevel 1 goto VCReportError";
}
+
return script;
}
-
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d09188a..8eece6b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -124,7 +124,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->LocalGenerator = mf.LocalGenerator;
this->FunctionBlockers = mf.FunctionBlockers;
- this->DataMap = mf.DataMap;
this->MacrosMap = mf.MacrosMap;
this->SubDirectoryOrder = mf.SubDirectoryOrder;
this->Properties = mf.Properties;
@@ -200,14 +199,6 @@ cmMakefile::~cmMakefile()
{
delete this->UsedCommands[i];
}
- for(DataMapType::const_iterator d = this->DataMap.begin();
- d != this->DataMap.end(); ++d)
- {
- if(d->second)
- {
- delete d->second;
- }
- }
std::vector<cmFunctionBlocker*>::iterator pos;
for (pos = this->FunctionBlockers.begin();
pos != this->FunctionBlockers.end(); ++pos)
@@ -2368,11 +2359,9 @@ void cmMakefile::AddDefaultDefinitions()
this->AddDefinition("CMAKE_MAJOR_VERSION", temp);
sprintf(temp, "%d", cmVersion::GetPatchVersion());
this->AddDefinition("CMAKE_PATCH_VERSION", temp);
- sprintf(temp, "%u.%u.%u",
- cmVersion::GetMajorVersion(),
- cmVersion::GetMinorVersion(),
- cmVersion::GetPatchVersion());
- this->AddDefinition("CMAKE_VERSION", temp);
+ sprintf(temp, "%d", cmVersion::GetTweakVersion());
+ this->AddDefinition("CMAKE_TWEAK_VERSION", temp);
+ this->AddDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
this->AddDefinition("CMAKE_FILES_DIRECTORY",
cmake::GetCMakeFilesDirectory());
@@ -2593,54 +2582,6 @@ void cmMakefile::SetHomeOutputDirectory(const char* lib)
}
}
-
-/**
- * Register the given cmData instance with its own name.
- */
-void cmMakefile::RegisterData(cmData* data)
-{
- std::string name = data->GetName();
- DataMapType::const_iterator d = this->DataMap.find(name);
- if((d != this->DataMap.end()) && (d->second != 0) && (d->second != data))
- {
- delete d->second;
- }
- this->DataMap[name] = data;
-}
-
-
-/**
- * Register the given cmData instance with the given name. This can be used
- * to register a NULL pointer.
- */
-void cmMakefile::RegisterData(const char* name, cmData* data)
-{
- DataMapType::const_iterator d = this->DataMap.find(name);
- if((d != this->DataMap.end()) && (d->second != 0) && (d->second != data))
- {
- delete d->second;
- }
- this->DataMap[name] = data;
-}
-
-
-/**
- * Lookup a cmData instance previously registered with the given name. If
- * the instance cannot be found, return NULL.
- */
-cmData* cmMakefile::LookupData(const char* name) const
-{
- DataMapType::const_iterator d = this->DataMap.find(name);
- if(d != this->DataMap.end())
- {
- return d->second;
- }
- else
- {
- return 0;
- }
-}
-
//----------------------------------------------------------------------------
cmSourceFile* cmMakefile::GetSource(const char* sourceName)
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 63f81b8..4fae7ee 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -13,7 +13,6 @@
#define cmMakefile_h
#include "cmCacheManager.h"
-#include "cmData.h"
#include "cmExecutionStatus.h"
#include "cmListFileCache.h"
#include "cmPolicies.h"
@@ -692,10 +691,6 @@ public:
std::vector<cmSourceGroup> &groups);
#endif
- void RegisterData(cmData*);
- void RegisterData(const char*, cmData*);
- cmData* LookupData(const char*) const;
-
/**
* Execute a single CMake command. Returns true if the command
* succeeded or false if it failed.
@@ -916,9 +911,6 @@ private:
void PushFunctionBlockerBarrier();
void PopFunctionBlockerBarrier(bool reportError = true);
- typedef std::map<cmStdString, cmData*> DataMapType;
- DataMapType DataMap;
-
typedef std::map<cmStdString, cmStdString> StringStringMap;
StringStringMap MacrosMap;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e7c4a7d..93c981a 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -229,10 +229,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Add language feature flags.
this->AddFeatureFlags(flags, linkLanguage);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
linkLanguage, this->ConfigName);
-#endif /* __APPLE__ */
// Add target-specific linker flags.
this->LocalGenerator->AppendFlags
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index f351174..dff91fe 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -122,6 +122,10 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
std::string extraFlags;
this->LocalGenerator->AppendFlags
(extraFlags,this->Target->GetProperty("STATIC_LIBRARY_FLAGS"));
+ std::string staticLibraryFlagsConfig = "STATIC_LIBRARY_FLAGS_";
+ staticLibraryFlagsConfig += cmSystemTools::UpperCase(this->ConfigName);
+ this->LocalGenerator->AppendFlags
+ (extraFlags, this->Target->GetProperty(staticLibraryFlagsConfig.c_str()));
this->WriteLibraryRules(linkRuleVar.c_str(), extraFlags.c_str(), false);
}
@@ -682,10 +686,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string langFlags;
this->AddFeatureFlags(langFlags, linkLanguage);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(langFlags, this->Target,
linkLanguage, this->ConfigName);
-#endif /* __APPLE__ */
// remove any language flags that might not work with the
// particular os
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index eae7101..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)
@@ -294,10 +297,8 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
// Add language feature flags.
this->AddFeatureFlags(flags, lang);
-#ifdef __APPLE__
this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
lang, this->ConfigName);
-#endif /* __APPLE__ */
// Fortran-specific flags computed for this target.
if(*l == "Fortran")
@@ -1439,11 +1440,15 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
//----------------------------------------------------------------------------
std::string cmMakefileTargetGenerator::GetFrameworkFlags()
{
-#ifndef __APPLE__
- return std::string();
-#else
- std::set<cmStdString> emitted;
+ if(!this->Makefile->IsOn("APPLE"))
+ {
+ return std::string();
+ }
+
+ std::set<cmStdString> emitted;
+#ifdef __APPLE__ /* don't insert this when crosscompiling e.g. to iphone */
emitted.insert("/System/Library/Frameworks");
+#endif
std::vector<std::string> includes;
this->LocalGenerator->GetIncludeDirectories(includes);
std::vector<std::string>::iterator i;
@@ -1475,7 +1480,6 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
}
}
return flags;
-#endif
}
//----------------------------------------------------------------------------
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 2d41d40..69d3e51 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -3,6 +3,7 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmVersion.h"
+#include "cmVersionMacros.h"
#include <map>
#include <set>
#include <queue>
@@ -22,6 +23,7 @@ public:
unsigned int majorVersionIntroduced,
unsigned int minorVersionIntroduced,
unsigned int patchVersionIntroduced,
+ unsigned int tweakVersionIntroduced,
cmPolicies::PolicyStatus status)
{
if (!idString || !shortDescription || ! longDescription)
@@ -37,21 +39,26 @@ public:
this->MajorVersionIntroduced = majorVersionIntroduced;
this->MinorVersionIntroduced = minorVersionIntroduced;
this->PatchVersionIntroduced = patchVersionIntroduced;
+ this->TweakVersionIntroduced = tweakVersionIntroduced;
this->Status = status;
}
std::string GetVersionString()
{
- cmOStringStream error;
- error << this->MajorVersionIntroduced << "." <<
- this->MinorVersionIntroduced << "." <<
- this->PatchVersionIntroduced;
- return error.str();
+ cmOStringStream v;
+ v << this->MajorVersionIntroduced << "." << this->MinorVersionIntroduced;
+ v << "." << this->PatchVersionIntroduced;
+ if(this->TweakVersionIntroduced > 0)
+ {
+ v << "." << this->TweakVersionIntroduced;
+ }
+ return v.str();
}
bool IsPolicyNewerThan(unsigned int majorV,
unsigned int minorV,
- unsigned int patchV)
+ unsigned int patchV,
+ unsigned int tweakV)
{
if (majorV < this->MajorVersionIntroduced)
{
@@ -69,7 +76,15 @@ public:
{
return false;
}
- return (patchV < this->PatchVersionIntroduced);
+ if (patchV < this->PatchVersionIntroduced)
+ {
+ return true;
+ }
+ if (patchV > this->PatchVersionIntroduced)
+ {
+ return false;
+ }
+ return (tweakV < this->TweakVersionIntroduced);
}
cmPolicies::PolicyID ID;
@@ -79,6 +94,7 @@ public:
unsigned int MajorVersionIntroduced;
unsigned int MinorVersionIntroduced;
unsigned int PatchVersionIntroduced;
+ unsigned int TweakVersionIntroduced;
cmPolicies::PolicyStatus Status;
};
@@ -110,7 +126,7 @@ cmPolicies::cmPolicies()
"The NEW behavior is to issue an error instead of a warning. "
"An included file may set CMP0000 explicitly to affect how this "
"policy is enforced for the main CMakeLists.txt file.",
- 2,6,0, cmPolicies::WARN
+ 2,6,0,0, cmPolicies::WARN
);
this->DefinePolicy(
@@ -126,7 +142,7 @@ cmPolicies::cmPolicies()
"and the cmake_policy command. "
"However, CMake must still check CMAKE_BACKWARDS_COMPATIBILITY for "
"projects written for CMake 2.4 and below.",
- 2,6,0, cmPolicies::WARN
+ 2,6,0,0, cmPolicies::WARN
);
this->DefinePolicy(
@@ -148,7 +164,7 @@ cmPolicies::cmPolicies()
"Custom targets must simply have globally unique names (unless one "
"uses the global property ALLOW_DUPLICATE_CUSTOM_TARGETS with a "
"Makefiles generator).",
- 2,6,0, cmPolicies::WARN
+ 2,6,0,0, cmPolicies::WARN
);
this->DefinePolicy(
@@ -213,7 +229,7 @@ cmPolicies::cmPolicies()
"Note that the warning for this policy will be issued for at most "
"one target. This avoids flooding users with messages for every "
"target when setting the policy once will probably fix all targets.",
- 2,6,0, cmPolicies::WARN);
+ 2,6,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0004, "CMP0004",
@@ -229,7 +245,7 @@ cmPolicies::cmPolicies()
"The setting for this policy used when checking the library names is "
"that in effect when the target is created by an add_executable or "
"add_library command.",
- 2,6,0, cmPolicies::WARN);
+ 2,6,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0005, "CMP0005",
@@ -250,7 +266,7 @@ cmPolicies::cmPolicies()
"for all native build tools automatically. "
"See documentation of the COMPILE_DEFINITIONS target property for "
"limitations of the escaping implementation.",
- 2,6,0, cmPolicies::WARN);
+ 2,6,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0006, "CMP0006",
@@ -268,7 +284,7 @@ cmPolicies::cmPolicies()
"DESTINATION if a BUNDLE DESTINATION is not given. "
"The NEW behavior for this policy is to produce an error if a bundle "
"target is installed without a BUNDLE DESTINATION.",
- 2,6,0, cmPolicies::WARN);
+ 2,6,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0007, "CMP0007",
@@ -280,7 +296,7 @@ cmPolicies::cmPolicies()
"The OLD behavior for this policy is to ignore empty list elements. "
"The NEW behavior for this policy is to correctly count empty "
"elements in a list. ",
- 2,6,0, cmPolicies::WARN);
+ 2,6,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0008, "CMP0008",
@@ -306,7 +322,7 @@ cmPolicies::cmPolicies()
"path and ask the linker to search for it. "
"The NEW behavior for this policy is to trust the given path and "
"pass it directly to the native build tool unchanged.",
- 2,6,1, cmPolicies::WARN);
+ 2,6,1,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0009, "CMP0009",
@@ -322,7 +338,7 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is not to follow the symlinks "
"by default, but only if FOLLOW_SYMLINKS is given as an additional "
"argument to the FILE command.",
- 2,6,2, cmPolicies::WARN);
+ 2,6,2,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0010, "CMP0010",
@@ -334,7 +350,7 @@ cmPolicies::cmPolicies()
"The OLD behavior for this policy is to warn about the error, leave "
"the string untouched, and continue. "
"The NEW behavior for this policy is to report an error.",
- 2,6,3, cmPolicies::WARN);
+ 2,6,3,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0011, "CMP0011",
@@ -354,7 +370,7 @@ cmPolicies::cmPolicies()
"include() and find_package() commands. "
"The NEW behavior for this policy is to allow the commands to do their "
"default cmake_policy PUSH and POP.",
- 2,6,3, cmPolicies::WARN);
+ 2,6,3,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0012, "CMP0012",
@@ -376,7 +392,7 @@ cmPolicies::cmPolicies()
"named like numbers and boolean constants. "
"The NEW behavior for this policy is to recognize numbers and "
"boolean constants without dereferencing variables with such names.",
- 2,8,0, cmPolicies::WARN);
+ 2,8,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0013, "CMP0013",
@@ -393,7 +409,7 @@ cmPolicies::cmPolicies()
"directories. "
"The NEW behavior for this policy is to disallow duplicate binary "
"directories with an error.",
- 2,8,0, cmPolicies::WARN);
+ 2,8,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0014, "CMP0014",
@@ -405,7 +421,7 @@ cmPolicies::cmPolicies()
"the case is an error. "
"The OLD behavior for this policy is to silently ignore the problem. "
"The NEW behavior for this policy is to report an error.",
- 2,8,0, cmPolicies::WARN);
+ 2,8,0,0, cmPolicies::WARN);
this->DefinePolicy(
CMP0015, "CMP0015",
@@ -420,7 +436,7 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is to convert relative paths to "
"absolute paths by appending the relative path to "
"CMAKE_CURRENT_SOURCE_DIR.",
- 2,8,1, cmPolicies::WARN);
+ 2,8,1,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
@@ -441,6 +457,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
unsigned int majorVersionIntroduced,
unsigned int minorVersionIntroduced,
unsigned int patchVersionIntroduced,
+ unsigned int tweakVersionIntroduced,
cmPolicies::PolicyStatus status)
{
// a policy must be unique and can only be defined once
@@ -457,6 +474,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
majorVersionIntroduced,
minorVersionIntroduced,
patchVersionIntroduced,
+ tweakVersionIntroduced,
status);
this->PolicyStringMap[idString] = iD;
}
@@ -475,14 +493,15 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
unsigned int majorVer = 2;
unsigned int minorVer = 0;
unsigned int patchVer = 0;
+ unsigned int tweakVer = 0;
// parse the string
- if(sscanf(ver.c_str(), "%u.%u.%u",
- &majorVer, &minorVer, &patchVer) < 2)
+ if(sscanf(ver.c_str(), "%u.%u.%u.%u",
+ &majorVer, &minorVer, &patchVer, &tweakVer) < 2)
{
cmOStringStream e;
e << "Invalid policy version value \"" << ver << "\". "
- << "A numeric major.minor[.patch] must be given.";
+ << "A numeric major.minor[.patch[.tweak]] must be given.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
@@ -510,7 +529,11 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
minorVer > cmVersion::GetMinorVersion()) ||
(majorVer == cmVersion::GetMajorVersion() &&
minorVer == cmVersion::GetMinorVersion() &&
- patchVer > cmVersion::GetPatchVersion()))
+ patchVer > cmVersion::GetPatchVersion()) ||
+ (majorVer == cmVersion::GetMajorVersion() &&
+ minorVer == cmVersion::GetMinorVersion() &&
+ patchVer == cmVersion::GetPatchVersion() &&
+ tweakVer > cmVersion::GetTweakVersion()))
{
cmOStringStream e;
e << "An attempt was made to set the policy version of CMake to \""
@@ -528,7 +551,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
= this->Policies.begin();
for (;i != this->Policies.end(); ++i)
{
- if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer))
+ if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
{
if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
{
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index aaa3ac0..23064dc 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -72,6 +72,7 @@ public:
unsigned int majorVersionIntroduced,
unsigned int minorVersionIntroduced,
unsigned int patchVersionIntroduced,
+ unsigned int tweakVersionIntroduced,
cmPolicies::PolicyStatus status);
///! Set a policy level for this listfile
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/cmProjectCommand.h b/Source/cmProjectCommand.h
index fca5f1f..fc2b7a2 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -66,7 +66,7 @@ public:
"Optionally you can specify which languages your project supports. "
"Example languages are CXX (i.e. C++), C, Fortran, etc. "
"By default C and CXX are enabled. E.g. if you do not have a "
- "C++ compiler, you can disable the check for it by explicitely listing "
+ "C++ compiler, you can disable the check for it by explicitly listing "
"the languages you want to support, e.g. C. By using the special "
"language \"NONE\" all checks for any language can be disabled.";
}
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 5fcbdba..d00fc86 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -99,7 +99,7 @@ bool cmSetCommand
}
}
- // collect any values into a single semi-colon seperated value list
+ // collect any values into a single semi-colon separated value list
if(static_cast<unsigned short>(args.size()) >
static_cast<unsigned short>(1 + ignoreLastArgs))
{
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/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 3704d6a..bc52d7f 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -404,7 +404,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
"The VS6 IDE does not support definition values with spaces "
"(but NMake does). Xcode does not support per-configuration "
"definitions on source files.\n"
- "Dislaimer: Most native build tools have poor support for escaping "
+ "Disclaimer: Most native build tools have poor support for escaping "
"certain values. CMake has work-arounds for many cases but some "
"values may just not be possible to pass correctly. If a value "
"does not seem to be escaped correctly, do not attempt to "
@@ -433,7 +433,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
("GENERATED", cmProperty::SOURCE_FILE,
"Is this source file generated as part of the build process.",
"If a source file is generated by the build process CMake will "
- "handle it differently in temrs of dependency checking etc. "
+ "handle it differently in terms of dependency checking etc. "
"Otherwise having a non-existent source file could create problems.");
cm->DefineProperty
@@ -487,7 +487,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
"For frameworks the content folder is "
"\"<name>.framework/Versions/<version>\". "
"See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target "
- "properties for specifying files meant for Headers, PrivateHeadres, "
+ "properties for specifying files meant for Headers, PrivateHeaders, "
"or Resources directories.");
cm->DefineProperty
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 5db0200..e8decbb 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -45,6 +45,7 @@
// This is a hack to prevent warnings about these functions being
// declared but not referenced.
#if defined(__sgi) && !defined(__GNUC__)
+# pragma set woff 3970 /* conversion from pointer to same-sized */
# include <sys/termios.h>
class cmStandardIncludesHack
{
@@ -240,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 d176987..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;
@@ -2048,12 +2048,13 @@ bool extract_tar(const char* outFileName, bool verbose,
if (verbose && extract)
{
cmSystemTools::Stdout("x ");
+ cmSystemTools::Stdout(archive_entry_pathname(entry));
}
if(verbose && !extract)
{
list_item_verbose(stdout, entry);
}
- else
+ else if(!extract)
{
cmSystemTools::Stdout(archive_entry_pathname(entry));
}
@@ -2135,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;
@@ -2158,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;
@@ -2937,3 +2938,18 @@ bool cmSystemTools::CheckRPath(std::string const& file,
return false;
#endif
}
+
+//----------------------------------------------------------------------------
+bool cmSystemTools::RepeatedRemoveDirectory(const char* dir)
+{
+ // Windows sometimes locks files temporarily so try a few times.
+ for(int i = 0; i < 10; ++i)
+ {
+ if(cmSystemTools::RemoveADirectory(dir))
+ {
+ return true;
+ }
+ cmSystemTools::Delay(100);
+ }
+ return false;
+}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index ed924dd..da5da31 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -436,6 +436,9 @@ public:
static bool CheckRPath(std::string const& file,
std::string const& newRPath);
+ /** Remove a directory; repeat a few times in case of locked files. */
+ static bool RepeatedRemoveDirectory(const char* dir);
+
private:
static bool s_ForceUnixPaths;
static bool s_RunCommandHideConsole;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0436bd0..45ba358 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -202,7 +202,7 @@ void cmTarget::DefineProperties(cmake *cm)
cm->DefineProperty
("HAS_CXX", cmProperty::TARGET,
- "Link the target using the C++ linker tool (obselete).",
+ "Link the target using the C++ linker tool (obsolete).",
"This is equivalent to setting the LINKER_LANGUAGE property to CXX. "
"See that property's documentation for details.");
@@ -708,6 +708,11 @@ void cmTarget::DefineProperties(cmake *cm)
"Extra flags to use when linking a static library.");
cm->DefineProperty
+ ("STATIC_LIBRARY_FLAGS_<CONFIG>", cmProperty::TARGET,
+ "Per-configuration flags for creating a static library.",
+ "This is the configuration-specific version of STATIC_LIBRARY_FLAGS.");
+
+ cm->DefineProperty
("SUFFIX", cmProperty::TARGET,
"What comes after the library name.",
"A target property that can be set to override the suffix "
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 3010fc9..4d31a14 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -361,7 +361,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
std::string errorMessage = "TRY_RUN() invoked in cross-compiling mode, "
"please set the following cache variables "
- "appropriatly:\n";
+ "appropriately:\n";
errorMessage += " " + this->RunResultVariable + " (advanced)\n";
if (out!=0)
{
diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx
index bde5f98..047d24d 100644
--- a/Source/cmVersion.cxx
+++ b/Source/cmVersion.cxx
@@ -16,8 +16,9 @@
unsigned int cmVersion::GetMajorVersion() { return CMake_VERSION_MAJOR; }
unsigned int cmVersion::GetMinorVersion() { return CMake_VERSION_MINOR; }
unsigned int cmVersion::GetPatchVersion() { return CMake_VERSION_PATCH; }
+unsigned int cmVersion::GetTweakVersion() { return CMake_VERSION_TWEAK; }
const char* cmVersion::GetCMakeVersion()
{
- return CMake_VERSION_FULL CMake_VERSION_RC_SUFFIX;
+ return CMake_VERSION;
}
diff --git a/Source/cmVersion.h b/Source/cmVersion.h
index f267ab6..e313524 100644
--- a/Source/cmVersion.h
+++ b/Source/cmVersion.h
@@ -28,6 +28,7 @@ public:
static unsigned int GetMajorVersion();
static unsigned int GetMinorVersion();
static unsigned int GetPatchVersion();
+ static unsigned int GetTweakVersion();
static const char* GetCMakeVersion();
};
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index ee6eca7..76bc8fe 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,4 +12,5 @@
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
-#cmakedefine CMake_VERSION_RC @CMake_VERSION_RC@
+#define CMake_VERSION_TWEAK @CMake_VERSION_TWEAK@
+#define CMake_VERSION "@CMake_VERSION@"
diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h
index 412db6d..67f58ca 100644
--- a/Source/cmVersionMacros.h
+++ b/Source/cmVersionMacros.h
@@ -14,22 +14,9 @@
#include "cmVersionConfig.h"
-#define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x)
-#define CMAKE_TO_STRING0(x) #x
-
-#define CMake_VERSION \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR)
-
-#define CMake_VERSION_FULL \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_PATCH)
-
-#if !(CMake_VERSION_MINOR & 1) && defined(CMake_VERSION_RC)
-# define CMake_VERSION_RC_SUFFIX "-rc" CMAKE_TO_STRING(CMake_VERSION_RC)
-#else
-# define CMake_VERSION_RC_SUFFIX ""
+#define CMake_VERSION_TWEAK_IS_RELEASE(tweak) ((tweak) < 20000000)
+#if CMake_VERSION_TWEAK_IS_RELEASE(CMake_VERSION_TWEAK)
+# define CMake_VERSION_IS_RELEASE 1
#endif
#endif
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4a8e161..59e20d5 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -435,12 +435,16 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
none.push_back(sf);
}
}
+
+ this->AddMissingSourceGroups(groupsUsed, sourceGroups);
+
// Write out group file
std::string path = this->Makefile->GetStartOutputDirectory();
path += "/";
path += this->Name;
path += ".vcxproj.filters";
cmGeneratedFileStream fout(path.c_str());
+ fout.SetCopyIfDifferent(true);
char magic[] = {0xEF,0xBB, 0xBF};
fout.write(magic, 3);
cmGeneratedFileStream* save = this->BuildFileStream;
@@ -484,9 +488,60 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
this->WriteString("</Project>\n", 0);
// restore stream pointer
this->BuildFileStream = save;
+
+ if (fout.Close())
+ {
+ this->GlobalGenerator->FileReplacedDuringGenerate(path);
+ }
}
-void
+// 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,
std::vector<cmSourceFile*> const& sources,
@@ -854,6 +909,13 @@ OutputLinkIncremental(std::string const& configName)
flags += " ";
flags += targetLinkFlags;
}
+ std::string flagsProp = "LINK_FLAGS_";
+ flagsProp += CONFIG;
+ if(const char* flagsConfig = this->Target->GetProperty(flagsProp.c_str()))
+ {
+ flags += " ";
+ flags += flagsConfig;
+ }
if(flags.find("INCREMENTAL:NO") != flags.npos)
{
incremental = "false";
@@ -1010,22 +1072,27 @@ WriteRCOptions(std::string const& ,
}
-void cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const&
- )
+void
+cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
{
if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
{
return;
}
- if(const char* libflags = this->Target
- ->GetProperty("STATIC_LIBRARY_FLAGS"))
+ const char* libflags = this->Target->GetProperty("STATIC_LIBRARY_FLAGS");
+ std::string flagsConfigVar = "STATIC_LIBRARY_FLAGS_";
+ flagsConfigVar += cmSystemTools::UpperCase(config);
+ const char* libflagsConfig =
+ this->Target->GetProperty(flagsConfigVar.c_str());
+ if(libflags || libflagsConfig)
{
this->WriteString("<Lib>\n", 2);
cmVisualStudioGeneratorOptions
libOptions(this->LocalGenerator, 10,
cmVisualStudioGeneratorOptions::Linker,
cmVS10LibFlagTable, 0, this);
- libOptions.Parse(libflags);
+ libOptions.Parse(libflags?libflags:"");
+ libOptions.Parse(libflagsConfig?libflagsConfig:"");
libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
libOptions.OutputFlagMap(*this->BuildFileStream, " ");
this->WriteString("</Lib>\n", 2);
@@ -1093,6 +1160,13 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
flags += " ";
flags += targetLinkFlags;
}
+ std::string flagsProp = "LINK_FLAGS_";
+ flagsProp += CONFIG;
+ if(const char* flagsConfig = this->Target->GetProperty(flagsProp.c_str()))
+ {
+ flags += " ";
+ flags += flagsConfig;
+ }
cmVisualStudioGeneratorOptions
linkOptions(this->LocalGenerator, 10,
cmVisualStudioGeneratorOptions::Linker,
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/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx
index c8b4ae4..d9bd26c 100644
--- a/Source/cmWin32ProcessExecution.cxx
+++ b/Source/cmWin32ProcessExecution.cxx
@@ -22,7 +22,8 @@
#if defined(__BORLANDC__)
# define STRICMP stricmp
# define TO_INTPTR(x) ((long)(x))
-#else // Visual studio
+#endif // Borland
+#if defined(_MSC_VER) // Visual studio
# if ( _MSC_VER >= 1300 )
# include <stddef.h>
# define TO_INTPTR(x) ((intptr_t)(x))
@@ -30,7 +31,12 @@
# define TO_INTPTR(x) ((long)(x))
# endif // Visual studio .NET
# define STRICMP _stricmp
-#endif // Borland
+#endif // Visual Studio
+#if defined(__MINGW32__)
+# include <stdint.h>
+# define TO_INTPTR(x) ((intptr_t)(x))
+# define STRICMP _stricmp
+#endif // MinGW
#define POPEN_1 1
#define POPEN_2 2
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index f46b87f..b2acb2b 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -54,24 +54,18 @@ bool cmWriteFileCommand
std::string dir = cmSystemTools::GetFilenamePath(fileName);
cmSystemTools::MakeDirectory(dir.c_str());
- mode_t mode =
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
- S_IREAD | S_IWRITE
-#elif defined( __BORLANDC__ )
- S_IRUSR | S_IWUSR
-#else
- 0666
-#endif
- ;
+ mode_t mode = 0;
// Set permissions to writable
if ( cmSystemTools::GetPermissions(fileName.c_str(), mode) )
{
cmSystemTools::SetPermissions(fileName.c_str(),
#if defined( _MSC_VER ) || defined( __MINGW32__ )
- S_IREAD | S_IWRITE
+ mode | S_IWRITE
+#elif defined( __BORLANDC__ )
+ mode | S_IWUSR
#else
- 0666
+ mode | S_IWUSR | S_IWGRP
#endif
);
}
@@ -89,7 +83,10 @@ bool cmWriteFileCommand
}
file << message << std::endl;
file.close();
- cmSystemTools::SetPermissions(fileName.c_str(), mode);
+ if(mode)
+ {
+ cmSystemTools::SetPermissions(fileName.c_str(), mode);
+ }
return true;
}
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..0f9ef1b 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);
@@ -964,7 +954,7 @@ void CMakeCommandUsage(const char* program)
<< " echo [string]... - displays arguments as text\n"
<< " echo_append [string]... - displays arguments as text but no new "
"line\n"
- << " environment - display the current enviroment\n"
+ << " environment - display the current environment\n"
<< " make_directory dir - create a directory\n"
<< " md5sum file1 [...] - compute md5sum of files\n"
<< " remove_directory dir - remove a directory and its contents\n"
@@ -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/ctest.cxx b/Source/ctest.cxx
index c9b875d..24921c4 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -218,6 +218,10 @@ static const char * cmDocumentationOptions[][3] =
{"--timeout <seconds>", "Set a global timeout on all tests.",
"This option will set a global timeout on all tests that do not already "
"have a timeout set on them."},
+ {"--stop-time <time>", "Set a time at which all tests should stop running.",
+ "Set a real time of day at which all tests should timeout. Example: "
+ "7:00:00 -0400. Any time format understood by the curl date parser is "
+ "accepted. Local time is assumed if no timezone is specified."},
{"--http1.0", "Submit using HTTP 1.0.",
"This option will force CTest to use HTTP 1.0 to submit files to the "
"dashboard, instead of HTTP 1.1."},
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 62042e8..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)
@@ -309,6 +303,14 @@ IF(NOT KWSYS_IN_SOURCE_BUILD)
${PROJECT_BINARY_DIR}/kwsysPrivate.h COPY_ONLY IMMEDIATE)
ENDIF(NOT KWSYS_IN_SOURCE_BUILD)
+# Select plugin module file name convention.
+IF(NOT KWSYS_DynamicLoader_PREFIX)
+ SET(KWSYS_DynamicLoader_PREFIX ${CMAKE_SHARED_MODULE_PREFIX})
+ENDIF()
+IF(NOT KWSYS_DynamicLoader_SUFFIX)
+ SET(KWSYS_DynamicLoader_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX})
+ENDIF()
+
#-----------------------------------------------------------------------------
# We require ANSI support from the C compiler. Add any needed flags.
IF(CMAKE_ANSI_CFLAGS)
@@ -597,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}")
@@ -774,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)
@@ -1087,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.
@@ -1114,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.h.in b/Source/kwsys/Configure.h.in
index 97b2c5d..15986cf 100644
--- a/Source/kwsys/Configure.h.in
+++ b/Source/kwsys/Configure.h.in
@@ -28,6 +28,10 @@
# if defined(__INTEL_COMPILER)
# pragma warning (disable: 1572) /* floating-point equality test */
# endif
+# if defined(__sgi) && !defined(__GNUC__)
+# pragma set woff 3970 /* pointer to int conversion */
+# pragma set woff 3968 /* 64 bit conversion */
+# endif
#endif
/* Whether kwsys namespace is "kwsys". */
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/DynamicLoader.cxx b/Source/kwsys/DynamicLoader.cxx
index a337031..c4ee095 100644
--- a/Source/kwsys/DynamicLoader.cxx
+++ b/Source/kwsys/DynamicLoader.cxx
@@ -69,19 +69,6 @@ DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const char* sy
return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
}
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
-{
- return ".sl";
-}
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
// TODO: Need implementation with errno/strerror
@@ -176,21 +163,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
}
//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
-{
- // NSCreateObjectFileImageFromFile fail when dealing with dylib image
- // it returns NSObjectFileImageInappropriateFile
- //return ".dylib";
- return ".so";
-}
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
return 0;
@@ -285,22 +257,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
}
//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
-{
-#ifdef __MINGW32__
- return "lib";
-#else
- return "";
-#endif
-}
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
-{
- return ".dll";
-}
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
LPVOID lpMsgBuf=NULL;
@@ -418,18 +374,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
}
//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
-{
- return ".so";
-}
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
const char *retval = strerror(last_dynamic_err);
@@ -444,7 +388,7 @@ const char* DynamicLoader::LastError()
// 5. Implementation for systems without dynamic libs
// __gnu_blrts__ is IBM BlueGene/L
// __LIBCATAMOUNT__ is defined on Catamount on Cray compute nodes
-#if defined(__gnu_blrts__) || defined(__LIBCATAMOUNT__)
+#if defined(__gnu_blrts__) || defined(__LIBCATAMOUNT__) || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
#include <string.h> // for strerror()
#define DYNAMICLOADER_DEFINED 1
@@ -476,18 +420,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
}
//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
- {
- return "lib";
- }
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
- {
- return ".a";
- }
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
return "General error";
@@ -540,22 +472,6 @@ DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
}
//----------------------------------------------------------------------------
-const char* DynamicLoader::LibPrefix()
-{
- return "lib";
-}
-
-//----------------------------------------------------------------------------
-const char* DynamicLoader::LibExtension()
-{
-#ifdef __CYGWIN__
- return ".dll";
-#else
- return ".so";
-#endif
-}
-
-//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
return dlerror();
diff --git a/Source/kwsys/DynamicLoader.hxx.in b/Source/kwsys/DynamicLoader.hxx.in
index 325e956..64468ec 100644
--- a/Source/kwsys/DynamicLoader.hxx.in
+++ b/Source/kwsys/DynamicLoader.hxx.in
@@ -86,11 +86,11 @@ public:
/** Find the address of the symbol in the given library. */
static SymbolPointer GetSymbolAddress(LibraryHandle, const char*);
- /** Return the library prefix for the given architecture */
- static const char* LibPrefix();
+ /** Return the default module prefix for the current platform. */
+ static const char* LibPrefix() { return "@KWSYS_DynamicLoader_PREFIX@"; }
- /** Return the library extension for the given architecture. */
- static const char* LibExtension();
+ /** Return the default module suffix for the current platform. */
+ static const char* LibExtension() { return "@KWSYS_DynamicLoader_SUFFIX@"; }
/** Return the last error produced from a calls made on this class. */
static const char* LastError();
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 373e906..9c66a44 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -720,6 +720,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}
+ /* Make sure we have something to run. */
+ if(cp->NumberOfCommands < 1)
+ {
+ strcpy(cp->ErrorMessage, "No command");
+ cp->State = kwsysProcess_State_Error;
+ return;
+ }
+
/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{
@@ -2373,9 +2381,13 @@ static pid_t kwsysProcessFork(kwsysProcess* cp,
Here we define the command to call on each platform and the
corresponding parsing format string. The parsing format should
have two integers to store: the pid and then the ppid. */
-#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) \
+ || defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
# define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
# define KWSYSPE_PS_FORMAT "%d %d\n"
+#elif defined(__sun) && (defined(__SVR4) || defined(__svr4__)) /* Solaris */
+# define KWSYSPE_PS_COMMAND "ps -e -o pid,ppid"
+# define KWSYSPE_PS_FORMAT "%d %d\n"
#elif defined(__hpux) || defined(__sun__) || defined(__sgi) || defined(_AIX) \
|| defined(__sparc)
# define KWSYSPE_PS_COMMAND "ps -ef"
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index c5ea6db..5aa4d8b 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -987,6 +987,14 @@ void kwsysProcess_Execute(kwsysProcess* cp)
return;
}
+ /* Make sure we have something to run. */
+ if(cp->NumberOfCommands < 1)
+ {
+ strcpy(cp->ErrorMessage, "No command");
+ cp->State = kwsysProcess_State_Error;
+ return;
+ }
+
/* Initialize the control structure for a new process. */
if(!kwsysProcessInitialize(cp))
{
diff --git a/Source/kwsys/SharedForward.h.in b/Source/kwsys/SharedForward.h.in
index da62d84..8521099 100644
--- a/Source/kwsys/SharedForward.h.in
+++ b/Source/kwsys/SharedForward.h.in
@@ -201,6 +201,12 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT
# define KWSYS_SHARED_FORWARD_LDD_N 1
# define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH"
+/* OpenBSD */
+#elif defined(__OpenBSD__)
+# define KWSYS_SHARED_FORWARD_LDD "ldd"
+# define KWSYS_SHARED_FORWARD_LDD_N 1
+# define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH"
+
/* OSX */
#elif defined(__APPLE__)
# define KWSYS_SHARED_FORWARD_LDD "otool", "-L"
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 7041d38..936c1f7 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -2395,11 +2395,13 @@ int SystemInformationImplementation::QueryMemory()
#elif _WIN32
#if _MSC_VER < 1300
MEMORYSTATUS ms;
+ unsigned long tv, tp, av, ap;
ms.dwLength = sizeof(ms);
GlobalMemoryStatus(&ms);
-#define MEM_VAL(value) dw##value
+ #define MEM_VAL(value) dw##value
#else
MEMORYSTATUSEX ms;
+ DWORDLONG tv, tp, av, ap;
ms.dwLength = sizeof(ms);
if (0 == GlobalMemoryStatusEx(&ms))
{
@@ -2407,10 +2409,10 @@ int SystemInformationImplementation::QueryMemory()
}
#define MEM_VAL(value) ull##value
#endif
- unsigned long tv = ms.MEM_VAL(TotalVirtual);
- unsigned long tp = ms.MEM_VAL(TotalPhys);
- unsigned long av = ms.MEM_VAL(AvailVirtual);
- unsigned long ap = ms.MEM_VAL(AvailPhys);
+ tv = ms.MEM_VAL(TotalVirtual);
+ tp = ms.MEM_VAL(TotalPhys);
+ av = ms.MEM_VAL(AvailVirtual);
+ ap = ms.MEM_VAL(AvailPhys);
this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10;
this->AvailableVirtualMemory = av>>10>>10;
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1c00621..3153235 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -9,6 +9,13 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
+
+#ifdef __osf__
+# define _OSF_SOURCE
+# define _POSIX_C_SOURCE 199506L
+# define _XOPEN_SOURCE_EXTENDED
+#endif
+
#include "kwsysPrivate.h"
#include KWSYS_HEADER(RegularExpression.hxx)
#include KWSYS_HEADER(SystemTools.hxx)
@@ -1715,8 +1722,7 @@ kwsys_stl::string SystemTools::ConvertToWindowsOutputPath(const char* path)
}
bool SystemTools::CopyFileIfDifferent(const char* source,
- const char* destination,
- bool copyPermissions)
+ const char* destination)
{
// special check for a destination that is a directory
// FilesDiffer does not handle file to directory compare
@@ -1729,8 +1735,7 @@ bool SystemTools::CopyFileIfDifferent(const char* source,
new_destination += SystemTools::GetFilenameName(source_name);
if(SystemTools::FilesDiffer(source, new_destination.c_str()))
{
- return SystemTools::CopyFileAlways(source, destination,
- copyPermissions);
+ return SystemTools::CopyFileAlways(source, destination);
}
else
{
@@ -1743,7 +1748,7 @@ bool SystemTools::CopyFileIfDifferent(const char* source,
// are different
if(SystemTools::FilesDiffer(source, destination))
{
- return SystemTools::CopyFileAlways(source, destination, copyPermissions);
+ return SystemTools::CopyFileAlways(source, destination);
}
// at this point the files must be the same so return true
return true;
@@ -1829,8 +1834,7 @@ bool SystemTools::FilesDiffer(const char* source,
/**
* Copy a file named by "source" to the file named by "destination".
*/
-bool SystemTools::CopyFileAlways(const char* source, const char* destination,
- bool copyPermissions)
+bool SystemTools::CopyFileAlways(const char* source, const char* destination)
{
// If files are the same do not copy
if ( SystemTools::SameFile(source, destination) )
@@ -1917,23 +1921,11 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination,
fin.close();
fout.close();
- // More checks.
- struct stat statSource, statDestination;
- statSource.st_size = 12345;
- statDestination.st_size = 12345;
- if(stat(source, &statSource) != 0)
- {
- return false;
- }
- else if(stat(destination, &statDestination) != 0)
+ if(!fout)
{
return false;
}
- else if(statSource.st_size != statDestination.st_size)
- {
- return false;
- }
- if ( copyPermissions && perms )
+ if ( perms )
{
if ( !SystemTools::SetPermissions(destination, perm) )
{
@@ -1945,15 +1937,15 @@ bool SystemTools::CopyFileAlways(const char* source, const char* destination,
//----------------------------------------------------------------------------
bool SystemTools::CopyAFile(const char* source, const char* destination,
- bool always, bool copyPermissions)
+ bool always)
{
if(always)
{
- return SystemTools::CopyFileAlways(source, destination, copyPermissions);
+ return SystemTools::CopyFileAlways(source, destination);
}
else
{
- return SystemTools::CopyFileIfDifferent(source, destination, copyPermissions);
+ return SystemTools::CopyFileIfDifferent(source, destination);
}
}
@@ -1962,7 +1954,7 @@ bool SystemTools::CopyAFile(const char* source, const char* destination,
* "destination".
*/
bool SystemTools::CopyADirectory(const char* source, const char* destination,
- bool always, bool copyPermissions)
+ bool always)
{
Directory dir;
dir.Load(source);
@@ -1986,16 +1978,14 @@ bool SystemTools::CopyADirectory(const char* source, const char* destination,
fullDestPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if (!SystemTools::CopyADirectory(fullPath.c_str(),
fullDestPath.c_str(),
- always,
- copyPermissions))
+ always))
{
return false;
}
}
else
{
- if(!SystemTools::CopyAFile(fullPath.c_str(), destination, always,
- copyPermissions))
+ if(!SystemTools::CopyAFile(fullPath.c_str(), destination, always))
{
return false;
}
@@ -3065,38 +3055,35 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
return relativePath;
}
-// OK, some fun stuff to get the actual case of a given path.
-// Basically, you just need to call ShortPath, then GetLongPathName,
-// However, GetLongPathName is not implemented on windows NT and 95,
-// so we have to simulate it on those versions
#ifdef _WIN32
-int OldWindowsGetLongPath(kwsys_stl::string const& shortPath,
- kwsys_stl::string& longPath )
+static int GetCasePathName(const kwsys_stl::string & pathIn,
+ kwsys_stl::string & casePath)
{
- kwsys_stl::string::size_type iFound = shortPath.rfind('/');
- if (iFound > 1 && iFound != shortPath.npos)
+ kwsys_stl::string::size_type iFound = pathIn.rfind('/');
+ if (iFound > 1 && iFound != pathIn.npos)
{
// recurse to peel off components
//
- if (OldWindowsGetLongPath(shortPath.substr(0, iFound), longPath) > 0)
+ if (GetCasePathName(pathIn.substr(0, iFound), casePath) > 0)
{
- longPath += '/';
- if (shortPath[1] != '/')
+ casePath += '/';
+ if (pathIn[1] != '/')
{
WIN32_FIND_DATA findData;
// append the long component name to the path
//
- if (INVALID_HANDLE_VALUE != ::FindFirstFile
- (shortPath.c_str(), &findData))
+ HANDLE hFind = ::FindFirstFile(pathIn.c_str(), &findData);
+ if (INVALID_HANDLE_VALUE != hFind)
{
- longPath += findData.cFileName;
+ casePath += findData.cFileName;
+ ::FindClose(hFind);
}
else
{
// if FindFirstFile fails, return the error code
//
- longPath = "";
+ casePath = "";
return 0;
}
}
@@ -3104,37 +3091,9 @@ int OldWindowsGetLongPath(kwsys_stl::string const& shortPath,
}
else
{
- longPath = shortPath;
- }
- return (int)longPath.size();
-}
-
-
-int PortableGetLongPathName(const char* pathIn,
- kwsys_stl::string & longPath)
-{
- HMODULE lh = LoadLibrary("Kernel32.dll");
- if(lh)
- {
- FARPROC proc = GetProcAddress(lh, "GetLongPathNameA");
- if(proc)
- {
- typedef DWORD (WINAPI * GetLongFunctionPtr) (LPCSTR,LPSTR,DWORD);
- GetLongFunctionPtr func = (GetLongFunctionPtr)proc;
- char buffer[MAX_PATH+1];
- int len = (*func)(pathIn, buffer, MAX_PATH+1);
- if(len == 0 || len > MAX_PATH+1)
- {
- FreeLibrary(lh);
- return 0;
- }
- longPath = buffer;
- FreeLibrary(lh);
- return len;
- }
- FreeLibrary(lh);
+ casePath = pathIn;
}
- return OldWindowsGetLongPath(pathIn, longPath);
+ return (int)casePath.size();
}
#endif
@@ -3153,29 +3112,19 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
{
return i->second;
}
- kwsys_stl::string shortPath;
- if(!SystemTools::GetShortPath(p, shortPath))
- {
- return p;
- }
- kwsys_stl::string longPath;
- int len = PortableGetLongPathName(shortPath.c_str(), longPath);
+ kwsys_stl::string casePath;
+ int len = GetCasePathName(p, casePath);
if(len == 0 || len > MAX_PATH+1)
{
return p;
}
- // Use original path if conversion back to a long path failed.
- if(longPath == shortPath)
- {
- longPath = p;
- }
// make sure drive letter is always upper case
- if(longPath.size() > 1 && longPath[1] == ':')
+ if(casePath.size() > 1 && casePath[1] == ':')
{
- longPath[0] = toupper(longPath[0]);
+ casePath[0] = toupper(casePath[0]);
}
- (*SystemTools::LongPathMap)[p] = longPath;
- return longPath;
+ (*SystemTools::LongPathMap)[p] = casePath;
+ return casePath;
#endif
}
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index fd35742..ec70320 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -500,14 +500,10 @@ public:
/**
* Copy the source file to the destination file only
- * if the two files differ. If the "copyPermissions"
- * argument is true, the permissions of the copy are
- * set to be the same as the permissions of the
- * original.
+ * if the two files differ.
*/
static bool CopyFileIfDifferent(const char* source,
- const char* destination,
- bool copyPermissions = true);
+ const char* destination);
/**
* Compare the contents of two files. Return true if different
@@ -520,22 +516,17 @@ public:
static bool SameFile(const char* file1, const char* file2);
/**
- * Copy a file. If the "copyPermissions" argument is true, the
- * permissions of the copy are set to be the same as the permissions
- * of the original.
+ * Copy a file.
*/
- static bool CopyFileAlways(const char* source, const char* destination,
- bool copyPermissions = true);
+ static bool CopyFileAlways(const char* source, const char* destination);
/**
* Copy a file. If the "always" argument is true the file is always
* copied. If it is false, the file is copied only if it is new or
- * has changed. If the "copyPermissions" argument is true, the
- * permissions of the copy are set to be the same as the permissions
- * of the original.
+ * has changed.
*/
static bool CopyAFile(const char* source, const char* destination,
- bool always = true, bool copyPermissions = true);
+ bool always = true);
/**
* Copy content directory to another directory with all files and
@@ -544,7 +535,7 @@ public:
* are new are copied.
*/
static bool CopyADirectory(const char* source, const char* destination,
- bool always = true, bool copyPermissions = true);
+ bool always = true);
/**
* Remove a file
diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in
index b36c975..db52fc8 100644
--- a/Source/kwsys/hashtable.hxx.in
+++ b/Source/kwsys/hashtable.hxx.in
@@ -38,6 +38,7 @@
# pragma warn -8027 /* 'for' not inlined. */
# pragma warn -8026 /* 'exception' not inlined. */
#endif
+
#ifndef @KWSYS_NAMESPACE@_hashtable_hxx
#define @KWSYS_NAMESPACE@_hashtable_hxx
@@ -57,6 +58,9 @@
# pragma warning (disable:4786)
# pragma warning (disable:4512) /* no assignment operator for class */
#endif
+#if defined(__sgi) && !defined(__GNUC__)
+# pragma set woff 3970 /* pointer to int conversion */ 3321 3968
+#endif
#if @KWSYS_NAMESPACE@_STL_HAS_ALLOCATOR_TEMPLATE
# define @KWSYS_NAMESPACE@_HASH_DEFAULT_ALLOCATOR(T) @KWSYS_NAMESPACE@_stl::allocator< T >
@@ -388,6 +392,10 @@ struct _Hashtable_const_iterator {
// Note: assumes long is at least 32 bits.
enum { _stl_num_primes = 31 };
+// create a function with a static local to that function that returns
+// the static
+inline const unsigned long* get_stl_prime_list() {
+
static const unsigned long _stl_prime_list[_stl_num_primes] =
{
5ul, 11ul, 23ul,
@@ -399,10 +407,12 @@ static const unsigned long _stl_prime_list[_stl_num_primes] =
1610612741ul, 3221225473ul, 4294967291ul
};
+return &_stl_prime_list[0]; }
+
inline size_t _stl_next_prime(size_t __n)
{
- const unsigned long* __first = _stl_prime_list;
- const unsigned long* __last = _stl_prime_list + (int)_stl_num_primes;
+ const unsigned long* __first = get_stl_prime_list();
+ const unsigned long* __last = get_stl_prime_list() + (int)_stl_num_primes;
const unsigned long* pos = @KWSYS_NAMESPACE@_stl::lower_bound(__first, __last, __n);
return pos == __last ? *(__last - 1) : *pos;
}
@@ -587,7 +597,7 @@ public:
size_type bucket_count() const { return _M_buckets.size(); }
size_type max_bucket_count() const
- { return _stl_prime_list[(int)_stl_num_primes - 1]; }
+ { return get_stl_prime_list()[(int)_stl_num_primes - 1]; }
size_type elems_in_bucket(size_type __bucket) const
{
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 6926d2c..dbf86c3 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 03)
+SET(KWSYS_DATE_STAMP_MONTH 08)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 11)
+SET(KWSYS_DATE_STAMP_DAY 10)
diff --git a/Source/kwsys/testAutoPtr.cxx b/Source/kwsys/testAutoPtr.cxx
index 747d869..ed75ff4 100644
--- a/Source/kwsys/testAutoPtr.cxx
+++ b/Source/kwsys/testAutoPtr.cxx
@@ -25,7 +25,7 @@
#define ASSERT(x,y) if (!(x)) { printf("FAIL: " y "\n"); status = 1; }
-static int instances = 0;
+int instances = 0; // don't declare as static
struct A
{
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/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate
index 1b5c8bc..16b784e 100644
--- a/Templates/staticLibHeader.dsptemplate
+++ b/Templates/staticLibHeader.dsptemplate
@@ -67,7 +67,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELEASE/OUTPUT_NAME_RELEASE" CM_STATIC_LIB_ARGS
+# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELEASE/OUTPUT_NAME_RELEASE" CM_STATIC_LIB_ARGS_RELEASE
CMAKE_CUSTOM_RULE_CODE_RELEASE
@@ -97,7 +97,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_DEBUG/OUTPUT_NAME_DEBUG" CM_STATIC_LIB_ARGS
+# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_DEBUG/OUTPUT_NAME_DEBUG" CM_STATIC_LIB_ARGS_DEBUG
CMAKE_CUSTOM_RULE_CODE_DEBUG
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_MINSIZEREL/OUTPUT_NAME_MINSIZEREL" CM_STATIC_LIB_ARGS
+# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_MINSIZEREL/OUTPUT_NAME_MINSIZEREL" CM_STATIC_LIB_ARGS_MINSIZEREL
CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
@@ -158,7 +158,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO/OUTPUT_NAME_RELWITHDEBINFO" CM_STATIC_LIB_ARGS
+# ADD LIB32 /nologo /out:"OUTPUT_DIRECTORY_RELWITHDEBINFO/OUTPUT_NAME_RELWITHDEBINFO" CM_STATIC_LIB_ARGS_RELWITHDEBINFO
CMAKE_CUSTOM_RULE_CODE_RELWITHDEBINFO
diff --git a/Tests/CMakeInstall.cmake b/Tests/CMakeInstall.cmake
index f141b53..dabc852 100644
--- a/Tests/CMakeInstall.cmake
+++ b/Tests/CMakeInstall.cmake
@@ -33,7 +33,7 @@ if(CMake_TEST_INSTALL)
add_test(CMake.Install
${CMake_TEST_INSTALL_CTest}
${CMake_TEST_INSTALL_CONFIG}
- --build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
+ --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR}
--build-generator ${CMAKE_GENERATOR} # Not CMAKE_TEST_GENERATOR
--build-project CMake
--build-makeprogram ${CMAKE_MAKE_PROGRAM} # Not CMAKE_TEST_MAKEPROGRAM
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6a08b3c..0743c5a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -159,7 +159,7 @@ IF(BUILD_TESTING)
IF(CTEST_TEST_OSX_ARCH)
ADD_TEST_MACRO(Architecture Architecture)
SET_TESTS_PROPERTIES(Architecture PROPERTIES
- PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype)")
+ PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)")
ENDIF(CTEST_TEST_OSX_ARCH)
LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
@@ -174,6 +174,34 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize)
+ ADD_TEST(LinkFlags-prepare
+ ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/LinkFlags"
+ "${CMake_BINARY_DIR}/Tests/LinkFlags"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-project LinkFlags
+ --build-target LinkFlags
+ --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
+ )
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
+
+ MACRO(ADD_LINK_FLAGS_TEST name depends)
+ ADD_TEST(LinkFlags-${name}
+ ${CMAKE_CMAKE_COMMAND} --build "${CMake_BINARY_DIR}/Tests/LinkFlags"
+ --target LinkFlags_${name} --config \${CTEST_CONFIGURATION_TYPE}
+ )
+ SET_TESTS_PROPERTIES(LinkFlags-${name} PROPERTIES
+ PASS_REGULAR_EXPRESSION "BADFLAG" DEPENDS LinkFlags-${depends})
+ ENDMACRO()
+ ADD_LINK_FLAGS_TEST(lib prepare)
+ ADD_LINK_FLAGS_TEST(dll lib)
+ ADD_LINK_FLAGS_TEST(exe dll)
+ ADD_LINK_FLAGS_TEST(lib_config exe)
+ ADD_LINK_FLAGS_TEST(dll_config lib_config)
+ ADD_LINK_FLAGS_TEST(exe_config dll_config)
+
# If we are running right now with a UnixMakefiles based generator,
# build the "Simple" test with the ExtraGenerators, if available
# This doesn't test whether the generated project files work (unfortunately),
@@ -270,7 +298,7 @@ IF(BUILD_TESTING)
FILE(MAKE_DIRECTORY "${_TEST_DIR}")
FILE(WRITE "${_TEST_DIR}/nightly-cmake.sh"
"cd ${_TEST_DIR}
-${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/${script}
+${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=next -P ${CMake_SOURCE_DIR}/Utilities/Release/${script}
${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake
")
ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh)
@@ -376,7 +404,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# --test-command t4
#--test-command "${CMAKE_COMMAND}"
#"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
- #-P "${CMAKE_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
+ #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
#)
# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND}
@@ -980,6 +1008,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ADD_TEST_MACRO(ModuleDefinition example_exe)
ENDIF(CMAKE_TEST_MSVC)
+ ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables)
+
IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -1021,7 +1051,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-target install
# --build-target package
--build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
- "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}"
+ "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
--test-command
${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
@@ -1046,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"
@@ -1303,8 +1333,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log"
)
SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES
- PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 5.*Start 5.*Start 4.*Start 3.*Start 2.*Start 1")
-
+ PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1")
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/GetDate.cmake"
+ "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/GetDate.cmake"
+ COPYONLY)
+ ADD_TEST(CTestTestStopTime ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/testOutput.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestStopTime PROPERTIES
+ PASS_REGULAR_EXPRESSION "The stop time has been passed")
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestSubdir/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake"
@@ -1328,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"
@@ -1365,9 +1432,11 @@ ${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")
+ set(regex "${regex}|Submission problem")
set(regex "${regex}|Submission successful)")
set(ctest_coverage_labels_args "")
@@ -1425,12 +1494,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log"
)
- CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest3/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" @ONLY ESCAPE_QUOTES)
- ADD_TEST(CTestTest3 ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTest3/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTest3/testOutput.log"
+ CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY
+ ESCAPE_QUOTES)
+ ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V
+ --output-log
+ "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log"
)
+ SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION
+ "Submission failed: Checksum failed for file")
# these tests take a long time, make sure they have it
# if timeouts have not already been set
@@ -1445,12 +1518,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES ( CTestTest2
PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
-
- GET_TEST_PROPERTY(CTestTest3 TIMEOUT PREVIOUS_TIMEOUT)
- IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES ( CTestTest3
- PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
- ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER)
IF(NOT DEFINED CTEST_RUN_CTestSubmitLargeOutput)
@@ -1476,6 +1543,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
#
SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES
PASS_REGULAR_EXPRESSION "Errors occurred during submission")
+
+ # Give this test plenty of time to run on slower machines:
+ #
+ SET_TESTS_PROPERTIES(CTestSubmitLargeOutput PROPERTIES
+ TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
ENDIF(CTEST_RUN_CTestSubmitLargeOutput)
IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
@@ -1518,20 +1590,28 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
- IF(EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
# 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)
-
-
+ ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+ 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)
@@ -1545,7 +1625,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
@@ -1685,14 +1765,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# If this is not an in-source build, provide a target to wipe out
# all the test build directories.
- IF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
ADD_CUSTOM_TARGET(test_clean
COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
COMMENT "Removing test build directories."
)
- ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
+ ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND}
-D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index 7a176e9..8fd52df 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -28,6 +28,11 @@ AddCMakeTest(Math "")
AddCMakeTest(CMakeMinimumRequired "")
AddCMakeTest(CompilerIdVendor "")
+AddCMakeTest(FileDownload "")
+set_property(TEST CMake.FileDownload PROPERTY
+ PASS_REGULAR_EXPRESSION "file already exists with expected MD5 sum"
+ )
+
if(HAVE_ELF_H)
AddCMakeTest(ELF "")
endif()
@@ -46,13 +51,14 @@ AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}")
# suite. It detects if any changes have been made to the CMake source tree
# by any previous configure, build or test steps.
#
-if(do_cvs_tests)
+if(do_cvs_tests OR GIT_EXECUTABLE)
string(REPLACE "\\" "/" ENV_HOME "$ENV{HOME}")
set(CheckSourceTree_PreArgs
"-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}"
"-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
"-DCVS_EXECUTABLE:STRING=${CVS_EXECUTABLE}"
+ "-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE}"
"-DHOME:STRING=${ENV_HOME}"
)
AddCMakeTest(CheckSourceTree "${CheckSourceTree_PreArgs}")
-endif(do_cvs_tests)
+endif(do_cvs_tests OR GIT_EXECUTABLE)
diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 1cfadcb..73f8b01 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -6,6 +6,7 @@ message("")
message("CMake_BINARY_DIR='${CMake_BINARY_DIR}'")
message("CMake_SOURCE_DIR='${CMake_SOURCE_DIR}'")
message("CVS_EXECUTABLE='${CVS_EXECUTABLE}'")
+message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
message("HOME='${HOME}'")
message("ENV{DASHBOARD_TEST_FROM_CTEST}='$ENV{DASHBOARD_TEST_FROM_CTEST}'")
message("")
@@ -42,55 +43,266 @@ message("in_source_build='${in_source_build}'")
message("")
-# If this does not appear to be a CVS checkout, just pass the test here and now.
-# (Do not let the test fail if it is run in a tree *exported* from CVS or
-# unpacked from a .zip file source installer...)
+# If this does not appear to be a git or CVS checkout, just pass the test here
+# and now. (Do not let the test fail if it is run in a tree *exported* from a
+# repository or unpacked from a .zip file source installer...)
#
-if(NOT EXISTS "${CMake_SOURCE_DIR}/CVS/Root")
- message("source tree is not a CVS checkout... test passes by early return...")
+set(is_git_checkout 0)
+if(EXISTS "${CMake_SOURCE_DIR}/.git")
+ set(is_git_checkout 1)
+endif()
+
+set(is_cvs_checkout 0)
+if(EXISTS "${CMake_SOURCE_DIR}/CVS/Root")
+ set(is_cvs_checkout 1)
+endif()
+
+message("is_git_checkout='${is_git_checkout}'")
+message("is_cvs_checkout='${is_cvs_checkout}'")
+message("")
+
+if(NOT is_cvs_checkout)
+if(NOT is_git_checkout)
+ message("source tree is neither git nor CVS checkout... test passes by early return...")
return()
endif()
+endif()
+
+if(is_cvs_checkout)
+if(is_git_checkout)
+ message("warning: source tree has both git *and* CVS file system bits???")
+ # should this condition be a FATAL_ERROR test failure...?
+endif()
+endif()
-# Check with "cvs -q -n up -dP" if there are any local modifications to the
-# CMake source tree:
+# This test looks for the following types of changes in the source tree:
#
-message("=============================================================================")
-message("Copy/paste this command to reproduce:")
-message("cd \"${CMake_SOURCE_DIR}\" && \"${CVS_EXECUTABLE}\" -q -n up -dP")
-message("")
+set(additions 0)
+set(conflicts 0)
+set(modifications 0)
+set(nonadditions 0)
-# Use the HOME value passed in to the script for calling cvs so it can find
-# its .cvspass and other file(s)
+# ov == output variable... conditionally filled in by either cvs or git below:
#
-set(original_ENV_HOME "$ENV{HOME}")
-set(ENV{HOME} "${HOME}")
+set(cmd "")
+set(ov "")
+set(ev "")
+set(rv "")
-execute_process(COMMAND ${CVS_EXECUTABLE} -q -n up -dP
- WORKING_DIRECTORY ${CMake_SOURCE_DIR}
- OUTPUT_VARIABLE ov
- ERROR_VARIABLE ev
- RESULT_VARIABLE rv)
-set(ENV{HOME} "${original_ENV_HOME}")
+if(is_cvs_checkout AND CVS_EXECUTABLE)
+ # Check with "cvs -q -n up -dP" if there are any local modifications to the
+ # CMake source tree:
+ #
+ message("=============================================================================")
+ message("This is a cvs checkout, using cvs to verify source tree....")
+ message("")
-message("Results of running '${CVS_EXECUTABLE} -q -n up -dP'")
-message("rv='${rv}'")
-message("ov='${ov}'")
-message("ev='${ev}'")
-message("")
+ execute_process(COMMAND ${CVS_EXECUTABLE} --version
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ OUTPUT_VARIABLE version_output
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message("=== output of 'cvs --version' ===")
+ message("${version_output}")
+ message("=== end output ===")
+ message("")
+
+ file(READ "${CMake_SOURCE_DIR}/CVS/Root" contents)
+ message("=== content of CVS/Root ===")
+ message("${contents}")
+ message("=== end content ===")
+ message("")
+
+ file(READ "${CMake_SOURCE_DIR}/CVS/Repository" contents)
+ message("=== content of CVS/Repository ===")
+ message("${contents}")
+ message("=== end content ===")
+ message("")
+
+ message("Copy/paste this command to reproduce:")
+ message("cd \"${CMake_SOURCE_DIR}\" && \"${CVS_EXECUTABLE}\" -q -n up -dP")
+ message("")
-if(NOT rv STREQUAL 0)
- message(FATAL_ERROR "error: 'cvs -q -n up -dP' attempt failed... (see output above)")
+ set(cmd ${CVS_EXECUTABLE} -q -n up -dP)
endif()
-# Analyze cvs output:
+
+# If no GIT_EXECUTABLE, see if we can figure out which git was used
+# for the ctest_update step on this dashboard...
#
-set(additions 0)
-set(conflicts 0)
-set(modifications 0)
-set(nonadditions 0)
+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:
+ #
+ message("=============================================================================")
+ message("This is a git checkout, using git to verify source tree....")
+ message("")
+
+ execute_process(COMMAND ${GIT_EXECUTABLE} --version
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ OUTPUT_VARIABLE version_output
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message("=== output of 'git --version' ===")
+ message("${version_output}")
+ message("=== end output ===")
+ message("")
+
+ execute_process(COMMAND ${GIT_EXECUTABLE} branch -a
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ OUTPUT_VARIABLE git_branch_output
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message("=== output of 'git branch -a' ===")
+ message("${git_branch_output}")
+ 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("")
+
+ set(cmd ${GIT_EXECUTABLE} status)
+endif()
+
+
+if(cmd)
+ # Use the HOME value passed in to the script for calling cvs/git so it can
+ # find its .cvspass or user/global config settings...
+ #
+ set(original_ENV_HOME "$ENV{HOME}")
+ set(ENV{HOME} "${HOME}")
+
+ execute_process(COMMAND ${cmd}
+ WORKING_DIRECTORY ${CMake_SOURCE_DIR}
+ OUTPUT_VARIABLE ov
+ ERROR_VARIABLE ev
+ RESULT_VARIABLE rv)
+
+ set(ENV{HOME} "${original_ENV_HOME}")
+
+ message("Results of running ${cmd}")
+ message("rv='${rv}'")
+ message("ov='${ov}'")
+ message("ev='${ev}'")
+ message("")
+ if(NOT rv STREQUAL 0)
+ if(is_git_checkout AND (rv STREQUAL "1"))
+ # Many builds of git return "1" from a "nothing is changed" git status call...
+ # Do not fail with an error for rv==1 with git...
+ else()
+ message(FATAL_ERROR "error: ${cmd} attempt failed... (see output above)")
+ endif()
+ endif()
+else()
+ message(FATAL_ERROR "error: no COMMAND to run to analyze source tree...")
+endif()
+
+
+# Analyze output:
+#
if(NOT ov STREQUAL "")
string(REPLACE ";" "\\\\;" lines "${ov}")
string(REPLACE "\n" "E;" lines "${lines}")
@@ -110,29 +322,44 @@ if(NOT ov STREQUAL "")
endif()
if(consider)
- if(line MATCHES "^A ")
- message(" locally added file/directory detected...")
- set(additions 1)
+ if(is_cvs_checkout)
+ if(line MATCHES "^A ")
+ message(" locally added file/directory detected...")
+ set(additions 1)
+ endif()
+
+ if(line MATCHES "^C ")
+ message(" conflict detected...")
+ set(conflicts 1)
+ endif()
+
+ if(line MATCHES "^M ")
+ message(" locally modified file detected...")
+ set(modifications 1)
+ endif()
+
+ if(line MATCHES "^\\? ")
+ message(" locally non-added file/directory detected...")
+ set(nonadditions 1)
+ endif()
endif()
- if(line MATCHES "^C ")
- message(" conflict detected...")
- set(conflicts 1)
- endif()
+ if(is_git_checkout)
+ if(line MATCHES "^#[ \t]*modified:")
+ message(" locally modified file detected...")
+ set(modifications 1)
+ endif()
- if(line MATCHES "^M ")
- message(" locally modified file detected...")
- set(modifications 1)
- endif()
-
- if(line MATCHES "^\\? ")
- message(" locally non-added file/directory detected...")
- set(nonadditions 1)
+ if(line MATCHES "^# Untracked")
+ message(" locally non-added file/directory detected...")
+ set(nonadditions 1)
+ endif()
endif()
endif()
endforeach()
endif()
+
message("=============================================================================")
message("additions='${additions}'")
message("conflicts='${conflicts}'")
@@ -185,14 +412,14 @@ if(nonadditions)
message("
warning: test results confounded because this is an 'in-source' build - cannot
distinguish between non-added files that are in-source build products and
-non-added source files that somebody forgot to 'cvs add'... - this is only ok
+non-added source files that somebody forgot to 'git add'... - this is only ok
if this is intentionally an in-source dashboard build... Developers should
use out-of-source builds to verify a clean source tree with this test...
Allowing test to pass despite the warning message...
")
else()
- message(FATAL_ERROR "test fails: local source tree non-additions: use cvs add before committing, or remove the files from the source tree")
+ message(FATAL_ERROR "test fails: local source tree non-additions: use git add before committing, or remove the files from the source tree")
endif()
endif()
diff --git a/Tests/CMakeTests/FileDownloadInput.png b/Tests/CMakeTests/FileDownloadInput.png
new file mode 100644
index 0000000..7bbcee4
--- /dev/null
+++ b/Tests/CMakeTests/FileDownloadInput.png
Binary files differ
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
new file mode 100644
index 0000000..578f510
--- /dev/null
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -0,0 +1,41 @@
+set(url "file://@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
+set(dir "@CMAKE_CURRENT_BINARY_DIR@/downloads")
+
+message(STATUS "FileDownload:1")
+file(DOWNLOAD
+ ${url}
+ ${dir}/file1.png
+ TIMEOUT 2
+ )
+
+message(STATUS "FileDownload:2")
+file(DOWNLOAD
+ ${url}
+ ${dir}/file2.png
+ TIMEOUT 2
+ SHOW_PROGRESS
+ )
+
+# Two calls in a row, exactly the same arguments.
+# Since downloaded file should exist already for 2nd call,
+# the 2nd call will short-circuit and return early...
+#
+if(EXISTS ${dir}/file3.png)
+ file(REMOVE ${dir}/file3.png)
+endif()
+
+message(STATUS "FileDownload:3")
+file(DOWNLOAD
+ ${url}
+ ${dir}/file3.png
+ TIMEOUT 2
+ EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ )
+
+message(STATUS "FileDownload:4")
+file(DOWNLOAD
+ ${url}
+ ${dir}/file3.png
+ TIMEOUT 2
+ EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ )
diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in
index 02f7001..47c1692 100644
--- a/Tests/CMakeTests/FindBaseTest.cmake.in
+++ b/Tests/CMakeTests/FindBaseTest.cmake.in
@@ -55,7 +55,7 @@ if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !")
endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}")
-# by explicitely disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
+# by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found
find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH)
if(FOO_H_6)
message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !")
diff --git a/Tests/CTestSubmitLargeOutput/test.cmake.in b/Tests/CTestSubmitLargeOutput/test.cmake.in
index bc094b0..17a7c7d 100644
--- a/Tests/CTestSubmitLargeOutput/test.cmake.in
+++ b/Tests/CTestSubmitLargeOutput/test.cmake.in
@@ -16,6 +16,7 @@ CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000)
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000)
+SET(CTEST_TEST_TIMEOUT @CMAKE_LONG_TEST_TIMEOUT@)
CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in
index cccd8c1..f6ec198 100644
--- a/Tests/CTestTest2/test.cmake.in
+++ b/Tests/CTestTest2/test.cmake.in
@@ -15,6 +15,14 @@ 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}")
+# for unix purify has to be used as a linker, and
+# will not work with ctest. So disable it so
+# that it is not attempted.
+IF(UNIX)
+ IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify)
+ SET(CTEST_MEMORYCHECK_COMMAND)
+ ENDIF()
+ENDIF()
#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
diff --git a/Tests/CTestTest3/test.cmake.in b/Tests/CTestTest3/test.cmake.in
index 1cf5a88..1e8ea50 100644
--- a/Tests/CTestTest3/test.cmake.in
+++ b/Tests/CTestTest3/test.cmake.in
@@ -25,6 +25,14 @@ 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@")
+# for unix purify has to be used as a linker, and
+# will not work with ctest. So disable it so
+# that it is not attempted.
+IF(UNIX)
+ IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify)
+ SET(CTEST_MEMORYCHECK_COMMAND)
+ ENDIF()
+ENDIF()
SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" -q -z3 \"-d:pserver:anoncvs@www.cmake.org:/cvsroot/KWSys\" co -r CTest-Testing-Tag KWSys")
diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in
new file mode 100644
index 0000000..c3c41a5
--- /dev/null
+++ b/Tests/CTestTestChecksum/test.cmake.in
@@ -0,0 +1,28 @@
+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@-Checksum")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel")
+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 PARALLEL_LEVEL 4)
+
+SET(CTEST_DROP_METHOD "@protocol@")
+SET(CTEST_DROP_SITE "@server@")
+SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
+
+CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res)
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/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt
index 8e7678d..882988f 100644
--- a/Tests/CTestTestScheduler/CMakeLists.txt
+++ b/Tests/CTestTestScheduler/CMakeLists.txt
@@ -4,6 +4,6 @@ INCLUDE (CTest)
ADD_EXECUTABLE (Sleep sleep.c)
-FOREACH (time RANGE 1 5)
+FOREACH (time RANGE 1 4)
ADD_TEST (TestSleep${time} Sleep ${time})
-ENDFOREACH (time RANGE 1 5)
+ENDFOREACH (time RANGE 1 4)
diff --git a/Tests/CTestTestScheduler/sleep.c b/Tests/CTestTestScheduler/sleep.c
index b06776c..9631a68 100644
--- a/Tests/CTestTestScheduler/sleep.c
+++ b/Tests/CTestTestScheduler/sleep.c
@@ -4,13 +4,13 @@
# include <unistd.h>
#endif
-/* sleeps for 2n seconds, where n is the argument to the program */
+/* sleeps for 4n seconds, where n is the argument to the program */
int main(int argc, char** argv)
{
int time;
if(argc > 1)
{
- time = 3 * atoi(argv[1]);
+ time = 4 * atoi(argv[1]);
}
#if defined(_WIN32)
Sleep(time * 1000);
diff --git a/Tests/CTestTestStopTime/CMakeLists.txt b/Tests/CTestTestStopTime/CMakeLists.txt
new file mode 100644
index 0000000..5fe30d3
--- /dev/null
+++ b/Tests/CTestTestStopTime/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(CTestTestStopTime)
+INCLUDE(CTest)
+
+ADD_EXECUTABLE (Sleep sleep.c)
+
+ADD_TEST (TestSleep Sleep 30)
+ADD_TEST (ShouldNotRun Sleep 30)
+
+SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES DEPENDS TestSleep)
+SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES WILL_FAIL ON)
diff --git a/Tests/CTestTestStopTime/CTestConfig.cmake b/Tests/CTestTestStopTime/CTestConfig.cmake
new file mode 100644
index 0000000..129db4d
--- /dev/null
+++ b/Tests/CTestTestStopTime/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestStopTime")
+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/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake
new file mode 100644
index 0000000..b793306
--- /dev/null
+++ b/Tests/CTestTestStopTime/GetDate.cmake
@@ -0,0 +1,233 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.2)
+
+MACRO(GET_DATE)
+ #
+ # All macro arguments are optional.
+ # If there's an ARGV0, use it as GD_PREFIX. Default = 'GD_'
+ # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE. Default = '0'
+ #
+ # If the date can be retrieved and parsed successfully, this macro
+ # will set the following CMake variables:
+ #
+ # GD_PREFIX
+ # ${GD_PREFIX}PREFIX (if '${GD_PREFIX}' is not 'GD_'...!)
+ # ${GD_PREFIX}VERBOSE
+ #
+ # ${GD_PREFIX}CMD
+ # ${GD_PREFIX}ARGS
+ # ${GD_PREFIX}OV
+ # ${GD_PREFIX}RV
+ #
+ # ${GD_PREFIX}REGEX
+ # ${GD_PREFIX}YEAR
+ # ${GD_PREFIX}MONTH
+ # ${GD_PREFIX}DAY
+ # ${GD_PREFIX}HOUR
+ # ${GD_PREFIX}MINUTE
+ # ${GD_PREFIX}SECOND
+ # ${GD_PREFIX}FRACTIONAL_SECOND
+ # ${GD_PREFIX}DAY_OF_WEEK
+ #
+ # Caller can then use these variables to construct names based on
+ # date and time stamps...
+ #
+
+ # If there's an ARGV0, use it as GD_PREFIX:
+ #
+ SET(GD_PREFIX "GD_")
+ IF(NOT "${ARGV0}" STREQUAL "")
+ SET(GD_PREFIX "${ARGV0}")
+ ENDIF(NOT "${ARGV0}" STREQUAL "")
+ IF(NOT "${GD_PREFIX}" STREQUAL "GD_")
+ SET(${GD_PREFIX}PREFIX "${GD_PREFIX}")
+ ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_")
+
+ # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE:
+ #
+ SET(${GD_PREFIX}VERBOSE "0")
+ IF(NOT "${ARGV1}" STREQUAL "")
+ SET(${GD_PREFIX}VERBOSE "${ARGV1}")
+ ENDIF(NOT "${ARGV1}" STREQUAL "")
+
+ # Retrieve the current date and time in the format:
+ #
+ # Thu 01/12/2006 8:55:12.01
+ # dow mm/dd/YYYY HH:MM:SS.ssssss
+ #
+ # Use "echo %DATE% %TIME%" on Windows.
+ # Otherwise, try "date" as implemented on most Unix flavors.
+ #
+ IF(WIN32)
+ #
+ # Use "cmd" shell with %DATE% and %TIME% support...
+ # May need adjustment in different locales or for custom date/time formats
+ # set in the Windows Control Panel.
+ #
+ SET(${GD_PREFIX}CMD "cmd")
+ SET(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%")
+ ELSE(WIN32)
+ #
+ # Match the format returned by default in US English Windows:
+ #
+ SET(${GD_PREFIX}CMD "date")
+ SET(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"")
+ ENDIF(WIN32)
+
+ EXEC_PROGRAM("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}"
+ OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV
+ )
+
+ IF(${GD_PREFIX}VERBOSE)
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "<GET_DATE>")
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "GD_PREFIX='${GD_PREFIX}'")
+ IF(NOT "${GD_PREFIX}" STREQUAL "GD_")
+ MESSAGE(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'")
+ ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_")
+ MESSAGE(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'")
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'")
+ MESSAGE(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'")
+ MESSAGE(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'")
+ MESSAGE(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
+ MESSAGE(STATUS "")
+ ENDIF(${GD_PREFIX}VERBOSE)
+
+ IF("${${GD_PREFIX}RV}" STREQUAL "0")
+ #
+ # Extract eight individual components by matching a regex with paren groupings.
+ # Use the replace functionality and \\1 thru \\8 to extract components.
+ #
+ SET(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)")
+
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}")
+ STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}")
+
+ #
+ # Verify that extracted components don't have anything obviously
+ # wrong with them... Emit warnings if something looks suspicious...
+ #
+
+ # Expecting a four digit year:
+ #
+ IF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...")
+ ENDIF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$")
+
+ # Expecting month to be <= 12:
+ #
+ IF(${${GD_PREFIX}MONTH} GREATER 12)
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!")
+ ENDIF(${${GD_PREFIX}MONTH} GREATER 12)
+
+ # Expecting day to be <= 31:
+ #
+ IF(${${GD_PREFIX}DAY} GREATER 31)
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!")
+ ENDIF(${${GD_PREFIX}DAY} GREATER 31)
+
+ # Expecting hour to be <= 23:
+ #
+ IF(${${GD_PREFIX}HOUR} GREATER 23)
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!")
+ ENDIF(${${GD_PREFIX}HOUR} GREATER 23)
+
+ # Expecting minute to be <= 59:
+ #
+ IF(${${GD_PREFIX}MINUTE} GREATER 59)
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!")
+ ENDIF(${${GD_PREFIX}MINUTE} GREATER 59)
+
+ # Expecting second to be <= 59:
+ #
+ IF(${${GD_PREFIX}SECOND} GREATER 59)
+ MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!")
+ ENDIF(${${GD_PREFIX}SECOND} GREATER 59)
+
+ # If individual components are single digit,
+ # prepend a leading zero:
+ #
+ IF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}")
+ ENDIF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$")
+ IF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}")
+ ENDIF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$")
+ IF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}")
+ ENDIF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$")
+ IF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}")
+ ENDIF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$")
+ IF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}")
+ ENDIF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$")
+ IF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
+ SET(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}")
+ ENDIF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$")
+
+ IF(${GD_PREFIX}VERBOSE)
+ MESSAGE(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'")
+ MESSAGE(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'")
+ MESSAGE(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'")
+ MESSAGE(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'")
+ MESSAGE(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'")
+ MESSAGE(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'")
+ MESSAGE(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'")
+ MESSAGE(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'")
+ MESSAGE(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'")
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "Counters that change...")
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}")
+ MESSAGE(STATUS " every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}")
+ MESSAGE(STATUS " daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}")
+ MESSAGE(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}")
+ MESSAGE(STATUS " annually : ${${GD_PREFIX}YEAR}")
+ MESSAGE(STATUS "")
+ ENDIF(${GD_PREFIX}VERBOSE)
+ ELSE("${${GD_PREFIX}RV}" STREQUAL "0")
+ MESSAGE(SEND_ERROR "ERROR: MACRO(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'")
+ ENDIF("${${GD_PREFIX}RV}" STREQUAL "0")
+
+ IF(${GD_PREFIX}VERBOSE)
+ MESSAGE(STATUS "</GET_DATE>")
+ MESSAGE(STATUS "")
+ ENDIF(${GD_PREFIX}VERBOSE)
+ENDMACRO(GET_DATE)
+
+MACRO(ADD_SECONDS sec)
+ set(new_min ${${GD_PREFIX}MINUTE})
+ set(new_hr ${${GD_PREFIX}HOUR})
+ math(EXPR new_sec "${sec} + ${${GD_PREFIX}SECOND}")
+ while(${new_sec} GREATER 60 OR ${new_sec} EQUAL 60)
+ math(EXPR new_sec "${new_sec} - 60")
+ math(EXPR new_min "${${GD_PREFIX}MINUTE} + 1")
+ endwhile()
+ while(${new_min} GREATER 60 OR ${new_min} EQUAL 60)
+ math(EXPR new_min "${new_min} - 60")
+ math(EXPR new_hr "${${GD_PREFIX}HOUR} + 1")
+ endwhile()
+ math(EXPR new_hr "${new_hr} % 24")
+
+ # Pad the H, M, S if needed
+ string(LENGTH ${new_sec} sec_len)
+ string(LENGTH ${new_min} min_len)
+ string(LENGTH ${new_hr} hr_len)
+ if(${sec_len} EQUAL 1)
+ set(new_sec "0${new_sec}")
+ endif()
+ if(${min_len} EQUAL 1)
+ set(new_min "0${new_min}")
+ endif()
+ if(${hr_len} EQUAL 1)
+ set(new_hr "0${new_hr}")
+ endif()
+ENDMACRO(ADD_SECONDS)
diff --git a/Tests/CTestTestStopTime/sleep.c b/Tests/CTestTestStopTime/sleep.c
new file mode 100644
index 0000000..b589647
--- /dev/null
+++ b/Tests/CTestTestStopTime/sleep.c
@@ -0,0 +1,21 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+/* sleeps for n seconds, where n is the argument to the program */
+int main(int argc, char** argv)
+{
+ int time;
+ if(argc > 1)
+ {
+ time = atoi(argv[1]);
+ }
+#if defined(_WIN32)
+ Sleep(time * 1000);
+#else
+ sleep(time);
+#endif
+ return 0;
+}
diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in
new file mode 100644
index 0000000..6a5534e
--- /dev/null
+++ b/Tests/CTestTestStopTime/test.cmake.in
@@ -0,0 +1,34 @@
+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@-StopTime")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime")
+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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+INCLUDE("${CTEST_BINARY_DIRECTORY}/GetDate.cmake")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+
+GET_DATE()
+message("curr time: ${${GD_PREFIX}HOUR}:${${GD_PREFIX}MINUTE}:${${GD_PREFIX}SECOND}")
+ADD_SECONDS(15)
+message("stop time: ${new_hr}:${new_min}:${new_sec}")
+
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res STOP_TIME "${new_hr}:${new_min}:${new_sec}")
+
+#CTEST_SUBMIT()
diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in
index eebb4f6..c654f47 100644
--- a/Tests/CTestUpdateBZR.cmake.in
+++ b/Tests/CTestUpdateBZR.cmake.in
@@ -39,6 +39,9 @@ create_content(import)
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${BZR} init
)
+run_child(WORKING_DIRECTORY ${TOP}/import
+ COMMAND ${BZR} whoami --branch "Test Author <testauthor@cmake.org>"
+ )
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${BZR} add .
@@ -57,6 +60,10 @@ run_child(
WORKING_DIRECTORY ${TOP}
COMMAND ${BZR} branch "${REPO}" user-source
)
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${BZR} whoami --branch "Test Author <testauthor@cmake.org>"
+ )
#-----------------------------------------------------------------------------
# Make changes in the working tree.
@@ -135,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
@@ -143,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 94c37fe..a52cb14 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -41,8 +41,8 @@ function(check_updates build)
# Compare expected and actual entries
set(EXTRA "${UPDATE_XML_ENTRIES}")
- list(REMOVE_ITEM EXTRA ${ARGN} ${UPDATE_MAYBE})
- set(MISSING "${ARGN}")
+ list(REMOVE_ITEM EXTRA ${ARGN} ${UPDATE_EXTRA} ${UPDATE_MAYBE})
+ set(MISSING "${ARGN}" ${UPDATE_EXTRA})
list(REMOVE_ITEM MISSING ${UPDATE_XML_ENTRIES})
if(NOT UPDATE_NOT_GLOBAL)
@@ -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 c721bb4..793b987 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -5,6 +5,7 @@
# Test in a directory next to this script.
get_filename_component(TOP "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(TOP "${TOP}/@CTestUpdateGIT_DIR@")
+set(UPDATE_EXTRA Updated{module})
# Include code common to all update tests.
include("@CMAKE_CURRENT_SOURCE_DIR@/CTestUpdateCommon.cmake")
@@ -42,6 +43,35 @@ run_child(
file(REMOVE_RECURSE ${TOP}/repo.git/hooks)
set(REPO file://${TOP}/repo.git)
+# Create submodule repository.
+message("Creating submodule...")
+file(MAKE_DIRECTORY ${TOP}/module.git)
+run_child(
+ WORKING_DIRECTORY ${TOP}/module.git
+ COMMAND ${GIT} --bare init
+ )
+file(REMOVE_RECURSE ${TOP}/module.git/hooks)
+set(MOD_REPO file://${TOP}/module.git)
+create_content(module)
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} init
+ )
+file(REMOVE_RECURSE ${TOP}/module/.git/hooks)
+file(APPEND ${TOP}/module/.git/config "
+[remote \"origin\"]
+\turl = ${MOD_REPO}
+\tfetch = +refs/heads/*:refs/remotes/origin/*
+${AUTHOR_CONFIG}")
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} add .
+ )
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} commit -m "Initial content"
+ )
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} push origin master:refs/heads/master
+ )
+
#-----------------------------------------------------------------------------
# Import initial content into the repository.
message("Importing content...")
@@ -61,6 +91,9 @@ run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${GIT} add .
)
run_child(WORKING_DIRECTORY ${TOP}/import
+ COMMAND ${GIT} submodule add ${MOD_REPO} module
+ )
+run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${GIT} commit -m "Initial content"
)
run_child(WORKING_DIRECTORY ${TOP}/import
@@ -68,6 +101,19 @@ run_child(WORKING_DIRECTORY ${TOP}/import
)
#-----------------------------------------------------------------------------
+# Modify the submodule.
+change_content(module)
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} add -u
+ )
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} commit -m "Changed content"
+ )
+run_child(WORKING_DIRECTORY ${TOP}/module
+ COMMAND ${GIT} push origin master:refs/heads/master
+ )
+
+#-----------------------------------------------------------------------------
# Create a working tree.
message("Checking out revision 1...")
run_child(
@@ -76,6 +122,30 @@ run_child(
)
file(REMOVE_RECURSE ${TOP}/user-source/.git/hooks)
file(APPEND ${TOP}/user-source/.git/config "${AUTHOR_CONFIG}")
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ COMMAND ${GIT} submodule init
+ )
+run_child(
+ WORKING_DIRECTORY ${TOP}/user-source
+ 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.
@@ -95,6 +165,9 @@ run_child(
WORKING_DIRECTORY ${TOP}/user-source
COMMAND ${GIT} rm ${files_removed}
)
+run_child(WORKING_DIRECTORY ${TOP}/user-source/module
+ COMMAND ${GIT} checkout master
+ )
run_child(
WORKING_DIRECTORY ${TOP}/user-source
COMMAND ${GIT} add -u
@@ -135,11 +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
- )
+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".
@@ -163,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)
@@ -177,11 +275,40 @@ execute_process(
WORKING_DIRECTORY \"${TOP}\"
COMMAND \"${GIT}\" clone \"${REPO}\" dash-source
)
+
+# Test .git file.
+file(RENAME \"${TOP}/dash-source/.git\" \"${TOP}/dash-source/repo.git\")
+file(WRITE \"${TOP}/dash-source/.git\" \"gitdir: repo.git\n\")
+
+execute_process(
+ WORKING_DIRECTORY \"${TOP}/dash-source\"
+ COMMAND \"${GIT}\" reset --hard ${revision1}
+ )
execute_process(
WORKING_DIRECTORY \"${TOP}/dash-source\"
- COMMAND \"${GIT}\" reset --hard master~2
+ COMMAND \"${GIT}\" submodule init
)
+execute_process(
+ WORKING_DIRECTORY \"${TOP}/dash-source\"
+ COMMAND \"${GIT}\" submodule update
+ )
+")
+
+# Run the dashboard script with CTest.
+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(dashboard.cmake)
+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/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
new file mode 100644
index 0000000..7206f1d
--- /dev/null
+++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
@@ -0,0 +1,85 @@
+cmake_minimum_required(VERSION 2.8)
+project(CheckCompilerRelatedVariables)
+
+
+function(echo_var var)
+ if(DEFINED ${var})
+ message("${var}='${${var}}' is defined")
+ else()
+ message("${var}='${${var}}' is NOT defined")
+ endif()
+endfunction()
+
+
+#
+# Check that the correct number of MSVC** variables are defined...
+#
+set(msvc_total 0)
+
+if(DEFINED MSVC60)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC70)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC71)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC80)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC90)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC10)
+ math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+
+echo_var(MSVC)
+echo_var(MSVC60)
+echo_var(MSVC70)
+echo_var(MSVC71)
+echo_var(MSVC80)
+echo_var(MSVC90)
+echo_var(MSVC10)
+
+if(MSVC)
+ #
+ # MSVC is set in cl.cmake when cl is the compiler...
+ #
+ # Exactly one of the numbered variables should also be set
+ # indicating which version of the cl compiler / Visual Studio
+ # is in use...
+ #
+ if(msvc_total EQUAL 1)
+ message("test passes: exactly one MSVC** variable is defined...")
+ else()
+ message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 1 expected")
+ endif()
+else()
+ #
+ # The compiler is something other than cl... None of the MSVC** variables
+ # should be defined...
+ #
+ if(msvc_total EQUAL 0)
+ message("test passes: no MSVC** variables are defined on non-MSVC build...")
+ else()
+ message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 0 expected")
+ endif()
+endif()
+
+
+#
+# This is a no-op executable... If this test is going to fail, it fails during
+# the configure step while cmake is configuring this CMakeLists.txt file...
+#
+
+file(WRITE
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+ "int main() { return 0; }"
+ )
+
+add_executable(
+ CheckCompilerRelatedVariables
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+ )
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index f02f2f7..26c6deb 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -1,10 +1,11 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
project(ExternalProjectTest NONE)
include(ExternalProject)
find_package(CVS)
find_package(Subversion)
+find_package(Git)
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
@@ -37,8 +38,6 @@ if(NOT DEFINED can_build_tutorial_step5)
endif()
endif()
-message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
-
# Empty projects that test all the known ExternalProject_Add argument key words:
#
@@ -65,7 +64,9 @@ ExternalProject_Add(${proj}
SVN_REPOSITORY ""
SVN_REVISION ""
TEST_COMMAND ""
+ TIMEOUT ""
URL ""
+ URL_MD5 ""
UPDATE_COMMAND ""
)
@@ -78,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})
@@ -87,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()
@@ -96,17 +99,20 @@ endif()
set(proj TutorialStep1-LocalTAR)
ExternalProject_Add(${proj}
URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar"
+ URL_MD5 a87c5b47c0201c09ddfe1d5738fdb1e3
LIST_SEPARATOR ::
PATCH_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DTEST_LIST:STRING=A::B::C
INSTALL_COMMAND ""
+ LOG_CONFIGURE 1
)
set(proj TutorialStep1-LocalNoDirTAR)
ExternalProject_Add(${proj}
URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar"
+ URL_MD5 d09e3d370c5c908fa035c30939ee438e
LIST_SEPARATOR @@
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
-DTEST_LIST:STRING=1@@2@@3
@@ -126,19 +132,72 @@ ExternalProject_Add_Step(${proj} mypatch
set(proj TutorialStep1-LocalTGZ)
ExternalProject_Add(${proj}
URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tgz"
+ 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)
ExternalProject_Add(${proj}
URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tgz"
+ URL_MD5 0b8182edcecdf40bf1c9d71d7d259f78
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
)
+# Local BZ2:
+#
+# (The bz2 tests are here just to verify that the bz2 decompression is executed
+# during a test suite run... The configure and build commands are set to
+# nothing to make the test quicker. To make this more complete, I should add
+# a diff between this and the TGZ source tree since that one does build...)
+#
+set(proj TutorialStep1-LocalBZ2)
+ExternalProject_Add(${proj}
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar.bz2"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
+set(proj TutorialStep1-LocalNoDirBZ2)
+ExternalProject_Add(${proj}
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar.bz2"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
+
+# Local ZIP:
+#
+# (The zip tests are here just to verify that the zip decompression is executed
+# during a test suite run... The configure and build commands are set to
+# nothing to make the test quicker. To make this more complete, I should add
+# a diff between this and the TGZ source tree since that one does build...)
+#
+set(proj TutorialStep1-LocalZIP)
+ExternalProject_Add(${proj}
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1.zip"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
+set(proj TutorialStep1-LocalNoDirZIP)
+ExternalProject_Add(${proj}
+ URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.zip"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
+
+# CVS-based tests:
+#
set(do_cvs_tests 0)
if(CVS_EXECUTABLE)
@@ -161,8 +220,9 @@ if(do_cvs_tests)
ExternalProject_Add(${proj}
SOURCE_DIR ${local_cvs_repo}
URL ${CMAKE_CURRENT_SOURCE_DIR}/cvsrepo.tgz
+ URL_MD5 55fc85825ffdd9ed2597123c68b79f7e
BUILD_COMMAND ""
- CONFIGURE_COMMAND ${CVS_EXECUTABLE} --version
+ CONFIGURE_COMMAND "${CVS_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
@@ -215,6 +275,8 @@ if(do_cvs_tests)
endif()
+# SVN-based tests:
+#
set(do_svn_tests 0)
if(Subversion_SVN_EXECUTABLE)
@@ -257,8 +319,9 @@ if(do_svn_tests)
ExternalProject_Add(${proj}
SOURCE_DIR ${local_svn_repo}
URL ${CMAKE_CURRENT_SOURCE_DIR}/svnrepo.tgz
+ URL_MD5 2f468be4ed1fa96377fca0cc830819c4
BUILD_COMMAND ""
- CONFIGURE_COMMAND ${Subversion_SVN_EXECUTABLE} --version
+ CONFIGURE_COMMAND "${Subversion_SVN_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
@@ -297,6 +360,82 @@ if(do_svn_tests)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
+ LOG_DOWNLOAD 1
+ )
+endif()
+
+
+set(do_git_tests 0)
+
+if(GIT_EXECUTABLE)
+ set(do_git_tests 1)
+
+ execute_process(
+ COMMAND "${GIT_EXECUTABLE}" --version
+ OUTPUT_VARIABLE ov
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
+ message(STATUS "git_version='${git_version}'")
+
+ if(git_version VERSION_LESS 1.6.5)
+ message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
+ set(do_git_tests 0)
+ endif()
+endif()
+
+
+if(do_git_tests)
+ set(local_git_repo "../../LocalRepositories/GIT")
+
+ # Unzip/untar the git repository in our source folder so that other
+ # projects below may use it to test git args of ExternalProject_Add
+ #
+ set(proj SetupLocalGITRepository)
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+ INSTALL_COMMAND ""
+ )
+
+ # git by commit id:
+ #
+ set(proj TutorialStep1-GIT-byhash)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_TAG d1970730310fe8bc07e73f15dc570071f9f9654a
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ )
+
+ # git by explicit branch/tag name:
+ #
+ set(proj TutorialStep1-GIT-bytag)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_TAG "origin/master"
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ )
+
+ # Live git / master (no GIT_TAG):
+ #
+ set(proj TutorialStep1-GIT-master)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ LOG_UPDATE 1
)
endif()
@@ -365,3 +504,10 @@ if(can_build_tutorial_step5)
set_property(TEST TutorialStep5-InstallTreeTest
APPEND PROPERTY LABELS Step5 InstallTree)
endif()
+
+
+message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
+message(STATUS "do_cvs_tests='${do_cvs_tests}'")
+message(STATUS "do_svn_tests='${do_svn_tests}'")
+message(STATUS "do_git_tests='${do_git_tests}'")
+message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
diff --git a/Tests/ExternalProject/Example/CMakeLists.txt b/Tests/ExternalProject/Example/CMakeLists.txt
new file mode 100644
index 0000000..2cadd7d
--- /dev/null
+++ b/Tests/ExternalProject/Example/CMakeLists.txt
@@ -0,0 +1,11 @@
+# This is the canonical simplest ExternalProject example CMakeLists.txt file:
+cmake_minimum_required(VERSION 2.8)
+project(ExternalProjectExample NONE)
+include(ExternalProject)
+
+ExternalProject_Add(
+ cmake281
+ URL http://www.cmake.org/files/v2.8/cmake-2.8.1.tar.gz
+ CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+ BUILD_COMMAND ""
+)
diff --git a/Tests/ExternalProject/Step1.tar.bz2 b/Tests/ExternalProject/Step1.tar.bz2
new file mode 100644
index 0000000..49b5f23
--- /dev/null
+++ b/Tests/ExternalProject/Step1.tar.bz2
Binary files differ
diff --git a/Tests/ExternalProject/Step1.zip b/Tests/ExternalProject/Step1.zip
new file mode 100644
index 0000000..49dac24
--- /dev/null
+++ b/Tests/ExternalProject/Step1.zip
Binary files differ
diff --git a/Tests/ExternalProject/Step1NoDir.tar.bz2 b/Tests/ExternalProject/Step1NoDir.tar.bz2
new file mode 100644
index 0000000..92eb480
--- /dev/null
+++ b/Tests/ExternalProject/Step1NoDir.tar.bz2
Binary files differ
diff --git a/Tests/ExternalProject/Step1NoDir.zip b/Tests/ExternalProject/Step1NoDir.zip
new file mode 100644
index 0000000..b42d318
--- /dev/null
+++ b/Tests/ExternalProject/Step1NoDir.zip
Binary files differ
diff --git a/Tests/ExternalProject/gitrepo.tgz b/Tests/ExternalProject/gitrepo.tgz
new file mode 100644
index 0000000..0a84bda
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo.tgz
Binary files differ
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 31cf0fc..74cc115 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -232,4 +232,5 @@ TRY_COMPILE(EXPORTER_COMPILED
MESSAGE(STATUS "Searching for export(PACKAGE) test project")
SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
-FIND_PACKAGE(CMakeTestExportPackage 1.${CMAKE_VERSION} EXACT REQUIRED)
+STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION})
+FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
diff --git a/Tests/LinkFlags/CMakeLists.txt b/Tests/LinkFlags/CMakeLists.txt
new file mode 100644
index 0000000..e06020c
--- /dev/null
+++ b/Tests/LinkFlags/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 2.8)
+project(LinkFlags C)
+
+string(TOUPPER "${TEST_CONFIG}" TEST_CONFIG_UPPER)
+set(obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkFlags_lib STATIC LinkFlagsLib.c)
+set_property(TARGET LinkFlags_lib PROPERTY STATIC_LIBRARY_FLAGS ${pre}BADFLAG${obj})
+
+add_library(LinkFlags_dll SHARED LinkFlagsLib.c)
+set_property(TARGET LinkFlags_dll PROPERTY LINK_FLAGS ${pre}BADFLAG${obj})
+
+add_executable(LinkFlags_exe LinkFlagsExe.c)
+set_property(TARGET LinkFlags_exe PROPERTY LINK_FLAGS ${pre}BADFLAG${obj})
+
+add_library(LinkFlags_lib_config STATIC LinkFlagsLib.c)
+set_property(TARGET LinkFlags_lib_config PROPERTY STATIC_LIBRARY_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
+
+add_library(LinkFlags_dll_config SHARED LinkFlagsLib.c)
+set_property(TARGET LinkFlags_dll_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
+
+add_executable(LinkFlags_exe_config LinkFlagsExe.c)
+set_property(TARGET LinkFlags_exe_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
+
+add_executable(LinkFlags LinkFlags.c)
diff --git a/Tests/LinkFlags/LinkFlags.c b/Tests/LinkFlags/LinkFlags.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/LinkFlags/LinkFlags.c
@@ -0,0 +1 @@
+int main(void) { return 0; }
diff --git a/Tests/LinkFlags/LinkFlagsExe.c b/Tests/LinkFlags/LinkFlagsExe.c
new file mode 100644
index 0000000..123587a
--- /dev/null
+++ b/Tests/LinkFlags/LinkFlagsExe.c
@@ -0,0 +1,6 @@
+int main(void) { return 0; }
+
+/* Intel compiler does not reject bad flags or objects! */
+#if defined(__INTEL_COMPILER)
+# error BADFLAG
+#endif
diff --git a/Tests/LinkFlags/LinkFlagsLib.c b/Tests/LinkFlags/LinkFlagsLib.c
new file mode 100644
index 0000000..9d8d088
--- /dev/null
+++ b/Tests/LinkFlags/LinkFlagsLib.c
@@ -0,0 +1,6 @@
+int flags_lib(void) { return 0; }
+
+/* Intel compiler does not reject bad flags or objects! */
+#if defined(__INTEL_COMPILER)
+# error BADFLAG
+#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/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index 8888aba..5d076e0 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -27,15 +27,15 @@ IF (BUILD_DOCUMENTATION)
ENDIF(NOT DOT_PATH)
CONFIGURE_FILE(
- ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doxyfile)
+ ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile)
CONFIGURE_FILE(
- ${CMAKE_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
+ ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
ADD_CUSTOM_TARGET(DoxygenDoc
${BASH}
- ${CMAKE_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
+ ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
ENDIF (BUILD_DOCUMENTATION)
diff --git a/Utilities/Doxygen/doc_makeall.sh.in b/Utilities/Doxygen/doc_makeall.sh.in
index e5cf240..a1b00e7 100755
--- a/Utilities/Doxygen/doc_makeall.sh.in
+++ b/Utilities/Doxygen/doc_makeall.sh.in
@@ -48,7 +48,7 @@ export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen"
# Example:
# SOURCE_DIR=@VTK_SOURCE_DIR@
#
-export SOURCE_DIR="@CMAKE_SOURCE_DIR@"
+export SOURCE_DIR="@CMake_SOURCE_DIR@"
# REL_PATH_TO_TOP:
# Relative path from the top directory of the source files to the directory
@@ -71,7 +71,7 @@ export REL_PATH_TO_TOP=.
# DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen
# INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
#
-export DOXTEMP="@CMAKE_BINARY_DIR@/Utilities/Doxygen"
+export DOXTEMP="@CMake_BINARY_DIR@/Utilities/Doxygen"
export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox"
# DOXYFILE:
diff --git a/Utilities/Doxygen/doxyfile.in b/Utilities/Doxygen/doxyfile.in
index ad5e377..c3d3a38 100644
--- a/Utilities/Doxygen/doxyfile.in
+++ b/Utilities/Doxygen/doxyfile.in
@@ -31,19 +31,19 @@ GRAPHICAL_HIERARCHY = YES
ALLEXTERNALS = NO
-IMAGE_PATH = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/contrib"
+IMAGE_PATH = "@CMake_BINARY_DIR@/Utilities/Doxygen/contrib"
-OUTPUT_DIRECTORY = "@CMAKE_BINARY_DIR@/Utilities/Doxygen/doc"
+OUTPUT_DIRECTORY = "@CMake_BINARY_DIR@/Utilities/Doxygen/doc"
INPUT = \
- "@CMAKE_SOURCE_DIR@/Source" \
- "@CMAKE_SOURCE_DIR@/Source/CPack" \
- "@CMAKE_SOURCE_DIR@/Source/CTest" \
- "@CMAKE_SOURCE_DIR@/Source/CursesDialog" \
- "@CMAKE_SOURCE_DIR@/Source/MFCDialog" \
- "@CMAKE_BINARY_DIR@/Source/kwsys" \
- "@CMAKE_BINARY_DIR@/Source/cmsys" \
- "@CMAKE_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \
+ "@CMake_SOURCE_DIR@/Source" \
+ "@CMake_SOURCE_DIR@/Source/CPack" \
+ "@CMake_SOURCE_DIR@/Source/CTest" \
+ "@CMake_SOURCE_DIR@/Source/CursesDialog" \
+ "@CMake_SOURCE_DIR@/Source/MFCDialog" \
+ "@CMake_BINARY_DIR@/Source/kwsys" \
+ "@CMake_BINARY_DIR@/Source/cmsys" \
+ "@CMake_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
diff --git a/Utilities/KWStyle/CMake.kws.xml.in b/Utilities/KWStyle/CMake.kws.xml.in
index 9c5efee..c2b4429 100644
--- a/Utilities/KWStyle/CMake.kws.xml.in
+++ b/Utilities/KWStyle/CMake.kws.xml.in
@@ -2,7 +2,7 @@
<Description>
<LineLength>79</LineLength>
<!--
-<Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
+<Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
<Functions>
<regex>[A-Z]</regex>
<length>100</length>
diff --git a/Utilities/KWStyle/CMakeFiles.txt.in b/Utilities/KWStyle/CMakeFiles.txt.in
index aa4ee74..a95aac6 100644
--- a/Utilities/KWStyle/CMakeFiles.txt.in
+++ b/Utilities/KWStyle/CMakeFiles.txt.in
@@ -1,15 +1,15 @@
-"@CMAKE_SOURCE_DIR@/Source/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CPack/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.txx"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CTest/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.h*"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.cxx"
-"@CMAKE_SOURCE_DIR@/Source/CurseDialog/*.txx"
+"@CMake_SOURCE_DIR@/Source/*.txx"
+"@CMake_SOURCE_DIR@/Source/*.cxx"
+"@CMake_SOURCE_DIR@/Source/*.h*"
+"@CMake_SOURCE_DIR@/Source/CPack/*.txx"
+"@CMake_SOURCE_DIR@/Source/CPack/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CPack/*.h*"
+"@CMake_SOURCE_DIR@/Source/CTest/*.txx"
+"@CMake_SOURCE_DIR@/Source/CTest/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CTest/*.h*"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.h*"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.cxx"
+"@CMake_SOURCE_DIR@/Source/CurseDialog/*.txx"
-f (Lexer\.h)
-f (Lexer\.cxx)
-f (Parser\.cxx)
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index d8269c6..4803ffa 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -36,27 +36,27 @@ IF(CMAKE_USE_KWSTYLE)
SET(KWSTYLE_ARGUMENTS -msvc ${KWSTYLE_ARGUMENTS})
ENDIF(KWSTYLE_USE_MSVC_FORMAT)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
- ${CMAKE_BINARY_DIR}/CMake.kws.xml)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
- ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMake.kws.xml.in
+ ${CMake_BINARY_DIR}/CMake.kws.xml)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+ ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml)
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
- ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt)
+ CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeFiles.txt.in
+ ${CMake_BINARY_DIR}/CMakeKWSFiles.txt)
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_BINARY_DIR}/KWStyleReport.txt
+ OUTPUT ${CMake_BINARY_DIR}/KWStyleReport.txt
COMMAND ${KWSTYLE_EXECUTABLE}
- ARGS -xml ${CMAKE_BINARY_DIR}/CMake.kws.xml -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt
+ ARGS -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
COMMENT "Coding Style Checker"
)
ADD_CUSTOM_TARGET(MoreStyleChecks
COMMAND ${KWSTYLE_EXECUTABLE}
- -xml ${CMAKE_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMAKE_BINARY_DIR}/html -o ${CMAKE_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMAKE_BINARY_DIR}/CMakeKWSFiles.txt
+ -xml ${CMake_BINARY_DIR}/CMakeMoreChecks.kws.xml -html ${CMake_BINARY_DIR}/html -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v ${KWSTYLE_ARGUMENTS} -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt
COMMENT "Coding Style Checker, more checks enabled"
)
- ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMAKE_BINARY_DIR}/KWStyleReport.txt)
+ ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
ENDIF(CMAKE_USE_KWSTYLE)
diff --git a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
index f47f8e8..b7078e0 100644
--- a/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
+++ b/Utilities/KWStyle/CMakeMoreChecks.kws.xml.in
@@ -2,7 +2,7 @@
<Description>
<ErrorThreshold>10</ErrorThreshold>
<LineLength>79</LineLength>
- <Header>"@CMAKE_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
+ <Header>"@CMake_SOURCE_DIR@/Utilities/KWStyle/Headers",false,true</Header>
<Functions>
<regex>^(cm)?[A-Z]</regex>
<length>200</length>
diff --git a/Utilities/Release/dash2win64_release.cmake b/Utilities/Release/dash2win64_release.cmake
index 5bec13a..94decdd 100644
--- a/Utilities/Release/dash2win64_release.cmake
+++ b/Utilities/Release/dash2win64_release.cmake
@@ -1,6 +1,6 @@
set(CMAKE_RELEASE_DIRECTORY "c:/cygwin/home/dashboard/CMakeReleaseDirectory")
set(CONFIGURE_WITH_CMAKE TRUE)
-set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files\\ \\(x86\\)/CMake\\ 2.6/bin/cmake.exe")
+set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files\\ \\(x86\\)/CMake\\ 2.8/bin/cmake.exe")
set(PROCESSORS 8)
set(HOST dash2win64)
set(CPACK_BINARY_GENERATORS "NSIS ZIP")
@@ -12,7 +12,7 @@ CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CMAKE_Fortran_COMPILER:FILEPATH=FALSE
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
BUILD_QtDialog:BOOL:=TRUE
-QT_QMAKE_EXECUTABLE:FILEPATH=c:/Dashboards/Support/qt-4.5.3-static/bin/qmake.exe
+QT_QMAKE_EXECUTABLE:FILEPATH=c:/Dashboards/Support/qt-build/Qt/bin/qmake.exe
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(GIT_COMMAND git)
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
index 645557b..6deeb41 100644
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ b/Utilities/Release/dashmacmini2_release.cmake
@@ -1,4 +1,6 @@
set(PROCESSORS 2)
+set(CMAKE_RELEASE_DIRECTORY /Users/kitware/CMakeReleaseDirectory)
+set(USER_OVERRIDE "set(CMAKE_CXX_LINK_EXECUTABLE \\\"gcc <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -shared-libgcc -lstdc++-static\\\")")
set(INSTALL_PREFIX /)
set(HOST dashmacmini2)
set(MAKE_PROGRAM "make")
@@ -13,6 +15,6 @@ CPACK_SYSTEM_NAME:STRING=Darwin-universal
BUILD_QtDialog:BOOL:=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Software/QtBinUniversal/bin/qmake
")
-set(GIT_COMMAND /Users/kitware/.userroot/bin/git)
+set(GIT_COMMAND /opt/local/bin/git)
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${path}/release_cmake.cmake)
diff --git a/Utilities/Release/release_cmake.sh.in b/Utilities/Release/release_cmake.sh.in
index ee56f39..4189728 100755
--- a/Utilities/Release/release_cmake.sh.in
+++ b/Utilities/Release/release_cmake.sh.in
@@ -69,6 +69,13 @@ echo "Create initial cache"
echo "@INITIAL_CACHE@" > @CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build/CMakeCache.txt
check_exit_value $? "Create initial cache" || exit 1
+# create a user override file user.txt if USER_OVERRIDE is set,
+# and append the cache variable to the cache
+if [ ! -z "@USER_OVERRIDE@" ]; then
+ echo "@USER_OVERRIDE@" > @CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build/user.txt
+ echo "CMAKE_USER_MAKE_RULES_OVERRIDE:FILEPATH=@CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build/user.txt" >> @CMAKE_RELEASE_DIRECTORY@/@CMAKE_CREATE_VERSION@-build/CMakeCache.txt
+fi
+
echo "Checkout the source for @CMAKE_CREATE_VERSION@"
cd @CMAKE_RELEASE_DIRECTORY@
if [ ! -z "@GIT_COMMAND@" ]; then
@@ -116,7 +123,7 @@ check_exit_value $? "Build cmake" || exit 1
if [ -z "@SKIP_TESTS@" ]; then
echo "Run cmake tests"
- ./bin/ctest -j @PROCESSORS@ test
+ ./bin/ctest --output-on-failure -j @PROCESSORS@ test
check_exit_value $? "Test cmake" || exit 1
fi
diff --git a/Utilities/Release/v20n250_aix_release.cmake b/Utilities/Release/v20n250_aix_release.cmake
index 876c84d..88eb8d0 100644
--- a/Utilities/Release/v20n250_aix_release.cmake
+++ b/Utilities/Release/v20n250_aix_release.cmake
@@ -5,8 +5,8 @@ set(CVS_COMMAND /vol/local/bin/cvs)
set(HOST "sshserv.centers.ihost.com" )
set(EXTRA_HOP "rsh v20n250" )
set(MAKE_PROGRAM "make")
-set(CC "xlc")
-set(CXX "xlC")
+set(CC "xlc_r")
+set(CXX "xlC_r")
set(FC "xlf")
set(INITIAL_CACHE "
CMAKE_BUILD_TYPE:STRING=Release
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/cmcurl/curl/multi.h b/Utilities/cmcurl/curl/multi.h
index d253372..1b66747 100644
--- a/Utilities/cmcurl/curl/multi.h
+++ b/Utilities/cmcurl/curl/multi.h
@@ -181,7 +181,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* curl_multi_cleanup().
*
* The 'CURLMsg' struct is meant to be very simple and only contain
- * very basic informations. If more involved information is wanted,
+ * very basic information. If more involved information is wanted,
* we will provide the particular "transfer handle" in that struct
* and that should/could/would be used in subsequent
* curl_easy_getinfo() calls (or similar). The point being that we
diff --git a/Utilities/cmcurl/url.c b/Utilities/cmcurl/url.c
index 3f4a4c3..da12231 100644
--- a/Utilities/cmcurl/url.c
+++ b/Utilities/cmcurl/url.c
@@ -3983,7 +3983,7 @@ static CURLcode SetupConnection(struct connectdata *conn,
conn->bits.tcpconnect = FALSE;
/* if the connection was closed by the server while exchanging
- authentication informations, retry with the new set
+ authentication information, retry with the new set
authentication information */
if(conn->bits.proxy_connect_closed) {
/* reset the error buffer */
diff --git a/Utilities/cmlibarchive/libarchive/archive_endian.h b/Utilities/cmlibarchive/libarchive/archive_endian.h
index e374546..067312d 100644
--- a/Utilities/cmlibarchive/libarchive/archive_endian.h
+++ b/Utilities/cmlibarchive/libarchive/archive_endian.h
@@ -43,9 +43,10 @@
* Disabling inline keyword for compilers known to choke on it:
* - Watcom C++ in C code. (For any version?)
* - SGI MIPSpro
+ * - SunPro C
* - Microsoft Visual C++ 6.0 (supposedly newer versions too)
*/
-#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__)
+#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__) || defined(__SUNPRO_C)
#define inline
#elif defined(_MSC_VER)
#define inline __inline
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_copy_bhfi.c b/Utilities/cmlibarchive/libarchive/archive_entry_copy_bhfi.c
index 4e09c2f..00cad4c 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_copy_bhfi.c
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_copy_bhfi.c
@@ -72,6 +72,5 @@ archive_entry_copy_bhfi(struct archive_entry *entry,
archive_entry_set_nlink(entry, bhfi->nNumberOfLinks);
archive_entry_set_size(entry, (((int64_t)bhfi->nFileSizeHigh) << 32)
+ bhfi->nFileSizeLow);
-// archive_entry_set_mode(entry, st->st_mode);
}
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_read.c b/Utilities/cmlibarchive/libarchive/archive_read.c
index e4bdaa6..79dd1f8 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read.c
@@ -1153,7 +1153,7 @@ __archive_read_skip(struct archive_read *a, int64_t request)
if (skipped == request)
return (skipped);
/* We hit EOF before we satisfied the skip request. */
- if (skipped < 0) // Map error code to 0 for error message below.
+ if (skipped < 0) /* Map error code to 0 for error message below. */
skipped = 0;
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_compression_program.c b/Utilities/cmlibarchive/libarchive/archive_read_support_compression_program.c
index 972fb03..f58e518 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_compression_program.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_compression_program.c
@@ -72,7 +72,7 @@ archive_read_support_compression_program(struct archive *a, const char *cmd)
*/
int
archive_read_support_compression_program_signature(struct archive *_a,
- const char *cmd, void *signature, size_t signature_len)
+ const char *cmd, const void *signature, size_t signature_len)
{
(void)_a; /* UNUSED */
(void)cmd; /* UNUSED */
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
index ae997a7..c12b808 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
@@ -1403,7 +1403,7 @@ add_entry(struct iso9660 *iso9660, struct file_info *file)
iso9660->pending_files[hole] = file;
return;
}
- // Move parent into hole <==> move hole up tree.
+ /* Move parent into hole <==> move hole up tree. */
iso9660->pending_files[hole] = iso9660->pending_files[parent];
hole = parent;
}
@@ -1933,16 +1933,16 @@ next_entry(struct iso9660 *iso9660)
/*
* Rebalance the heap.
*/
- a = 0; // Starting element and its offset
+ a = 0; /* Starting element and its offset */
a_offset = iso9660->pending_files[a]->offset
+ iso9660->pending_files[a]->size;
for (;;) {
- b = a + a + 1; // First child
+ b = a + a + 1; /* First child */
if (b >= iso9660->pending_files_used)
return (r);
b_offset = iso9660->pending_files[b]->offset
+ iso9660->pending_files[b]->size;
- c = b + 1; // Use second child if it is smaller.
+ c = b + 1; /* Use second child if it is smaller. */
if (c < iso9660->pending_files_used) {
c_offset = iso9660->pending_files[c]->offset
+ iso9660->pending_files[c]->size;
diff --git a/Utilities/cmlibarchive/libarchive/archive_windows.h b/Utilities/cmlibarchive/libarchive/archive_windows.h
index a046b97..17f5698 100644
--- a/Utilities/cmlibarchive/libarchive/archive_windows.h
+++ b/Utilities/cmlibarchive/libarchive/archive_windows.h
@@ -53,7 +53,7 @@
#include <errno.h>
#define set_errno(val) ((errno)=val)
#include <io.h>
-#include <stdlib.h> //brings in NULL
+#include <stdlib.h> /* brings in NULL */
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -61,7 +61,6 @@
#include <direct.h>
#define NOCRYPT
#include <windows.h>
-//#define EFTYPE 7
#if !defined(STDIN_FILENO)
#define STDIN_FILENO 0
@@ -170,8 +169,7 @@
#ifndef S_IFIFO
#define S_IFIFO _S_IFIFO
#endif
-//#define S_IFCHR _S_IFCHR
-//#define S_IFDIR _S_IFDIR
+
#ifndef S_IFBLK
#define S_IFBLK _S_IFBLK
#endif
@@ -181,8 +179,6 @@
#ifndef S_IFSOCK
#define S_IFSOCK _S_IFSOCK
#endif
-//#define S_IFREG _S_IFREG
-//#define S_IFMT _S_IFMT
#ifndef S_ISBLK
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* block special */
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo or socket */
@@ -248,9 +244,9 @@
/* File descriptor flags used with F_GETFD and F_SETFD. */
#define FD_CLOEXEC 1 /* Close on exec. */
-//NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else...
+/*NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else... */
#define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
-//#define O_NDELAY O_NONBLOCK
+/*#define O_NDELAY O_NONBLOCK */
/* Symbolic constants for the access() function */
#if !defined(F_OK)
@@ -300,7 +296,9 @@ struct _timeval64i32 {
#define __timeval _timeval64i32
#endif
-typedef int pid_t;
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+ typedef int pid_t;
+#endif /* _MSC_VER __BORLANDC__ */
/* Message digest define */
#if !defined(HAVE_OPENSSL_MD5_H) && !defined(HAVE_OPENSSL_SHA_H)
diff --git a/Utilities/cmlibarchive/libarchive/config_windows.h b/Utilities/cmlibarchive/libarchive/config_windows.h
index c50f64d..cbbaccf 100644
--- a/Utilities/cmlibarchive/libarchive/config_windows.h
+++ b/Utilities/cmlibarchive/libarchive/config_windows.h
@@ -7,10 +7,11 @@
#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED
-
+/*
///////////////////////////////////////////////////////////////////////////
// Check for Watcom and Microsoft Visual C compilers (WIN32 only) ///////
///////////////////////////////////////////////////////////////////////////
+*/
#if (defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
#define IS_WIN32 1
@@ -33,8 +34,8 @@
/* Define to 1 if UID should be unsigned */
#define USE_UNSIGNED_GID 1
#endif
-///////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////
+/*///////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////*/
/* Define to 1 if you have the `acl_create_entry' function. */
/* #undef HAVE_ACL_CREATE_ENTRY */
diff --git a/Utilities/cmzlib/deflate.c b/Utilities/cmzlib/deflate.c
index a5e7a35..5ec8374 100644
--- a/Utilities/cmzlib/deflate.c
+++ b/Utilities/cmzlib/deflate.c
@@ -286,10 +286,10 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
- // The following memset eliminates the valgrind uninitialized warning
- // "swept under the carpet" here:
- // http://www.zlib.net/zlib_faq.html#faq36
- //
+ /* The following memset eliminates the valgrind uninitialized warning
+ "swept under the carpet" here:
+ http://www.zlib.net/zlib_faq.html#faq36 */
+
memset(s->window, 0, s->w_size*2*sizeof(Byte));
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
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 25d6b68..01d9e15 100755
--- a/bootstrap
+++ b/bootstrap
@@ -30,17 +30,22 @@ cmake_date_stamp_component()
cmake_system=`uname`
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
cmake_binary_dir=`pwd`
+
+# Load version information.
cmake_version_major="`cmake_version_component MAJOR`"
cmake_version_minor="`cmake_version_component MINOR`"
-if echo "${cmake_version_minor}" | grep "[0-9]*[13579]" > /dev/null 2>&1; then
- cmake_version_patch="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
-else
- cmake_version_patch="`cmake_version_component PATCH`"
+cmake_version_patch="`cmake_version_component PATCH`"
+cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
+cmake_version_tweak="`cmake_version_component TWEAK`"
+if [ "x$cmake_version_tweak" = "x" ]; then
+ cmake_version_tweak="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
+fi
+if [ "$cmake_version_tweak" != "0" ]; then
+ cmake_version="${cmake_version}.${cmake_version_tweak}"
fi
-cmake_version="${cmake_version_major}.${cmake_version_minor}"
-cmake_version_full="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
-cmake_data_dir="/share/cmake-${cmake_version}"
-cmake_doc_dir="/doc/cmake-${cmake_version}"
+
+cmake_data_dir="/share/cmake-${cmake_version_major}.${cmake_version_minor}"
+cmake_doc_dir="/doc/cmake-${cmake_version_major}.${cmake_version_minor}"
cmake_man_dir="/man"
cmake_init_file=""
cmake_bootstrap_system_libs=""
@@ -161,6 +166,7 @@ CMAKE_UNUSED_SOURCES="\
"
CMAKE_CXX_SOURCES="\
+ cmStandardIncludes \
cmake \
cmakemain \
cmakewizard \
@@ -312,7 +318,7 @@ Directory and file names:
# Display CMake bootstrap usage
cmake_version_display()
{
- echo "CMake ${cmake_version_full}, Copyright 2000-2009 Kitware, Inc."
+ echo "CMake ${cmake_version}, Copyright 2000-2009 Kitware, Inc."
}
# Display CMake bootstrap error, display the log file and exit
@@ -644,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}"
@@ -691,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}"
@@ -748,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=
@@ -777,7 +850,7 @@ if [ "x${cmake_parallel_make}" != "x" ]; then
cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
fi
for a in ${cmake_make_processors}; do
- if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
+ if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
cmake_make_processor="${a}"
fi
done
@@ -786,19 +859,19 @@ if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
if [ -z "${cmake_make_processor}" ]; then
cmake_make_flags="${cmake_original_make_flags}"
for a in ${cmake_make_processors}; do
- if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
+ if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
cmake_make_processor="${a}"
fi
done
fi
fi
cd "${cmake_bootstrap_dir}"
-rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
if [ -z "${cmake_make_processor}" ]; then
cmake_error 8 "Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE."
fi
+rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
echo "Makefile processor on this system is: ${cmake_make_processor}"
if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
echo "---------------------------------------------"
@@ -1246,6 +1319,8 @@ fi
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
+cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_TWEAK ${cmake_version_tweak}"
+cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"