summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.rst4
-rw-r--r--Help/command/cmake_policy.rst86
-rw-r--r--Help/command/ctest_build.rst2
-rw-r--r--Help/command/ctest_start.rst10
-rw-r--r--Help/command/file.rst2
-rw-r--r--Help/command/target_compile_features.rst2
-rw-r--r--Help/command/target_include_directories.rst14
-rw-r--r--Help/manual/cmake-buildsystem.7.rst8
-rw-r--r--Help/manual/cmake-commands.7.rst2
-rw-r--r--Help/manual/cmake-compile-features.7.rst25
-rw-r--r--Help/manual/cmake-developer.7.rst251
-rw-r--r--Help/manual/cmake-qt.7.rst6
-rw-r--r--Help/manual/cmake-variables.7.rst51
-rw-r--r--Help/manual/ctest.1.rst601
-rw-r--r--Help/policy/CMP0020.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_tgt/CXX_EXTENSIONS.rst3
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst6
-rw-r--r--Help/prop_tgt/C_EXTENSIONS.rst3
-rw-r--r--Help/prop_tgt/C_STANDARD.rst6
-rw-r--r--Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst18
-rw-r--r--Help/release/dev/FindOpenGL-target.rst5
-rw-r--r--Help/release/dev/OpenWatcom.rst9
-rw-r--r--Help/release/dev/delay-generator-toolset.rst8
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst6
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst2
-rw-r--r--Help/variable/CTEST_BINARY_DIRECTORY.rst5
-rw-r--r--Help/variable/CTEST_BUILD_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_BUILD_NAME.rst5
-rw-r--r--Help/variable/CTEST_BZR_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_CHECKOUT_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_CONFIGURATION_TYPE.rst5
-rw-r--r--Help/variable/CTEST_CONFIGURE_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_COVERAGE_COMMAND.rst60
-rw-r--r--Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst5
-rw-r--r--Help/variable/CTEST_CURL_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_CVS_CHECKOUT.rst4
-rw-r--r--Help/variable/CTEST_CVS_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_DROP_LOCATION.rst5
-rw-r--r--Help/variable/CTEST_DROP_METHOD.rst5
-rw-r--r--Help/variable/CTEST_DROP_SITE.rst5
-rw-r--r--Help/variable/CTEST_DROP_SITE_CDASH.rst5
-rw-r--r--Help/variable/CTEST_DROP_SITE_PASSWORD.rst5
-rw-r--r--Help/variable/CTEST_DROP_SITE_USER.rst5
-rw-r--r--Help/variable/CTEST_GIT_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst5
-rw-r--r--Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_HG_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_HG_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst5
-rw-r--r--Help/variable/CTEST_NIGHTLY_START_TIME.rst5
-rw-r--r--Help/variable/CTEST_P4_CLIENT.rst5
-rw-r--r--Help/variable/CTEST_P4_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_P4_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_P4_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_SCP_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_SITE.rst5
-rw-r--r--Help/variable/CTEST_SOURCE_DIRECTORY.rst5
-rw-r--r--Help/variable/CTEST_SVN_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_SVN_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_TEST_TIMEOUT.rst5
-rw-r--r--Help/variable/CTEST_TRIGGER_SITE.rst5
-rw-r--r--Help/variable/CTEST_UPDATE_COMMAND.rst5
-rw-r--r--Help/variable/CTEST_UPDATE_OPTIONS.rst5
-rw-r--r--Help/variable/CTEST_USE_LAUNCHERS.rst5
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake7
-rw-r--r--Modules/CMakeRCCompiler.cmake.in2
-rw-r--r--Modules/Compiler/ADSP-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/AppleClang-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/Borland-DetermineCompiler.cmake4
-rw-r--r--Modules/Compiler/Clang-DetermineCompilerInternal.cmake16
-rw-r--r--Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake4
-rw-r--r--Modules/Compiler/Compaq-C-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/Cray-DetermineCompiler.cmake4
-rw-r--r--Modules/Compiler/Embarcadero-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/GNU-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/HP-C-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/HP-CXX-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake6
-rw-r--r--Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake6
-rw-r--r--Modules/Compiler/Intel-DetermineCompiler.cmake20
-rw-r--r--Modules/Compiler/MIPSpro-DetermineCompiler.cmake12
-rw-r--r--Modules/Compiler/MSVC-DetermineCompiler.cmake10
-rw-r--r--Modules/Compiler/OpenWatcom-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/PGI-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/PathScale-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/SDCC-C-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/SunPro-C-DetermineCompiler.cmake12
-rw-r--r--Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake12
-rw-r--r--Modules/Compiler/TI-DetermineCompiler.cmake6
-rw-r--r--Modules/Compiler/Watcom-DetermineCompiler.cmake6
-rw-r--r--Modules/FindOpenGL.cmake76
-rw-r--r--Modules/FindQt4.cmake12
-rw-r--r--Modules/Platform/Android.cmake9
-rw-r--r--Modules/ProcessorCount.cmake4
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake132
-rw-r--r--README.rst4
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx12
-rw-r--r--Source/CTest/cmCTestCoverageHandler.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx4
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx (renamed from Source/CTest/cmParsePythonCoverage.cxx)77
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.h (renamed from Source/CTest/cmParsePythonCoverage.h)11
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx2
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx2
-rw-r--r--Source/cmComputeLinkInformation.cxx6
-rw-r--r--Source/cmComputeTargetDepends.cxx10
-rw-r--r--Source/cmCustomCommand.cxx16
-rw-r--r--Source/cmCustomCommand.h4
-rw-r--r--Source/cmCustomCommandGenerator.cxx2
-rw-r--r--Source/cmDefinitions.cxx38
-rw-r--r--Source/cmDefinitions.h17
-rw-r--r--Source/cmDocumentation.cxx2
-rw-r--r--Source/cmExportBuildFileGenerator.cxx1
-rw-r--r--Source/cmExportBuildFileGenerator.h2
-rw-r--r--Source/cmExportFileGenerator.cxx3
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx5
-rw-r--r--Source/cmFileCommand.cxx7
-rw-r--r--Source/cmGeneratorExpression.cxx21
-rw-r--r--Source/cmGeneratorExpression.h4
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx26
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h5
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx52
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h5
-rw-r--r--Source/cmGeneratorTarget.cxx13
-rw-r--r--Source/cmGlobalGenerator.cxx27
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx40
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h8
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx10
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx36
-rw-r--r--Source/cmGlobalXCodeGenerator.h4
-rw-r--r--Source/cmInstallFilesGenerator.cxx4
-rw-r--r--Source/cmInstalledFile.cxx10
-rw-r--r--Source/cmListFileCache.cxx21
-rw-r--r--Source/cmListFileCache.h17
-rw-r--r--Source/cmLocalGenerator.cxx19
-rw-r--r--Source/cmLocalGenerator.h1
-rw-r--r--Source/cmMakefile.cxx55
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx8
-rw-r--r--Source/cmNinjaTargetGenerator.cxx6
-rw-r--r--Source/cmOrderDirectories.cxx8
-rw-r--r--Source/cmTarget.cxx185
-rw-r--r--Source/cmTargetCompileOptionsCommand.cxx3
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx3
-rw-r--r--Source/cmTest.cxx6
-rw-r--r--Source/cmTest.h4
-rw-r--r--Source/cmTestGenerator.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx294
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h6
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/cmake.h4
-rw-r--r--Source/ctest.cxx3
-rw-r--r--Tests/CMakeLib/CMakeLists.txt4
-rw-r--r--Tests/CMakeLib/testRST.cxx9
-rw-r--r--Tests/CMakeLists.txt33
-rw-r--r--Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in8
-rw-r--r--Tests/CTestTestLabelRegExp/test.cmake.in37
-rw-r--r--Tests/CoberturaCoverage/DartConfiguration.tcl.in8
-rw-r--r--Tests/CoberturaCoverage/coverage.xml.in112
-rw-r--r--Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java52
-rw-r--r--Tests/Complex/CMakeLists.txt8
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt8
-rw-r--r--Tests/CxxDialect/CMakeLists.txt18
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt7
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/main.cpp12
-rw-r--r--Tests/RunCMake/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CommandLine/P_directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_directory-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/CommandLine/build-bad-generator-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/build-no-cache-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/build-no-cache-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/build-no-generator-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/build-no-generator-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt1
-rw-r--r--Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt0
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX11.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX98.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake1
-rw-r--r--Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt11
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt10
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake25
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebug-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c26
230 files changed, 2723 insertions, 864 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 76561b9..3499da8 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -4,10 +4,10 @@ Contributing to CMake
Community
=========
-CMake is maintained by `Kitware, Inc.`_ and developed in
+CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
-.. _`Kitware, Inc.`: http://www.kitware.com
+.. _`Kitware`: http://www.kitware.com/cmake
The preferred entry point for new contributors is the mailing list.
Please subscribe and post to the `CMake Developers List`_ to offer
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 46db8d3..2bc3287 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -1,77 +1,93 @@
cmake_policy
------------
-Manage CMake Policy settings.
+Manage CMake Policy settings. See the :manual:`cmake-policies(7)`
+manual for defined policies.
As CMake evolves it is sometimes necessary to change existing behavior
in order to fix bugs or improve implementations of existing features.
The CMake Policy mechanism is designed to help keep existing projects
building as new versions of CMake introduce changes in behavior. Each
new policy (behavioral change) is given an identifier of the form
-"CMP<NNNN>" where "<NNNN>" is an integer index. Documentation
-associated with each policy describes the OLD and NEW behavior and the
-reason the policy was introduced. Projects may set each policy to
-select the desired behavior. When CMake needs to know which behavior
+``CMP<NNNN>`` where ``<NNNN>`` is an integer index. Documentation
+associated with each policy describes the ``OLD`` and ``NEW`` behavior
+and the reason the policy was introduced. Projects may set each policy
+to select the desired behavior. When CMake needs to know which behavior
to use it checks for a setting specified by the project. If no
-setting is available the OLD behavior is assumed and a warning is
+setting is available the ``OLD`` behavior is assumed and a warning is
produced requesting that the policy be set.
-The cmake_policy command is used to set policies to OLD or NEW
-behavior. While setting policies individually is supported, we
-encourage projects to set policies based on CMake versions.
+Setting Policies by CMake Version
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+The ``cmake_policy`` command is used to set policies to ``OLD`` or ``NEW``
+behavior. While setting policies individually is supported, we
+encourage projects to set policies based on CMake versions::
cmake_policy(VERSION major.minor[.patch[.tweak]])
-Specify that the current CMake list file is written for the given
+Specify that the current CMake code is written for the given
version of CMake. All policies introduced in the specified version or
-earlier will be set to use NEW behavior. All policies introduced
-after the specified version will be unset (unless variable
-CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default). This effectively
-requests behavior preferred as of a given CMake version and tells
-newer CMake versions to warn about their new policies. The policy
-version specified must be at least 2.4 or the command will report an
-error. In order to get compatibility features supporting versions
-earlier than 2.4 see documentation of policy CMP0001.
+earlier will be set to use ``NEW`` behavior. All policies introduced
+after the specified version will be unset (unless the
+:variable:`CMAKE_POLICY_DEFAULT_CMP<NNNN>` variable sets a default).
+This effectively requests behavior preferred as of a given CMake
+version and tells newer CMake versions to warn about their new policies.
+The policy version specified must be at least 2.4 or the command will
+report an error.
+
+Note that the :command:`cmake_minimum_required(VERSION)`
+command implicitly calls ``cmake_policy(VERSION)`` too.
+
+Setting Policies Explicitly
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
-Tell CMake to use the OLD or NEW behavior for a given policy.
+Tell CMake to use the ``OLD`` or ``NEW`` behavior for a given policy.
Projects depending on the old behavior of a given policy may silence a
-policy warning by setting the policy state to OLD. Alternatively one
-may fix the project to work with the new behavior and set the policy
-state to NEW.
+policy warning by setting the policy state to ``OLD``. Alternatively
+one may fix the project to work with the new behavior and set the
+policy state to ``NEW``.
+
+Checking Policy Settings
+^^^^^^^^^^^^^^^^^^^^^^^^
::
cmake_policy(GET CMP<NNNN> <variable>)
-Check whether a given policy is set to OLD or NEW behavior. The
-output variable value will be "OLD" or "NEW" if the policy is set, and
-empty otherwise.
+Check whether a given policy is set to ``OLD`` or ``NEW`` behavior.
+The output ``<variable>`` value will be ``OLD`` or ``NEW`` if the
+policy is set, and empty otherwise.
+
+CMake Policy Stack
+^^^^^^^^^^^^^^^^^^
CMake keeps policy settings on a stack, so changes made by the
cmake_policy command affect only the top of the stack. A new entry on
the policy stack is managed automatically for each subdirectory to
protect its parents and siblings. CMake also manages a new entry for
-scripts loaded by include() and find_package() commands except when
-invoked with the NO_POLICY_SCOPE option (see also policy CMP0011).
-The cmake_policy command provides an interface to manage custom
-entries on the policy stack:
-
-::
+scripts loaded by :command:`include` and :command:`find_package` commands
+except when invoked with the ``NO_POLICY_SCOPE`` option
+(see also policy :policy:`CMP0011`).
+The ``cmake_policy`` command provides an interface to manage custom
+entries on the policy stack::
cmake_policy(PUSH)
cmake_policy(POP)
-Each PUSH must have a matching POP to erase any changes. This is
-useful to make temporary changes to policy settings.
+Each ``PUSH`` must have a matching ``POP`` to erase any changes.
+This is useful to make temporary changes to policy settings.
+Calls to the :command:`cmake_minimum_required(VERSION)`,
+``cmake_policy(VERSION)``, or ``cmake_policy(SET)`` commands
+influence only the current top of the policy stack.
-Functions and macros record policy settings when they are created and
+Commands created by the :command:`function` and :command:`macro`
+commands record policy settings when they are created and
use the pre-record policies when they are invoked. If the function or
macro implementation sets policies, the changes automatically
propagate up through callers until they reach the closest nested
diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst
index 1347b42..4a95cdd 100644
--- a/Help/command/ctest_build.rst
+++ b/Help/command/ctest_build.rst
@@ -23,7 +23,7 @@ The APPEND option marks results for append to those previously
submitted to a dashboard server since the last ctest_start. Append
semantics are defined by the dashboard server in use.
-If set the contents of the variable CTEST_BUILD_FLAGS are passed as
+If set, the contents of the variable CTEST_BUILD_FLAGS are passed as
additional arguments to the underlying build command. This can e.g. be
used to trigger a parallel build using the -j option of make. See
:module:`ProcessorCount` for an example.
diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst
index f16142e..d7472db 100644
--- a/Help/command/ctest_start.rst
+++ b/Help/command/ctest_start.rst
@@ -10,7 +10,15 @@ Starts the testing for a given model
Starts the testing for a given model. The command should be called
after the binary directory is initialized. If the 'source' and
'binary' directory are not specified, it reads the
-CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is
+:variable:`CTEST_SOURCE_DIRECTORY` and :variable:`CTEST_BINARY_DIRECTORY`.
+If the track is
specified, the submissions will go to the specified track. If APPEND
is used, the existing TAG is used rather than creating a new one based
on the current time stamp.
+
+If the :variable:`CTEST_CHECKOUT_COMMAND` variable
+(or the :variable:`CTEST_CVS_CHECKOUT` variable)
+is set, its content is treated as command-line. The command is
+invoked with the current working directory set to the parent of the source
+directory, even if the source directory already exists. This can be used
+to create the source tree from a version control repository.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 14ca20c..869350a 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -271,6 +271,8 @@ from the input content to produce the output content. The options are:
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.
+Generated files are modified on subsequent cmake runs only if their content
+is changed.
------------------------------------------------------------------------------
diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst
index a6503db..29a8b41 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -11,7 +11,7 @@ Specify compiler features required when compiling a given target. If the
feature is not listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable
or :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
then an error will be reported by CMake. If the use of the feature requires
-an additional compiler flag, such as ``-std=c++11``, the flag will be added
+an additional compiler flag, such as ``-std=gnu++11``, the flag will be added
automatically.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 75f917d..581bace 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -40,3 +40,17 @@ Arguments to ``target_include_directories`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
+
+Include directories usage requirements commonly differ between the build-tree
+and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
+generator expressions can be used to describe separate usage requirements
+based on the usage location. Relative paths are allowed within the
+``INSTALL_INTERFACE`` expression and are interpreted relative to the
+installation prefix. For example:
+
+.. code-block:: cmake
+
+ target_include_directories(mylib PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
+ $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
+ )
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 3e1f011..fdd1be4 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -551,7 +551,7 @@ exporting see the :manual:`cmake-packages(7)` manual.
.. _`Include Directories and Usage Requirements`:
Include Directories and Usage Requirements
-''''''''''''''''''''''''''''''''''''''''''
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Include directories require some special consideration when specified as usage
requirements and when used with generator expressions. The
@@ -578,9 +578,9 @@ expands to the installation prefix when imported by a consuming project.
Include directories usage requirements commonly differ between the build-tree
and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
generator expressions can be used to describe separate usage requirements
-based on the usage location. Relative paths are allowed within these
-expressions, and are interpreted relative to the current source directory
-or the installation prefix, as appropriate:
+based on the usage location. Relative paths are allowed within the
+``INSTALL_INTERFACE`` expression and are interpreted relative to the
+installation prefix. For example:
.. code-block:: cmake
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 17c3236..8ff73a4 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -128,6 +128,8 @@ versions of CMake. Do not use them in new code.
/command/variable_requires
/command/write_file
+.. _`CTest Commands`:
+
CTest Commands
==============
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index c014846..d4bbecc 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -47,7 +47,7 @@ be compiled with compiler support for the
In processing the requirement for the ``cxx_constexpr`` feature,
:manual:`cmake(1)` will ensure that the in-use C++ compiler is capable
-of the feature, and will add any necessary flags such as ``-std=c++11``
+of the feature, and will add any necessary flags such as ``-std=gnu++11``
to the compile lines of C++ files in the ``mylib`` target. A
``FATAL_ERROR`` is issued if the compiler is not capable of the
feature.
@@ -59,8 +59,8 @@ for each target.
Such compile flags are added even if the compiler supports the
particular feature without the flag. For example, the GNU compiler
-supports variadic templates (with a warning) even if ``-std=c++98`` is
-used. CMake adds the ``-std=c++11`` flag if ``cxx_variadic_templates``
+supports variadic templates (with a warning) even if ``-std=gnu++98`` is
+used. CMake adds the ``-std=gnu++11`` flag if ``cxx_variadic_templates``
is specified as a requirement.
In the above example, ``mylib`` requires ``cxx_constexpr`` when it
@@ -76,7 +76,7 @@ known feature), that may be specified with the ``PUBLIC`` or
# cxx_constexpr is a usage-requirement
target_compile_features(mylib PUBLIC cxx_constexpr)
- # main.cpp will be compiled with -std=c++11 on GNU for cxx_constexpr.
+ # main.cpp will be compiled with -std=gnu++11 on GNU for cxx_constexpr.
add_executable(myexe main.cpp)
target_link_libraries(myexe mylib)
@@ -84,16 +84,13 @@ Feature requirements are evaluated transitively by consuming the link
implementation. See :manual:`cmake-buildsystem(7)` for more on
transitive behavior of build properties and usage requirements.
-Note that new use of compile feature requirements may expose
-cross-platform bugs in user code. For example, the GNU compiler uses the
-``gnu++98`` language by default as of GCC version 4.8. User code may
-be relying on that by expecting the ``typeof`` GNU extension to work.
-However, if the :command:`target_compile_features` command is used to
-specify the requirement for ``cxx_constexpr``, a ``-std=c++11`` flag may
-be added, and the ``typeof`` extension would no longer be available. The
-solution is to specify that compiler extensions are relied upon by setting
-the :prop_tgt:`CXX_EXTENSIONS` target property to ``ON`` when starting to
-use the :command:`target_compile_features` command.
+Because the :prop_tgt:`CXX_EXTENSIONS` target property is ``ON`` by default,
+CMake uses extended variants of language dialects by default, such as
+``-std=gnu++11`` instead of ``-std=c++11``. That target property may be
+set to ``OFF`` to use the non-extended variant of the dialect flag. Note
+that because most compilers enable extensions by default, this could
+expose cross-platform bugs in user code or in the headers of third-party
+dependencies.
Optional Compile Features
=========================
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 81adea0..9851c12 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -465,168 +465,195 @@ with an explicit target.
Style
-----
-1)
- Command signatures should be marked up as plain literal blocks, not as
- cmake ``code-blocks``.
+Style: Section Headers
+^^^^^^^^^^^^^^^^^^^^^^
-2)
- Signatures are separated from preceding content by a horizontal
- line. That is, use:
+When marking section titles, make the section decoration line as long as
+the title text. Use only a line below the title, not above. For
+example:
- .. code-block:: rst
+.. code-block:: rst
+
+ Title Text
+ ----------
+
+Capitalize the first letter of each non-minor word in the title.
+
+The section header underline character hierarchy is
+
+* ``#``: Manual group (part) in the master document
+* ``*``: Manual (chapter) title
+* ``=``: Section within a manual
+* ``-``: Subsection or `CMake Domain`_ object document title
+* ``^``: Subsubsection or `CMake Domain`_ object document section
+* ``"``: Paragraph or `CMake Domain`_ object document subsection
+
+Style: Whitespace
+^^^^^^^^^^^^^^^^^
+
+Use two spaces for indentation. Use two spaces between sentences in
+prose.
+
+Style: Line Length
+^^^^^^^^^^^^^^^^^^
+
+Prefer to restrict the width of lines to 75-80 columns. This is not a
+hard restriction, but writing new paragraphs wrapped at 75 columns
+allows space for adding minor content without significant re-wrapping of
+content.
+
+Style: Prose
+^^^^^^^^^^^^
+
+Use American English spellings in prose.
- ... preceding paragraph.
+Style: Starting Literal Blocks
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ---------------------------------------------------------------------
+Prefer to mark the start of literal blocks with ``::`` at the end of
+the preceding paragraph. In cases where the following block gets
+a ``code-block`` marker, put a single ``:`` at the end of the preceding
+paragraph.
- ::
+Style: CMake Command Signatures
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- add_library(<lib> ...)
+Command signatures should be marked up as plain literal blocks, not as
+cmake ``code-blocks``.
- This signature is used for ...
+Signatures are separated from preceding content by a horizontal
+line. That is, use:
-3)
- Use "``OFF``" and "``ON``" for boolean values which can be modified by
- the user, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`. Such properties
- may be "enabled" and "disabled". Use "``True``" and "``False``" for
- inherent values which can't be modified after being set, such as the
- :prop_tgt:`IMPORTED` property of a build target.
+.. code-block:: rst
-4)
- Use two spaces for indentation. Use two spaces between sentences in
- prose.
+ ... preceding paragraph.
-5)
- Prefer to mark the start of literal blocks with ``::`` at the end of
- the preceding paragraph. In cases where the following block gets
- a ``code-block`` marker, put a single ``:`` at the end of the preceding
- paragraph.
+ ---------------------------------------------------------------------
-6)
- Prefer to restrict the width of lines to 75-80 columns. This is not a
- hard restriction, but writing new paragraphs wrapped at 75 columns
- allows space for adding minor content without significant re-wrapping of
- content.
+ ::
-7)
- Mark up self-references with ``inline-literal`` syntax. For example,
- within the add_executable command documentation, use
+ add_library(<lib> ...)
- .. code-block:: rst
+ This signature is used for ...
- ``add_executable``
+Signatures of commands should wrap optional parts with square brackets,
+and should mark list of optional arguments with an ellipsis (``...``).
+Elements of the signature which are specified by the user should be
+specified with angle brackets, and may be referred to in prose using
+``inline-literal`` syntax.
- not
+Style: Boolean Constants
+^^^^^^^^^^^^^^^^^^^^^^^^
- .. code-block:: rst
+Use "``OFF``" and "``ON``" for boolean values which can be modified by
+the user, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`. Such properties
+may be "enabled" and "disabled". Use "``True``" and "``False``" for
+inherent values which can't be modified after being set, such as the
+:prop_tgt:`IMPORTED` property of a build target.
- :command:`add_executable`
+Style: Inline Literals
+^^^^^^^^^^^^^^^^^^^^^^
- which is used elsewhere.
+Mark up references to keywords in signatures, file names, and other
+technical terms with ``inline-literal`` syntax, for example:
-8)
- Mark up all other linkable references as links, including repeats. An
- alternative, which is used by wikipedia (`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
- is to link to a reference only once per article. That style is not used
- in CMake documentation.
+.. code-block:: rst
-9)
- Mark up references to keywords in signatures, file names, and other
- technical terms with ``inline-literl`` syntax, for example:
+ If ``WIN32`` is used with :command:`add_executable`, the
+ :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
+ creates the file ``<name>.exe`` on Windows.
- .. code-block:: rst
+Style: Cross-References
+^^^^^^^^^^^^^^^^^^^^^^^
- If ``WIN32`` is used with :command:`add_executable`, the
- :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
- creates the file ``<name>.exe`` on Windows.
+Mark up linkable references as links, including repeats.
+An alternative, which is used by wikipedia
+(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
+is to link to a reference only once per article. That style is not used
+in CMake documentation.
+Style: Referencing CMake Concepts
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-10)
- If referring to a concept which corresponds to a property, and that
- concept is described in a high-level manual, prefer to link to the
- manual section instead of the property. For example:
+If referring to a concept which corresponds to a property, and that
+concept is described in a high-level manual, prefer to link to the
+manual section instead of the property. For example:
- .. code-block:: rst
+.. code-block:: rst
- This command creates an :ref:`Imported Target <Imported Targets>`.
+ This command creates an :ref:`Imported Target <Imported Targets>`.
- instead of:
+instead of:
- .. code-block:: rst
+.. code-block:: rst
- This command creates an :prop_tgt:`IMPORTED` target.
+ This command creates an :prop_tgt:`IMPORTED` target.
- The latter should be used only when referring specifically to the
- property.
+The latter should be used only when referring specifically to the
+property.
- References to manual sections are not automatically created by creating
- a section, but code such as:
+References to manual sections are not automatically created by creating
+a section, but code such as:
- .. code-block:: rst
+.. code-block:: rst
- .. _`Imported Targets`:
+ .. _`Imported Targets`:
- creates a suitable anchor. Use an anchor name which matches the name
- of the corresponding section. Refer to the anchor using a
- cross-reference with specified text.
+creates a suitable anchor. Use an anchor name which matches the name
+of the corresponding section. Refer to the anchor using a
+cross-reference with specified text.
- Imported Targets need the ``IMPORTED`` term marked up with care in
- particular because the term may refer to a command keyword
- (``IMPORTED``), a target property (:prop_tgt:`IMPORTED`), or a
- concept (:ref:`Imported Targets`).
+Imported Targets need the ``IMPORTED`` term marked up with care in
+particular because the term may refer to a command keyword
+(``IMPORTED``), a target property (:prop_tgt:`IMPORTED`), or a
+concept (:ref:`Imported Targets`).
-11)
- Where a property, command or variable is related conceptually to others,
- by for example, being related to the buildsystem description, generator
- expressions or Qt, each relevant property, command or variable should
- link to the primary manual, which provides high-level information. Only
- particular information relating to the command should be in the
- documentation of the command.
+Where a property, command or variable is related conceptually to others,
+by for example, being related to the buildsystem description, generator
+expressions or Qt, each relevant property, command or variable should
+link to the primary manual, which provides high-level information. Only
+particular information relating to the command should be in the
+documentation of the command.
-12)
- When marking section titles, make the section decoration line as long as
- the title text. Use only a line below the title, not above. For
- example:
+Style: Referencing CMake Domain Objects
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- .. code-block:: rst
+When referring to `CMake Domain`_ objects such as properties, variables,
+commands etc, prefer to link to the target object and follow that with
+the type of object it is. For example:
- Title Text
- ----------
+.. code-block:: rst
- Capitalize the first letter of each non-minor word in the title.
+ Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
-13)
- When referring to properties, variables, commands etc, prefer to link
- to the target object and follow that with the type of object it is.
- For example:
+Instead of
- .. code-block:: rst
+.. code-block:: rst
- Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
+ Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
- Instead of
+The ``policy`` directive is an exception, and the type us usually
+referred to before the link:
- .. code-block:: rst
+.. code-block:: rst
- Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
+ If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
- The ``policy`` directive is an exception, and the type us usually
- referred to before the link:
+However, markup self-references with ``inline-literal`` syntax.
+For example, within the :command:`add_executable` command
+documentation, use
- .. code-block:: rst
+.. code-block:: rst
- If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
+ ``add_executable``
-14)
- Signatures of commands should wrap optional parts with square brackets,
- and should mark list of optional arguments with an ellipsis (``...``).
- Elements of the signature which are specified by the user should be
- specified with angle brackets, and may be referred to in prose using
- ``inline-literal`` syntax.
+not
+
+.. code-block:: rst
-15)
- Use American English spellings in prose.
+ :command:`add_executable`
+which is used elsewhere.
Modules
=======
@@ -808,7 +835,7 @@ Documentation`_ section above.
Standard Variable Names
-~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^
For a ``FindXxx.cmake`` module that takes the approach of setting
variables (either instead of or in addition to creating imported
@@ -914,7 +941,7 @@ them.
A Sample Find Module
-~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^
We will describe how to create a simple find module for a library
``Foo``.
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index cad4951..fe8d62d 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -54,7 +54,7 @@ CMake. Target dependencies may be added to that custom target by adding them
to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
AUTOMOC
-'''''''
+^^^^^^^
The :prop_tgt:`AUTOMOC` target property controls whether :manual:`cmake(1)`
inspects the C++ files in the target to determine if they require ``moc`` to
@@ -84,7 +84,7 @@ variable may be populated to pre-set the options for all following targets.
.. _`Qt AUTOUIC`:
AUTOUIC
-'''''''
+^^^^^^^
The :prop_tgt:`AUTOUIC` target property controls whether :manual:`cmake(1)`
inspects the C++ files in the target to determine if they require ``uic`` to
@@ -147,7 +147,7 @@ result of linking with the :prop_tgt:`IMPORTED` target:
.. _`Qt AUTORCC`:
AUTORCC
-'''''''
+^^^^^^^
The :prop_tgt:`AUTORCC` target property controls whether :manual:`cmake(1)`
creates rules to execute ``rcc`` at the appropriate time on source files
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index b2dc88f..df434c5 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -308,6 +308,57 @@ Variables for Languages
/variable/CMAKE_LANG_SOURCE_FILE_EXTENSIONS
/variable/CMAKE_USER_MAKE_RULES_OVERRIDE_LANG
+Variables for CTest
+===================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CTEST_BINARY_DIRECTORY
+ /variable/CTEST_BUILD_COMMAND
+ /variable/CTEST_BUILD_NAME
+ /variable/CTEST_BZR_COMMAND
+ /variable/CTEST_BZR_UPDATE_OPTIONS
+ /variable/CTEST_CHECKOUT_COMMAND
+ /variable/CTEST_CONFIGURATION_TYPE
+ /variable/CTEST_CONFIGURE_COMMAND
+ /variable/CTEST_COVERAGE_COMMAND
+ /variable/CTEST_COVERAGE_EXTRA_FLAGS
+ /variable/CTEST_CURL_OPTIONS
+ /variable/CTEST_CVS_CHECKOUT
+ /variable/CTEST_CVS_COMMAND
+ /variable/CTEST_CVS_UPDATE_OPTIONS
+ /variable/CTEST_DROP_LOCATION
+ /variable/CTEST_DROP_METHOD
+ /variable/CTEST_DROP_SITE
+ /variable/CTEST_DROP_SITE_CDASH
+ /variable/CTEST_DROP_SITE_PASSWORD
+ /variable/CTEST_DROP_SITE_USER
+ /variable/CTEST_GIT_COMMAND
+ /variable/CTEST_GIT_UPDATE_CUSTOM
+ /variable/CTEST_GIT_UPDATE_OPTIONS
+ /variable/CTEST_HG_COMMAND
+ /variable/CTEST_HG_UPDATE_OPTIONS
+ /variable/CTEST_MEMORYCHECK_COMMAND
+ /variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS
+ /variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
+ /variable/CTEST_NIGHTLY_START_TIME
+ /variable/CTEST_P4_CLIENT
+ /variable/CTEST_P4_COMMAND
+ /variable/CTEST_P4_OPTIONS
+ /variable/CTEST_P4_UPDATE_OPTIONS
+ /variable/CTEST_SCP_COMMAND
+ /variable/CTEST_SITE
+ /variable/CTEST_SOURCE_DIRECTORY
+ /variable/CTEST_SVN_COMMAND
+ /variable/CTEST_SVN_OPTIONS
+ /variable/CTEST_SVN_UPDATE_OPTIONS
+ /variable/CTEST_TEST_TIMEOUT
+ /variable/CTEST_TRIGGER_SITE
+ /variable/CTEST_UPDATE_COMMAND
+ /variable/CTEST_UPDATE_OPTIONS
+ /variable/CTEST_USE_LAUNCHERS
+
Variables for CPack
===================
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 60d08dd..a57a8f0 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -365,6 +365,607 @@ Options
.. include:: OPTIONS_HELP.txt
+Dashboard Client
+================
+
+CTest can operate as a client for the `CDash`_ software quality dashboard
+application. As a dashboard client, CTest performs a sequence of steps
+to configure, build, and test software, and then submits the results to
+a `CDash`_ server.
+
+.. _`CDash`: http://cdash.org/
+
+Dashboard Client Steps
+----------------------
+
+CTest defines an ordered list of testing steps of which some or all may
+be run as a dashboard client:
+
+``Start``
+ Start a new dashboard submission to be composed of results recorded
+ by the following steps.
+ See the `CTest Start Step`_ section below.
+
+``Update``
+ Update the source tree from its version control repository.
+ Record the old and new versions and the list of updated source files.
+ See the `CTest Update Step`_ section below.
+
+``Configure``
+ Configure the software by running a command in the build tree.
+ Record the configuration output log.
+ See the `CTest Configure Step`_ section below.
+
+``Build``
+ Build the software by running a command in the build tree.
+ Record the build output log and detect warnings and errors.
+ See the `CTest Build Step`_ section below.
+
+``Test``
+ Test the software by loading a ``CTestTestfile.cmake``
+ from the build tree and executing the defined tests.
+ Record the output and result of each test.
+ See the `CTest Test Step`_ section below.
+
+``Coverage``
+ Compute coverage of the source code by running a coverage
+ analysis tool and recording its output.
+ See the `CTest Coverage Step`_ section below.
+
+``MemCheck``
+ Run the software test suite through a memory check tool.
+ Record the test output, results, and issues reported by the tool.
+ See the `CTest MemCheck Step`_ section below.
+
+``Submit``
+ Submit results recorded from other testing steps to the
+ software quality dashboard server.
+ See the `CTest Submit Step`_ section below.
+
+Dashboard Client Modes
+----------------------
+
+CTest defines three modes of operation as a dashboard client:
+
+``Nightly``
+ This mode is intended to be invoked once per day, typically at night.
+ It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
+ ``Coverage``, and ``Submit`` steps by default. Selected steps run even
+ if the ``Update`` step reports no changes to the source tree.
+
+``Continuous``
+ This mode is intended to be invoked repeatedly throughout the day.
+ It enables the ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
+ ``Coverage``, and ``Submit`` steps by default, but exits after the
+ ``Update`` step if it reports no changes to the source tree.
+
+``Experimental``
+ This mode is intended to be invoked by a developer to test local changes.
+ It enables the ``Start``, ``Configure``, ``Build``, ``Test``, ``Coverage``,
+ and ``Submit`` steps by default.
+
+Dashboard Client via CTest Command-Line
+---------------------------------------
+
+CTest can perform testing on an already-generated build tree.
+Run the ``ctest`` command with the current working directory set
+to the build tree and use one of these signatures::
+
+ ctest -D <mode>[<step>]
+ ctest -M <mode> [ -T <step> ]...
+
+The ``<mode>`` must be one of the above `Dashboard Client Modes`_,
+and each ``<step>`` must be one of the above `Dashboard Client Steps`_.
+
+CTest reads the `Dashboard Client Configuration`_ settings from
+a file in the build tree called either ``CTestConfiguration.ini``
+or ``DartConfiguration.tcl`` (the names are historical). The format
+of the file is::
+
+ # Lines starting in '#' are comments.
+ # Other non-blank lines are key-value pairs.
+ <setting>: <value>
+
+where ``<setting>`` is the setting name and ``<value>`` is the
+setting value.
+
+In build trees generated by CMake, this configuration file is
+generated by the :module:`CTest` module if included by the project.
+The module uses variables to obtain a value for each setting
+as documented with the settings below.
+
+.. _`CTest Script`:
+
+Dashboard Client via CTest Script
+---------------------------------
+
+CTest can perform testing driven by a :manual:`cmake-language(7)`
+script that creates and maintains the source and build tree as
+well as performing the testing steps. Run the ``ctest`` command
+with the current working directory set outside of any build tree
+and use one of these signatures::
+
+ ctest -S <script>
+ ctest -SP <script>
+
+The ``<script>`` file must call :ref:`CTest Commands` commands
+to run testing steps explicitly as documented below. The commands
+obtain `Dashboard Client Configuration`_ settings from their
+arguments or from variables set in the script.
+
+Dashboard Client Configuration
+==============================
+
+The `Dashboard Client Steps`_ may be configured by named
+settings as documented in the following sections.
+
+.. _`CTest Start Step`:
+
+CTest Start Step
+----------------
+
+Start a new dashboard submission to be composed of results recorded
+by the following steps.
+
+In a `CTest Script`_, the :command:`ctest_start` command runs this step.
+Arguments to the command may specify some of the step settings.
+The command first runs the command-line specified by the
+``CTEST_CHECKOUT_COMMAND`` variable, if set, to initialize the source
+directory.
+
+Configuration settings include:
+
+``BuildDirectory``
+ The full path to the project build tree.
+
+ * `CTest Script`_ variable: :variable:`CTEST_BINARY_DIRECTORY`
+ * :module:`CTest` module variable: :variable:`PROJECT_BINARY_DIR`
+
+``SourceDirectory``
+ The full path to the project source tree.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SOURCE_DIRECTORY`
+ * :module:`CTest` module variable: :variable:`PROJECT_SOURCE_DIR`
+
+.. _`CTest Update Step`:
+
+CTest Update Step
+-----------------
+
+In a `CTest Script`_, the :command:`ctest_update` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings to specify the version control tool include:
+
+``BZRCommand``
+ ``bzr`` command-line tool to use if source tree is managed by Bazaar.
+
+ * `CTest Script`_ variable: :variable:`CTEST_BZR_COMMAND`
+ * :module:`CTest` module variable: none
+
+``BZRUpdateOptions``
+ Command-line options to the ``BZRCommand`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_BZR_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: none
+
+``CVSCommand``
+ ``cvs`` command-line tool to use if source tree is managed by CVS.
+
+ * `CTest Script`_ variable: :variable:`CTEST_CVS_COMMAND`
+ * :module:`CTest` module variable: ``CVSCOMMAND``
+
+``CVSUpdateOptions``
+ Command-line options to the ``CVSCommand`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_CVS_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: ``CVS_UPDATE_OPTIONS``
+
+``GITCommand``
+ ``git`` command-line tool to use if source tree is managed by Git.
+
+ * `CTest Script`_ variable: :variable:`CTEST_GIT_COMMAND`
+ * :module:`CTest` module variable: ``GITCOMMAND``
+
+``GITUpdateCustom``
+ Specify a semicolon-separated list of custom command lines to run
+ in the source tree (Git work tree) to update it instead of running
+ the ``GITCommand``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_CUSTOM`
+ * :module:`CTest` module variable: ``CTEST_GIT_UPDATE_CUSTOM``
+
+``GITUpdateOptions``
+ Command-line options to the ``GITCommand`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_GIT_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: ``GIT_UPDATE_OPTIONS``
+
+``HGCommand``
+ ``hg`` command-line tool to use if source tree is managed by Mercurial.
+
+ * `CTest Script`_ variable: :variable:`CTEST_HG_COMMAND`
+ * :module:`CTest` module variable: none
+
+``HGUpdateOptions``
+ Command-line options to the ``HGCommand`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_HG_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: none
+
+``P4Client``
+ Value of the ``-c`` option to the ``P4Command``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_P4_CLIENT`
+ * :module:`CTest` module variable: ``CTEST_P4_CLIENT``
+
+``P4Command``
+ ``p4`` command-line tool to use if source tree is managed by Perforce.
+
+ * `CTest Script`_ variable: :variable:`CTEST_P4_COMMAND`
+ * :module:`CTest` module variable: ``P4COMMAND``
+
+``P4Options``
+ Command-line options to the ``P4Command`` for all invocations.
+
+ * `CTest Script`_ variable: :variable:`CTEST_P4_OPTIONS`
+ * :module:`CTest` module variable: ``CTEST_P4_OPTIONS``
+
+``P4UpdateCustom``
+ Specify a semicolon-separated list of custom command lines to run
+ in the source tree (Perforce tree) to update it instead of running
+ the ``P4Command``.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``CTEST_P4_UPDATE_CUSTOM``
+
+``P4UpdateOptions``
+ Command-line options to the ``P4Command`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_P4_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: ``CTEST_P4_UPDATE_OPTIONS``
+
+``SVNCommand``
+ ``svn`` command-line tool to use if source tree is managed by Subversion.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SVN_COMMAND`
+ * :module:`CTest` module variable: ``SVNCOMMAND``
+
+``SVNOptions``
+ Command-line options to the ``SVNCommand`` for all invocations.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SVN_OPTIONS`
+ * :module:`CTest` module variable: ``CTEST_SVN_OPTIONS``
+
+``SVNUpdateOptions``
+ Command-line options to the ``SVNCommand`` when updating the source.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SVN_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: ``SVN_UPDATE_OPTIONS``
+
+``UpdateCommand``
+ Specify the version-control command-line tool to use without
+ detecting the VCS that manages the source tree.
+
+ * `CTest Script`_ variable: :variable:`CTEST_UPDATE_COMMAND`
+ * :module:`CTest` module variable: ``<VCS>COMMAND``
+ when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_COMMAND``
+
+``UpdateOptions``
+ Command-line options to the ``UpdateCommand``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_UPDATE_OPTIONS`
+ * :module:`CTest` module variable: ``<VCS>_UPDATE_OPTIONS``
+ when ``UPDATE_TYPE`` is ``<vcs>``, else ``UPDATE_OPTIONS``
+
+``UpdateType``
+ Specify the version-control system that manages the source
+ tree if it cannot be detected automatically.
+ The value may be ``bzr``, ``cvs``, ``git``, ``hg``,
+ ``p4``, or ``svn``.
+
+ * `CTest Script`_ variable: none, detected from source tree
+ * :module:`CTest` module variable: ``UPDATE_TYPE`` if set,
+ else ``CTEST_UPDATE_TYPE``
+
+Additional configuration settings include:
+
+``NightlyStartTime``
+ In the ``Nightly`` dashboard mode, specify the "nightly start time".
+ With centralized version control systems (``cvs`` and ``svn``),
+ the ``Update`` step checks out the version of the software as of
+ this time so that multiple clients choose a common version to test.
+ This is not well-defined in distributed version-control systems so
+ the setting is ignored.
+
+ * `CTest Script`_ variable: :variable:`CTEST_NIGHTLY_START_TIME`
+ * :module:`CTest` module variable: ``NIGHTLY_START_TIME`` if set,
+ else ``CTEST_NIGHTLY_START_TIME``
+
+.. _`CTest Configure Step`:
+
+CTest Configure Step
+--------------------
+
+In a `CTest Script`_, the :command:`ctest_configure` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``ConfigureCommand``
+ Command-line to launch the software configuration process.
+ It will be executed in the location specified by the
+ ``BuildDirectory`` setting.
+
+ * `CTest Script`_ variable: :variable:`CTEST_CONFIGURE_COMMAND`
+ * :module:`CTest` module variable: :variable:`CMAKE_COMMAND`
+ followed by :variable:`PROJECT_SOURCE_DIR`
+
+.. _`CTest Build Step`:
+
+CTest Build Step
+----------------
+
+In a `CTest Script`_, the :command:`ctest_build` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``DefaultCTestConfigurationType``
+ When the build system to be launched allows build-time selection
+ of the configuration (e.g. ``Debug``, ``Release``), this specifies
+ the default configuration to be built when no ``-C`` option is
+ given to the ``ctest`` command. The value will be substituted into
+ the value of ``MakeCommand`` to replace the literal string
+ ``${CTEST_CONFIGURATION_TYPE}`` if it appears.
+
+ * `CTest Script`_ variable: :variable:`CTEST_CONFIGURATION_TYPE`
+ * :module:`CTest` module variable: ``DEFAULT_CTEST_CONFIGURATION_TYPE``,
+ initialized by the ``CMAKE_CONFIG_TYPE`` environment variable
+
+``MakeCommand``
+ Command-line to launch the software build process.
+ It will be executed in the location specified by the
+ ``BuildDirectory`` setting.
+
+ * `CTest Script`_ variable: :variable:`CTEST_BUILD_COMMAND`
+ * :module:`CTest` module variable: ``MAKECOMMAND``,
+ initialized by the :command:`build_command` command
+
+``UseLaunchers``
+ For build trees generated by CMake using a Makefile generator
+ or the :generator:`Ninja` generator, specify whether the
+ ``CTEST_USE_LAUNCHERS`` feature is enabled by the
+ :module:`CTestUseLaunchers` module (also included by the
+ :module:`CTest` module). When enabled, the generated build
+ system wraps each invocation of the compiler, linker, or
+ custom command line with a "launcher" that communicates
+ with CTest via environment variables and files to report
+ granular build warning and error information. Otherwise,
+ CTest must "scrape" the build output log for diagnostics.
+
+ * `CTest Script`_ variable: :variable:`CTEST_USE_LAUNCHERS`
+ * :module:`CTest` module variable: ``CTEST_USE_LAUNCHERS``
+
+.. _`CTest Test Step`:
+
+CTest Test Step
+---------------
+
+In a `CTest Script`_, the :command:`ctest_test` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``TimeOut``
+ The default timeout for each test if not specified by the
+ :prop_test:`TIMEOUT` test property.
+
+ * `CTest Script`_ variable: :variable:`CTEST_TEST_TIMEOUT`
+ * :module:`CTest` module variable: ``DART_TESTING_TIMEOUT``
+
+.. _`CTest Coverage Step`:
+
+CTest Coverage Step
+-------------------
+
+In a `CTest Script`_, the :command:`ctest_coverage` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``CoverageCommand``
+ Command-line tool to perform software coverage analysis.
+ It will be executed in the location specified by the
+ ``BuildDirectory`` setting.
+
+ * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_COMMAND`
+ * :module:`CTest` module variable: ``COVERAGE_COMMAND``
+
+``CoverageExtraFlags``
+ Specify command-line options to the ``CoverageCommand`` tool.
+
+ * `CTest Script`_ variable: :variable:`CTEST_COVERAGE_EXTRA_FLAGS`
+ * :module:`CTest` module variable: ``COVERAGE_EXTRA_FLAGS``
+
+.. _`CTest MemCheck Step`:
+
+CTest MemCheck Step
+-------------------
+
+In a `CTest Script`_, the :command:`ctest_memcheck` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``MemoryCheckCommand``
+ Command-line tool to perform dynamic analysis. Test command lines
+ will be launched through this tool.
+
+ * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND`
+ * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND``
+
+``MemoryCheckCommandOptions``
+ Specify command-line options to the ``MemoryCheckCommand`` tool.
+ They will be placed prior to the test command line.
+
+ * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_COMMAND_OPTIONS`
+ * :module:`CTest` module variable: ``MEMORYCHECK_COMMAND_OPTIONS``
+
+``MemoryCheckSuppressionFile``
+ Specify a file containing suppression rules for the
+ ``MemoryCheckCommand`` tool. It will be passed with options
+ appropriate to the tool.
+
+ * `CTest Script`_ variable: :variable:`CTEST_MEMORYCHECK_SUPPRESSIONS_FILE`
+ * :module:`CTest` module variable: ``MEMORYCHECK_SUPPRESSIONS_FILE``
+
+Additional configuration settings include:
+
+``BoundsCheckerCommand``
+ Specify a ``MemoryCheckCommand`` that is known to be command-line
+ compatible with Bounds Checker.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: none
+
+``PurifyCommand``
+ Specify a ``MemoryCheckCommand`` that is known to be command-line
+ compatible with Purify.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``PURIFYCOMMAND``
+
+``ValgrindCommand``
+ Specify a ``MemoryCheckCommand`` that is known to be command-line
+ compatible with Valgrind.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``VALGRIND_COMMAND``
+
+``ValgrindCommandOptions``
+ Specify command-line options to the ``ValgrindCommand`` tool.
+ They will be placed prior to the test command line.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``VALGRIND_COMMAND_OPTIONS``
+
+.. _`CTest Submit Step`:
+
+CTest Submit Step
+-----------------
+
+In a `CTest Script`_, the :command:`ctest_submit` command runs this step.
+Arguments to the command may specify some of the step settings.
+
+Configuration settings include:
+
+``BuildName``
+ Describe the dashboard client platform with a short string.
+ (Operating system, compiler, etc.)
+
+ * `CTest Script`_ variable: :variable:`CTEST_BUILD_NAME`
+ * :module:`CTest` module variable: ``BUILDNAME``
+
+``CDashVersion``
+ Specify the version of `CDash`_ on the server.
+
+ * `CTest Script`_ variable: none, detected from server
+ * :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
+
+``CTestSubmitRetryCount``
+ Specify a number of attempts to retry submission on network failure.
+
+ * `CTest Script`_ variable: none,
+ use the :command:`ctest_submit` ``RETRY_COUNT`` option.
+ * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_COUNT``
+
+``CTestSubmitRetryDelay``
+ Specify a delay before retrying submission on network failure.
+
+ * `CTest Script`_ variable: none,
+ use the :command:`ctest_submit` ``RETRY_DELAY`` option.
+ * :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_DELAY``
+
+``CurlOptions``
+ Specify a semicolon-separated list of options to control the
+ Curl library that CTest uses internally to connect to the
+ server. Possible options are ``CURLOPT_SSL_VERIFYPEER_OFF``
+ and ``CURLOPT_SSL_VERIFYHOST_OFF``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_CURL_OPTIONS`
+ * :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
+
+``DropLocation``
+ The path on the dashboard server to send the submission.
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
+ * :module:`CTest` module variable: ``DROP_LOCATION`` if set,
+ else ``CTEST_DROP_LOCATION``
+
+``DropMethod``
+ Specify the method by which results should be submitted to the
+ dashboard server. The value may be ``cp``, ``ftp``, ``http``,
+ ``https``, ``scp``, or ``xmlrpc`` (if CMake was built with
+ support for it).
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
+ * :module:`CTest` module variable: ``DROP_METHOD`` if set,
+ else ``CTEST_DROP_METHOD``
+
+``DropSite``
+ The dashboard server name
+ (for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``).
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
+ * :module:`CTest` module variable: ``DROP_SITE`` if set,
+ else ``CTEST_DROP_SITE``
+
+``DropSitePassword``
+ The dashboard server login password, if any
+ (for ``ftp``, ``http``, and ``https``).
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
+ * :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
+ else ``CTEST_DROP_SITE_PASWORD``
+
+``DropSiteUser``
+ The dashboard server login user name, if any
+ (for ``ftp``, ``http``, and ``https``).
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
+ * :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
+ else ``CTEST_DROP_SITE_USER``
+
+``IsCDash``
+ Specify whether the dashboard server is `CDash`_ or an older
+ dashboard server implementation requiring ``TriggerSite``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
+ * :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
+
+``ScpCommand``
+ ``scp`` command-line tool to use when ``DropMethod`` is ``scp``.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
+ * :module:`CTest` module variable: ``SCPCOMMAND``
+
+``Site``
+ Describe the dashboard client host site with a short string.
+ (Hostname, domain, etc.)
+
+ * `CTest Script`_ variable: :variable:`CTEST_SITE`
+ * :module:`CTest` module variable: ``SITE``,
+ initialized by the :command:`site_name` command
+
+``TriggerSite``
+ Legacy option to support older dashboard server implementations.
+ Not used when ``IsCDash`` is true.
+
+ * `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
+ * :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
+ else ``CTEST_TRIGGER_SITE``
+
See Also
========
diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst
index ad664b0..6767d08 100644
--- a/Help/policy/CMP0020.rst
+++ b/Help/policy/CMP0020.rst
@@ -16,7 +16,7 @@ this automatic linking will need to be disabled as per the
documentation.
The OLD behavior for this policy is not to link executables to
-qtmain.lib automatically when they link to the QtCore IMPORTEDtarget.
+qtmain.lib automatically when they link to the QtCore IMPORTED target.
The NEW behavior for this policy is to link executables to qtmain.lib
automatically when they link to QtCore IMPORTED target.
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index cf35467..bdeabdb 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -185,7 +185,7 @@ The features known to this version of CMake are:
.. _N3050: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
``cxx_nonstatic_member_init``
- Non-static data member initialization, as defined in N2756.
+ Non-static data member initialization, as defined in N2756_.
.. _N2756: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst
index d7f87a4..67c5cb0 100644
--- a/Help/prop_tgt/CXX_EXTENSIONS.rst
+++ b/Help/prop_tgt/CXX_EXTENSIONS.rst
@@ -5,7 +5,8 @@ Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
used. For some compilers, this results in adding a flag such
-as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line.
+as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line. This
+property is ``ON`` by default.
See the :manual:`cmake-compile-features(7)` manual for information on
compile features.
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index 8f299bb..b50cdf9 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -5,7 +5,7 @@ The C++ standard whose features are requested to build this target.
This property specifies the C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
-flag such as ``-std=c++11`` to the compile line.
+flag such as ``-std=gnu++11`` to the compile line.
Supported values are ``98`` and ``11``.
@@ -17,9 +17,9 @@ means that using:
set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
-with a compiler which does not support ``-std=c++11`` or an equivalent
+with a compiler which does not support ``-std=gnu++11`` or an equivalent
flag will not result in an error or warning, but will instead add the
-``-std=c++98`` flag if supported. This "decay" behavior may be controlled
+``-std=gnu++98`` flag if supported. This "decay" behavior may be controlled
with the :prop_tgt:`CXX_STANDARD_REQUIRED` target property.
See the :manual:`cmake-compile-features(7)` manual for information on
diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst
index 0772ecc..dc48cc6 100644
--- a/Help/prop_tgt/C_EXTENSIONS.rst
+++ b/Help/prop_tgt/C_EXTENSIONS.rst
@@ -5,7 +5,8 @@ Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
used. For some compilers, this results in adding a flag such
-as ``-std=gnu11`` instead of ``-std=c11`` to the compile line.
+as ``-std=gnu11`` instead of ``-std=c11`` to the compile line. This
+property is ``ON`` by default.
See the :manual:`cmake-compile-features(7)` manual for information on
compile features.
diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst
index a0c939a..88ca926 100644
--- a/Help/prop_tgt/C_STANDARD.rst
+++ b/Help/prop_tgt/C_STANDARD.rst
@@ -5,7 +5,7 @@ The C standard whose features are requested to build this target.
This property specifies the C standard whose features are requested
to build this target. For some compilers, this results in adding a
-flag such as ``-std=c11`` to the compile line.
+flag such as ``-std=gnu11`` to the compile line.
Supported values are ``90``, ``99`` and ``11``.
@@ -17,9 +17,9 @@ means that using:
set_property(TARGET tgt PROPERTY C_STANDARD 11)
-with a compiler which does not support ``-std=c11`` or an equivalent
+with a compiler which does not support ``-std=gnu11`` or an equivalent
flag will not result in an error or warning, but will instead add the
-``-std=c99`` or ``-std=c90`` flag if supported. This "decay" behavior may
+``-std=gnu99`` or ``-std=gnu90`` flag if supported. This "decay" behavior may
be controlled with the :prop_tgt:`C_STANDARD_REQUIRED` target property.
See the :manual:`cmake-compile-features(7)` manual for information on
diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
index bf4ab46..899e821 100644
--- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
@@ -3,6 +3,10 @@ INTERFACE_INCLUDE_DIRECTORIES
List of public include directories for a library.
+The :command:`target_include_directories` command populates this property
+with values given to the ``PUBLIC`` and ``INTERFACE`` keywords. Projects
+may also get and set the property directly.
+
Targets may populate this property to publish the include directories
required to compile against the headers for the target. Consuming
targets can add entries to their own :prop_tgt:`INCLUDE_DIRECTORIES`
@@ -13,3 +17,17 @@ Contents of ``INTERFACE_INCLUDE_DIRECTORIES`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
+
+Include directories usage requirements commonly differ between the build-tree
+and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
+generator expressions can be used to describe separate usage requirements
+based on the usage location. Relative paths are allowed within the
+``INSTALL_INTERFACE`` expression and are interpreted relative to the
+installation prefix. For example:
+
+.. code-block:: cmake
+
+ set_property(TARGET mylib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
+ $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
+ )
diff --git a/Help/release/dev/FindOpenGL-target.rst b/Help/release/dev/FindOpenGL-target.rst
new file mode 100644
index 0000000..670507e
--- /dev/null
+++ b/Help/release/dev/FindOpenGL-target.rst
@@ -0,0 +1,5 @@
+FindOpenGL-target
+-----------------
+
+* The :module:`FindOpenGL` module now provides imported targets
+ ``OpenGL::GL`` and ``OpenGL::GLU`` when the libraries are found.
diff --git a/Help/release/dev/OpenWatcom.rst b/Help/release/dev/OpenWatcom.rst
new file mode 100644
index 0000000..63f6e8c
--- /dev/null
+++ b/Help/release/dev/OpenWatcom.rst
@@ -0,0 +1,9 @@
+OpenWatcom
+----------
+
+* Support for the Open Watcom compiler has been overhauled.
+ The :variable:`CMAKE_<LANG>_COMPILER_ID` is now ``OpenWatcom``,
+ and the :variable:`CMAKE_<LANG>_COMPILER_VERSION` now uses
+ the Open Watcom external version numbering. The external
+ version numbers are lower than the internal version number
+ by 11.
diff --git a/Help/release/dev/delay-generator-toolset.rst b/Help/release/dev/delay-generator-toolset.rst
new file mode 100644
index 0000000..0512834
--- /dev/null
+++ b/Help/release/dev/delay-generator-toolset.rst
@@ -0,0 +1,8 @@
+delay-generator-toolset
+-----------------------
+
+* The :variable:`CMAKE_GENERATOR_TOOLSET` variable may now be
+ initialized in a toolchain file specified by the
+ :variable:`CMAKE_TOOLCHAIN_FILE` variable. This is useful
+ when cross-compiling with the Xcode or Visual Studio
+ generators.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index 4540eaa..9ccc8b3 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -7,3 +7,9 @@ Some CMake generators support a toolset name to be given to the native
build system to choose a compiler. If the user specifies a toolset
name (e.g. via the cmake -T option) the value will be available in
this variable.
+
+The value of this variable should never be modified by project code.
+A toolchain file specified by the :variable:`CMAKE_TOOLCHAIN_FILE`
+variable may initialize ``CMAKE_GENERATOR_TOOLSET``. Once a given
+build tree has been initialized with a particular value for this
+variable, changing the value has undefined behavior.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index cf9c386..f554f4e 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -20,13 +20,13 @@ include:
Intel = Intel Compiler (intel.com)
MIPSpro = SGI MIPSpro (sgi.com)
MSVC = Microsoft Visual Studio (microsoft.com)
+ OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
PathScale = PathScale (pathscale.com)
SDCC = Small Device C Compiler (sdcc.sourceforge.net)
SunPro = Oracle Solaris Studio (oracle.com)
TI = Texas Instruments (ti.com)
TinyCC = Tiny C Compiler (tinycc.org)
- Watcom = Open Watcom (openwatcom.org)
XL, VisualAge, zOS = IBM XL (ibm.com)
This variable is not guaranteed to be defined for all compilers or
diff --git a/Help/variable/CTEST_BINARY_DIRECTORY.rst b/Help/variable/CTEST_BINARY_DIRECTORY.rst
new file mode 100644
index 0000000..fd8461f
--- /dev/null
+++ b/Help/variable/CTEST_BINARY_DIRECTORY.rst
@@ -0,0 +1,5 @@
+CTEST_BINARY_DIRECTORY
+----------------------
+
+Specify the CTest ``BuildDirectory`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BUILD_COMMAND.rst b/Help/variable/CTEST_BUILD_COMMAND.rst
new file mode 100644
index 0000000..7b13ba0
--- /dev/null
+++ b/Help/variable/CTEST_BUILD_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_BUILD_COMMAND
+-------------------
+
+Specify the CTest ``MakeCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BUILD_NAME.rst b/Help/variable/CTEST_BUILD_NAME.rst
new file mode 100644
index 0000000..d25d84c
--- /dev/null
+++ b/Help/variable/CTEST_BUILD_NAME.rst
@@ -0,0 +1,5 @@
+CTEST_BUILD_NAME
+----------------
+
+Specify the CTest ``BuildName`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BZR_COMMAND.rst b/Help/variable/CTEST_BZR_COMMAND.rst
new file mode 100644
index 0000000..474d621
--- /dev/null
+++ b/Help/variable/CTEST_BZR_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_BZR_COMMAND
+-----------------
+
+Specify the CTest ``BZRCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..d0f9579
--- /dev/null
+++ b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_BZR_UPDATE_OPTIONS
+------------------------
+
+Specify the CTest ``BZRUpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CHECKOUT_COMMAND.rst b/Help/variable/CTEST_CHECKOUT_COMMAND.rst
new file mode 100644
index 0000000..da256f2
--- /dev/null
+++ b/Help/variable/CTEST_CHECKOUT_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_CHECKOUT_COMMAND
+----------------------
+
+Tell the :command:`ctest_start` command how to checkout or initialize
+the source directory in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CONFIGURATION_TYPE.rst b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
new file mode 100644
index 0000000..c905480
--- /dev/null
+++ b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
@@ -0,0 +1,5 @@
+CTEST_CONFIGURATION_TYPE
+------------------------
+
+Specify the CTest ``DefaultCTestConfigurationType`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CONFIGURE_COMMAND.rst b/Help/variable/CTEST_CONFIGURE_COMMAND.rst
new file mode 100644
index 0000000..5561b6d
--- /dev/null
+++ b/Help/variable/CTEST_CONFIGURE_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_CONFIGURE_COMMAND
+-----------------------
+
+Specify the CTest ``ConfigureCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_COVERAGE_COMMAND.rst b/Help/variable/CTEST_COVERAGE_COMMAND.rst
new file mode 100644
index 0000000..a669dd7
--- /dev/null
+++ b/Help/variable/CTEST_COVERAGE_COMMAND.rst
@@ -0,0 +1,60 @@
+CTEST_COVERAGE_COMMAND
+----------------------
+
+Specify the CTest ``CoverageCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
+
+Cobertura
+'''''''''
+
+Using `Cobertura`_ as the coverage generation within your multi-module
+Java project can generate a series of XML files.
+
+The Cobertura Coverage parser expects to read the coverage data from a
+single XML file which contains the coverage data for all modules.
+Cobertura has a program with the ability to merge given cobertura.ser files
+and then another program to generate a combined XML file from the previous
+merged file. For command line testing, this can be done by hand prior to
+CTest looking for the coverage files. For script builds,
+set the ``CTEST_COVERAGE_COMMAND`` variable to point to a file which will
+perform these same steps, such as a .sh or .bat file.
+
+.. code-block:: cmake
+
+ set(CTEST_COVERAGE_COMMAND .../run-coverage-and-consolidate.sh)
+
+where the ``run-coverage-and-consolidate.sh`` script is perhaps created by
+the :command:`configure_file` command and might contain the following code:
+
+.. code-block:: bash
+
+ #!/usr/bin/env bash
+ CoberturaFiles="$(find "/path/to/source" -name "cobertura.ser")"
+ SourceDirs="$(find "/path/to/source" -name "java" -type d)"
+ cobertura-merge --datafile coberturamerge.ser $CoberturaFiles
+ cobertura-report --datafile coberturamerge.ser --destination . \
+ --format xml $SourceDirs
+
+The script uses ``find`` to capture the paths to all of the cobertura.ser files
+found below the project's source directory. It keeps the list of files and
+supplies it as an argument to the ``cobertura-merge`` program. The ``--datafile``
+argument signifies where the result of the merge will be kept.
+
+The combined ``coberturamerge.ser`` file is then used to generate the XML report
+using the ``cobertura-report`` program. The call to the cobertura-report program
+requires some named arguments.
+
+``--datafila``
+ path to the merged .ser file
+
+``--destination``
+ path to put the output files(s)
+
+``--format``
+ file format to write output in: xml or html
+
+The rest of the supplied arguments consist of the full paths to the
+/src/main/java directories of each module within the souce tree. These
+directories are needed and should not be forgotten.
+
+.. _`Cobertura`: http://cobertura.github.io/cobertura/
diff --git a/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst
new file mode 100644
index 0000000..2981955
--- /dev/null
+++ b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst
@@ -0,0 +1,5 @@
+CTEST_COVERAGE_EXTRA_FLAGS
+--------------------------
+
+Specify the CTest ``CoverageExtraFlags`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CURL_OPTIONS.rst b/Help/variable/CTEST_CURL_OPTIONS.rst
new file mode 100644
index 0000000..fc5dfc4
--- /dev/null
+++ b/Help/variable/CTEST_CURL_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_CURL_OPTIONS
+------------------
+
+Specify the CTest ``CurlOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CVS_CHECKOUT.rst b/Help/variable/CTEST_CVS_CHECKOUT.rst
new file mode 100644
index 0000000..6431c02
--- /dev/null
+++ b/Help/variable/CTEST_CVS_CHECKOUT.rst
@@ -0,0 +1,4 @@
+CTEST_CVS_CHECKOUT
+------------------
+
+Deprecated. Use :variable:`CTEST_CHECKOUT_COMMAND` instead.
diff --git a/Help/variable/CTEST_CVS_COMMAND.rst b/Help/variable/CTEST_CVS_COMMAND.rst
new file mode 100644
index 0000000..049700b
--- /dev/null
+++ b/Help/variable/CTEST_CVS_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_CVS_COMMAND
+-----------------
+
+Specify the CTest ``CVSCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..d7f2f7c
--- /dev/null
+++ b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_CVS_UPDATE_OPTIONS
+------------------------
+
+Specify the CTest ``CVSUpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_LOCATION.rst b/Help/variable/CTEST_DROP_LOCATION.rst
new file mode 100644
index 0000000..c0f2215
--- /dev/null
+++ b/Help/variable/CTEST_DROP_LOCATION.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_LOCATION
+-------------------
+
+Specify the CTest ``DropLocation`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_METHOD.rst b/Help/variable/CTEST_DROP_METHOD.rst
new file mode 100644
index 0000000..50fbd4d
--- /dev/null
+++ b/Help/variable/CTEST_DROP_METHOD.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_METHOD
+-----------------
+
+Specify the CTest ``DropMethod`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE.rst b/Help/variable/CTEST_DROP_SITE.rst
new file mode 100644
index 0000000..d15d99b
--- /dev/null
+++ b/Help/variable/CTEST_DROP_SITE.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_SITE
+---------------
+
+Specify the CTest ``DropSite`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_CDASH.rst b/Help/variable/CTEST_DROP_SITE_CDASH.rst
new file mode 100644
index 0000000..22b9776
--- /dev/null
+++ b/Help/variable/CTEST_DROP_SITE_CDASH.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_SITE_CDASH
+---------------------
+
+Specify the CTest ``IsCDash`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_PASSWORD.rst b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst
new file mode 100644
index 0000000..904d2c8
--- /dev/null
+++ b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_SITE_PASSWORD
+------------------------
+
+Specify the CTest ``DropSitePassword`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_USER.rst b/Help/variable/CTEST_DROP_SITE_USER.rst
new file mode 100644
index 0000000..a860a03
--- /dev/null
+++ b/Help/variable/CTEST_DROP_SITE_USER.rst
@@ -0,0 +1,5 @@
+CTEST_DROP_SITE_USER
+--------------------
+
+Specify the CTest ``DropSiteUser`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_COMMAND.rst b/Help/variable/CTEST_GIT_COMMAND.rst
new file mode 100644
index 0000000..eb83792
--- /dev/null
+++ b/Help/variable/CTEST_GIT_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_GIT_COMMAND
+-----------------
+
+Specify the CTest ``GITCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst
new file mode 100644
index 0000000..0c479e6
--- /dev/null
+++ b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst
@@ -0,0 +1,5 @@
+CTEST_GIT_UPDATE_CUSTOM
+-----------------------
+
+Specify the CTest ``GITUpdateCustom`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..4590a78
--- /dev/null
+++ b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_GIT_UPDATE_OPTIONS
+------------------------
+
+Specify the CTest ``GITUpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_HG_COMMAND.rst b/Help/variable/CTEST_HG_COMMAND.rst
new file mode 100644
index 0000000..3854950
--- /dev/null
+++ b/Help/variable/CTEST_HG_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_HG_COMMAND
+----------------
+
+Specify the CTest ``HGCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..9049c1f
--- /dev/null
+++ b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_HG_UPDATE_OPTIONS
+-----------------------
+
+Specify the CTest ``HGUpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst
new file mode 100644
index 0000000..8c199ba
--- /dev/null
+++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_MEMORYCHECK_COMMAND
+-------------------------
+
+Specify the CTest ``MemoryCheckCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst
new file mode 100644
index 0000000..3e26ab5
--- /dev/null
+++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_MEMORYCHECK_COMMAND_OPTIONS
+---------------------------------
+
+Specify the CTest ``MemoryCheckCommandOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst
new file mode 100644
index 0000000..1147ee8
--- /dev/null
+++ b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst
@@ -0,0 +1,5 @@
+CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
+-----------------------------------
+
+Specify the CTest ``MemoryCheckSuppressionFile`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_NIGHTLY_START_TIME.rst b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
new file mode 100644
index 0000000..bc80276
--- /dev/null
+++ b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
@@ -0,0 +1,5 @@
+CTEST_NIGHTLY_START_TIME
+------------------------
+
+Specify the CTest ``NightlyStartTime`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_CLIENT.rst b/Help/variable/CTEST_P4_CLIENT.rst
new file mode 100644
index 0000000..347ea54
--- /dev/null
+++ b/Help/variable/CTEST_P4_CLIENT.rst
@@ -0,0 +1,5 @@
+CTEST_P4_CLIENT
+---------------
+
+Specify the CTest ``P4Client`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_COMMAND.rst b/Help/variable/CTEST_P4_COMMAND.rst
new file mode 100644
index 0000000..defab12
--- /dev/null
+++ b/Help/variable/CTEST_P4_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_P4_COMMAND
+----------------
+
+Specify the CTest ``P4Command`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_OPTIONS.rst b/Help/variable/CTEST_P4_OPTIONS.rst
new file mode 100644
index 0000000..fee4ce2
--- /dev/null
+++ b/Help/variable/CTEST_P4_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_P4_OPTIONS
+----------------
+
+Specify the CTest ``P4Options`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..0e2790f
--- /dev/null
+++ b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_P4_UPDATE_OPTIONS
+-----------------------
+
+Specify the CTest ``P4UpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst
new file mode 100644
index 0000000..0f128b1
--- /dev/null
+++ b/Help/variable/CTEST_SCP_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_SCP_COMMAND
+-----------------
+
+Specify the CTest ``SCPCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SITE.rst b/Help/variable/CTEST_SITE.rst
new file mode 100644
index 0000000..8a5ec25
--- /dev/null
+++ b/Help/variable/CTEST_SITE.rst
@@ -0,0 +1,5 @@
+CTEST_SITE
+----------
+
+Specify the CTest ``Site`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SOURCE_DIRECTORY.rst b/Help/variable/CTEST_SOURCE_DIRECTORY.rst
new file mode 100644
index 0000000..b6837d1
--- /dev/null
+++ b/Help/variable/CTEST_SOURCE_DIRECTORY.rst
@@ -0,0 +1,5 @@
+CTEST_SOURCE_DIRECTORY
+----------------------
+
+Specify the CTest ``SourceDirectory`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_COMMAND.rst b/Help/variable/CTEST_SVN_COMMAND.rst
new file mode 100644
index 0000000..af90143
--- /dev/null
+++ b/Help/variable/CTEST_SVN_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_SVN_COMMAND
+-----------------
+
+Specify the CTest ``SVNCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_OPTIONS.rst b/Help/variable/CTEST_SVN_OPTIONS.rst
new file mode 100644
index 0000000..76551dc
--- /dev/null
+++ b/Help/variable/CTEST_SVN_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_SVN_OPTIONS
+-----------------
+
+Specify the CTest ``SVNOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..5f01a19
--- /dev/null
+++ b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_SVN_UPDATE_OPTIONS
+------------------------
+
+Specify the CTest ``SVNUpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TEST_TIMEOUT.rst b/Help/variable/CTEST_TEST_TIMEOUT.rst
new file mode 100644
index 0000000..c031437
--- /dev/null
+++ b/Help/variable/CTEST_TEST_TIMEOUT.rst
@@ -0,0 +1,5 @@
+CTEST_TEST_TIMEOUT
+------------------
+
+Specify the CTest ``TimeOut`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst
new file mode 100644
index 0000000..de92428
--- /dev/null
+++ b/Help/variable/CTEST_TRIGGER_SITE.rst
@@ -0,0 +1,5 @@
+CTEST_TRIGGER_SITE
+------------------
+
+Specify the CTest ``TriggerSite`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_UPDATE_COMMAND.rst b/Help/variable/CTEST_UPDATE_COMMAND.rst
new file mode 100644
index 0000000..90155d0
--- /dev/null
+++ b/Help/variable/CTEST_UPDATE_COMMAND.rst
@@ -0,0 +1,5 @@
+CTEST_UPDATE_COMMAND
+--------------------
+
+Specify the CTest ``UpdateCommand`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_UPDATE_OPTIONS.rst b/Help/variable/CTEST_UPDATE_OPTIONS.rst
new file mode 100644
index 0000000..e43d61d
--- /dev/null
+++ b/Help/variable/CTEST_UPDATE_OPTIONS.rst
@@ -0,0 +1,5 @@
+CTEST_UPDATE_OPTIONS
+--------------------
+
+Specify the CTest ``UpdateOptions`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_USE_LAUNCHERS.rst b/Help/variable/CTEST_USE_LAUNCHERS.rst
new file mode 100644
index 0000000..9f48a2e
--- /dev/null
+++ b/Help/variable/CTEST_USE_LAUNCHERS.rst
@@ -0,0 +1,5 @@
+CTEST_USE_LAUNCHERS
+-------------------
+
+Specify the CTest ``UseLaunchers`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index d8a0d67..7f82a9d 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -17,6 +17,7 @@ function(_readFile file)
get_filename_component(name ${file} NAME_WE)
string(REGEX REPLACE "-.*" "" CompilerId ${name})
set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
+ set(_compiler_id_simulate_${CompilerId} ${_compiler_id_simulate} PARENT_SCOPE)
set(_compiler_id_pp_test_${CompilerId} ${_compiler_id_pp_test} PARENT_SCOPE)
endfunction()
@@ -114,7 +115,9 @@ function(compiler_id_detection outvar lang)
endif()
set(id_content "${pp_if} ${_compiler_id_pp_test_${Id}}\n")
if (CID_ID_STRING)
- set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_ID \"${Id}\"")
+ set(PREFIX ${CID_PREFIX})
+ string(CONFIGURE "${_compiler_id_simulate_${Id}}" SIMULATE_BLOCK @ONLY)
+ set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_ID \"${Id}\"${SIMULATE_BLOCK}")
endif()
if (CID_ID_DEFINE)
set(id_content "${id_content}# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
@@ -122,6 +125,8 @@ function(compiler_id_detection outvar lang)
endif()
if (CID_VERSION_STRINGS)
set(PREFIX ${CID_PREFIX})
+ set(MACRO_DEC DEC)
+ set(MACRO_HEX HEX)
string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
set(id_content "${id_content}${VERSION_BLOCK}\n")
endif()
diff --git a/Modules/CMakeRCCompiler.cmake.in b/Modules/CMakeRCCompiler.cmake.in
index 0fc3142..8257cd6 100644
--- a/Modules/CMakeRCCompiler.cmake.in
+++ b/Modules/CMakeRCCompiler.cmake.in
@@ -1,6 +1,6 @@
set(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
set(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
set(CMAKE_RC_COMPILER_LOADED 1)
-set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
+set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC)
set(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
set(CMAKE_RC_COMPILER_ENV_VAR "RC")
diff --git a/Modules/Compiler/ADSP-DetermineCompiler.cmake b/Modules/Compiler/ADSP-DetermineCompiler.cmake
index 0b5af0d..0340f69 100644
--- a/Modules/Compiler/ADSP-DetermineCompiler.cmake
+++ b/Modules/Compiler/ADSP-DetermineCompiler.cmake
@@ -4,7 +4,7 @@ set(_compiler_id_pp_test "defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFI
set(_compiler_id_version_compute "
#if defined(__VISUALDSPVERSION__)
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__VISUALDSPVERSION__>>24)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__VISUALDSPVERSION__>>16 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__VISUALDSPVERSION__>>8 & 0xFF)
#endif")
diff --git a/Modules/Compiler/AppleClang-DetermineCompiler.cmake b/Modules/Compiler/AppleClang-DetermineCompiler.cmake
index d293b7b..397f95c 100644
--- a/Modules/Compiler/AppleClang-DetermineCompiler.cmake
+++ b/Modules/Compiler/AppleClang-DetermineCompiler.cmake
@@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__)
include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
set(_compiler_id_version_compute "${_compiler_id_version_compute}
-# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__apple_build_version__)")
+# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__apple_build_version__)")
diff --git a/Modules/Compiler/Borland-DetermineCompiler.cmake b/Modules/Compiler/Borland-DetermineCompiler.cmake
index 2e8a948..ef3083b 100644
--- a/Modules/Compiler/Borland-DetermineCompiler.cmake
+++ b/Modules/Compiler/Borland-DetermineCompiler.cmake
@@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__BORLANDC__)")
set(_compiler_id_version_compute "
/* __BORLANDC__ = 0xVRR */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__BORLANDC__>>8)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__BORLANDC__ & 0xFF)")
diff --git a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake
index 9a37a63..08c1230 100644
--- a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake
+++ b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake
@@ -1,11 +1,15 @@
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__clang_major__)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__clang_minor__)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__clang_patchlevel__)
# if defined(_MSC_VER)
-# define @PREFIX@SIMULATE_ID \"MSVC\"
/* _MSC_VER = VVRR */
-# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
+# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
+# endif")
+
+set(_compiler_id_simulate "
+# if defined(_MSC_VER)
+# define @PREFIX@SIMULATE_ID \"MSVC\"
# endif")
diff --git a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake b/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
index e4def4d..2265e5e 100644
--- a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
+++ b/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
@@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__COMO__)")
set(_compiler_id_version_compute "
/* __COMO_VERSION__ = VRR */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__COMO_VERSION__ / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__COMO_VERSION__ % 100)")
diff --git a/Modules/Compiler/Compaq-C-DetermineCompiler.cmake b/Modules/Compiler/Compaq-C-DetermineCompiler.cmake
index 56fedb1..02e99dc 100644
--- a/Modules/Compiler/Compaq-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/Compaq-C-DetermineCompiler.cmake
@@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__DECC)")
set(_compiler_id_version_compute "
/* __DECC_VER = VVRRTPPPP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__DECC_VER/10000000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__DECC_VER/100000 % 100)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__DECC_VER % 10000)")
diff --git a/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake b/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake
index 5855c24..c7d0565 100644
--- a/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake
+++ b/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake
@@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__DECCXX)")
set(_compiler_id_version_compute "
/* __DECCXX_VER = VVRRTPPPP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__DECCXX_VER/10000000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__DECCXX_VER/100000 % 100)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__DECCXX_VER % 10000)")
diff --git a/Modules/Compiler/Cray-DetermineCompiler.cmake b/Modules/Compiler/Cray-DetermineCompiler.cmake
index 6e4eaf9..881b82c 100644
--- a/Modules/Compiler/Cray-DetermineCompiler.cmake
+++ b/Modules/Compiler/Cray-DetermineCompiler.cmake
@@ -2,5 +2,5 @@
set(_compiler_id_pp_test "defined(_CRAYC)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_RELEASE)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_RELEASE)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_RELEASE_MINOR)")
diff --git a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
index f52d79b..2feedac 100644
--- a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
+++ b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
@@ -2,6 +2,6 @@
set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)")
diff --git a/Modules/Compiler/GNU-DetermineCompiler.cmake b/Modules/Compiler/GNU-DetermineCompiler.cmake
index f0c25dd..261f148 100644
--- a/Modules/Compiler/GNU-DetermineCompiler.cmake
+++ b/Modules/Compiler/GNU-DetermineCompiler.cmake
@@ -2,8 +2,8 @@
set(_compiler_id_pp_test "defined(__GNUC__)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__GNUC__)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__GNUC_PATCHLEVEL__)
# endif")
diff --git a/Modules/Compiler/HP-C-DetermineCompiler.cmake b/Modules/Compiler/HP-C-DetermineCompiler.cmake
index 024a658..4269799 100644
--- a/Modules/Compiler/HP-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/HP-C-DetermineCompiler.cmake
@@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__HP_cc)")
set(_compiler_id_version_compute "
/* __HP_cc = VVRRPP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_cc % 100)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__HP_cc/10000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__HP_cc/100 % 100)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__HP_cc % 100)")
diff --git a/Modules/Compiler/HP-CXX-DetermineCompiler.cmake b/Modules/Compiler/HP-CXX-DetermineCompiler.cmake
index 6999492..3d4d7e4 100644
--- a/Modules/Compiler/HP-CXX-DetermineCompiler.cmake
+++ b/Modules/Compiler/HP-CXX-DetermineCompiler.cmake
@@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__HP_aCC)")
set(_compiler_id_version_compute "
/* __HP_aCC = VVRRPP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__HP_aCC/10000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__HP_aCC/100 % 100)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__HP_aCC % 100)")
diff --git a/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake b/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
index 6169ab4..899e284 100644
--- a/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
+++ b/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
@@ -1,6 +1,6 @@
set(_compiler_id_version_compute "
/* __IBMC__ = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMC__/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMC__/10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMC__ % 10)")
diff --git a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake
index f673d72..73aa2b4 100644
--- a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake
+++ b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake
@@ -1,6 +1,6 @@
set(_compiler_id_version_compute "
/* __IBMCPP__ = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__IBMCPP__/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__IBMCPP__/10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__IBMCPP__ % 10)")
diff --git a/Modules/Compiler/Intel-DetermineCompiler.cmake b/Modules/Compiler/Intel-DetermineCompiler.cmake
index 6fada1c..d7e4532 100644
--- a/Modules/Compiler/Intel-DetermineCompiler.cmake
+++ b/Modules/Compiler/Intel-DetermineCompiler.cmake
@@ -3,20 +3,24 @@ set(_compiler_id_pp_test "defined(__INTEL_COMPILER) || defined(__ICC)")
set(_compiler_id_version_compute "
/* __INTEL_COMPILER = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_COMPILER/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_COMPILER/10 % 10)
# if defined(__INTEL_COMPILER_UPDATE)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER_UPDATE)
# else
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER % 10)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
+# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)
-# define @PREFIX@SIMULATE_ID \"MSVC\"
/* _MSC_VER = VVRR */
-# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
+# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
+# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
+# endif")
+
+set(_compiler_id_simulate "
+# if defined(_MSC_VER)
+# define @PREFIX@SIMULATE_ID \"MSVC\"
# endif")
diff --git a/Modules/Compiler/MIPSpro-DetermineCompiler.cmake b/Modules/Compiler/MIPSpro-DetermineCompiler.cmake
index 31eb345..9e48553 100644
--- a/Modules/Compiler/MIPSpro-DetermineCompiler.cmake
+++ b/Modules/Compiler/MIPSpro-DetermineCompiler.cmake
@@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VE
set(_compiler_id_version_compute "
# if defined(_SGI_COMPILER_VERSION)
/* _SGI_COMPILER_VERSION = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_SGI_COMPILER_VERSION/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_SGI_COMPILER_VERSION/10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_SGI_COMPILER_VERSION % 10)
# else
/* _COMPILER_VERSION = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_COMPILER_VERSION/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_COMPILER_VERSION/10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_COMPILER_VERSION % 10)
# endif")
diff --git a/Modules/Compiler/MSVC-DetermineCompiler.cmake b/Modules/Compiler/MSVC-DetermineCompiler.cmake
index d462d07..313de89 100644
--- a/Modules/Compiler/MSVC-DetermineCompiler.cmake
+++ b/Modules/Compiler/MSVC-DetermineCompiler.cmake
@@ -3,17 +3,17 @@ set(_compiler_id_pp_test "defined(_MSC_VER)")
set(_compiler_id_version_compute "
/* _MSC_VER = VVRR */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(_MSC_VER / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(_MSC_VER % 100)
# if defined(_MSC_FULL_VER)
# if _MSC_VER >= 1400
/* _MSC_FULL_VER = VVRRPPPPP */
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 100000)
# else
/* _MSC_FULL_VER = VVRRPPPP */
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(_MSC_FULL_VER % 10000)
# endif
# endif
# if defined(_MSC_BUILD)
-# define @PREFIX@COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
+# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(_MSC_BUILD)
# endif")
diff --git a/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake b/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
index 6d416c1..2ed116c 100644
--- a/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
+++ b/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
@@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__)")
set(_compiler_id_version_compute "
/* __WATCOMC__ = VVRP + 1100 */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__WATCOMC__ - 1100) / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
# endif")
diff --git a/Modules/Compiler/PGI-DetermineCompiler.cmake b/Modules/Compiler/PGI-DetermineCompiler.cmake
index 8e68bd6..8d3dc9c 100644
--- a/Modules/Compiler/PGI-DetermineCompiler.cmake
+++ b/Modules/Compiler/PGI-DetermineCompiler.cmake
@@ -2,8 +2,8 @@
set(_compiler_id_pp_test "defined(__PGI)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PGIC__)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PGIC_PATCHLEVEL__)
# endif")
diff --git a/Modules/Compiler/PathScale-DetermineCompiler.cmake b/Modules/Compiler/PathScale-DetermineCompiler.cmake
index 3335e26..4eb81de 100644
--- a/Modules/Compiler/PathScale-DetermineCompiler.cmake
+++ b/Modules/Compiler/PathScale-DetermineCompiler.cmake
@@ -2,8 +2,8 @@
set(_compiler_id_pp_test "defined(__PATHCC__)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__PATHCC__)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__PATHCC_PATCHLEVEL__)
# endif")
diff --git a/Modules/Compiler/SDCC-C-DetermineCompiler.cmake b/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
index 8fe60d9..1d7dd78 100644
--- a/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
@@ -5,6 +5,6 @@ set(_compiler_id_pp_test "defined(SDCC)")
set(_compiler_id_version_compute "
/* SDCC = VRP */
-# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
-# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(SDCC % 10)")
+# define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
+# define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
+# define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC % 10)")
diff --git a/Modules/Compiler/SunPro-C-DetermineCompiler.cmake b/Modules/Compiler/SunPro-C-DetermineCompiler.cmake
index 7db1a97..e9d7457 100644
--- a/Modules/Compiler/SunPro-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/SunPro-C-DetermineCompiler.cmake
@@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(__SUNPRO_C)")
set(_compiler_id_version_compute "
# if __SUNPRO_C >= 0x5100
/* __SUNPRO_C = 0xVRRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>12)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_C>>8)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_C>>4 & 0xF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_C & 0xF)
# endif")
diff --git a/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake b/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake
index 0a48cc6..5c23a95 100644
--- a/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake
+++ b/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake
@@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(__SUNPRO_CC)")
set(_compiler_id_version_compute "
# if __SUNPRO_CC >= 0x5100
/* __SUNPRO_CC = 0xVRRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>12)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC & 0xF)
# else
/* __SUNPRO_CC = 0xVRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
-# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
-# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__SUNPRO_CC>>8)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__SUNPRO_CC>>4 & 0xF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__SUNPRO_CC & 0xF)
# endif")
diff --git a/Modules/Compiler/TI-DetermineCompiler.cmake b/Modules/Compiler/TI-DetermineCompiler.cmake
index 1856c9b..19aa9e3 100644
--- a/Modules/Compiler/TI-DetermineCompiler.cmake
+++ b/Modules/Compiler/TI-DetermineCompiler.cmake
@@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__TI_COMPILER_VERSION__)")
set(_compiler_id_version_compute "
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)")
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000000)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__TI_COMPILER_VERSION__/1000 % 1000)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__TI_COMPILER_VERSION__ % 1000)")
diff --git a/Modules/Compiler/Watcom-DetermineCompiler.cmake b/Modules/Compiler/Watcom-DetermineCompiler.cmake
index cc59abf..153e350 100644
--- a/Modules/Compiler/Watcom-DetermineCompiler.cmake
+++ b/Modules/Compiler/Watcom-DetermineCompiler.cmake
@@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__) && __WATCOMC__ < 1200")
set(_compiler_id_version_compute "
/* __WATCOMC__ = VVRR */
-# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__WATCOMC__ / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
-# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__WATCOMC__ % 10)
# endif")
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 21c2198..2b3bd14 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -2,32 +2,48 @@
# FindOpenGL
# ----------
#
-# Try to find OpenGL
+# FindModule for OpenGL and GLU.
#
-# Once done this will define
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
#
-# ::
+# This module defines the :prop_tgt:`IMPORTED` targets:
#
-# OPENGL_FOUND - system has OpenGL
-# OPENGL_XMESA_FOUND - system has XMESA
-# OPENGL_GLU_FOUND - system has GLU
-# OPENGL_INCLUDE_DIR - the GL include directory
-# OPENGL_LIBRARIES - Link these to use OpenGL and GLU
+# ``OpenGL::GL``
+# Defined if the system has OpenGL.
+# ``OpenGL::GLU``
+# Defined if the system has GLU.
#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
#
+# This module sets the following variables:
#
-# If you want to use just GL you can use these values
+# ``OPENGL_FOUND``
+# True, if the system has OpenGL.
+# ``OPENGL_XMESA_FOUND``
+# True, if the system has XMESA.
+# ``OPENGL_GLU_FOUND``
+# True, if the system has GLU.
+# ``OPENGL_INCLUDE_DIR``
+# Path to the OpenGL include directory.
+# ``OPENGL_LIBRARIES``
+# Paths to the OpenGL and GLU libraries.
#
-# ::
+# If you want to use just GL you can use these values:
#
-# OPENGL_gl_LIBRARY - Path to OpenGL Library
-# OPENGL_glu_LIBRARY - Path to GLU Library
+# ``OPENGL_gl_LIBRARY``
+# Path to the OpenGL library.
+# ``OPENGL_glu_LIBRARY``
+# Path to the GLU library.
#
+# OSX Specific
+# ^^^^^^^^^^^^
#
-#
-# On OSX default to using the framework version of opengl People will
+# On OSX default to using the framework version of OpenGL. People will
# have to change the cache values of OPENGL_glu_LIBRARY and
-# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
+# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
+
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -175,6 +191,36 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS})
unset(_OpenGL_REQUIRED_VARS)
+# OpenGL:: targets
+if(OPENGL_FOUND)
+ if(NOT TARGET OpenGL::GL)
+ add_library(OpenGL::GL UNKNOWN IMPORTED)
+ set_target_properties(OpenGL::GL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
+ if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
+ set_target_properties(OpenGL::GL PROPERTIES
+ IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
+ else()
+ set_target_properties(OpenGL::GL PROPERTIES
+ IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}")
+ endif()
+ endif()
+
+ if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
+ add_library(OpenGL::GLU UNKNOWN IMPORTED)
+ set_target_properties(OpenGL::GLU PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES OpenGL::GL)
+ if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
+ set_target_properties(OpenGL::GLU PROPERTIES
+ IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
+ else()
+ set_target_properties(OpenGL::GLU PROPERTIES
+ IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}")
+ endif()
+ endif()
+endif()
+
mark_as_advanced(
OPENGL_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 9487a62..c930042 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1,9 +1,9 @@
#.rst:
# FindQt4
-# *******
+# -------
#
# Finding and Using Qt4
-# =====================
+# ^^^^^^^^^^^^^^^^^^^^^
#
# This module can be used to find Qt4. The most important issue is that
# the Qt4 qmake is available via the system path. This qmake is then
@@ -30,7 +30,7 @@
# property to ``TRUE`` on the executable.
#
# Qt Build Tools
-# ==============
+# ^^^^^^^^^^^^^^
#
# Qt relies on some bundled tools for code generation, such as ``moc`` for
# meta-object code generation,``uic`` for widget layout and population,
@@ -39,7 +39,7 @@
# are met. See :manual:`cmake-qt(7)` for more.
#
# Qt Macros
-# =========
+# ^^^^^^^^^
#
# In some cases it can be necessary or useful to invoke the Qt build tools in a
# more-manual way. Several macros are available to add targets for such uses.
@@ -194,7 +194,7 @@
#
#
# IMPORTED Targets
-# ================
+# ^^^^^^^^^^^^^^^^
#
# A particular Qt library may be used by using the corresponding
# :prop_tgt:`IMPORTED` target with the :command:`target_link_libraries`
@@ -271,7 +271,7 @@
# The phonon target
#
# Result Variables
-# ================
+# ^^^^^^^^^^^^^^^^
#
# Below is a detailed list of variables that FindQt4.cmake sets.
#
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
new file mode 100644
index 0000000..e6d4fcf
--- /dev/null
+++ b/Modules/Platform/Android.cmake
@@ -0,0 +1,9 @@
+include(Platform/Linux)
+
+# Android has soname, but binary names must end in ".so" so we cannot append
+# a version number. Also we cannot portably represent symlinks on the host.
+set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1)
+
+# Android reportedly ignores RPATH, and we cannot predict the install
+# location anyway.
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index e034a28..8f21adf 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -103,6 +103,10 @@ function(ProcessorCount var)
OUTPUT_VARIABLE machinfo_output)
string(REGEX MATCHALL "Number of CPUs = ([0-9]+)" procs "${machinfo_output}")
set(count "${CMAKE_MATCH_1}")
+ if(NOT count)
+ string(REGEX MATCHALL "([0-9]+) logical processors" procs "${machinfo_output}")
+ set(count "${CMAKE_MATCH_1}")
+ endif()
#message("ProcessorCount: trying machinfo '${ProcessorCount_cmd_machinfo}'")
else()
find_program(ProcessorCount_cmd_mpsched mpsched)
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index f80943d..d7992fe 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -52,7 +52,15 @@
# Feature Test Macros
# ===================
#
-# For each compiler, a preprocessor test of the compiler version is generated
+# For each compiler, a preprocessor macro is generated matching
+# ``<PREFIX>_COMPILER_IS_<compiler>`` which has the content either ``0``
+# or ``1``, depending on the compiler in use. Preprocessor macros for
+# compiler version components are generated matching
+# ``<PREFIX>_COMPILER_VERSION_MAJOR`` ``<PREFIX>_COMPILER_VERSION_MINOR``
+# and ``<PREFIX>_COMPILER_VERSION_PATCH`` containing decimal values
+# for the corresponding compiler version components, if defined.
+#
+# A preprocessor test is generated based on the compiler version
# denoting whether each feature is enabled. A preprocessor macro
# matching ``<PREFIX>_COMPILER_<FEATURE>``, where ``<FEATURE>`` is the
# upper-case ``<feature>`` name, is generated to contain the value
@@ -133,16 +141,47 @@
# ``static_assert``, or ignored if using the backward compatibility
# implementation.
#
-# ====================== ================================ ===================
-# Feature Define Symbol
-# ====================== ================================ ===================
-# ``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas``
-# ``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof``
-# ``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr``
-# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert``
-# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert``
-# ====================== ================================ ===================
-
+# The ``cxx_attribute_deprecated`` feature provides a macro definition
+# ``<PREFIX>_DEPRECATED``, which expands to either the standard
+# ``[[deprecated]]`` attribute or a compiler-specific decorator such
+# as ``__attribute__((__deprecated__))`` used by GNU compilers.
+#
+# The ``cxx_alignas`` feature provides a macro definition
+# ``<PREFIX>_ALIGNAS`` which expands to either the standard ``alignas``
+# decorator or a compiler-specific decorator such as
+# ``__attribute__ ((__aligned__))`` used by GNU compilers.
+#
+# The ``cxx_alignof`` feature provides a macro definition
+# ``<PREFIX>_ALIGNOF`` which expands to either the standard ``alignof``
+# decorator or a compiler-specific decorator such as ``__alignof__``
+# used by GNU compilers.
+#
+# ============================= ================================ =====================
+# Feature Define Symbol
+# ============================= ================================ =====================
+# ``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas``
+# ``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof``
+# ``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr``
+# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert``
+# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert``
+# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED`` ``[[deprecated]]``
+# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED_MSG`` ``[[deprecated]]``
+# ============================= ================================ =====================
+#
+# A use-case which arises with such deprecation macros is the deprecation
+# of an entire library. In that case, all public API in the library may
+# be decorated with the ``<PREFIX>_DEPRECATED`` macro. This results in
+# very noisy build output when building the library itself, so the macro
+# may be may be defined to empty in that case when building the deprecated
+# library:
+#
+# .. code-block:: cmake
+#
+# add_library(compat_support ${srcs})
+# target_compile_definitions(compat_support
+# PRIVATE
+# CompatSupport_DEPRECATED=
+# )
#=============================================================================
# Copyright 2014 Stephen Kelly <steveire@gmail.com>
@@ -166,6 +205,8 @@ function(_load_compiler_variables CompilerId lang)
foreach(feature ${ARGN})
set(_cmake_feature_test_${CompilerId}_${feature} ${_cmake_feature_test_${feature}} PARENT_SCOPE)
endforeach()
+ include("${CMAKE_ROOT}/Modules/Compiler/${CompilerId}-DetermineCompiler.cmake" OPTIONAL)
+ set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
endfunction()
function(write_compiler_detection_header
@@ -197,19 +238,33 @@ function(write_compiler_detection_header
if(NOT _WCD_VERSION)
set(_WCD_VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
endif()
- if (_WCD_VERSION VERSION_LESS 3.1.0) # Version which introduced this function
- message(FATAL_ERROR "VERSION parameter too low.")
+ set(_min_version 3.1.0) # Version which introduced this function
+ if (_WCD_VERSION VERSION_LESS _min_version)
+ set(err "VERSION compatibility for write_compiler_detection_header is set to ${_WCD_VERSION}, which is too low.")
+ set(err "${err} It must be set to at least ${_min_version}. ")
+ set(err "${err} Either set the VERSION parameter to the write_compiler_detection_header function, or update")
+ set(err "${err} your minimum required CMake version with the cmake_minimum_required command.")
+ message(FATAL_ERROR "${err}")
endif()
set(compilers
GNU
Clang
)
+
+ set(_hex_compilers ADSP Borland Embarcadero SunPro)
+
foreach(_comp ${_WCD_COMPILERS})
list(FIND compilers ${_comp} idx)
if (idx EQUAL -1)
message(FATAL_ERROR "Unsupported compiler ${_comp}.")
endif()
+ if (NOT _need_hex_conversion)
+ list(FIND _hex_compilers ${_comp} idx)
+ if (NOT idx EQUAL -1)
+ set(_need_hex_conversion TRUE)
+ endif()
+ endif()
endforeach()
set(file_content "
@@ -223,6 +278,21 @@ function(write_compiler_detection_header
set(file_content "${file_content}\n${_WCD_PROLOG}\n")
endif()
+ if (_need_hex_conversion)
+ set(file_content "${file_content}
+#define ${prefix_arg}_DEC(X) (X)
+#define ${prefix_arg}_HEX(X) ( \\
+ ((X)>>28 & 0xF) * 10000000 + \\
+ ((X)>>24 & 0xF) * 1000000 + \\
+ ((X)>>20 & 0xF) * 100000 + \\
+ ((X)>>16 & 0xF) * 10000 + \\
+ ((X)>>12 & 0xF) * 1000 + \\
+ ((X)>>8 & 0xF) * 100 + \\
+ ((X)>>4 & 0xF) * 10 + \\
+ ((X) & 0xF) \\
+ )\n")
+ endif()
+
foreach(feature ${_WCD_FEATURES})
if (feature MATCHES "^cxx_")
list(APPEND _langs CXX)
@@ -266,6 +336,21 @@ function(write_compiler_detection_header
# if !(${_cmake_oldestSupported_${compiler}})
# error Unsupported compiler version
# endif\n")
+
+ set(PREFIX ${prefix_arg}_)
+ if (_need_hex_conversion)
+ set(MACRO_DEC ${prefix_arg}_DEC)
+ set(MACRO_HEX ${prefix_arg}_HEX)
+ else()
+ set(MACRO_DEC)
+ set(MACRO_HEX)
+ endif()
+ string(CONFIGURE "${_compiler_id_version_compute_${compiler}}" VERSION_BLOCK @ONLY)
+ set(file_content "${file_content}${VERSION_BLOCK}\n")
+ set(PREFIX)
+ set(MACRO_DEC)
+ set(MACRO_HEX)
+
set(pp_if "elif")
foreach(feature ${${_lang}_features})
string(TOUPPER ${feature} feature_upper)
@@ -402,6 +487,27 @@ function(write_compiler_detection_header
# endif
\n")
endif()
+ if (feature STREQUAL cxx_attribute_deprecated)
+ set(def_name ${prefix_arg}_${feature_PP})
+ set(def_value "${prefix_arg}_DEPRECATED")
+ set(file_content "${file_content}
+# ifndef ${def_value}
+# if ${def_name}
+# define ${def_value} [[deprecated]]
+# define ${def_value}_MSG(MSG) [[deprecated(MSG)]]
+# elif defined(__GNUC__) || defined(__clang__)
+# define ${def_value} __attribute__((__deprecated__))
+# define ${def_value}_MSG(MSG) __attribute__((__deprecated__(MSG)))
+# elif defined(_MSC_VER)
+# define ${def_value} __declspec(deprecated)
+# define ${def_value}_MSG(MSG) __declspec(deprecated(MSG))
+# else
+# define ${def_value}
+# define ${def_value}_MSG(MSG)
+# endif
+# endif
+\n")
+ endif()
endforeach()
set(file_content "${file_content}#endif\n")
diff --git a/README.rst b/README.rst
index 1b5b0c3..e91b209 100644
--- a/README.rst
+++ b/README.rst
@@ -11,10 +11,10 @@ For full documentation visit the `CMake Home Page`_ and the
.. _`CMake Home Page`: http://www.cmake.org
.. _`CMake Documentation Page`: http://www.cmake.org/cmake/help/documentation.html
-CMake is maintained by `Kitware, Inc.`_ and developed in
+CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
-.. _`Kitware, Inc.`: http://www.kitware.com
+.. _`Kitware`: http://www.kitware.com/cmake
License
=======
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 8ecf83c..fe6cc1b 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -519,7 +519,7 @@ set(CTEST_SRCS cmCTest.cxx
CTest/cmParseCacheCoverage.cxx
CTest/cmParseGTMCoverage.cxx
CTest/cmParsePHPCoverage.cxx
- CTest/cmParsePythonCoverage.cxx
+ CTest/cmParseCoberturaCoverage.cxx
CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
CTest/cmCTestGenericHandler.cxx
CTest/cmCTestHandlerCommand.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 154574f..b8fbc7e 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 20140530)
+set(CMake_VERSION_PATCH 20140613)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 0113698..a5eee6b 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -588,8 +588,8 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str,
return;
}
- cmsys::RegularExpression urlRegex;
- urlRegex.compile("^(mailto:|(ftps?|https?|news)://).*$");
+ static cmsys::RegularExpression
+ urlRegex("^(mailto:|(ftps?|https?|news)://).*$");
std::vector<std::string>::iterator it;
for ( it = cpackMenuLinksVector.begin();
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index cb6e56e..da27c8c 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -11,7 +11,7 @@
============================================================================*/
#include "cmCTestCoverageHandler.h"
#include "cmParsePHPCoverage.h"
-#include "cmParsePythonCoverage.h"
+#include "cmParseCoberturaCoverage.h"
#include "cmParseGTMCoverage.h"
#include "cmParseCacheCoverage.h"
#include "cmCTest.h"
@@ -401,7 +401,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{
return error;
}
- file_count += this->HandlePythonCoverage(&cont);
+ file_count += this->HandleCoberturaCoverage(&cont);
error = cont.Error;
if ( file_count < 0 )
{
@@ -779,10 +779,10 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
}
//----------------------------------------------------------------------
-int cmCTestCoverageHandler::HandlePythonCoverage(
+int cmCTestCoverageHandler::HandleCoberturaCoverage(
cmCTestCoverageHandlerContainer* cont)
{
- cmParsePythonCoverage cov(*cont, this->CTest);
+ cmParseCoberturaCoverage cov(*cont, this->CTest);
// Assume the coverage.xml is in the source directory
std::string coverageXMLFile = this->CTest->GetBinaryDir() + "/coverage.xml";
@@ -790,14 +790,14 @@ int cmCTestCoverageHandler::HandlePythonCoverage(
if(cmSystemTools::FileExists(coverageXMLFile.c_str()))
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Parsing coverage.py XML file: " << coverageXMLFile
+ "Parsing Cobertura XML file: " << coverageXMLFile
<< std::endl);
cov.ReadCoverageXML(coverageXMLFile.c_str());
}
else
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Cannot find coverage.py XML file: " << coverageXMLFile
+ "Cannot find Cobertura XML file: " << coverageXMLFile
<< std::endl);
}
return static_cast<int>(cont->TotalCoverage.size());
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index 0a0fe81..38a3353 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -76,7 +76,7 @@ private:
int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont);
//! Handle coverage for Python with coverage.py
- int HandlePythonCoverage(cmCTestCoverageHandlerContainer* cont);
+ int HandleCoberturaCoverage(cmCTestCoverageHandlerContainer* cont);
//! Handle coverage for mumps
int HandleMumpsCoverage(cmCTestCoverageHandlerContainer* cont);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 1d1dde4..f21d166 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -509,7 +509,7 @@ int cmCTestTestHandler::ProcessHandler()
if ( val )
{
this->UseExcludeLabelRegExpFlag = true;
- this->ExcludeLabelRegularExpression = val;
+ this->ExcludeLabelRegExp = val;
}
val = this->GetOption("IncludeRegularExpression");
if ( val )
@@ -1558,7 +1558,7 @@ void cmCTestTestHandler::GetListOfTests()
this->IncludeLabelRegularExpression.
compile(this->IncludeLabelRegExp.c_str());
}
- if ( !this->IncludeLabelRegExp.empty() )
+ if ( !this->ExcludeLabelRegExp.empty() )
{
this->ExcludeLabelRegularExpression.
compile(this->ExcludeLabelRegExp.c_str());
diff --git a/Source/CTest/cmParsePythonCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 817b8dc..6b98056 100644
--- a/Source/CTest/cmParsePythonCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -1,17 +1,21 @@
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
#include "cmXMLParser.h"
-#include "cmParsePythonCoverage.h"
+#include "cmParseCoberturaCoverage.h"
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
//----------------------------------------------------------------------------
-class cmParsePythonCoverage::XMLParser: public cmXMLParser
+class cmParseCoberturaCoverage::XMLParser: public cmXMLParser
{
public:
XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont)
: CTest(ctest), Coverage(cont)
{
+ this->InSources = false;
+ this->InSource = false;
+ this->FilePaths.push_back(this->Coverage.SourceDir);
+ this->CurFileName = "";
}
virtual ~XMLParser()
@@ -20,9 +24,44 @@ public:
protected:
+
+ virtual void EndElement(const std::string& name)
+ {
+ if(name == "source")
+ {
+ this->InSource=false;
+ }
+ else if (name == "sources")
+ {
+ this->InSources=false;
+ }
+ }
+
+ virtual void CharacterDataHandler(const char* data, int length)
+ {
+ std::string tmp;
+ tmp.insert(0,data,length);
+ if (this->InSources && this->InSource)
+ {
+ this->FilePaths.push_back(tmp);
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Adding Source: "
+ << tmp << std::endl);
+ }
+ }
+
virtual void StartElement(const std::string& name, const char** atts)
{
- if(name == "class")
+ std::string FoundSource;
+ std::string finalpath = "";
+ if(name == "source")
+ {
+ this->InSource = true;
+ }
+ else if(name == "sources")
+ {
+ this->InSources = true;
+ }
+ else if(name == "class")
{
int tagCount = 0;
while(true)
@@ -30,11 +69,19 @@ protected:
if(strcmp(atts[tagCount], "filename") == 0)
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Reading file: "
- << atts[tagCount+1] << std::endl);
- this->CurFileName = this->Coverage.SourceDir + "/" +
- atts[tagCount+1];
+ << atts[tagCount+1]<< std::endl);
+ std::string filename = atts[tagCount+1];
+ for(size_t i=0;i < FilePaths.size();i++)
+ {
+ finalpath = FilePaths[i] + "/" + filename;
+ if(cmSystemTools::FileExists(finalpath.c_str()))
+ {
+ this->CurFileName = finalpath;
+ break;
+ }
+ }
cmsys::ifstream fin(this->CurFileName.c_str());
- if(!fin)
+ if(this->CurFileName == "" || !fin )
{
this->CurFileName = this->Coverage.BinaryDir + "/" +
atts[tagCount+1];
@@ -48,7 +95,6 @@ protected:
break;
}
}
-
std::string line;
FileLinesType& curFileLines =
this->Coverage.TotalCoverage[this->CurFileName];
@@ -83,7 +129,9 @@ protected:
{
FileLinesType& curFileLines =
this->Coverage.TotalCoverage[this->CurFileName];
- curFileLines[curNumber-1] = curHits;
+ {
+ curFileLines[curNumber-1] = curHits;
+ }
break;
}
++tagCount;
@@ -91,10 +139,11 @@ protected:
}
}
- virtual void EndElement(const std::string&) {}
-
private:
+ bool InSources;
+ bool InSource;
+ std::vector<std::string> FilePaths;
typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector
FileLinesType;
cmCTest* CTest;
@@ -104,16 +153,16 @@ private:
};
-cmParsePythonCoverage::cmParsePythonCoverage(
+cmParseCoberturaCoverage::cmParseCoberturaCoverage(
cmCTestCoverageHandlerContainer& cont,
cmCTest* ctest)
:Coverage(cont), CTest(ctest)
{
}
-bool cmParsePythonCoverage::ReadCoverageXML(const char* xmlFile)
+bool cmParseCoberturaCoverage::ReadCoverageXML(const char* xmlFile)
{
- cmParsePythonCoverage::XMLParser parser(this->CTest, this->Coverage);
+ cmParseCoberturaCoverage::XMLParser parser(this->CTest, this->Coverage);
parser.ParseFile(xmlFile);
return true;
}
diff --git a/Source/CTest/cmParsePythonCoverage.h b/Source/CTest/cmParseCoberturaCoverage.h
index 668c7f9..ff5954d 100644
--- a/Source/CTest/cmParsePythonCoverage.h
+++ b/Source/CTest/cmParseCoberturaCoverage.h
@@ -10,8 +10,8 @@
See the License for more information.
============================================================================*/
-#ifndef cmParsePythonCoverage_h
-#define cmParsePythonCoverage_h
+#ifndef cmParseCoberturaCoverage_h
+#define cmParseCoberturaCoverage_h
#include "cmStandardIncludes.h"
#include "cmCTestCoverageHandler.h"
@@ -25,15 +25,18 @@
* Java-based Cobertura coverage application. This helper class parses
* that XML file to fill the coverage-handler container.
*/
-class cmParsePythonCoverage
+class cmParseCoberturaCoverage
{
public:
//! Create the coverage parser by passing in the coverage handler
//! container and the cmCTest object
- cmParsePythonCoverage(cmCTestCoverageHandlerContainer& cont,
+ cmParseCoberturaCoverage(cmCTestCoverageHandlerContainer& cont,
cmCTest* ctest);
+ bool inSources;
+ bool inSource;
+ std::vector<std::string> filepaths;
//! Read the XML produced by running `coverage xml`
bool ReadCoverageXML(const char* xmlFile);
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 1a98cea..8a37797 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -814,7 +814,7 @@ void CMakeSetupDialog::doAbout()
{
QString msg = tr(
"CMake %1 (cmake.org).\n"
- "CMake suite maintained by Kitware, Inc. (kitware.com).\n"
+ "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n"
"Distributed under terms of the BSD 3-Clause License.\n"
"\n"
"CMake GUI maintained by csimsoft,\n"
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index a7f6b49..64b67c9 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -137,7 +137,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
this->Makefile->GetHomeOutputDirectory()))
{
cmOStringStream msg;
- cmListFileBacktrace bt;
+ cmListFileBacktrace bt(this->Makefile->GetLocalGenerator());
cmListFileContext lfc;
lfc.FilePath = this->FileName;
lfc.Line = this->FileLine;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index ea8536f..0ce04a5 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1811,7 +1811,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath)
}
}
- is_shared_library = this->ExtractSharedLibraryName.find(file.c_str());
+ is_shared_library = this->ExtractSharedLibraryName.find(file);
if(!is_shared_library)
{
@@ -1831,8 +1831,8 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath)
{
if(fullPath.find(".framework") != std::string::npos)
{
- cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/(.*)$");
+ static cmsys::RegularExpression
+ splitFramework("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(fullPath) &&
(std::string::npos !=
splitFramework.match(3).find(splitFramework.match(2))))
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index eb62455..f28217f 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -386,15 +386,17 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
e << "The dependency target \"" << dependee_name
<< "\" of target \"" << depender->GetName() << "\" does not exist.";
- cmListFileBacktrace nullBacktrace;
cmListFileBacktrace const* backtrace =
depender->GetUtilityBacktrace(dependee_name);
- if(!backtrace)
+ if(backtrace)
{
- backtrace = &nullBacktrace;
+ cm->IssueMessage(messageType, e.str(), *backtrace);
+ }
+ else
+ {
+ cm->IssueMessage(messageType, e.str());
}
- cm->IssueMessage(messageType, e.str(), *backtrace);
}
}
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index ac2eef8..c161eb6 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -17,6 +17,7 @@
//----------------------------------------------------------------------------
cmCustomCommand::cmCustomCommand()
+ : Backtrace(NULL)
{
this->HaveComment = false;
this->EscapeOldStyle = true;
@@ -33,7 +34,7 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
WorkingDirectory(r.WorkingDirectory),
EscapeAllowMakeVars(r.EscapeAllowMakeVars),
EscapeOldStyle(r.EscapeOldStyle),
- Backtrace(new cmListFileBacktrace(*r.Backtrace))
+ Backtrace(r.Backtrace)
{
}
@@ -54,11 +55,7 @@ cmCustomCommand& cmCustomCommand::operator=(cmCustomCommand const& r)
this->EscapeAllowMakeVars = r.EscapeAllowMakeVars;
this->EscapeOldStyle = r.EscapeOldStyle;
this->ImplicitDepends = r.ImplicitDepends;
-
- cmsys::auto_ptr<cmListFileBacktrace>
- newBacktrace(new cmListFileBacktrace(*r.Backtrace));
- delete this->Backtrace;
- this->Backtrace = newBacktrace.release();
+ this->Backtrace = r.Backtrace;
return *this;
}
@@ -78,20 +75,19 @@ cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
WorkingDirectory(workingDirectory?workingDirectory:""),
EscapeAllowMakeVars(false),
EscapeOldStyle(true),
- Backtrace(new cmListFileBacktrace)
+ Backtrace(NULL)
{
this->EscapeOldStyle = true;
this->EscapeAllowMakeVars = false;
if(mf)
{
- mf->GetBacktrace(*this->Backtrace);
+ this->Backtrace = mf->GetBacktrace();
}
}
//----------------------------------------------------------------------------
cmCustomCommand::~cmCustomCommand()
{
- delete this->Backtrace;
}
//----------------------------------------------------------------------------
@@ -166,7 +162,7 @@ void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
//----------------------------------------------------------------------------
cmListFileBacktrace const& cmCustomCommand::GetBacktrace() const
{
- return *this->Backtrace;
+ return this->Backtrace;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index b5d7e62..21dbefb 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -13,8 +13,8 @@
#define cmCustomCommand_h
#include "cmStandardIncludes.h"
+#include "cmListFileCache.h"
class cmMakefile;
-class cmListFileBacktrace;
/** \class cmCustomCommand
* \brief A class to encapsulate a custom command
@@ -88,7 +88,7 @@ private:
std::string WorkingDirectory;
bool EscapeAllowMakeVars;
bool EscapeOldStyle;
- cmListFileBacktrace* Backtrace;
+ cmListFileBacktrace Backtrace;
ImplicitDependsList ImplicitDepends;
};
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index ebfbf7c..1bca6e6 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -21,7 +21,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(
cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
- GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false)
+ GE(new cmGeneratorExpression(&cc.GetBacktrace())), DependsDone(false)
{
}
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index babf1c4..5515f35 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -15,7 +15,8 @@
cmDefinitions::Def cmDefinitions::NoDef;
//----------------------------------------------------------------------------
-cmDefinitions::cmDefinitions(cmDefinitions* parent): Up(parent)
+cmDefinitions::cmDefinitions(cmDefinitions* parent)
+ : Up(parent)
{
}
@@ -28,18 +29,17 @@ void cmDefinitions::Reset(cmDefinitions* parent)
//----------------------------------------------------------------------------
cmDefinitions::Def const&
-cmDefinitions::GetInternal(const std::string& key)
+cmDefinitions::GetInternal(const std::string& key) const
{
MapType::const_iterator i = this->Map.find(key);
if(i != this->Map.end())
{
return i->second;
}
- else if(cmDefinitions* up = this->Up)
+ if(cmDefinitions* up = this->Up)
{
- // Query the parent scope and store the result locally.
- Def def = up->GetInternal(key);
- return this->Map.insert(MapType::value_type(key, def)).first->second;
+ // Query the parent scope.
+ return up->GetInternal(key);
}
return this->NoDef;
}
@@ -51,16 +51,7 @@ cmDefinitions::SetInternal(const std::string& key, Def const& def)
if(this->Up || def.Exists)
{
// In lower scopes we store keys, defined or not.
- MapType::iterator i = this->Map.find(key);
- if(i == this->Map.end())
- {
- i = this->Map.insert(MapType::value_type(key, def)).first;
- }
- else
- {
- i->second = def;
- }
- return i->second;
+ return (this->Map[key] = def);
}
else
{
@@ -71,13 +62,26 @@ cmDefinitions::SetInternal(const std::string& key, Def const& def)
}
//----------------------------------------------------------------------------
-const char* cmDefinitions::Get(const std::string& key)
+const char* cmDefinitions::Get(const std::string& key) const
{
Def const& def = this->GetInternal(key);
return def.Exists? def.c_str() : 0;
}
//----------------------------------------------------------------------------
+void cmDefinitions::Pull(const std::string& key)
+{
+ if (this->Up)
+ {
+ Def const& def = this->Up->GetInternal(key);
+ if (def.Exists)
+ {
+ this->SetInternal(key, def);
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
const char* cmDefinitions::Set(const std::string& key, const char* value)
{
Def const& def = this->SetInternal(key, Def(value));
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index d615fb0..5209a8b 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -13,6 +13,9 @@
#define cmDefinitions_h
#include "cmStandardIncludes.h"
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include "cmsys/hash_map.hxx"
+#endif
/** \class cmDefinitions
* \brief Store a scope of variable definitions for CMake language.
@@ -33,9 +36,11 @@ public:
/** Returns the parent scope, if any. */
cmDefinitions* GetParent() const { return this->Up; }
- /** Get the value associated with a key; null if none.
- Store the result locally if it came from a parent. */
- const char* Get(const std::string& key);
+ /** Get the value associated with a key; null if none. */
+ const char* Get(const std::string& key) const;
+
+ /** Pull a variable from the parent. */
+ void Pull(const std::string& key);
/** Set (or unset if null) a value associated with a key. */
const char* Set(const std::string& key, const char* value);
@@ -69,11 +74,15 @@ private:
cmDefinitions* Up;
// Local definitions, set or unset.
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ typedef cmsys::hash_map<std::string, Def> MapType;
+#else
typedef std::map<std::string, Def> MapType;
+#endif
MapType Map;
// Internal query and update methods.
- Def const& GetInternal(const std::string& key);
+ Def const& GetInternal(const std::string& key) const;
Def const& SetInternal(const std::string& key, Def const& def);
// Implementation of Closure() method.
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 71e53f4..8d035af 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -102,7 +102,7 @@ bool cmDocumentation::PrintVersion(std::ostream& os)
this->GetNameString() <<
" version " << cmVersion::GetCMakeVersion() << "\n"
"\n"
- "CMake suite maintained by Kitware, Inc. (kitware.com).\n"
+ "CMake suite maintained and supported by Kitware (kitware.com/cmake).\n"
;
return true;
}
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 6c8ebb6..30a52d4 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -18,6 +18,7 @@
//----------------------------------------------------------------------------
cmExportBuildFileGenerator::cmExportBuildFileGenerator()
+ : Backtrace(NULL)
{
this->Makefile = 0;
this->ExportSet = 0;
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index c1bdb5b..8b5694c 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -45,7 +45,7 @@ public:
void SetMakefile(cmMakefile *mf) {
this->Makefile = mf;
- this->Makefile->GetBacktrace(this->Backtrace);
+ this->Backtrace = this->Makefile->GetBacktrace();
}
protected:
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 2db4086..9f5eee5 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -377,8 +377,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
const char *propName = "INTERFACE_INCLUDE_DIRECTORIES";
const char *input = target->GetProperty(propName);
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
std::string dirs = cmGeneratorExpression::Preprocess(
tei->InterfaceIncludeDirectories,
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 3350d7c..eb8d193 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -57,10 +57,9 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
return std::string();
}
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
tgt->GetName(),
propName, 0, 0);
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 4ee34df..655f3ba 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3270,14 +3270,13 @@ void cmFileCommand::AddEvaluationFile(const std::string &inputName,
bool inputIsContent
)
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- cmGeneratorExpression outputGe(lfbt);
+ cmGeneratorExpression outputGe(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge
= outputGe.Parse(outputExpr);
- cmGeneratorExpression conditionGe(lfbt);
+ cmGeneratorExpression conditionGe(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge
= conditionGe.Parse(condition);
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index d53bdd7..2b4d955 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -24,7 +24,7 @@
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
- cmListFileBacktrace const& backtrace):
+ cmListFileBacktrace const* backtrace):
Backtrace(backtrace)
{
}
@@ -33,10 +33,18 @@ cmGeneratorExpression::cmGeneratorExpression(
cmsys::auto_ptr<cmCompiledGeneratorExpression>
cmGeneratorExpression::Parse(std::string const& input)
{
+#if !defined(__BORLANDC__)
return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
- new cmCompiledGeneratorExpression(
- this->Backtrace,
- input));
+ new cmCompiledGeneratorExpression(
+ this->Backtrace ? *this->Backtrace : cmListFileBacktrace(NULL),
+ input));
+#else
+ cmListFileBacktrace emptyBacktrace(NULL);
+ return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
+ new cmCompiledGeneratorExpression(
+ this->Backtrace ? *this->Backtrace : emptyBacktrace,
+ input));
+#endif
}
//----------------------------------------------------------------------------
@@ -461,12 +469,11 @@ std::string::size_type cmGeneratorExpression::Find(const std::string &input)
//----------------------------------------------------------------------------
bool cmGeneratorExpression::IsValidTargetName(const std::string &input)
{
- cmsys::RegularExpression targetNameValidator;
// The ':' is supported to allow use with IMPORTED targets. At least
// Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter.
- targetNameValidator.compile("^[A-Za-z0-9_.:+-]+$");
+ static cmsys::RegularExpression targetNameValidator("^[A-Za-z0-9_.:+-]+$");
- return targetNameValidator.find(input.c_str());
+ return targetNameValidator.find(input);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index ef5360e..324d23c 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -41,7 +41,7 @@ class cmGeneratorExpression
{
public:
/** Construct. */
- cmGeneratorExpression(cmListFileBacktrace const& backtrace);
+ cmGeneratorExpression(cmListFileBacktrace const* backtrace = NULL);
~cmGeneratorExpression();
cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
@@ -70,7 +70,7 @@ private:
cmGeneratorExpression(const cmGeneratorExpression &);
void operator=(const cmGeneratorExpression &);
- cmListFileBacktrace const& Backtrace;
+ cmListFileBacktrace const* Backtrace;
};
class cmCompiledGeneratorExpression
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 7f8e694..75a84cb 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -24,6 +24,25 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
: Parent(parent), Target(target), Property(property),
Content(content), Backtrace(backtrace), TransitivePropertiesOnly(false)
{
+ Initialize();
+}
+
+//----------------------------------------------------------------------------
+cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
+ const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent)
+ : Parent(parent), Target(target), Property(property),
+ Content(content), Backtrace(NULL), TransitivePropertiesOnly(false)
+{
+ Initialize();
+}
+
+//----------------------------------------------------------------------------
+void
+cmGeneratorExpressionDAGChecker::Initialize()
+{
const cmGeneratorExpressionDAGChecker *top = this;
const cmGeneratorExpressionDAGChecker *p = this->Parent;
while (p)
@@ -43,11 +62,12 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
#undef TEST_TRANSITIVE_PROPERTY_METHOD
{
std::map<std::string, std::set<std::string> >::const_iterator it
- = top->Seen.find(target);
+ = top->Seen.find(this->Target);
if (it != top->Seen.end())
{
const std::set<std::string> &propSet = it->second;
- const std::set<std::string>::const_iterator i = propSet.find(property);
+ const std::set<std::string>::const_iterator i
+ = propSet.find(this->Property);
if (i != propSet.end())
{
this->CheckResult = ALREADY_SEEN;
@@ -55,7 +75,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
}
}
const_cast<cmGeneratorExpressionDAGChecker *>(top)
- ->Seen[target].insert(property);
+ ->Seen[this->Target].insert(this->Property);
}
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 7217a56..10f9fa7 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -46,6 +46,10 @@ struct cmGeneratorExpressionDAGChecker
const std::string &property,
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *parent);
+ cmGeneratorExpressionDAGChecker(const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent);
enum Result {
DAG,
@@ -76,6 +80,7 @@ struct cmGeneratorExpressionDAGChecker
private:
Result CheckGraph() const;
+ void Initialize();
private:
const cmGeneratorExpressionDAGChecker * const Parent;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 01d31d3..f9067cf 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -115,7 +115,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
}
cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace();
- cmGeneratorExpression contentGE(lfbt);
+ cmGeneratorExpression contentGE(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression
= contentGE.Parse(inputContent);
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 0b357f6..7dcb335 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -401,9 +401,8 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{
return compilerId ? compilerId : "";
}
- cmsys::RegularExpression compilerIdValidator;
- compilerIdValidator.compile("^[A-Za-z0-9_]*$");
- if (!compilerIdValidator.find(parameters.begin()->c_str()))
+ static cmsys::RegularExpression compilerIdValidator("^[A-Za-z0-9_]*$");
+ if (!compilerIdValidator.find(*parameters.begin()))
{
reportError(context, content->GetOriginalExpression(),
"Expression syntax not recognized.");
@@ -457,8 +456,8 @@ static const struct CCompilerIdNode : public CompilerIdNode
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
- "$<C_COMPILER_ID> may only be used with targets. It may not "
- "be used with add_custom_command.");
+ "$<C_COMPILER_ID> may only be used with binary targets. It may "
+ "not be used with add_custom_command or add_custom_target.");
return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
@@ -479,8 +478,8 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
- "$<CXX_COMPILER_ID> may only be used with targets. It may not "
- "be used with add_custom_command.");
+ "$<CXX_COMPILER_ID> may only be used with binary targets. It may "
+ "not be used with add_custom_command or add_custom_target.");
return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
@@ -509,9 +508,8 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
return compilerVersion ? compilerVersion : "";
}
- cmsys::RegularExpression compilerIdValidator;
- compilerIdValidator.compile("^[0-9\\.]*$");
- if (!compilerIdValidator.find(parameters.begin()->c_str()))
+ static cmsys::RegularExpression compilerIdValidator("^[0-9\\.]*$");
+ if (!compilerIdValidator.find(*parameters.begin()))
{
reportError(context, content->GetOriginalExpression(),
"Expression syntax not recognized.");
@@ -541,8 +539,8 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
- "$<C_COMPILER_VERSION> may only be used with targets. It may not "
- "be used with add_custom_command.");
+ "$<C_COMPILER_VERSION> may only be used with binary targets. It "
+ "may not be used with add_custom_command or add_custom_target.");
return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
@@ -563,8 +561,8 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
- "$<CXX_COMPILER_VERSION> may only be used with targets. It may "
- "not be used with add_custom_command.");
+ "$<CXX_COMPILER_VERSION> may only be used with binary targets. It "
+ "may not be used with add_custom_command or add_custom_target.");
return std::string();
}
return this->EvaluateWithLanguage(parameters, context, content,
@@ -711,9 +709,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
{
return configurationNode.Evaluate(parameters, context, content, 0);
}
- cmsys::RegularExpression configValidator;
- configValidator.compile("^[A-Za-z0-9_]*$");
- if (!configValidator.find(parameters.begin()->c_str()))
+ static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$");
+ if (!configValidator.find(*parameters.begin()))
{
reportError(context, content->GetOriginalExpression(),
"Expression syntax not recognized.");
@@ -809,7 +806,7 @@ std::string getLinkedTargetsContent(const std::vector<cmTarget*> &targets,
cmGeneratorExpressionDAGChecker *dagChecker,
const std::string &interfacePropertyName)
{
- cmGeneratorExpression ge(context->Backtrace);
+ cmGeneratorExpression ge(&context->Backtrace);
std::string sep;
std::string depString;
@@ -884,8 +881,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
"$<TARGET_PROPERTY:...> expression requires one or two parameters");
return std::string();
}
- cmsys::RegularExpression propertyNameValidator;
- propertyNameValidator.compile("^[A-Za-z0-9_]+$");
+ static cmsys::RegularExpression propertyNameValidator("^[A-Za-z0-9_]+$");
cmTarget const* target = context->HeadTarget;
std::string propertyName = *parameters.begin();
@@ -893,10 +889,10 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (!target && parameters.size() == 1)
{
reportError(context, content->GetOriginalExpression(),
- "$<TARGET_PROPERTY:prop> may only be used with targets. It may not "
- "be used with add_custom_command. Specify the target to read a "
- "property from using the $<TARGET_PROPERTY:tgt,prop> signature "
- "instead.");
+ "$<TARGET_PROPERTY:prop> may only be used with binary targets. "
+ "It may not be used with add_custom_command or add_custom_target. "
+ "Specify the target to read a property from using the "
+ "$<TARGET_PROPERTY:tgt,prop> signature instead.");
return std::string();
}
@@ -973,7 +969,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return std::string();
}
- if (!propertyNameValidator.find(propertyName.c_str()))
+ if (!propertyNameValidator.find(propertyName))
{
::reportError(context, content->GetOriginalExpression(),
"Property name not supported.");
@@ -1196,7 +1192,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
if (targetPropertyTransitiveWhitelist[i] == interfacePropertyName)
{
- cmGeneratorExpression ge(context->Backtrace);
+ cmGeneratorExpression ge(&context->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
std::string result = cge->Evaluate(context->Makefile,
context->Config,
@@ -1460,8 +1456,8 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
- "$<TARGET_POLICY:prop> may only be used with targets. It may not "
- "be used with add_custom_command.");
+ "$<TARGET_POLICY:prop> may only be used with binary targets. It "
+ "may not be used with add_custom_command or add_custom_target.");
return std::string();
}
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index eb76d7f..0ffb860 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -22,6 +22,11 @@ class cmTarget;
//----------------------------------------------------------------------------
struct cmGeneratorExpressionContext
{
+ cmGeneratorExpressionContext()
+ : Backtrace(NULL)
+ {
+ }
+
cmListFileBacktrace Backtrace;
std::set<cmTarget*> DependTargets;
std::set<cmTarget const*> AllTargets;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 153c611..a7576ed 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -259,12 +259,10 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
std::vector<std::string>& result,
bool excludeImported)
{
- cmListFileBacktrace lfbt;
-
if (const char* dirs =
depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES"))
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf,
config, false, headTarget,
@@ -278,7 +276,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
if (const char* dirs =
depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES"))
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf,
config, false, headTarget,
@@ -457,8 +455,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
return false;
}
- cmListFileBacktrace lfbt;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
"SYSTEM_INCLUDE_DIRECTORIES", 0, 0);
@@ -470,7 +467,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
it = this->Target->GetSystemIncludeDirectories().begin();
it != this->Target->GetSystemIncludeDirectories().end(); ++it)
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(*it)
->Evaluate(this->Makefile,
config, false, this->Target,
@@ -808,7 +805,7 @@ cmTargetTraceDependencies
{
// Transform command names that reference targets built in this
// project to corresponding target-level dependencies.
- cmGeneratorExpression ge(cc.GetBacktrace());
+ cmGeneratorExpression ge(&cc.GetBacktrace());
// Add target-level dependencies referenced by generator expressions.
std::set<cmTarget*> targets;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index dba4f46..6c8be72 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -76,7 +76,8 @@ cmGlobalGenerator::~cmGlobalGenerator()
}
}
-bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
+bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
+ cmMakefile* mf)
{
cmOStringStream e;
e <<
@@ -85,8 +86,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
"does not support toolset specification, but toolset\n"
" " << ts << "\n"
"was specified.";
- this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
- cmListFileBacktrace());
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
@@ -448,6 +448,15 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
mf->ReadListFile(0,fpath.c_str());
}
+ // Tell the generator about the toolset, if any.
+ std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET");
+ if(!toolset.empty() &&
+ !this->SetGeneratorToolset(toolset, mf))
+ {
+ cmSystemTools::SetFatalErrorOccured();
+ return;
+ }
+
// **** Load the system specific initialization if not yet loaded
if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED"))
{
@@ -1273,8 +1282,7 @@ void cmGlobalGenerator::Generate()
if(!this->GenerateCPackPropertiesFile())
{
this->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, "Could not write CPack properties file.",
- cmListFileBacktrace());
+ cmake::FATAL_ERROR, "Could not write CPack properties file.");
}
for (std::map<std::string, cmExportBuildFileGenerator*>::iterator
@@ -1285,8 +1293,7 @@ void cmGlobalGenerator::Generate()
&& !cmSystemTools::GetErrorOccuredFlag())
{
this->GetCMakeInstance()
- ->IssueMessage(cmake::FATAL_ERROR, "Could not write export file.",
- cmListFileBacktrace());
+ ->IssueMessage(cmake::FATAL_ERROR, "Could not write export file.");
return;
}
}
@@ -1315,8 +1322,7 @@ void cmGlobalGenerator::Generate()
{
w << " " << *iter << "\n";
}
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
- cmListFileBacktrace());
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
this->CMakeInstance->UpdateProgress("Generating done", -1);
@@ -1516,8 +1522,7 @@ cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
if(ti == this->GeneratorTargets.end())
{
this->CMakeInstance->IssueMessage(
- cmake::INTERNAL_ERROR, "Missing cmGeneratorTarget instance!",
- cmListFileBacktrace());
+ cmake::INTERNAL_ERROR, "Missing cmGeneratorTarget instance!");
return 0;
}
return ti->second;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 617e708..67bd378 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -63,7 +63,7 @@ public:
/** Set the generator-specific toolset name. Returns true if toolset
is supported and false otherwise. */
- virtual bool SetGeneratorToolset(std::string const& ts);
+ virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
/**
* Create LocalGenerators and process the CMakeLists files. This does not
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 37a416b..a6d1c31 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -48,17 +48,19 @@ public:
const char* p = cmVS10GenName(name, genName);
if(!p)
{ return 0; }
- if(strcmp(p, "") == 0)
+ if(!*p)
{
return new cmGlobalVisualStudio10Generator(
genName, "", "");
}
- if(strcmp(p, " Win64") == 0)
+ if(*p++ != ' ')
+ { return 0; }
+ if(strcmp(p, "Win64") == 0)
{
return new cmGlobalVisualStudio10Generator(
genName, "x64", "CMAKE_FORCE_WIN64");
}
- if(strcmp(p, " IA64") == 0)
+ if(strcmp(p, "IA64") == 0)
{
return new cmGlobalVisualStudio10Generator(
genName, "Itanium", "CMAKE_FORCE_IA64");
@@ -116,9 +118,11 @@ cmGlobalVisualStudio10Generator::MatchesGeneratorName(
//----------------------------------------------------------------------------
bool
-cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts)
+cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
+ cmMakefile* mf)
{
- this->PlatformToolset = ts;
+ this->GeneratorToolset = ts;
+ this->AddVSPlatformToolsetDefinition(mf);
return true;
}
@@ -126,10 +130,16 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts)
void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
- if(!this->PlatformToolset.empty())
+ this->AddVSPlatformToolsetDefinition(mf);
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Generator
+::AddVSPlatformToolsetDefinition(cmMakefile* mf) const
+{
+ if(const char* toolset = this->GetPlatformToolset())
{
- mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET",
- this->PlatformToolset.c_str());
+ mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
}
}
@@ -215,11 +225,15 @@ void cmGlobalVisualStudio10Generator
}
//----------------------------------------------------------------------------
-const char* cmGlobalVisualStudio10Generator::GetPlatformToolset()
+const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
{
- if(!this->PlatformToolset.empty())
+ if(!this->GeneratorToolset.empty())
+ {
+ return this->GeneratorToolset.c_str();
+ }
+ if(!this->DefaultPlatformToolset.empty())
{
- return this->PlatformToolset.c_str();
+ return this->DefaultPlatformToolset.c_str();
}
return 0;
}
@@ -417,7 +431,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
//----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
{
- if(!this->PlatformToolset.empty())
+ if(this->GetPlatformToolset())
{
return true;
}
@@ -435,7 +449,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
cmOStringStream m;
m << "Found Windows SDK v7.1: " << winSDK_7_1;
mf->DisplayStatus(m.str().c_str(), -1);
- this->PlatformToolset = "Windows7.1SDK";
+ this->DefaultPlatformToolset = "Windows7.1SDK";
return true;
}
else
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index ede6b1b..b4dcc7e 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -31,7 +31,7 @@ public:
virtual bool MatchesGeneratorName(const std::string& name) const;
- virtual bool SetGeneratorToolset(std::string const& ts);
+ virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
@@ -66,7 +66,7 @@ public:
bool IsMasmEnabled() const { return this->MasmEnabled; }
/** The toolset name for the target platform. */
- const char* GetPlatformToolset();
+ const char* GetPlatformToolset() const;
/**
* Where does this version of Visual Studio look for macros for the
@@ -99,7 +99,8 @@ protected:
std::string const& GetMSBuildCommand();
- std::string PlatformToolset;
+ std::string GeneratorToolset;
+ std::string DefaultPlatformToolset;
bool ExpressEdition;
bool MasmEnabled;
@@ -122,5 +123,6 @@ private:
virtual std::string FindMSBuildCommand();
virtual std::string FindDevEnvCommand();
virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); }
+ void AddVSPlatformToolsetDefinition(cmMakefile* mf) const;
};
#endif
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 4caa7f2..fa134fc 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -43,27 +43,24 @@ public:
const char* p = cmVS11GenName(name, genName);
if(!p)
{ return 0; }
- if(strcmp(p, "") == 0)
+ if(!*p)
{
return new cmGlobalVisualStudio11Generator(
genName, "", "");
}
- if(strcmp(p, " Win64") == 0)
+ if(*p++ != ' ')
+ { return 0; }
+ if(strcmp(p, "Win64") == 0)
{
return new cmGlobalVisualStudio11Generator(
genName, "x64", "CMAKE_FORCE_WIN64");
}
- if(strcmp(p, " ARM") == 0)
+ if(strcmp(p, "ARM") == 0)
{
return new cmGlobalVisualStudio11Generator(
genName, "ARM", "");
}
- if(*p++ != ' ')
- {
- return 0;
- }
-
std::set<std::string> installedSDKs =
cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs();
@@ -117,7 +114,7 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;"
"ProductDir", vc11Express, cmSystemTools::KeyWOW64_32);
- this->PlatformToolset = "v110";
+ this->DefaultPlatformToolset = "v110";
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 6cd9f12..698624d 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -43,17 +43,19 @@ public:
const char* p = cmVS12GenName(name, genName);
if(!p)
{ return 0; }
- if(strcmp(p, "") == 0)
+ if(!*p)
{
return new cmGlobalVisualStudio12Generator(
genName, "", "");
}
- if(strcmp(p, " Win64") == 0)
+ if(*p++ != ' ')
+ { return 0; }
+ if(strcmp(p, "Win64") == 0)
{
return new cmGlobalVisualStudio12Generator(
genName, "x64", "CMAKE_FORCE_WIN64");
}
- if(strcmp(p, " ARM") == 0)
+ if(strcmp(p, "ARM") == 0)
{
return new cmGlobalVisualStudio12Generator(
genName, "ARM", "");
@@ -92,7 +94,7 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\12.0\\Setup\\VC;"
"ProductDir", vc12Express, cmSystemTools::KeyWOW64_32);
- this->PlatformToolset = "v120";
+ this->DefaultPlatformToolset = "v120";
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e5fc436..29a5955 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -202,16 +202,19 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
}
//----------------------------------------------------------------------------
-bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts)
+bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
+ cmMakefile* mf)
{
if(this->XcodeVersion >= 30)
{
- this->PlatformToolset = ts;
+ this->GeneratorToolset = ts;
+ mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET",
+ this->GeneratorToolset.c_str());
return true;
}
else
{
- return cmGlobalGenerator::SetGeneratorToolset(ts);
+ return cmGlobalGenerator::SetGeneratorToolset(ts, mf);
}
}
@@ -239,11 +242,6 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
}
}
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
- if(!this->PlatformToolset.empty())
- {
- mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET",
- this->PlatformToolset.c_str());
- }
this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);
const char* osxArch =
mf->GetDefinition("CMAKE_OSX_ARCHITECTURES");
@@ -2442,8 +2440,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget)
}
else
{
- const char* theConfig =
- this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE");
+ std::string theConfig =
+ this->CurrentMakefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
cmXCodeObject* buildSettings =
this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
this->CreateBuildSettings(cmtarget, buildSettings, theConfig);
@@ -2821,11 +2819,7 @@ void cmGlobalXCodeGenerator
i != this->CurrentConfigurationTypes.end(); ++i)
{
// Get the current configuration name.
- const char* configName = i->c_str();
- if(!*configName)
- {
- configName = 0;
- }
+ std::string configName = *i;
if(this->XcodeVersion >= 50)
{
@@ -3363,10 +3357,10 @@ void cmGlobalXCodeGenerator
buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET",
this->CreateString(deploymentTarget));
}
- if(!this->PlatformToolset.empty())
+ if(!this->GeneratorToolset.empty())
{
buildSettings->AddAttribute("GCC_VERSION",
- this->CreateString(this->PlatformToolset.c_str()));
+ this->CreateString(this->GeneratorToolset.c_str()));
}
// Put this last so it can override existing settings
@@ -3512,11 +3506,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
ct = this->CurrentConfigurationTypes.begin();
ct != this->CurrentConfigurationTypes.end(); ++ct)
{
- const char* configName = 0;
- if(!ct->empty())
- {
- configName = ct->c_str();
- }
+ std::string configName = *ct;
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
i != targets.end(); ++i)
{
@@ -3969,7 +3959,7 @@ bool cmGlobalXCodeGenerator::IsMultiConfig()
void cmGlobalXCodeGenerator
::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
{
- const char* configName = this->GetCMakeCFGIntDir();
+ std::string configName = this->GetCMakeCFGIntDir();
std::string dir = this->GetObjectsNormalDirectory(
"$(PROJECT_NAME)", configName, gt->Target);
if(this->XcodeVersion >= 21)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index c9937ed..ae23e3b 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -89,7 +89,7 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig();
- virtual bool SetGeneratorToolset(std::string const& ts);
+ virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
void AppendFlag(std::string& flags, std::string const& flag);
private:
cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
@@ -246,7 +246,7 @@ private:
std::map<std::string, cmXCodeObject* > TargetGroup;
std::map<std::string, cmXCodeObject* > FileRefs;
std::vector<std::string> Architectures;
- std::string PlatformToolset;
+ std::string GeneratorToolset;
};
#endif
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 6594218..b2be82e 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -12,6 +12,7 @@
#include "cmInstallFilesGenerator.h"
#include "cmGeneratorExpression.h"
+#include "cmMakefile.h"
#include "cmSystemTools.h"
//----------------------------------------------------------------------------
@@ -84,8 +85,7 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
Indent const& indent)
{
std::vector<std::string> files;
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
for(std::vector<std::string>::const_iterator i = this->Files.begin();
i != this->Files.end(); ++i)
{
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 7e78ec0..7813fcc 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -32,9 +32,8 @@ cmInstalledFile::~cmInstalledFile()
//----------------------------------------------------------------------------
void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name)
{
- cmListFileBacktrace backtrace;
- mf->GetBacktrace(backtrace);
- cmGeneratorExpression ge(backtrace);
+ cmListFileBacktrace backtrace = mf->GetBacktrace();
+ cmGeneratorExpression ge(&backtrace);
this->Name = name;
this->NameExpression = ge.Parse(name).release();
@@ -70,9 +69,8 @@ void cmInstalledFile::SetProperty(cmMakefile const* mf,
void cmInstalledFile::AppendProperty(cmMakefile const* mf,
const std::string& prop, const char* value, bool /*asString*/)
{
- cmListFileBacktrace backtrace;
- mf->GetBacktrace(backtrace);
- cmGeneratorExpression ge(backtrace);
+ cmListFileBacktrace backtrace = mf->GetBacktrace();
+ cmGeneratorExpression ge(&backtrace);
Property& property = this->Properties[prop];
property.ValueExpressions.push_back(ge.Parse(value).release());
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 34781d3..3fc5b69 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -12,6 +12,7 @@
#include "cmListFileCache.h"
#include "cmListFileLexer.h"
+#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmVersion.h"
@@ -141,7 +142,8 @@ bool cmListFile::ParseFile(const char* filename,
bool topLevel,
cmMakefile *mf)
{
- if(!cmSystemTools::FileExists(filename))
+ if(!cmSystemTools::FileExists(filename) ||
+ cmSystemTools::FileIsDirectory(filename))
{
return false;
}
@@ -408,6 +410,23 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
}
//----------------------------------------------------------------------------
+void cmListFileBacktrace::MakeRelative()
+{
+ if (this->Relative)
+ {
+ return;
+ }
+ for (cmListFileBacktrace::iterator i = this->begin();
+ i != this->end(); ++i)
+ {
+ i->FilePath = this->LocalGenerator->Convert(i->FilePath,
+ cmLocalGenerator::HOME);
+ }
+ this->Relative = true;
+}
+
+
+//----------------------------------------------------------------------------
std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc)
{
os << lfc.FilePath;
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index bede25e..2ca9b8e 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -14,6 +14,8 @@
#include "cmStandardIncludes.h"
+class cmLocalGenerator;
+
/** \class cmListFileCache
* \brief A class to cache list file contents.
*
@@ -66,7 +68,20 @@ struct cmListFileFunction: public cmListFileContext
std::vector<cmListFileArgument> Arguments;
};
-class cmListFileBacktrace: public std::vector<cmListFileContext> {};
+class cmListFileBacktrace: public std::vector<cmListFileContext>
+{
+ public:
+ cmListFileBacktrace(cmLocalGenerator* localGen)
+ : LocalGenerator(localGen)
+ , Relative(localGen ? false : true)
+ {
+ }
+
+ void MakeRelative();
+ private:
+ cmLocalGenerator* LocalGenerator;
+ bool Relative;
+};
struct cmListFile
{
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f83981e..c8c8c79 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -875,6 +875,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return replaceValues.ObjectDir;
}
}
+ if(replaceValues.ObjectFileDir)
+ {
+ if(variable == "OBJECT_FILE_DIR")
+ {
+ return replaceValues.ObjectFileDir;
+ }
+ }
if(replaceValues.Objects)
{
if(variable == "OBJECTS")
@@ -2195,8 +2202,16 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target,
return;
}
std::string extProp = lang + "_EXTENSIONS";
- bool ext = target->GetPropertyAsBool(extProp);
- std::string type = ext ? "EXTENSION" : "STANDARD";
+ std::string type = "EXTENSION";
+ bool ext = true;
+ if (const char* extPropValue = target->GetProperty(extProp))
+ {
+ if (cmSystemTools::IsOff(extPropValue))
+ {
+ ext = false;
+ type = "STANDARD";
+ }
+ }
if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED"))
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 32da21b..ad73073 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -269,6 +269,7 @@ public:
const char* Output;
const char* Object;
const char* ObjectDir;
+ const char* ObjectFileDir;
const char* Flags;
const char* ObjectsQuoted;
const char* SONameFlag;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2620471..412c998 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -310,14 +310,19 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
std::string const& text) const
{
// Collect context information.
- cmListFileBacktrace backtrace;
+ cmLocalGenerator* localGen = this->GetLocalGenerator();
+ if(this->CallStack.empty() && this->GetCMakeInstance()->GetIsInTryCompile())
+ {
+ localGen = 0;
+ }
+ cmListFileBacktrace backtrace(localGen);
if(!this->CallStack.empty())
{
if((t == cmake::FATAL_ERROR) || (t == cmake::INTERNAL_ERROR))
{
this->CallStack.back().Status->SetNestedError(true);
}
- this->GetBacktrace(backtrace);
+ backtrace = this->GetBacktrace();
}
else
{
@@ -335,11 +340,6 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
lfc.FilePath = this->ListFileStack.back();
}
lfc.Line = 0;
- if(!this->GetCMakeInstance()->GetIsInTryCompile())
- {
- lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
- cmLocalGenerator::HOME);
- }
backtrace.push_back(lfc);
}
@@ -348,21 +348,15 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
}
//----------------------------------------------------------------------------
-bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const
+cmListFileBacktrace cmMakefile::GetBacktrace() const
{
- if(this->CallStack.empty())
- {
- return false;
- }
+ cmListFileBacktrace backtrace(this->GetLocalGenerator());
for(CallStackType::const_reverse_iterator i = this->CallStack.rbegin();
i != this->CallStack.rend(); ++i)
{
- cmListFileContext lfc = *(*i).Context;
- lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
- cmLocalGenerator::HOME);
- backtrace.push_back(lfc);
+ backtrace.push_back(*i->Context);
}
- return true;
+ return backtrace;
}
//----------------------------------------------------------------------------
@@ -1745,8 +1739,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
before ? this->IncludeDirectoriesEntries.begin()
: this->IncludeDirectoriesEntries.end();
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
cmValueWithOrigin entry(incString, lfbt);
this->IncludeDirectoriesEntries.insert(position, entry);
@@ -1923,7 +1916,7 @@ void cmMakefile::CheckForUnused(const char* reason,
if (this->WarnUnused && !this->VariableUsed(name))
{
std::string path;
- cmListFileBacktrace bt;
+ cmListFileBacktrace bt(this->GetLocalGenerator());
if (this->CallStack.size())
{
const cmListFileContext* file = this->CallStack.back().Context;
@@ -2874,7 +2867,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
this->GetHomeOutputDirectory()))
{
cmOStringStream msg;
- cmListFileBacktrace bt;
+ cmListFileBacktrace bt(this->GetLocalGenerator());
cmListFileContext lfc;
lfc.FilePath = filename;
lfc.Line = line;
@@ -4013,8 +4006,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
{
return;
}
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
this->IncludeDirectoriesEntries.push_back(
cmValueWithOrigin(value, lfbt));
return;
@@ -4026,8 +4018,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
{
return;
}
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
this->CompileOptionsEntries.push_back(cmValueWithOrigin(value, lfbt));
return;
}
@@ -4038,8 +4029,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
{
return;
}
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);
this->CompileDefinitionsEntries.push_back(entry);
return;
@@ -4070,24 +4060,21 @@ void cmMakefile::AppendProperty(const std::string& prop,
{
if (prop == "INCLUDE_DIRECTORIES")
{
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
this->IncludeDirectoriesEntries.push_back(
cmValueWithOrigin(value, lfbt));
return;
}
if (prop == "COMPILE_OPTIONS")
{
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
this->CompileOptionsEntries.push_back(
cmValueWithOrigin(value, lfbt));
return;
}
if (prop == "COMPILE_DEFINITIONS")
{
- cmListFileBacktrace lfbt;
- this->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->GetBacktrace();
this->CompileDefinitionsEntries.push_back(
cmValueWithOrigin(value, lfbt));
return;
@@ -4435,7 +4422,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
if(cmDefinitions* up = cur.GetParent())
{
// First localize the definition in the current scope.
- cur.Get(var);
+ cur.Pull(var);
// Now update the definition in the parent scope.
up->Set(var, varDef);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e3b83af..d5ffd98 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -655,7 +655,7 @@ public:
/**
* Get the current context backtrace.
*/
- bool GetBacktrace(cmListFileBacktrace& backtrace) const;
+ cmListFileBacktrace GetBacktrace() const;
/**
* Get the vector of files created by this makefile
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index a08d731..403f6e6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -137,8 +137,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->Makefile->GetProperty
("ADDITIONAL_MAKE_CLEAN_FILES"))
{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(additional_clean_files);
@@ -684,6 +683,11 @@ cmMakefileTargetGenerator
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
vars.ObjectDir = objectDir.c_str();
+ std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
+ objectFileDir = this->Convert(objectFileDir,
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
+ vars.ObjectFileDir = objectFileDir.c_str();
vars.Flags = flags.c_str();
std::string definesString = "$(";
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c3b4c75..24689fb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -385,6 +385,7 @@ cmNinjaTargetGenerator
vars.TargetPDB = "$TARGET_PDB";
vars.TargetCompilePDB = "$TARGET_COMPILE_PDB";
vars.ObjectDir = "$OBJECT_DIR";
+ vars.ObjectFileDir = "$OBJECT_FILE_DIR";
cmMakefile* mf = this->GetMakefile();
@@ -623,6 +624,10 @@ cmNinjaTargetGenerator
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(objectDir.c_str()),
cmLocalGenerator::SHELL);
+ std::string objectFileDir = cmSystemTools::GetFilenamePath(objectFileName);
+ vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
+ ConvertToNinjaPath(objectFileDir.c_str()),
+ cmLocalGenerator::SHELL);
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars);
@@ -651,6 +656,7 @@ cmNinjaTargetGenerator
compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str();
compileObjectVars.ObjectDir = objectDir.c_str();
+ compileObjectVars.ObjectFileDir = objectFileDir.c_str();
compileObjectVars.Flags = vars["FLAGS"].c_str();
compileObjectVars.Defines = vars["DEFINES"].c_str();
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index ec671fc..71a3497 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -39,8 +39,8 @@ public:
if(file.rfind(".framework") != std::string::npos)
{
- cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/(.*)$");
+ static cmsys::RegularExpression
+ splitFramework("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(file) &&
(std::string::npos !=
splitFramework.match(3).find(splitFramework.match(2))))
@@ -326,8 +326,8 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
if(fullPath.rfind(".framework") != std::string::npos)
{
- cmsys::RegularExpression splitFramework;
- splitFramework.compile("^(.*)/(.*).framework/(.*)$");
+ static cmsys::RegularExpression
+ splitFramework("^(.*)/(.*).framework/(.*)$");
if(splitFramework.find(fullPath) &&
(std::string::npos !=
splitFramework.match(3).find(splitFramework.match(2))))
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 15acfdd..01edde9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -87,10 +87,12 @@ class cmTargetInternals
{
public:
cmTargetInternals()
+ : Backtrace(NULL)
{
this->PolicyWarnedCMP0022 = false;
}
cmTargetInternals(cmTargetInternals const&)
+ : Backtrace(NULL)
{
this->PolicyWarnedCMP0022 = false;
}
@@ -366,7 +368,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
}
// Save the backtrace of target construction.
- this->Makefile->GetBacktrace(this->Internal->Backtrace);
+ this->Internal->Backtrace = this->Makefile->GetBacktrace();
if (!this->IsImported())
{
@@ -443,7 +445,7 @@ void cmTarget::AddUtility(const std::string& u, cmMakefile *makefile)
{
if(this->Utilities.insert(u).second && makefile)
{
- makefile->GetBacktrace(UtilityBacktraces[u]);
+ UtilityBacktraces.insert(std::make_pair(u, makefile->GetBacktrace()));
}
}
@@ -710,11 +712,8 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
this->DebugSourcesDone = true;
}
- cmListFileBacktrace lfbt;
-
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "SOURCES", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ "SOURCES", 0, 0);
std::set<std::string> uniqueSrcs;
bool contextDependentDirectSources = processSources(this,
@@ -739,7 +738,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
continue;
}
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
@@ -758,7 +757,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
// TARGET_PROPERTY expression.
sourceGenex = "$<$<BOOL:" + it->Value + ">:" + sourceGenex + ">";
}
- cmGeneratorExpression ge(it->Backtrace);
+ cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
sourceGenex);
@@ -910,9 +909,8 @@ void cmTarget::AddTracedSources(std::vector<std::string> const& srcs)
{
this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true;
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back(
@@ -948,9 +946,8 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
{
this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true;
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back(
@@ -1084,9 +1081,8 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
{
this->Internal->SourceFilesMap.clear();
this->LinkImplementationLanguageIsContextDependent = true;
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true);
this->Internal->SourceEntries.push_back(
@@ -1206,11 +1202,10 @@ void cmTarget::GetDirectLinkLibraries(const std::string& config,
const char *prop = this->GetProperty("LINK_LIBRARIES");
if (prop)
{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
"LINK_LIBRARIES", 0, 0);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
@@ -1241,11 +1236,10 @@ void cmTarget::GetInterfaceLinkLibraries(const std::string& config,
const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES");
if (prop)
{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
"INTERFACE_LINK_LIBRARIES", 0, 0);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
@@ -1306,8 +1300,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature)
ret = false;
}
}
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->TLLCommands.push_back(std::make_pair(signature, lfbt));
return ret;
}
@@ -1333,9 +1326,10 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s,
: "plain");
s << "The uses of the " << sigString << " signature are here:\n";
std::set<std::string> emitted;
- for(std::vector<cmListFileBacktrace>::const_iterator it = sigs.begin();
+ for(std::vector<cmListFileBacktrace>::iterator it = sigs.begin();
it != sigs.end(); ++it)
{
+ it->MakeRelative();
cmListFileBacktrace::const_iterator i = it->begin();
if(i != it->end())
{
@@ -1796,9 +1790,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
}
if(prop == "INCLUDE_DIRECTORIES")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->IncludeDirectoriesEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->IncludeDirectoriesEntries.push_back(
@@ -1807,9 +1800,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
}
if(prop == "COMPILE_OPTIONS")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileOptionsEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileOptionsEntries.push_back(
@@ -1818,9 +1810,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
}
if(prop == "COMPILE_FEATURES")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileFeaturesEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileFeaturesEntries.push_back(
@@ -1829,9 +1820,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
}
if(prop == "COMPILE_DEFINITIONS")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
deleteAndClear(this->Internal->CompileDefinitionsEntries);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->CompileDefinitionsEntries.push_back(
@@ -1849,8 +1839,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if (prop == "LINK_LIBRARIES")
{
this->Internal->LinkImplementationPropertyEntries.clear();
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);
this->Internal->LinkImplementationPropertyEntries.push_back(entry);
return;
@@ -1866,9 +1855,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
return;
}
this->Internal->SourceFilesMap.clear();
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
this->Internal->SourceEntries.clear();
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->SourceEntries.push_back(
@@ -1901,36 +1889,32 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
if(prop == "INCLUDE_DIRECTORIES")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
this->Internal->IncludeDirectoriesEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return;
}
if(prop == "COMPILE_OPTIONS")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
this->Internal->CompileOptionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return;
}
if(prop == "COMPILE_FEATURES")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
this->Internal->CompileFeaturesEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return;
}
if(prop == "COMPILE_DEFINITIONS")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
this->Internal->CompileDefinitionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return;
@@ -1945,8 +1929,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
if (prop == "LINK_LIBRARIES")
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);
this->Internal->LinkImplementationPropertyEntries.push_back(entry);
return;
@@ -1962,9 +1945,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
return;
}
this->Internal->SourceFilesMap.clear();
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmGeneratorExpression ge(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
+ cmGeneratorExpression ge(&lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
this->Internal->SourceEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(cge));
@@ -2030,7 +2012,7 @@ void cmTarget::AppendBuildInterfaceIncludes()
void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
bool before)
{
- cmGeneratorExpression ge(entry.Backtrace);
+ cmGeneratorExpression ge(&entry.Backtrace);
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
= before ? this->Internal->IncludeDirectoriesEntries.begin()
@@ -2044,7 +2026,7 @@ void cmTarget::InsertInclude(const cmValueWithOrigin &entry,
void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry,
bool before)
{
- cmGeneratorExpression ge(entry.Backtrace);
+ cmGeneratorExpression ge(&entry.Backtrace);
std::vector<cmTargetInternals::TargetPropertyEntry*>::iterator position
= before ? this->Internal->CompileOptionsEntries.begin()
@@ -2057,7 +2039,7 @@ void cmTarget::InsertCompileOption(const cmValueWithOrigin &entry,
//----------------------------------------------------------------------------
void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry)
{
- cmGeneratorExpression ge(entry.Backtrace);
+ cmGeneratorExpression ge(&entry.Backtrace);
this->Internal->CompileDefinitionsEntries.push_back(
new cmTargetInternals::TargetPropertyEntry(ge.Parse(entry.Value)));
@@ -2098,14 +2080,13 @@ static void processIncludeDirectories(cmTarget const* tgt,
}
}
std::string usedIncludes;
- cmListFileBacktrace lfbt;
for(std::vector<std::string>::iterator
li = entryIncludes.begin(); li != entryIncludes.end(); ++li)
{
std::string targetName = (*it)->TargetName;
std::string evaluatedTargetName;
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(targetName);
evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
@@ -2238,10 +2219,8 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
{
std::vector<std::string> includes;
std::set<std::string> uniqueIncludes;
- cmListFileBacktrace lfbt;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
"INCLUDE_DIRECTORIES", 0, 0);
std::vector<std::string> debugProperties;
@@ -2284,7 +2263,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
continue;
}
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value);
std::string result = cge->Evaluate(this->Makefile, config,
@@ -2303,7 +2282,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
// TARGET_PROPERTY expression.
includeGenex = "$<$<BOOL:" + it->Value + ">:" + includeGenex + ">";
}
- cmGeneratorExpression ge(it->Backtrace);
+ cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
includeGenex);
@@ -2332,7 +2311,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
libDir = frameworkCheck.match(1);
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(libDir.c_str());
this->Internal
@@ -2446,10 +2425,9 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
{
return;
}
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
"AUTOUIC_OPTIONS", 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(prop)
@@ -2466,11 +2444,9 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
const std::string& config) const
{
std::set<std::string> uniqueOptions;
- cmListFileBacktrace lfbt;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "COMPILE_OPTIONS", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ "COMPILE_OPTIONS", 0, 0);
std::vector<std::string> debugProperties;
const char *debugProp =
@@ -2512,7 +2488,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
continue;
}
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
@@ -2531,7 +2507,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
// TARGET_PROPERTY expression.
optionGenex = "$<$<BOOL:" + it->Value + ">:" + optionGenex + ">";
}
- cmGeneratorExpression ge(it->Backtrace);
+ cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
optionGenex);
@@ -2578,11 +2554,9 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
const std::string& config) const
{
std::set<std::string> uniqueOptions;
- cmListFileBacktrace lfbt;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
- "COMPILE_DEFINITIONS", 0, 0);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ "COMPILE_DEFINITIONS", 0, 0);
std::vector<std::string> debugProperties;
const char *debugProp =
@@ -2624,7 +2598,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
continue;
}
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
@@ -2643,7 +2617,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
// TARGET_PROPERTY expression.
defsGenex = "$<$<BOOL:" + it->Value + ">:" + defsGenex + ">";
}
- cmGeneratorExpression ge(it->Backtrace);
+ cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
defsGenex);
@@ -2671,7 +2645,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
}
case cmPolicies::OLD:
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(configProp);
this->Internal
@@ -2726,10 +2700,8 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
const std::string& config) const
{
std::set<std::string> uniqueFeatures;
- cmListFileBacktrace lfbt;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
- this->GetName(),
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
"COMPILE_FEATURES",
0, 0);
@@ -2773,7 +2745,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
continue;
}
{
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
@@ -2792,7 +2764,7 @@ void cmTarget::GetCompileFeatures(std::vector<std::string> &result,
// TARGET_PROPERTY expression.
featureGenex = "$<$<BOOL:" + it->Value + ">:" + featureGenex + ">";
}
- cmGeneratorExpression ge(it->Backtrace);
+ cmGeneratorExpression ge(&it->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
featureGenex);
@@ -4348,6 +4320,7 @@ void cmTarget::GetLibraryNames(std::string& name,
const char* version = this->GetProperty("VERSION");
const char* soversion = this->GetProperty("SOVERSION");
if(!this->HasSOName(config) ||
+ this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") ||
this->IsFrameworkOnApple())
{
// Versioning is supported only for shared libraries and modules,
@@ -5183,8 +5156,7 @@ cmTarget::ReportPropertyOrigin(const std::string &p,
areport += result;
areport += "\"):\n" + report;
- cmListFileBacktrace lfbt;
- this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport, lfbt);
+ this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
}
//----------------------------------------------------------------------------
@@ -5921,10 +5893,9 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
}
if(propertyLibs)
{
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
+ cmGeneratorExpression ge;
- cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
linkProp, 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(propertyLibs)
@@ -6175,7 +6146,6 @@ void processILibs(const std::string& config,
if (emitted.insert(tgt).second)
{
tgts.push_back(tgt);
- std::vector<std::string> ilibs;
cmTarget::LinkInterface const* iface =
tgt->GetLinkInterfaceLibraries(config, headTarget);
if (iface)
@@ -6244,10 +6214,9 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
}
// The interface libraries have been explicitly set.
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
- linkIfaceProp, 0, 0);
+ cmGeneratorExpression ge;
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
+ linkIfaceProp, 0, 0);
dagChecker.SetTransitivePropertiesOnly();
std::vector<std::string> libs;
cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
@@ -6356,9 +6325,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
if(explicitLibraries)
{
// The interface libraries have been explicitly set.
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+ cmGeneratorExpression ge;
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
linkIfaceProp, 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(explicitLibraries)->Evaluate(
this->Makefile,
@@ -6383,9 +6351,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
{
// Compare the link implementation fallback link interface to the
// preferred new link interface property and warn if different.
- cmListFileBacktrace lfbt;
- cmGeneratorExpression ge(lfbt);
- cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+ cmGeneratorExpression ge;
+ cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
"INTERFACE_LINK_LIBRARIES", 0, 0);
std::vector<std::string> ifaceLibs;
const char* newExplicitLibraries =
diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx
index 18499fd..3fb76a6 100644
--- a/Source/cmTargetCompileOptionsCommand.cxx
+++ b/Source/cmTargetCompileOptionsCommand.cxx
@@ -55,8 +55,7 @@ bool cmTargetCompileOptionsCommand
::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
bool, bool)
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(this->Join(content), lfbt);
tgt->InsertCompileOption(entry);
return true;
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index caec7eb..e9f0e04 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -70,8 +70,7 @@ bool cmTargetIncludeDirectoriesCommand
::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
bool prepend, bool system)
{
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
+ cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(this->Join(content), lfbt);
tgt->InsertInclude(entry, prepend);
if (system)
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 28a7bb1..ff5d411 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -17,24 +17,22 @@
//----------------------------------------------------------------------------
cmTest::cmTest(cmMakefile* mf)
+ : Backtrace(mf->GetBacktrace())
{
this->Makefile = mf;
this->OldStyle = true;
this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
- this->Backtrace = new cmListFileBacktrace;
- this->Makefile->GetBacktrace(*this->Backtrace);
}
//----------------------------------------------------------------------------
cmTest::~cmTest()
{
- delete this->Backtrace;
}
//----------------------------------------------------------------------------
cmListFileBacktrace const& cmTest::GetBacktrace() const
{
- return *this->Backtrace;
+ return this->Backtrace;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmTest.h b/Source/cmTest.h
index a93eff5..c6e7e42 100644
--- a/Source/cmTest.h
+++ b/Source/cmTest.h
@@ -14,8 +14,8 @@
#include "cmCustomCommand.h"
#include "cmPropertyMap.h"
+#include "cmListFileCache.h"
class cmMakefile;
-class cmListFileBacktrace;
/** \class cmTest
* \brief Represent a test
@@ -71,7 +71,7 @@ private:
bool OldStyle;
cmMakefile* Makefile;
- cmListFileBacktrace* Backtrace;
+ cmListFileBacktrace Backtrace;
};
#endif
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index c1b1f8b..f87a535 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -70,7 +70,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
this->TestGenerated = true;
// Set up generator expression evaluation context.
- cmGeneratorExpression ge(this->Test->GetBacktrace());
+ cmGeneratorExpression ge(&this->Test->GetBacktrace());
// Start the test command.
os << indent << "add_test(" << this->Test->GetName() << " ";
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 72bb020..acf3930 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -32,34 +32,37 @@
#include <cmsys/auto_ptr.hxx>
-static cmVS7FlagTable const*
-cmVSGetCLFlagTable(cmLocalVisualStudioGenerator* lg)
+cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
{
- if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS12)
+ cmLocalVisualStudioGenerator::VSVersion
+ v = this->LocalGenerator->GetVersion();
+ if(v >= cmLocalVisualStudioGenerator::VS12)
{ return cmVS12CLFlagTable; }
- else if(lg->GetVersion() == cmLocalVisualStudioGenerator::VS11)
+ else if(v == cmLocalVisualStudioGenerator::VS11)
{ return cmVS11CLFlagTable; }
else
{ return cmVS10CLFlagTable; }
}
-static cmVS7FlagTable const*
-cmVSGetLibFlagTable(cmLocalVisualStudioGenerator* lg)
+cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLibFlagTable() const
{
- if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS12)
+ cmLocalVisualStudioGenerator::VSVersion
+ v = this->LocalGenerator->GetVersion();
+ if(v >= cmLocalVisualStudioGenerator::VS12)
{ return cmVS12LibFlagTable; }
- else if(lg->GetVersion() == cmLocalVisualStudioGenerator::VS11)
+ else if(v == cmLocalVisualStudioGenerator::VS11)
{ return cmVS11LibFlagTable; }
else
{ return cmVS10LibFlagTable; }
}
-static cmVS7FlagTable const*
-cmVSGetLinkFlagTable(cmLocalVisualStudioGenerator* lg)
+cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetLinkFlagTable() const
{
- if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS12)
+ cmLocalVisualStudioGenerator::VSVersion
+ v = this->LocalGenerator->GetVersion();
+ if(v >= cmLocalVisualStudioGenerator::VS12)
{ return cmVS12LinkFlagTable; }
- else if(lg->GetVersion() == cmLocalVisualStudioGenerator::VS11)
+ else if(v == cmLocalVisualStudioGenerator::VS11)
{ return cmVS11LinkFlagTable; }
else
{ return cmVS10LinkFlagTable; }
@@ -464,8 +467,6 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
{
- cmGlobalVisualStudio10Generator* gg =
- static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@@ -500,52 +501,61 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
configType += "</ConfigurationType>\n";
this->WriteString(configType.c_str(), 2);
- const char* mfcFlag =
- this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG");
- std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
+ this->WriteMSToolConfigurationValues(*i);
- std::string useOfMfcValue = "false";
- if(mfcFlagValue == "1")
- {
- useOfMfcValue = "Static";
- }
- else if(mfcFlagValue == "2")
- {
- useOfMfcValue = "Dynamic";
- }
- std::string mfcLine = "<UseOfMfc>";
- mfcLine += useOfMfcValue + "</UseOfMfc>\n";
- this->WriteString(mfcLine.c_str(), 2);
+ this->WriteString("</PropertyGroup>\n", 1);
+ }
+}
- if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY &&
- this->ClOptions[*i]->UsingUnicode()) ||
- this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
- {
- this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
- }
- else if (this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
- this->ClOptions[*i]->UsingSBCS())
- {
- this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2);
- }
- else
- {
- this->WriteString("<CharacterSet>MultiByte</CharacterSet>\n", 2);
- }
- if(const char* toolset = gg->GetPlatformToolset())
- {
- std::string pts = "<PlatformToolset>";
- pts += toolset;
- pts += "</PlatformToolset>\n";
- this->WriteString(pts.c_str(), 2);
- }
- if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
- {
- this->WriteString("<WindowsAppContainer>true"
- "</WindowsAppContainer>\n", 2);
- }
+//----------------------------------------------------------------------------
+void cmVisualStudio10TargetGenerator
+::WriteMSToolConfigurationValues(std::string const& config)
+{
+ cmGlobalVisualStudio10Generator* gg =
+ static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
+ const char* mfcFlag =
+ this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG");
+ std::string mfcFlagValue = mfcFlag ? mfcFlag : "0";
- this->WriteString("</PropertyGroup>\n", 1);
+ std::string useOfMfcValue = "false";
+ if(mfcFlagValue == "1")
+ {
+ useOfMfcValue = "Static";
+ }
+ else if(mfcFlagValue == "2")
+ {
+ useOfMfcValue = "Dynamic";
+ }
+ std::string mfcLine = "<UseOfMfc>";
+ mfcLine += useOfMfcValue + "</UseOfMfc>\n";
+ this->WriteString(mfcLine.c_str(), 2);
+
+ if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY &&
+ this->ClOptions[config]->UsingUnicode()) ||
+ this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+ {
+ this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
+ }
+ else if (this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
+ this->ClOptions[config]->UsingSBCS())
+ {
+ this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2);
+ }
+ else
+ {
+ this->WriteString("<CharacterSet>MultiByte</CharacterSet>\n", 2);
+ }
+ if(const char* toolset = gg->GetPlatformToolset())
+ {
+ std::string pts = "<PlatformToolset>";
+ pts += toolset;
+ pts += "</PlatformToolset>\n";
+ this->WriteString(pts.c_str(), 2);
+ }
+ if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+ {
+ this->WriteString("<WindowsAppContainer>true"
+ "</WindowsAppContainer>\n", 2);
}
}
@@ -1144,17 +1154,18 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
// if the source file does not match the linker language
// then force c or c++
+ const char* compileAs = 0;
if(needForceLang || (linkLanguage != lang))
{
if(lang == "CXX")
{
// force a C++ file type
- flags += " /TP ";
+ compileAs = "CompileAsCpp";
}
else if(lang == "C")
{
// force to c
- flags += " /TC ";
+ compileAs = "CompileAsC";
}
}
bool hasFlags = false;
@@ -1190,7 +1201,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
// if we have flags or defines for this config then
// use them
- if(flags.size() || configDefines.size())
+ if(!flags.empty() || !configDefines.empty() || compileAs)
{
(*this->BuildFileStream ) << firstString;
firstString = ""; // only do firstString once
@@ -1198,7 +1209,11 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
cmVisualStudioGeneratorOptions
clOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Compiler,
- cmVSGetCLFlagTable(this->LocalGenerator), 0, this);
+ this->GetClFlagTable(), 0, this);
+ if(compileAs)
+ {
+ clOptions.AddFlag("CompileAs", compileAs);
+ }
clOptions.Parse(flags.c_str());
clOptions.AddDefines(configDefines.c_str());
clOptions.SetConfiguration((*config).c_str());
@@ -1260,23 +1275,28 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
this->ConvertToWindowsSlash(outDir);
this->WritePlatformConfigTag("OutDir", config->c_str(), 3);
- *this->BuildFileStream << outDir
+ *this->BuildFileStream << cmVS10EscapeXML(outDir)
<< "</OutDir>\n";
this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
- *this->BuildFileStream << intermediateDir
+ *this->BuildFileStream << cmVS10EscapeXML(intermediateDir)
<< "</IntDir>\n";
+ std::string name =
+ cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
- *this->BuildFileStream
- << cmSystemTools::GetFilenameWithoutLastExtension(
- targetNameFull.c_str())
- << "</TargetName>\n";
+ *this->BuildFileStream << cmVS10EscapeXML(name) << "</TargetName>\n";
+ std::string ext =
+ cmSystemTools::GetFilenameLastExtension(targetNameFull);
+ if(ext.empty())
+ {
+ // An empty TargetExt causes a default extension to be used.
+ // A single "." appears to be treated as an empty extension.
+ ext = ".";
+ }
this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
- *this->BuildFileStream
- << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str())
- << "</TargetExt>\n";
+ *this->BuildFileStream << cmVS10EscapeXML(ext) << "</TargetExt>\n";
this->OutputLinkIncremental(*config);
}
@@ -1355,48 +1375,44 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
cmsys::auto_ptr<Options> pOptions(
new Options(this->LocalGenerator, Options::Compiler,
- cmVSGetCLFlagTable(this->LocalGenerator)));
+ this->GetClFlagTable()));
Options& clOptions = *pOptions;
std::string flags;
- // collect up flags for
- if(this->Target->GetType() < cmTarget::UTILITY)
+ const std::string& linkLanguage =
+ this->Target->GetLinkerLanguage(configName.c_str());
+ if(linkLanguage.empty())
{
- const std::string& linkLanguage =
- this->Target->GetLinkerLanguage(configName.c_str());
- if(linkLanguage.empty())
- {
- cmSystemTools::Error
- ("CMake can not determine linker language for target: ",
- this->Name.c_str());
- return false;
- }
- if(linkLanguage == "C" || linkLanguage == "CXX"
- || linkLanguage == "Fortran")
- {
- std::string baseFlagVar = "CMAKE_";
- baseFlagVar += linkLanguage;
- baseFlagVar += "_FLAGS";
- flags = this->
- Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
- std::string flagVar = baseFlagVar + std::string("_") +
- cmSystemTools::UpperCase(configName);
- flags += " ";
- flags += this->
- Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
- }
- // set the correct language
- if(linkLanguage == "C")
- {
- flags += " /TC ";
- }
- if(linkLanguage == "CXX")
- {
- flags += " /TP ";
- }
- this->LocalGenerator->AddCompileOptions(flags, this->Target,
- linkLanguage, configName.c_str());
+ cmSystemTools::Error
+ ("CMake can not determine linker language for target: ",
+ this->Name.c_str());
+ return false;
+ }
+ if(linkLanguage == "C" || linkLanguage == "CXX"
+ || linkLanguage == "Fortran")
+ {
+ std::string baseFlagVar = "CMAKE_";
+ baseFlagVar += linkLanguage;
+ baseFlagVar += "_FLAGS";
+ flags = this->
+ Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str());
+ std::string flagVar = baseFlagVar + std::string("_") +
+ cmSystemTools::UpperCase(configName);
+ flags += " ";
+ flags += this->
+ Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str());
+ }
+ // set the correct language
+ if(linkLanguage == "C")
+ {
+ clOptions.AddFlag("CompileAs", "CompileAsC");
}
+ if(linkLanguage == "CXX")
+ {
+ clOptions.AddFlag("CompileAs", "CompileAsCpp");
+ }
+ this->LocalGenerator->AddCompileOptions(flags, this->Target,
+ linkLanguage, configName.c_str());
// Get preprocessor definitions for this directory.
std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
@@ -1436,6 +1452,10 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
clOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
this->OutputIncludes(includes);
clOptions.OutputFlagMap(*this->BuildFileStream, " ");
+ clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
+ "\n", "CXX");
+
+ this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
// If not in debug mode, write the DebugInformationFormat field
// without value so PDBs don't get generated uselessly.
@@ -1445,10 +1465,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
"</DebugInformationFormat>\n", 3);
}
- clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n", "CXX");
- this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
-
// Specify the compiler program database file if configured.
std::string pdb = this->Target->GetCompilePDBPath(configName.c_str());
if(!pdb.empty())
@@ -1508,7 +1524,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
cmVisualStudioGeneratorOptions
libOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Linker,
- cmVSGetLibFlagTable(this->LocalGenerator), 0, this);
+ this->GetLibFlagTable(), 0, this);
libOptions.Parse(libflags.c_str());
libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
libOptions.OutputFlagMap(*this->BuildFileStream, " ");
@@ -1543,7 +1559,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
{
cmsys::auto_ptr<Options> pOptions(
new Options(this->LocalGenerator, Options::Linker,
- cmVSGetLinkFlagTable(this->LocalGenerator), 0, this));
+ this->GetLinkFlagTable(), 0, this));
Options& linkOptions = *pOptions;
const std::string& linkLanguage =
@@ -1567,16 +1583,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
{
linkType = "EXE";
}
- std::string stackVar = "CMAKE_";
- stackVar += linkLanguage;
- stackVar += "_STACK_SIZE";
- const char* stackVal = this->Makefile->GetDefinition(stackVar.c_str());
std::string flags;
- if(stackVal)
- {
- flags += " /STACK:";
- flags += stackVal;
- }
std::string linkFlagVarBase = "CMAKE_";
linkFlagVarBase += linkType;
linkFlagVarBase += "_LINKER_FLAGS";
@@ -1600,14 +1607,6 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
flags += " ";
flags += flagsConfig;
}
- if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
- {
- linkOptions.AddFlag("SubSystem", "Windows");
- }
- else
- {
- linkOptions.AddFlag("SubSystem", "Console");
- }
std::string standardLibsVar = "CMAKE_";
standardLibsVar += linkLanguage;
standardLibsVar += "_STANDARD_LIBRARIES";
@@ -1661,15 +1660,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
linkDirs += "%(AdditionalLibraryDirectories)";
linkOptions.AddFlag("AdditionalLibraryDirectories", linkDirs.c_str());
linkOptions.AddFlag("AdditionalDependencies", libs.c_str());
- linkOptions.AddFlag("Version", "");
- if(linkOptions.IsDebug() || flags.find("/debug") != flags.npos)
- {
- linkOptions.AddFlag("GenerateDebugInformation", "true");
- }
- else
- {
- linkOptions.AddFlag("GenerateDebugInformation", "false");
- }
+
std::string targetName;
std::string targetNameSO;
std::string targetNameFull;
@@ -1688,6 +1679,31 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
config.c_str());
}
+ linkOptions.AddFlag("Version", "");
+
+ if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
+ {
+ linkOptions.AddFlag("SubSystem", "Windows");
+ }
+ else
+ {
+ linkOptions.AddFlag("SubSystem", "Console");
+ }
+
+ if(const char* stackVal =
+ this->Makefile->GetDefinition("CMAKE_"+linkLanguage+"_STACK_SIZE"))
+ {
+ linkOptions.AddFlag("StackReserveSize", stackVal);
+ }
+
+ if(linkOptions.IsDebug() || flags.find("/debug") != flags.npos)
+ {
+ linkOptions.AddFlag("GenerateDebugInformation", "true");
+ }
+ else
+ {
+ linkOptions.AddFlag("GenerateDebugInformation", "false");
+ }
std::string pdb = this->Target->GetPDBDirectory(config.c_str());
pdb += "/";
pdb += targetNamePDB;
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index d72c6fd..8f2faca 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -23,6 +23,7 @@ class cmCustomCommand;
class cmLocalVisualStudio7Generator;
class cmComputeLinkInformation;
class cmVisualStudioGeneratorOptions;
+struct cmIDEFlagTable;
#include "cmSourceGroup.h"
class cmVisualStudio10TargetGenerator
@@ -55,6 +56,7 @@ private:
void WriteString(const char* line, int indentLevel);
void WriteProjectConfigurations();
void WriteProjectConfigurationValues();
+ void WriteMSToolConfigurationValues(std::string const& config);
void WriteSource(const char* tool, cmSourceFile const* sf,
const char* end = 0);
void WriteSources(const char* tool,
@@ -98,6 +100,10 @@ private:
const std::vector<cmSourceGroup>& allGroups);
bool IsResxHeader(const std::string& headerFile);
+ cmIDEFlagTable const* GetClFlagTable() const;
+ cmIDEFlagTable const* GetLibFlagTable() const;
+ cmIDEFlagTable const* GetLinkFlagTable() const;
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<std::string, Options*> OptionsMap;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 60e92a0..e3bebbd 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1462,11 +1462,6 @@ int cmake::ActualConfigure()
"Name of generator toolset.",
cmCacheManager::INTERNAL);
}
- if(!this->GeneratorToolset.empty() &&
- !this->GlobalGenerator->SetGeneratorToolset(this->GeneratorToolset))
- {
- return -2;
- }
// reset any system configuration information, except for when we are
// InTryCompile. With TryCompile the system info is taken from the parent's
@@ -2567,8 +2562,11 @@ static bool cmakeCheckStampList(const char* stampList)
//----------------------------------------------------------------------------
void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
- cmListFileBacktrace const& backtrace)
+ cmListFileBacktrace const& bt)
{
+ cmListFileBacktrace backtrace = bt;
+ backtrace.MakeRelative();
+
cmOStringStream msg;
bool isError = false;
// Construct the message header.
@@ -2726,11 +2724,17 @@ int cmake::Build(const std::string& dir,
}
if(!it.Find("CMAKE_GENERATOR"))
{
- std::cerr << "Error: could find generator in Cache\n";
+ std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n";
return 1;
}
cmsys::auto_ptr<cmGlobalGenerator> gen(
this->CreateGlobalGenerator(it.GetValue()));
+ if(!gen.get())
+ {
+ std::cerr << "Error: could create CMAKE_GENERATOR \""
+ << it.GetValue() << "\"\n";
+ return 1;
+ }
std::string output;
std::string projName;
if(!it.Find("CMAKE_PROJECT_NAME"))
@@ -2785,7 +2789,7 @@ void cmake::RunCheckForUnusedVariables()
}
if(haveUnused)
{
- this->IssueMessage(cmake::WARNING, msg.str(), cmListFileBacktrace());
+ this->IssueMessage(cmake::WARNING, msg.str());
}
#endif
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 329b439..2d04902 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -13,6 +13,7 @@
#ifndef cmake_h
#define cmake_h
+#include "cmListFileCache.h"
#include "cmSystemTools.h"
#include "cmPropertyDefinitionMap.h"
#include "cmPropertyMap.h"
@@ -29,7 +30,6 @@ class cmFileTimeComparison;
class cmExternalMakefileProjectGenerator;
class cmDocumentationSection;
class cmPolicies;
-class cmListFileBacktrace;
class cmTarget;
class cmGeneratedFileStream;
@@ -360,7 +360,7 @@ class cmake
/** Display a message to the user. */
void IssueMessage(cmake::MessageType t, std::string const& text,
- cmListFileBacktrace const& backtrace);
+ cmListFileBacktrace const& backtrace = cmListFileBacktrace(NULL));
///! run the --build option
int Build(const std::string& dir,
const std::string& target,
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 92d2df5..ff32de9 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -45,7 +45,8 @@ static const char * cmDocumentationOptions[][2] =
{"-V,--verbose", "Enable verbose output from tests."},
{"-VV,--extra-verbose", "Enable more verbose output from tests."},
{"--debug", "Displaying more verbose internals of CTest."},
- {"--output-on-failure"},
+ {"--output-on-failure", "Output anything outputted by the test program "
+ "if the test should fail."},
{"-F", "Enable failover."},
{"-j <jobs>, --parallel <jobs>", "Run the tests in parallel using the"
"given number of jobs."},
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index 0e1fe8d..8c99f64 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -13,6 +13,8 @@ set(CMakeLib_TESTS
testXMLSafe
)
+set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
+
if(WIN32)
list(APPEND CMakeLib_TESTS
testVisualStudioSlnParser
@@ -39,7 +41,7 @@ if(CMAKE_OSX_ARCHITECTURES AND XCODE
endif()
foreach(test ${CMakeLib_TESTS})
- add_test(CMakeLib.${test} CMakeLibTests ${test})
+ add_test(CMakeLib.${test} CMakeLibTests ${test} ${${test}_ARGS})
endforeach()
if(TEST_CompileCommandOutput)
diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx
index bad9560..37cb3fa 100644
--- a/Tests/CMakeLib/testRST.cxx
+++ b/Tests/CMakeLib/testRST.cxx
@@ -25,9 +25,14 @@ void reportLine(std::ostream& os, bool ret, std::string line, bool eol)
}
}
-int testRST(int, char*[])
+int testRST(int argc, char* argv[])
{
- std::string dir = cmSystemTools::GetFilenamePath(__FILE__);
+ if(argc != 2)
+ {
+ std::cerr << "Usage: testRST <dir>" << std::endl;
+ return 1;
+ }
+ std::string dir = argv[1];
if(dir.empty())
{
dir = ".";
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 8d2b7fc..3e69f93 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1820,9 +1820,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-options ${build_options}
"--warn-unused-vars")
set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
- PASS_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:7 \\(set\\):")
+ PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):")
set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
- FAIL_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:5 \\(set\\):")
+ FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND NOT WIN32)
@@ -2184,6 +2184,24 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
"Process file.*foo.py.*Total LOC:.*13.*Percentage Coverage: 84.62.*"
ENVIRONMENT COVFILE=)
+ # Adding a test case for non-python Cobertura Coverage
+ configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/DartConfiguration.tcl.in"
+ "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/DartConfiguration.tcl")
+ configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/coverage.xml.in"
+ "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/coverage.xml")
+ file(COPY "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/src"
+ DESTINATION "${CMake_BINARY_DIR}/Testing/CoberturaCoverage")
+ add_test(NAME CTestCoberturaCoverage
+ COMMAND cmake -E chdir
+ ${CMake_BINARY_DIR}/Testing/CoberturaCoverage
+ $<TARGET_FILE:ctest> -T Coverage --debug)
+ set_tests_properties(CTestCoberturaCoverage PROPERTIES
+ PASS_REGULAR_EXPRESSION
+ "Process file.*CoverageTest.java.*Total LOC:.*18.*Percentage Coverage: 72.22.*"
+ ENVIRONMENT COVFILE=)
+
function(add_config_tests cfg)
set(base "${CMake_BINARY_DIR}/Tests/CTestConfig")
@@ -2325,6 +2343,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
"All Labels:.* Label1.* Label2")
configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestLabelRegExp/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestLabelRegExp/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(NAME CTestTestLabelRegExp
+ COMMAND ${CMAKE_CMAKE_COMMAND}
+ -DSOURCE_DIR=${CMAKE_SOURCE_DIR}/Tests/CTestTestLabelRegExp
+ -P ${CMAKE_BINARY_DIR}/Tests/CTestTestLabelRegExp/test.cmake
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Tests/CTestTestLabelRegExp
+ )
+
+ configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake"
@ONLY ESCAPE_QUOTES)
diff --git a/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in b/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in
new file mode 100644
index 0000000..657f382
--- /dev/null
+++ b/Tests/CTestTestLabelRegExp/CTestTestfile.cmake.in
@@ -0,0 +1,8 @@
+add_test(test1 ${CMAKE_COMMAND} -E echo test1)
+set_tests_properties(test1 PROPERTIES LABELS "foo")
+
+add_test(test2 ${CMAKE_COMMAND} -E echo test2)
+set_tests_properties(test2 PROPERTIES LABELS "bar")
+
+add_test(test3 ${CMAKE_COMMAND} -E echo test3)
+set_tests_properties(test3 PROPERTIES LABELS "foo;bar")
diff --git a/Tests/CTestTestLabelRegExp/test.cmake.in b/Tests/CTestTestLabelRegExp/test.cmake.in
new file mode 100644
index 0000000..5c0c9d7
--- /dev/null
+++ b/Tests/CTestTestLabelRegExp/test.cmake.in
@@ -0,0 +1,37 @@
+configure_file(${SOURCE_DIR}/CTestTestfile.cmake.in CTestTestfile.cmake)
+
+function(get_test_list TEST_LIST)
+ set(QUERY_COMMAND ${CMAKE_CTEST_COMMAND} -N ${ARGN})
+
+ execute_process(COMMAND ${QUERY_COMMAND}
+ RESULT_VARIABLE RESULT
+ OUTPUT_VARIABLE OUTPUT
+ ERROR_VARIABLE ERROR)
+
+ if(NOT ${RESULT} STREQUAL "0")
+ message(FATAL_ERROR "command [${QUERY_COMMAND}] failed: RESULT[${RESULT}] OUTPUT[${OUTPUT}] ERROR[${ERROR}]")
+ endif()
+
+ set(${TEST_LIST} "${OUTPUT}" PARENT_SCOPE)
+endfunction()
+
+function(expect_test_list EXPECTED_OUTPUT)
+ get_test_list(TEST_LIST ${ARGN})
+
+ if(NOT "${TEST_LIST}" MATCHES "${EXPECTED_OUTPUT}")
+ message(FATAL_ERROR "actual output [${TEST_LIST}] does not match expected output [${EXPECTED_OUTPUT}] for given arguments [${ARGN}]")
+ endif()
+endfunction()
+
+expect_test_list("test1.*test3.*Total Tests: 2" --label-regex foo)
+expect_test_list("test2.*test3.*Total Tests: 2" --label-regex bar)
+expect_test_list("test1.*test2.*test3.*Total Tests: 3" --label-regex foo|bar)
+expect_test_list("Total Tests: 0" --label-regex baz)
+
+expect_test_list("test2.*Total Tests: 1" --label-exclude foo)
+expect_test_list("test1.*Total Tests: 1" --label-exclude bar)
+expect_test_list("Total Tests: 0" --label-exclude foo|bar)
+expect_test_list("test1.*test2.*test3.*Total Tests: 3" --label-exclude baz)
+
+expect_test_list("test1.*Total Tests: 1" --label-regex foo --label-exclude bar)
+expect_test_list("test2.*Total Tests: 1" --label-regex bar --label-exclude foo)
diff --git a/Tests/CoberturaCoverage/DartConfiguration.tcl.in b/Tests/CoberturaCoverage/DartConfiguration.tcl.in
new file mode 100644
index 0000000..954f59a
--- /dev/null
+++ b/Tests/CoberturaCoverage/DartConfiguration.tcl.in
@@ -0,0 +1,8 @@
+# This file is configured by CMake automatically as DartConfiguration.tcl
+# If you choose not to use CMake, this file may be hand configured, by
+# filling in the required variables.
+
+
+# Configuration directories and files
+SourceDirectory: ${CMake_SOURCE_DIR}/Testing/CoberturaCoverage
+BuildDirectory: ${CMake_BINARY_DIR}/Testing/CoberturaCoverage
diff --git a/Tests/CoberturaCoverage/coverage.xml.in b/Tests/CoberturaCoverage/coverage.xml.in
new file mode 100644
index 0000000..b3f6691
--- /dev/null
+++ b/Tests/CoberturaCoverage/coverage.xml.in
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
+
+<coverage line-rate="0.7222222222222222" branch-rate="0.875" lines-covered="13" lines-valid="18" branches-covered="7" branches-valid="8" complexity="0.0" version="1.9.4.1" timestamp="1401890139281">
+ <sources>
+ <source>${CMake_BINARY_DIR}/Testing/CoberturaCoverage/src/main/java/</source>
+ </sources>
+ <packages>
+ <package name="org.cmake.Coverage" line-rate="0.7222222222222222" branch-rate="0.875" complexity="0.0">
+ <classes>
+ <class name="org.cmake.Coverage.CoverageTest" filename="org/cmake/CoverageTest.java" line-rate="0.7222222222222222" branch-rate="0.875" complexity="0.0">
+ <methods>
+ <method name="&lt;clinit&gt;" signature="()V" line-rate="1.0" branch-rate="1.0">
+ <lines>
+ <line number="10" hits="2" branch="false"/>
+ <line number="11" hits="2" branch="false"/>
+ </lines>
+ </method>
+ <method name="&lt;init&gt;" signature="()V" line-rate="0.0" branch-rate="1.0">
+ <lines>
+ <line number="8" hits="0" branch="false"/>
+ <line number="12" hits="0" branch="false"/>
+ </lines>
+ </method>
+ <method name="equalsVarOne" signature="(Ljava/lang/String;)Ljava/lang/Boolean;" line-rate="0.6666666666666666" branch-rate="0.5">
+ <lines>
+ <line number="16" hits="2" branch="true" condition-coverage="50% (1/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="50%"/>
+ </conditions>
+ </line>
+ <line number="17" hits="2" branch="false"/>
+ <line number="20" hits="0" branch="false"/>
+ </lines>
+ </method>
+ <method name="equalsVarTwo" signature="(Ljava/lang/String;)Z" line-rate="1.0" branch-rate="1.0">
+ <lines>
+ <line number="26" hits="4" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="27" hits="2" branch="false"/>
+ <line number="30" hits="2" branch="false"/>
+ </lines>
+ </method>
+ <method name="timesIntOne" signature="(Ljava/lang/Integer;)Ljava/lang/Integer;" line-rate="0.0" branch-rate="1.0">
+ <lines>
+ <line number="35" hits="0" branch="false"/>
+ <line number="36" hits="0" branch="false"/>
+ </lines>
+ </method>
+ <method name="whileLoop" signature="(Ljava/lang/Integer;)Z" line-rate="1.0" branch-rate="1.0">
+ <lines>
+ <line number="41" hits="2" branch="false"/>
+ <line number="42" hits="10" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="43" hits="8" branch="false"/>
+ <line number="45" hits="2" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="46" hits="1" branch="false"/>
+ <line number="49" hits="1" branch="false"/>
+ </lines>
+ </method>
+ </methods>
+ <lines>
+ <line number="8" hits="0" branch="false"/>
+ <line number="10" hits="2" branch="false"/>
+ <line number="11" hits="2" branch="false"/>
+ <line number="12" hits="0" branch="false"/>
+ <line number="16" hits="2" branch="true" condition-coverage="50% (1/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="50%"/>
+ </conditions>
+ </line>
+ <line number="17" hits="2" branch="false"/>
+ <line number="20" hits="0" branch="false"/>
+ <line number="26" hits="4" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="27" hits="2" branch="false"/>
+ <line number="30" hits="2" branch="false"/>
+ <line number="35" hits="0" branch="false"/>
+ <line number="36" hits="0" branch="false"/>
+ <line number="41" hits="2" branch="false"/>
+ <line number="42" hits="10" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="43" hits="8" branch="false"/>
+ <line number="45" hits="2" branch="true" condition-coverage="100% (2/2)">
+ <conditions>
+ <condition number="0" type="jump" coverage="100%"/>
+ </conditions>
+ </line>
+ <line number="46" hits="1" branch="false"/>
+ <line number="49" hits="1" branch="false"/>
+ </lines>
+ </class>
+ </classes>
+ </package>
+ </packages>
+</coverage>
diff --git a/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java
new file mode 100644
index 0000000..4fb43c6
--- /dev/null
+++ b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java
@@ -0,0 +1,52 @@
+package org.cmake.Coverage;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.List;
+import java.awt.*;
+
+public class CoverageTest {
+
+ public static String VarOne = "test1";
+ public static String VarTwo = "test2";
+ private Integer IntOne = 4;
+
+ public static Boolean equalsVarOne(String inString) {
+
+ if(VarOne.equals(inString)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public static boolean equalsVarTwo(String inString){
+
+ if(VarTwo.equals(inString)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ private Integer timesIntOne(Integer inVal){
+
+ return inVal * IntOne;
+ }
+
+ public static boolean whileLoop(Integer StopInt){
+
+ Integer i = 0;
+ while(i < StopInt){
+ i=i+1;
+ }
+ if (i.equals(5)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+}
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 5fa46bf..222250c 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -83,6 +83,14 @@ set_property(DIRECTORY
PROPERTY COMPILE_DEFINITIONS_RELEASE
CMAKE_IS_FUN_IN_RELEASE_MODE
)
+set_property(DIRECTORY
+ PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO
+ CMAKE_IS_FUN_IN_RELEASE_MODE
+ )
+set_property(DIRECTORY
+ PROPERTY COMPILE_DEFINITIONS_MINSIZEREL
+ CMAKE_IS_FUN_IN_RELEASE_MODE
+ )
set(TEST_SEP "a b c")
separate_arguments(TEST_SEP)
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index d3d9132..3f17dcc 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -83,6 +83,14 @@ set_property(DIRECTORY
PROPERTY COMPILE_DEFINITIONS_RELEASE
CMAKE_IS_FUN_IN_RELEASE_MODE
)
+set_property(DIRECTORY
+ PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO
+ CMAKE_IS_FUN_IN_RELEASE_MODE
+ )
+set_property(DIRECTORY
+ PROPERTY COMPILE_DEFINITIONS_MINSIZEREL
+ CMAKE_IS_FUN_IN_RELEASE_MODE
+ )
set(TEST_SEP "a b c")
separate_arguments(TEST_SEP)
diff --git a/Tests/CxxDialect/CMakeLists.txt b/Tests/CxxDialect/CMakeLists.txt
index 0eb6f8f..8c90339 100644
--- a/Tests/CxxDialect/CMakeLists.txt
+++ b/Tests/CxxDialect/CMakeLists.txt
@@ -4,11 +4,25 @@ project(CxxDialect)
add_executable(use_typeof use_typeof.cxx)
set_property(TARGET use_typeof PROPERTY CXX_STANDARD 98)
-set_property(TARGET use_typeof PROPERTY CXX_EXTENSIONS ON)
add_executable(use_constexpr use_constexpr.cxx)
set_property(TARGET use_constexpr PROPERTY CXX_STANDARD 11)
add_executable(CxxDialect use_constexpr_and_typeof.cxx)
set_property(TARGET CxxDialect PROPERTY CXX_STANDARD 11)
-set_property(TARGET CxxDialect PROPERTY CXX_EXTENSIONS ON)
+
+try_compile(typeof_no_extensions_works
+ "${CMAKE_CURRENT_BINARY_DIR}/use_typeof_test"
+ "${CMAKE_CURRENT_SOURCE_DIR}/use_typeof.cxx"
+ COMPILE_DEFINITIONS
+ CMAKE_FLAGS
+ "-DCMAKE_CXX_STANDARD=98"
+ "-DCMAKE_CXX_EXTENSIONS=FALSE"
+ OUTPUT_VARIABLE OUTPUT
+)
+
+if (typeof_no_extensions_works)
+ message("Use of typeof extension with extensions disabled works, but is expected to fail: ${OUTPUT}")
+else()
+ message("Use of typeof extension with extensions disabled fails, as expected")
+endif()
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index ab0ebc3..645cc65 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -35,6 +35,10 @@ if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES)
return()
endif()
+string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
+string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
+string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" COMPILER_VERSION_PATCH "${CMAKE_CXX_COMPILER_VERSION}")
+
macro(set_defines target true_defs false_defs)
set(defines)
foreach(def ${true_defs})
@@ -46,6 +50,9 @@ macro(set_defines target true_defs false_defs)
target_compile_definitions(${target}
PRIVATE
${defines}
+ EXPECTED_COMPILER_VERSION_MAJOR=${COMPILER_VERSION_MAJOR}
+ EXPECTED_COMPILER_VERSION_MINOR=${COMPILER_VERSION_MINOR}
+ EXPECTED_COMPILER_VERSION_PATCH=${COMPILER_VERSION_PATCH}
)
endmacro()
diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.cpp b/Tests/Module/WriteCompilerDetectionHeader/main.cpp
index 8b4ea52..b807ad5 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/main.cpp
+++ b/Tests/Module/WriteCompilerDetectionHeader/main.cpp
@@ -13,6 +13,18 @@
#error cxx_variadic_templates expected availability did not match.
#endif
+#if !CHECK(VERSION_MAJOR)
+#error Compiler major version did not match.
+#endif
+
+#if !CHECK(VERSION_MINOR)
+#error Compiler minor version did not match.
+#endif
+
+#if !CHECK(VERSION_PATCH)
+#error Compiler patch version did not match.
+#endif
+
int main()
{
return 0;
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d5af542..06272ce 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -16,6 +16,10 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3)
set(GeneratorToolset_ARGS -DXCODE_BELOW_3=1)
endif()
+if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 2)
+ set(TargetSources_ARGS -DXCODE_BELOW_2=1)
+endif()
+
add_RunCMake_test(CMP0019)
add_RunCMake_test(CMP0022)
add_RunCMake_test(CMP0026)
diff --git a/Tests/RunCMake/CommandLine/P_directory-result.txt b/Tests/RunCMake/CommandLine/P_directory-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_directory-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/P_directory-stderr.txt b/Tests/RunCMake/CommandLine/P_directory-stderr.txt
new file mode 100644
index 0000000..b8319a1
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_directory-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index ada4cab..f3d9637 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -1,5 +1,12 @@
include(RunCMake)
+run_cmake_command(build-no-cache
+ ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR})
+run_cmake_command(build-no-generator
+ ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-no-generator)
+run_cmake_command(build-bad-generator
+ ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator)
+
if(UNIX)
run_cmake_command(E_create_symlink-missing-dir
${CMAKE_COMMAND} -E create_symlink T missing-dir/L
@@ -28,3 +35,5 @@ run_cmake_command(E_sleep-no-args ${CMAKE_COMMAND} -E sleep)
run_cmake_command(E_sleep-bad-arg1 ${CMAKE_COMMAND} -E sleep x)
run_cmake_command(E_sleep-bad-arg2 ${CMAKE_COMMAND} -E sleep 1 -1)
run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1)
+
+run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR})
diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-result.txt b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-bad-generator-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt
new file mode 100644
index 0000000..1103407
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-bad-generator-stderr.txt
@@ -0,0 +1 @@
+^Error: could create CMAKE_GENERATOR "Bad Generator"$
diff --git a/Tests/RunCMake/CommandLine/build-no-cache-result.txt b/Tests/RunCMake/CommandLine/build-no-cache-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-cache-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt
new file mode 100644
index 0000000..40dd3c0
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-cache-stderr.txt
@@ -0,0 +1 @@
+^Error: could not load cache$
diff --git a/Tests/RunCMake/CommandLine/build-no-generator-result.txt b/Tests/RunCMake/CommandLine/build-no-generator-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-generator-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt
new file mode 100644
index 0000000..40ad030
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/build-no-generator-stderr.txt
@@ -0,0 +1 @@
+^Error: could not find CMAKE_GENERATOR in Cache$
diff --git a/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt
new file mode 100644
index 0000000..e34af44
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cache-bad-generator/CMakeCache.txt
@@ -0,0 +1 @@
+CMAKE_GENERATOR:INTERNAL=Bad Generator
diff --git a/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cache-no-generator/CMakeCache.txt
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake
index 10b251a..f60504f 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX11.cmake
@@ -1,4 +1,5 @@
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 11)
+set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE)
set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake
index 9e726c8..10b251a 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Ext.cmake
@@ -1,5 +1,4 @@
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 11)
-set_property(TARGET foo PROPERTY CXX_EXTENSIONS TRUE)
set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake
index 8f6755f..29703db 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable.cmake
@@ -2,4 +2,3 @@
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 11)
-set_property(TARGET foo PROPERTY CXX_EXTENSIONS TRUE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake
index 29703db..c480997 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX11Variable.cmake
@@ -2,3 +2,4 @@
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 11)
+set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake
index 4ea595e..fd9fb60 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX98.cmake
@@ -2,3 +2,4 @@
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 98)
set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE)
+set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake
index fdf4cc7..4ea595e 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Ext.cmake
@@ -1,5 +1,4 @@
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 98)
-set_property(TARGET foo PROPERTY CXX_EXTENSIONS TRUE)
set_property(TARGET foo PROPERTY CXX_STANDARD_REQUIRED TRUE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake
index a26a22d..0e3ef8d 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable.cmake
@@ -2,4 +2,3 @@
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 98)
-set_property(TARGET foo PROPERTY CXX_EXTENSIONS TRUE)
diff --git a/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake
index 0e3ef8d..7562264 100644
--- a/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake
+++ b/Tests/RunCMake/CompileFeatures/RequireCXX98Variable.cmake
@@ -2,3 +2,4 @@
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_library(foo empty.cpp)
set_property(TARGET foo PROPERTY CXX_STANDARD 98)
+set_property(TARGET foo PROPERTY CXX_EXTENSIONS FALSE)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt
new file mode 100644
index 0000000..dd7a183
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-CXX_COMPILER_ID.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<CXX_COMPILER_ID>
+
+ \$<CXX_COMPILER_ID> may only be used with binary targets. It may not be
+ used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake
new file mode 100644
index 0000000..7dd38da
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_ID.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_ID>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt
new file mode 100644
index 0000000..d4a064a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-CXX_COMPILER_VERSION.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<CXX_COMPILER_VERSION>
+
+ \$<CXX_COMPILER_VERSION> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake
new file mode 100644
index 0000000..1afb2b5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-CXX_COMPILER_VERSION.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<CXX_COMPILER_VERSION>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt
new file mode 100644
index 0000000..b8e53ed
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-C_COMPILER_ID.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<C_COMPILER_ID>
+
+ \$<C_COMPILER_ID> may only be used with binary targets. It may not be used
+ with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake
new file mode 100644
index 0000000..2d92ee3
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_ID.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_ID>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt
new file mode 100644
index 0000000..551efe9
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-C_COMPILER_VERSION.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<C_COMPILER_VERSION>
+
+ \$<C_COMPILER_VERSION> may only be used with binary targets. It may not be
+ used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake
new file mode 100644
index 0000000..9b8a531
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-C_COMPILER_VERSION.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<C_COMPILER_VERSION>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt
new file mode 100644
index 0000000..0e87538
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-TARGET_POLICY.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_POLICY:CMP0004>
+
+ \$<TARGET_POLICY:prop> may only be used with binary targets. It may not be
+ used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake
new file mode 100644
index 0000000..10b37b5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_POLICY.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_POLICY:CMP0004>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt
new file mode 100644
index 0000000..08ad3c2
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY-stderr.txt
@@ -0,0 +1,11 @@
+CMake Error at NonValidTarget-TARGET_PROPERTY.cmake:4 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:NotAProperty>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake
new file mode 100644
index 0000000..64abc5f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PROPERTY.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<TARGET_PROPERTY:NotAProperty>.cpp"
+)
+
+add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file.cpp")
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index f3f99ed..c8f3fdf 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -10,3 +10,9 @@ run_cmake(BadTargetName)
run_cmake(BadTargetTypeObject)
run_cmake(BadInstallPrefix)
run_cmake(CMP0044-WARN)
+run_cmake(NonValidTarget-C_COMPILER_ID)
+run_cmake(NonValidTarget-CXX_COMPILER_ID)
+run_cmake(NonValidTarget-C_COMPILER_VERSION)
+run_cmake(NonValidTarget-CXX_COMPILER_VERSION)
+run_cmake(NonValidTarget-TARGET_PROPERTY)
+run_cmake(NonValidTarget-TARGET_POLICY)
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt
index bf1f190..d0d526c 100644
--- a/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt
+++ b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error:
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
Generator
.*
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake b/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake
new file mode 100644
index 0000000..7bbf327
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolset-toolchain.cmake
@@ -0,0 +1 @@
+set(CMAKE_GENERATOR_TOOLSET "Bad Toolset")
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt
new file mode 100644
index 0000000..d0d526c
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ .*
+
+ does not support toolset specification, but toolset
+
+ Bad Toolset
+
+ was specified.$
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetToolchain.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index 1ccc1ad..d39f33f 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -12,6 +12,17 @@ else()
endif()
set(RunCMake_GENERATOR_TOOLSET "")
+
set(RunCMake_TEST_OPTIONS -T "Extra Toolset")
run_cmake(TwoToolsets)
unset(RunCMake_TEST_OPTIONS)
+
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012]|Xcode" AND NOT XCODE_BELOW_3)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestToolset-toolchain.cmake)
+ run_cmake(TestToolsetToolchain)
+ unset(RunCMake_TEST_OPTIONS)
+else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/BadToolset-toolchain.cmake)
+ run_cmake(BadToolsetToolchain)
+ unset(RunCMake_TEST_OPTIONS)
+endif()
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake b/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake
new file mode 100644
index 0000000..bee2ae4
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolset-toolchain.cmake
@@ -0,0 +1 @@
+set(CMAKE_GENERATOR_TOOLSET "Test Toolset")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt
new file mode 100644
index 0000000..0623e90
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at TestToolsetToolchain.cmake:[0-9]+ \(message\):
+ CMAKE_GENERATOR_TOOLSET is "Test Toolset" as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at TestToolsetToolchain.cmake:[0-9]+ \(message\):
+ CMAKE_(VS|XCODE)_PLATFORM_TOOLSET is "Test Toolset" as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake
new file mode 100644
index 0000000..7c1c415
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetToolchain.cmake
@@ -0,0 +1,25 @@
+if("x${CMAKE_GENERATOR_TOOLSET}" STREQUAL "xTest Toolset")
+ message(SEND_ERROR "CMAKE_GENERATOR_TOOLSET is \"Test Toolset\" as expected.")
+else()
+ message(FATAL_ERROR
+ "CMAKE_GENERATOR_TOOLSET is \"${CMAKE_GENERATOR_TOOLSET}\" "
+ "but should be \"Test Toolset\"!")
+endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ if("x${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "xTest Toolset")
+ message(SEND_ERROR "CMAKE_VS_PLATFORM_TOOLSET is \"Test Toolset\" as expected.")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_VS_PLATFORM_TOOLSET is \"${CMAKE_VS_PLATFORM_TOOLSET}\" "
+ "but should be \"Test Toolset\"!")
+ endif()
+endif()
+if(CMAKE_GENERATOR MATCHES "Xcode")
+ if("x${CMAKE_XCODE_PLATFORM_TOOLSET}" STREQUAL "xTest Toolset")
+ message(SEND_ERROR "CMAKE_XCODE_PLATFORM_TOOLSET is \"Test Toolset\" as expected.")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_XCODE_PLATFORM_TOOLSET is \"${CMAKE_XCODE_PLATFORM_TOOLSET}\" "
+ "but should be \"Test Toolset\"!")
+ endif()
+endif()
diff --git a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
index 0200dcb..11bc96c 100644
--- a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
+++ b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
@@ -5,7 +5,7 @@ CMake Debug Log at OriginDebug.cmake:13 \(add_library\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-+
+.*
CMake Debug Log at OriginDebug.cmake:16 \(set_property\):
Used sources for target OriginDebug:
@@ -13,7 +13,7 @@ CMake Debug Log at OriginDebug.cmake:16 \(set_property\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-+
+.*
CMake Debug Log at OriginDebug.cmake:20 \(target_sources\):
Used sources for target OriginDebug:
@@ -21,7 +21,7 @@ CMake Debug Log at OriginDebug.cmake:20 \(target_sources\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-+
+.*
CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\):
Used sources for target OriginDebug:
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index 01e505c..1d2eaec 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -1,7 +1,6 @@
include(RunCMake)
-if(RunCMake_GENERATOR MATCHES Xcode
- OR RunCMake_GENERATOR MATCHES "Visual Studio")
+if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode" AND NOT XCODE_BELOW_2)
run_cmake(ConfigNotAllowed)
run_cmake(OriginDebugIDE)
else()
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt
index 842eb3f..8d4db34 100644
--- a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt
@@ -1,5 +1,9 @@
CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\):
- VERSION parameter too low.
+ VERSION compatibility for write_compiler_detection_header is set to 3.0,
+ which is too low. It must be set to at least 3.1.0. Either set the
+ VERSION parameter to the write_compiler_detection_header function, or
+ update your minimum required CMake version with the cmake_minimum_required
+ command.
Call Stack \(most recent call first\):
OldVersion.cmake:4 \(write_compiler_detection_header\)
CMakeLists.txt:3 \(include\)
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index 80389ee..a3d350b 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -2862,7 +2862,7 @@ set_time(int fd, int mode, const char *name,
#endif
}
-#ifdef F_SETTIMES /* Tru64 */
+#ifdef F_SETTIMES
static int
set_time_tru64(int fd, int mode, const char *name,
time_t atime, long atime_nsec,
@@ -2870,19 +2870,21 @@ set_time_tru64(int fd, int mode, const char *name,
time_t ctime, long ctime_nsec)
{
struct attr_timbuf tstamp;
- struct timeval times[3];
- times[0].tv_sec = atime;
- times[0].tv_usec = atime_nsec / 1000;
- times[1].tv_sec = mtime;
- times[1].tv_usec = mtime_nsec / 1000;
- times[2].tv_sec = ctime;
- times[2].tv_usec = ctime_nsec / 1000;
- tstamp.atime = times[0];
- tstamp.mtime = times[1];
- tstamp.ctime = times[2];
+ tstamp.atime.tv_sec = atime;
+ tstamp.mtime.tv_sec = mtime;
+ tstamp.ctime.tv_sec = ctime;
+#if defined (__hpux) && defined (__ia64)
+ tstamp.atime.tv_nsec = atime_nsec;
+ tstamp.mtime.tv_nsec = mtime_nsec;
+ tstamp.ctime.tv_nsec = ctime_nsec;
+#else
+ tstamp.atime.tv_usec = atime_nsec / 1000;
+ tstamp.mtime.tv_usec = mtime_nsec / 1000;
+ tstamp.ctime.tv_usec = ctime_nsec / 1000;
+#endif
return (fcntl(fd,F_SETTIMES,&tstamp));
}
-#endif /* Tru64 */
+#endif /* F_SETTIMES */
static int
set_times(struct archive_write_disk *a,