summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/FIND_XXX_ROOT.txt8
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst248
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/module/FindBacktrace.rst1
-rw-r--r--Help/policy/CMP0040.rst16
-rw-r--r--Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst6
-rw-r--r--Help/variable/CMAKE_STAGING_PREFIX.rst13
-rw-r--r--Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst6
-rw-r--r--Licenses/LGPLv2.1.txt502
-rw-r--r--Licenses/README.rst7
-rw-r--r--Modules/FindBacktrace.cmake91
-rw-r--r--Modules/FindSDL.cmake10
-rw-r--r--Modules/FindSDL_image.cmake8
-rw-r--r--Modules/FindSDL_mixer.cmake8
-rw-r--r--Modules/FindSDL_net.cmake8
-rw-r--r--Modules/FindSDL_sound.cmake2
-rw-r--r--Modules/FindSDL_ttf.cmake8
-rw-r--r--Modules/FindwxWidgets.cmake6
-rw-r--r--Modules/Platform/UnixPaths.cmake6
-rw-r--r--Modules/Platform/WindowsPaths.cmake11
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx14
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestGIT.cxx6
-rw-r--r--Source/QtDialog/CMakeLists.txt7
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx24
-rw-r--r--Source/cmCTest.cxx4
-rw-r--r--Source/cmComputeLinkInformation.cxx20
-rw-r--r--Source/cmDocumentation.cxx8
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx8
-rw-r--r--Source/cmFindCommon.cxx7
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx6
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx4
-rw-r--r--Source/cmGeneratorTarget.cxx11
-rw-r--r--Source/cmGeneratorTarget.h8
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx135
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalNinjaGenerator.cxx15
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx54
-rw-r--r--Source/cmMakefile.cxx80
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.h2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx6
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.h2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx14
-rw-r--r--Source/cmNinjaNormalTargetGenerator.h3
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx5
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.h2
-rw-r--r--Source/cmOSXBundleGenerator.cxx6
-rw-r--r--Source/cmOSXBundleGenerator.h3
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx2
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h2
-rw-r--r--Source/cmSetCommand.cxx2
-rw-r--r--Source/cmStandardIncludes.h26
-rw-r--r--Source/cmTarget.cxx14
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx2
-rw-r--r--Source/cmUnsetCommand.cxx2
-rw-r--r--Source/cmakemain.cxx5
-rw-r--r--Tests/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake7
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake5
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake7
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake5
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt1
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake4
-rw-r--r--Tests/RunCMake/CMP0040/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0040/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/CMP0040/empty.cpp7
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/StagingPrefix/CMakeLists.txt89
-rw-r--r--Tests/StagingPrefix/Consumer/CMakeLists.txt22
-rw-r--r--Tests/StagingPrefix/Consumer/cmake/FindBar.cmake6
-rw-r--r--Tests/StagingPrefix/Consumer/main.cpp10
-rw-r--r--Tests/StagingPrefix/Producer/CMakeLists.txt26
-rw-r--r--Tests/StagingPrefix/Producer/bar.cpp7
-rw-r--r--Tests/StagingPrefix/Producer/bar.h10
-rw-r--r--Tests/StagingPrefix/Producer/foo.cpp7
-rw-r--r--Tests/StagingPrefix/Producer/foo.h10
-rw-r--r--Tests/StagingPrefix/main.cpp5
-rw-r--r--Utilities/Release/dash2win64_release.cmake1
-rw-r--r--Utilities/Release/dashmacmini2_release.cmake1
-rw-r--r--Utilities/Release/dashmacmini5_release.cmake1
-rw-r--r--Utilities/Release/magrathea_release.cmake1
105 files changed, 1511 insertions, 285 deletions
diff --git a/Help/command/FIND_XXX_ROOT.txt b/Help/command/FIND_XXX_ROOT.txt
index 7f80dcb..efc076f 100644
--- a/Help/command/FIND_XXX_ROOT.txt
+++ b/Help/command/FIND_XXX_ROOT.txt
@@ -1,7 +1,9 @@
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
directories to be prepended to all other search directories. This
-effectively "re-roots" the entire search under given locations. By
-default it is empty.
+effectively "re-roots" the entire search under given locations.
+Paths which are descendants of the :variable:`CMAKE_STAGING_PREFIX` are excluded
+from this re-rooting, because that variable is always a path on the host system.
+By default the CMAKE_FIND_ROOT_PATH is empty.
The :variable:`CMAKE_SYSROOT` variable can also be used to specify exactly one
directory to use as a prefix. Setting :variable:`CMAKE_SYSROOT` also has other
@@ -18,4 +20,4 @@ overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH
the search order will be as described above. If
NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be
used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
-directories will be searched.
+directories and directories below :variable:`CMAKE_STAGING_PREFIX` will be searched.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index ddde183..2a2b7dc 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -7,80 +7,174 @@ cmake-generator-expressions(7)
.. contents::
-Generator Expressions
-=====================
-
-Generator expressions are evaluated during build
-system generation to produce information specific to each build
-configuration. Valid expressions are:
-
-::
-
- $<0:...> = empty string (ignores "...")
- $<1:...> = content of "..."
- $<CONFIG:cfg> = '1' if config is "cfg", else '0'
- $<CONFIGURATION> = configuration name
- $<BOOL:...> = '1' if the '...' is true, else '0'
- $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
- $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
- $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
- $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
- $<JOIN:list,...> = joins the list with the content of "..."
- $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
- $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
- $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
- $<PLATFORM_ID> = The CMake-id of the platform $<PLATFORM_ID:comp> = '1' if the The CMake-id of the platform matches comp, otherwise '0'.
- $<C_COMPILER_ID> = The CMake-id of the C compiler used.
- $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
- $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
- $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
- $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
- $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
- $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
- $<C_COMPILER_VERSION> = The version of the C compiler used.
- $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
- $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
- $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
- $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
- $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
- $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
-
-where "tgt" is the name of a target. Target file expressions produce
-a full path, but _DIR and _NAME versions can produce the directory and
-file name components:
-
-::
-
- $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
- $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
- $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
-
-
-
-::
-
- $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
-
-Note that tgt is not added as a dependency of the target this
-expression is evaluated on.
-
-::
-
- $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
- $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
-
-Boolean expressions:
-
-::
-
- $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
- $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
- $<NOT:?> = '0' if '?' is '1', else '1'
-
-where '?' is always either '0' or '1'.
-
-Expressions with an implicit 'this' target:
-
-::
-
- $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
+Introduction
+============
+
+Generator expressions are evaluated during build system generation to produce
+information specific to each build configuration.
+
+Generator expressions are allowed in the context of many target properties,
+such as :prop_tgt:`LINK_LIBRARIES`, :prop_tgt:`INCLUDE_DIRECTORIES`,
+:prop_tgt:`COMPILE_DEFINITIONS` and others. They may also be used when using
+commands to populate those properties, such as :command:`target_link_libraries`,
+:command:`target_include_directories`, :command:`target_compile_definitions`
+and others.
+
+This means that they enable conditional linking, conditional
+definitions used when compiling, and conditional include directories and
+more. The conditions may be based on the build configuration, target
+properties, platform information or any other queryable information.
+
+Logical Expressions
+===================
+
+Logical expressions are used to create conditional output. The basic
+expressions are the ``0`` and ``1`` expressions. Because other logical
+expressions evaluate to either ``0`` or ``1``, they can be composed to
+create conditional output::
+
+ $<$<CONFIG:Debug>:DEBUG_MODE>
+
+expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
+otherwise expands to nothing.
+
+``$<0:...>``
+ Empty string (ignores ``...``)
+``$<1:...>``
+ Content of ``...``
+``$<BOOL:...>``
+ ``1`` if the ``...`` is true, else ``0``
+``$<AND:?[,?]...>``
+ ``1`` if all ``?`` are ``1``, else ``0``
+
+ The ``?`` must always be either ``0`` or ``1`` in boolean expressions.
+
+``$<OR:?[,?]...>``
+ ``0`` if all ``?`` are ``0``, else ``1``
+``$<NOT:?>``
+ ``0`` if ``?`` is ``1``, else ``1``
+``$<STREQUAL:a,b>``
+ ``1`` if ``a`` is STREQUAL ``b``, else ``0``
+``$<CONFIG:cfg>``
+ ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
+ The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
+ this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
+ target.
+``$<PLATFORM_ID:comp>``
+ ``1`` if the CMake-id of the platform matches ``comp``, otherwise ``0``.
+``$<C_COMPILER_ID:comp>``
+ ``1`` if the CMake-id of the C compiler matches ``comp``, otherwise ``0``.
+``$<CXX_COMPILER_ID:comp>``
+ ``1`` if the CMake-id of the CXX compiler matches ``comp``, otherwise ``0``.
+``$<VERSION_GREATER:v1,v2>``
+ ``1`` if ``v1`` is a version greater than ``v2``, else ``0``.
+``$<VERSION_LESS:v1,v2>``
+ ``1`` if ``v1`` is a version less than ``v2``, else ``0``.
+``$<VERSION_EQUAL:v1,v2>``
+ ``1`` if ``v1`` is the same version as ``v2``, else ``0``.
+``$<C_COMPILER_VERSION:ver>``
+ ``1`` if the version of the C compiler matches ``ver``, otherwise ``0``.
+``$<CXX_COMPILER_VERSION:ver>``
+ ``1`` if the version of the CXX compiler matches ``ver``, otherwise ``0``.
+``$<TARGET_POLICY:pol>``
+ ``1`` if the policy ``pol`` was NEW when the 'head' target was created,
+ else ``0``. If the policy was not set, the warning message for the policy
+ will be emitted. This generator expression only works for a subset of
+ policies.
+
+Informational Expressions
+=========================
+
+These expressions expand to some information. The information may be used
+directly, eg::
+
+ include_directories(/usr/include/$<CXX_COMPILER_ID>/)
+
+expands to ``/usr/include/GNU/`` or ``/usr/include/Clang/`` etc, depending on
+the Id of the compiler.
+
+These expressions may also may be combined with logical expressions::
+
+ $<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.2.0>:OLD_COMPILER>
+
+expands to ``OLD_COMPILER`` if the
+:variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less
+than 4.2.0.
+
+``$<CONFIGURATION>``
+ Configuration name
+``$<PLATFORM_ID>``
+ The CMake-id of the platform
+``$<C_COMPILER_ID>``
+ The CMake-id of the C compiler used.
+``$<CXX_COMPILER_ID>``
+ The CMake-id of the CXX compiler used.
+``$<C_COMPILER_VERSION>``
+ The version of the C compiler used.
+``$<CXX_COMPILER_VERSION>``
+ The version of the CXX compiler used.
+``$<TARGET_FILE:tgt>``
+ Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a target.
+``$<TARGET_FILE_NAME:tgt>``
+ Name of main file (.exe, .so.1.2, .a).
+``$<TARGET_FILE_DIR:tgt>``
+ Directory of main file (.exe, .so.1.2, .a).
+``$<TARGET_LINKER_FILE:tgt>``
+ File used to link (.a, .lib, .so) where ``tgt`` is the name of a target.
+``$<TARGET_LINKER_FILE_NAME:tgt>``
+ Name of file used to link (.a, .lib, .so).
+``$<TARGET_LINKER_FILE_DIR:tgt>``
+ Directory of file used to link (.a, .lib, .so).
+``$<TARGET_SONAME_FILE:tgt>``
+ File with soname (.so.3) where ``tgt`` is the name of a target.
+``$<TARGET_SONAME_FILE_NAME:tgt>``
+ Name of file with soname (.so.3).
+``$<TARGET_SONAME_FILE_DIR:tgt>``
+ Directory of with soname (.so.3).
+``$<TARGET_PROPERTY:tgt,prop>``
+ Value of the property ``prop`` on the target ``tgt``.
+
+ Note that ``tgt`` is not added as a dependency of the target this
+ expression is evaluated on.
+``$<TARGET_PROPERTY:prop>``
+ Value of the property ``prop`` on the target on which the generator
+ expression is evaluated.
+``$<INSTALL_PREFIX>``
+ Content of the install prefix when the target is exported via
+ :command:`install(EXPORT)` and empty otherwise.
+
+Output Expressions
+==================
+
+These expressions generate output, in some cases depending on an input. These
+expressions may be combined with other expressions for information or logical
+comparison::
+
+ -I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>
+
+generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target
+property with each entry preceeded by ``-I``. Note that a more-complete use
+in this situation would be require first checking if the INCLUDE_DIRECTORIES
+property is non-empty::
+
+ $<$<BOOL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>>:-I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>>
+
+``$<JOIN:list,...>``
+ Joins the list with the content of ``...``
+``$<ANGLE-R>``
+ A literal ``>``. Used to compare strings which contain a ``>`` for example.
+``$<COMMA>``
+ A literal ``,``. Used to compare strings which contain a ``,`` for example.
+``$<SEMICOLON>``
+ A literal ``;``. Used to prevent list expansion on an argument with ``;``.
+``$<TARGET_NAME:...>``
+ Marks ``...`` as being the name of a target. This is required if exporting
+ targets to multiple dependent export sets. The ``...`` must be a literal
+ name of a target- it may not contain generator expressions.
+``$<INSTALL_INTERFACE:...>``
+ Content of ``...`` when the property is exported using :command:`install(EXPORT)`,
+ and empty otherwise.
+``$<BUILD_INTERFACE:...>``
+ Content of ``...`` when the property is exported using :command:`export`, or
+ when the target is used by another target in the same buildsystem. Expands to
+ the empty string otherwise.
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 01efcf7..f148a51 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -74,6 +74,7 @@ All Modules
/module/FindAVIFile
/module/FindBISON
/module/FindBLAS
+ /module/FindBacktrace
/module/FindBoost
/module/FindBullet
/module/FindBZip2
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 2430ee9..e954a86 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -73,3 +73,4 @@ All Policies
/policy/CMP0037
/policy/CMP0038
/policy/CMP0039
+ /policy/CMP0040
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index dd82b40..a46539f 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -110,6 +110,7 @@ Variables that Change Behavior
/variable/CMAKE_PREFIX_PATH
/variable/CMAKE_PROGRAM_PATH
/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
+ /variable/CMAKE_STAGING_PREFIX
/variable/CMAKE_SYSTEM_IGNORE_PATH
/variable/CMAKE_SYSTEM_INCLUDE_PATH
/variable/CMAKE_SYSTEM_LIBRARY_PATH
diff --git a/Help/module/FindBacktrace.rst b/Help/module/FindBacktrace.rst
new file mode 100644
index 0000000..e1ca48c
--- /dev/null
+++ b/Help/module/FindBacktrace.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindBacktrace.cmake
diff --git a/Help/policy/CMP0040.rst b/Help/policy/CMP0040.rst
new file mode 100644
index 0000000..99b54ff
--- /dev/null
+++ b/Help/policy/CMP0040.rst
@@ -0,0 +1,16 @@
+CMP0040
+-------
+
+The target in the TARGET signature of add_custom_command() must exist.
+
+CMake 2.8.12 and lower silently ignored a custom command created with
+the TARGET signature of :command:`add_custom_command`
+if the target is unknown.
+
+The OLD behavior for this policy is to ignore custom commands
+for unknown targets. The NEW behavior for this policy is to report and error
+if the target referenced in :command:`add_custom_command` is unknown.
+
+This policy was introduced in CMake version 3.0.0. CMake version
+|release| warns when the policy is not set and uses OLD behavior. Use
+the cmake_policy command to set it to OLD or NEW explicitly.
diff --git a/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
index 91231b0..70d920b 100644
--- a/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
+++ b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
@@ -3,11 +3,13 @@ CMAKE_FIND_NO_INSTALL_PREFIX
Ignore the :variable:`CMAKE_INSTALL_PREFIX` when searching for assets.
-CMake adds the :variable:`CMAKE_INSTALL_PREFIX` to the
+CMake adds the :variable:`CMAKE_INSTALL_PREFIX` and the
+:variable:`CMAKE_STAGING_PREFIX` variable to the
:variable:`CMAKE_SYSTEM_PREFIX_PATH` by default. This variable may be set
on the command line to control that behavior.
Set :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` to TRUE to tell find_package not
-to search in the :variable:`CMAKE_INSTALL_PREFIX` by default. Note that the
+to search in the :variable:`CMAKE_INSTALL_PREFIX` or
+:variable:`CMAKE_STAGING_PREFIX` by default. Note that the
prefix may still be searched for other reasons, such as being the same prefix
as the CMake installation, or for being a built-in system prefix.
diff --git a/Help/variable/CMAKE_STAGING_PREFIX.rst b/Help/variable/CMAKE_STAGING_PREFIX.rst
new file mode 100644
index 0000000..c4de7da
--- /dev/null
+++ b/Help/variable/CMAKE_STAGING_PREFIX.rst
@@ -0,0 +1,13 @@
+CMAKE_STAGING_PREFIX
+--------------------
+
+This variable may be set to a path to install to when cross-compiling. This can
+be useful if the path in :variable:`CMAKE_SYSROOT` is read-only, or otherwise
+should remain pristine.
+
+The CMAKE_STAGING_PREFIX location is also used as a search prefix by the ``find_*``
+commands. This can be controlled by setting the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX`
+variable.
+
+If any RPATH/RUNPATH entries passed to the linker contain the CMAKE_STAGING_PREFIX,
+the matching path fragments are replaced with the :variable:`CMAKE_INSTALL_PREFIX`.
diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
index 2dbae1f..537eaba 100644
--- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
@@ -9,8 +9,8 @@ appropriate subdirectories to the base directories. So FIND_PROGRAM()
adds /bin to each of the directories in the path, FIND_LIBRARY()
appends /lib to each of the directories, and FIND_PATH() and
FIND_FILE() append /include . By default this contains the standard
-directories for the current system and the CMAKE_INSTALL_PREFIX. It
-is NOT intended to be modified by the project, use CMAKE_PREFIX_PATH
-for this. See also CMAKE_SYSTEM_INCLUDE_PATH,
+directories for the current system, the CMAKE_INSTALL_PREFIX and
+the :variable:`CMAKE_STAGING_PREFIX`. It is NOT intended to be modified by
+the project, use CMAKE_PREFIX_PATH for this. See also CMAKE_SYSTEM_INCLUDE_PATH,
CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_PROGRAM_PATH, and
CMAKE_SYSTEM_IGNORE_PATH.
diff --git a/Licenses/LGPLv2.1.txt b/Licenses/LGPLv2.1.txt
new file mode 100644
index 0000000..4362b49
--- /dev/null
+++ b/Licenses/LGPLv2.1.txt
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/Licenses/README.rst b/Licenses/README.rst
new file mode 100644
index 0000000..e798f78
--- /dev/null
+++ b/Licenses/README.rst
@@ -0,0 +1,7 @@
+Licenses
+========
+
+The CMake source tree is distributed under terms of the BSD 3-Clause license.
+
+This directory contains other license files that need to be packaged with
+binary distributions when certain third-party libraries are included.
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
new file mode 100644
index 0000000..56e739e
--- /dev/null
+++ b/Modules/FindBacktrace.cmake
@@ -0,0 +1,91 @@
+#.rst:
+# FindBacktrace
+# -------------
+#
+# Find provider for backtrace(3).
+#
+# Checks if OS supports backtrace(3) via either libc or custom library.
+# This module defines the following variables::
+#
+# Backtrace_HEADER - The header file needed for backtrace(3). Cached.
+# Could be forcibly set by user.
+# Backtrace_INCLUDE_DIRS - The include directories needed to use backtrace(3) header.
+# Backtrace_LIBRARIES - The libraries (linker flags) needed to use backtrace(3), if any.
+# Backtrace_FOUND - Is set if and only if backtrace(3) support detected.
+#
+# The following cache variables are also available to set or use::
+#
+# Backtrace_LIBRARY - The external library providing backtrace, if any.
+# Backtrace_INCLUDE_DIR - The directory holding the backtrace(3) header.
+#
+# Typical usage is to generate of header file using configure_file() with the
+# contents like the following::
+#
+# #cmakedefine01 Backtrace_FOUND
+# #if Backtrace_FOUND
+# # include <${Backtrace_HEADER}>
+# #endif
+#
+# And then reference that generated header file in actual source.
+
+#=============================================================================
+# Copyright 2013 Vadim Zhukov
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+include(CMakePushCheckState)
+include(CheckSymbolExists)
+include(FindPackageHandleStandardArgs)
+
+# List of variables to be provided to find_package_handle_standard_args()
+set(_Backtrace_STD_ARGS Backtrace_INCLUDE_DIR)
+
+if(Backtrace_HEADER)
+ set(_Backtrace_HEADER_TRY "${Backtrace_HEADER}")
+else(Backtrace_HEADER)
+ set(_Backtrace_HEADER_TRY "execinfo.h")
+endif(Backtrace_HEADER)
+
+find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
+set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
+
+# First, check if we already have backtrace(), e.g., in libc
+cmake_push_check_state(RESET)
+set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
+check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
+cmake_pop_check_state()
+
+if(_Backtrace_SYM_FOUND)
+ set(Backtrace_LIBRARY)
+ if(NOT Backtrace_FIND_QUIETLY)
+ message(STATUS "backtrace facility detected in default set of libraries")
+ endif()
+else()
+ # Check for external library, for non-glibc systems
+ if(Backtrace_INCLUDE_DIR)
+ # OpenBSD has libbacktrace renamed to libexecinfo
+ find_library(Backtrace_LIBRARY "execinfo")
+ elseif() # respect user wishes
+ set(_Backtrace_HEADER_TRY "backtrace.h")
+ find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY})
+ find_library(Backtrace_LIBRARY "backtrace")
+ endif()
+
+ # Prepend list with library path as it's more common practice
+ set(_Backtrace_STD_ARGS Backtrace_LIBRARY ${_Backtrace_STD_ARGS})
+endif()
+
+set(Backtrace_LIBRARIES ${Backtrace_LIBRARY})
+set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing backtrace(3) facility")
+
+find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS})
+mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY)
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 6d418fd..ec1f881 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -90,13 +90,19 @@ find_path(SDL_INCLUDE_DIR SDL.h
include/SDL include/SDL12 include/SDL11 include
)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+ set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
# SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number.
find_library(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
HINTS
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(NOT SDL_BUILDING_LIBRARY)
@@ -109,7 +115,7 @@ if(NOT SDL_BUILDING_LIBRARY)
NAMES SDLmain SDLmain-1.1
HINTS
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
PATHS
/sw
/opt/local
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 2ec6e50..e5173e3 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -57,6 +57,12 @@ find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+ set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
if(NOT SDL_IMAGE_LIBRARY AND SDLIMAGE_LIBRARY)
set(SDL_IMAGE_LIBRARY ${SDLIMAGE_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
@@ -66,7 +72,7 @@ find_library(SDL_IMAGE_LIBRARY
HINTS
ENV SDLIMAGEDIR
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_IMAGE_INCLUDE_DIR AND EXISTS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h")
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index d17c907..8f2f066 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -57,6 +57,12 @@ find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+ set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
if(NOT SDL_MIXER_LIBRARY AND SDLMIXER_LIBRARY)
set(SDL_MIXER_LIBRARY ${SDLMIXER_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
@@ -66,7 +72,7 @@ find_library(SDL_MIXER_LIBRARY
HINTS
ENV SDLMIXERDIR
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_MIXER_INCLUDE_DIR AND EXISTS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h")
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index c545189..e5c2cdb 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -57,6 +57,12 @@ find_path(SDL_NET_INCLUDE_DIR SDL_net.h
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+ set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
if(NOT SDL_NET_LIBRARY AND SDLNET_LIBRARY)
set(SDL_NET_LIBRARY ${SDLNET_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
@@ -66,7 +72,7 @@ find_library(SDL_NET_LIBRARY
HINTS
ENV SDLNETDIR
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_NET_INCLUDE_DIR AND EXISTS "${SDL_NET_INCLUDE_DIR}/SDL_net.h")
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 863699a..3a6ab7b 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -106,7 +106,7 @@ find_library(SDL_SOUND_LIBRARY
HINTS
ENV SDLSOUNDDIR
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib VisualC/win32lib
)
if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 8f72b1a..3f58ac1 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -57,6 +57,12 @@ find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+ set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
if(NOT SDL_TTF_LIBRARY AND SDLTTF_LIBRARY)
set(SDL_TTF_LIBRARY ${SDLTTF_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
@@ -66,7 +72,7 @@ find_library(SDL_TTF_LIBRARY
HINTS
ENV SDLTTFDIR
ENV SDLDIR
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_TTF_INCLUDE_DIR AND EXISTS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h")
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 4ecab62..3c664e7 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -303,6 +303,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets multilib base libraries.
find_library(WX_base${_DBG}
NAMES
+ wxbase30${_UCD}${_DBG}
wxbase29${_UCD}${_DBG}
wxbase28${_UCD}${_DBG}
wxbase27${_UCD}${_DBG}
@@ -315,6 +316,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
foreach(LIB net odbc xml)
find_library(WX_${LIB}${_DBG}
NAMES
+ wxbase30${_UCD}${_DBG}_${LIB}
wxbase29${_UCD}${_DBG}_${LIB}
wxbase28${_UCD}${_DBG}_${LIB}
wxbase27${_UCD}${_DBG}_${LIB}
@@ -329,6 +331,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Find wxWidgets monolithic library.
find_library(WX_mono${_DBG}
NAMES
+ wxmsw${_UNV}30${_UCD}${_DBG}
wxmsw${_UNV}29${_UCD}${_DBG}
wxmsw${_UNV}28${_UCD}${_DBG}
wxmsw${_UNV}27${_UCD}${_DBG}
@@ -344,6 +347,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
stc ribbon propgrid webview)
find_library(WX_${LIB}${_DBG}
NAMES
+ wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
wxmsw${_UNV}27${_UCD}${_DBG}_${LIB}
@@ -457,6 +461,8 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
D:/
ENV ProgramFiles
PATH_SUFFIXES
+ wxWidgets-3.0.0
+ wxWidgets-2.9.5
wxWidgets-2.9.4
wxWidgets-2.9.3
wxWidgets-2.9.2
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 7a424c4..eca3280 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -43,6 +43,12 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
# Project install destination.
"${CMAKE_INSTALL_PREFIX}"
)
+ if(CMAKE_STAGING_PREFIX)
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ # User-supplied staging prefix.
+ "${CMAKE_STAGING_PREFIX}"
+ )
+ endif()
endif()
# List common include file locations not under the common prefixes.
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index c231495..3240c23 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -79,6 +79,12 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
# Project install destination.
"${CMAKE_INSTALL_PREFIX}"
)
+ if (CMAKE_STAGING_PREFIX)
+ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ # User-supplied staging prefix.
+ "${CMAKE_STAGING_PREFIX}"
+ )
+ endif()
endif()
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
@@ -94,6 +100,11 @@ if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
"${CMAKE_INSTALL_PREFIX}/bin"
)
+ if (CMAKE_STAGING_PREFIX)
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+ "${CMAKE_STAGING_PREFIX}/bin"
+ )
+ endif()
endif()
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
"${_CMAKE_INSTALL_DIR}/bin"
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c52cb08..ea5c9be 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20131121)
+set(CMake_VERSION_TWEAK 20131125)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 5475c2f..cd2fcc7 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -580,7 +580,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
* (this works at CPack time too)
*/
if (this->SupportsComponentInstallation() &
- !(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
+ !(this->IsOn("CPACK_MONOLITHIC_INSTALL")))
{
// Determine the installation types for this project (if provided).
std::string installTypesVar = "CPACK_"
@@ -1532,13 +1532,13 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
component->DisplayName = component->Name;
}
component->IsHidden
- = this->IsSet((macroPrefix + "_HIDDEN").c_str());
+ = this->IsOn((macroPrefix + "_HIDDEN").c_str());
component->IsRequired
- = this->IsSet((macroPrefix + "_REQUIRED").c_str());
+ = this->IsOn((macroPrefix + "_REQUIRED").c_str());
component->IsDisabledByDefault
- = this->IsSet((macroPrefix + "_DISABLED").c_str());
+ = this->IsOn((macroPrefix + "_DISABLED").c_str());
component->IsDownloaded
- = this->IsSet((macroPrefix + "_DOWNLOADED").c_str())
+ = this->IsOn((macroPrefix + "_DOWNLOADED").c_str())
|| cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
const char* archiveFile = this->GetOption((macroPrefix +
@@ -1635,9 +1635,9 @@ cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
group->Description = description;
}
group->IsBold
- = this->IsSet((macroPrefix + "_BOLD_TITLE").c_str());
+ = this->IsOn((macroPrefix + "_BOLD_TITLE").c_str());
group->IsExpandedByDefault
- = this->IsSet((macroPrefix + "_EXPANDED").c_str());
+ = this->IsOn((macroPrefix + "_EXPANDED").c_str());
const char* parentGroupName
= this->GetOption((macroPrefix + "_PARENT_GROUP").c_str());
if (parentGroupName && *parentGroupName)
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 39eeb70..e480fff 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -763,7 +763,7 @@ void cmCTestBuildHandler::GenerateXMLLaunchedFragment(std::ostream& os,
bool cmCTestBuildHandler::IsLaunchedErrorFile(const char* fname)
{
// error-{hash}.xml
- return (strncmp(fname, "error-", 6) == 0 &&
+ return (cmHasLiteralPrefix(fname, "error-") &&
strcmp(fname+strlen(fname)-4, ".xml") == 0);
}
@@ -771,7 +771,7 @@ bool cmCTestBuildHandler::IsLaunchedErrorFile(const char* fname)
bool cmCTestBuildHandler::IsLaunchedWarningFile(const char* fname)
{
// warning-{hash}.xml
- return (strncmp(fname, "warning-", 8) == 0 &&
+ return (cmHasLiteralPrefix(fname, "warning-") &&
strcmp(fname+strlen(fname)-4, ".xml") == 0);
}
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 5b34491..725f613 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -536,11 +536,11 @@ private:
void DoHeaderLine()
{
// Look for header fields that we need.
- if(strncmp(this->Line.c_str(), "commit ", 7) == 0)
+ if(cmHasLiteralPrefix(this->Line.c_str(), "commit "))
{
this->Rev.Rev = this->Line.c_str()+7;
}
- else if(strncmp(this->Line.c_str(), "author ", 7) == 0)
+ else if(cmHasLiteralPrefix(this->Line.c_str(), "author "))
{
Person author;
this->ParsePerson(this->Line.c_str()+7, author);
@@ -548,7 +548,7 @@ private:
this->Rev.EMail = author.EMail;
this->Rev.Date = this->FormatDateTime(author);
}
- else if(strncmp(this->Line.c_str(), "committer ", 10) == 0)
+ else if(cmHasLiteralPrefix(this->Line.c_str(), "committer "))
{
Person committer;
this->ParsePerson(this->Line.c_str()+10, committer);
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index f1f4649..4308a4d 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -102,6 +102,13 @@ if(APPLE)
MACOSX_PACKAGE_LOCATION Resources)
endif()
+if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
+ install(FILES ${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt
+ DESTINATION ${CMAKE_DATA_DIR}/Licenses)
+ set_property(SOURCE CMakeSetupDialog.cxx
+ PROPERTY COMPILE_DEFINITIONS CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
+endif()
+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index a7665c8..1903c02 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -34,6 +34,7 @@
#include "QCMakeCacheView.h"
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
+#include "cmSystemTools.h"
#include "cmVersion.h"
QCMakeThread::QCMakeThread(QObject* p)
@@ -807,12 +808,26 @@ void CMakeSetupDialog::doDeleteCache()
void CMakeSetupDialog::doAbout()
{
- QString msg = tr("CMake %1\n"
- "Using Qt %2\n"
- "www.cmake.org");
-
+ QString msg = tr(
+ "CMake %1 (cmake.org).\n"
+ "CMake suite maintained by Kitware, Inc. (kitware.com).\n"
+ "Distributed under terms of the BSD 3-Clause License.\n"
+ "\n"
+ "CMake GUI maintained by csimsoft,\n"
+ "built using Qt %2 (qt-project.org).\n"
+#ifdef CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL
+ "\n"
+ "The Qt Toolkit is Copyright (C) Digia Plc and/or its subsidiary(-ies).\n"
+ "Qt is licensed under terms of the GNU LGPLv2.1, available at:\n"
+ " \"%3\""
+#endif
+ );
msg = msg.arg(cmVersion::GetCMakeVersion());
msg = msg.arg(qVersion());
+#ifdef CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL
+ std::string lgpl = cmSystemTools::GetCMakeRoot()+"/Licenses/LGPLv2.1.txt";
+ msg = msg.arg(lgpl.c_str());
+#endif
QDialog dialog;
dialog.setWindowTitle(tr("About"));
@@ -946,6 +961,7 @@ void CMakeSetupDialog::saveBuildPaths(const QStringList& paths)
void CMakeSetupDialog::setCacheModified()
{
this->CacheModified = true;
+ this->ConfigureNeeded = true;
this->enterState(ReadyConfigure);
}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index bfabc9f..125a3bf 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1131,11 +1131,11 @@ int cmCTest::GetTestModelFromString(const char* str)
return cmCTest::EXPERIMENTAL;
}
std::string rstr = cmSystemTools::LowerCase(str);
- if ( strncmp(rstr.c_str(), "cont", 4) == 0 )
+ if ( cmHasLiteralPrefix(rstr.c_str(), "cont") )
{
return cmCTest::CONTINUOUS;
}
- if ( strncmp(rstr.c_str(), "nigh", 4) == 0 )
+ if ( cmHasLiteralPrefix(rstr.c_str(), "nigh") )
{
return cmCTest::NIGHTLY;
}
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 3152c2a..0ef3d2e 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1902,6 +1902,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
if(use_build_rpath || use_link_rpath)
{
std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
+ const char *stagePath
+ = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
+ const char *installPrefix
+ = this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
cmSystemTools::ConvertToUnixSlashes(rootPath);
std::vector<std::string> const& rdirs = this->GetRuntimeSearchPath();
for(std::vector<std::string>::const_iterator ri = rdirs.begin();
@@ -1916,6 +1920,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
{
d = d.substr(rootPath.size());
}
+ else if (stagePath && *stagePath && d.find(stagePath) == 0)
+ {
+ std::string suffix = d.substr(strlen(stagePath));
+ d = installPrefix;
+ d += "/";
+ d += suffix;
+ cmSystemTools::ConvertToUnixSlashes(d);
+ }
if(emitted.insert(d).second)
{
runtimeDirs.push_back(d);
@@ -1936,6 +1948,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
{
d = d.substr(rootPath.size());
}
+ else if (stagePath && *stagePath && d.find(stagePath) == 0)
+ {
+ std::string suffix = d.substr(strlen(stagePath));
+ d = installPrefix;
+ d += "/";
+ d += suffix;
+ cmSystemTools::ConvertToUnixSlashes(d);
+ }
if(emitted.insert(d).second)
{
runtimeDirs.push_back(d);
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 8e06a1c..8576bf2 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -95,8 +95,12 @@ cmDocumentation::~cmDocumentation()
//----------------------------------------------------------------------------
bool cmDocumentation::PrintVersion(std::ostream& os)
{
- os << this->GetNameString() << " version "
- << cmVersion::GetCMakeVersion() << "\n";
+ os <<
+ this->GetNameString() <<
+ " version " << cmVersion::GetCMakeVersion() << "\n"
+ "\n"
+ "CMake suite maintained by Kitware, Inc. (kitware.com).\n"
+ ;
return true;
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index fdc075e..2ce4458 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -240,7 +240,7 @@ static bool checkInterfaceDirs(const std::string &prepro,
{
continue;
}
- if (strncmp(li->c_str(), "${_IMPORT_PREFIX}", 17) == 0)
+ if (cmHasLiteralPrefix(li->c_str(), "${_IMPORT_PREFIX}"))
{
continue;
}
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 133944e..ad17556 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -81,10 +81,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
os << "# Compute the installation prefix relative to this file.\n"
<< "get_filename_component(_IMPORT_PREFIX"
<< " \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n";
- if(strncmp(absDestS.c_str(), "/lib/", 5) == 0 ||
- strncmp(absDestS.c_str(), "/lib64/", 7) == 0 ||
- strncmp(absDestS.c_str(), "/usr/lib/", 9) == 0 ||
- strncmp(absDestS.c_str(), "/usr/lib64/", 11) == 0)
+ if(cmHasLiteralPrefix(absDestS.c_str(), "/lib/") ||
+ cmHasLiteralPrefix(absDestS.c_str(), "/lib64/") ||
+ cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib/") ||
+ cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib64/"))
{
// Handle "/usr move" symlinks created by some Linux distros.
os <<
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 8c42811..e8c8da3 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -165,6 +165,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
cmSystemTools::ConvertToUnixSlashes(*ri);
}
+ const char* stagePrefix =
+ this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
+
// Copy the original set of unrooted paths.
std::vector<std::string> unrootedPaths = paths;
paths.clear();
@@ -179,7 +182,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// already inside. Skip the unrooted path if it is relative to
// a user home directory or is empty.
std::string rootedDir;
- if(cmSystemTools::IsSubDirectory(ui->c_str(), ri->c_str()))
+ if(cmSystemTools::IsSubDirectory(ui->c_str(), ri->c_str())
+ || (stagePrefix
+ && cmSystemTools::IsSubDirectory(ui->c_str(), stagePrefix)))
{
rootedDir = *ui;
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 92dc054..7399c7b 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -173,8 +173,8 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt)
return (strcmp(prop, "LINK_LIBRARIES") == 0
|| strcmp(prop, "LINK_INTERFACE_LIBRARIES") == 0
|| strcmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
- || strncmp(prop, "LINK_INTERFACE_LIBRARIES_", 25) == 0
- || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 34) == 0)
+ || cmHasLiteralPrefix(prop, "LINK_INTERFACE_LIBRARIES_")
+ || cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_"))
|| strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0;
}
@@ -200,7 +200,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions() const
const char *prop = this->Property.c_str();
return (strcmp(prop, "COMPILE_DEFINITIONS") == 0
|| strcmp(prop, "INTERFACE_COMPILE_DEFINITIONS") == 0
- || strncmp(prop, "COMPILE_DEFINITIONS_", 20) == 0);
+ || cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_"));
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 2ae5a22..67972b9 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -902,8 +902,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(POPULATE_INTERFACE_PROPERTY_NAME)
// Note that the above macro terminates with an else
- /* else */ if (strncmp(propertyName.c_str(),
- "COMPILE_DEFINITIONS_", 20) == 0)
+ /* else */ if (cmHasLiteralPrefix(propertyName.c_str(),
+ "COMPILE_DEFINITIONS_"))
{
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 011fc6c..90cca1b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -692,3 +692,14 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
gg->AddToManifest(config? config:"", f);
}
}
+
+bool cmStrictTargetComparison::operator()(cmTarget *t1, cmTarget *t2) const
+{
+ int nameResult = strcmp(t1->GetName(), t2->GetName());
+ if (nameResult == 0)
+ {
+ return strcmp(t1->GetMakefile()->GetStartDirectory(),
+ t2->GetMakefile()->GetStartDirectory()) < 0;
+ }
+ return nameResult < 0;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 69d1bb2..d2b65b2 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -100,6 +100,12 @@ private:
void operator=(cmGeneratorTarget const&);
};
-typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
+struct cmStrictTargetComparison {
+ bool operator()(cmTarget *t1, cmTarget *t2) const;
+};
+
+typedef std::map<cmTarget*,
+ cmGeneratorTarget*,
+ cmStrictTargetComparison> cmGeneratorTargetsType;
#endif
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index e1af2f9..6333873 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -471,23 +471,29 @@ cmGlobalUnixMakefileGenerator3
// The directory-level rule should depend on the target-level rules
// for all targets in the directory.
std::vector<std::string> depends;
- for(cmTargets::iterator l = lg->GetMakefile()->GetTargets().begin();
- l != lg->GetMakefile()->GetTargets().end(); ++l)
+ cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator l = targets.begin();
+ l != targets.end(); ++l)
{
- if((l->second.GetType() == cmTarget::EXECUTABLE) ||
- (l->second.GetType() == cmTarget::STATIC_LIBRARY) ||
- (l->second.GetType() == cmTarget::SHARED_LIBRARY) ||
- (l->second.GetType() == cmTarget::MODULE_LIBRARY) ||
- (l->second.GetType() == cmTarget::OBJECT_LIBRARY) ||
- (l->second.GetType() == cmTarget::INTERFACE_LIBRARY) ||
- (l->second.GetType() == cmTarget::UTILITY))
+ if((l->second->GetType() == cmTarget::EXECUTABLE) ||
+ (l->second->GetType() == cmTarget::STATIC_LIBRARY) ||
+ (l->second->GetType() == cmTarget::SHARED_LIBRARY) ||
+ (l->second->GetType() == cmTarget::MODULE_LIBRARY) ||
+ (l->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
+ (l->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
+ (l->second->GetType() == cmTarget::UTILITY))
{
+ if(l->second->Target->IsImported())
+ {
+ continue;
+ }
// Add this to the list of depends rules in this directory.
- if((!check_all || !l->second.GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
+ if((!check_all || !l->second->GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
(!check_relink ||
- l->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str())))
+ l->second->Target
+ ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str())))
{
- std::string tname = lg->GetRelativeTargetDirectory(l->second);
+ std::string tname = lg->GetRelativeTargetDirectory(*l->second->Target);
tname += "/";
tname += pass;
depends.push_back(tname);
@@ -632,49 +638,55 @@ cmGlobalUnixMakefileGenerator3
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->LocalGenerators[i]);
// for each target Generate the rule files for each target.
- cmTargets& targets = lg->GetMakefile()->GetTargets();
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
{
+ if(t->second->Target->IsImported())
+ {
+ continue;
+ }
// Don't emit the same rule twice (e.g. two targets with the same
// simple name)
- if(t->second.GetName() &&
- strlen(t->second.GetName()) &&
- emitted.insert(t->second.GetName()).second &&
+ if(t->second->GetName() &&
+ strlen(t->second->GetName()) &&
+ emitted.insert(t->second->GetName()).second &&
// Handle user targets here. Global targets are handled in
// the local generator on a per-directory basis.
- ((t->second.GetType() == cmTarget::EXECUTABLE) ||
- (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
- (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
- (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
- (t->second.GetType() == cmTarget::OBJECT_LIBRARY) ||
- (t->second.GetType() == cmTarget::INTERFACE_LIBRARY) ||
- (t->second.GetType() == cmTarget::UTILITY)))
+ ((t->second->GetType() == cmTarget::EXECUTABLE) ||
+ (t->second->GetType() == cmTarget::STATIC_LIBRARY) ||
+ (t->second->GetType() == cmTarget::SHARED_LIBRARY) ||
+ (t->second->GetType() == cmTarget::MODULE_LIBRARY) ||
+ (t->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
+ (t->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
+ (t->second->GetType() == cmTarget::UTILITY)))
{
// Add a rule to build the target by name.
lg->WriteDivider(ruleFileStream);
ruleFileStream
<< "# Target rules for targets named "
- << t->second.GetName() << "\n\n";
+ << t->second->GetName() << "\n\n";
// Write the rule.
commands.clear();
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
tmp += "Makefile2";
commands.push_back(lg->GetRecursiveMakeCall
- (tmp.c_str(),t->second.GetName()));
+ (tmp.c_str(),t->second->GetName()));
depends.clear();
depends.push_back("cmake_check_build_system");
lg->WriteMakeRule(ruleFileStream,
"Build rule for target.",
- t->second.GetName(), depends, commands,
+ t->second->GetName(), depends, commands,
true);
- if (t->second.GetType() == cmTarget::INTERFACE_LIBRARY)
+ if (t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
{
continue;
}
// Add a fast rule to build the target
- std::string localName = lg->GetRelativeTargetDirectory(t->second);
+ std::string localName =
+ lg->GetRelativeTargetDirectory(*t->second->Target);
std::string makefileName;
makefileName = localName;
makefileName += "/build.make";
@@ -682,7 +694,7 @@ cmGlobalUnixMakefileGenerator3
commands.clear();
std::string makeTargetName = localName;
makeTargetName += "/build";
- localName = t->second.GetName();
+ localName = t->second->GetName();
localName += "/fast";
commands.push_back(lg->GetRecursiveMakeCall
(makefileName.c_str(), makeTargetName.c_str()));
@@ -691,11 +703,12 @@ cmGlobalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before
// installation.
- if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
+ if(t->second->Target
+ ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
- makeTargetName = lg->GetRelativeTargetDirectory(t->second);
+ makeTargetName = lg->GetRelativeTargetDirectory(*t->second->Target);
makeTargetName += "/preinstall";
- localName = t->second.GetName();
+ localName = t->second->GetName();
localName += "/preinstall";
depends.clear();
commands.clear();
@@ -729,26 +742,31 @@ cmGlobalUnixMakefileGenerator3
depends.push_back("cmake_check_build_system");
// for each target Generate the rule files for each target.
- cmTargets& targets = lg->GetMakefile()->GetTargets();
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ cmGeneratorTargetsType targets = lg->GetMakefile()->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
{
- if (t->second.GetName()
- && strlen(t->second.GetName())
- && ((t->second.GetType() == cmTarget::EXECUTABLE)
- || (t->second.GetType() == cmTarget::STATIC_LIBRARY)
- || (t->second.GetType() == cmTarget::SHARED_LIBRARY)
- || (t->second.GetType() == cmTarget::MODULE_LIBRARY)
- || (t->second.GetType() == cmTarget::OBJECT_LIBRARY)
- || (t->second.GetType() == cmTarget::INTERFACE_LIBRARY)
- || (t->second.GetType() == cmTarget::UTILITY)))
+ if(t->second->Target->IsImported())
+ {
+ continue;
+ }
+ if (t->second->GetName()
+ && strlen(t->second->GetName())
+ && ((t->second->GetType() == cmTarget::EXECUTABLE)
+ || (t->second->GetType() == cmTarget::STATIC_LIBRARY)
+ || (t->second->GetType() == cmTarget::SHARED_LIBRARY)
+ || (t->second->GetType() == cmTarget::MODULE_LIBRARY)
+ || (t->second->GetType() == cmTarget::OBJECT_LIBRARY)
+ || (t->second->GetType() == cmTarget::INTERFACE_LIBRARY)
+ || (t->second->GetType() == cmTarget::UTILITY)))
{
std::string makefileName;
// Add a rule to build the target by name.
- localName = lg->GetRelativeTargetDirectory(t->second);
+ localName = lg->GetRelativeTargetDirectory(*t->second->Target);
makefileName = localName;
makefileName += "/build.make";
- bool needRequiresStep = this->NeedRequiresStep(t->second);
+ bool needRequiresStep = this->NeedRequiresStep(*t->second->Target);
lg->WriteDivider(ruleFileStream);
ruleFileStream
@@ -757,7 +775,7 @@ cmGlobalUnixMakefileGenerator3
commands.clear();
- if(t->second.GetType() != cmTarget::INTERFACE_LIBRARY)
+ if(t->second->GetType() != cmTarget::INTERFACE_LIBRARY)
{
makeTargetName = localName;
makeTargetName += "/depend";
@@ -793,7 +811,7 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::SHELL);
progCmd << " ";
std::vector<unsigned long>& progFiles =
- this->ProgressMap[&t->second].Marks;
+ this->ProgressMap[t->second->Target].Marks;
for (std::vector<unsigned long>::iterator i = progFiles.begin();
i != progFiles.end(); ++i)
{
@@ -802,14 +820,14 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(progCmd.str());
}
progressDir = "Built target ";
- progressDir += t->first;
+ progressDir += t->second->GetName();
lg->AppendEcho(commands,progressDir.c_str());
}
else
{
depends.clear();
}
- this->AppendGlobalTargetDepends(depends,t->second);
+ this->AppendGlobalTargetDepends(depends,*t->second->Target);
if(depends.empty() && this->EmptyRuleHackDepends != "")
{
depends.push_back(this->EmptyRuleHackDepends);
@@ -818,7 +836,7 @@ cmGlobalUnixMakefileGenerator3
localName.c_str(), depends, commands, true);
// add the all/all dependency
- if(!this->IsExcluded(this->LocalGenerators[0], t->second))
+ if(!this->IsExcluded(this->LocalGenerators[0], *t->second->Target))
{
depends.clear();
depends.push_back(localName);
@@ -843,7 +861,7 @@ cmGlobalUnixMakefileGenerator3
//
std::set<cmTarget *> emitted;
progCmd << " "
- << this->CountProgressMarksInTarget(&t->second, emitted);
+ << this->CountProgressMarksInTarget(t->second->Target, emitted);
commands.push_back(progCmd.str());
}
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
@@ -861,7 +879,7 @@ cmGlobalUnixMakefileGenerator3
}
depends.clear();
depends.push_back("cmake_check_build_system");
- localName = lg->GetRelativeTargetDirectory(t->second);
+ localName = lg->GetRelativeTargetDirectory(*t->second->Target);
localName += "/rule";
lg->WriteMakeRule(ruleFileStream,
"Build rule for subdir invocation for target.",
@@ -872,12 +890,13 @@ cmGlobalUnixMakefileGenerator3
depends.clear();
depends.push_back(localName);
lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
- t->second.GetName(), depends, commands, true);
+ t->second->GetName(), depends, commands, true);
// Add rules to prepare the target for installation.
- if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
+ if(t->second->Target
+ ->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
- localName = lg->GetRelativeTargetDirectory(t->second);
+ localName = lg->GetRelativeTargetDirectory(*t->second->Target);
localName += "/preinstall";
depends.clear();
commands.clear();
@@ -887,7 +906,7 @@ cmGlobalUnixMakefileGenerator3
"Pre-install relink rule for target.",
localName.c_str(), depends, commands, true);
- if(!this->IsExcluded(this->LocalGenerators[0], t->second))
+ if(!this->IsExcluded(this->LocalGenerators[0], *t->second->Target))
{
depends.clear();
depends.push_back(localName);
@@ -898,7 +917,7 @@ cmGlobalUnixMakefileGenerator3
}
// add the clean rule
- localName = lg->GetRelativeTargetDirectory(t->second);
+ localName = lg->GetRelativeTargetDirectory(*t->second->Target);
makeTargetName = localName;
makeTargetName += "/clean";
depends.clear();
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 29401c6..7d4abbd 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -28,7 +28,7 @@ static const char* cmVS10GenName(const char* name, std::string& genName)
return 0;
}
const char* p = name + sizeof(vs10generatorName) - 6;
- if(strncmp(p, " 2010", 5) == 0)
+ if(cmHasLiteralPrefix(p, " 2010"))
{
p += 5;
}
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index f1d7312..1f0c47a 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -23,7 +23,7 @@ static const char* cmVS11GenName(const char* name, std::string& genName)
return 0;
}
const char* p = name + sizeof(vs11generatorName) - 6;
- if(strncmp(p, " 2012", 5) == 0)
+ if(cmHasLiteralPrefix(p, " 2012"))
{
p += 5;
}
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index edd5567..3074794 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -23,7 +23,7 @@ static const char* cmVS12GenName(const char* name, std::string& genName)
return 0;
}
const char* p = name + sizeof(vs12generatorName) - 6;
- if(strncmp(p, " 2013", 5) == 0)
+ if(cmHasLiteralPrefix(p, " 2013"))
{
p += 5;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d2784a9..cf5798f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -370,6 +370,11 @@ void cmLocalGenerator::GenerateInstallRules()
prefix = "/usr/local";
}
#endif
+ if (const char *stagingPrefix
+ = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"))
+ {
+ prefix = stagingPrefix;
+ }
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index f1d5e2c..158d714 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -64,18 +64,23 @@ void cmLocalNinjaGenerator::Generate()
}
}
- cmTargets& targets = this->GetMakefile()->GetTargets();
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ cmGeneratorTargetsType targets = this->GetMakefile()->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
{
- cmNinjaTargetGenerator* tg = cmNinjaTargetGenerator::New(&t->second);
+ if (t->second->Target->IsImported())
+ {
+ continue;
+ }
+ cmNinjaTargetGenerator* tg = cmNinjaTargetGenerator::New(t->second);
if(tg)
{
tg->Generate();
// Add the target to "all" if required.
if (!this->GetGlobalNinjaGenerator()->IsExcluded(
this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
- t->second))
- this->GetGlobalNinjaGenerator()->AddDependencyToAll(&t->second);
+ *t->second->Target))
+ this->GetGlobalNinjaGenerator()->AddDependencyToAll(t->second->Target);
delete tg;
}
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 8ed8d0a..9af5c29 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -145,13 +145,18 @@ void cmLocalUnixMakefileGenerator3::Generate()
this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
// Generate the rule files for each target.
- cmTargets& targets = this->Makefile->GetTargets();
+ cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
cmGlobalUnixMakefileGenerator3* gg =
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
{
+ if (t->second->Target->IsImported())
+ {
+ continue;
+ }
cmsys::auto_ptr<cmMakefileTargetGenerator> tg(
- cmMakefileTargetGenerator::New(&(t->second)));
+ cmMakefileTargetGenerator::New(t->second));
if (tg.get())
{
tg->WriteRuleFiles();
@@ -372,22 +377,23 @@ void cmLocalUnixMakefileGenerator3
// for each target we just provide a rule to cd up to the top and do a make
// on the target
- cmTargets& targets = this->Makefile->GetTargets();
+ cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets();
std::string localName;
- for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
- {
- if((t->second.GetType() == cmTarget::EXECUTABLE) ||
- (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
- (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
- (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
- (t->second.GetType() == cmTarget::OBJECT_LIBRARY) ||
- (t->second.GetType() == cmTarget::INTERFACE_LIBRARY) ||
- (t->second.GetType() == cmTarget::UTILITY))
+ for(cmGeneratorTargetsType::iterator t = targets.begin();
+ t != targets.end(); ++t)
+ {
+ if((t->second->GetType() == cmTarget::EXECUTABLE) ||
+ (t->second->GetType() == cmTarget::STATIC_LIBRARY) ||
+ (t->second->GetType() == cmTarget::SHARED_LIBRARY) ||
+ (t->second->GetType() == cmTarget::MODULE_LIBRARY) ||
+ (t->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
+ (t->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
+ (t->second->GetType() == cmTarget::UTILITY))
{
- emitted.insert(t->second.GetName());
+ emitted.insert(t->second->GetName());
// for subdirs add a rule to build this specific target by name.
- localName = this->GetRelativeTargetDirectory(t->second);
+ localName = this->GetRelativeTargetDirectory(*t->second->Target);
localName += "/rule";
commands.clear();
depends.clear();
@@ -404,22 +410,23 @@ void cmLocalUnixMakefileGenerator3
localName.c_str(), depends, commands, true);
// Add a target with the canonical name (no prefix, suffix or path).
- if(localName != t->second.GetName())
+ if(localName != t->second->GetName())
{
commands.clear();
depends.push_back(localName);
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
- t->second.GetName(), depends, commands, true);
+ t->second->GetName(), depends, commands, true);
}
// Add a fast rule to build the target
- std::string makefileName = this->GetRelativeTargetDirectory(t->second);
+ std::string makefileName =
+ this->GetRelativeTargetDirectory(*t->second->Target);
makefileName += "/build.make";
// make sure the makefile name is suitable for a makefile
std::string makeTargetName =
- this->GetRelativeTargetDirectory(t->second);
+ this->GetRelativeTargetDirectory(*t->second->Target);
makeTargetName += "/build";
- localName = t->second.GetName();
+ localName = t->second->GetName();
localName += "/fast";
depends.clear();
commands.clear();
@@ -433,11 +440,12 @@ void cmLocalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before
// installation.
- if(t->second.NeedRelinkBeforeInstall(this->ConfigurationName.c_str()))
+ if(t->second->Target
+ ->NeedRelinkBeforeInstall(this->ConfigurationName.c_str()))
{
- makeTargetName = this->GetRelativeTargetDirectory(t->second);
+ makeTargetName = this->GetRelativeTargetDirectory(*t->second->Target);
makeTargetName += "/preinstall";
- localName = t->second.GetName();
+ localName = t->second->GetName();
localName += "/preinstall";
depends.clear();
commands.clear();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6be1fdd..989aa5f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -884,34 +884,61 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
{
// Find the target to which to add the custom command.
cmTargets::iterator ti = this->Targets.find(target);
- if(ti != this->Targets.end())
+
+ if(ti == this->Targets.end())
{
- if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY)
+ cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ bool issueMessage = false;
+ switch(this->GetPolicyStatus(cmPolicies::CMP0040))
{
- cmOStringStream e;
- e << "Target \"" << target << "\" is an OBJECT library "
- "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
- return;
+ case cmPolicies::WARN:
+ issueMessage = true;
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ issueMessage = true;
+ messageType = cmake::FATAL_ERROR;
}
- // Add the command to the appropriate build step for the target.
- std::vector<std::string> no_output;
- cmCustomCommand cc(this, no_output, depends,
- commandLines, comment, workingDir);
- cc.SetEscapeOldStyle(escapeOldStyle);
- cc.SetEscapeAllowMakeVars(true);
- switch(type)
+
+ if(issueMessage)
{
- case cmTarget::PRE_BUILD:
- ti->second.AddPreBuildCommand(cc);
- break;
- case cmTarget::PRE_LINK:
- ti->second.AddPreLinkCommand(cc);
- break;
- case cmTarget::POST_BUILD:
- ti->second.AddPostBuildCommand(cc);
- break;
+ cmOStringStream e;
+ e << (this->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0040)) << "\n";
+ e << "The target name \"" << target << "\" is unknown in this context.";
+ IssueMessage(messageType, e.str().c_str());
}
+
+ return;
+ }
+
+ if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "Target \"" << target << "\" is an OBJECT library "
+ "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
+ this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return;
+ }
+ // Add the command to the appropriate build step for the target.
+ std::vector<std::string> no_output;
+ cmCustomCommand cc(this, no_output, depends,
+ commandLines, comment, workingDir);
+ cc.SetEscapeOldStyle(escapeOldStyle);
+ cc.SetEscapeAllowMakeVars(true);
+ switch(type)
+ {
+ case cmTarget::PRE_BUILD:
+ ti->second.AddPreBuildCommand(cc);
+ break;
+ case cmTarget::PRE_LINK:
+ ti->second.AddPreLinkCommand(cc);
+ break;
+ case cmTarget::POST_BUILD:
+ ti->second.AddPostBuildCommand(cc);
+ break;
}
}
@@ -4059,8 +4086,11 @@ bool cmMakefile::IsAlias(const char *name)
//----------------------------------------------------------------------------
cmGeneratorTarget* cmMakefile::FindGeneratorTargetToUse(const char* name)
{
- cmTarget *t = this->FindTargetToUse(name);
- return this->LocalGenerator->GetGlobalGenerator()->GetGeneratorTarget(t);
+ if (cmTarget *t = this->FindTargetToUse(name))
+ {
+ return this->LocalGenerator->GetGlobalGenerator()->GetGeneratorTarget(t);
+ }
+ return 0;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e4219a9..69fe444 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -21,15 +21,15 @@
//----------------------------------------------------------------------------
cmMakefileExecutableTargetGenerator
-::cmMakefileExecutableTargetGenerator(cmTarget* target):
- cmMakefileTargetGenerator(target)
+::cmMakefileExecutableTargetGenerator(cmGeneratorTarget* target):
+ cmMakefileTargetGenerator(target->Target)
{
this->CustomCommandDriver = OnDepends;
this->Target->GetExecutableNames(
this->TargetNameOut, this->TargetNameReal, this->TargetNameImport,
this->TargetNamePDB, this->ConfigName);
- this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target,
+ this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
this->ConfigName);
this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders);
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.h b/Source/cmMakefileExecutableTargetGenerator.h
index 3b18166..940226b 100644
--- a/Source/cmMakefileExecutableTargetGenerator.h
+++ b/Source/cmMakefileExecutableTargetGenerator.h
@@ -17,7 +17,7 @@
class cmMakefileExecutableTargetGenerator: public cmMakefileTargetGenerator
{
public:
- cmMakefileExecutableTargetGenerator(cmTarget* target);
+ cmMakefileExecutableTargetGenerator(cmGeneratorTarget* target);
virtual ~cmMakefileExecutableTargetGenerator();
/* the main entry point for this class. Writes the Makefiles associated
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 29365a3..7b8a531 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -21,15 +21,15 @@
//----------------------------------------------------------------------------
cmMakefileLibraryTargetGenerator
-::cmMakefileLibraryTargetGenerator(cmTarget* target):
- cmMakefileTargetGenerator(target)
+::cmMakefileLibraryTargetGenerator(cmGeneratorTarget* target):
+ cmMakefileTargetGenerator(target->Target)
{
this->CustomCommandDriver = OnDepends;
this->Target->GetLibraryNames(
this->TargetNameOut, this->TargetNameSO, this->TargetNameReal,
this->TargetNameImport, this->TargetNamePDB, this->ConfigName);
- this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target,
+ this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
this->ConfigName);
this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders);
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index 07f828b..1487b56 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -18,7 +18,7 @@ class cmMakefileLibraryTargetGenerator:
public cmMakefileTargetGenerator
{
public:
- cmMakefileLibraryTargetGenerator(cmTarget* target);
+ cmMakefileLibraryTargetGenerator(cmGeneratorTarget* target);
virtual ~cmMakefileLibraryTargetGenerator();
/* the main entry point for this class. Writes the Makefiles associated
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2fcad79..2063a24 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -63,7 +63,7 @@ cmMakefileTargetGenerator::~cmMakefileTargetGenerator()
}
cmMakefileTargetGenerator *
-cmMakefileTargetGenerator::New(cmTarget *tgt)
+cmMakefileTargetGenerator::New(cmGeneratorTarget *tgt)
{
cmMakefileTargetGenerator *result = 0;
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index ec2af1c..4f8fafa 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -38,7 +38,7 @@ public:
virtual ~cmMakefileTargetGenerator();
// construct using this factory call
- static cmMakefileTargetGenerator *New(cmTarget *tgt);
+ static cmMakefileTargetGenerator *New(cmGeneratorTarget *tgt);
/* the main entry point for this class. Writes the Makefiles associated
with this target */
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 1fa4e95..7751ad9 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -20,11 +20,11 @@
//----------------------------------------------------------------------------
cmMakefileUtilityTargetGenerator
-::cmMakefileUtilityTargetGenerator(cmTarget* target):
- cmMakefileTargetGenerator(target)
+::cmMakefileUtilityTargetGenerator(cmGeneratorTarget* target):
+ cmMakefileTargetGenerator(target->Target)
{
this->CustomCommandDriver = OnUtility;
- this->OSXBundleGenerator = new cmOSXBundleGenerator(this->Target,
+ this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
this->ConfigName);
this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders);
}
diff --git a/Source/cmMakefileUtilityTargetGenerator.h b/Source/cmMakefileUtilityTargetGenerator.h
index fc47b38..8f99300 100644
--- a/Source/cmMakefileUtilityTargetGenerator.h
+++ b/Source/cmMakefileUtilityTargetGenerator.h
@@ -18,7 +18,7 @@ class cmMakefileUtilityTargetGenerator:
public cmMakefileTargetGenerator
{
public:
- cmMakefileUtilityTargetGenerator(cmTarget* target);
+ cmMakefileUtilityTargetGenerator(cmGeneratorTarget* target);
virtual ~cmMakefileUtilityTargetGenerator();
/* the main entry point for this class. Writes the Makefiles associated
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index d8e9b34..2c96ede 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
+#include "cmGeneratorTarget.h"
#include <assert.h>
#include <algorithm>
@@ -27,8 +28,8 @@
cmNinjaNormalTargetGenerator::
-cmNinjaNormalTargetGenerator(cmTarget* target)
- : cmNinjaTargetGenerator(target)
+cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
+ : cmNinjaTargetGenerator(target->Target)
, TargetNameOut()
, TargetNameSO()
, TargetNameReal()
@@ -36,15 +37,16 @@ cmNinjaNormalTargetGenerator(cmTarget* target)
, TargetNamePDB()
, TargetLinkLanguage(0)
{
- this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
+ this->TargetLinkLanguage = target->Target
+ ->GetLinkerLanguage(this->GetConfigName());
if (target->GetType() == cmTarget::EXECUTABLE)
- target->GetExecutableNames(this->TargetNameOut,
+ target->Target->GetExecutableNames(this->TargetNameOut,
this->TargetNameReal,
this->TargetNameImport,
this->TargetNamePDB,
GetLocalGenerator()->GetConfigName());
else
- target->GetLibraryNames(this->TargetNameOut,
+ target->Target->GetLibraryNames(this->TargetNameOut,
this->TargetNameSO,
this->TargetNameReal,
this->TargetNameImport,
@@ -55,7 +57,7 @@ cmNinjaNormalTargetGenerator(cmTarget* target)
{
// on Windows the output dir is already needed at compile time
// ensure the directory exists (OutDir test)
- EnsureDirectoryExists(target->GetDirectory(this->GetConfigName()));
+ EnsureDirectoryExists(target->Target->GetDirectory(this->GetConfigName()));
}
this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
diff --git a/Source/cmNinjaNormalTargetGenerator.h b/Source/cmNinjaNormalTargetGenerator.h
index 284804b..c7a089c 100644
--- a/Source/cmNinjaNormalTargetGenerator.h
+++ b/Source/cmNinjaNormalTargetGenerator.h
@@ -21,11 +21,12 @@
class cmSourceFile;
class cmOSXBundleGenerator;
+class cmGeneratorTarget;
class cmNinjaNormalTargetGenerator : public cmNinjaTargetGenerator
{
public:
- cmNinjaNormalTargetGenerator(cmTarget* target);
+ cmNinjaNormalTargetGenerator(cmGeneratorTarget* target);
~cmNinjaNormalTargetGenerator();
void Generate();
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 26eadbe..b132db6 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -26,7 +26,7 @@
#include <algorithm>
cmNinjaTargetGenerator *
-cmNinjaTargetGenerator::New(cmTarget* target)
+cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
{
switch (target->GetType())
{
@@ -44,7 +44,7 @@ cmNinjaTargetGenerator::New(cmTarget* target)
// We only want to process global targets that live in the home
// (i.e. top-level) directory. CMake creates copies of these targets
// in every directory, which we don't need.
- cmMakefile *mf = target->GetMakefile();
+ cmMakefile *mf = target->Target->GetMakefile();
if (strcmp(mf->GetStartDirectory(), mf->GetHomeDirectory()) == 0)
return new cmNinjaUtilityTargetGenerator(target);
// else fallthrough
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 1cf811a..e377a78 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -30,7 +30,7 @@ class cmNinjaTargetGenerator
{
public:
/// Create a cmNinjaTargetGenerator according to the @a target's type.
- static cmNinjaTargetGenerator* New(cmTarget* target);
+ static cmNinjaTargetGenerator* New(cmGeneratorTarget* target);
/// Build a NinjaTargetGenerator.
cmNinjaTargetGenerator(cmTarget* target);
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 755ce6e..8556565 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -18,8 +18,9 @@
#include "cmSourceFile.h"
#include "cmTarget.h"
-cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(cmTarget *target)
- : cmNinjaTargetGenerator(target) {}
+cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
+ cmGeneratorTarget *target)
+ : cmNinjaTargetGenerator(target->Target) {}
cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() {}
diff --git a/Source/cmNinjaUtilityTargetGenerator.h b/Source/cmNinjaUtilityTargetGenerator.h
index 8b82ce4..add0291 100644
--- a/Source/cmNinjaUtilityTargetGenerator.h
+++ b/Source/cmNinjaUtilityTargetGenerator.h
@@ -21,7 +21,7 @@ class cmSourceFile;
class cmNinjaUtilityTargetGenerator : public cmNinjaTargetGenerator
{
public:
- cmNinjaUtilityTargetGenerator(cmTarget* target);
+ cmNinjaUtilityTargetGenerator(cmGeneratorTarget* target);
~cmNinjaUtilityTargetGenerator();
void Generate();
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index a475c7c..9a340dc 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -18,10 +18,10 @@
//----------------------------------------------------------------------------
cmOSXBundleGenerator::
-cmOSXBundleGenerator(cmTarget* target,
+cmOSXBundleGenerator(cmGeneratorTarget* target,
const char* configName)
- : Target(target)
- , Makefile(target->GetMakefile())
+ : Target(target->Target)
+ , Makefile(target->Target->GetMakefile())
, LocalGenerator(Makefile->GetLocalGenerator())
, ConfigName(configName)
, MacContentFolders(0)
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index ec82b9a..29b7611 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -21,11 +21,12 @@
class cmTarget;
class cmMakefile;
class cmLocalGenerator;
+class cmGeneratorTarget;
class cmOSXBundleGenerator
{
public:
- cmOSXBundleGenerator(cmTarget* target,
+ cmOSXBundleGenerator(cmGeneratorTarget* target,
const char* configName);
// create an app bundle at a given root, and return
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 16b2bea..5de36ed 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -32,7 +32,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
std::string line;
while(cmSystemTools::GetLineFromStream(fin, line))
{
- if(!strncmp(line.c_str(), "#include", 8))
+ if(cmHasLiteralPrefix(line.c_str(), "#include"))
{
// if it is an include line then create a string class
std::string currentline = line;
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index a18fc16..b9b469c 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -301,6 +301,11 @@ cmPolicies::cmPolicies()
CMP0039, "CMP0039",
"Utility targets may not have link dependencies.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0040, "CMP0040",
+ "The target in the TARGET signature of add_custom_command() must exist.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 361d820..6834121 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -92,6 +92,8 @@ public:
/// should match a validity pattern.
CMP0038, ///< Targets may not link directly to themselves
CMP0039, ///< Utility targets may not have link dependencies
+ CMP0040, ///< The target in the TARGET signature of
+ /// add_custom_command() must exist.
/** \brief Always the last entry.
*
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index bb193bf..36363a1 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -23,7 +23,7 @@ bool cmSetCommand
// watch for ENV signatures
const char* variable = args[0].c_str(); // VAR is always first
- if (!strncmp(variable,"ENV{",4) && strlen(variable) > 5)
+ if (cmHasLiteralPrefix(variable, "ENV{") && strlen(variable) > 5)
{
// what is the variable name
char *varName = new char [strlen(variable)];
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 18d017d..1ccec68 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -377,13 +377,31 @@ static thisClass* SafeDownCast(cmObject *c) \
return 0;\
}
+inline bool cmHasLiteralPrefixImpl(const std::string &str1,
+ const char *str2,
+ size_t N)
+{
+ return strncmp(str1.c_str(), str2, N) == 0;
+}
+
+inline bool cmHasLiteralPrefixImpl(const char* str1,
+ const char *str2,
+ size_t N)
+{
+ return strncmp(str1, str2, N) == 0;
+}
+
#if defined(_MSC_VER) && _MSC_VER < 1300 \
- || defined(__GNUC__) && __GNUC__ < 3
+ || defined(__GNUC__) && __GNUC__ < 3 \
+ || defined(__BORLANDC__)
#define cmArrayBegin(a) a
#define cmArraySize(a) (sizeof(a)/sizeof(*a))
#define cmArrayEnd(a) a + cmArraySize(a)
+#define cmHasLiteralPrefix(STR1, STR2) \
+ cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1)
+
#else
template<typename T, size_t N>
@@ -393,6 +411,12 @@ const T* cmArrayEnd(const T (&a)[N]) { return a + N; }
template<typename T, size_t N>
size_t cmArraySize(const T (&)[N]) { return N; }
+template<typename T, size_t N>
+bool cmHasLiteralPrefix(T str1, const char (&str2)[N])
+{
+ return cmHasLiteralPrefixImpl(str1, str2, N - 1);
+}
+
#endif
struct cmStrCmp {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index cf68e38..120a666 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -560,7 +560,7 @@ cmSourceFile* cmTarget::AddSource(const char* s)
//----------------------------------------------------------------------------
void cmTarget::ProcessSourceExpression(std::string const& expr)
{
- if(strncmp(expr.c_str(), "$<TARGET_OBJECTS:", 17) == 0 &&
+ if(cmHasLiteralPrefix(expr.c_str(), "$<TARGET_OBJECTS:") &&
expr[expr.size()-1] == '>')
{
std::string objLibName = expr.substr(17, expr.size()-18);
@@ -2199,11 +2199,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
{
// Wipe out maps caching information affected by this property.
- if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
+ if(this->IsImported() && cmHasLiteralPrefix(prop, "IMPORTED"))
{
this->Internal->ImportInfoMap.clear();
}
- if(!this->IsImported() && strncmp(prop, "LINK_INTERFACE_", 15) == 0)
+ if(!this->IsImported() && cmHasLiteralPrefix(prop, "LINK_INTERFACE_"))
{
this->ClearLinkMaps();
}
@@ -2279,21 +2279,21 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
void cmTarget::CheckProperty(const char* prop, cmMakefile* context) const
{
// Certain properties need checking.
- if(strncmp(prop, "LINK_INTERFACE_LIBRARIES", 24) == 0)
+ if(cmHasLiteralPrefix(prop, "LINK_INTERFACE_LIBRARIES"))
{
if(const char* value = this->GetProperty(prop))
{
cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, false);
}
}
- if(strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES", 33) == 0)
+ if(cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES"))
{
if(const char* value = this->GetProperty(prop))
{
cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, true);
}
}
- if(strncmp(prop, "INTERFACE_LINK_LIBRARIES", 24) == 0)
+ if(cmHasLiteralPrefix(prop, "INTERFACE_LINK_LIBRARIES"))
{
if(const char* value = this->GetProperty(prop))
{
@@ -2595,7 +2595,7 @@ const char *cmTarget::GetProperty(const char* prop,
}
// Support "LOCATION_<CONFIG>".
- if(strncmp(prop, "LOCATION_", 9) == 0)
+ if(cmHasLiteralPrefix(prop, "LOCATION_"))
{
if (!this->HandleLocationPropertyPolicy())
{
diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx
index 46c9666..b567252 100644
--- a/Source/cmTargetCompileDefinitionsCommand.cxx
+++ b/Source/cmTargetCompileDefinitionsCommand.cxx
@@ -44,7 +44,7 @@ std::string cmTargetCompileDefinitionsCommand
for(std::vector<std::string>::const_iterator it = content.begin();
it != content.end(); ++it)
{
- if (strncmp(it->c_str(), "-D", 2) == 0)
+ if (cmHasLiteralPrefix(it->c_str(), "-D"))
{
defs += sep + it->substr(2);
}
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 84f3029..053cdfc 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -24,7 +24,7 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
const char* variable = args[0].c_str();
// unset(ENV{VAR})
- if (!strncmp(variable,"ENV{",4) && strlen(variable) > 5)
+ if (cmHasLiteralPrefix(variable, "ENV{") && strlen(variable) > 5)
{
// what is the variable name
char *envVarName = new char [strlen(variable)];
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 6ef0579..882b072 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -273,7 +273,7 @@ int do_cmake(int ac, char** av)
list_all_cached = true;
list_help = true;
}
- else if (strncmp(av[i], "-P", strlen("-P")) == 0)
+ else if (cmHasLiteralPrefix(av[i], "-P"))
{
if ( i == ac -1 )
{
@@ -287,8 +287,7 @@ int do_cmake(int ac, char** av)
args.push_back(av[i]);
}
}
- else if (strncmp(av[i], "--find-package",
- strlen("--find-package")) == 0)
+ else if (cmHasLiteralPrefix(av[i], "--find-package"))
{
workingMode = cmake::FIND_PACKAGE_MODE;
args.push_back(av[i]);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 48abfae..f7a320a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -269,6 +269,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(CompileOptions CompileOptions)
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
+ ADD_TEST_MACRO(StagingPrefix StagingPrefix)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
set_tests_properties(EmptyLibrary PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target: test")
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake
new file mode 100644
index 0000000..f9c8afd
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0040 NEW)
+
+add_library(foobar empty.cpp)
+
+add_custom_command(TARGET foobar PRE_BUILD
+ COMMAND "${CMAKE_COMMAND} -E echo hello world"
+)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt
new file mode 100644
index 0000000..03a0217
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at CMP0040-NEW-missing-target.cmake:3 \(add_custom_command\):
+ Policy CMP0040 is not set: The target in the TARGET signature of
+ add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for
+ policy details. Use the cmake_policy command to set the policy and
+ suppress this warning.
++
+ The target name "foobar" is unknown in this context.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake
new file mode 100644
index 0000000..276863d
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake
@@ -0,0 +1,5 @@
+cmake_policy(SET CMP0040 NEW)
+
+add_custom_command(TARGET foobar PRE_BUILD
+ COMMAND "${CMAKE_COMMAND} -E hello world"
+)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake
new file mode 100644
index 0000000..d7ec50d
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0040 OLD)
+
+add_library(foobar empty.cpp)
+
+add_custom_command(TARGET foobar PRE_BUILD
+ COMMAND "${CMAKE_COMMAND} -E echo hello world"
+)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake
new file mode 100644
index 0000000..ef7a0f7
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake
@@ -0,0 +1,5 @@
+cmake_policy(SET CMP0040 OLD)
+
+add_custom_command(TARGET foobar PRE_BUILD
+ COMMAND "${CMAKE_COMMAND} -E echo hello world"
+)
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt
new file mode 100644
index 0000000..e791f0a
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) at CMP0040-WARN-missing-target.cmake:2 \(add_custom_command\):
+ Policy CMP0040 is not set: The target in the TARGET signature of
+ add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for
+ policy details. Use the cmake_policy command to set the policy and
+ suppress this warning.
++
+ The target name "foobar" is unknown in this context.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake
new file mode 100644
index 0000000..2c3e401
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake
@@ -0,0 +1,4 @@
+
+add_custom_command(TARGET foobar PRE_BUILD
+ COMMAND "${CMAKE_COMMAND} -E hello world"
+)
diff --git a/Tests/RunCMake/CMP0040/CMakeLists.txt b/Tests/RunCMake/CMP0040/CMakeLists.txt
new file mode 100644
index 0000000..2f10cb0
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0040/RunCMakeTest.cmake b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake
new file mode 100644
index 0000000..13160e3
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(CMP0040-OLD-missing-target)
+run_cmake(CMP0040-NEW-missing-target)
+run_cmake(CMP0040-WARN-missing-target)
+
+run_cmake(CMP0040-OLD-existing-target)
+run_cmake(CMP0040-NEW-existing-target)
diff --git a/Tests/RunCMake/CMP0040/empty.cpp b/Tests/RunCMake/CMP0040/empty.cpp
new file mode 100644
index 0000000..bfbbdde
--- /dev/null
+++ b/Tests/RunCMake/CMP0040/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index bb1b909..209b0b3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -59,6 +59,7 @@ add_RunCMake_test(CMP0028)
add_RunCMake_test(CMP0037)
add_RunCMake_test(CMP0038)
add_RunCMake_test(CMP0039)
+add_RunCMake_test(CMP0040)
add_RunCMake_test(CTest)
if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)
diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt
new file mode 100644
index 0000000..922776d
--- /dev/null
+++ b/Tests/StagingPrefix/CMakeLists.txt
@@ -0,0 +1,89 @@
+
+cmake_minimum_required(VERSION 2.8.12)
+project(StagingPrefix)
+
+# Wipe out the install tree
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/CleanupProject
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ConsumerBuild
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ProducerBuild
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/stage
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/prefix
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/ignored
+ )
+add_custom_target(CleanupTarget ALL DEPENDS ${CMAKE_BINARY_DIR}/CleanupProject)
+set_property(
+ SOURCE ${CMAKE_BINARY_DIR}/CleanupProject
+ PROPERTY SYMBOLIC 1
+ )
+
+if(CMAKE_CONFIGURATION_TYPES)
+ set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
+else()
+ if(CMAKE_BUILD_TYPE)
+ set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}")
+ else()
+ set(NESTED_CONFIG_TYPE)
+ endif()
+endif()
+
+# Build and install the producer.
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/ProducerProject
+ COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE}
+ --build-and-test
+ ${CMAKE_SOURCE_DIR}/Producer
+ ${CMAKE_BINARY_DIR}/ProducerBuild
+ --build-noclean
+ --build-project Producer
+ --build-target install
+ --build-generator ${CMAKE_GENERATOR}
+ --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+ --build-options
+ -DCMAKE_VERBOSE_MAKEFILE=1
+ "-DCMAKE_STAGING_PREFIX=${CMAKE_BINARY_DIR}/stage"
+ "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix"
+ VERBATIM
+ )
+
+add_custom_target(ProducerTarget ALL DEPENDS ${CMAKE_BINARY_DIR}/ProducerProject)
+add_dependencies(ProducerTarget CleanupTarget)
+set_property(
+ SOURCE ${CMAKE_BINARY_DIR}/ProducerProject
+ PROPERTY SYMBOLIC 1
+ )
+
+if(NOT WIN32)
+ file(WRITE
+ "${CMAKE_BINARY_DIR}/ignored/${CMAKE_BINARY_DIR}/stage/include/ignored.h"
+ "#define IGNORED\n"
+ )
+endif()
+
+# Build and install the consumer.
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/ConsumerProject
+ COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE}
+ --build-and-test
+ ${CMAKE_SOURCE_DIR}/Consumer
+ ${CMAKE_BINARY_DIR}/ConsumerBuild
+ --build-noclean
+ --build-project Consumer
+ --build-target install
+ --build-generator ${CMAKE_GENERATOR}
+ --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+ --build-options
+ "-DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/ignored"
+ "-DCMAKE_STAGING_PREFIX=${CMAKE_BINARY_DIR}/stage"
+ -DCMAKE_VERBOSE_MAKEFILE=1
+ VERBATIM
+ )
+add_custom_target(ConsumerTarget ALL DEPENDS ${CMAKE_BINARY_DIR}/ConsumerProject)
+add_dependencies(ConsumerTarget ProducerTarget)
+set_property(
+ SOURCE ${CMAKE_BINARY_DIR}/ConsumerProject
+ PROPERTY SYMBOLIC 1
+ )
+
+add_executable(StagingPrefix main.cpp)
+add_dependencies(StagingPrefix ConsumerTarget)
diff --git a/Tests/StagingPrefix/Consumer/CMakeLists.txt b/Tests/StagingPrefix/Consumer/CMakeLists.txt
new file mode 100644
index 0000000..a230441
--- /dev/null
+++ b/Tests/StagingPrefix/Consumer/CMakeLists.txt
@@ -0,0 +1,22 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+project(Consumer)
+
+
+add_executable(executable main.cpp)
+find_package(Foo CONFIG REQUIRED)
+target_link_libraries(executable Foo::foo)
+
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+find_package(Bar MODULE REQUIRED)
+include_directories(${Bar_INCLUDE_DIRS})
+target_link_libraries(executable ${Bar_LIBRARIES})
+
+install(TARGETS executable DESTINATION bin)
+
+if(NOT WIN32)
+ find_path(IGNORED_INCLUDE_DIR ignored.h)
+ if (IGNORED_INCLUDE_DIR)
+ message(SEND_ERROR "Should not find this file. The search path should be excluded.")
+ endif()
+endif()
diff --git a/Tests/StagingPrefix/Consumer/cmake/FindBar.cmake b/Tests/StagingPrefix/Consumer/cmake/FindBar.cmake
new file mode 100644
index 0000000..29e4478
--- /dev/null
+++ b/Tests/StagingPrefix/Consumer/cmake/FindBar.cmake
@@ -0,0 +1,6 @@
+
+find_path(_inc_prefix bar.h PATH_SUFFIXES bar)
+set(Bar_INCLUDE_DIRS ${_inc_prefix})
+
+find_library(Bar_LIBRARY bar)
+set(Bar_LIBRARIES ${Bar_LIBRARY})
diff --git a/Tests/StagingPrefix/Consumer/main.cpp b/Tests/StagingPrefix/Consumer/main.cpp
new file mode 100644
index 0000000..612ee05
--- /dev/null
+++ b/Tests/StagingPrefix/Consumer/main.cpp
@@ -0,0 +1,10 @@
+
+#include "foo.h"
+#include "bar.h"
+
+int main(int, char **)
+{
+ Foo f;
+ Bar b;
+ return f.foo() + b.bar();
+}
diff --git a/Tests/StagingPrefix/Producer/CMakeLists.txt b/Tests/StagingPrefix/Producer/CMakeLists.txt
new file mode 100644
index 0000000..eb3d98f
--- /dev/null
+++ b/Tests/StagingPrefix/Producer/CMakeLists.txt
@@ -0,0 +1,26 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+project(Producer)
+
+add_library(foo SHARED foo.cpp)
+
+install(TARGETS foo EXPORT fooTargets
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ INCLUDES DESTINATION include/foo
+)
+install(FILES foo.h DESTINATION include/foo)
+install(EXPORT fooTargets
+ FILE FooConfig.cmake
+ NAMESPACE Foo::
+ DESTINATION lib/cmake/Foo
+)
+
+add_library(bar SHARED bar.cpp)
+install(TARGETS bar
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+install(FILES bar.h DESTINATION include/bar)
diff --git a/Tests/StagingPrefix/Producer/bar.cpp b/Tests/StagingPrefix/Producer/bar.cpp
new file mode 100644
index 0000000..6bb8abe
--- /dev/null
+++ b/Tests/StagingPrefix/Producer/bar.cpp
@@ -0,0 +1,7 @@
+
+#include "bar.h"
+
+int Bar::bar()
+{
+ return 0;
+}
diff --git a/Tests/StagingPrefix/Producer/bar.h b/Tests/StagingPrefix/Producer/bar.h
new file mode 100644
index 0000000..acd1fae
--- /dev/null
+++ b/Tests/StagingPrefix/Producer/bar.h
@@ -0,0 +1,10 @@
+
+class
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+Bar
+{
+public:
+ int bar();
+};
diff --git a/Tests/StagingPrefix/Producer/foo.cpp b/Tests/StagingPrefix/Producer/foo.cpp
new file mode 100644
index 0000000..64ad7cd
--- /dev/null
+++ b/Tests/StagingPrefix/Producer/foo.cpp
@@ -0,0 +1,7 @@
+
+#include "foo.h"
+
+int Foo::foo()
+{
+ return 0;
+}
diff --git a/Tests/StagingPrefix/Producer/foo.h b/Tests/StagingPrefix/Producer/foo.h
new file mode 100644
index 0000000..614093d
--- /dev/null
+++ b/Tests/StagingPrefix/Producer/foo.h
@@ -0,0 +1,10 @@
+
+class
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+Foo
+{
+public:
+ int foo();
+};
diff --git a/Tests/StagingPrefix/main.cpp b/Tests/StagingPrefix/main.cpp
new file mode 100644
index 0000000..341aaaf
--- /dev/null
+++ b/Tests/StagingPrefix/main.cpp
@@ -0,0 +1,5 @@
+
+int main(int, char **)
+{
+ return 0;
+}
diff --git a/Utilities/Release/dash2win64_release.cmake b/Utilities/Release/dash2win64_release.cmake
index 6d1ac76..848e2f4 100644
--- a/Utilities/Release/dash2win64_release.cmake
+++ b/Utilities/Release/dash2win64_release.cmake
@@ -13,6 +13,7 @@ CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CMAKE_Fortran_COMPILER:FILEPATH=FALSE
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
BUILD_QtDialog:BOOL:=TRUE
+CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=c:/Dashboards/Support/qt-build/Qt/bin/qmake.exe
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
diff --git a/Utilities/Release/dashmacmini2_release.cmake b/Utilities/Release/dashmacmini2_release.cmake
index 5e57a70b..9d418d9 100644
--- a/Utilities/Release/dashmacmini2_release.cmake
+++ b/Utilities/Release/dashmacmini2_release.cmake
@@ -16,6 +16,7 @@ OPENSSL_SSL_LIBRARY:FILEPATH=/Users/kitware/openssl-1.0.1c-install/lib/libssl.a
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CPACK_SYSTEM_NAME:STRING=Darwin-universal
BUILD_QtDialog:BOOL=TRUE
+CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Support/qt-4.8.0/install/bin/qmake
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
diff --git a/Utilities/Release/dashmacmini5_release.cmake b/Utilities/Release/dashmacmini5_release.cmake
index 36b0952..aba68f8 100644
--- a/Utilities/Release/dashmacmini5_release.cmake
+++ b/Utilities/Release/dashmacmini5_release.cmake
@@ -18,6 +18,7 @@ CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.5
CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
CPACK_SYSTEM_NAME:STRING=Darwin64-universal
BUILD_QtDialog:BOOL=TRUE
+CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=/Users/kitware/Support/qt-4.8.0/install/bin/qmake
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
diff --git a/Utilities/Release/magrathea_release.cmake b/Utilities/Release/magrathea_release.cmake
index 4783fda..93916e2 100644
--- a/Utilities/Release/magrathea_release.cmake
+++ b/Utilities/Release/magrathea_release.cmake
@@ -16,6 +16,7 @@ OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.0.1c-install/include
OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.0.1c-install/lib/libssl.a
CPACK_SYSTEM_NAME:STRING=Linux-i386
BUILD_QtDialog:BOOL:=TRUE
+CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:BOOL=TRUE
QT_QMAKE_EXECUTABLE:FILEPATH=/home/kitware/qt-4.43-install/bin/qmake
")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)