summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake51
-rw-r--r--CMakeCPackOptions.cmake.in10
-rw-r--r--CMakeLists.txt69
-rw-r--r--ChangeLog.manual413
-rw-r--r--Modules/CMakeCCompilerId.c.in3
-rw-r--r--Modules/CMakeCInformation.cmake14
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in3
-rw-r--r--Modules/CMakeCXXInformation.cmake14
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake35
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake29
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake18
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake4
-rw-r--r--Modules/CMakeFortranInformation.cmake14
-rw-r--r--Modules/CMakeJavaInformation.cmake18
-rw-r--r--Modules/CheckCSourceCompiles.cmake4
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake4
-rw-r--r--Modules/CheckFunctionExists.cmake14
-rw-r--r--Modules/CheckSymbolExists.cmake19
-rw-r--r--Modules/Compiler/SCO-C.cmake2
-rw-r--r--Modules/Compiler/SCO-CXX.cmake2
-rw-r--r--Modules/Compiler/SCO.cmake25
-rw-r--r--Modules/FindALSA.cmake2
-rw-r--r--Modules/FindASPELL.cmake2
-rw-r--r--Modules/FindAVIFile.cmake2
-rw-r--r--Modules/FindBISON.cmake2
-rw-r--r--Modules/FindBZip2.cmake2
-rw-r--r--Modules/FindBullet.cmake2
-rw-r--r--Modules/FindCUDA.cmake2
-rw-r--r--Modules/FindCURL.cmake2
-rw-r--r--Modules/FindCVS.cmake2
-rw-r--r--Modules/FindCoin3D.cmake2
-rw-r--r--Modules/FindCurses.cmake2
-rw-r--r--Modules/FindCxxTest.cmake2
-rw-r--r--Modules/FindDCMTK.cmake2
-rw-r--r--Modules/FindDart.cmake2
-rw-r--r--Modules/FindDevIL.cmake2
-rw-r--r--Modules/FindDoxygen.cmake2
-rw-r--r--Modules/FindEXPAT.cmake2
-rw-r--r--Modules/FindFLEX.cmake2
-rw-r--r--Modules/FindFLTK.cmake2
-rw-r--r--Modules/FindFreetype.cmake2
-rw-r--r--Modules/FindGDAL.cmake2
-rw-r--r--Modules/FindGIF.cmake2
-rw-r--r--Modules/FindGLUT.cmake2
-rw-r--r--Modules/FindGTK2.cmake2
-rw-r--r--Modules/FindGTest.cmake2
-rw-r--r--Modules/FindGit.cmake2
-rw-r--r--Modules/FindGnuTLS.cmake2
-rw-r--r--Modules/FindGnuplot.cmake2
-rw-r--r--Modules/FindHDF5.cmake2
-rw-r--r--Modules/FindHSPELL.cmake2
-rw-r--r--Modules/FindImageMagick.cmake2
-rw-r--r--Modules/FindJNI.cmake2
-rw-r--r--Modules/FindJPEG.cmake2
-rw-r--r--Modules/FindJasper.cmake2
-rw-r--r--Modules/FindJava.cmake2
-rw-r--r--Modules/FindLibArchive.cmake5
-rw-r--r--Modules/FindLibXml2.cmake2
-rw-r--r--Modules/FindLibXslt.cmake2
-rw-r--r--Modules/FindLua50.cmake2
-rw-r--r--Modules/FindLua51.cmake2
-rw-r--r--Modules/FindMPEG.cmake2
-rw-r--r--Modules/FindMPEG2.cmake2
-rw-r--r--Modules/FindMPI.cmake2
-rw-r--r--Modules/FindMotif.cmake2
-rw-r--r--Modules/FindOpenAL.cmake2
-rw-r--r--Modules/FindOpenGL.cmake2
-rw-r--r--Modules/FindOpenMP.cmake2
-rw-r--r--Modules/FindOpenSSL.cmake2
-rw-r--r--Modules/FindOpenSceneGraph.cmake2
-rw-r--r--Modules/FindOpenThreads.cmake2
-rw-r--r--Modules/FindPHP4.cmake2
-rw-r--r--Modules/FindPNG.cmake4
-rw-r--r--Modules/FindPerl.cmake2
-rw-r--r--Modules/FindPerlLibs.cmake3
-rw-r--r--Modules/FindPhysFS.cmake2
-rw-r--r--Modules/FindProducer.cmake2
-rw-r--r--Modules/FindProtobuf.cmake2
-rw-r--r--Modules/FindPythonInterp.cmake2
-rw-r--r--Modules/FindPythonLibs.cmake3
-rw-r--r--Modules/FindQt3.cmake2
-rw-r--r--Modules/FindQt4.cmake5
-rw-r--r--Modules/FindQuickTime.cmake2
-rw-r--r--Modules/FindRTI.cmake2
-rw-r--r--Modules/FindRuby.cmake2
-rw-r--r--Modules/FindSWIG.cmake2
-rw-r--r--Modules/FindSubversion.cmake2
-rw-r--r--Modules/FindTCL.cmake2
-rw-r--r--Modules/FindTIFF.cmake2
-rw-r--r--Modules/FindTclsh.cmake2
-rw-r--r--Modules/FindThreads.cmake2
-rw-r--r--Modules/FindWget.cmake2
-rw-r--r--Modules/FindZLIB.cmake4
-rw-r--r--Modules/Findosg.cmake2
-rw-r--r--Modules/FindosgAnimation.cmake2
-rw-r--r--Modules/FindosgDB.cmake2
-rw-r--r--Modules/FindosgFX.cmake2
-rw-r--r--Modules/FindosgGA.cmake2
-rw-r--r--Modules/FindosgIntrospection.cmake2
-rw-r--r--Modules/FindosgManipulator.cmake2
-rw-r--r--Modules/FindosgParticle.cmake2
-rw-r--r--Modules/FindosgProducer.cmake2
-rw-r--r--Modules/FindosgShadow.cmake2
-rw-r--r--Modules/FindosgSim.cmake2
-rw-r--r--Modules/FindosgTerrain.cmake2
-rw-r--r--Modules/FindosgText.cmake2
-rw-r--r--Modules/FindosgUtil.cmake2
-rw-r--r--Modules/FindosgViewer.cmake2
-rw-r--r--Modules/FindosgVolume.cmake2
-rw-r--r--Modules/FindosgWidget.cmake2
-rw-r--r--Modules/FindwxWidgets.cmake2
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake58
-rw-r--r--Modules/Platform/SCO_SV.cmake3
-rw-r--r--Source/CMakeLists.txt5
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx1
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx2
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx46
-rw-r--r--Source/CursesDialog/form/frm_driver.c2
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx16
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h2
-rw-r--r--Source/QtDialog/QCMake.cxx18
-rw-r--r--Source/QtDialog/QCMake.h7
-rw-r--r--Source/cmAddTestCommand.cxx5
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx28
-rw-r--r--Source/cmCommandArgumentParserHelper.h2
-rw-r--r--Source/cmCoreTryCompile.cxx78
-rw-r--r--Source/cmDefinitions.cxx16
-rw-r--r--Source/cmDefinitions.h3
-rw-r--r--Source/cmDependsC.cxx1
-rw-r--r--Source/cmDocumentCompileDefinitions.h34
-rw-r--r--Source/cmDocumentVariables.cxx59
-rw-r--r--Source/cmExportFileGenerator.cxx6
-rw-r--r--Source/cmExportInstallFileGenerator.cxx14
-rw-r--r--Source/cmFunctionCommand.cxx4
-rw-r--r--Source/cmGetCMakePropertyCommand.h11
-rw-r--r--Source/cmGetDirectoryPropertyCommand.h3
-rw-r--r--Source/cmGetSourceFilePropertyCommand.h4
-rw-r--r--Source/cmGetTargetPropertyCommand.h4
-rw-r--r--Source/cmGetTestPropertyCommand.h12
-rw-r--r--Source/cmGlobalGenerator.cxx46
-rw-r--r--Source/cmGlobalGenerator.h5
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx9
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx74
-rw-r--r--Source/cmGlobalXCodeGenerator.h3
-rw-r--r--Source/cmGraphVizWriter.cxx6
-rw-r--r--Source/cmIfCommand.h89
-rw-r--r--Source/cmListCommand.h8
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx66
-rw-r--r--Source/cmLocalVisualStudio7Generator.h1
-rw-r--r--Source/cmMacroCommand.cxx12
-rw-r--r--Source/cmMacroCommand.h1
-rw-r--r--Source/cmMakefile.cxx226
-rw-r--r--Source/cmMakefile.h17
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx49
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.h1
-rw-r--r--Source/cmSourceFile.cxx26
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmTarget.cxx34
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Source/cmTryCompileCommand.h45
-rw-r--r--Source/cmTryRunCommand.h5
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx114
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx8
-rw-r--r--Source/cmVisualStudioGeneratorOptions.h3
-rw-r--r--Source/cmake.cxx109
-rw-r--r--Source/cmake.h23
-rw-r--r--Source/cmakemain.cxx23
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
-rw-r--r--Tests/ArgumentExpansion/CMakeLists.txt60
-rw-r--r--Tests/BundleTest/BundleLib.cxx4
-rw-r--r--Tests/BundleTest/BundleTest.cxx6
-rw-r--r--Tests/BundleTest/CMakeLists.txt12
-rw-r--r--Tests/CFBundleTest/CMakeLists.txt56
-rw-r--r--Tests/CFBundleTest/ExportList_plugin.txt3
-rw-r--r--Tests/CFBundleTest/Info.plist.in54
-rw-r--r--Tests/CFBundleTest/InfoPlist.strings.in4
-rw-r--r--Tests/CFBundleTest/Localized.r18
-rw-r--r--Tests/CFBundleTest/Localized.rsrcbin0 -> 496 bytes
-rw-r--r--Tests/CFBundleTest/PluginConfig.cmake21
-rw-r--r--Tests/CFBundleTest/README.txt16
-rw-r--r--Tests/CFBundleTest/VerifyResult.cmake32
-rw-r--r--Tests/CFBundleTest/np_macmain.cpp49
-rw-r--r--Tests/CMakeLists.txt183
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt12
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in18
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in18
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in18
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in18
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in7
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake12
-rw-r--r--Tests/CTestTest2/test.cmake.in13
-rw-r--r--Tests/CTestTest3/test.cmake.in120
-rw-r--r--Tests/CTestTestBadExe/test.cmake.in3
-rw-r--r--Tests/CTestTestChecksum/test.cmake.in3
-rw-r--r--Tests/CTestTestCostSerial/test.cmake.in3
-rw-r--r--Tests/CTestTestCrash/test.cmake.in3
-rw-r--r--Tests/CTestTestCycle/test.cmake.in3
-rw-r--r--Tests/CTestTestDepends/test.cmake.in3
-rw-r--r--Tests/CTestTestFailedSubmits/test.cmake.in4
-rw-r--r--Tests/CTestTestFailure/testNoBuild.cmake.in3
-rw-r--r--Tests/CTestTestFailure/testNoExe.cmake.in3
-rw-r--r--Tests/CTestTestParallel/test.cmake.in3
-rw-r--r--Tests/CTestTestResourceLock/test.cmake.in3
-rw-r--r--Tests/CTestTestScheduler/test.cmake.in3
-rw-r--r--Tests/CTestTestStopTime/test.cmake.in3
-rw-r--r--Tests/CTestTestSubdir/test.cmake.in3
-rw-r--r--Tests/CTestTestTimeout/test.cmake.in3
-rw-r--r--Tests/CTestTestZeroTimeout/test.cmake.in3
-rw-r--r--Tests/MissingSourceFile/CMakeLists.txt2
-rw-r--r--Tests/SubDirSpaces/CMakeLists.txt10
-rw-r--r--Tests/TestsWorkingDirectory/CMakeLists.txt6
-rw-r--r--Tests/TestsWorkingDirectory/subdir/CMakeLists.txt31
-rw-r--r--Tests/VSResource/CMakeLists.txt36
-rw-r--r--Tests/VSResource/main.cpp84
-rw-r--r--Tests/VSResource/test.rc16
-rw-r--r--Tests/VSResource/test.txt2
-rw-r--r--Tests/VariableUnusedViaSet/CMakeLists.txt4
-rw-r--r--Tests/VariableUnusedViaUnset/CMakeLists.txt8
-rw-r--r--Tests/VariableUsage/CMakeLists.txt1
-rw-r--r--Utilities/Release/v20n250_aix_release.cmake6
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt20
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.c15
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry_xattr.c7
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_windows.h5
-rwxr-xr-xbootstrap54
228 files changed, 2704 insertions, 843 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 692befa..c3c25f5 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -13,16 +13,18 @@
# If the cmake version includes cpack, use it
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
- OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
+ OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
"Install Microsoft runtime debug libraries with CMake." FALSE)
MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES)
+
+ # By default, do not warn when built on machines using only VS Express:
+ IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+ SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+ ENDIF()
+
INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
- # Set the options file that needs to be included inside CMakeCPackOptions.cmake
- SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
- CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
- "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
- SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
+
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
SET(CPACK_PACKAGE_VENDOR "Kitware")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
@@ -30,6 +32,25 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
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}")
+
+ # Make this explicit here, rather than accepting the CPack default value,
+ # so we can refer to it:
+ SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+
+ # Installers for 32- vs. 64-bit CMake:
+ # - Root install directory (displayed to end user at installer-run time)
+ # - "NSIS package/display name" (text used in the installer GUI)
+ # - Registry key used to store info about the installation
+ IF(CMAKE_CL_64)
+ SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+ SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
+ SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
+ ELSE()
+ SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
+ SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+ SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
+ ENDIF()
+
IF(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
@@ -41,11 +62,12 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64)
- SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR})
+ SET(CPACK_SYSTEM_NAME win64-x64)
ELSE(CMAKE_CL_64)
- SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR})
+ SET(CPACK_SYSTEM_NAME win32-x86)
ENDIF(CMAKE_CL_64)
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
+
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not
@@ -57,15 +79,17 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN)
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+
SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
+
IF(UNIX)
SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
ENDIF(UNIX)
-# cygwin specific packaging stuff
+
+ # cygwin specific packaging stuff
IF(CYGWIN)
-
# setup the cygwin package name
SET(CPACK_PACKAGE_NAME cmake)
# setup the name of the package for cygwin cmake-2.4.3
@@ -87,6 +111,13 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# this file uses some of the package file name variables
INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
ENDIF(CYGWIN)
+
+ # Set the options file that needs to be included inside CMakeCPackOptions.cmake
+ SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
+ CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
+ "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
+ SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
+
# include CPack model once all variables are set
INCLUDE(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index a94fa72..69a1508 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -3,8 +3,10 @@
# in this file.
if(CPACK_GENERATOR MATCHES "NSIS")
+ SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
+
# set the install/unistall icon used for the installer itself
- # There is a bug in NSI that does not handle full unix paths properly.
+ # There is a bug in NSI that does not handle full unix paths properly.
SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
# set the package header icon for MUI
@@ -21,11 +23,11 @@ if(CPACK_GENERATOR MATCHES "NSIS")
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help"
"http://www.cmake.org" "CMake Web Site"
)
- # Use the icond from cmake-gui for add-remove programs
+ # Use the icon from cmake-gui for add-remove programs
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
- SET(CPACK_NSIS_DISPLAY_NAME "CMake @CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@ a cross-platform, open-source build system")
- SET(CPACK_NSIS_PACKAGE_NAME "CMake @CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@")
+ SET(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
+ SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4508e33..23525c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,12 @@ IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
+IF(CMAKE_BOOTSTRAP)
+ # Running from bootstrap script. Set local variable and remove from cache.
+ SET(CMAKE_BOOTSTRAP 1)
+ UNSET(CMAKE_BOOTSTRAP CACHE)
+ENDIF()
+
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
# Allow empty endif() and such with CMake 2.4.
@@ -53,42 +59,47 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
- # Allow the user to enable/disable all system utility library options
- # by setting CMAKE_USE_SYSTEM_LIBRARIES on the command line.
- IF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
- SET(CMAKE_USE_SYSTEM_LIBRARIES_USER 1)
- ENDIF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
- IF(CMAKE_USE_SYSTEM_LIBRARIES)
- SET(CMAKE_USE_SYSTEM_LIBRARIES ON)
- ELSE(CMAKE_USE_SYSTEM_LIBRARIES)
- SET(CMAKE_USE_SYSTEM_LIBRARIES OFF)
- ENDIF(CMAKE_USE_SYSTEM_LIBRARIES)
- IF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
- SET(CMAKE_USE_SYSTEM_CURL "${CMAKE_USE_SYSTEM_LIBRARIES}"
- CACHE BOOL "Use system-installed curl" FORCE)
- SET(CMAKE_USE_SYSTEM_EXPAT "${CMAKE_USE_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)
+ # Allow the user to enable/disable all system utility library options by
+ # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
+ SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
+ FOREACH(util ${UTILITIES})
+ IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
+ AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
+ SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
+ ENDIF()
+ IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
+ IF(CMAKE_USE_SYSTEM_LIBRARY_${util})
+ SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
+ ELSE()
+ SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
+ ENDIF()
+ IF(CMAKE_BOOTSTRAP)
+ UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
+ ENDIF()
+ STRING(TOLOWER "${util}" lutil)
+ SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
+ CACHE BOOL "Use system-installed ${lutil}" FORCE)
+ ELSE()
+ SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
+ ENDIF()
+ ENDFOREACH(util)
+ IF(CMAKE_BOOTSTRAP)
+ UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
+ ENDIF()
# Optionally use system utility libraries.
- OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" ${CMAKE_USE_SYSTEM_LIBRARIES})
+ OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
- ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
+ "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "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_USE_SYSTEM_LIBRARY_EXPAT}" "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
- ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
+ "${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "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)
+ "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
# Mention to the user what system libraries are being used.
- FOREACH(util BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
+ FOREACH(util ${UTILITIES})
IF(CMAKE_USE_SYSTEM_${util})
MESSAGE(STATUS "Using system-installed ${util}")
ENDIF(CMAKE_USE_SYSTEM_${util})
@@ -419,7 +430,7 @@ ENDIF()
# The CMake version number.
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
-SET(CMake_VERSION_PATCH 3)
+SET(CMake_VERSION_PATCH 4)
#SET(CMake_VERSION_TWEAK 0)
#SET(CMake_VERSION_RC 1)
diff --git a/ChangeLog.manual b/ChangeLog.manual
index c2e2cdf..20998a3 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,3 +1,416 @@
+Changes in CMake 2.8.4 (since 2.8.4-rc2)
+----------------------------------------
+Alex Neundorf (1):
+ Fix crash in GraphVizWriter when GRAPHVIZ_TARGET_IGNORE_REGEX is used
+
+Andreas Schneider (1):
+ FindPerlLibs: Add notice of copyright
+
+Brad King (3):
+ libarchive: Define major/minor/makedev only where needed (#11648)
+ libarchive: Use OpenSSL only if CMAKE_USE_OPENSSL (#11815)
+ Fix documentation of MSVC_VERSION (#11833)
+
+David Cole (1):
+ Silence the may be used uninitialized warnings: initialize stuff.
+
+Eric NOULARD (2):
+ CPack Tests the different ways of packaging components
+ Avoid foreach IN LISTS syntax which is not supported by CMake 2.6
+
+Changes in CMake 2.8.4-rc2 (since 2.8.4-rc1)
+--------------------------------------------
+Alex Neundorf (3):
+ Make cmake build again with cmake < 2.6.3
+ Strip trailing whitespace.
+ Fix parsing of compiler name with a version number
+
+Ben Boeckel (86):
+ ... 86 commit messages summarized as:
+ Fix ADD_TEST regression when WORKING_DIRECTORY not given
+ Add new "strict-mode" CMake variable checking
+ Activate / avoid using new command line arguments:
+ --warn-uninitialized
+ --warn-unused-vars
+ --no-warn-unused-cli
+ --check-system-vars
+
+Bill Hoffman (3):
+ For macros make sure the FilePath points to a valid pointer in the args.
+ Add a warning when variables are used uninitialized.
+ Make --strict-mode option, and integrate with cmake-gui
+
+Brad King (34):
+ bootstrap: Granular system library selection (#11431)
+ bootstrap: Clarify --init flag documentation (#11431)
+ bootstrap: --verbose implies verbose Makefiles (#11708)
+ Combine duplicate COMPILE_DEFINITIONS disclaimer
+ Document COMPILE_DEFINITIONS known limitations (#11660, #11712)
+ Document try_compile behavior more clearly (#11688)
+ Document Check(C|CXX)SourceCompiles behavior more clearly (#11688)
+ Fix get_(cmake|test)_property documentation (#11703)
+ Reference get_property() from old get_*_property() commands
+ Replace misleading example in the if() documentation (#10773)
+ Clarify auto-dereference cases in if() command (#11701)
+ Document CheckFunctionExists more clearly (#10044)
+ Document CheckSymbolExists more clearly (#11685)
+ Update CheckSymbolExists copyright year
+ Report directory with missing source file (#11677)
+ Test that missing source mentions directory (#11677)
+ Teach Simple_Mingw_Linux2Win test to use windres
+ Disable SubDirSpaces parens with GNU Make 3.82 (#11654)
+ libarchive: Fix major() check for LSB 4.0 (#11648)
+ Xcode: Make generation depend on all input directories
+ Recognize SCO UnixWare C/C++ compilers (#11700)
+ Factor SCO compiler info out of platform file (#11700)
+ Honor CMAKE_TRY_COMPILE_CONFIGURATION in Makefile generators (#10809)
+ Document CMAKE_TRY_COMPILE_CONFIGURATION variable
+ Honor VS_SCC_* properties in Fortran targets (#10237)
+ Normalize slashes in scanned #include lines (#10281)
+ Improve try_compile and try_run error messages
+ Use shortest extension to verify try_compile language (#11731)
+ Modules: Include builtin FindPackageHandleStandardArgs directly
+ Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725)
+ Clarify CMAKE_USER_MAKE_RULES_OVERRIDE documentation (#11724)
+ Always place try_compile executables predictably (#11724)
+ try_compile: Allow only languages loaded in caller (#11469)
+ Fix ArgumentExpansion test expected results
+
+Clinton Stimpson (1):
+ Replace exec_program with execute_process for qmake queries.
+
+David Cole (16):
+ Update script with new machine name
+ VS10: Fix problems with InstallRequiredSystemLibraries.
+ Add CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS variable
+ Add CPACK_NSIS_INSTALL_ROOT for CMake's own installer (#9148)
+ Xcode: Disable implicit make rules in custom rules makefiles.
+ Add freeglut as library name (#10031)
+ Add new names for PNG and ZLIB libraries
+ Avoid exceptions when ccmake terminal window is too small (#11668)
+ VS10: Load projects with obj "source" files (#11147)
+ VS10: Enable using devenv as CMAKE_MAKE_PROGRAM (#11459)
+ Xcode: Fix crash: avoid strlen call on NULL char *
+ CTestTest2: Avoid running purify unless requested
+ VS10: Escape double quote chars in defines for rc files (#11695)
+ Fix line too long KWStyle issue (#11695)
+ Avoid space in rc /D values for VS6 and Cygwin (#11695)
+ VSResource: Avoid windres /D with quoted spaces (#11695)
+
+Marcus D. Hanwell (1):
+ Bug #11715 - generate header in the build tree.
+
+Nicolas Despres (1):
+ bootstrap: Add --enable-ccache option (#11707)
+
+Changes in CMake 2.8.4-rc1 (since 2.8.3)
+----------------------------------------
+Alex Neundorf (32):
+ Add support for nasm assembler, patch by Peter Collingbourne (see #10069)
+ Improve misleading comments.
+ Add missing copyright headers
+ We already have 2010, fix copyright year.
+ Make FindBISON work properly with non-C locales (#11326)
+ Add support for yasm, a nasm compatible assembler
+ Use CMAKE_ASM_NASM_FLAGS for nasm instead of FLAGS
+ Remove trailing whitespace and minor formatting changes for the dot-code
+ Move the code for collecting targets and libraries into separate functions
+ Properly insert all targets, also those which don't link to anything.
+ Generate separate dot files for each target, and a big one with everything.
+ Move the code for generating dot-files into separate class cmGraphVizWriter
+ Fix #11421: FindQt3.cmake doesn't honor the REQUIRED keyword
+ Remove trailing whitespace
+ Don't enforce VERBOSE makefiles for the CodeBlocks generator
+ Remove the "early alpha stage" comments about Eclipse and C::B
+ Don't disable colors in the CodeBlocks generator and minor cleanup.
+ Some more fixes for nasm support, from Etienne (#10069)
+ Enable/disable generating graphs depending on the target type
+ Use std::cout instead of fprintf
+ Collect targets and libs on demand instead of in the ctor
+ Exclude targets from the graphviz file based on a regex
+ Include CMakeDetermineCompilerId in CMakeDetermineASMCompiler.cmake (#11467)
+ Fix typos in the doc
+ Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator
+ Add ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT as a ADVANCED cache variable (#9631)
+ Fix crash in Eclipse generator with empty project (#11616)
+ Fix indentation in cmPolicies::ApplyPolicyVersion()
+ Remove trailing whitespace
+ Prefer files from CMAKE_ROOT when including from CMAKE_ROOT
+ Improve documentation and messages for the new CMP0017
+ Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
+
+Alexey Ozeritsky (5):
+ FindBLAS works in C/C++ projects without Fortran
+ ACML find fixes (issue 0011219)
+ find ACML fixes
+ fix for Fortran-only projects
+ FindLAPACK works with C/C++ only projects (issue 0009976)
+
+Andrius Å tikonas (1):
+ Modules: Fix spelling 'becase' -> 'because'.
+
+Ben Boeckel (25):
+ Fix parsing of cache variables without a type
+ Use cmCacheManager to load entries from the cache
+ Support manual cache entries
+ Condense parsing of cache entries
+ Use FPHSA in FindOpenGL
+ Ignore strerror_r since CMake isn't threaded
+ Use _POLL_EMUL_H_ instead of HAVE_POLL_FINE
+ Rename WorkingDirectory test
+ Add WORKING_DIRECTORY argument to add_test
+ Add tests for WORKING_DIRECTORY arg to add_test
+ Rename the project to match the test
+ Fix header includes for C++ and Visual Studio
+ Add ctype.h include for toupper()
+ Flip slashes around on Windows
+ Use --><-- markers to denote the path
+ Simplify the _default_cwd derivation
+ Only test the default cwd with Makefiles
+ Group adding tests with its properties
+ Fully specify the path to old-signature add_test
+ Use iostream to make Borland happy
+ Check for poll when looking for _POLL_EMUL_H_
+ Toss out strerror_r macros
+ Fix missed _POLL_EMUL_H_ and HAVE_POLL combo
+ Make TestsWorkingDirectory test a C file
+ Pass the expected value as the first argument
+
+Bill Hoffman (17):
+ Fixes for the OSF operating system build.
+ Add a fix for the inline keyword on the osf os.
+ Add a "Contract" test for VTK. The test downloads and builds VTK.
+ Fix contract test so it is not hard coded to the vtk542 test.
+ Fix incremental linking for VS2010 with nmake or make.
+ Change cpack run and verify script to work with multi-config generators.
+ Fix vs2010 project generation error when HEADER_FILE_ONLY is set.
+ Add more documentation for LANGUAGE property.
+ Add flags to resource builds on vs 2010 with a test.
+ Disable incremental testing for this test, it crashes vs9 linker.
+ Only run resource test for MSVC compilers.
+ Add support for windows resources with mingw/msys.
+ Add support for windres to cygwin.
+ Add testing for windows resources for mingw/msys/cygwin and remove for watcom.
+ Enable resource building with the intel compiler on windows.
+ Add support for source files in custom targets for VS 10 (Bug#11330).
+ Change the nightly tests to build from the nightly branch and not next.
+
+Brad King (90):
+ Store direct dependencies in solutions for VS >= 8
+ BUG: Fix compiler flag test for non-English MSVC (#11336)
+ Document custom command behavior without DEPENDS (#11407)
+ Consolidate duplicate link rule make dependency code
+ Define LINK_DEPENDS target property (#11406)
+ KWSys: Teach SystemInformation about WinXP Pro and Win7
+ Fix Intel .vfproj SubSystem attribute values
+ Set Intel .vfproj RuntimeLibrary attribute
+ Create Fortran info variables for .mod behavior
+ Teach CMake about Cray C, C++, and Fortran compilers
+ Speedup find_* commands (#11412)
+ Prefer non-empty prefixes when matching lib names (#11468)
+ Record edge type in global dependency graph
+ Use modern global dependency graph for VS < 8 deps
+ Allow add_dependencies() on imported targets (#10395)
+ Pass Mac linker flag through PGI compiler using "-Wl,"
+ Modernize FindITK module (#11494)
+ Fix find_* argument parsing crash (#11513)
+ Skip VS <= 7.1 dependency analysis for VS >= 8
+ Enable 64-bit tools with VS 2010 Express (#9981, #10722)
+ KWSys: Associate installed library with an EXPORT
+ Fix try_compile RemoveFile anti-virus loop (#11503)
+ Fix Fortran .mod timestamps with Cray compiler
+ Make Fortran $obj.provides.build targets not .PHONY
+ Honor custom command dependencies on imported targets (#10395)
+ Improve signature of cmLocalGenerator::GetRealDependency
+ Skip file-level dependencies on custom targets (#11332)
+ Simplify VS generator ConstructScript interface
+ Factor out common custom command generator
+ Remove cmLocalGenerator::GetRealLocation
+ KWSys: Remove realpath from SystemTools::GetPath (#10335)
+ Fix parallel "make install" of CMake itself
+ CTest: Fix ctest_sleep documentation (#11554)
+ Fix soname in cross-compiled targets with Mac host (#11547)
+ Detect object files in implicit link information
+ Allow Fortran platform files to set empty values
+ Recognize the NAG Fortran compiler
+ Add NAG Fortran compiler information files
+ FortranCInterface: Recognize NAG Fortran module symbols
+ Remove unused variable "rootdir" in VS generators
+ Avoid msbuild idiosyncrasy that builds multiple configs (#11594)
+ Remove unused parameter "root" in some VS generator methods
+ Fix dependency tracing of INSTALL and PACKAGE (#11598)
+ Remove unused GLOBAL_TARGET generation code
+ KWSys: Use EXPORT name only if installing library
+ Write full version into try_compile CMakeLists
+ KWSys: Do not mangle UNC paths in ConvertToUnixOutputPath (#10206)
+ Normalize add_custom_command OUTPUT names (#10485)
+ Make link rule depend on ".def" file (#11014)
+ Document target_link_libraries target scope (#11058)
+ Record backtrace in cmCustomCommand
+ Factor generator expression docs out of add_test
+ Factor per-config sample targets out of 'Testing' test
+ Optionally suppress errors in cmGeneratorExpression
+ Record set of targets used in cmGeneratorExpression
+ Introduce "generator expression" syntax to custom commands (#11209)
+ CTest: Fix test DEPEND cycle detection
+ Make Intel defines consistent with MSVC on Windows (#9904)
+ CTest: Fix line-too-long style in DEPEND cycle error
+ Detect Fortran target architecture on Windows
+ Modernize Intel compiler info on Windows
+ Remove unused old-style g++ info file
+ CheckCCompilerFlag: Strict signature of 'main' (#11615)
+ Warn in find(GLOB) docs about bad use case (#11617)
+ Remove call to SystemTools::GetMaximumFilePathLength
+ Xcode: Generate native 3.2 projects
+ Declare min CMake version in --system-information project
+ Cygwin: Fix tests to check CYGWIN instead of WIN32
+ Cygwin: Do not define 'WIN32' (#10122)
+ Revert "Remove unused parameter "root" in some VS generator methods"
+ Revert "Avoid msbuild idiosyncrasy that builds multiple configs" (#11633)
+ Avoid msbuild ".\" idiosyncrasy that builds multiple configs (#11594)
+ Mark CustomCommand test perconfig.out as SYMBOLIC
+ CTest: Factor out duplicate Git author/committer code
+ KWSys: Avoid buffer overflow in SystemInformation (#11018)
+ Fix sentence break in add_test documentation
+ Pass Mac linker flag through all compilers with -Wl,
+ KWSys: Avoid passing string literal as char*
+ Avoid passing string literal to char* type
+ Fix constness in compiler id detection
+ Build enable_language command during bootstrap
+ Map multiple /FI flags for VS < 10 (#11649)
+ KWSys: Remove useless include <sys/procfs.h> (#11648)
+ Allow users to specify defaults for unset policies
+ ccmake: Use LSB 4.0 curses API conditionally
+ CTest: Do not truncate UTF-8 test output too early (#10656)
+ ccmake: Use LSB 4.0 getmaxyx conditionally
+ Allow platform files to set large archive rules (#11674)
+ Document reading LOCATION early as undefined (#11671)
+ Document reading LOCATION_<CONFIG> early as undefined (#11671)
+
+Brian Bassett (1):
+ VS: Fix linking of Fortran-only DLL projects (#10803)
+
+Campbell Barton (1):
+ Honor RULE_MESSAGES property for build target messages
+
+Chuck Atkins (1):
+ CTest: Teach launcher to ignore empty/no-op make commands
+
+Clinton Stimpson (11):
+ Fix regex for moc includes when looking for frameworks.
+ cmake-gui: use BundleUtilities in place of custom script.
+ Fix regression in 2dae2f1 which added find of Qt imports dir.
+ Force cmake to run again when qrc dependency scanning needs to happen.
+ Fix regression to allow specifying a CMakeCache.txt file on the command line.
+ BundleUtilities: only do rpath strip on copied prerequisites.
+ Fix build issues cross compiling with static Qt.
+ CTest: multiple ctest_test calls w/LABEL regexs (#11487)
+ cmake-gui: always enable generate button.
+ allow absolute paths for dbus interface.
+ Add support for using static/dynamic Qt plugins.
+
+Craig Scott (1):
+ ccmake: Port for LSB 4.0 (#11648)
+
+Dave Abrahams (1):
+ FindPerlLibs: Fix for Mac locally applied patches
+
+David Cole (31):
+ Add a contract test for building the CSE.
+ Enable overriding contract test timeout values.
+ Update tag in the Contracts/cse-snapshot test.
+ Make HTML test fail when --nonet arg is not available.
+ Begin post-2.8.3 development
+ No CMake.HTML test if xmllint has no --nonet.
+ Suppress "loop was vectorized" "warnings."
+ Add contract test for Trilinos 10.6.1 snapshot.
+ Honor FOLDER on include_external_msproject targets (#11436)
+ Correct misspelling in error message text.
+ BundleUtilities: error if fixup_bundle_item called on non-embedded item
+ VS10: stop build on custom command error (#11533)
+ CPack: look for makensis in the PATH (#8210)
+ VS10: avoid warning, no nologo when verbose (#10587)
+ Use m prefix in shorttag value to indicate "md5 of tarball"
+ Establish pass criteria for the Trilinos contract test.
+ Suppress erroneous warnings from Intel compiler
+ Avoid running CMake.Install test simultaneously with other tests
+ VS10: Finish Midl support (#11461)
+ Prohibit space in HOME value for VSMidl test.
+ KWSys: Fix CPU speed calculations (#9963)
+ KWSys: Retrieve QNX specific memory and processor info (#11329)
+ Improve build error detection.
+ VSMidl Test: Use correct include_directories with VS6 (#11461)
+ Add PATH_SUFFIXES for finding git.
+ ExternalProject: Avoid bleed-through output when logging.
+ Fix WOW64 registry mode on Windows 2000 (#10759)
+ ExternalProject: Replace location tags in CMAKE_CACHE_ARGS
+ CPack: Detect more URLs in CPACK_NSIS_MENU_LINKS (#10644)
+ KWSys: Fix WOW64 registry mode on Windows 2000 (#10759)
+ CPack: Add CPACK_NSIS_INSTALL_ROOT variable (#9148)
+
+Eric NOULARD (13):
+ CPackRPM add basic component support to CPackRPM
+ CPack fix kwstyle breakage and make CPackRPM backward compatible
+ CPack backward compatibility fix 2.8.3-2.8.2 (bug 11452)
+ CPack Fix KWStyle error
+ CPack Honor CPACK_MONOLITHIC_INSTALL at CPack time too
+ CPack use IsOn when it's better than IsSet
+ CPackRPM fix bug 0011595 : Can't generate RPMs (on FC11...)
+ CPack new tests for component install
+ CPack Default component test for ZIP should be OK
+ CPackTest spit out more output in case of failure
+ Arrange output in a better way
+ Precise the project config type when invoking cpack
+ CPackSTGZ quote here-doc, fix bug10518
+
+Kai Wasserbäch (1):
+ FindTCL: Fix TCL and TK version variable references (#11528)
+
+Marcus D. Hanwell (5):
+ BUG 11451 - pass CMAKE_EXTRA_GENERATOR down.
+ Added CMAKE_CACHE_ARGS to ExternalProject.
+ Escape file write expansion, and build up lists.
+ Fixed bug where last entry would be lost.
+ Python additional version support, bug #10279.
+
+Matthias Kretz (1):
+ Inline help in vim with vertical split.
+
+Mike McQuaid (6):
+ Fix incorrect variable documentation (#11127)
+ Add variable for InstallRequiredSystemLibraries dir (#11140)
+ InstallRequiredSystemLibraries debug-only (#11141)
+ Allow NSIS package or uninstall icon (#11143)
+ Add CPACK_NSIS_EXECUTABLES_DIRECTORY (#7828)
+ Add CPack NSIS MUI_FINISHPAGE_RUN support (#11144)
+
+Philip Lowman (8):
+ 11363: FindBoost.cmake fails to find debug libraries in tagged layout install
+ 11429: FindGTK2 does not find libraries built for Visual Studio 2010
+ 11430: FindBullet doesn't find header files installed by Bullet >= 2.77
+ 11384: FindCxxTest now includes test code in VS project
+ [patch] Add Boost 1.45 to search, simplify a check removing VERSION_LESS
+ Add Boost 1.46
+ Fix spelling BOOST_LIBRARYDIR message. Add error for common misspellings.
+ Lowercase all function names and improve consistency
+
+Rolf Eike Beer (2):
+ allow STRING(SUBSTRING) work with length -1 as "rest of the string"
+ Add the WORKING_DIRECTORY property to tests
+
+Wojciech Migda (1):
+ Recognize the Texas Instruments DSP compiler (#11645)
+
+Yaakov Selkowitz (2):
+ Cygwin: Use 'cyg' prefix for module DLLs (#10122)
+ Cygwin: Fix release script libncurses search patterns (#10766)
+
+Zach Mullen (4):
+ Remove debugging message from parallel ctest
+ CTest git update should pass the committer as well as the author
+ Support explicitly set test costs in non-parallel testing.
+ Test TIMEOUT property explicitly set to zero should be honored
+
No changes in CMake 2.8.3 since 2.8.3-rc4.
Changes in CMake 2.8.3-rc4 (since 2.8.3-rc3)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index c7778fb..c91553a 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -48,6 +48,9 @@
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+#elif defined(__SCO_VERSION__)
+# define COMPILER_ID "SCO"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 668119f..9285fef 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -76,12 +76,16 @@ ENDIF (NOT _INCLUDED_FILE)
# be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+ENDIF()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
+ENDIF()
# for most systems a module is the same as a shared library
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 2ff227a..4c8f497 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -50,6 +50,9 @@
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+#elif defined(__SCO_VERSION__)
+# define COMPILER_ID "SCO"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 163a7ef..620de63 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -75,12 +75,16 @@ ENDIF (NOT _INCLUDED_FILE)
# be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+ENDIF()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
+ENDIF()
# for most systems a module is the same as a shared library
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 7a443e0..d6350bf 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -81,16 +81,17 @@ ENDIF()
# If we have a gas/as cross compiler, they have usually some prefix, like
-# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas .
+# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas , optionally
+# with a 3-component version number at the end
# The other tools of the toolchain usually have the same prefix
# NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
- IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$")
+ IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
STRING(REGEX REPLACE "^(.+-)g?as(\\.exe)?$" "\\1" _CMAKE_TOOLCHAIN_PREFIX "${COMPILER_BASENAME}")
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(\\.exe)?$")
+ ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
INCLUDE(CMakeFindBinUtils)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 639b426..06664c1 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -15,14 +15,14 @@
# determine the compiler to use for C programs
# NOTE, a generator may set CMAKE_C_COMPILER before
# loading this file to force a compiler.
-# use environment variable CC first if defined by user, next use
+# use environment variable CC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler
-# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
+# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
# as prefix for the tools (e.g. arm-elf-gcc, arm-elf-ar etc.). This works
# currently with the GNU crosscompilers.
#
-# Sets the following variables:
+# Sets the following variables:
# CMAKE_C_COMPILER
# CMAKE_AR
# CMAKE_RANLIB
@@ -41,12 +41,12 @@ IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
ENDIF(CMAKE_C_FLAGS_ENV_INIT)
IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
- MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
+ MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
ENDIF($ENV{CC} MATCHES ".+")
# next try prefer the compiler specified by the generator
- IF(CMAKE_GENERATOR_CC)
+ IF(CMAKE_GENERATOR_CC)
IF(NOT CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
ENDIF(NOT CMAKE_C_COMPILER_INIT)
@@ -64,7 +64,7 @@ IF(NOT CMAKE_C_COMPILER)
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_CXX_COMPILER_PATH)
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
-
+
IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE)
ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
@@ -72,7 +72,7 @@ ELSE(NOT CMAKE_C_COMPILER)
# we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_C_COMPILER is a list of length 2, use the first item as
+ # if CMAKE_C_COMPILER is a list of length 2, use the first item as
# CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
@@ -81,9 +81,9 @@ ELSE(NOT CMAKE_C_COMPILER)
LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
- # if a compiler was specified by the user but without path,
+ # if a compiler was specified by the user but without path,
# now try to find it with the full path
- # if it is found, force it into the cache,
+ # if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
# if the C compiler already had a path, reuse it for searching the CXX compiler
GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
@@ -143,19 +143,20 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN)
ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
-# If we have a gcc cross compiler, they have usually some prefix, like
-# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc .
+# If we have a gcc cross compiler, they have usually some prefix, like
+# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
+# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2).
# The other tools of the toolchain usually have the same prefix
# NAME_WE cannot be used since then this test will fail for names lile
-# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
+# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+IF (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
- IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
+ IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")
+ ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
@@ -163,7 +164,7 @@ IF (CMAKE_CROSSCOMPILING
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-ENDIF (CMAKE_CROSSCOMPILING
+ENDIF (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
@@ -179,5 +180,5 @@ ENDIF(MSVC_C_ARCHITECTURE_ID)
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
- )
+ )
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 555d20e..e77672d 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -15,10 +15,10 @@
# determine the compiler to use for C++ programs
# NOTE, a generator may set CMAKE_CXX_COMPILER before
# loading this file to force a compiler.
-# use environment variable CXX first if defined by user, next use
+# use environment variable CXX first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CXX which can be defined by a generator
# as a default compiler
-# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
+# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
# as prefix for the tools (e.g. arm-elf-g++, arm-elf-ar etc.)
#
# Sets the following variables:
@@ -63,7 +63,7 @@ IF(NOT CMAKE_CXX_COMPILER)
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} DOC "C++ compiler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler")
-
+
IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE)
ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
@@ -72,7 +72,7 @@ ELSE(NOT CMAKE_CXX_COMPILER)
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
#
-# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
+# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
@@ -81,9 +81,9 @@ ELSE(NOT CMAKE_CXX_COMPILER)
LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
-# if a compiler was specified by the user but without path,
+# if a compiler was specified by the user but without path,
# now try to find it with the full path
-# if it is found, force it into the cache,
+# if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
# if the CXX compiler already had a path, reuse it for searching the C compiler
GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
@@ -151,19 +151,20 @@ IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
-# if we have a g++ cross compiler, they have usually some prefix, like
-# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++
-# the other tools of the toolchain usually have the same prefix
+# if we have a g++ cross compiler, they have usually some prefix, like
+# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
+# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2).
+# The other tools of the toolchain usually have the same prefix
# NAME_WE cannot be used since then this test will fail for names lile
-# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
+# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
-IF (CMAKE_CROSSCOMPILING
+IF (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
- IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
+ IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
- ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(\\.exe)?$")
+ ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
@@ -171,7 +172,7 @@ IF (CMAKE_CROSSCOMPILING
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
-ENDIF (CMAKE_CROSSCOMPILING
+ENDIF (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index ed0b6fb..7f918e6 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -24,10 +24,18 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
# Compile the ABI identification source.
SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
+ SET(CMAKE_FLAGS )
+ IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
+ SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ ENDIF()
TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src}
- CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}"
+ CMAKE_FLAGS "${CMAKE_FLAGS}"
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
+ # We need ignore these warnings because some platforms need
+ # CMAKE_${lang}_STANDARD_LIBRARIES to link properly and we
+ # don't care when we are just determining the ABI.
+ "--no-warn-unused-cli"
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}"
)
@@ -58,10 +66,16 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
# Parse implicit linker information for this language, if available.
SET(implicit_dirs "")
SET(implicit_libs "")
+ SET(MULTI_ARCH FALSE)
+ IF(DEFINED CMAKE_OSX_ARCHITECTURES)
+ IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
+ SET(MULTI_ARCH TRUE)
+ ENDIF()
+ ENDIF()
IF(CMAKE_${lang}_VERBOSE_FLAG
# Implicit link information cannot be used explicitly for
# multiple OS X architectures, so we skip it.
- AND NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";"
+ AND NOT MULTI_ARCH
# Skip this with Xcode for now.
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index bf78a5b..9a3884a 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -243,7 +243,9 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
-
+ IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
+ SET(CMAKE_EXECUTABLE_FORMAT)
+ ENDIF()
# Return the information extracted.
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index d18353a..4f033e3 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -52,12 +52,16 @@ ENDIF (NOT _INCLUDED_FILE)
# be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+ENDIF()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
+ENDIF()
# Fortran needs cmake to do a requires step during its build process to
diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake
index e9bc9be..e192db1 100644
--- a/Modules/CMakeJavaInformation.cmake
+++ b/Modules/CMakeJavaInformation.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2004-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -19,12 +19,16 @@
# be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
-
-IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
- INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX})
-ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
+ENDIF()
+
+IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
+ # Save the full path of the file so try_compile can use it.
+ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
+ SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
+ENDIF()
# this is a place holder if java needed flags for javac they would go here.
IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index e8bfc0c..d59fe55 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -1,6 +1,6 @@
-# - Check if the given C source code compiles.
+# - Check if given C source compiles and links into an executable
# CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
-# <code> - source code to try to compile
+# <code> - source code to try to compile, must define 'main'
# <var> - variable to store whether the source code compiled
# <fail-regex> - fail if test output matches this regex
# The following variables may be set before calling this macro to
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 4502c6b..0491b37 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -1,6 +1,6 @@
-# - Check if the given C++ source code compiles.
+# - Check if given C++ source compiles and links into an executable
# CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
-# <code> - source code to try to compile
+# <code> - source code to try to compile, must define 'main'
# <var> - variable to store whether the source code compiled
# <fail-regex> - fail if test output matches this regex
# The following variables may be set before calling this macro to
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index e1a1777..0ba36d9 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -1,8 +1,10 @@
-# - Check if the function exists.
-# CHECK_FUNCTION_EXISTS(FUNCTION VARIABLE)
-# - macro which checks if the function exists
-# FUNCTION - the name of the function
-# VARIABLE - variable to store the result
+# - Check if a C function can be linked
+# CHECK_FUNCTION_EXISTS(<function> <variable>)
+#
+# Check that the <function> is provided by libraries on the system and
+# store the result in a <variable>. This does not verify that any
+# system header file declares the function, only that it can be found
+# at link time (considure using CheckSymbolExists).
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
@@ -13,7 +15,7 @@
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
+# Copyright 2002-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 40910f2..e86604b 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -1,9 +1,16 @@
-# - Check if the symbol exists in include files
-# CHECK_SYMBOL_EXISTS(SYMBOL FILES VARIABLE)
+# - Check if a symbol exists as a function, variable, or macro
+# CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>)
#
-# SYMBOL - symbol
-# FILES - include files to check
-# VARIABLE - variable to return result
+# Check that the <symbol> is available after including given header
+# <files> and store the result in a <variable>. Specify the list
+# of files in one argument as a semicolon-separated list.
+#
+# If the header files define the symbol as a macro it is considered
+# available and assumed to work. If the header files declare the
+# symbol as a function or variable then the symbol must also be
+# available for linking. If the symbol is a type or enum value
+# it will not be recognized (consider using CheckTypeSize or
+# CheckCSourceCompiles).
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
@@ -14,7 +21,7 @@
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
#=============================================================================
-# Copyright 2003-2009 Kitware, Inc.
+# Copyright 2003-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
diff --git a/Modules/Compiler/SCO-C.cmake b/Modules/Compiler/SCO-C.cmake
new file mode 100644
index 0000000..6e762cc
--- /dev/null
+++ b/Modules/Compiler/SCO-C.cmake
@@ -0,0 +1,2 @@
+include(Compiler/SCO)
+__compiler_sco(C)
diff --git a/Modules/Compiler/SCO-CXX.cmake b/Modules/Compiler/SCO-CXX.cmake
new file mode 100644
index 0000000..5b713a0
--- /dev/null
+++ b/Modules/Compiler/SCO-CXX.cmake
@@ -0,0 +1,2 @@
+include(Compiler/SCO)
+__compiler_sco(CXX)
diff --git a/Modules/Compiler/SCO.cmake b/Modules/Compiler/SCO.cmake
new file mode 100644
index 0000000..d3deeb1
--- /dev/null
+++ b/Modules/Compiler/SCO.cmake
@@ -0,0 +1,25 @@
+
+#=============================================================================
+# Copyright 2002-2011 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 distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_SCO)
+ return()
+endif()
+set(__COMPILER_SCO 1)
+
+macro(__compiler_sco lang)
+ # Feature flags.
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-Kpic -belf")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-belf -Wl,-Bexport")
+endmacro()
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 40bd6f3..af84f8c 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -35,7 +35,7 @@ find_library(ALSA_LIBRARY NAMES asound
# handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA DEFAULT_MSG ALSA_LIBRARY ALSA_INCLUDE_DIR)
if(ALSA_FOUND)
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index 63ffdf9..d19fab4 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -26,7 +26,7 @@ FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
# handle the QUIETLY and REQUIRED arguments and set ASPELL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
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 90885ac..8b5b05a 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -37,7 +37,7 @@ ENDIF (UNIX)
# handle the QUIETLY and REQUIRED arguments and set AVIFILE_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
IF (AVIFILE_FOUND)
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index fc5daa6..e855a27 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -158,7 +158,7 @@ IF(BISON_EXECUTABLE)
ENDIF(BISON_EXECUTABLE)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
VERSION_VAR BISON_VERSION)
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index e671f93..679c129 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -26,7 +26,7 @@ FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2 )
# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
IF (BZIP2_FOUND)
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index a7c6de2..cebb828 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -70,7 +70,7 @@ _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_d)
# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1547b19..d5ef430 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -684,7 +684,7 @@ set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL
set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL
"This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(CUDA
REQUIRED_VARS
CUDA_TOOLKIT_ROOT_DIR
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 07835fa..36f3841 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -34,7 +34,7 @@ MARK_AS_ADVANCED(CURL_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
IF(CURL_FOUND)
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index 2769111..57680bd 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -65,5 +65,5 @@ mark_as_advanced(CVS_EXECUTABLE)
# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(CVS DEFAULT_MSG CVS_EXECUTABLE)
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 47d0c55..8bfe97a 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -76,7 +76,7 @@ ENDIF (WIN32)
# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
MARK_AS_ADVANCED(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 4485f43..d1e1311 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -155,7 +155,7 @@ SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
CURSES_LIBRARY CURSES_INCLUDE_PATH)
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 69104c5..4ff310c 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -165,7 +165,7 @@ find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
PATHS ${CXXTEST_INCLUDE_DIR})
if(PYTHONINTERP_FOUND OR PERL_FOUND)
- include(FindPackageHandleStandardArgs)
+ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND))
set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index 3bed97f..0ac22f8 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -132,7 +132,7 @@ if(DCMTK_ofstd_INCLUDE_DIR)
mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR)
endif()
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(DCMTK DEFAULT_MSG
DCMTK_config_INCLUDE_DIR
DCMTK_ofstd_INCLUDE_DIR
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index 90f71bd..f7c54df 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -30,7 +30,7 @@ FIND_PATH(DART_ROOT README.INSTALL
# handle the QUIETLY and REQUIRED arguments and set DART_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Dart DEFAULT_MSG DART_ROOT)
MARK_AS_ADVANCED(DART_ROOT)
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index c87e736..0e21284 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -25,7 +25,7 @@
# TODO: Add version support.
# Tested under Linux and Windows (MSVC)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PATH(IL_INCLUDE_DIR il.h
PATH_SUFFIXES include IL
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index aa4973d..e5428ae 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -76,7 +76,7 @@ FIND_PROGRAM(DOXYGEN_EXECUTABLE
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE)
#
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 3c04b4c..8551fd6 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -26,7 +26,7 @@ FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
# Copy the results to the output variables.
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 481e1e2..3cc3da5 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -143,7 +143,7 @@ IF(FLEX_EXECUTABLE)
ENDIF(FLEX_EXECUTABLE)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
VERSION_VAR FLEX_VERSION)
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 03d4b8e..bb18a2e 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -292,7 +292,7 @@ ENDIF(NOT FLTK_DIR)
ENDIF()
LIST(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(FLTK_SKIP_FLUID)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
ELSE()
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 7762684..8957b64 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -88,7 +88,7 @@ SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index 2050c72..c31bef5 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -100,7 +100,7 @@ FIND_LIBRARY(GDAL_LIBRARY
/usr/freeware
)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
set(GDAL_LIBRARIES ${GDAL_LIBRARY})
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index e0d25e1..1fad07d 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -60,7 +60,7 @@ SET(GIF_LIBRARIES ${GIF_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set GIF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF DEFAULT_MSG GIF_LIBRARY GIF_INCLUDE_DIR)
MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARY)
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 45df79e..af88997 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -23,7 +23,7 @@
IF (WIN32)
FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h
PATHS ${GLUT_ROOT_PATH}/include )
- FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32
+ FIND_LIBRARY( GLUT_glut_LIBRARY NAMES glut glut32 freeglut
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Release
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index caecca2..a03c023 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -521,7 +521,7 @@ endif()
set(_GTK2_did_we_find_everything true) # This gets set to GTK2_FOUND
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
string(TOUPPER ${_GTK2_component} _COMPONENT_UPPER)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index ef2852a..6cffb5c 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -146,7 +146,7 @@ else()
_gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
endif()
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest DEFAULT_MSG GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
if(GTEST_FOUND)
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index af316d8..503b640 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -43,5 +43,5 @@ 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)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 5c41253..a437a1f 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -56,7 +56,7 @@ MARK_AS_ADVANCED(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set GNUTLS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GnuTLS DEFAULT_MSG GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
IF(GNUTLS_FOUND)
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index 364d725..7c59f03 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -34,7 +34,7 @@ SET(GNUPLOT ${GNUPLOT_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot DEFAULT_MSG GNUPLOT_EXECUTABLE)
MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE )
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 30203f2..90849a1 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -57,7 +57,7 @@
# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
include(SelectLibraryConfigurations)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# List of the valid HDF5 components
set( HDF5_VALID_COMPONENTS
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 3a8943f..054f565 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -36,7 +36,7 @@ ENDIF()
# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
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/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index 3afcb1c..5e6fa20 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -171,7 +171,7 @@ SET(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES})
#---------------------------------------------------------------------
# Standard Package Output
#---------------------------------------------------------------------
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
ImageMagick DEFAULT_MSG ImageMagick_FOUND
)
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 5d70f0b..6ba1826 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -232,7 +232,7 @@ FIND_PATH(JAVA_AWT_INCLUDE_PATH jawt.h
${JAVA_INCLUDE_PATH}
)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 1f37483..349e7e1 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -27,7 +27,7 @@ FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
IF(JPEG_FOUND)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 8aaa373..bae4c05 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -27,7 +27,7 @@ FIND_LIBRARY(JASPER_LIBRARY NAMES jasper libjasper)
# handle the QUIETLY and REQUIRED arguments and set JASPER_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jasper DEFAULT_MSG JASPER_LIBRARY JASPER_INCLUDE_DIR JPEG_LIBRARIES)
IF (JASPER_FOUND)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 1599433..8c2128e 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -150,7 +150,7 @@ FIND_PROGRAM(Java_JAVAC_EXECUTABLE
PATHS ${_JAVA_PATHS}
)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(Java_FIND_COMPONENTS)
foreach(component ${Java_FIND_COMPONENTS})
# User just want to execute some Java byte-compiled
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index e7c2706..cedcd24 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -50,7 +50,10 @@ endif()
# Handle the QUIETLY and REQUIRED arguments and set LIBARCHIVE_FOUND
# to TRUE if all listed variables are TRUE.
-include(FindPackageHandleStandardArgs)
+# (Use ${CMAKE_ROOT}/Modules instead of ${CMAKE_CURRENT_LIST_DIR} because CMake
+# itself includes this FindLibArchive when built with an older CMake that does
+# not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.)
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(LibArchive DEFAULT_MSG
LibArchive_LIBRARY LibArchive_INCLUDE_DIR
)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 250c20a..95ae180 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -46,7 +46,7 @@ SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
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 0fcfbf5..462835a 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -40,7 +40,7 @@ FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
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/FindLua50.cmake b/Modules/FindLua50.cmake
index 091e596..ee8b84e 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -87,7 +87,7 @@ ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
ENDIF(${LUA_LIBRARY_lua} MATCHES "framework")
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua50 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR)
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index e67d545..123fd5d 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -66,7 +66,7 @@ IF(LUA_LIBRARY)
ENDIF(UNIX AND NOT APPLE)
ENDIF(LUA_LIBRARY)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR)
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 9d44ac4..cf4ef58 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -34,7 +34,7 @@ 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)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
IF(MPEG_FOUND)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index bc1cf2b..fab37cf 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -36,7 +36,7 @@ FIND_LIBRARY( MPEG2_vo_LIBRARY vo
# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
IF(MPEG2_FOUND)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 4d1da5b..a81a53b 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -346,7 +346,7 @@ else (MPI_INCLUDE_PATH AND MPI_LIBRARY)
set(MPI_FOUND FALSE)
endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# handle the QUIETLY and REQUIRED arguments
find_package_handle_standard_args(MPI DEFAULT_MSG MPI_LIBRARY MPI_INCLUDE_PATH)
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index f101545..e354112 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -34,7 +34,7 @@ ENDIF(UNIX)
# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Motif DEFAULT_MSG MOTIF_LIBRARIES MOTIF_INCLUDE_DIR)
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index 8f79436..bcba6e2 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -97,7 +97,7 @@ FIND_LIBRARY(OPENAL_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
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/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 3618963..98d8808 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -149,7 +149,7 @@ SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
# handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY)
MARK_AS_ADVANCED(
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index f149d9f..652803c 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -26,7 +26,7 @@
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
set(OpenMP_C_FLAG_CANDIDATES
#Gnu
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index d3d7fc2..f41a66b 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -113,7 +113,7 @@ ELSE(WIN32 AND NOT CYGWIN)
ENDIF(WIN32 AND NOT CYGWIN)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(OpenSSL DEFAULT_MSG
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 8e6abdb..460f0fd 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -231,7 +231,7 @@ else()
endif()
endif()
- include(FindPackageHandleStandardArgs)
+ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph DEFAULT_MSG OPENSCENEGRAPH_LIBRARIES OPENSCENEGRAPH_INCLUDE_DIR)
endif()
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index e1fe937..6b81fbe 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -118,6 +118,6 @@ else()
set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
endif()
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 3b21f89..6c2965a 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -81,5 +81,5 @@ IF(APPLE)
ENDFOREACH(symbol)
ENDIF(APPLE)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PHP4 DEFAULT_MSG PHP4_EXECUTABLE PHP4_INCLUDE_PATH)
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 4fb218b..f607dc6 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 png14 libpng14 png14d libpng14d png12 libpng12 png12d libpng12d)
+ set(PNG_NAMES ${PNG_NAMES} png libpng png15 libpng15 png15d libpng15d png14 libpng14 png14d libpng14d png12 libpng12 png12d libpng12d)
find_library(PNG_LIBRARY NAMES ${PNG_NAMES} )
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
@@ -55,7 +55,7 @@ endif(ZLIB_FOUND)
# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PNG DEFAULT_MSG PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index 87d1ff9..db393e7 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -44,7 +44,7 @@ SET(PERL ${PERL_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE)
MARK_AS_ADVANCED(PERL_EXECUTABLE)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 91eb91d..eea55f1 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -25,6 +25,7 @@
#=============================================================================
# Copyright 2004-2009 Kitware, Inc.
+# Copyright 2008 Andreas Schneider <asn@cryptomilk.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -258,7 +259,7 @@ endif (PERL_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
VERSION_VAR PERL_VERSION)
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index c38f4bc..80dfd51 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -56,6 +56,6 @@ FIND_LIBRARY(PHYSFS_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS DEFAULT_MSG PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index d5aefb9..39a9436 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -77,6 +77,6 @@ FIND_LIBRARY(PRODUCER_LIBRARY
/opt
)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Producer DEFAULT_MSG
PRODUCER_LIBRARY PRODUCER_INCLUDE_DIR)
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index c9823c2..a6e6653 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -111,7 +111,7 @@ if(WIN32)
set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}")
endif()
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 3592e4c..46cde43 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -45,7 +45,7 @@ endif()
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp DEFAULT_MSG PYTHON_EXECUTABLE)
mark_as_advanced(PYTHON_EXECUTABLE)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 780ffc2..adcec46 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -104,7 +104,7 @@ SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
@@ -151,6 +151,7 @@ FUNCTION(PYTHON_WRITE_MODULES_HEADER _filename)
GET_FILENAME_COMPONENT(_name "${_filename}" NAME)
STRING(REPLACE "." "_" _name "${_name}")
STRING(TOUPPER ${_name} _nameUpper)
+ SET(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
SET(_filenameTmp "${_filename}.in")
FILE(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 1319de2..bacbb07 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -242,7 +242,7 @@ IF (QT_MIN_VERSION)
ENDIF (QT_MIN_VERSION)
# if the include a library are found then we have it
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE)
SET(QT_FOUND ${QT3_FOUND} )
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index d9d6ea7..79a3d51 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -447,7 +447,10 @@ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
ENDMACRO (_QT4_ADJUST_LIB_VARS)
function(_QT4_QUERY_QMAKE VAR RESULT)
- exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
+ execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR}
+ RESULT_VARIABLE return_code
+ OUTPUT_VARIABLE output ERROR_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT return_code)
file(TO_CMAKE_PATH "${output}" output)
set(${RESULT} ${output} PARENT_SCOPE)
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index b86a59f..038c2dd 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -43,5 +43,5 @@ ENDIF(APPLE)
# handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QuickTime DEFAULT_MSG QUICKTIME_LIBRARY QUICKTIME_INCLUDE_DIR)
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index b27eaa7..031c138 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -95,7 +95,7 @@ ENDIF (RTI_INCLUDE_DIR)
# Set the modified system variables back to the original value.
SET(CMAKE_FIND_LIBRARY_PREFIXES "${RTI_OLD_FIND_LIBRARY_PREFIXES}")
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG
RTI_LIBRARY RTI_INCLUDE_DIR)
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 2e78d85..80fb216 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -209,7 +209,7 @@ ENDIF(WIN32)
FIND_LIBRARY(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
SET(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
IF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
LIST(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 68a913d..2e719ff 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -62,6 +62,6 @@ IF(SWIG_EXECUTABLE)
ENDIF(SWIG_swiglib_result)
ENDIF(SWIG_EXECUTABLE)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
VERSION_VAR SWIG_VERSION )
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 3561a19..d8cdacb 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -122,7 +122,7 @@ IF(Subversion_SVN_EXECUTABLE)
ENDIF(Subversion_SVN_EXECUTABLE)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
VERSION_VAR Subversion_VERSION_SVN )
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index b206c9a..13f32f8 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -197,7 +197,7 @@ FIND_PATH(TK_INCLUDE_PATH
# handle the QUIETLY and REQUIRED arguments and set TCL_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
SET(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 6f06ff1..714f65f 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -27,7 +27,7 @@ FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} )
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF DEFAULT_MSG TIFF_LIBRARY TIFF_INCLUDE_DIR)
IF(TIFF_FOUND)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 322c3a9..8fde59e 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -84,7 +84,7 @@ FIND_PROGRAM(TCL_TCLSH
# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh DEFAULT_MSG TCL_TCLSH)
MARK_AS_ADVANCED(TCL_TCLSH)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 4cb7451..a6c2df8 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -153,5 +153,5 @@ IF(CMAKE_USE_PTHREADS_INIT)
ENDIF()
ENDIF(CMAKE_USE_PTHREADS_INIT)
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index 97c4302..c94132c 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -26,7 +26,7 @@ FIND_PROGRAM(WGET_EXECUTABLE
# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget DEFAULT_MSG WGET_EXECUTABLE)
MARK_AS_ADVANCED( WGET_EXECUTABLE )
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 1ac6c2c..2062a7e 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -35,7 +35,7 @@ FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
)
-SET(ZLIB_NAMES z zlib zdll)
+SET(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES
${ZLIB_NAMES}
@@ -66,7 +66,7 @@ ENDIF()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_INCLUDE_DIR ZLIB_LIBRARY
VERSION_VAR ZLIB_VERSION_STRING)
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 76f202f..0106372 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -50,5 +50,5 @@ include(Findosg_functions)
OSG_FIND_PATH (OSG osg/PositionAttitudeTransform)
OSG_FIND_LIBRARY(OSG osg)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osg DEFAULT_MSG OSG_LIBRARY OSG_INCLUDE_DIR)
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index 83e669a..b9b44a0 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGANIMATION osgAnimation/Animation)
OSG_FIND_LIBRARY(OSGANIMATION osgAnimation)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgAnimation DEFAULT_MSG
OSGANIMATION_LIBRARY OSGANIMATION_INCLUDE_DIR)
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index f1cdfa5..eabdde7 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGDB osgDB/DatabasePager)
OSG_FIND_LIBRARY(OSGDB osgDB)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgDB DEFAULT_MSG
OSGDB_LIBRARY OSGDB_INCLUDE_DIR)
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index 64cbda8..81d5af5 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGFX osgFX/BumpMapping)
OSG_FIND_LIBRARY(OSGFX osgFX)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgFX DEFAULT_MSG
OSGFX_LIBRARY OSGFX_INCLUDE_DIR)
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index 00fc313..a4fe79b 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGGA osgGA/FlightManipulator)
OSG_FIND_LIBRARY(OSGGA osgGA)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgGA DEFAULT_MSG
OSGGA_LIBRARY OSGGA_INCLUDE_DIR)
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index 919523b..24e6ed5 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGINTROSPECTION osgIntrospection/Reflection)
OSG_FIND_LIBRARY(OSGINTROSPECTION osgIntrospection)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgIntrospection DEFAULT_MSG
OSGINTROSPECTION_LIBRARY OSGINTROSPECTION_INCLUDE_DIR)
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index 93d4bac..f71b5fd 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGMANIPULATOR osgManipulator/TrackballDragger)
OSG_FIND_LIBRARY(OSGMANIPULATOR osgManipulator)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgManipulator DEFAULT_MSG
OSGMANIPULATOR_LIBRARY OSGMANIPULATOR_INCLUDE_DIR)
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index a0d7516..f23a83f 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGPARTICLE osgParticle/FireEffect)
OSG_FIND_LIBRARY(OSGPARTICLE osgParticle)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgParticle DEFAULT_MSG
OSGPARTICLE_LIBRARY OSGPARTICLE_INCLUDE_DIR)
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index e4e57f3..51f6090 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGPRODUCER osgProducer/OsgSceneHandler)
OSG_FIND_LIBRARY(OSGPRODUCER osgProducer)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgProducer DEFAULT_MSG
OSGPRODUCER_LIBRARY OSGPRODUCER_INCLUDE_DIR)
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index 86a339c..278f8ae 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGSHADOW osgShadow/ShadowTexture)
OSG_FIND_LIBRARY(OSGSHADOW osgShadow)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgShadow DEFAULT_MSG
OSGSHADOW_LIBRARY OSGSHADOW_INCLUDE_DIR)
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index b66a991..15daf64 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGSIM osgSim/ImpostorSprite)
OSG_FIND_LIBRARY(OSGSIM osgSim)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgSim DEFAULT_MSG
OSGSIM_LIBRARY OSGSIM_INCLUDE_DIR)
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index 04559cf..fbf373e 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGTERRAIN osgTerrain/Terrain)
OSG_FIND_LIBRARY(OSGTERRAIN osgTerrain)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgTerrain DEFAULT_MSG
OSGTERRAIN_LIBRARY OSGTERRAIN_INCLUDE_DIR)
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 6d20336..22f825f 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGTEXT osgText/Text)
OSG_FIND_LIBRARY(OSGTEXT osgText)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgText DEFAULT_MSG
OSGTEXT_LIBRARY OSGTEXT_INCLUDE_DIR)
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index 2faa7d4..05a74df 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGUTIL osgUtil/SceneView)
OSG_FIND_LIBRARY(OSGUTIL osgUtil)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgUtil DEFAULT_MSG
OSGUTIL_LIBRARY OSGUTIL_INCLUDE_DIR)
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index 30b9926..650dbd7 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGVIEWER osgViewer/Viewer)
OSG_FIND_LIBRARY(OSGVIEWER osgViewer)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgViewer DEFAULT_MSG
OSGVIEWER_LIBRARY OSGVIEWER_INCLUDE_DIR)
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index f916667..3ad7edc 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGVOLUME osgVolume/Volume)
OSG_FIND_LIBRARY(OSGVOLUME osgVolume)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgVolume DEFAULT_MSG
OSGVOLUME_LIBRARY OSGVOLUME_INCLUDE_DIR)
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 5f84873..206a8b7 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -46,6 +46,6 @@ include(Findosg_functions)
OSG_FIND_PATH (OSGWIDGET osgWidget/Widget)
OSG_FIND_LIBRARY(OSGWIDGET osgWidget)
-include(FindPackageHandleStandardArgs)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(osgWidget DEFAULT_MSG
OSGWIDGET_LIBRARY OSGWIDGET_INCLUDE_DIR)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index d991cd4..090259b 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -827,7 +827,7 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}")
#=====================================================================
#=====================================================================
-INCLUDE(FindPackageHandleStandardArgs)
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND)
# Maintain consistency with all other variables.
SET(wxWidgets_FOUND ${WXWIDGETS_FOUND})
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 4564e74..2dfe8b1 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -16,6 +16,12 @@
# libraries are installed as well as the CRT run time libraries.
# If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
# installed to that directory rather than the default.
+# If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this file
+# warns about required files that do not exist. You can set this variable to
+# ON before including this file to avoid the warning. For example, the Visual
+# Studio Express editions do not include the redistributable files, so if you
+# include this file on a machine with only VS Express installed, you'll get
+# the warning.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -33,6 +39,21 @@
IF(MSVC)
FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
+ IF(CMAKE_CL_64)
+ IF(MSVC_VERSION GREATER 1599)
+ # VS 10 and later:
+ SET(CMAKE_MSVC_ARCH x64)
+ ELSE()
+ # VS 9 and earlier:
+ SET(CMAKE_MSVC_ARCH amd64)
+ ENDIF()
+ ELSE(CMAKE_CL_64)
+ SET(CMAKE_MSVC_ARCH x86)
+ ENDIF(CMAKE_CL_64)
+
+ GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
+ GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
+
IF(MSVC70)
SET(__install__libs
"${SYSTEMROOT}/system32/msvcp70.dll"
@@ -47,15 +68,6 @@ IF(MSVC)
)
ENDIF(MSVC71)
- IF(CMAKE_CL_64)
- SET(CMAKE_MSVC_ARCH amd64)
- ELSE(CMAKE_CL_64)
- SET(CMAKE_MSVC_ARCH x86)
- ENDIF(CMAKE_CL_64)
-
- GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
- GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
-
IF(MSVC80)
# Find the runtime library redistribution directory.
FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
@@ -87,7 +99,6 @@ IF(MSVC)
"${MSVC80_CRT_DIR}/msvcr80d.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
-
ENDIF(MSVC80)
IF(MSVC90)
@@ -130,15 +141,14 @@ IF(MSVC)
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
"${base_dir}/VC/redist"
+ "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist"
+ "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist"
)
MARK_AS_ADVANCED(MSVC10_REDIST_DIR)
SET(MSVC10_CRT_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT")
- # Install the manifest that allows DLLs to be loaded from the
- # directory containing the executable.
IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
SET(__install__libs
- "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest"
"${MSVC10_CRT_DIR}/msvcp100.dll"
"${MSVC10_CRT_DIR}/msvcr100.dll"
)
@@ -146,9 +156,8 @@ IF(MSVC)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC10_CRT_DIR
- "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
+ "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugCRT")
SET(__install__libs ${__install__libs}
- "${MSVC10_CRT_DIR}/Microsoft.VC100.DebugCRT.manifest"
"${MSVC10_CRT_DIR}/msvcp100d.dll"
"${MSVC10_CRT_DIR}/msvcr100d.dll"
)
@@ -161,11 +170,13 @@ IF(MSVC)
"${SYSTEMROOT}/system32/mfc70.dll"
)
ENDIF(MSVC70)
+
IF(MSVC71)
SET(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc71.dll"
)
ENDIF(MSVC71)
+
IF(MSVC80)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC80_MFC_DIR
@@ -259,7 +270,6 @@ IF(MSVC)
SET(MSVC10_MFC_DIR
"${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugMFC")
SET(__install__libs ${__install__libs}
- "${MSVC10_MFC_DIR}/Microsoft.VC100.DebugMFC.manifest"
"${MSVC10_MFC_DIR}/mfc100d.dll"
"${MSVC10_MFC_DIR}/mfc100ud.dll"
"${MSVC10_MFC_DIR}/mfcm100d.dll"
@@ -268,11 +278,8 @@ IF(MSVC)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC")
- # Install the manifest that allows DLLs to be loaded from the
- # directory containing the executable.
IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
SET(__install__libs ${__install__libs}
- "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest"
"${MSVC10_MFC_DIR}/mfc100.dll"
"${MSVC10_MFC_DIR}/mfc100u.dll"
"${MSVC10_MFC_DIR}/mfcm100.dll"
@@ -282,10 +289,7 @@ IF(MSVC)
# include the language dll's for vs10 as well as the actuall dll's
SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC")
- # Install the manifest that allows DLLs to be loaded from the
- # directory containing the executable.
SET(__install__libs ${__install__libs}
- "${MSVC10_MFCLOC_DIR}/Microsoft.VC100.MFCLOC.manifest"
"${MSVC10_MFCLOC_DIR}/mfc100chs.dll"
"${MSVC10_MFCLOC_DIR}/mfc100cht.dll"
"${MSVC10_MFCLOC_DIR}/mfc100enu.dll"
@@ -297,7 +301,6 @@ IF(MSVC)
"${MSVC10_MFCLOC_DIR}/mfc100kor.dll"
)
ENDIF(MSVC10)
-
ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
FOREACH(lib
@@ -306,6 +309,15 @@ IF(MSVC)
IF(EXISTS ${lib})
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
+ ELSE(EXISTS ${lib})
+ IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+ MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
+ # This warning indicates an incomplete Visual Studio installation
+ # or a bug somewhere above here in this file.
+ # If you would like to avoid this warning, fix the real problem, or
+ # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
+ # this file.
+ ENDIF()
ENDIF(EXISTS ${lib})
ENDFOREACH(lib)
ENDIF(MSVC)
diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake
index efb7aa0..cbdcb7d 100644
--- a/Modules/Platform/SCO_SV.cmake
+++ b/Modules/Platform/SCO_SV.cmake
@@ -1,5 +1,2 @@
-SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-Kpic -belf")
-SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf")
SET(CMAKE_DL_LIBS "")
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport")
INCLUDE(Platform/UnixPaths)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index f183eb4..278d4df 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -158,6 +158,7 @@ SET(SRCS
cmDocumentationFormatterText.cxx
cmDocumentationFormatterUsage.cxx
cmDocumentationSection.cxx
+ cmDocumentCompileDefinitions.h
cmDocumentGeneratorExpressions.h
cmDocumentVariables.cxx
cmDynamicLoader.cxx
@@ -342,7 +343,7 @@ TARGET_LINK_LIBRARIES(CMakeLib cmsys
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
${CMAKE_CURL_LIBRARIES} )
-# On Apple we need Carbon
+# On Apple we need CoreFoundation
IF(APPLE)
TARGET_LINK_LIBRARIES(CMakeLib "-framework CoreFoundation")
ENDIF(APPLE)
@@ -464,7 +465,7 @@ IF(APPLE)
ADD_EXECUTABLE(OSXScriptLauncher
CPack/OSXScriptLauncher.cxx)
TARGET_LINK_LIBRARIES(OSXScriptLauncher cmsys)
- TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework Carbon")
+ TARGET_LINK_LIBRARIES(OSXScriptLauncher "-framework CoreFoundation")
ENDIF(APPLE)
# Build CMake executable
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index 99ffecc..e0fbe9b 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -14,7 +14,6 @@
#include <cmsys/ios/fstream>
#include <cmsys/ios/iostream>
-#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
// For the PATH_MAX constant
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 2d4bb97..0e8cbc0 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -150,7 +150,7 @@ int cmCPackOSXX11Generator::PackageFiles()
// since we get random dashboard failures with this one
// try running it more than once
int numTries = 4;
- bool res;
+ bool res = false;
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index ef81da8..0c4b1a6 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -320,7 +320,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
std::string output;
int retVal = 1;
int numTries = 4;
- bool res;
+ bool res = false;
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 7f3e360..e1876b9 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -334,32 +334,35 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
}
// Re-adjust the fields according to their place
- bool isNewPage;
- int i=0;
this->NumberOfPages = 1;
- std::vector<cmCursesCacheEntryComposite*>::iterator it;
- for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
+ if (height > 0)
{
- cmCacheManager::CacheIterator mit =
- this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
- if (mit.IsAtEnd() ||
- (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")))
+ bool isNewPage;
+ int i=0;
+ std::vector<cmCursesCacheEntryComposite*>::iterator it;
+ for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
- continue;
- }
- int row = (i % height) + 1;
- int page = (i / height) + 1;
- isNewPage = ( page > 1 ) && ( row == 1 );
+ cmCacheManager::CacheIterator mit =
+ this->CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
+ if (mit.IsAtEnd() ||
+ (!this->AdvancedMode && mit.GetPropertyAsBool("ADVANCED")))
+ {
+ continue;
+ }
+ int row = (i % height) + 1;
+ int page = (i / height) + 1;
+ isNewPage = ( page > 1 ) && ( row == 1 );
- if (isNewPage)
- {
- this->NumberOfPages++;
+ if (isNewPage)
+ {
+ this->NumberOfPages++;
+ }
+ (*it)->Label->Move(left, top+row-1, isNewPage);
+ (*it)->IsNewLabel->Move(left+32, top+row-1, false);
+ (*it)->Entry->Move(left+33, top+row-1, false);
+ (*it)->Entry->SetPage(this->NumberOfPages);
+ i++;
}
- (*it)->Label->Move(left, top+row-1, isNewPage);
- (*it)->IsNewLabel->Move(left+32, top+row-1, false);
- (*it)->Entry->Move(left+33, top+row-1, false);
- (*it)->Entry->SetPage(this->NumberOfPages);
- i++;
}
// Post the form
@@ -786,6 +789,7 @@ void cmCursesMainForm::RemoveEntry(const char* value)
const char* val = (*it)->GetValue();
if ( val && !strcmp(value, val) )
{
+ this->CMakeInstance->UnwatchUnusedCli(value);
this->Entries->erase(it);
break;
}
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c
index 03896c2..f234722 100644
--- a/Source/CursesDialog/form/frm_driver.c
+++ b/Source/CursesDialog/form/frm_driver.c
@@ -1086,7 +1086,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts)
if (form->status & _POSTED)
{
- if ((form->curpage == field->page))
+ if (form->curpage == field->page)
{
if (changed_opts & O_VISIBLE)
{
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 408dbac..c8c4bfa 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -118,8 +118,15 @@ CMakeSetupDialog::CMakeSetupDialog()
this, SLOT(doInstallForCommandLine()));
#endif
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
- this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
+ this->SuppressDevWarningsAction =
+ OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
this->SuppressDevWarningsAction->setCheckable(true);
+ this->WarnUninitializedAction =
+ OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)"));
+ this->WarnUninitializedAction->setCheckable(true);
+ this->WarnUnusedAction =
+ OptionsMenu->addAction(tr("&Warn Unused (--warn-unused-vars)"));
+ this->WarnUnusedAction->setCheckable(true);
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
debugAction->setCheckable(true);
@@ -247,6 +254,13 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
+ QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)),
+ this->CMakeThread->cmakeInstance(),
+ SLOT(setWarnUninitializedMode(bool)));
+ QObject::connect(this->WarnUnusedAction, SIGNAL(triggered(bool)),
+ this->CMakeThread->cmakeInstance(),
+ SLOT(setWarnUnusedMode(bool)));
+
if(!this->SourceDirectory->text().isEmpty() ||
!this->BinaryDirectory->lineEdit()->text().isEmpty())
{
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1934795..5121759 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -97,6 +97,8 @@ protected:
QAction* ConfigureAction;
QAction* GenerateAction;
QAction* SuppressDevWarningsAction;
+ QAction* WarnUninitializedAction;
+ QAction* WarnUnusedAction;
QAction* InstallForCommandLineAction;
State CurrentState;
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index dc31fad..a40a175 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -28,6 +28,8 @@ QCMake::QCMake(QObject* p)
: QObject(p)
{
this->SuppressDevWarnings = false;
+ this->WarnUninitializedMode = false;
+ this->WarnUnusedMode = false;
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
@@ -164,6 +166,8 @@ void QCMake::configure()
this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data()));
this->CMakeInstance->LoadCache();
this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings);
+ this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
+ this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
this->CMakeInstance->PreLoadCMakeFiles();
cmSystemTools::ResetErrorOccuredFlag();
@@ -238,12 +242,16 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
// remove some properites
foreach(QString s, toremove)
{
+ this->CMakeInstance->UnwatchUnusedCli(s.toAscii().data());
+
cachem->RemoveCacheEntry(s.toAscii().data());
}
// add some new properites
foreach(QCMakeProperty s, props)
{
+ this->CMakeInstance->WatchUnusedCli(s.Key.toAscii().data());
+
if(s.Type == QCMakeProperty::BOOL)
{
this->CMakeInstance->AddCacheEntry(s.Key.toAscii().data(),
@@ -417,3 +425,13 @@ void QCMake::setSuppressDevWarnings(bool value)
{
this->SuppressDevWarnings = value;
}
+
+void QCMake::setWarnUninitializedMode(bool value)
+{
+ this->WarnUninitializedMode = value;
+}
+
+void QCMake::setWarnUnusedMode(bool value)
+{
+ this->WarnUnusedMode = value;
+}
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index bbfb3d7..0d10823 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -88,6 +88,10 @@ public slots:
void setDebugOutput(bool);
/// set whether to do suppress dev warnings
void setSuppressDevWarnings(bool value);
+ /// set whether to run cmake with warnings about uninitialized variables
+ void setWarnUninitializedMode(bool value);
+ /// set whether to run cmake with warnings about unused variables
+ void setWarnUnusedMode(bool value);
public:
/// get the list of cache properties
@@ -133,6 +137,9 @@ protected:
static void errorCallback(const char* msg, const char* title,
bool&, void* cd);
bool SuppressDevWarnings;
+ bool WarnUninitializedMode;
+ bool WarnUnusedMode;
+ bool WarnUnusedAllMode;
QString SourceDirectory;
QString BinaryDirectory;
QString Generator;
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 11ca9e7..a9165f5 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -170,7 +170,10 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
cmTest* test = this->Makefile->CreateTest(name.c_str());
test->SetOldStyle(false);
test->SetCommand(command);
- test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
+ if(!working_directory.empty())
+ {
+ test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
+ }
this->Makefile->AddTestGenerator(new cmTestGenerator(test, configurations));
return true;
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 234c37e..a781767 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -20,6 +20,8 @@ int cmCommandArgument_yyparse( yyscan_t yyscanner );
//
cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
{
+ this->WarnUninitialized = false;
+ this->CheckSystemVars = false;
this->FileLine = -1;
this->FileName = 0;
this->RemoveEmpty = true;
@@ -119,10 +121,32 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
cmOStringStream ostr;
ostr << this->FileLine;
return this->AddString(ostr.str().c_str());
- }
+ }
const char* value = this->Makefile->GetDefinition(var);
if(!value && !this->RemoveEmpty)
{
+ // check to see if we need to print a warning
+ // if strict mode is on and the variable has
+ // not been "cleared"/initialized with a set(foo ) call
+ if(this->WarnUninitialized && !this->Makefile->VariableInitialized(var))
+ {
+ if (this->CheckSystemVars ||
+ cmSystemTools::IsSubDirectory(this->FileName,
+ this->Makefile->GetHomeDirectory()) ||
+ cmSystemTools::IsSubDirectory(this->FileName,
+ this->Makefile->GetHomeOutputDirectory()))
+ {
+ cmOStringStream msg;
+ cmListFileBacktrace bt;
+ cmListFileContext lfc;
+ lfc.FilePath = this->FileName;
+ lfc.Line = this->FileLine;
+ bt.push_back(lfc);
+ msg << "uninitialized variable \'" << var << "\'";
+ this->Makefile->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+ msg.str().c_str(), bt);
+ }
+ }
return 0;
}
if (this->EscapeQuotes && value)
@@ -319,6 +343,8 @@ void cmCommandArgumentParserHelper::Error(const char* str)
void cmCommandArgumentParserHelper::SetMakefile(const cmMakefile* mf)
{
this->Makefile = mf;
+ this->WarnUninitialized = mf->GetCMakeInstance()->GetWarnUninitialized();
+ this->CheckSystemVars = mf->GetCMakeInstance()->GetCheckSystemVars();
}
void cmCommandArgumentParserHelper::SetResult(const char* value)
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index 62cbc80..a211e95 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -96,6 +96,8 @@ private:
const cmMakefile* Makefile;
std::string Result;
const char* FileName;
+ bool WarnUninitialized;
+ bool CheckSystemVars;
long FileLine;
bool EscapeQuotes;
std::string ErrorString;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 0fe64ad..96a214e 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -1,6 +1,6 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
- Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+ Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
@@ -56,7 +56,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
if ( argv.size() <= (i+1) )
{
- cmSystemTools::Error(
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"OUTPUT_VARIABLE specified but there is no variable");
return -1;
}
@@ -92,7 +92,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
if ( argv.size() <= (i+1) )
{
- cmSystemTools::Error(
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"COPY_FILE specified but there is no variable");
return -1;
}
@@ -120,13 +120,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
// only valid for srcfile signatures
if (compileFlags.size())
{
- cmSystemTools::Error(
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"COMPILE_FLAGS specified on a srcdir type TRY_COMPILE");
return -1;
}
if (copyFile.size())
{
- cmSystemTools::Error("COPY_FILE specified on a srcdir type TRY_COMPILE");
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ "COPY_FILE specified on a srcdir type TRY_COMPILE");
return -1;
}
}
@@ -136,9 +137,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
// do not allow recursive try Compiles
if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory())
{
- cmSystemTools::Error(
- "Attempt at a recursive or nested TRY_COMPILE in directory ",
- this->BinaryDirectory.c_str());
+ cmOStringStream e;
+ e << "Attempt at a recursive or nested TRY_COMPILE in directory\n"
+ << " " << this->BinaryDirectory << "\n";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return -1;
}
@@ -158,14 +160,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
FILE *fout = fopen(outFileName.c_str(),"w");
if (!fout)
{
- cmSystemTools::Error("Failed to create CMakeList file for ",
- outFileName.c_str());
- cmSystemTools::ReportLastSystemError("");
+ cmOStringStream e;
+ e << "Failed to open\n"
+ << " " << outFileName.c_str() << "\n"
+ << cmSystemTools::GetLastSystemError();
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return -1;
}
std::string source = argv[2];
- std::string ext = cmSystemTools::GetFilenameExtension(source);
+ std::string ext = cmSystemTools::GetFilenameLastExtension(source);
const char* lang =(this->Makefile->GetCMakeInstance()->GetGlobalGenerator()
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
@@ -199,10 +203,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
}
else
{
+ fclose(fout);
cmOStringStream err;
- err << "Unknown extension \"" << ext << "\" for file \""
- << source << "\". TRY_COMPILE only works for enabled languages.\n"
- << "Currently enabled languages are:";
+ err << "Unknown extension \"" << ext << "\" for file\n"
+ << " " << source << "\n"
+ << "try_compile() works only for enabled languages. "
+ << "Currently these are:\n ";
std::vector<std::string> langs;
this->Makefile->GetCMakeInstance()->GetGlobalGenerator()->
GetEnabledLanguages(langs);
@@ -211,9 +217,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{
err << " " << *l;
}
- err << "\nSee PROJECT command for help enabling other languages.";
- cmSystemTools::Error(err.str().c_str());
- fclose(fout);
+ err << "\nSee project() command to enable other languages.";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, err.str());
return -1;
}
std::string langFlags = "CMAKE_";
@@ -246,10 +251,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
CMAKE_TRY_COMPILE_OSX_ARCHITECTURE first to i386 and then to ppc to
have the tests run for each specific architecture. Since
cmLocalGenerator doesn't allow building for "the other"
- architecture only via CMAKE_OSX_ARCHITECTURES,use to CMAKE_DO_TRY_COMPILE
- to enforce it for this case here.
+ architecture only via CMAKE_OSX_ARCHITECTURES.
*/
- cmakeFlags.push_back("-DCMAKE_DO_TRY_COMPILE=TRUE");
if(this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_OSX_ARCHITECTURES")!=0)
{
std::string flag="-DCMAKE_OSX_ARCHITECTURES=";
@@ -278,6 +281,10 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmakeFlags.push_back(flag);
}
+ /* Put the executable at a known location (for COPY_FILE). */
+ fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
+ this->BinaryDirectory.c_str());
+ /* Create the actual executable. */
fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str());
fprintf(fout,
"TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n");
@@ -340,17 +347,15 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
copyFile.c_str()))
{
cmOStringStream emsg;
- emsg << "Could not COPY_FILE.\n"
- << " OutputFile: '" << this->OutputFile.c_str() << "'\n"
- << " copyFile: '" << copyFile.c_str() << "'\n";
-
- if (this->FindErrorMessage.size())
+ emsg << "Cannot copy output executable\n"
+ << " '" << this->OutputFile.c_str() << "'\n"
+ << "to destination specified by COPY_FILE:\n"
+ << " '" << copyFile.c_str() << "'\n";
+ if(!this->FindErrorMessage.empty())
{
- emsg << "\n";
- emsg << this->FindErrorMessage.c_str() << "\n";
+ emsg << this->FindErrorMessage.c_str();
}
-
- cmSystemTools::Error(emsg.str().c_str());
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, emsg.str());
return -1;
}
}
@@ -457,18 +462,11 @@ void cmCoreTryCompile::FindOutputFile(const char* targetName)
}
cmOStringStream emsg;
- emsg << "Unable to find executable for " << this->GetName() << ": tried \"";
+ emsg << "Unable to find the executable at any of:\n";
for (unsigned int i = 0; i < searchDirs.size(); ++i)
{
- emsg << this->BinaryDirectory << searchDirs[i] << tmpOutputFile;
- if (i < searchDirs.size() - 1)
- {
- emsg << "\" and \"";
- }
- else
- {
- emsg << "\".";
- }
+ emsg << " " << this->BinaryDirectory << searchDirs[i]
+ << tmpOutputFile << "\n";
}
this->FindErrorMessage = emsg.str();
return;
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 2d40718..9d28700 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -85,6 +85,22 @@ const char* cmDefinitions::Set(const char* key, const char* value)
}
//----------------------------------------------------------------------------
+std::set<cmStdString> cmDefinitions::LocalKeys() const
+{
+ std::set<cmStdString> keys;
+ // Consider local definitions.
+ for(MapType::const_iterator mi = this->Map.begin();
+ mi != this->Map.end(); ++mi)
+ {
+ if (mi->second.Exists)
+ {
+ keys.insert(mi->first);
+ }
+ }
+ return keys;
+}
+
+//----------------------------------------------------------------------------
cmDefinitions cmDefinitions::Closure() const
{
return cmDefinitions(ClosureTag(), this);
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index e385e88..4834d84 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -40,6 +40,9 @@ public:
/** Set (or unset if null) a value associated with a key. */
const char* Set(const char* key, const char* value);
+ /** Get the set of all local keys. */
+ std::set<cmStdString> LocalKeys() const;
+
/** Compute the closure of all defined keys with values.
This flattens the scope. The result has no parent. */
cmDefinitions Closure() const;
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 942cb3f..a76b3af 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -448,6 +448,7 @@ void cmDependsC::Scan(std::istream& is, const char* directory,
// Get the file being included.
UnscannedEntry entry;
entry.FileName = this->IncludeRegexLine.match(2);
+ cmSystemTools::ConvertToUnixSlashes(entry.FileName);
if(this->IncludeRegexLine.match(3) == "\"" &&
!cmSystemTools::FileIsFullPath(entry.FileName.c_str()))
{
diff --git a/Source/cmDocumentCompileDefinitions.h b/Source/cmDocumentCompileDefinitions.h
new file mode 100644
index 0000000..ef3b3e7
--- /dev/null
+++ b/Source/cmDocumentCompileDefinitions.h
@@ -0,0 +1,34 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2011 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 cmDocumentCompileDefinitions_h
+#define cmDocumentCompileDefinitions_h
+
+#define CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER \
+ "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 " \
+ "work-around the problem by adding escape sequences to the value. " \
+ "Your work-around may break in a future version of CMake that " \
+ "has improved escape support. Instead consider defining the macro " \
+ "in a (configured) header file. Then report the limitation. " \
+ "Known limitations include:\n" \
+ " # - broken almost everywhere\n" \
+ " ; - broken in VS IDE and Borland Makefiles\n" \
+ " , - broken in VS IDE\n" \
+ " % - broken in some cases in NMake\n" \
+ " & | - broken in some cases on MinGW\n" \
+ " ^ < > \\\" - broken in most Make tools on Windows\n" \
+ "CMake does not reject these values outright because they do work " \
+ "in some cases. Use with caution. "
+
+#endif
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 5dfa64e..0cd5fa2 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -696,13 +696,29 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_USER_MAKE_RULES_OVERRIDE", cmProperty::VARIABLE,
- "Specify a file that can change the build rule variables.",
- "If this variable is set, it should to point to a "
- "CMakeLists.txt file that will be read in by CMake "
- "after all the system settings have been set, but "
- "before they have been used. This would allow you "
- "to override any variables that need to be changed "
- "for some special project. ",false,
+ "Specify a CMake file that overrides platform information.",
+ "CMake loads the specified file while enabling support for each "
+ "language from either the project() or enable_language() commands. "
+ "It is loaded after CMake's builtin compiler and platform information "
+ "modules have been loaded but before the information is used. "
+ "The file may set platform information variables to override CMake's "
+ "defaults."
+ "\n"
+ "This feature is intended for use only in overriding information "
+ "variables that must be set before CMake builds its first test "
+ "project to check that the compiler for a language works. "
+ "It should not be used to load a file in cases that a normal include() "
+ "will work. "
+ "Use it only as a last resort for behavior that cannot be achieved "
+ "any other way. "
+ "For example, one may set CMAKE_C_FLAGS_INIT to change the default "
+ "value used to initialize CMAKE_C_FLAGS before it is cached. "
+ "The override file should NOT be used to set anything that could "
+ "be set after languages are enabled, such as variables like "
+ "CMAKE_RUNTIME_OUTPUT_DIRECTORY that affect the placement of binaries. "
+ "Information set in the file will be used for try_compile and try_run "
+ "builds too."
+ ,false,
"Variables That Change Behavior");
cm->DefineProperty
@@ -851,8 +867,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("MSVC_VERSION", cmProperty::VARIABLE,
"The version of Microsoft Visual C/C++ being used if any.",
- "The version of Microsoft Visual C/C++ being used if any. "
- "For example 1300 is MSVC 6.0.",
+ "Known version numbers are:\n"
+ " 1200 = VS 6.0\n"
+ " 1300 = VS 7.0\n"
+ " 1310 = VS 7.1\n"
+ " 1400 = VS 8.0\n"
+ " 1500 = VS 9.0\n"
+ " 1600 = VS 10.0\n"
+ "",
false,
"Variables That Describe the System");
@@ -1121,6 +1143,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"this variable for a target if they are set. "
"Library targets are otherwise placed in this directory.",false,
"Variables that Control the Build");
+ cm->DefineProperty
+ ("CMAKE_TRY_COMPILE_CONFIGURATION", cmProperty::VARIABLE,
+ "Build configuration used for try_compile and try_run projects.",
+ "Projects built by try_compile and try_run are built "
+ "synchronously during the CMake configuration step. "
+ "Therefore a specific build configuration must be chosen even "
+ "if the generated build system supports multiple configurations.",false,
+ "Variables that Control the Build");
// Variables defined when the a language is enabled These variables will
@@ -1130,13 +1160,10 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>", cmProperty::VARIABLE,
- "Specify a file that can change the build rule variables.",
- "If this variable is set, it should to point to a "
- "CMakeLists.txt file that will be read in by CMake "
- "after all the system settings have been set, but "
- "before they have been used. This would allow you "
- "to override any variables that need to be changed "
- "for some language. ",false,
+ "Specify a CMake file that overrides platform information for <LANG>.",
+ "This is a language-specific version of "
+ "CMAKE_USER_MAKE_RULES_OVERRIDE loaded only when enabling "
+ "language <LANG>.",false,
"Variables for Languages");
cm->DefineProperty
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index e2a6035..9e5c91e 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -325,6 +325,12 @@ cmExportFileGenerator
os << "SET_PROPERTY(TARGET " << targetName
<< " PROPERTY MACOSX_BUNDLE 1)\n";
}
+
+ if (target->IsCFBundleOnApple())
+ {
+ os << "SET_PROPERTY(TARGET " << targetName
+ << " PROPERTY BUNDLE 1)\n";
+ }
os << "\n";
}
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 717571c..23ff5fb 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -263,6 +263,20 @@ cmExportInstallFileGenerator
value += ".framework/";
value += itgen->GetInstallFilename(target, config);
}
+ else if(target->IsCFBundleOnApple())
+ {
+ const char *ext = target->GetProperty("BUNDLE_EXTENSION");
+ if (!ext)
+ {
+ ext = "bundle";
+ }
+
+ value += itgen->GetInstallFilename(target, config);
+ value += ".";
+ value += ext;
+ value += "/";
+ value += itgen->GetInstallFilename(target, config);
+ }
else if(target->IsAppBundleOnApple())
{
value += itgen->GetInstallFilename(target, config);
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index b05642e..ec4fd16 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -113,6 +113,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
cmOStringStream strStream;
strStream << expandedArgs.size();
this->Makefile->AddDefinition("ARGC",strStream.str().c_str());
+ this->Makefile->MarkVariableAsUsed("ARGC");
// set the values for ARGV0 ARGV1 ...
for (unsigned int t = 0; t < expandedArgs.size(); ++t)
@@ -121,6 +122,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
tmpStream << "ARGV" << t;
this->Makefile->AddDefinition(tmpStream.str().c_str(),
expandedArgs[t].c_str());
+ this->Makefile->MarkVariableAsUsed(tmpStream.str().c_str());
}
// define the formal arguments
@@ -153,7 +155,9 @@ bool cmFunctionHelperCommand::InvokeInitialPass
cnt ++;
}
this->Makefile->AddDefinition("ARGV", argvDef.c_str());
+ this->Makefile->MarkVariableAsUsed("ARGV");
this->Makefile->AddDefinition("ARGN", argnDef.c_str());
+ this->Makefile->MarkVariableAsUsed("ARGN");
// Invoke all the functions that were collected in the block.
// for each function
diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h
index c78671e..d82be70 100644
--- a/Source/cmGetCMakePropertyCommand.h
+++ b/Source/cmGetCMakePropertyCommand.h
@@ -54,11 +54,14 @@ public:
{
return
" get_cmake_property(VAR property)\n"
- "Get a property from the CMake instance. The value of the "
- "property is stored in the variable VAR. If the property is "
- "not found, CMake will report an error. Some supported properties "
+ "Get a property from the CMake instance. "
+ "The value of the property is stored in the variable VAR. "
+ "If the property is not found, VAR will be set to \"NOTFOUND\". "
+ "Some supported properties "
"include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and "
- "COMPONENTS.";
+ "COMPONENTS."
+ "\n"
+ "See also the more general get_property() command.";
}
cmTypeMacro(cmGetCMakePropertyCommand, cmCommand);
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index c3a23a3..b7a5f71 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -66,7 +66,8 @@ public:
"Get a variable definition from a directory. "
"This form is useful to get a variable definition from another "
"directory."
- ;
+ "\n"
+ "See also the more general get_property() command.";
}
cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h
index c1d5e11..56469f8 100644
--- a/Source/cmGetSourceFilePropertyCommand.h
+++ b/Source/cmGetSourceFilePropertyCommand.h
@@ -53,7 +53,9 @@ public:
"stored in the variable VAR. If the property is not found, VAR "
"will be set to \"NOTFOUND\". Use set_source_files_properties to set "
"property values. Source file properties usually control how the "
- "file is built. One property that is always there is LOCATION";
+ "file is built. One property that is always there is LOCATION"
+ "\n"
+ "See also the more general get_property() command.";
}
cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand);
diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h
index e1984c3..71c75ef 100644
--- a/Source/cmGetTargetPropertyCommand.h
+++ b/Source/cmGetTargetPropertyCommand.h
@@ -55,7 +55,9 @@ public:
"property values. Properties are usually used to control how "
"a target is built, but some query the target instead. "
"This command can get properties for any target so far created. "
- "The targets do not need to be in the current CMakeLists.txt file.";
+ "The targets do not need to be in the current CMakeLists.txt file."
+ "\n"
+ "See also the more general get_property() command.";
}
cmTypeMacro(cmGetTargetPropertyCommand, cmCommand);
diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h
index 956cf55..d9f5d9b 100644
--- a/Source/cmGetTestPropertyCommand.h
+++ b/Source/cmGetTestPropertyCommand.h
@@ -48,11 +48,13 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " get_test_property(test VAR property)\n"
- "Get a property from the Test. The value of the property is "
- "stored in the variable VAR. If the property is not found, "
- "CMake will report an error. For a list of standard properties "
- "you can type cmake --help-property-list";
+ " get_test_property(test property VAR)\n"
+ "Get a property from the Test. The value of the property is "
+ "stored in the variable VAR. If the property is not found, VAR "
+ "will be set to \"NOTFOUND\". For a list of standard properties "
+ "you can type cmake --help-property-list"
+ "\n"
+ "See also the more general get_property() command.";
}
cmTypeMacro(cmGetTestPropertyCommand, cmCommand);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 123ab5e..d47fb6f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -56,6 +56,7 @@ cmGlobalGenerator::cmGlobalGenerator()
this->ExtraGenerator = 0;
this->CurrentLocalGenerator = 0;
+ this->TryCompileOuterMakefile = 0;
}
cmGlobalGenerator::~cmGlobalGenerator()
@@ -199,6 +200,34 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
cmSystemTools::SetFatalErrorOccured();
return;
}
+
+ if(this->TryCompileOuterMakefile)
+ {
+ // In a try-compile we can only enable languages provided by caller.
+ for(std::vector<std::string>::const_iterator li = languages.begin();
+ li != languages.end(); ++li)
+ {
+ if(*li == "NONE")
+ {
+ this->SetLanguageEnabled("NONE", mf);
+ }
+ else
+ {
+ const char* lang = li->c_str();
+ if(this->LanguagesReady.find(lang) == this->LanguagesReady.end())
+ {
+ cmOStringStream e;
+ e << "The test project needs language "
+ << lang << " which is not enabled.";
+ this->TryCompileOuterMakefile
+ ->IssueMessage(cmake::FATAL_ERROR, e.str());
+ cmSystemTools::SetFatalErrorOccured();
+ return;
+ }
+ }
+ }
+ }
+
mf->AddDefinition("RUN_CONFIGURE", true);
std::string rootBin = mf->GetHomeOutputDirectory();
rootBin += cmake::GetCMakeFilesDirectory();
@@ -208,15 +237,6 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
// files from the parent cmake bin dir, into the try compile bin dir
if(this->ConfiguredFilesPath.size())
{
- for(std::vector<std::string>::const_iterator l = languages.begin();
- l != languages.end(); ++l)
- {
- if(*l == "NONE")
- {
- this->SetLanguageEnabled("NONE", mf);
- break;
- }
- }
rootBin = this->ConfiguredFilesPath;
}
@@ -421,6 +441,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
{
this->SetLanguageEnabledMaps(lang, mf);
}
+ this->LanguagesReady.insert(lang);
std::string compilerName = "CMAKE_";
compilerName += lang;
@@ -882,6 +903,8 @@ void cmGlobalGenerator::Generate()
}
this->CMakeInstance->UpdateProgress("Generating done", -1);
+
+ this->CMakeInstance->RunCheckForUnusedVariables("generation");
}
//----------------------------------------------------------------------------
@@ -1333,9 +1356,11 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
return lg;
}
-void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen )
+void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
+ cmMakefile* mf)
{
this->SetConfiguredFilesPath(gen);
+ this->TryCompileOuterMakefile = mf;
const char* make =
gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make,
@@ -1343,6 +1368,7 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen )
cmCacheManager::FILEPATH);
// copy the enabled languages
this->LanguageEnabled = gen->LanguageEnabled;
+ this->LanguagesReady = gen->LanguagesReady;
this->ExtensionToLanguage = gen->ExtensionToLanguage;
this->IgnoreExtensions = gen->IgnoreExtensions;
this->LanguageToOutputExtension = gen->LanguageToOutputExtension;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 6a1aa53..5268731 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -79,7 +79,8 @@ public:
/**
* Try to determine system infomation, get it from another generator
*/
- virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen);
+ virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
+ cmMakefile* mf);
/**
* Try running cmake and building a file. This is used for dynalically
@@ -325,11 +326,13 @@ protected:
virtual bool UseFolderProperty();
private:
+ cmMakefile* TryCompileOuterMakefile;
float FirstTimeProgress;
// If you add a new map here, make sure it is copied
// in EnableLanguagesFromGenerator
std::map<cmStdString, bool> IgnoreExtensions;
std::map<cmStdString, bool> LanguageEnabled;
+ std::set<cmStdString> LanguagesReady; // Ready for try_compile
std::map<cmStdString, cmStdString> OutputExtensions;
std::map<cmStdString, cmStdString> LanguageToOutputExtension;
std::map<cmStdString, cmStdString> ExtensionToLanguage;
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 0b939af..6c3c1ed 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -114,18 +114,23 @@ std::string cmGlobalVisualStudio10Generator
::GenerateBuildCommand(const char* makeProgram,
const char *projectName,
const char* additionalOptions, const char *targetName,
- const char* config, bool ignoreErrors, bool)
+ const char* config, bool ignoreErrors, bool fast)
{
- // Ingoring errors is not implemented in visual studio 6
- (void) ignoreErrors;
-
-
// now build the test
std::string makeCommand
= cmSystemTools::ConvertToOutputPath(makeProgram);
std::string lowerCaseCommand = makeCommand;
cmSystemTools::LowerCase(lowerCaseCommand);
+ // If makeProgram is devenv, parent class knows how to generate command:
+ if (lowerCaseCommand.find("devenv") != std::string::npos)
+ {
+ return cmGlobalVisualStudio7Generator::GenerateBuildCommand(makeProgram,
+ projectName, additionalOptions, targetName, config, ignoreErrors, fast);
+ }
+
+ // Otherwise, assume MSBuild command line, and construct accordingly.
+
// if there are spaces in the makeCommand, assume a full path
// and convert it to a path with no spaces in it as the
// RunSingleCommand does not like spaces
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 2d080df..ef723b7 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -358,6 +358,15 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] =
{"ExceptionHandling", "EHsc", "enable c++ exceptions", "1", 0},
{"ExceptionHandling", "EHa", "enable SEH exceptions", "2", 0},
+ {"EnablePREfast", "analyze", "", "true", 0},
+ {"EnablePREfast", "analyze-", "", "false", 0},
+
+ // Language options
+ {"TreatWChar_tAsBuiltInType", "Zc:wchar_t",
+ "wchar_t is a built-in type", "true", 0},
+ {"TreatWChar_tAsBuiltInType", "Zc:wchar_t-",
+ "wchar_t is not a built-in type", "false", 0},
+
{0,0,0,0,0}
};
cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8()
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 59ca38f..df679ea 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -355,7 +355,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmCustomCommandLines commandLines;
commandLines.push_back(makecommand);
// Add Re-Run CMake rules
- this->CreateReRunCMakeFile(root);
+ this->CreateReRunCMakeFile(root, gens);
// now make the allbuild depend on all the non-utility targets
// in the project
@@ -403,10 +403,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
}
//----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
+void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
+ cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens)
{
cmMakefile* mf = root->GetMakefile();
- std::vector<std::string> lfiles = mf->GetListFiles();
+ std::vector<std::string> lfiles;
+ for(std::vector<cmLocalGenerator*>::const_iterator gi = gens.begin();
+ gi != gens.end(); ++gi)
+ {
+ std::vector<std::string> const& lf = (*gi)->GetMakefile()->GetListFiles();
+ lfiles.insert(lfiles.end(), lf.begin(), lf.end());
+ }
+
// sort the array
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
std::vector<std::string>::iterator new_end =
@@ -570,6 +578,12 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
}
}
+ if(cmtarget.IsCFBundleOnApple())
+ {
+ cmtarget.SetProperty("PREFIX", "");
+ cmtarget.SetProperty("SUFFIX", "");
+ }
+
// Add the fileRef to the top level Resources group/folder if it is not
// already there.
//
@@ -804,6 +818,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
// some build phases only apply to bundles and/or frameworks
bool isFrameworkTarget = cmtarget.IsFrameworkOnApple();
bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
+ bool isCFBundleTarget = cmtarget.IsCFBundleOnApple();
cmXCodeObject* buildFiles = 0;
@@ -849,7 +864,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
// create resource build phase - only for framework or bundle targets
cmXCodeObject* resourceBuildPhase = 0;
- if (!resourceFiles.empty() && (isFrameworkTarget || isBundleTarget))
+ if (!resourceFiles.empty() &&
+ (isFrameworkTarget || isBundleTarget || isCFBundleTarget))
{
resourceBuildPhase =
this->CreateObject(cmXCodeObject::PBXResourcesBuildPhase);
@@ -870,7 +886,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
// create vector of "non-resource content file" build phases - only for
// framework or bundle targets
std::vector<cmXCodeObject*> contentBuildPhases;
- if (isFrameworkTarget || isBundleTarget)
+ if (isFrameworkTarget || isBundleTarget || isCFBundleTarget)
{
typedef std::map<cmStdString, std::vector<cmSourceFile*> >
mapOfVectorOfSourceFiles;
@@ -1279,6 +1295,9 @@ void cmGlobalXCodeGenerator
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
makefileStream << "# Custom rules for " << target.GetName() << "\n";
+ // disable the implicit rules
+ makefileStream << ".SUFFIXES: " << "\n";
+
// have all depend on all outputs
makefileStream << "all: ";
std::map<const cmCustomCommand*, cmStdString> tname;
@@ -1594,7 +1613,33 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("BUNDLE"));
- if(this->XcodeVersion >= 22)
+ if (target.GetPropertyAsBool("BUNDLE"))
+ {
+ // It turns out that a BUNDLE is basically the same
+ // in many ways as an application bundle, as far as
+ // link flags go
+ std::string createFlags =
+ this->LookupFlags("CMAKE_SHARED_MODULE_CREATE_", lang, "_FLAGS",
+ "-bundle");
+ if(!createFlags.empty())
+ {
+ extraLinkOptions += " ";
+ extraLinkOptions += createFlags;
+ }
+ std::string plist = this->ComputeInfoPListLocation(target);
+ // Xcode will create the final version of Info.plist at build time,
+ // so let it replace the cfbundle name. This avoids creating
+ // a per-configuration Info.plist file. The cfbundle plist
+ // is very similar to the application bundle plist
+ this->CurrentLocalGenerator
+ ->GenerateAppleInfoPList(&target, "$(EXECUTABLE_NAME)",
+ plist.c_str());
+ std::string path =
+ this->ConvertToRelativeForXCode(plist.c_str());
+ buildSettings->AddAttribute("INFOPLIST_FILE",
+ this->CreateString(path.c_str()));
+ }
+ else if(this->XcodeVersion >= 22)
{
buildSettings->AddAttribute("MACH_O_TYPE",
this->CreateString("mh_bundle"));
@@ -1633,7 +1678,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string plist = this->ComputeInfoPListLocation(target);
// Xcode will create the final version of Info.plist at build time,
- // so let it replace the framework name. This avoids creating
+ // so let it replace the framework name. This avoids creating
// a per-configuration Info.plist file.
this->CurrentLocalGenerator
->GenerateFrameworkInfoPList(&target, "$(EXECUTABLE_NAME)",
@@ -2032,7 +2077,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
case cmTarget::STATIC_LIBRARY:
return "archive.ar";
case cmTarget::MODULE_LIBRARY:
- return ((this->XcodeVersion >= 22)?
+ if (cmtarget.IsCFBundleOnApple())
+ return "wrapper.plug-in";
+ else
+ return ((this->XcodeVersion >= 22)?
"compiled.mach-o.executable" : "compiled.mach-o.dylib");
case cmTarget::SHARED_LIBRARY:
return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
@@ -2052,8 +2100,12 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget)
case cmTarget::STATIC_LIBRARY:
return "com.apple.product-type.library.static";
case cmTarget::MODULE_LIBRARY:
- return ((this->XcodeVersion >= 22)? "com.apple.product-type.tool" :
- "com.apple.product-type.library.dynamic");
+ if (cmtarget.IsCFBundleOnApple())
+ return "com.apple.product-type.bundle";
+ else
+ return ((this->XcodeVersion >= 22)?
+ "com.apple.product-type.tool" :
+ "com.apple.product-type.library.dynamic");
case cmTarget::SHARED_LIBRARY:
return (cmtarget.GetPropertyAsBool("FRAMEWORK")?
"com.apple.product-type.framework" :
@@ -2682,7 +2734,7 @@ void cmGlobalXCodeGenerator
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
const char* osxArch =
this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES");
- if(strlen(osxArch) == 0)
+ if(!osxArch || strlen(osxArch) == 0)
{
if(this->XcodeVersion >= 32)
{
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index b4de805..290532a 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -171,7 +171,8 @@ private:
const char* name2,
cmTarget& cmtarget,
const std::vector<cmCustomCommand>&);
- void CreateReRunCMakeFile(cmLocalGenerator* root);
+ void CreateReRunCMakeFile(cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*> const& gens);
std::string LookupFlags(const char* varNamePrefix,
const char* varNameLang,
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index bdb33bc..de95aa5 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -272,6 +272,12 @@ void cmGraphVizWriter::WriteConnections(const char* targetName,
std::map<cmStdString, cmStdString>::const_iterator libNameIt =
this->TargetNamesNodes.find(libName);
+ // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used
+ if(libNameIt == this->TargetNamesNodes.end())
+ {
+ continue;
+ }
+
std::string connectionName = myNodeName;
connectionName += "-";
connectionName += libNameIt->second;
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 107a892..4996bc4 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -125,10 +125,13 @@ public:
"True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. "
"False if the constant is 0, OFF, NO, FALSE, N, IGNORE, \"\", "
"or ends in the suffix '-NOTFOUND'. "
- "Named boolean constants are case-insensitive."
+ "Named boolean constants are case-insensitive. "
+ "If the argument is not one of these constants, "
+ "it is treated as a variable:"
"\n"
" if(<variable>)\n"
- "True if the variable's value is not a false constant."
+ "True if the variable is defined to a value that is not a false "
+ "constant. False otherwise. "
"\n"
" if(NOT <expression>)\n"
"True if the expression is not true."
@@ -163,32 +166,25 @@ public:
"Behavior is well-defined only for full paths.\n"
" if(IS_ABSOLUTE path)\n"
"True if the given path is an absolute path.\n"
- " if(variable MATCHES regex)\n"
- " if(string MATCHES regex)\n"
+ " if(<variable|string> MATCHES regex)\n"
"True if the given string or variable's value matches the given "
"regular expression.\n"
- " if(variable LESS number)\n"
- " if(string LESS number)\n"
- " if(variable GREATER number)\n"
- " if(string GREATER number)\n"
- " if(variable EQUAL number)\n"
- " if(string EQUAL number)\n"
+ " if(<variable|string> LESS <variable|string>)\n"
+ " if(<variable|string> GREATER <variable|string>)\n"
+ " if(<variable|string> EQUAL <variable|string>)\n"
"True if the given string or variable's value is a valid number and "
"the inequality or equality is true.\n"
- " if(variable STRLESS string)\n"
- " if(string STRLESS string)\n"
- " if(variable STRGREATER string)\n"
- " if(string STRGREATER string)\n"
- " if(variable STREQUAL string)\n"
- " if(string STREQUAL string)\n"
+ " if(<variable|string> STRLESS <variable|string>)\n"
+ " if(<variable|string> STRGREATER <variable|string>)\n"
+ " if(<variable|string> STREQUAL <variable|string>)\n"
"True if the given string or variable's value is lexicographically "
"less (or greater, or equal) than the string or variable on the right.\n"
- " if(version1 VERSION_LESS version2)\n"
- " if(version1 VERSION_EQUAL version2)\n"
- " if(version1 VERSION_GREATER version2)\n"
+ " if(<variable|string> VERSION_LESS <variable|string>)\n"
+ " if(<variable|string> VERSION_EQUAL <variable|string>)\n"
+ " if(<variable|string> VERSION_GREATER <variable|string>)\n"
"Component-wise integer version number comparison (version format is "
"major[.minor[.patch[.tweak]]]).\n"
- " if(DEFINED variable)\n"
+ " if(DEFINED <variable>)\n"
"True if the given variable is defined. It does not matter if the "
"variable is true or false just if it has been set.\n"
" if((expression) AND (expression OR (expression)))\n"
@@ -199,38 +195,27 @@ public:
"that contains them."
"\n"
- "The if statement was written fairly early in CMake's history "
- "and it has some convenience features that are worth covering. "
- "The if statement reduces operations until there is "
- "a single remaining value, at that point if the case "
- "insensitive value is: ON, 1, YES, TRUE, Y it returns true, if "
- "it is OFF, 0, NO, FALSE, N, NOTFOUND, *-NOTFOUND, IGNORE it "
- "will return false. \n"
-
- "This is fairly reasonable. The convenience feature that sometimes "
- "throws new authors is how CMake handles values that do not "
- "match the true or false list. Those values are treated as "
- "variables and are dereferenced even though they do not have "
- "the required ${} syntax. This means that if you write\n"
-
- " if (boobah)\n"
-
- "CMake will treat it as if you wrote \n"
-
- " if (${boobah})\n"
-
- "likewise if you write \n"
-
- " if (fubar AND sol)\n"
-
- "CMake will conveniently treat it as \n"
-
- " if (\"${fubar}\" AND \"${sol}\")\n"
-
- "The later is really the correct way to write it, but the "
- "former will work as well. Only some operations in the if "
- "statement have this special handling of arguments. The "
- "specific details follow: \n"
+ "The if command was written very early in CMake's history, predating "
+ "the ${} variable evaluation syntax, and for convenience evaluates "
+ "variables named by its arguments as shown in the above signatures. "
+ "Note that normal variable evaluation with ${} applies before the "
+ "if command even receives the arguments. "
+ "Therefore code like\n"
+ " set(var1 OFF)\n"
+ " set(var2 \"var1\")\n"
+ " if(${var2})\n"
+ "appears to the if command as\n"
+ " if(var1)\n"
+ "and is evaluated according to the if(<variable>) case "
+ "documented above. "
+ "The result is OFF which is false. "
+ "However, if we remove the ${} from the example then the command sees\n"
+ " if(var2)\n"
+ "which is true because var2 is defined to \"var1\" which is not "
+ "a false constant."
+ "\n"
+ "Automatic evaluation applies in the other cases whenever the "
+ "above-documented signature accepts <variable|string>:\n"
"1) The left hand argument to MATCHES is first checked to see "
"if it is a defined variable, if so the variable's value is "
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index 7f229fa..d215295 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -83,6 +83,14 @@ public:
"REMOVE_DUPLICATES will remove duplicated items in the list.\n"
"REVERSE reverses the contents of the list in-place.\n"
"SORT sorts the list in-place alphabetically.\n"
+ "The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, "
+ "REMOVE_DUPLICATES, REVERSE and SORT may create new values for "
+ "the list within the current CMake variable scope. Similar to "
+ "the SET command, the LIST command creates new variable values "
+ "in the current scope, even if the list itself is actually "
+ "defined in a parent scope. To propagate the results of these "
+ "operations upwards, use SET with PARENT_SCOPE, SET with CACHE "
+ "INTERNAL, or some other means of value propagation.\n"
"NOTES: A list in cmake is a ; separated group of strings. "
"To create a list the set command can be used. For example, "
"set(var a b c d e) creates a list with a;b;c;d;e, and "
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 21f6460..700d92a 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -381,6 +381,11 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
"Use sse2 instructions", "2", 0},
{"EnableEnhancedInstructionSet", "arch:SSE",
"Use sse instructions", "1", 0},
+ {"FloatingPointModel", "fp:precise",
+ "Use precise floating point model", "0", 0},
+ {"FloatingPointModel", "fp:strict",
+ "Use strict floating point model", "1", 0},
+ {"FloatingPointModel", "fp:fast", "Use fast floating point model", "2", 0},
{"FavorSizeOrSpeed", "Ot", "Favor fast code", "1", 0},
{"FavorSizeOrSpeed", "Os", "Favor small code", "2", 0},
{"CompileAs", "TC", "Compile as c code", "1", 0},
@@ -451,8 +456,13 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
"Turn off Run time type information for c++", "FALSE", 0},
{"SmallerTypeCheck", "RTCc", "smaller type check", "TRUE", 0},
{"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "TRUE", 0},
+ {"WholeProgramOptimization", "GL",
+ "Enables whole program optimization", "TRUE", 0},
+ {"WholeProgramOptimization", "GL-",
+ "Disables whole program optimization", "FALSE", 0},
{"WarnAsError", "WX", "Treat warnings as errors", "TRUE", 0},
{"BrowseInformation", "FR", "Generate browse information", "1", 0},
+ {"StringPooling", "GF", "Enable StringPooling", "TRUE", 0},
{0,0,0,0,0}
};
@@ -466,6 +476,14 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0},
{"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0},
{"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0},
+ {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0},
+ {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0},
+ {"DataExecutionPrevention", "NXCOMPAT:NO",
+ "Not known to work with Windows Data Execution Prevention", "1", 0},
+ {"DataExecutionPrevention", "NXCOMPAT",
+ "Known to work with Windows Data Execution Prevention", "2", 0},
+ {"DelaySign", "DELAYSIGN:NO", "", "false", 0},
+ {"DelaySign", "DELAYSIGN", "", "true", 0},
{"EntryPointSymbol", "ENTRY:", "sets the starting address", "",
cmVS7FlagTable::UserValue},
{"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "",
@@ -478,8 +496,16 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"EnableCOMDATFolding", "OPT:NOICF", "Do not remove redundant COMDATs",
"1", 0},
{"EnableCOMDATFolding", "OPT:ICF", "Remove redundant COMDATs", "2", 0},
+ {"ResourceOnlyDLL", "NOENTRY", "Create DLL with no entry point", "true", 0},
{"OptimizeReferences", "OPT:NOREF", "Keep unreferenced data", "1", 0},
{"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0},
+ {"Profile", "PROFILE", "", "true", 0},
+ {"RandomizedBaseAddress", "DYNAMICBASE:NO",
+ "Image may not be rebased at load-time", "1", 0},
+ {"RandomizedBaseAddress", "DYNAMICBASE",
+ "Image may be rebased at load-time", "2", 0},
+ {"SetChecksum", "RELEASE", "Enable setting checksum in header", "true", 0},
+ {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0},
{"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0},
{"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0},
{"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0},
@@ -498,6 +524,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0},
{"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0},
{"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0},
+ {"TurnOffAssemblyGeneration", "NOASSEMBLY",
+ "No assembly even if CLR information is present in objects.", "true", 0},
{"ModuleDefinitionFile", "DEF:", "add an export def file", "",
cmVS7FlagTable::UserValue},
{"GenerateMapFile", "MAP", "enable generation of map file", "TRUE", 0},
@@ -755,7 +783,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
fout << "\"\n";
targetOptions.OutputFlagMap(fout, "\t\t\t\t");
- targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
+ targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
if(targetBuilds)
@@ -789,7 +817,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
}
// add the -D flags to the RC tool
fout << "\"";
- targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "");
+ targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "", "RC");
fout << "/>\n";
tool = "VCMIDLTool";
if(this->FortranProject)
@@ -1462,6 +1490,7 @@ void cmLocalVisualStudio7Generator
else if(!fcinfo.FileConfigMap.empty())
{
const char* aCompilerTool = "VCCLCompilerTool";
+ const char* lang = "CXX";
if(this->FortranProject)
{
aCompilerTool = "VFFortranCompilerTool";
@@ -1479,6 +1508,7 @@ void cmLocalVisualStudio7Generator
if(ext == "rc")
{
aCompilerTool = "VCResourceCompilerTool";
+ lang = "RC";
if(this->FortranProject)
{
aCompilerTool = "VFResourceCompilerTool";
@@ -1520,7 +1550,8 @@ void cmLocalVisualStudio7Generator
fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n");
fileOptions.OutputFlagMap(fout, "\t\t\t\t\t");
fileOptions.OutputPreprocessorDefinitions(fout,
- "\t\t\t\t\t", "\n");
+ "\t\t\t\t\t", "\n",
+ lang);
}
if(!fc.AdditionalDeps.empty())
{
@@ -1706,6 +1737,22 @@ void cmLocalVisualStudio7Generator
event.Finish();
}
+void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout,
+ cmTarget& target)
+{
+ // if we have all the required Source code control tags
+ // then add that to the project
+ const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME");
+ const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH");
+ const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER");
+ if(vsProvider && vsLocalpath && vsProjectname)
+ {
+ fout << "\tSccProjectName=\"" << vsProjectname << "\"\n"
+ << "\tSccLocalPath=\"" << vsLocalpath << "\"\n"
+ << "\tSccProvider=\"" << vsProvider << "\"\n";
+ }
+}
+
void
cmLocalVisualStudio7Generator
::WriteProjectStartFortran(std::ostream& fout,
@@ -1773,6 +1820,7 @@ cmLocalVisualStudio7Generator
{
fout << "\tProjectType=\"" << projectType << "\"\n";
}
+ this->WriteProjectSCC(fout, target);
fout<< "\tKeyword=\"" << keyword << "\">\n"
<< "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n"
<< "\t<Platforms>\n"
@@ -1813,9 +1861,6 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
{
keyword = "Win32Proj";
}
- const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME");
- const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH");
- const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER");
cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
fout << "\tName=\"" << projLabel << "\"\n";
@@ -1823,14 +1868,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
{
fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n";
}
- // if we have all the required Source code control tags
- // then add that to the project
- if(vsProvider && vsLocalpath && vsProjectname)
- {
- fout << "\tSccProjectName=\"" << vsProjectname << "\"\n"
- << "\tSccLocalPath=\"" << vsLocalpath << "\"\n"
- << "\tSccProvider=\"" << vsProvider << "\"\n";
- }
+ this->WriteProjectSCC(fout, target);
fout << "\tKeyword=\"" << keyword << "\">\n"
<< "\t<Platforms>\n"
<< "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 19f7b97..160e2d4 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -102,6 +102,7 @@ private:
cmTarget& t, bool debug);
void OutputLibraryDirectories(std::ostream& fout,
std::vector<std::string> const& dirs);
+ void WriteProjectSCC(std::ostream& fout, cmTarget& target);
void WriteProjectStart(std::ostream& fout, const char *libName,
cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
void WriteProjectStartFortran(std::ostream& fout, const char *libName,
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 497949a..774f32b 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -31,6 +31,7 @@ public:
// we must copy when we clone
newC->Args = this->Args;
newC->Functions = this->Functions;
+ newC->FilePath = this->FilePath;
newC->Policies = this->Policies;
return newC;
}
@@ -78,6 +79,7 @@ public:
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
cmPolicies::PolicyMap Policies;
+ std::string FilePath;
};
@@ -121,7 +123,10 @@ bool cmMacroHelperCommand::InvokeInitialPass
std::string argnDef;
bool argnDefInitialized = false;
bool argvDefInitialized = false;
-
+ if( this->Functions.size())
+ {
+ this->FilePath = this->Functions[0].FilePath;
+ }
// Invoke all the functions that were collected in the block.
cmListFileFunction newLFF;
// for each function
@@ -135,10 +140,13 @@ bool cmMacroHelperCommand::InvokeInitialPass
newLFF.Line = this->Functions[c].Line;
// for each argument of the current function
- for (std::vector<cmListFileArgument>::const_iterator k =
+ for (std::vector<cmListFileArgument>::iterator k =
this->Functions[c].Arguments.begin();
k != this->Functions[c].Arguments.end(); ++k)
{
+ // Set the FilePath on the arguments to match the function since it is
+ // not stored and the original values may be freed
+ k->FilePath = this->FilePath.c_str();
tmps = k->Value;
// replace formal arguments
for (unsigned int j = 1; j < this->Args.size(); ++j)
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index 3457da2..93e10b2 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -112,7 +112,6 @@ public:
"policies inside macros."
;
}
-
cmTypeMacro(cmMacroCommand, cmCommand);
};
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 53f4c3c..e14e44d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -22,6 +22,7 @@
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmCommandArgumentParserHelper.h"
+#include "cmDocumentCompileDefinitions.h"
#include "cmTest.h"
#ifdef CMAKE_BUILD_WITH_CMAKE
# include "cmVariableWatch.h"
@@ -43,12 +44,22 @@ class cmMakefile::Internals
{
public:
std::stack<cmDefinitions, std::list<cmDefinitions> > VarStack;
+ std::stack<std::set<cmStdString> > VarInitStack;
+ std::stack<std::set<cmStdString> > VarUsageStack;
};
// default is not to be building executables
cmMakefile::cmMakefile(): Internal(new Internals)
{
- this->Internal->VarStack.push(cmDefinitions());
+ const cmDefinitions& defs = cmDefinitions();
+ const std::set<cmStdString> globalKeys = defs.LocalKeys();
+ this->Internal->VarStack.push(defs);
+ this->Internal->VarInitStack.push(globalKeys);
+ this->Internal->VarUsageStack.push(globalKeys);
+
+ // Initialize these first since AddDefaultDefinitions calls AddDefinition
+ this->WarnUnused = false;
+ this->CheckSystemVars = false;
// Setup the default include file regular expression (match everything).
this->IncludeFileRegularExpression = "^.*$";
@@ -91,6 +102,8 @@ cmMakefile::cmMakefile(): Internal(new Internals)
cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
{
this->Internal->VarStack.push(mf.Internal->VarStack.top().Closure());
+ this->Internal->VarInitStack.push(mf.Internal->VarInitStack.top());
+ this->Internal->VarUsageStack.push(mf.Internal->VarUsageStack.top());
this->Prefix = mf.Prefix;
this->AuxSourceDirectories = mf.AuxSourceDirectories;
@@ -128,8 +141,10 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->SubDirectoryOrder = mf.SubDirectoryOrder;
this->Properties = mf.Properties;
this->PreOrder = mf.PreOrder;
- this->ListFileStack = mf.ListFileStack;
+ this->WarnUnused = mf.WarnUnused;
this->Initialize();
+ this->CheckSystemVars = mf.CheckSystemVars;
+ this->ListFileStack = mf.ListFileStack;
}
//----------------------------------------------------------------------------
@@ -570,6 +585,7 @@ bool cmMakefile::ReadListFile(const char* filename_in,
std::string currentFile
= this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename_in);
+ this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
const char* external = 0;
std::string external_abs;
@@ -610,8 +626,10 @@ bool cmMakefile::ReadListFile(const char* filename_in,
}
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread);
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
cmSystemTools::GetFilenamePath(filenametoread).c_str());
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
// try to see if the list file is the top most
// list file for a project, and if it is, then it
@@ -644,9 +662,12 @@ bool cmMakefile::ReadListFile(const char* filename_in,
*fullPath = "";
}
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+ this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
cmSystemTools::GetFilenamePath(currentFile).c_str());
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
return false;
}
// add this list file to the list of dependencies
@@ -686,13 +707,19 @@ bool cmMakefile::ReadListFile(const char* filename_in,
}
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
+ this->MarkVariableAsUsed("CMAKE_PARENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str());
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->AddDefinition("CMAKE_CURRENT_LIST_DIR",
cmSystemTools::GetFilenamePath(currentFile).c_str());
+ this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
// pop the listfile off the stack
this->ListFileStack.pop_back();
+ // Check for unused variables
+ this->CheckForUnusedVariables();
+
return true;
}
@@ -758,6 +785,8 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
this->AddSourceGroup("Resources", "\\.plist$");
#endif
+ this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
+ this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
}
bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
@@ -1626,6 +1655,13 @@ void cmMakefile::AddDefinition(const char* name, const char* value)
#endif
this->Internal->VarStack.top().Set(name, value);
+ if (this->Internal->VarUsageStack.size() &&
+ this->VariableInitialized(name))
+ {
+ this->CheckForUnused("changing definition", name);
+ this->Internal->VarUsageStack.top().erase(name);
+ }
+ this->Internal->VarInitStack.top().insert(name);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
@@ -1690,6 +1726,13 @@ void cmMakefile::AddCacheDefinition(const char* name, const char* value,
void cmMakefile::AddDefinition(const char* name, bool value)
{
this->Internal->VarStack.top().Set(name, value? "ON" : "OFF");
+ if (this->Internal->VarUsageStack.size() &&
+ this->VariableInitialized(name))
+ {
+ this->CheckForUnused("changing definition", name);
+ this->Internal->VarUsageStack.top().erase(name);
+ }
+ this->Internal->VarInitStack.top().insert(name);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
if ( vv )
@@ -1700,9 +1743,90 @@ void cmMakefile::AddDefinition(const char* name, bool value)
#endif
}
+void cmMakefile::CheckForUnusedVariables() const
+{
+ const cmDefinitions& defs = this->Internal->VarStack.top();
+ const std::set<cmStdString>& locals = defs.LocalKeys();
+ std::set<cmStdString>::const_iterator it = locals.begin();
+ for (; it != locals.end(); ++it)
+ {
+ this->CheckForUnused("out of scope", it->c_str());
+ }
+}
+
+void cmMakefile::MarkVariableAsUsed(const char* var)
+{
+ this->Internal->VarUsageStack.top().insert(var);
+}
+
+bool cmMakefile::VariableInitialized(const char* var) const
+{
+ if(this->Internal->VarInitStack.top().find(var) !=
+ this->Internal->VarInitStack.top().end())
+ {
+ return true;
+ }
+ return false;
+}
+
+bool cmMakefile::VariableUsed(const char* var) const
+{
+ if(this->Internal->VarUsageStack.top().find(var) !=
+ this->Internal->VarUsageStack.top().end())
+ {
+ return true;
+ }
+ return false;
+}
+
+void cmMakefile::CheckForUnused(const char* reason, const char* name) const
+{
+ if (this->WarnUnused && !this->VariableUsed(name))
+ {
+ cmStdString path;
+ cmListFileBacktrace bt;
+ if (this->CallStack.size())
+ {
+ const cmListFileContext* file = this->CallStack.back().Context;
+ bt.push_back(*file);
+ path = file->FilePath.c_str();
+ }
+ else
+ {
+ path = this->GetStartDirectory();
+ path += "/CMakeLists.txt";
+ cmListFileContext lfc;
+ lfc.FilePath = path;
+ lfc.Line = 0;
+ bt.push_back(lfc);
+ }
+ if (this->CheckSystemVars ||
+ cmSystemTools::IsSubDirectory(path.c_str(),
+ this->GetHomeDirectory()) ||
+ (cmSystemTools::IsSubDirectory(path.c_str(),
+ this->GetHomeOutputDirectory()) &&
+ !cmSystemTools::IsSubDirectory(path.c_str(),
+ cmake::GetCMakeFilesDirectory())))
+ {
+ cmOStringStream msg;
+ msg << "unused variable (" << reason << ") \'" << name << "\'";
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+ msg.str().c_str(),
+ bt);
+ }
+ }
+}
+
void cmMakefile::RemoveDefinition(const char* name)
{
this->Internal->VarStack.top().Set(name, 0);
+ if (this->Internal->VarUsageStack.size() &&
+ this->VariableInitialized(name))
+ {
+ this->CheckForUnused("unsetting", name);
+ this->Internal->VarUsageStack.top().erase(name);
+ }
+ this->Internal->VarInitStack.top().insert(name);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
if ( vv )
@@ -2054,6 +2178,7 @@ const char* cmMakefile::GetRequiredDefinition(const char* name) const
bool cmMakefile::IsDefinitionSet(const char* name) const
{
const char* def = this->Internal->VarStack.top().Get(name);
+ this->Internal->VarUsageStack.top().insert(name);
if(!def)
{
def = this->GetCacheManager()->GetCacheValue(name);
@@ -2081,6 +2206,10 @@ const char* cmMakefile::GetDefinition(const char* name) const
RecordPropertyAccess(name,cmProperty::VARIABLE);
}
#endif
+ if (this->WarnUnused)
+ {
+ this->Internal->VarUsageStack.top().insert(name);
+ }
const char* def = this->Internal->VarStack.top().Get(name);
if(!def)
{
@@ -2717,14 +2846,51 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
cm.SetStartOutputDirectory(bindir);
cm.SetCMakeCommand(cmakeCommand.c_str());
cm.LoadCache();
+ if(!gg->IsMultiConfig())
+ {
+ if(const char* config =
+ this->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"))
+ {
+ // Tell the single-configuration generator which one to use.
+ // Add this before the user-provided CMake arguments in case
+ // one of the arguments is -DCMAKE_BUILD_TYPE=...
+ cm.AddCacheEntry("CMAKE_BUILD_TYPE", config,
+ "Build configuration", cmCacheManager::STRING);
+ }
+ }
// if cmake args were provided then pass them in
if (cmakeArgs)
{
+ // FIXME: Workaround to ignore unused CLI variables in try-compile.
+ //
+ // Ideally we should use SetArgs to honor options like --warn-unused-vars.
+ // However, there is a subtle problem when certain arguments are passed to
+ // a macro wrapping around try_compile or try_run that does not escape
+ // semicolons in its parameters but just passes ${ARGV} or ${ARGN}. In
+ // this case a list argument like "-DVAR=a;b" gets split into multiple
+ // cmake arguments "-DVAR=a" and "b". Currently SetCacheArgs ignores
+ // argument "b" and uses just "-DVAR=a", leading to a subtle bug in that
+ // the try_compile or try_run does not get the proper value of VAR. If we
+ // call SetArgs here then it would treat "b" as the source directory and
+ // cause an error such as "The source directory .../CMakeFiles/CMakeTmp/b
+ // does not exist", thus breaking the try_compile or try_run completely.
+ //
+ // Strictly speaking the bug is in the wrapper macro because the CMake
+ // language has always flattened nested lists and the macro should escape
+ // the semicolons in its arguments before forwarding them. However, this
+ // bug is so subtle that projects typically work anyway, usually because
+ // the value VAR=a is sufficient for the try_compile or try_run to get the
+ // correct result. Calling SetArgs here would break such projects that
+ // previously built. Instead we work around the issue by never reporting
+ // unused arguments and ignoring options such as --warn-unused-vars.
+ cm.SetWarnUnusedCli(false);
+ //cm.SetArgs(*cmakeArgs, true);
+
cm.SetCacheArgs(*cmakeArgs);
}
// to save time we pass the EnableLanguage info directly
gg->EnableLanguagesFromGenerator
- (this->LocalGenerator->GetGlobalGenerator());
+ (this->LocalGenerator->GetGlobalGenerator(), this);
if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"))
{
cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS",
@@ -3403,12 +3569,48 @@ std::string cmMakefile::GetListFileStack()
void cmMakefile::PushScope()
{
cmDefinitions* parent = &this->Internal->VarStack.top();
+ const std::set<cmStdString>& init = this->Internal->VarInitStack.top();
+ const std::set<cmStdString>& usage = this->Internal->VarUsageStack.top();
this->Internal->VarStack.push(cmDefinitions(parent));
+ this->Internal->VarInitStack.push(init);
+ this->Internal->VarUsageStack.push(usage);
}
void cmMakefile::PopScope()
{
+ cmDefinitions* current = &this->Internal->VarStack.top();
+ std::set<cmStdString> init = this->Internal->VarInitStack.top();
+ std::set<cmStdString> usage = this->Internal->VarUsageStack.top();
+ const std::set<cmStdString>& locals = current->LocalKeys();
+ // Remove initialization and usage information for variables in the local
+ // scope.
+ std::set<cmStdString>::const_iterator it = locals.begin();
+ for (; it != locals.end(); ++it)
+ {
+ init.erase(*it);
+ if (!this->VariableUsed(it->c_str()))
+ {
+ this->CheckForUnused("out of scope", it->c_str());
+ }
+ else
+ {
+ usage.erase(*it);
+ }
+ }
this->Internal->VarStack.pop();
+ this->Internal->VarInitStack.pop();
+ this->Internal->VarUsageStack.pop();
+ // Push initialization and usage up to the parent scope.
+ it = init.begin();
+ for (; it != init.end(); ++it)
+ {
+ this->Internal->VarInitStack.top().insert(*it);
+ }
+ it = usage.begin();
+ for (; it != usage.end(); ++it)
+ {
+ this->Internal->VarUsageStack.top().insert(*it);
+ }
}
void cmMakefile::RaiseScope(const char *var, const char *varDef)
@@ -3433,7 +3635,14 @@ void cmMakefile::RaiseScope(const char *var, const char *varDef)
// directory's scope was initialized by the closure of the parent
// scope, so we do not need to localize the definition first.
cmMakefile* parent = plg->GetMakefile();
- parent->Internal->VarStack.top().Set(var, varDef);
+ if (varDef)
+ {
+ parent->AddDefinition(var, varDef);
+ }
+ else
+ {
+ parent->RemoveDefinition(var);
+ }
}
else
{
@@ -3492,14 +3701,7 @@ void cmMakefile::DefineProperties(cmake *cm)
"are not supported by the native build tool. "
"The VS6 IDE does not support definition values with spaces "
"(but NMake does).\n"
- "Dislaimer: 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 "
- "work-around the problem by adding escape sequences to the value. "
- "Your work-around may break in a future version of CMake that "
- "has improved escape support. Instead consider defining the macro "
- "in a (configured) header file. Then report the limitation.");
+ CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER);
cm->DefineProperty
("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::DIRECTORY,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 8b8a3f8..837a352 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -61,6 +61,14 @@ public:
unsigned int GetCacheMajorVersion();
unsigned int GetCacheMinorVersion();
+ /* Check for unused variables in this scope */
+ void CheckForUnusedVariables() const;
+ /* Mark a variable as used */
+ void MarkVariableAsUsed(const char* var);
+ /* return true if a variable has been initialized */
+ bool VariableInitialized(const char* ) const;
+ /* return true if a variable has been used */
+ bool VariableUsed(const char* ) const;
/** Return whether compatibility features needed for a version of
the cache or lower should be enabled. */
bool NeedCacheCompatibility(int major, int minor);
@@ -836,7 +844,10 @@ public:
protected:
// add link libraries and directories to the target
void AddGlobalLinkInformation(const char* name, cmTarget& target);
-
+
+ // Check for a an unused variable
+ void CheckForUnused(const char* reason, const char* name) const;
+
std::string Prefix;
std::vector<std::string> AuxSourceDirectories; //
@@ -929,6 +940,10 @@ private:
// should this makefile be processed before or after processing the parent
bool PreOrder;
+ // Unused variable flags
+ bool WarnUnused;
+ bool CheckSystemVars;
+
// stack of list files being read
std::deque<cmStdString> ListFileStack;
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 049a338..1e9a670 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -26,6 +26,12 @@ cmMakefileLibraryTargetGenerator
::cmMakefileLibraryTargetGenerator(cmTarget* target):
cmMakefileTargetGenerator(target)
{
+ if(this->Target->IsCFBundleOnApple())
+ {
+ target->SetProperty("PREFIX", "");
+ target->SetProperty("SUFFIX", "");
+ }
+
this->CustomCommandDriver = OnDepends;
this->Target->GetLibraryNames(
this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
@@ -41,6 +47,20 @@ cmMakefileLibraryTargetGenerator
this->MacContentDirectory += this->FrameworkVersion;
this->MacContentDirectory += "/";
}
+ else if(this->Target->IsCFBundleOnApple())
+ {
+ this->MacContentDirectory = this->Target->GetDirectory(this->ConfigName);
+ this->MacContentDirectory += "/";
+ this->MacContentDirectory += this->TargetNameOut;
+ this->MacContentDirectory += ".";
+ const char *ext = this->Target->GetProperty("BUNDLE_EXTENSION");
+ if (!ext)
+ {
+ ext = "bundle";
+ }
+ this->MacContentDirectory += ext;
+ this->MacContentDirectory += "/Contents/";
+ }
}
//----------------------------------------------------------------------------
@@ -301,6 +321,27 @@ cmMakefileLibraryTargetGenerator
}
//----------------------------------------------------------------------------
+void
+cmMakefileLibraryTargetGenerator::CreateCFBundle(std::string& targetName,
+ std::string& outpath)
+{
+ // Compute bundle directory names.
+ outpath = this->MacContentDirectory;
+ outpath += "MacOS";
+ cmSystemTools::MakeDirectory(outpath.c_str());
+ this->Makefile->AddCMakeOutputFile(outpath.c_str());
+ outpath += "/";
+
+ // Configure the Info.plist file. Note that it needs the executable name
+ // to be set.
+ std::string plist = this->MacContentDirectory + "Info.plist";
+ this->LocalGenerator->GenerateAppleInfoPList(this->Target,
+ targetName.c_str(),
+ plist.c_str());
+ this->Makefile->AddCMakeOutputFile(plist.c_str());
+}
+
+//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteLibraryRules
(const char* linkRuleVar, const char* extraFlags, bool relink)
{
@@ -354,6 +395,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
outpath = this->MacContentDirectory;
this->CreateFramework(targetName);
}
+ else if(this->Target->IsCFBundleOnApple())
+ {
+ outpath = this->Target->GetDirectory(this->ConfigName);
+ outpath += "/";
+ this->CreateCFBundle(targetName, outpath);
+ }
else if(relink)
{
outpath = this->Makefile->GetStartOutputDirectory();
@@ -417,6 +464,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
buildEcho += " shared library ";
break;
case cmTarget::MODULE_LIBRARY:
+ if (this->Target->IsCFBundleOnApple())
+ buildEcho += " CFBundle";
buildEcho += " shared module ";
break;
default:
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index 2f085ad..f3c47db 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -33,6 +33,7 @@ protected:
// MacOSX Framework support methods
void WriteFrameworkRules(bool relink);
void CreateFramework(std::string const& targetName);
+ void CreateCFBundle(std::string& targetName, std::string& outpath);
// Store the computd framework version for OS X Frameworks.
std::string FrameworkVersion;
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 26328cf..42d3f06 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -16,6 +16,7 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmake.h"
+#include "cmDocumentCompileDefinitions.h"
//----------------------------------------------------------------------------
cmSourceFile::cmSourceFile(cmMakefile* mf, const char* name):
@@ -187,8 +188,13 @@ bool cmSourceFile::FindFullPath(std::string* error)
}
cmOStringStream e;
- e << "Cannot find source file \"" << this->Location.GetName() << "\"";
- e << ". Tried extensions";
+ std::string missing = this->Location.GetDirectory();
+ if(!missing.empty())
+ {
+ missing += "/";
+ }
+ missing += this->Location.GetName();
+ e << "Cannot find source file:\n " << missing << "\nTried extensions";
for(std::vector<std::string>::const_iterator ext = srcExts.begin();
ext != srcExts.end(); ++ext)
{
@@ -411,15 +417,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"
- "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 "
- "work-around the problem by adding escape sequences to the value. "
- "Your work-around may break in a future version of CMake that "
- "has improved escape support. Instead consider defining the macro "
- "in a (configured) header file. Then report the limitation.");
-
+ CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER);
cm->DefineProperty
("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::SOURCE_FILE,
@@ -484,17 +482,21 @@ void cmSourceFile::DefineProperties(cmake *cm)
cm->DefineProperty
("MACOSX_PACKAGE_LOCATION", cmProperty::SOURCE_FILE,
- "Place a source file inside a Mac OS X bundle or framework.",
+ "Place a source file inside a Mac OS X bundle, CFBundle, or framework.",
"Executable targets with the MACOSX_BUNDLE property set are built "
"as Mac OS X application bundles on Apple platforms. "
"Shared library targets with the FRAMEWORK property set are built "
"as Mac OS X frameworks on Apple platforms. "
+ "Module library targets with the BUNDLE property set are built "
+ "as Mac OS X CFBundle bundles on Apple platforms. "
"Source files listed in the target with this property set will "
"be copied to a directory inside the bundle or framework content "
"folder specified by the property value. "
"For bundles the content folder is \"<name>.app/Contents\". "
"For frameworks the content folder is "
"\"<name>.framework/Versions/<version>\". "
+ "For cfbundles the content folder is "
+ "\"<name>.bundle/Contents\" (unless the extension is changed). "
"See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target "
"properties for specifying files meant for Headers, PrivateHeaders, "
"or Resources directories.");
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 2b4414d..949fcf5 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -482,6 +482,7 @@ void cmStringCommand::ClearMatches(cmMakefile* mf)
char name[128];
sprintf(name, "CMAKE_MATCH_%d", i);
mf->AddDefinition(name, "");
+ mf->MarkVariableAsUsed(name);
}
}
@@ -493,6 +494,7 @@ void cmStringCommand::StoreMatches(cmMakefile* mf,cmsys::RegularExpression& re)
char name[128];
sprintf(name, "CMAKE_MATCH_%d", i);
mf->AddDefinition(name, re.match(i).c_str());
+ mf->MarkVariableAsUsed(name);
}
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 52574e2..75ff712 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -16,6 +16,7 @@
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmComputeLinkInformation.h"
+#include "cmDocumentCompileDefinitions.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
#include <cmsys/RegularExpression.hxx>
@@ -146,14 +147,7 @@ void cmTarget::DefineProperties(cmake *cm)
"are not supported by the native build tool. "
"The VS6 IDE does not support definition values with spaces "
"(but NMake does).\n"
- "Dislaimer: 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 "
- "work-around the problem by adding escape sequences to the value. "
- "Your work-around may break in a future version of CMake that "
- "has improved escape support. Instead consider defining the macro "
- "in a (configured) header file. Then report the limitation.");
+ CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER);
cm->DefineProperty
("COMPILE_DEFINITIONS_<CONFIG>", cmProperty::TARGET,
@@ -194,6 +188,22 @@ void cmTarget::DefineProperties(cmake *cm)
"the target is built.");
cm->DefineProperty
+ ("BUNDLE", cmProperty::TARGET,
+ "This target is a CFBundle on the Mac.",
+ "If a module library target has this property set to true it will "
+ "be built as a CFBundle when built on the mac. It will have the "
+ "directory structure required for a CFBundle and will be suitable "
+ "to be used for creating Browser Plugins or other application "
+ "resources.");
+
+ cm->DefineProperty
+ ("BUNDLE_EXTENSION", cmProperty::TARGET,
+ "The file extension used to name a BUNDLE target on the Mac.",
+ "The default value is \"bundle\" - you can also use \"plugin\" or "
+ "whatever file extension is required by the host app for your "
+ "bundle.");
+
+ cm->DefineProperty
("FRAMEWORK", cmProperty::TARGET,
"This target is a framework on the Mac.",
"If a shared library target has this property set to true it will "
@@ -1217,6 +1227,14 @@ bool cmTarget::IsAppBundleOnApple()
}
//----------------------------------------------------------------------------
+bool cmTarget::IsCFBundleOnApple()
+{
+ return (this->GetType() == cmTarget::MODULE_LIBRARY &&
+ this->Makefile->IsOn("APPLE") &&
+ this->GetPropertyAsBool("BUNDLE"));
+}
+
+//----------------------------------------------------------------------------
class cmTargetTraceDependencies
{
public:
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index f2b7d61..b0e20ba 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -430,6 +430,9 @@ public:
Apple. */
bool IsFrameworkOnApple();
+ /** Return whether this target is a CFBundle (plugin) on Apple. */
+ bool IsCFBundleOnApple();
+
/** Return whether this target is an executable Bundle on Apple. */
bool IsAppBundleOnApple();
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 3a30e4c..0c67a8b 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -47,7 +47,7 @@ public:
*/
virtual const char* GetTerseDocumentation()
{
- return "Try compiling some code.";
+ return "Try building some code.";
}
/**
@@ -55,23 +55,28 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " try_compile(RESULT_VAR bindir srcdir\n"
- " projectName <targetname> [CMAKE_FLAGS <Flags>]\n"
- " [OUTPUT_VARIABLE var])\n"
- "Try compiling a program. In this form, srcdir should contain a "
- "complete CMake project with a CMakeLists.txt file and all sources. The "
- "bindir and srcdir will not be deleted after this command is run. "
- "If <target name> is specified then build just that target "
- "otherwise the all or ALL_BUILD target is built.\n"
- " try_compile(RESULT_VAR bindir srcfile\n"
- " [CMAKE_FLAGS <Flags>]\n"
- " [COMPILE_DEFINITIONS <flags> ...]\n"
- " [OUTPUT_VARIABLE var]\n"
- " [COPY_FILE <filename> )\n"
- "Try compiling a srcfile. In this case, the user need only supply a "
- "source file. CMake will create the appropriate CMakeLists.txt file "
- "to build the source. If COPY_FILE is used, the compiled file will be "
- "copied to the given file.\n"
+ " try_compile(RESULT_VAR <bindir> <srcdir>\n"
+ " <projectName> [targetName] [CMAKE_FLAGS flags...]\n"
+ " [OUTPUT_VARIABLE <var>])\n"
+ "Try building a project. In this form, srcdir should contain a "
+ "complete CMake project with a CMakeLists.txt file and all sources. "
+ "The bindir and srcdir will not be deleted after this command is run. "
+ "Specify targetName to build a specific target instead of the 'all' or "
+ "'ALL_BUILD' target."
+ "\n"
+ " try_compile(RESULT_VAR <bindir> <srcfile>\n"
+ " [CMAKE_FLAGS flags...]\n"
+ " [COMPILE_DEFINITIONS flags...]\n"
+ " [OUTPUT_VARIABLE <var>]\n"
+ " [COPY_FILE <fileName>])\n"
+ "Try building a source file into an executable. "
+ "In this form the user need only supply a source file that defines "
+ "a 'main'. "
+ "CMake will create a CMakeLists.txt file to build the source "
+ "as an executable. "
+ "Specify COPY_FILE to get a copy of the linked executable at the "
+ "given fileName."
+ "\n"
"In this version all files in bindir/CMakeFiles/CMakeTmp, "
"will be cleaned automatically, for debugging a --debug-trycompile can "
"be passed to cmake to avoid the clean. Some extra flags that "
@@ -94,7 +99,9 @@ public:
"Return the success or failure in "
"RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags "
"to the cmake that is run during the build. "
- "";
+ "Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build "
+ "configuration."
+ ;
}
cmTypeMacro(cmTryCompileCommand, cmCoreTryCompile);
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index ca48e90..f86d863 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -93,7 +93,10 @@ public:
"that when crosscompiling, the cache variables will have to be set "
"manually to the output of the executable. You can also \"guard\" the "
"calls to try_run with if(CMAKE_CROSSCOMPILING) and provide an "
- "easy-to-preset alternative for this case.\n";
+ "easy-to-preset alternative for this case.\n"
+ "Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build "
+ "configuration."
+ ;
}
cmTypeMacro(cmTryRunCommand, cmCoreTryCompile);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ab282b0..4cb745e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -597,7 +597,11 @@ WriteGroupSources(const char* name,
for(std::vector<cmSourceFile*>::const_iterator s = sources.begin();
s != sources.end(); ++s)
{
- cmSourceFile* sf = *s;
+ cmSourceFile* sf = *s;
+ if(sf->GetExtension() == "obj")
+ {
+ continue;
+ }
std::string const& source = sf->GetFullPath();
cmSourceGroup& sourceGroup =
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
@@ -666,55 +670,60 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
- // if it is not a custom command then add it as a c/c++ file,
- // TODO: need to check for idl or rc
- if(!(*source)->GetCustomCommand())
+ std::string ext = (*source)->GetExtension();
+ if((*source)->GetCustomCommand() || ext == "obj")
{
- bool header = (*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
- || this->GlobalGenerator->IgnoreFile
- ((*source)->GetExtension().c_str());
- const char* lang = (*source)->GetLanguage();
- bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0);
- bool rc = lang && (strcmp(lang, "RC") == 0);
- bool idl = (*source)->GetExtension() == "idl";
- std::string sourceFile = (*source)->GetFullPath();
- sourceFile = cmSystemTools::RelativePath(
- this->Makefile->GetCurrentOutputDirectory(),
- sourceFile.c_str());
- this->ConvertToWindowsSlash(sourceFile);
- // output the source file
- if(header)
- {
- this->WriteString("<ClInclude Include=\"", 2);
- }
- else if(cl)
- {
- this->WriteString("<ClCompile Include=\"", 2);
- }
- else if(rc)
- {
- this->WriteString("<ResourceCompile Include=\"", 2);
- }
- else if(idl)
- {
- this->WriteString("<Midl Include=\"", 2);
- }
- else
- {
- this->WriteString("<None Include=\"", 2);
- }
- (*this->BuildFileStream ) << sourceFile << "\"";
- // ouput any flags specific to this source file
- if(!header && cl && this->OutputSourceSpecificFlags(*source))
- {
- // if the source file has specific flags the tag
- // is ended on a new line
- this->WriteString("</ClCompile>\n", 2);
- }
- else
- {
- (*this->BuildFileStream ) << " />\n";
- }
+ continue;
+ }
+ // If it is not a custom command and it is not a pre-built obj file,
+ // then add it as a source (c/c++/header/rc/idl) file
+ bool header = (*source)->GetPropertyAsBool("HEADER_FILE_ONLY")
+ || this->GlobalGenerator->IgnoreFile(ext.c_str());
+ const char* lang = (*source)->GetLanguage();
+ bool cl = lang && (strcmp(lang, "C") == 0 || strcmp(lang, "CXX") ==0);
+ bool rc = lang && (strcmp(lang, "RC") == 0);
+ bool idl = ext == "idl";
+ std::string sourceFile = (*source)->GetFullPath();
+ sourceFile = cmSystemTools::RelativePath(
+ this->Makefile->GetCurrentOutputDirectory(),
+ sourceFile.c_str());
+ this->ConvertToWindowsSlash(sourceFile);
+ // output the source file
+ if(header)
+ {
+ this->WriteString("<ClInclude Include=\"", 2);
+ }
+ else if(cl)
+ {
+ this->WriteString("<ClCompile Include=\"", 2);
+ }
+ else if(rc)
+ {
+ this->WriteString("<ResourceCompile Include=\"", 2);
+ }
+ else if(idl)
+ {
+ this->WriteString("<Midl Include=\"", 2);
+ }
+ else
+ {
+ this->WriteString("<None Include=\"", 2);
+ }
+ (*this->BuildFileStream ) << sourceFile << "\"";
+ // ouput any flags specific to this source file
+ if(!header && cl && this->OutputSourceSpecificFlags(*source))
+ {
+ // if the source file has specific flags the tag
+ // is ended on a new line
+ this->WriteString("</ClCompile>\n", 2);
+ }
+ else if(!header && rc && this->OutputSourceSpecificFlags(*source))
+ {
+ this->WriteString("</ResourceCompile>\n", 2);
+ }
+ else
+ {
+ (*this->BuildFileStream ) << " />\n";
}
}
this->WriteString("</ItemGroup>\n", 1);
@@ -848,8 +857,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream,
- " ", "\n");
-
+ " ", "\n", lang);
}
}
return hasFlags;
@@ -1115,7 +1123,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n");
+ "\n", "CXX");
this->WriteString("<AssemblerListingLocation>", 3);
*this->BuildFileStream << configName
<< "</AssemblerListingLocation>\n";
@@ -1150,7 +1158,7 @@ WriteRCOptions(std::string const& configName,
this->WriteString("<ResourceCompile>\n", 2);
Options& clOptions = *(this->ClOptions[configName]);
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n");
+ "\n", "RC");
this->OutputIncludes(includes);
this->WriteString("</ResourceCompile>\n", 2);
}
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 9acae0d..ed0d60c 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -204,7 +204,8 @@ void
cmVisualStudioGeneratorOptions
::OutputPreprocessorDefinitions(std::ostream& fout,
const char* prefix,
- const char* suffix)
+ const char* suffix,
+ const char* lang)
{
if(this->Defines.empty())
{
@@ -251,6 +252,11 @@ cmVisualStudioGeneratorOptions
if(this->Version == 10)
{
define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str());
+
+ if(0 == strcmp(lang, "RC"))
+ {
+ cmSystemTools::ReplaceString(define, "\"", "\\\"");
+ }
}
else
{
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 8619ba0..fadc4b5 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -54,7 +54,8 @@ public:
// Write options to output.
void OutputPreprocessorDefinitions(std::ostream& fout,
const char* prefix,
- const char* suffix);
+ const char* suffix,
+ const char* lang);
void OutputFlagMap(std::ostream& fout, const char* indent);
void OutputAdditionalOptions(std::ostream& fout,
const char* prefix,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index bc3245e..0c03b65 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -138,9 +138,20 @@ void cmNeedBackwardsCompatibility(const std::string& variable,
#endif
}
+void cmWarnUnusedCliWarning(const std::string& variable,
+ int, void* ctx, const char*, const cmMakefile*)
+{
+ cmake* cm = reinterpret_cast<cmake*>(ctx);
+ cm->MarkCliAsUsed(variable);
+}
+
cmake::cmake()
{
this->Trace = false;
+ this->WarnUninitialized = false;
+ this->WarnUnused = false;
+ this->WarnUnusedCli = true;
+ this->CheckSystemVars = false;
this->SuppressDevWarnings = false;
this->DoSuppressDevWarnings = false;
this->DebugOutput = false;
@@ -367,6 +378,10 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
{
this->CacheManager->AddCacheEntry(var.c_str(), value.c_str(),
"No help, variable specified on the command line.", type);
+ if(this->WarnUnusedCli)
+ {
+ this->WatchUnusedCli(var.c_str());
+ }
}
else
{
@@ -509,9 +524,10 @@ void cmake::ReadListFile(const char *path)
}
// Parse the args
-void cmake::SetArgs(const std::vector<std::string>& args)
+void cmake::SetArgs(const std::vector<std::string>& args,
+ bool directoriesSetBefore)
{
- bool directoriesSet = false;
+ bool directoriesSet = directoriesSetBefore;
for(unsigned int i=1; i < args.size(); ++i)
{
std::string arg = args[i];
@@ -613,6 +629,28 @@ void cmake::SetArgs(const std::vector<std::string>& args)
std::cout << "Running with trace output on.\n";
this->SetTrace(true);
}
+ else if(arg.find("--warn-uninitialized",0) == 0)
+ {
+ std::cout << "Warn about uninitialized values.\n";
+ this->SetWarnUninitialized(true);
+ }
+ else if(arg.find("--warn-unused-vars",0) == 0)
+ {
+ std::cout << "Finding unused variables.\n";
+ this->SetWarnUnused(true);
+ }
+ else if(arg.find("--no-warn-unused-cli",0) == 0)
+ {
+ std::cout << "Not searching for unused variables given on the " <<
+ "command line.\n";
+ this->SetWarnUnusedCli(false);
+ }
+ else if(arg.find("--check-system-vars",0) == 0)
+ {
+ std::cout << "Also check system files when warning about unused and " <<
+ "uninitialized variables.\n";
+ this->SetCheckSystemVars(true);
+ }
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
@@ -941,37 +979,39 @@ void CMakeCommandUsage(const char* program)
errorStream
<< "Usage: " << program << " -E [command] [arguments ...]\n"
<< "Available commands: \n"
+ << " build build_dir - build the project in build_dir.\n"
<< " chdir dir cmd [args]... - run command in a given directory\n"
- << " rename oldname newname - rename a file or directory "
- "(on one volume)\n"
+ << " compare_files file1 file2 - check if file1 is same as file2\n"
<< " copy file destination - copy file to destination (either file "
"or directory)\n"
- << " copy_if_different in-file out-file - copy file if input has "
- "changed\n"
<< " copy_directory source destination - copy directory 'source' "
"content to directory 'destination'\n"
- << " compare_files file1 file2 - check if file1 is same as file2\n"
+ << " copy_if_different in-file out-file - copy file if input has "
+ "changed\n"
<< " echo [string]... - displays arguments as text\n"
<< " echo_append [string]... - displays arguments as text but no new "
"line\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"
<< " remove [-f] file1 file2 ... - remove the file(s), use -f to force "
"it\n"
+ << " remove_directory dir - remove a directory and its contents\n"
+ << " rename oldname newname - rename a file or directory "
+ "(on one volume)\n"
<< " tar [cxt][vfz][cvfj] file.tar "
"file/dir1 file/dir2 ... - create a tar "
"archive\n"
<< " time command [args] ... - run command and return elapsed time\n"
<< " touch file - touch a file.\n"
<< " touch_nocreate file - touch a file but do not create it.\n"
- << " build build_dir - build the project in build_dir.\n"
#if defined(_WIN32) && !defined(__CYGWIN__)
- << " write_regv key value - write registry value\n"
- << " delete_regv key - delete registry value\n"
+ << "Available on Windows only:\n"
<< " comspec - on windows 9x use this for RunCommand\n"
+ << " delete_regv key - delete registry value\n"
+ << " write_regv key value - write registry value\n"
#else
+ << "Available on UNIX only:\n"
<< " create_symlink old new - create a symbolic link new -> old\n"
#endif
;
@@ -2296,6 +2336,11 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
std::string oldstartoutputdir = this->GetStartOutputDirectory();
this->SetStartDirectory(this->GetHomeDirectory());
this->SetStartOutputDirectory(this->GetHomeOutputDirectory());
+ const bool warncli = this->WarnUnusedCli;
+ if (!this->ScriptMode)
+ {
+ this->WarnUnusedCli = false;
+ }
int ret = this->Configure();
if (ret || this->ScriptMode)
{
@@ -2317,6 +2362,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
#endif
return ret;
}
+ this->WarnUnusedCli = warncli;
ret = this->Generate();
std::string message = "Build files have been written to: ";
message += this->GetHomeOutputDirectory();
@@ -2859,6 +2905,10 @@ const char* cmake::GetCPackCommand()
return this->CPackCommand.c_str();
}
+void cmake::MarkCliAsUsed(const std::string& variable)
+{
+ this->UsedCliVariables[variable] = true;
+}
void cmake::GenerateGraphViz(const char* fileName) const
{
@@ -4279,3 +4329,40 @@ int cmake::Build(const std::string& dir,
config.c_str(), clean, false, 0, true,
0, nativeOptions);
}
+
+void cmake::WatchUnusedCli(const char* var)
+{
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
+ this->UsedCliVariables[var] = false;
+#endif
+}
+
+void cmake::UnwatchUnusedCli(const char* var)
+{
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ this->VariableWatch->RemoveWatch(var, cmWarnUnusedCliWarning);
+ this->UsedCliVariables[var] = true;
+#endif
+}
+
+void cmake::RunCheckForUnusedVariables(const std::string& reason) const
+{
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ if(this->WarnUnusedCli)
+ {
+ std::map<std::string, bool>::const_iterator it;
+ for(it = this->UsedCliVariables.begin();
+ it != this->UsedCliVariables.end(); ++it)
+ {
+ if(!it->second)
+ {
+ std::string message = "CMake Warning: The variable, '" + it->first +
+ "', specified manually, was not used during the " + reason +
+ ".";
+ cmSystemTools::Message(message.c_str());
+ }
+ }
+ }
+#endif
+}
diff --git a/Source/cmake.h b/Source/cmake.h
index 6744ca1..70fcaa8 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -214,7 +214,8 @@ class cmake
bool CommandExists(const char* name) const;
///! Parse command line arguments
- void SetArgs(const std::vector<std::string>&);
+ void SetArgs(const std::vector<std::string>&,
+ bool directoriesSetBefore = false);
///! Is this cmake running as a result of a TRY_COMPILE command
bool GetIsInTryCompile() { return this->InTryCompile; }
@@ -308,6 +309,17 @@ class cmake
// Do we want trace output during the cmake run.
bool GetTrace() { return this->Trace;}
void SetTrace(bool b) { this->Trace = b;}
+ bool GetWarnUninitialized() { return this->WarnUninitialized;}
+ void SetWarnUninitialized(bool b) { this->WarnUninitialized = b;}
+ bool GetWarnUnused() { return this->WarnUnused;}
+ void SetWarnUnused(bool b) { this->WarnUnused = b;}
+ bool GetWarnUnusedCli() { return this->WarnUnusedCli;}
+ void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b;}
+ bool GetCheckSystemVars() { return this->CheckSystemVars;}
+ void SetCheckSystemVars(bool b) { this->CheckSystemVars = b;}
+
+ void MarkCliAsUsed(const std::string& variable);
+
// Define a property
void DefineProperty(const char *name, cmProperty::ScopeType scope,
const char *ShortDescription,
@@ -353,6 +365,10 @@ class cmake
const std::string& config,
const std::vector<std::string>& nativeOptions,
bool clean);
+
+ void UnwatchUnusedCli(const char* var);
+ void WatchUnusedCli(const char* var);
+ void RunCheckForUnusedVariables(const std::string& reason) const;
protected:
void InitializeProperties();
int HandleDeleteCacheVariables(const char* var);
@@ -447,6 +463,11 @@ private:
bool ScriptMode;
bool DebugOutput;
bool Trace;
+ bool WarnUninitialized;
+ bool WarnUnused;
+ bool WarnUnusedCli;
+ bool CheckSystemVars;
+ std::map<std::string, bool> UsedCliVariables;
std::string CMakeEditCommand;
std::string CMakeCommand;
std::string CXXEnvironment;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index ddff71d..a5dca18 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -71,11 +71,13 @@ static const char * cmDocumentationOptions[][3] =
{"-E", "CMake command mode.",
"For true platform independence, CMake provides a list of commands "
"that can be used on all systems. Run with -E help for the usage "
- "information. Commands available are: chdir, copy, copy_if_different "
- "copy_directory, compare_files, echo, echo_append, environment, "
- "make_directory, md5sum, remove_directory, remove, tar, time, "
- "touch, touch_nocreate, write_regv, delete_regv, comspec, "
- "create_symlink."},
+ "information. Commands available are: build, chdir, compare_files, copy, "
+ "copy_directory, copy_if_different, echo, echo_append, environment, "
+ "make_directory, md5sum, remove, remove_directory, rename, tar, time, "
+ "touch, touch_nocreate. In addition, some platform specific commands "
+ "are available. "
+ "On Windows: comspec, delete_regv, write_regv. "
+ "On UNIX: create_symlink."},
{"-i", "Run in wizard mode.",
"Wizard mode runs cmake interactively without a GUI. The user is "
"prompted to answer questions about the project configuration. "
@@ -120,6 +122,17 @@ static const char * cmDocumentationOptions[][3] =
{"--trace", "Put cmake in trace mode.",
"Print a trace of all calls made and from where with "
"message(send_error ) calls."},
+ {"--warn-uninitialized", "Warn about uninitialized values.",
+ "Print a warning when an uninitialized variable is used."},
+ {"--warn-unused-vars", "Warn about unused variables.",
+ "Find variables that are declared or set, but not used."},
+ {"--no-warn-unused-cli", "Don't warn about command line options.",
+ "Don't find variables that are declared on the command line, but not "
+ "used."},
+ {"--check-system-vars", "Find problems with variable usage in system "
+ "files.", "Normally, unused and uninitialized variables are searched for "
+ "only in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to "
+ "warn about other files as well."},
{"--help-command cmd [file]", "Print help for a single command and exit.",
"Full documentation specific to the given command is displayed. "
"If a file is specified, the documentation is written into and the output "
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index 4bc8769..8d4ad8b 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 01)
+SET(KWSYS_DATE_STAMP_MONTH 02)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 11)
+SET(KWSYS_DATE_STAMP_DAY 22)
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt
new file mode 100644
index 0000000..a24636f
--- /dev/null
+++ b/Tests/ArgumentExpansion/CMakeLists.txt
@@ -0,0 +1,60 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(ArgumentExpansion)
+
+function (argument_tester expected expected_len)
+ list(LENGTH ARGN argn_len)
+ list(LENGTH ${expected} expected_received_len)
+
+ if (NOT ${expected_received_len} EQUAL ${expected_len})
+ message(STATUS "Unexpected: Expanding expected values isn't working")
+ endif (NOT ${expected_received_len} EQUAL ${expected_len})
+
+ if (${argn_len} EQUAL ${expected_len})
+ set(i 0)
+ while (i LESS ${argn_len})
+ list(GET ARGN ${i} argn_value)
+ list(GET ${expected} ${i} expected_value)
+
+ if (NOT "${argn_value}" STREQUAL "${expected_value}")
+ message(STATUS "Unexpected: Argument ${i} doesn't match")
+ message(STATUS " Expected: ${expected_value}")
+ message(STATUS " Received: ${argn_value}")
+ endif ()
+
+ math(EXPR i "${i} + 1")
+ endwhile (i LESS ${argn_len})
+ else (${argn_len} EQUAL ${expected_len})
+ message(STATUS "Unexpected: Lengths of arguments don't match")
+ message(STATUS " Expected: ${expected_len}")
+ message(STATUS " Received: ${argn_len}")
+ endif (${argn_len} EQUAL ${expected_len})
+endfunction (argument_tester expected)
+
+set(empty_test)
+message(STATUS "Test: Empty arguments")
+argument_tester(empty_test 0 ${empty_test})
+
+set(single_arg_test
+ "single arg")
+message(STATUS "Test: Single argument")
+argument_tester(single_arg_test 1 ${single_arg_test})
+
+set(multiple_arg_test
+ "first arg"
+ "second arg")
+message(STATUS "Test: Multiple arguments")
+argument_tester(multiple_arg_test 2 ${multiple_arg_test})
+
+set(nested_list_arg_test
+ "${multiple_arg_test}"
+ "first arg"
+ "second arg")
+message(STATUS "Test: Nested list argument flattens")
+argument_tester(nested_list_arg_test 4 ${nested_list_arg_test})
+
+set(semicolon_arg_test
+ "pre\;post")
+set(semicolon_arg_test_flat "pre;post")
+message(STATUS "Test: Semicolon argument flattens")
+argument_tester(semicolon_arg_test_flat 2 ${semicolon_arg_test})
diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx
index bab745e..b68ee25 100644
--- a/Tests/BundleTest/BundleLib.cxx
+++ b/Tests/BundleTest/BundleLib.cxx
@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
int fileExists(char* filename)
{
@@ -51,7 +51,7 @@ int findBundleFile(char* exec, const char* file)
int foo(char *exec)
{
- // Call a "Carbon" function...
+ // Call a CoreFoundation function...
//
CFBundleRef br = CFBundleGetMainBundle();
(void) br;
diff --git a/Tests/BundleTest/BundleTest.cxx b/Tests/BundleTest/BundleTest.cxx
index 29d17db..a66d601 100644
--- a/Tests/BundleTest/BundleTest.cxx
+++ b/Tests/BundleTest/BundleTest.cxx
@@ -1,6 +1,6 @@
#include <stdio.h>
-#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
extern int foo(char* exec);
@@ -8,8 +8,8 @@ int main(int argc, char* argv[])
{
printf("Started with: %d arguments\n", argc);
- // Call a "Carbon" function... but pull in the link dependency on "-framework
- // Carbon" via CMake's dependency chaining mechanism. This code exists to
+ // Call a CoreFoundation function... but pull in the link dependency on "-framework
+ // CoreFoundation" via CMake's dependency chaining mechanism. This code exists to
// verify that the chaining mechanism works with "-framework blah" style
// link dependencies.
//
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 5ccf2bf..5342f49 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -25,14 +25,14 @@ SET_SOURCE_FILES_PROPERTIES(
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
# Test building a bundle linking to a shared library where the
-# shared library links to Carbon, but the executable does not
-# explicitly link to Carbon, but the executable does *depend*
-# on Carbon. There should be a link failure for the executable
+# shared library links to CoreFoundation, but the executable does not
+# explicitly link to CoreFoundation, but the executable does *depend*
+# on CoreFoundation. There should be a link failure for the executable
# if CMake's dependency chaining for libraries with "-framework
# blah" style dependencies gets broken...
#
ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx)
-TARGET_LINK_LIBRARIES(BundleTestLib "-framework Carbon")
+TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation")
ADD_EXECUTABLE(BundleTest
MACOSX_BUNDLE
@@ -43,8 +43,8 @@ ADD_EXECUTABLE(BundleTest
)
TARGET_LINK_LIBRARIES(BundleTest BundleTestLib)
#
-# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework Carbon")
-# (see above comments about Carbon)
+# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation")
+# (see above comments about CoreFoundation)
#
# Test bundle installation.
diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt
new file mode 100644
index 0000000..8fd9efd
--- /dev/null
+++ b/Tests/CFBundleTest/CMakeLists.txt
@@ -0,0 +1,56 @@
+#this is adapted from FireBreath (http://www.firebreath.org)
+
+cmake_minimum_required(VERSION 2.8)
+
+project(CFBundleTest)
+
+include(PluginConfig.cmake)
+
+message ("Creating Mac Browser Plugin project ${PROJECT_NAME}")
+set(SOURCES
+ np_macmain.cpp
+ Localized.r
+ ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
+ ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
+ ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
+)
+
+add_library( ${PROJECT_NAME} MODULE
+ ${SOURCES}
+ )
+
+set (RCFILES ${CMAKE_CURRENT_SOURCE_DIR}/Localized.r)
+
+configure_file(Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
+configure_file(InfoPlist.strings.in ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings)
+
+# Compile the resource file
+find_program(RC_COMPILER Rez NO_DEFAULT_PATHS PATHS /Developer/Tools)
+if(NOT RC_COMPILER)
+ message(FATAL_ERROR "could not find Rez to build resources from .r file...")
+endif()
+
+execute_process(COMMAND
+ ${RC_COMPILER} ${RCFILES} -useDF -o ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
+ )
+
+set_source_files_properties(
+ ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
+ PROPERTIES GENERATED 1
+ )
+# note that for some reason, the makefile and xcode generators use a different
+# property to indicate where the Info.plist file is :-/ For that reason, we
+# specify it twice so it will work both places
+set_target_properties(CFBundleTest PROPERTIES
+ BUNDLE 1
+ BUNDLE_EXTENSION plugin
+ XCODE_ATTRIBUTE_WRAPPER_EXTENSION plugin #sets the extension to .plugin
+ XCODE_ATTRIBUTE_MACH_O_TYPE mh_bundle
+ XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
+ MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
+ LINK_FLAGS "-Wl,-exported_symbols_list,\"${CMAKE_CURRENT_SOURCE_DIR}/ExportList_plugin.txt\"")
+
+set_source_files_properties(
+ ${CMAKE_CURRENT_BINARY_DIR}/InfoPlist.strings
+ ${CMAKE_CURRENT_BINARY_DIR}/Localized.rsrc
+ PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/English.lproj")
diff --git a/Tests/CFBundleTest/ExportList_plugin.txt b/Tests/CFBundleTest/ExportList_plugin.txt
new file mode 100644
index 0000000..31d6f64
--- /dev/null
+++ b/Tests/CFBundleTest/ExportList_plugin.txt
@@ -0,0 +1,3 @@
+_NP_GetEntryPoints
+_NP_Initialize
+_NP_Shutdown
diff --git a/Tests/CFBundleTest/Info.plist.in b/Tests/CFBundleTest/Info.plist.in
new file mode 100644
index 0000000..638002f
--- /dev/null
+++ b/Tests/CFBundleTest/Info.plist.in
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${PLUGIN_NAME}</string>
+ <key>CFBundleGetInfoString</key>
+ <string>${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}, ${FBSTRING_LegalCopyright}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.${ACTIVEX_PROGID}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BRPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${PLUGIN_NAME} ${FBSTRING_PLUGIN_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>${FBSTRING_PLUGIN_VERSION}</string>
+ <key>CFPlugInDynamicRegisterFunction</key>
+ <string></string>
+ <key>CFPlugInDynamicRegistration</key>
+ <string>NO</string>
+ <key>CFPlugInFactories</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <string>MyFactoryFunction</string>
+ </dict>
+ <key>CFPlugInTypes</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <array>
+ <string>00000000-0000-0000-0000-000000000000</string>
+ </array>
+ </dict>
+ <key>CFPlugInUnloadFunction</key>
+ <string></string>
+ <key>WebPluginName</key>
+ <string>${FBSTRING_ProductName}</string>
+ <key>WebPluginDescription</key>
+ <string>${FBSTRING_FileDescription}</string>
+ <key>WebPluginMIMETypes</key>
+ <dict>
+ <key>${FBSTRING_MIMEType}</key>
+ <dict>
+ <key>WebPluginTypeDescription</key>
+ <string>${FBSTRING_FileDescription}</string>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/Tests/CFBundleTest/InfoPlist.strings.in b/Tests/CFBundleTest/InfoPlist.strings.in
new file mode 100644
index 0000000..790ead0
--- /dev/null
+++ b/Tests/CFBundleTest/InfoPlist.strings.in
@@ -0,0 +1,4 @@
+/* Localized versions of Info.plist keys */
+
+CFBundleName = "${PLUGIN_NAME}.plugin";
+NSHumanReadableCopyright = "${FBSTRING_LegalCopyright}";
diff --git a/Tests/CFBundleTest/Localized.r b/Tests/CFBundleTest/Localized.r
new file mode 100644
index 0000000..e988e26
--- /dev/null
+++ b/Tests/CFBundleTest/Localized.r
@@ -0,0 +1,18 @@
+#include <CoreServices/CoreServices.r>
+
+resource 'STR#' (126)
+{ {
+ "${FBSTRING_LegalCopyright}",
+ "${FBSTRING_ProductName}"
+} };
+
+resource 'STR#' (127)
+{ {
+ "${FBSTRING_FileDescription}"
+} };
+
+resource 'STR#' (128)
+{ {
+ "${FBSTRING_MIMEType}",
+ "${FBSTRING_FileExtents}"
+} };
diff --git a/Tests/CFBundleTest/Localized.rsrc b/Tests/CFBundleTest/Localized.rsrc
new file mode 100644
index 0000000..cbf3523
--- /dev/null
+++ b/Tests/CFBundleTest/Localized.rsrc
Binary files differ
diff --git a/Tests/CFBundleTest/PluginConfig.cmake b/Tests/CFBundleTest/PluginConfig.cmake
new file mode 100644
index 0000000..763ddcc
--- /dev/null
+++ b/Tests/CFBundleTest/PluginConfig.cmake
@@ -0,0 +1,21 @@
+#/**********************************************************\
+# Auto-Generated Plugin Configuration file
+# for CFTestPlugin
+#\**********************************************************/
+
+set(PLUGIN_NAME "CFTestPlugin")
+set(PLUGIN_PREFIX "CFTP")
+set(COMPANY_NAME "FBDevTeam")
+
+set(MOZILLA_PLUGINID "@firebreath.googlecode.com/CFTestPlugin")
+
+# strings
+set(FBSTRING_CompanyName "Firebreath Dev Team")
+set(FBSTRING_FileDescription "CFBundle Test Plugin - Plugin for testing cmake patch to improve FireBreath project generation")
+set(FBSTRING_PLUGIN_VERSION "1.0.0")
+set(FBSTRING_LegalCopyright "Copyright 2010 Firebreath Dev Team")
+set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll")
+set(FBSTRING_ProductName "CFTestPlugin")
+set(FBSTRING_FileExtents "")
+set(FBSTRING_PluginName "CFTestPlugin")
+set(FBSTRING_MIMEType "application/x-fbtestplugin")
diff --git a/Tests/CFBundleTest/README.txt b/Tests/CFBundleTest/README.txt
new file mode 100644
index 0000000..248651b
--- /dev/null
+++ b/Tests/CFBundleTest/README.txt
@@ -0,0 +1,16 @@
+
+CFBundle test project. The generated .plugin/ bundle from either makefiles or XCode should look like this:
+
+./Contents
+./Contents/Info.plist
+./Contents/MacOS
+./Contents/MacOS/CFBundleTest
+./Contents/Resources
+./Contents/Resources/English.lproj
+./Contents/Resources/English.lproj/InfoPlist.strings
+./Contents/Resources/English.lproj/Localized.rsrc
+
+file Contents/MacOS/CFBundleTest should return something like:
+Contents/MacOS/CFBundleTest: Mach-O 64-bit bundle x86_64
+
+It is okay if it is a 32 bit binary; if it is not Mach-O, or is spelled differently, it is not okay.
diff --git a/Tests/CFBundleTest/VerifyResult.cmake b/Tests/CFBundleTest/VerifyResult.cmake
new file mode 100644
index 0000000..e622900
--- /dev/null
+++ b/Tests/CFBundleTest/VerifyResult.cmake
@@ -0,0 +1,32 @@
+if(NOT DEFINED CTEST_CONFIGURATION_TYPE)
+ message(FATAL_ERROR "expected variable CTEST_CONFIGURATION_TYPE not defined")
+endif()
+
+if(NOT DEFINED dir)
+ message(FATAL_ERROR "expected variable dir not defined")
+endif()
+
+if(NOT DEFINED gen)
+ message(FATAL_ERROR "expected variable gen not defined")
+endif()
+
+message(STATUS "CTEST_CONFIGURATION_TYPE='${CTEST_CONFIGURATION_TYPE}'")
+message(STATUS "dir='${dir}'")
+message(STATUS "gen='${gen}'")
+
+if(gen MATCHES "Make" OR
+ "${CTEST_CONFIGURATION_TYPE}" STREQUAL "" OR
+ "${CTEST_CONFIGURATION_TYPE}" STREQUAL "." OR
+ "${CTEST_CONFIGURATION_TYPE}" STREQUAL "NoConfig")
+ set(expected_filename "${dir}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest")
+else()
+ set(expected_filename "${dir}/${CTEST_CONFIGURATION_TYPE}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest")
+endif()
+
+if(NOT EXISTS "${expected_filename}")
+ message(FATAL_ERROR "test fails: expected output file does not exist [${expected_filename}]")
+endif()
+
+file(COPY "${expected_filename}"
+ DESTINATION "${dir}/LatestBuildResult"
+ )
diff --git a/Tests/CFBundleTest/np_macmain.cpp b/Tests/CFBundleTest/np_macmain.cpp
new file mode 100644
index 0000000..78004d0
--- /dev/null
+++ b/Tests/CFBundleTest/np_macmain.cpp
@@ -0,0 +1,49 @@
+/***********************************************************\
+ Written by: Richard Bateman (taxilian)
+
+ Based on the default np_macmain.cpp from FireBreath
+ http://firebreath.googlecode.com
+
+ This file has been stripped to prevent it from accidently
+ doing anything useful.
+\***********************************************************/
+
+
+#include <stdio.h>
+
+typedef void (*NPP_ShutdownProcPtr)(void);
+typedef short NPError;
+
+#pragma GCC visibility push(default)
+
+struct NPNetscapeFuncs;
+struct NPPluginFuncs;
+
+extern "C" {
+ NPError NP_Initialize(NPNetscapeFuncs *browserFuncs);
+ NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
+ NPError NP_Shutdown(void);
+}
+
+#pragma GCC visibility pop
+
+void initPluginModule()
+{
+}
+
+NPError NP_GetEntryPoints(NPPluginFuncs* pFuncs)
+{
+ printf("NP_GetEntryPoints()\n");
+ return 0;
+}
+
+NPError NP_Initialize(NPNetscapeFuncs* pFuncs)
+{
+ printf("NP_Initialize()\n");
+ return 0;
+}
+
+NPError NP_Shutdown()
+{
+ return 0;
+}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index c5331be..4d4764f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -138,8 +138,8 @@ IF(BUILD_TESTING)
SET(TEST_RESOURCES TRUE)
ENDIF()
# for borland and watcom there is no resource support
- IF(("${CMAKE_TEST_GENERATOR}" MATCHES "WMake") OR
- ("${CMAKE_TEST_GENERATOR}" MATCHES "Borland"))
+ IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR
+ "${CMAKE_TEST_GENERATOR}" MATCHES "Borland")
SET(TEST_RESOURCES FALSE)
ENDIF()
IF(TEST_RESOURCES)
@@ -149,7 +149,7 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(PreOrder PreOrder)
ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
- PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file \"MissingSourceFile.c\"")
+ PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
ADD_TEST_MACRO(IPO COnly/COnly)
@@ -391,6 +391,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
+ ADD_TEST(ArgumentExpansion ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion"
+ "${CMake_BINARY_DIR}/Tests/ArgumentExpansion"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project ArgumentExpansion
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
+ )
+ SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES
+ FAIL_REGULAR_EXPRESSION "Unexpected: ")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")
+
ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/CustomCommand"
@@ -550,30 +563,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
IF(CTEST_RUN_CPackComponentsForAll)
set(CPackComponentsForAll_EXTRA_OPTIONS)
-
- set(CPackRun_CPackGen "-DCPackGen=ZIP")
set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}")
- set(CPackRun_CPackComponentWay "-DCPackComponentWay=default")
-
- ADD_TEST(CPackComponentsForAll-ZIP-default ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
- "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project CPackComponentsForAll
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-options
- -DCPACK_BINARY_ZIP:BOOL=ON
- ${CPackComponentsForAll_EXTRA_OPTIONS}
- --graphviz=CPackComponentsForAll.dot
- --test-command ${CMAKE_CMAKE_COMMAND}
- "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
- "${CPackRun_CPackCommand}"
- "${CPackRun_CPackGen}"
- "${CPackRun_CPackComponentWay}"
- -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
-
- LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll")
+ # set up list of CPack generators
+ list(APPEND GENLST "ZIP")
+ # set up list of component packaging ways
+ list(APPEND CWAYLST "default")
+ list(APPEND CWAYLST "OnePackPerGroup")
+ list(APPEND CWAYLST "IgnoreGroup")
+ list(APPEND CWAYLST "AllInOne")
+ list(APPEND CWAYLST "AllGroupsInOne")
+ foreach(CPackGen ${GENLST})
+ set(CPackRun_CPackGen "-DCPackGen=${CPackGen}")
+ foreach(CPackComponentWay ${CWAYLST})
+ set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}")
+ ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
+ "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project CPackComponentsForAll
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-options
+ -DCPACK_BINARY_${CPackGen}:BOOL=ON
+ ${CPackRun_CPackComponentWay}
+ ${CPackComponentsForAll_EXTRA_OPTIONS}
+ --graphviz=CPackComponentsForAll.dot
+ --test-command ${CMAKE_CMAKE_COMMAND}
+ "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
+ "${CPackRun_CPackCommand}"
+ "${CPackRun_CPackGen}"
+ "${CPackRun_CPackComponentWay}"
+ -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}")
+ endforeach(CPackComponentWay)
+ endforeach(CPackGen)
ENDIF(CTEST_RUN_CPackComponentsForAll)
# By default, turn this test off (because it takes a long time...)
@@ -792,11 +815,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--test-command ${CMAKE_CTEST_COMMAND} -V
)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
- # The ExternalProject test takes 900 seconds on some machines!
- GET_TEST_PROPERTY(ExternalProject TIMEOUT PREVIOUS_TIMEOUT)
- IF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
- SET_TESTS_PROPERTIES(ExternalProject PROPERTIES TIMEOUT 1000)
- ENDIF("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND)
+ SET_TESTS_PROPERTIES(ExternalProject PROPERTIES
+ TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
# do each of the tutorial steps
FOREACH(STP RANGE 1 7)
@@ -1121,6 +1141,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest")
+ ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CFBundleTest"
+ "${CMake_BINARY_DIR}/Tests/CFBundleTest"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-project CFBundleTest
+ --test-command
+ ${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=\${CTEST_CONFIGURATION_TYPE}
+ -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest
+ -Dgen=${CMAKE_TEST_GENERATOR}
+ -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest")
+
ADD_TEST_MACRO(ObjC++ ObjC++)
ENDIF (APPLE AND CMAKE_COMPILER_IS_GNUCXX)
@@ -1139,6 +1174,77 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
ENDIF(APPLE AND CTEST_TEST_CPACK)
+ ADD_TEST(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet"
+ "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-noclean
+ --build-project WarnUnusedUnusedViaSet
+ --build-options "--warn-unused-vars")
+ SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
+ PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
+ SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
+ FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet")
+
+ ADD_TEST(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset"
+ "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-noclean
+ --build-project WarnUnusedUnusedViaUnset
+ --build-options "--warn-unused-vars")
+ SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
+ PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):")
+ SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
+ FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
+
+ ADD_TEST(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VariableUsage"
+ "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-noclean
+ --build-project WarnUnusedCliUnused
+ --build-options "-DUNUSED_CLI_VARIABLE=Unused")
+ SET_TESTS_PROPERTIES(WarnUnusedCliUnused PROPERTIES
+ PASS_REGULAR_EXPRESSION "CMake Warning: The variable, 'UNUSED_CLI_VARIABLE'")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
+
+ ADD_TEST(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VariableUsage"
+ "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-noclean
+ --build-project WarnUnusedCliUsed
+ --build-options "-DUSED_VARIABLE=Usage proven")
+ SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES
+ PASS_REGULAR_EXPRESSION "Usage proven")
+ SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES
+ FAIL_REGULAR_EXPRESSION "CMake Warning: The variable, 'USED_VARIABLE'")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed")
+
+ ADD_TEST(WarnUninitialized ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VariableUsage"
+ "${CMake_BINARY_DIR}/Tests/WarnUninitialized"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-noclean
+ --build-project WarnUninitialized
+ --build-options "--warn-uninitialized")
+ SET_TESTS_PROPERTIES(WarnUninitialized PROPERTIES
+ PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'")
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized")
+
ADD_TEST(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory"
@@ -1785,11 +1891,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
ENDIF(SDCC_EXECUTABLE)
-
+ # If a Linux -> MinGW cross compiler is found then try it
FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
- MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE)
- IF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE)
+ FIND_PROGRAM(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres)
+ MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE)
+ IF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE)
ADD_TEST(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Simple"
@@ -1800,11 +1907,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-options
"-DCMAKE_SYSTEM_NAME=Windows"
"-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
- "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}")
+ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
+ "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
+ )
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
- ENDIF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE)
-
-
+ ENDIF()
ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
IF(UNIX)
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 971b2dc..bcec509 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -107,14 +107,14 @@ set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)
# We may use the CPack specific config file in order
-# to tailor CPack behavio on a CPack generator specific way
+# to tailor CPack behavior on a CPack generator specific way
# (Behavior would be different for RPM or TGZ or DEB ...)
-if (USE_CPACK_PROJECT_CONFIG)
+if (NOT ("${CPackComponentWay}" STREQUAL "default"))
# Setup project specific CPack-time CPack Config file.
- configure_file(${MyLib_SOURCE_DIR}/MyLibCPackConfig.cmake.in
- ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake
+ configure_file(${CPackComponentsForAll_SOURCE_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake.in
+ ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake
@ONLY)
- set(CPACK_PROJECT_CONFIG_FILE ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake)
-endif (USE_CPACK_PROJECT_CONFIG)
+ set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake)
+endif (NOT ("${CPackComponentWay}" STREQUAL "default"))
# Include CPack to introduce the appropriate targets
include(CPack) \ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in
new file mode 100644
index 0000000..3a7119e
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllGroupsInOne.cmake.in
@@ -0,0 +1,18 @@
+#
+# Activate component packaging
+#
+if(CPACK_GENERATOR MATCHES "ZIP")
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "RPM")
+ set(CPACK_RPM_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "RPM")
+
+#
+# Choose grouping way
+#
+set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1)
+#set(CPACK_COMPONENTS_GROUPING)
+#set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in
new file mode 100644
index 0000000..9a40293
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in
@@ -0,0 +1,18 @@
+#
+# Activate component packaging
+#
+if(CPACK_GENERATOR MATCHES "ZIP")
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "RPM")
+ set(CPACK_RPM_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "RPM")
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE 1)
+#set(CPACK_COMPONENTS_GROUPING)
+#set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
new file mode 100644
index 0000000..92a97a5
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
@@ -0,0 +1,18 @@
+#
+# Activate component packaging
+#
+if(CPACK_GENERATOR MATCHES "ZIP")
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "RPM")
+ set(CPACK_RPM_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "RPM")
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
+#set(CPACK_COMPONENTS_GROUPING)
+set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) \ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
new file mode 100644
index 0000000..4180891
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in
@@ -0,0 +1,18 @@
+#
+# Activate component packaging
+#
+if(CPACK_GENERATOR MATCHES "ZIP")
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "RPM")
+ set(CPACK_RPM_COMPONENT_INSTALL "ON")
+endif(CPACK_GENERATOR MATCHES "RPM")
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
+#set(CPACK_COMPONENTS_GROUPING)
+#set(CPACK_COMPONENTS_IGNORE_GROUPS)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE) \ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
deleted file mode 100644
index 7ffafae..0000000
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
+++ /dev/null
@@ -1,7 +0,0 @@
-if(CPACK_GENERATOR MATCHES "ZIP")
-# set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
-endif(CPACK_GENERATOR MATCHES "ZIP")
-
-if(CPACK_GENERATOR MATCHES "TGZ")
- set(CPACK_MONOLITHIC_INSTALL 1)
-endif(CPACK_GENERATOR MATCHES "TGZ")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 11f72ec..d5137bd 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -49,6 +49,18 @@ if(CPackGen MATCHES "ZIP")
if (${CPackComponentWay} STREQUAL "default")
set(expected_count 1)
endif(${CPackComponentWay} STREQUAL "default")
+ if (${CPackComponentWay} STREQUAL "OnePackPerGroup")
+ set(expected_count 2)
+ endif (${CPackComponentWay} STREQUAL "OnePackPerGroup")
+ if (${CPackComponentWay} STREQUAL "IgnoreGroup")
+ set(expected_count 4)
+ endif (${CPackComponentWay} STREQUAL "IgnoreGroup")
+ if (${CPackComponentWay} STREQUAL "AllInOne")
+ set(expected_count 1)
+ endif (${CPackComponentWay} STREQUAL "AllInOne")
+ if (${CPackComponentWay} STREQUAL "AllGroupsInOne")
+ set(expected_count 1)
+ endif (${CPackComponentWay} STREQUAL "AllGroupsInOne")
endif(CPackGen MATCHES "ZIP")
# Now verify if the number of expected file is OK
diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in
index f6ec198..b58b639 100644
--- a/Tests/CTestTest2/test.cmake.in
+++ b/Tests/CTestTest2/test.cmake.in
@@ -15,13 +15,12 @@ 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()
+
+# By default, CTESTTEST2_USE_PURIFY is not defined. If you want to run purify
+# on CTestTest2, set CTESTTEST2_USE_PURIFY to ON in CMake's cache.
+SET(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@)
+IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY)
+ SET(CTEST_MEMORYCHECK_COMMAND)
ENDIF()
#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
diff --git a/Tests/CTestTest3/test.cmake.in b/Tests/CTestTest3/test.cmake.in
deleted file mode 100644
index 1e8ea50..0000000
--- a/Tests/CTestTest3/test.cmake.in
+++ /dev/null
@@ -1,120 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
-
-MACRO(PROJECT_START NAME)
- MESSAGE("###################################################")
- MESSAGE("")
- MESSAGE("Start project: ${NAME}")
- MESSAGE("")
- MESSAGE("###################################################")
-ENDMACRO(PROJECT_START)
-
-# Project 1
-PROJECT_START("KWSys from CVS")
-
-# Settings:
-SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3")
-SET(CTEST_SITE "@SITE@")
-SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-CVS")
-
-# ---
-SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSys")
-SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/CVS/KWSysBin")
-SET(CTEST_UPDATE_COMMAND "@CVSCOMMAND@")
-SET(CTEST_CMAKE_GENERATOR "@CMAKE_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@")
-# 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")
-
-CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
-
-FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
-CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
-CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
-CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@
-CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@
-CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@
-CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@
-
-# This one is needed for testing advanced ctest features
-CTEST_TEST_KWSYS:BOOL=ON
-")
-
-SET(CTEST_CUSTOM_WARNING_MATCH CommandLineArguments)
-
-CTEST_START(Nightly)
-CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}")
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5 SCHEDULE_RANDOM ON)
-CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-
-set(CTEST_DROP_METHOD "@protocol@")
-set(CTEST_DROP_SITE "@server@")
-set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
-
-CTEST_SUBMIT(RETURN_VALUE res)
-
-#SET(svncommand "@SVNCOMMAND@")
-set(svncommand FALSE) # turn this off until namic svn cmake is back
-IF(svncommand)
- # Project 2
- PROJECT_START("KWSys from SVN")
-
- # Settings:
- SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest3")
- SET(CTEST_SITE "@SITE@")
- SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest3-SVN")
-
- # ---
- SET(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsys")
- SET(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/SVN/kwsysBin")
- SET(CTEST_UPDATE_COMMAND "@SVNCOMMAND@")
- SET(CTEST_CMAKE_GENERATOR "@CMAKE_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}")
- SET(CTEST_CHECKOUT_COMMAND "\"${CTEST_UPDATE_COMMAND}\" co \"http://svn.na-mic.org:8000/svn/CMake/Source/kwsys/\" -r 500")
-
- CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
-
- FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
- CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@
- CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@
- CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@
- CMAKE_CXX_COMPILER:STRING=@CMAKE_CXX_COMPILER@
- CMAKE_C_COMPILER_ARG1:STRING=@CMAKE_C_COMPILER_ARG1@
- CMAKE_CXX_COMPILER_ARG1:STRING=@CMAKE_CXX_COMPILER_ARG1@
-
- # This one is needed for testing advanced ctest features
- CTEST_TEST_KWSYS:BOOL=ON
- ")
-
- CTEST_START(Experimental)
- CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
- 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 5 SCHEDULE_RANDOM ON)
- CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 5)
- CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
- CTEST_SUBMIT(RETURN_VALUE res)
-
-ELSE(svncommand)
- MESSAGE("Cannot find SVN command: ${svncommand}")
-ENDIF(svncommand)
diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in
index 743e835..5d22d35 100644
--- a/Tests/CTestTestBadExe/test.cmake.in
+++ b/Tests/CTestTestBadExe/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadEx
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}")
diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in
index c3c41a5..8413544 100644
--- a/Tests/CTestTestChecksum/test.cmake.in
+++ b/Tests/CTestTestChecksum/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal
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}")
diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in
index ce4d60a..ca216e3 100644
--- a/Tests/CTestTestCostSerial/test.cmake.in
+++ b/Tests/CTestTestCostSerial/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostS
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}")
diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in
index 259c8659..5cec594 100644
--- a/Tests/CTestTestCrash/test.cmake.in
+++ b/Tests/CTestTestCrash/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash
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}")
diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in
index a17adca..201f604 100644
--- a/Tests/CTestTestCycle/test.cmake.in
+++ b/Tests/CTestTestCycle/test.cmake.in
@@ -10,9 +10,6 @@ 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}")
diff --git a/Tests/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in
index ed4e182..36a1ebf 100644
--- a/Tests/CTestTestDepends/test.cmake.in
+++ b/Tests/CTestTestDepends/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepen
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}")
diff --git a/Tests/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in
index 9b581eb..b0e1632 100644
--- a/Tests/CTestTestFailedSubmits/test.cmake.in
+++ b/Tests/CTestTestFailedSubmits/test.cmake.in
@@ -22,9 +22,6 @@ SET(CTEST_BINARY_DIRECTORY "@build@")
SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
SET(CTEST_CMAKE_GENERATOR "@CMAKE_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}")
@@ -39,7 +36,6 @@ 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)
-CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}" @ctest_coverage_labels_args@ RETURN_VALUE res)
# ok to call ctest_submit - still avoids network activity because there is
diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in
index b0bb039..7bc921a 100644
--- a/Tests/CTestTestFailure/testNoBuild.cmake.in
+++ b/Tests/CTestTestFailure/testNoBuild.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu
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}")
diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in
index 69d4f84..59c18d7 100644
--- a/Tests/CTestTestFailure/testNoExe.cmake.in
+++ b/Tests/CTestTestFailure/testNoExe.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailu
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}")
diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in
index 6ca15f6..83845de 100644
--- a/Tests/CTestTestParallel/test.cmake.in
+++ b/Tests/CTestTestParallel/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParal
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}")
diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in
index 0f353b8..98c5901 100644
--- a/Tests/CTestTestResourceLock/test.cmake.in
+++ b/Tests/CTestTestResourceLock/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResou
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}")
diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in
index 2a91829..505bd7c 100644
--- a/Tests/CTestTestScheduler/test.cmake.in
+++ b/Tests/CTestTestScheduler/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSched
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}")
diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in
index 6a5534e..2d03686 100644
--- a/Tests/CTestTestStopTime/test.cmake.in
+++ b/Tests/CTestTestStopTime/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopT
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}")
diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in
index c8d4fda..f240473 100644
--- a/Tests/CTestTestSubdir/test.cmake.in
+++ b/Tests/CTestTestSubdir/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdi
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}")
diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in
index 6ed11a4..8a8dc24 100644
--- a/Tests/CTestTestTimeout/test.cmake.in
+++ b/Tests/CTestTestTimeout/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeo
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}")
diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in
index 0ff32a4..56bae9d 100644
--- a/Tests/CTestTestZeroTimeout/test.cmake.in
+++ b/Tests/CTestTestZeroTimeout/test.cmake.in
@@ -10,9 +10,6 @@ SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroT
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}")
SET(CTEST_TEST_TIMEOUT 2)
diff --git a/Tests/MissingSourceFile/CMakeLists.txt b/Tests/MissingSourceFile/CMakeLists.txt
index 42b7c51..a7206c8 100644
--- a/Tests/MissingSourceFile/CMakeLists.txt
+++ b/Tests/MissingSourceFile/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8)
project(MissingSourceFile C)
-add_executable(MissingSourceFile MissingSourceFile.c)
+add_executable(MissingSourceFile DoesNotExist/MissingSourceFile.c)
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index a647fef..879530b 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -13,7 +13,15 @@ set(CMAKE_PAREN TRUE)
IF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
message("wmake does not support () in path")
set(CMAKE_PAREN FALSE)
-ENDIF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
+elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make")
+ execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} no_such_target --version
+ RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE out)
+ if("${out}" MATCHES "GNU Make 3.82")
+ # GNU Make 3.82 fails on parens: http://savannah.gnu.org/bugs/?30612
+ message(STATUS "GNU Make 3.82 sometimes fails on () in path")
+ set(CMAKE_PAREN FALSE)
+ endif()
+endif()
IF(CMAKE_PAREN)
ADD_DEFINITIONS(-DCMAKE_PAREN=1)
diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
index 0fef19d..a0fd18a 100644
--- a/Tests/TestsWorkingDirectory/CMakeLists.txt
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -7,6 +7,8 @@ enable_testing()
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+add_test(NAME WorkingDirectory0 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
+
add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
set_tests_properties(WorkingDirectory1 PROPERTIES
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
@@ -19,7 +21,7 @@ set_tests_properties(WorkingDirectory2 PROPERTIES
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/.."
)
-get_filename_component(_default_cwd "${EXECUTABLE_OUTPUT_PATH}" PATH)
+set(_default_cwd "${CMAKE_BINARY_DIR}")
# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
if(${CMAKE_GENERATOR} MATCHES "Makefiles")
@@ -36,3 +38,5 @@ add_test(NAME WorkingDirectory5 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. COMMAND
if(${CMAKE_GENERATOR} MATCHES "Makefiles")
add_test(WorkingDirectory6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
endif()
+
+add_subdirectory(subdir)
diff --git a/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
new file mode 100644
index 0000000..523f02e
--- /dev/null
+++ b/Tests/TestsWorkingDirectory/subdir/CMakeLists.txt
@@ -0,0 +1,31 @@
+add_test(NAME WorkingDirectory-Subdir0 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir1 COMMAND WorkingDirectory "${CMAKE_CURRENT_BINARY_DIR}")
+set_tests_properties(WorkingDirectory-Subdir1 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir2 COMMAND WorkingDirectory "${_parent_dir}")
+set_tests_properties(WorkingDirectory-Subdir2 PROPERTIES
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+)
+
+set(_default_cwd "${CMAKE_CURRENT_BINARY_DIR}")
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir3 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd})
+endif()
+
+add_test(NAME WorkingDirectory-Subdir4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND WorkingDirectory ${CMAKE_CURRENT_BINARY_DIR})
+
+string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_test(NAME WorkingDirectory-Subdir5 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. COMMAND WorkingDirectory ${_parent_dir})
+
+# FIXME: How to deal with /debug, /release, etc. with VS or XCode?
+if(${CMAKE_GENERATOR} MATCHES "Makefiles")
+add_test(WorkingDirectory-Subdir6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
+endif()
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index e842955..5d7d14e 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -1,7 +1,37 @@
-cmake_minimum_required (VERSION 2.6)
-project (VSResource)
-add_definitions(/DCMAKE_RCDEFINE="test.txt")
+cmake_minimum_required(VERSION 2.8.3.20110118)
+project(VSResource)
+
string(REPLACE "/INCREMENTAL:YES" ""
CMAKE_EXE_LINKER_FLAGS_DEBUG
"${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+
+message(STATUS "CMAKE_RC_COMPILER='${CMAKE_RC_COMPILER}'")
+
+# Because of the following avoidance techniques required for windres and VS6,
+# we recommend using a configured header file, and defining preprocessor
+# symbols via #define code and including that header in the rc file. Using
+# add_definitions is fine for simple definitions (with no spaces and no
+# quoting), but requires avoidance or work-arounds beyond that...
+
+if(CMAKE_RC_COMPILER MATCHES windres)
+ # windres rc compiler does not properly define quoted /D values as strings
+ message(STATUS "CMAKE_RC_COMPILER MATCHES windres")
+ add_definitions(/DCMAKE_RCDEFINE=test.txt)
+ add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS)
+elseif(MSVC60)
+ # VS6 rc compiler does not deal well with spaces in a "/D" value, but it can
+ # handle the quoting
+ message(STATUS "MSVC60")
+ add_definitions(/DCMAKE_RCDEFINE="test.txt")
+else()
+ # expected case -- rc compiler is "capable enough"
+ message(STATUS
+ "rc compiler handles quoted strings with spaces in values via /D")
+ set(TEXTFILE_FROM_SOURCE_DIR "textfile, spaces in name, from binary dir")
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt
+ "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" @ONLY)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt")
+endif()
+
add_executable(VSResource main.cpp test.rc)
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp
index 6f68df3..7ee0c74 100644
--- a/Tests/VSResource/main.cpp
+++ b/Tests/VSResource/main.cpp
@@ -1,10 +1,80 @@
#include <windows.h>
+#include <stdio.h>
-int main(int argc, char** argv) {
- HRSRC hello = ::FindResource(0, "hello", "TEXT");
- if(hello) {
- return 0;
- } else {
- return 1;
- }
+struct x
+{
+ const char *txt;
+};
+
+int main(int argc, char** argv)
+{
+ int ret = 1;
+
+ fprintf(stdout, "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)\n");
+
+#ifdef CMAKE_RCDEFINE
+ fprintf(stdout, "CMAKE_RCDEFINE defined\n");
+#endif
+
+#ifdef CMAKE_RCDEFINE_NO_QUOTED_STRINGS
+ // Expect CMAKE_RCDEFINE to preprocess to exactly test.txt
+ x test;
+ test.txt = "*exactly* test.txt";
+ fprintf(stdout, "CMAKE_RCDEFINE_NO_QUOTED_STRINGS defined\n");
+ fprintf(stdout, "CMAKE_RCDEFINE is %s, and is *not* a string constant\n",
+ CMAKE_RCDEFINE);
+#else
+ // Expect CMAKE_RCDEFINE to be a string:
+ fprintf(stdout, "CMAKE_RCDEFINE='%s', and is a string constant\n",
+ CMAKE_RCDEFINE);
+#endif
+
+ HRSRC hello = ::FindResource(NULL, MAKEINTRESOURCE(1025), "TEXTFILE");
+ if(hello)
+ {
+ fprintf(stdout, "FindResource worked\n");
+ HGLOBAL hgbl = ::LoadResource(NULL, hello);
+ int datasize = (int) ::SizeofResource(NULL, hello);
+ if(hgbl && datasize>0)
+ {
+ fprintf(stdout, "LoadResource worked\n");
+ fprintf(stdout, "SizeofResource returned datasize='%d'\n", datasize);
+ void *data = ::LockResource(hgbl);
+ if (data)
+ {
+ fprintf(stdout, "LockResource worked\n");
+ char *str = (char *) malloc(datasize+4);
+ if (str)
+ {
+ memcpy(str, data, datasize);
+ str[datasize] = 'E';
+ str[datasize+1] = 'O';
+ str[datasize+2] = 'R';
+ str[datasize+3] = 0;
+ fprintf(stdout, "str='%s'\n", str);
+ free(str);
+
+ ret = 0;
+
+#ifdef CMAKE_RCDEFINE_NO_QUOTED_STRINGS
+ fprintf(stdout, "LoadString skipped\n");
+#else
+ char buf[256];
+ if (::LoadString(NULL, 1026, buf, sizeof(buf)) > 0)
+ {
+ fprintf(stdout, "LoadString worked\n");
+ fprintf(stdout, "buf='%s'\n", buf);
+ }
+ else
+ {
+ fprintf(stdout, "LoadString failed\n");
+ ret = 1;
+ }
+#endif
+ }
+ }
+ }
+ }
+
+ return ret;
}
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
index 8aab8b7..4ce4b53 100644
--- a/Tests/VSResource/test.rc
+++ b/Tests/VSResource/test.rc
@@ -1,5 +1,17 @@
#ifdef CMAKE_RCDEFINE
-hello TEXT DISCARDABLE CMAKE_RCDEFINE
+
+// This line can compile with either an unquoted or a quoted string
+1025 TEXTFILE CMAKE_RCDEFINE
+
+#ifndef CMAKE_RCDEFINE_NO_QUOTED_STRINGS
+// This block can only be compiled if CMAKE_RCDEFINE preprocesses
+// to a double quoted string
+STRINGTABLE
+BEGIN
+ 1026 CMAKE_RCDEFINE
+END
+#endif
+
#else
#error "resource compiler did not get defines from command line!"
-#endif \ No newline at end of file
+#endif
diff --git a/Tests/VSResource/test.txt b/Tests/VSResource/test.txt
index 980a0d5..c27c68d 100644
--- a/Tests/VSResource/test.txt
+++ b/Tests/VSResource/test.txt
@@ -1 +1 @@
-Hello World!
+Hello World! (@TEXTFILE_FROM_SOURCE_DIR@)
diff --git a/Tests/VariableUnusedViaSet/CMakeLists.txt b/Tests/VariableUnusedViaSet/CMakeLists.txt
new file mode 100644
index 0000000..0123ab2
--- /dev/null
+++ b/Tests/VariableUnusedViaSet/CMakeLists.txt
@@ -0,0 +1,4 @@
+set(UNUSED_VARIABLE)
+# Warning should occur here
+set(UNUSED_VARIABLE "Usage")
+message(STATUS "${UNUSED_VARIABLE}")
diff --git a/Tests/VariableUnusedViaUnset/CMakeLists.txt b/Tests/VariableUnusedViaUnset/CMakeLists.txt
new file mode 100644
index 0000000..4b4031d
--- /dev/null
+++ b/Tests/VariableUnusedViaUnset/CMakeLists.txt
@@ -0,0 +1,8 @@
+# NOTE: Changing lines in here changes the test results since the first
+# instance shouldn't warn, but the second should and they have the same message
+
+# A warning should NOT be issued for this line:
+set(UNUSED_VARIABLE)
+# Warning should occur here:
+set(UNUSED_VARIABLE)
+message(STATUS "${UNUSED_VARIABLE}")
diff --git a/Tests/VariableUsage/CMakeLists.txt b/Tests/VariableUsage/CMakeLists.txt
new file mode 100644
index 0000000..4da1f56
--- /dev/null
+++ b/Tests/VariableUsage/CMakeLists.txt
@@ -0,0 +1 @@
+message(STATUS "${USED_VARIABLE}")
diff --git a/Utilities/Release/v20n250_aix_release.cmake b/Utilities/Release/v20n250_aix_release.cmake
index 88eb8d0..7a5c8b9 100644
--- a/Utilities/Release/v20n250_aix_release.cmake
+++ b/Utilities/Release/v20n250_aix_release.cmake
@@ -1,9 +1,9 @@
-set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" )
+set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory")
set(FINAL_PATH /u/noibm34/cmake-release)
set(PROCESSORS 2)
set(CVS_COMMAND /vol/local/bin/cvs)
-set(HOST "sshserv.centers.ihost.com" )
-set(EXTRA_HOP "rsh v20n250" )
+set(HOST "sshserv.centers.ihost.com")
+set(EXTRA_HOP "rsh p90n03")
set(MAKE_PROGRAM "make")
set(CC "xlc_r")
set(CXX "xlC_r")
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 8c10b21..08cda1e 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -274,7 +274,11 @@ LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
#
# Find OpenSSL
#
-FIND_PACKAGE(OpenSSL)
+IF(CMAKE_USE_OPENSSL)
+ FIND_PACKAGE(OpenSSL)
+ELSE()
+ SET(OPENSSL_FOUND 0)
+ENDIF()
IF(OPENSSL_FOUND)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES})
@@ -296,7 +300,11 @@ LA_CHECK_INCLUDE_FILE("sha256.h" HAVE_SHA256_H)
#
# Find MD5/RMD160/SHA library
#
-FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto)
+IF(CMAKE_USE_OPENSSL)
+ FIND_LIBRARY(CRYPTO_LIBRARY NAMES crypto)
+ELSE()
+ SET(CRYPTO_LIBRARY "")
+ENDIF()
IF(CRYPTO_LIBRARY)
LIST(APPEND ADDITIONAL_LIBS ${CRYPTO_LIBRARY})
ELSE(CRYPTO_LIBRARY)
@@ -415,8 +423,12 @@ CHECK_SYMBOL_EXISTS(strerror_r "string.h" HAVE_STRERROR_R)
CHECK_SYMBOL_EXISTS(strftime "time.h" HAVE_STRFTIME)
CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF)
-CHECK_SYMBOL_EXISTS(major "sys/mkdev.h" MAJOR_IN_MKDEV)
-CHECK_SYMBOL_EXISTS(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
+CHECK_C_SOURCE_COMPILES(
+ "#include <sys/mkdev.h>\nint main() { return major(256); }"
+ MAJOR_IN_MKDEV)
+CHECK_C_SOURCE_COMPILES(
+ "#include <sys/sysmacros.h>\nint main() { return major(256); }"
+ MAJOR_IN_SYSMACROS)
IF(HAVE_STRERROR_R)
SET(HAVE_DECL_STRERROR_R 1)
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry.c b/Utilities/cmlibarchive/libarchive/archive_entry.c
index d75dde5..c304231 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry.c
+++ b/Utilities/cmlibarchive/libarchive/archive_entry.c
@@ -32,12 +32,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef MAJOR_IN_MKDEV
+#if MAJOR_IN_MKDEV
#include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
+#define HAVE_MAJOR
+#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
-#endif
+#define HAVE_MAJOR
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -75,6 +75,13 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
#undef max
#define max(a, b) ((a)>(b)?(a):(b))
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define major(x) ((int)(0x00ff & ((x) >> 8)))
+#define minor(x) ((int)(0xffff00ff & (x)))
+#define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
+
/* Play games to come up with a suitable makedev() definition. */
#ifdef __QNXNTO__
/* QNX. <sigh> */
diff --git a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c
index c35c7b3..28b8ff5 100644
--- a/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c
+++ b/Utilities/cmlibarchive/libarchive/archive_entry_xattr.c
@@ -32,13 +32,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.55 2008/12/23 05:01:4
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
-#endif
-#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_windows.h b/Utilities/cmlibarchive/libarchive/archive_windows.h
index 17f5698..f85f3f0 100644
--- a/Utilities/cmlibarchive/libarchive/archive_windows.h
+++ b/Utilities/cmlibarchive/libarchive/archive_windows.h
@@ -94,11 +94,6 @@
#endif
#endif
-/* Replacement for major/minor/makedev. */
-#define major(x) ((int)(0x00ff & ((x) >> 8)))
-#define minor(x) ((int)(0xffff00ff & (x)))
-#define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
-
/* Alias the Windows _function to the POSIX equivalent. */
#define access _access
#define chdir __la_chdir
diff --git a/bootstrap b/bootstrap
index b4e19ef..c999888 100755
--- a/bootstrap
+++ b/bootstrap
@@ -26,6 +26,11 @@ cmake_date_stamp_component()
"
}
+cmake_toupper()
+{
+ echo "$1" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
+}
+
# Detect system and directory information.
cmake_system=`uname`
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
@@ -294,11 +299,23 @@ Configuration:
--verbose display more information
--parallel=n bootstrap cmake in parallel, where n is
number of nodes [1]
- --init=FILE use FILE for cmake initialization
- --system-libs use system-installed third-party libraries
+ --enable-ccache Enable ccache when building cmake
+ --init=FILE load FILE as script to populate cache
+ --system-libs use all system-installed third-party libraries
(for use only by package maintainers)
- --no-system-libs use cmake-provided third-party libraries
+ --no-system-libs use all cmake-provided third-party libraries
(default)
+ --system-curl use system-installed curl library
+ --no-system-curl use cmake-provided curl library (default)
+ --system-expat use system-installed expat library
+ --no-system-expat use cmake-provided expat library (default)
+ --system-zlib use system-installed zlib library
+ --no-system-zlib use cmake-provided zlib library (default)
+ --system-bzip2 use system-installed bzip2 library
+ --no-system-bzip2 use cmake-provided bzip2 library (default)
+ --system-libarchive use system-installed libarchive library
+ --no-system-libarchive use cmake-provided libarchive library (default)
+
--qt-gui build the Qt-based GUI (requires Qt >= 4.2)
--no-qt-gui do not build the Qt-based GUI (default)
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
@@ -507,6 +524,7 @@ cmake_try_make ()
# Parse arguments
cmake_verbose=
cmake_parallel_make=
+cmake_ccache_enabled=
cmake_prefix_dir="${cmake_default_prefix}"
for a in "$@"; do
if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
@@ -528,11 +546,20 @@ for a in "$@"; do
if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
cmake_init_file=`echo $a | sed "s/^--init=//"`
fi
+ for lib in bzip2 curl expat libarchive zlib; do
+ if echo $a | grep "^--system-${lib}" > /dev/null 2> /dev/null; then
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${lib}`=1"
+ break
+ elif echo $a | grep "^--no-system-${lib}" > /dev/null 2> /dev/null; then
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper ${lib}`=0"
+ break
+ fi
+ done
if echo $a | grep "^--system-libs" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1"
fi
if echo $a | grep "^--no-system-libs" > /dev/null 2> /dev/null; then
- cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
+ cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0"
fi
if echo $a | grep "^--qt-gui" > /dev/null 2> /dev/null; then
cmake_bootstrap_qt_gui="1"
@@ -553,6 +580,9 @@ for a in "$@"; do
if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
cmake_verbose=TRUE
fi
+ if echo $a | grep "^--enable-ccache" > /dev/null 2> /dev/null; then
+ cmake_ccache_enabled=TRUE
+ fi
done
# If verbose, display some information about bootstrap
@@ -636,9 +666,9 @@ if ${cmake_system_cygwin}; then
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
fi
-# Add Carbon framework on Darwin
+# Add CoreFoundation framework on Darwin
if ${cmake_system_darwin}; then
- cmake_ld_flags="${LDFLAGS} -framework Carbon"
+ cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
fi
# Add BeOS toolkits...
@@ -1488,13 +1518,21 @@ cd "${cmake_binary_dir}"
# build with same compiler and make
CC="${cmake_c_compiler}"
CXX="${cmake_cxx_compiler}"
+if [ -n "${cmake_ccache_enabled}" ]; then
+ CC="ccache ${CC}"
+ CXX="ccache ${CXX}"
+fi
MAKE="${cmake_make_processor}"
export CC
export CXX
export MAKE
# Run bootstrap CMake to configure real CMake
-"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
+cmake_options="-DCMAKE_BOOTSTRAP=1"
+if [ -n "${cmake_verbose}" ]; then
+ cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
+fi
+"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs}
RES=$?
if [ "${RES}" -ne "0" ]; then
cmake_error 11 "Problem while running initial CMake"