summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/FIND_XXX_ROOT.txt10
-rw-r--r--Help/command/find_file.rst2
-rw-r--r--Help/command/find_library.rst2
-rw-r--r--Help/command/find_package.rst2
-rw-r--r--Help/command/find_path.rst2
-rw-r--r--Help/command/find_program.rst2
-rw-r--r--Help/generator/Kate.rst26
-rw-r--r--Help/index.rst1
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst6
-rw-r--r--Help/manual/cmake-generators.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-toolchains.7.rst160
-rw-r--r--Help/manual/cmake-variables.7.rst9
-rw-r--r--Help/policy/CMP0041.rst25
-rw-r--r--Help/prop_tgt/AUTOUIC_OPTIONS.rst4
-rw-r--r--Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst14
-rw-r--r--Help/prop_tgt/PDB_NAME.rst13
-rw-r--r--Help/prop_tgt/PDB_NAME_CONFIG.rst8
-rw-r--r--Help/prop_tgt/PDB_NOTE.txt8
-rw-r--r--Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst12
-rw-r--r--Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst16
-rw-r--r--Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst4
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH.rst8
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst6
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst6
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst6
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst6
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt8
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_TARGET.rst2
-rw-r--r--Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY.rst7
-rw-r--r--Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG.rst11
-rw-r--r--Help/variable/CMAKE_SYSROOT.rst2
-rw-r--r--Help/variable/CMAKE_TOOLCHAIN_FILE.rst9
-rw-r--r--Modules/CMakeCInformation.cmake8
-rw-r--r--Modules/CMakeCXXInformation.cmake8
-rw-r--r--Modules/CMakeFindKate.cmake31
-rw-r--r--Modules/CMakeFortranInformation.cmake8
-rw-r--r--Modules/CPackWIX.cmake8
-rw-r--r--Modules/CTestUseLaunchers.cmake28
-rw-r--r--Modules/FindSWIG.cmake2
-rw-r--r--Modules/Platform/Darwin.cmake4
-rw-r--r--Modules/ProcessorCount.cmake14
-rw-r--r--Modules/UseSWIG.cmake30
-rw-r--r--Modules/WIX.template.in2
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx306
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h31
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.cxx9
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.h3
-rw-r--r--Source/CTest/cmCTestLaunch.cxx19
-rw-r--r--Source/CTest/cmCTestLaunch.h1
-rw-r--r--Source/cmExportBuildFileGenerator.cxx3
-rw-r--r--Source/cmExportFileGenerator.cxx70
-rw-r--r--Source/cmExportInstallFileGenerator.cxx4
-rw-r--r--Source/cmExtraKateGenerator.cxx372
-rw-r--r--Source/cmExtraKateGenerator.h62
-rw-r--r--Source/cmGeneratorExpression.cxx2
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx8
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h6
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx48
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
-rw-r--r--Source/cmInstallCommandArguments.cxx5
-rw-r--r--Source/cmLocalGenerator.cxx1
-rw-r--r--Source/cmLocalGenerator.h1
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx5
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmQtAutoGenerators.cxx82
-rw-r--r--Source/cmQtAutoGenerators.h3
-rw-r--r--Source/cmTarget.cxx144
-rw-r--r--Source/cmTarget.h6
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx2
-rw-r--r--Source/cmake.cxx3
-rw-r--r--Source/cmcmd.cxx3
-rw-r--r--Tests/CMakeCommands/target_include_directories/CMakeLists.txt3
-rw-r--r--Tests/CMakeCommands/target_include_directories/consumer.cpp5
-rw-r--r--Tests/CMakeCommands/target_include_directories/relative_dir/consumer/consumer.h2
-rw-r--r--Tests/CMakeLists.txt30
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt14
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt56
-rw-r--r--Tests/ExportImport/Import/A/deps_iface.c6
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt3
-rw-r--r--Tests/GeneratorExpression/check-part3.cmake3
-rw-r--r--Tests/QtAutoUicInterface/CMakeLists.txt70
-rw-r--r--Tests/QtAutoUicInterface/klocalizedstring.cpp12
-rw-r--r--Tests/QtAutoUicInterface/klocalizedstring.h17
-rw-r--r--Tests/QtAutoUicInterface/libwidget.cpp9
-rw-r--r--Tests/QtAutoUicInterface/libwidget.h24
-rw-r--r--Tests/QtAutoUicInterface/libwidget.ui32
-rw-r--r--Tests/QtAutoUicInterface/main.cpp75
-rw-r--r--Tests/QtAutoUicInterface/mywidget.cpp9
-rw-r--r--Tests/QtAutoUicInterface/mywidget.h24
-rw-r--r--Tests/QtAutoUicInterface/mywidget.ui32
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt20
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-NEW.cmake12
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-OLD.cmake12
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt32
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-WARN.cmake10
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt22
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake11
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake11
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt34
-rw-r--r--Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake9
-rw-r--r--Tests/RunCMake/CMP0041/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0041/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/CMP0041/empty.cpp7
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/include_directories/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN-stderr.txt1
-rw-r--r--Tests/RunCMake/include_directories/export-NOWARN.cmake62
123 files changed, 2301 insertions, 160 deletions
diff --git a/Help/command/FIND_XXX_ROOT.txt b/Help/command/FIND_XXX_ROOT.txt
index efc076f..b5cab68 100644
--- a/Help/command/FIND_XXX_ROOT.txt
+++ b/Help/command/FIND_XXX_ROOT.txt
@@ -1,9 +1,9 @@
-The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
+The CMake variable :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.
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.
+By default the :variable:`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
@@ -12,12 +12,12 @@ effects. See the documentation for that variable for more.
These variables are especially useful when cross-compiling to
point to the root directory of the target environment and CMake will
search there too. By default at first the directories listed in
-CMAKE_FIND_ROOT_PATH are searched, then the :variable:`CMAKE_SYSROOT` directory is
-searched, and then the non-rooted directories will be
+:variable:`CMAKE_FIND_ROOT_PATH` are searched, then the :variable:`CMAKE_SYSROOT`
+directory is searched, and then the non-rooted directories will be
searched. The default behavior can be adjusted by setting
|CMAKE_FIND_ROOT_PATH_MODE_XXX|. This behavior can be manually
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
+NO_CMAKE_FIND_ROOT_PATH is used then :variable:`CMAKE_FIND_ROOT_PATH` will not be
used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
directories and directories below :variable:`CMAKE_STAGING_PREFIX` will be searched.
diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst
index 549b317..db7e151 100644
--- a/Help/command/find_file.rst
+++ b/Help/command/find_file.rst
@@ -22,6 +22,6 @@ find_file
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
- CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
+ :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
.. include:: FIND_XXX.txt
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst
index 8598be7..91342ba 100644
--- a/Help/command/find_library.rst
+++ b/Help/command/find_library.rst
@@ -22,7 +22,7 @@ find_library
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
- CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
+ :variable:`CMAKE_FIND_ROOT_PATH_MODE_LIBRARY`
.. include:: FIND_XXX.txt
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index c394a08..f09cb41 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -320,7 +320,7 @@ hard-coded guesses.
.. |FIND_XXX| replace:: find_package
.. |FIND_ARGS_XXX| replace:: <package>
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
- CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
+ :variable:`CMAKE_FIND_ROOT_PATH_MODE_PACKAGE`
.. include:: FIND_XXX_MAC.txt
.. include:: FIND_XXX_ROOT.txt
diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst
index c85011a..95d49e7 100644
--- a/Help/command/find_path.rst
+++ b/Help/command/find_path.rst
@@ -22,7 +22,7 @@ find_path
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
- CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
+ :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
.. include:: FIND_XXX.txt
diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst
index da5a41d..c62a8a5 100644
--- a/Help/command/find_program.rst
+++ b/Help/command/find_program.rst
@@ -20,6 +20,6 @@ find_program
.. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_APPBUNDLE_PATH
.. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
- CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
+ :variable:`CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`
.. include:: FIND_XXX.txt
diff --git a/Help/generator/Kate.rst b/Help/generator/Kate.rst
new file mode 100644
index 0000000..9b61a93
--- /dev/null
+++ b/Help/generator/Kate.rst
@@ -0,0 +1,26 @@
+Kate
+----
+
+Generates Kate project files.
+
+A project file for Kate will be created in the top directory in the top level
+build directory.
+To use it in kate, the Project plugin must be enabled.
+The project file is loaded in kate simply by opening the
+ProjectName.kateproject file in the editor.
+If the kate Build-plugin is enabled, all targets generated by CMake are
+available for building.
+
+This "extra" generator may be specified as:
+
+``Kate - MinGW Makefiles``
+ Generate with :generator:`MinGW Makefiles`.
+
+``Kate - NMake Makefiles``
+ Generate with :generator:`NMake Makefiles`.
+
+``Kate - Ninja``
+ Generate with :generator:`Ninja`.
+
+``Kate - Unix Makefiles``
+ Generate with :generator:`Unix Makefiles`.
diff --git a/Help/index.rst b/Help/index.rst
index 0d33825..4ef5c3f 100644
--- a/Help/index.rst
+++ b/Help/index.rst
@@ -27,6 +27,7 @@ Reference Manuals
/manual/cmake-commands.7
/manual/cmake-generators.7
+ /manual/cmake-toolchains.7
/manual/cmake-modules.7
/manual/cmake-policies.7
/manual/cmake-properties.7
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index bd9e7c2..ed28abd 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -178,3 +178,9 @@ property is non-empty::
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.
+``$<LOWER_CASE:...>``
+ Content of ``...`` converted to lower case.
+``$<UPPER_CASE:...>``
+ Content of ``...`` converted to upper case.
+``$<MAKE_C_IDENTIFIER:...>``
+ Content of ``...`` converted to a C identifier.
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 93fbf77..b72c7ef 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -81,4 +81,5 @@ The following extra generators are known to CMake.
/generator/CodeBlocks
/generator/Eclipse CDT4
/generator/KDevelop3
+ /generator/Kate
/generator/Sublime Text 2
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index e954a86..5e94f89 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -74,3 +74,4 @@ All Policies
/policy/CMP0038
/policy/CMP0039
/policy/CMP0040
+ /policy/CMP0041
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 2097062..d569e31 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -141,6 +141,7 @@ Properties on Targets
/prop_tgt/INSTALL_NAME_DIR
/prop_tgt/INSTALL_RPATH
/prop_tgt/INSTALL_RPATH_USE_LINK_PATH
+ /prop_tgt/INTERFACE_AUTOUIC_OPTIONS
/prop_tgt/INTERFACE_COMPILE_DEFINITIONS
/prop_tgt/INTERFACE_COMPILE_OPTIONS
/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
new file mode 100644
index 0000000..fbe546e
--- /dev/null
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -0,0 +1,160 @@
+.. cmake-manual-description: CMake Toolchains Reference
+
+cmake-toolchains(7)
+*******************
+
+.. only:: html or latex
+
+ .. contents::
+
+Introduction
+============
+
+CMake uses a toolchain of utilities to compile, link libraries and create
+archives, and other tasks to drive the build. The toolchain utilities available
+are determined by the languages enabled. In normal builds, CMake automatically
+determines the toolchain for host builds based on system introspection and
+defaults. In cross-compiling scenarios, a toolchain file may be specified
+with information about compiler and utility paths.
+
+Languages
+=========
+
+Languages are enabled by the :command:`project` command. If no project command
+is in the top-level CMakeLists file, one will be implicitly generated. By default
+the enabled languages are C and CXX::
+
+ project(C_Only C)
+
+A special value of NONE can also be used with the :command:`project` command
+to enable no languages::
+
+ project(MyProject NONE)
+
+The :command:`enable_language` command can be used to enable languages after the
+:command:`project` command::
+
+ enable_language(CXX)
+
+When a language is enabled, CMake finds a compiler for that language, and
+determines some information, such as the vendor and version of the compiler,
+the target architecture and bitwidth, the location of corresponding utilities
+etc.
+
+The :prop_gbl:`ENABLED_LANGUAGES` global property contains the languages which
+are currently enabled.
+
+Variables and Properties
+========================
+
+Several variables relate to the language components of a toolchain which are
+enabled. :variable:`CMAKE_<LANG>_COMPILER` is the full path to the compiler used
+for ``<LANG>``. :variable:`CMAKE_<LANG>_COMPILER_ID` is the identifier used
+by CMake for the compiler and :variable:`CMAKE_<LANG>_COMPILER_VERSION` is the
+version of the compiler.
+
+The :variable:`CMAKE_<LANG>_FLAGS` variables and the configuration-specific
+equivalents contain flags that will be added to the compile command when
+compiling a file of a particular language.
+
+As the linker is invoked by the compiler driver, CMake needs a way to determine
+which compiler to use to invoke the linker. This is calculated by the
+:prop_sf:`LANGUAGE` of source files in the target, and in the case of static
+libraries, the language of the dependent libraries. The choice CMake makes may
+be overridden with the :prop_tgt:`LINKER_LANGUAGE` target property.
+
+Toolchain Features
+==================
+
+CMake provides the :command:`try_compile` command and wrapper macros such as
+:module:`CheckCXXSourceCompiles`, :module:`CheckCXXSymbolExists` and
+:module:`CheckIncludeFile` to test capability and availability of various
+toolchain features. These APIs test the toolchain in some way and cache the
+result so that the test does not have to be performed again the next time
+CMake runs.
+
+Some toolchain features have built-in handling in CMake, and do not require
+compile-tests. For example, :prop_tgt:`POSITION_INDEPENDENT_CODE` allows
+specifying that a target should be built as position-independent code, if
+the compiler supports that feature. The :prop_tgt:`<LANG>_VISIBILITY_PRESET`
+and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` target properties add flags for
+hidden visibility, if supported by the compiler.
+
+Cross Compiling
+===============
+
+If :manual:`cmake(1)` is invoked with the command line parameter
+``-DCMAKE_TOOLCHAIN_FILE=path/to/file``, the file will be loaded early to set
+values for the compilers. A typical cross-compiling toolchain has content such
+as::
+
+ set(CMAKE_SYSTEM_NAME Linux)
+
+ set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs)
+ set(CMAKE_STAGING_PREFIX /home/devel/stage)
+
+ set(CMAKE_C_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc)
+ set(CMAKE_CXX_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++)
+
+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+
+The :variable:`CMAKE_SYSTEM_NAME` is the CMake-identifier of the target platform
+to build for.
+
+The :variable:`CMAKE_SYSROOT` is optional, and may be specified if a sysroot
+is available.
+
+The :variable:`CMAKE_STAGING_PREFIX` is also optional. It may be used to specify
+a path on the host to install to. The :variable:`CMAKE_INSTALL_PREFIX` is always
+the runtime installation location, even when cross-compiling.
+
+The :variable:`CMAKE_<LANG>_COMPILER` variables may be set to full paths, or to
+names of compilers to search for in standard locations. In cases where CMake does
+not have enough information to extract information from the compiler, the
+:module:`CMakeForceCompiler` module can be used to bypass some of the checks.
+
+CMake ``find_*`` commands will look in the sysroot, and the :variable:`CMAKE_FIND_ROOT_PATH`
+entries by default in all cases, as well as looking in the host system root prefix.
+Although this can be controlled on a case-by-case basis, when cross-compiling, it
+can be useful to exclude looking in either the host or the target for particular
+artifacts. Generally, includes, libraries and packages should be found in the
+target system prefixes, whereas executables which must be run as part of the build
+should be found only on the host and not on the target. This is the purpose of
+the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables.
+
+Some compilers are inherently cross compilers, such as Clang and the QNX QCC
+compiler. The :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a
+value to those supported compilers when compiling::
+
+ set(CMAKE_SYSTEM_NAME Linux)
+
+ set(triple arm-linux-gnueabihf)
+
+ set(CMAKE_C_COMPILER clang)
+ set(CMAKE_C_COMPILER_TARGET ${triple})
+ set(CMAKE_CXX_COMPILER clang++)
+ set(CMAKE_CXX_COMPILER_TARGET ${triple})
+
+Or, for QCC::
+
+ set(CMAKE_SYSTEM_NAME QNX)
+
+ set(arch gcc_ntoarmv7le)
+
+ set(CMAKE_C_COMPILER qcc)
+ set(CMAKE_C_COMPILER_TARGET ${arch})
+ set(CMAKE_CXX_COMPILER QCC)
+ set(CMAKE_CXX_COMPILER_TARGET ${arch})
+
+
+Similarly, some compilers do not ship their own supplementary utilities
+such as linkers, but provide a way to specify the location of the external
+toolchain which will be used by the compiler driver. The
+:variable:`CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN` variable can be set in a
+toolchain file to pass the path to the compiler driver.
+
+The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is
+cross-compiling.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 4e24823..6756bb9 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -64,6 +64,7 @@ Variables that Provide Information
/variable/CMAKE_STANDARD_LIBRARIES
/variable/CMAKE_STATIC_LIBRARY_PREFIX
/variable/CMAKE_STATIC_LIBRARY_SUFFIX
+ /variable/CMAKE_TOOLCHAIN_FILE
/variable/CMAKE_TWEAK_VERSION
/variable/CMAKE_VERBOSE_MAKEFILE
/variable/CMAKE_VERSION
@@ -96,8 +97,13 @@ Variables that Change Behavior
/variable/CMAKE_SYSROOT
/variable/CMAKE_FIND_LIBRARY_PREFIXES
/variable/CMAKE_FIND_LIBRARY_SUFFIXES
- /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
/variable/CMAKE_FIND_NO_INSTALL_PREFIX
+ /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
+ /variable/CMAKE_FIND_ROOT_PATH
+ /variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
+ /variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
+ /variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
+ /variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
/variable/CMAKE_IGNORE_PATH
/variable/CMAKE_INCLUDE_PATH
/variable/CMAKE_INCLUDE_DIRECTORIES_BEFORE
@@ -204,6 +210,7 @@ Variables that Control the Build
/variable/CMAKE_NO_BUILTIN_CHRPATH
/variable/CMAKE_NO_SYSTEM_FROM_IMPORTED
/variable/CMAKE_PDB_OUTPUT_DIRECTORY
+ /variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_POSITION_INDEPENDENT_CODE
/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY
/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG
diff --git a/Help/policy/CMP0041.rst b/Help/policy/CMP0041.rst
new file mode 100644
index 0000000..acb85af
--- /dev/null
+++ b/Help/policy/CMP0041.rst
@@ -0,0 +1,25 @@
+CMP0041
+-------
+
+Error on relative include with generator expression.
+
+Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
+:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of a target if it contained a generator
+expression at any position.
+
+The path entries in that target property should not be relative. High-level
+API should ensure that by adding either a source directory or a install
+directory prefix, as appropriate.
+
+As an additional diagnostic, the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` generated
+on an :prop_tgt:`IMPORTED` target for the install location should not contain
+paths in the source directory or the build directory.
+
+The OLD behavior for this policy is to ignore relative path entries if they
+contain a generator expression. The NEW behavior for this policy is to report
+an error if a generator expression appears in another location and the path is
+relative.
+
+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/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
index c6cf885..aeec38b 100644
--- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -15,3 +15,7 @@ This property is initialized by the value of the variable
The options set on the target may be overridden by :prop_sf:`AUTOUIC_OPTIONS` set
on the .ui source file.
+
+This property may use "generator expressions" with the syntax "$<...>".
+See the :manual:`cmake-generator-expressions(7)` manual for available
+expressions.
diff --git a/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst
new file mode 100644
index 0000000..e97d293
--- /dev/null
+++ b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst
@@ -0,0 +1,14 @@
+INTERFACE_AUTOUIC_OPTIONS
+-------------------------
+
+List of interface options to pass to uic.
+
+Targets may populate this property to publish the options
+required to use when invoking ``uic``. Consuming targets can add entries to their
+own :prop_tgt:`AUTOUIC_OPTIONS` property such as
+``$<TARGET_PROPERTY:foo,INTERFACE_AUTOUIC_OPTIONS>`` to use the uic options
+specified in the interface of ``foo``. This is done automatically by
+the :command:`target_link_libraries` command.
+
+This property supports generator expressions. See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
diff --git a/Help/prop_tgt/PDB_NAME.rst b/Help/prop_tgt/PDB_NAME.rst
index fe059e0..e8fc3be 100644
--- a/Help/prop_tgt/PDB_NAME.rst
+++ b/Help/prop_tgt/PDB_NAME.rst
@@ -1,10 +1,13 @@
PDB_NAME
--------
-Output name for MS debug symbols .pdb file from linker.
+Output name for the MS debug symbol ``.pdb`` file generated by the
+linker for an executable or shared library target.
-Set the base name for debug symbols file created for an executable or
-shared library target. If not set, the logical target name is used by
-default.
+This property specifies the base name for the debug symbols file.
+If not set, the logical target name is used by default.
-This property is not implemented by the Visual Studio 6 generator.
+.. include:: PDB_NOTE.txt
+
+This property is not implemented by the :generator:`Visual Studio 6`
+generator.
diff --git a/Help/prop_tgt/PDB_NAME_CONFIG.rst b/Help/prop_tgt/PDB_NAME_CONFIG.rst
index 50c3aa2..c846b57 100644
--- a/Help/prop_tgt/PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/PDB_NAME_CONFIG.rst
@@ -1,8 +1,10 @@
PDB_NAME_<CONFIG>
-----------------
-Per-configuration name for MS debug symbols .pdb file.
+Per-configuration output name for the MS debug symbol ``.pdb`` file
+generated by the linker for an executable or shared library target.
-This is the configuration-specific version of PDB_NAME.
+This is the configuration-specific version of :prop_tgt:`PDB_NAME`.
-This property is not implemented by the Visual Studio 6 generator.
+This property is not implemented by the :generator:`Visual Studio 6`
+generator.
diff --git a/Help/prop_tgt/PDB_NOTE.txt b/Help/prop_tgt/PDB_NOTE.txt
new file mode 100644
index 0000000..e55aba2
--- /dev/null
+++ b/Help/prop_tgt/PDB_NOTE.txt
@@ -0,0 +1,8 @@
+.. note::
+ This property does not apply to STATIC library targets because no linker
+ is invoked to produce them so they have no linker-generated ``.pdb`` file
+ containing debug symbols.
+
+ The compiler-generated program database files specified by the MSVC
+ ``/Fd`` flag are not the same as linker-generated program database
+ files and so are not influenced by this property.
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
index d973e90d..9a863a1 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
@@ -1,11 +1,15 @@
PDB_OUTPUT_DIRECTORY
--------------------
-Output directory for MS debug symbols .pdb file from linker.
+Output directory for the MS debug symbols ``.pdb`` file
+generated by the linker for an executable or shared library target.
This property specifies the directory into which the MS debug symbols
will be placed by the linker. This property is initialized by the
-value of the variable CMAKE_PDB_OUTPUT_DIRECTORY if it is set when a
-target is created.
+value of the :variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
+set when a target is created.
-This property is not implemented by the Visual Studio 6 generator.
+.. include:: PDB_NOTE.txt
+
+This property is not implemented by the :generator:`Visual Studio 6`
+generator.
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
index 25ab944..caec2de 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,13 +1,15 @@
PDB_OUTPUT_DIRECTORY_<CONFIG>
-----------------------------
-Per-configuration output directory for MS debug symbols .pdb files.
+Per-configuration output directory for the MS debug symbol ``.pdb`` file
+generated by the linker for an executable or shared library target.
-This is a per-configuration version of PDB_OUTPUT_DIRECTORY, but
-multi-configuration generators (VS, Xcode) do NOT append a
+This is a per-configuration version of :prop_tgt:`PDB_OUTPUT_DIRECTORY`,
+but multi-configuration generators (VS, Xcode) do NOT append a
per-configuration subdirectory to the specified directory. This
-property is initialized by the value of the variable
-CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is
-created.
+property is initialized by the value of the
+:variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is
+set when a target is created.
-This property is not implemented by the Visual Studio 6 generator.
+This property is not implemented by the :generator:`Visual Studio 6`
+generator.
diff --git a/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst b/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
index 2ded823..6b17f6e 100644
--- a/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
+++ b/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
@@ -6,6 +6,6 @@ Enables tracing output for target properties.
This variable can be populated with a list of properties to generate
debug output for when evaluating target properties. Currently it can
only be used when evaluating the INCLUDE_DIRECTORIES,
-COMPILE_DEFINITIONS and COMPILE_OPTIONS target properties. In that
-case, it outputs a backtrace for each entry in the target property.
+COMPILE_DEFINITIONS, COMPILE_OPTIONS and AUTOUIC_OPTIONS target properties.
+In that case, it outputs a backtrace for each entry in the target property.
Default is unset.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
new file mode 100644
index 0000000..67948f7
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
@@ -0,0 +1,8 @@
+CMAKE_FIND_ROOT_PATH
+--------------------
+
+List of root paths to search on the filesystem.
+
+This variable is most useful when cross-compiling. CMake uses the paths in
+this list as alternative roots to find filesystem items with :command:`find_package`,
+:command:`find_library` etc.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst
new file mode 100644
index 0000000..df1af5a
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst
@@ -0,0 +1,6 @@
+CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
+---------------------------------
+
+.. |FIND_XXX| replace:: :command:`find_file` and :command:`find_path`
+
+.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst
new file mode 100644
index 0000000..52ab89d
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst
@@ -0,0 +1,6 @@
+CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
+---------------------------------
+
+.. |FIND_XXX| replace:: :command:`find_library`
+
+.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst
new file mode 100644
index 0000000..3872947
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst
@@ -0,0 +1,6 @@
+CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
+---------------------------------
+
+.. |FIND_XXX| replace:: :command:`find_package`
+
+.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst
new file mode 100644
index 0000000..d24a78a
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst
@@ -0,0 +1,6 @@
+CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
+---------------------------------
+
+.. |FIND_XXX| replace:: :command:`find_program`
+
+.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
new file mode 100644
index 0000000..ab65e09
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
@@ -0,0 +1,8 @@
+This variable controls whether the :variable:`CMAKE_FIND_ROOT_PATH` and
+:variable:`CMAKE_SYSROOT` are used by |FIND_XXX|.
+
+If set to ``ONLY``, then only the roots in :variable:`CMAKE_FIND_ROOT_PATH`
+will be searched. If set to ``NEVER``, then the roots in
+:variable:`CMAKE_FIND_ROOT_PATH` will be ignored and only the host system
+root will be used. If set to ``BOTH``, then the host system paths and the
+paths in :variable:`CMAKE_FIND_ROOT_PATH` will be searched.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN.rst b/Help/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN.rst
index 86c0b0e..033998d 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN.rst
@@ -10,4 +10,4 @@ may be set to a path to a path to the external toolchain and will be passed
to the compiler driver if supported.
This variable may only be set in a toolchain file specified by
-the ``CMAKE_TOOLCHAIN_FILE`` variable.
+the :variable:`CMAKE_TOOLCHAIN_FILE` variable.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_TARGET.rst b/Help/variable/CMAKE_LANG_COMPILER_TARGET.rst
index 7c8efee..656c57d 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_TARGET.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_TARGET.rst
@@ -8,4 +8,4 @@ QNX qcc. These compiler drivers support a command-line argument to specify
the target to cross-compile for.
This variable may only be set in a toolchain file specified by
-the ``CMAKE_TOOLCHAIN_FILE`` variable.
+the :variable:`CMAKE_TOOLCHAIN_FILE` variable.
diff --git a/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY.rst b/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY.rst
index 938d159..763bcb3 100644
--- a/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY.rst
@@ -1,8 +1,9 @@
CMAKE_PDB_OUTPUT_DIRECTORY
--------------------------
-Where to put all the MS debug symbol files from linker.
+Output directory for MS debug symbol ``.pdb`` files generated by the
+linker for executable and shared library targets.
-This variable is used to initialize the PDB_OUTPUT_DIRECTORY property
-on all the targets. See that target property for additional
+This variable is used to initialize the :prop_tgt:`PDB_OUTPUT_DIRECTORY`
+property on all the targets. See that target property for additional
information.
diff --git a/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
new file mode 100644
index 0000000..4d18eec
--- /dev/null
+++ b/Help/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -0,0 +1,11 @@
+CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>
+-----------------------------------
+
+Per-configuration output directory for MS debug symbol ``.pdb`` files
+generated by the linker for executable and shared library targets.
+
+This is a per-configuration version of :variable:`CMAKE_PDB_OUTPUT_DIRECTORY`.
+This variable is used to initialize the
+:prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`
+property on all the targets. See that target property for additional
+information.
diff --git a/Help/variable/CMAKE_SYSROOT.rst b/Help/variable/CMAKE_SYSROOT.rst
index e42e63a..7aa0450 100644
--- a/Help/variable/CMAKE_SYSROOT.rst
+++ b/Help/variable/CMAKE_SYSROOT.rst
@@ -9,4 +9,4 @@ necessary on installation. The ``CMAKE_SYSROOT`` is also used to prefix
paths searched by the ``find_*`` commands.
This variable may only be set in a toolchain file specified by
-the ``CMAKE_TOOLCHAIN_FILE`` variable.
+the :variable:`CMAKE_TOOLCHAIN_FILE` variable.
diff --git a/Help/variable/CMAKE_TOOLCHAIN_FILE.rst b/Help/variable/CMAKE_TOOLCHAIN_FILE.rst
new file mode 100644
index 0000000..e1a65e1
--- /dev/null
+++ b/Help/variable/CMAKE_TOOLCHAIN_FILE.rst
@@ -0,0 +1,9 @@
+CMAKE_TOOLCHAIN_FILE
+--------------------
+
+Path to toolchain file supplied to :manual:`cmake(1)`.
+
+This variable is specified on the command line when cross-compiling with CMake.
+It is the path to a file which is read early in the CMake run and which specifies
+locations for compilers and toolchain utilities, and other target platform and
+compiler related information.
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 0f5b694..e0cce45 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -119,16 +119,16 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Flags used by the compiler during release minsize builds.")
+ "Flags used by the compiler during release builds for minimum size.")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
- "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
+ "Flags used by the compiler during release builds.")
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Flags used by the compiler during Release with Debug Info builds.")
+ "Flags used by the compiler during release builds with debug info.")
endif()
if(CMAKE_C_STANDARD_LIBRARIES_INIT)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
- CACHE STRING "Libraries linked by defalut with all C applications.")
+ CACHE STRING "Libraries linked by default with all C applications.")
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
endif()
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 9cf3489..3010a48 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -209,17 +209,17 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Flags used by the compiler during release minsize builds.")
+ "Flags used by the compiler during release builds for minimum size.")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
- "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
+ "Flags used by the compiler during release builds.")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Flags used by the compiler during Release with Debug Info builds.")
+ "Flags used by the compiler during release builds with debug info.")
endif()
if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
- CACHE STRING "Libraries linked by defalut with all C++ applications.")
+ CACHE STRING "Libraries linked by default with all C++ applications.")
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
endif()
diff --git a/Modules/CMakeFindKate.cmake b/Modules/CMakeFindKate.cmake
new file mode 100644
index 0000000..4dcdb28
--- /dev/null
+++ b/Modules/CMakeFindKate.cmake
@@ -0,0 +1,31 @@
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This file is included in CMakeSystemSpecificInformation.cmake if
+# the Eclipse CDT4 extra generator has been selected.
+
+
+# Try to find out how many CPUs we have and set the -j argument for make accordingly
+
+include(ProcessorCount)
+processorcount(_CMAKE_KATE_PROCESSOR_COUNT)
+
+# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
+# (we may also get here in the future e.g. for ninja)
+if("${_CMAKE_KATE_PROCESSOR_COUNT}" GREATER 1 AND CMAKE_HOST_UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
+ set(_CMAKE_KATE_INITIAL_MAKE_ARGS "-j${_CMAKE_KATE_PROCESSOR_COUNT}")
+endif()
+
+# This variable is used by the Eclipse generator and appended to the make invocation commands.
+set(CMAKE_KATE_MAKE_ARGUMENTS "${_CMAKE_KATE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Kate invokes make. Enter e.g. -j<some_number> to get parallel builds")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index debfd46..080dc68 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -218,7 +218,7 @@ endif()
if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
- CACHE STRING "Libraries linked by defalut with all Fortran applications.")
+ CACHE STRING "Libraries linked by default with all Fortran applications.")
mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
endif()
@@ -226,11 +226,11 @@ if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.")
set (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Flags used by the compiler during release minsize builds.")
+ "Flags used by the compiler during release builds for minimum size.")
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
- "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
+ "Flags used by the compiler during release builds.")
set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Flags used by the compiler during Release with Debug Info builds.")
+ "Flags used by the compiler during release builds with debug info.")
endif()
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 3f0978d..237c5bc 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -63,6 +63,14 @@
#
# If set, this icon is used in place of the default icon.
#
+# .. variable:: CPACK_WIX_UI_REF
+#
+# This variable allows you to override the Id of the ``<UIRef>`` element
+# in the WiX template.
+#
+# The default is ``WixUI_InstallDir`` in case no CPack components have
+# been defined and ``WixUI_FeatureTree`` otherwise.
+#
# .. variable:: CPACK_WIX_UI_BANNER
#
# The bitmap will appear at the top of all installer pages other than the
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index 2fab247..c79119f 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -46,9 +46,31 @@ if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
if(CTEST_USE_LAUNCHERS)
- set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
+ set(__launch_common_options
+ "--target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR>")
+
+ set(__launch_compile_options
+ "${__launch_common_options} --output <OBJECT> --source <SOURCE> --language <LANGUAGE>")
+
+ set(__launch_link_options
+ "${__launch_common_options} --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE>")
+
+ set(__launch_custom_options
+ "${__launch_common_options} --output <OUTPUT>")
+
+ if("${CMAKE_GENERATOR}" MATCHES "Ninja")
+ set(__launch_compile_options "${__launch_compile_options} --filter-prefix <CMAKE_CL_SHOWINCLUDES_PREFIX>")
+ endif()
+
+ set(CTEST_LAUNCH_COMPILE
+ "\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_compile_options} --")
+
+ set(CTEST_LAUNCH_LINK
+ "\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_link_options} --")
+
+ set(CTEST_LAUNCH_CUSTOM
+ "\"${CMAKE_CTEST_COMMAND}\" --launch ${__launch_custom_options} --")
+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 55f4c0d..8bd4048 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -52,8 +52,6 @@ if(SWIG_EXECUTABLE)
endif()
else()
string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
- # force the path to be computed each time in case SWIG_EXECUTABLE has changed.
- set(SWIG_DIR SWIG_DIR-NOTFOUND)
find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output} NO_CMAKE_FIND_ROOT_PATH)
if(SWIG_DIR)
set(SWIG_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseSWIG.cmake)
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index f3ec441..fc3f87e 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -341,7 +341,9 @@ foreach(_path
list(APPEND _apps_paths "${_apps}")
endif()
endforeach()
-list(REMOVE_DUPLICATES _apps_paths)
+if(_apps_paths)
+ list(REMOVE_DUPLICATES _apps_paths)
+endif()
set(CMAKE_SYSTEM_APPBUNDLE_PATH
${_apps_paths})
unset(_apps_paths)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 22ee776..0fe0b32 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -182,6 +182,20 @@ function(ProcessorCount var)
endif()
endif()
+ if(NOT count)
+ # Haiku
+ find_program(ProcessorCount_cmd_sysinfo sysinfo)
+ if(ProcessorCount_cmd_sysinfo)
+ execute_process(COMMAND ${ProcessorCount_cmd_sysinfo}
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE sysinfo_X_output)
+ string(REGEX MATCHALL "\nCPU #[0-9]+:" procs "\n${sysinfo_X_output}")
+ list(LENGTH procs count)
+ #message("ProcessorCount: trying sysinfo '${ProcessorCount_cmd_sysinfo}'")
+ endif()
+ endif()
+
# Since cygwin builds of CMake do not define WIN32 anymore, but they still
# run on Windows, and will still have this env var defined:
#
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 28d5ff0..67cab4a 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -59,12 +59,15 @@ macro(SWIG_MODULE_INITIALIZE name language)
set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
set(SWIG_MODULE_${name}_REAL_NAME "${name}")
+ if (CMAKE_SWIG_FLAGS MATCHES "-noproxy")
+ set (SWIG_MODULE_${name}_NOPROXY TRUE)
+ endif ()
if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
- # when swig is used without the -interface it will produce in the module.py
- # a 'import _modulename' statement, which implies having a corresponding
- # _modulename.so (*NIX), _modulename.pyd (Win32).
+ elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
+ # swig will produce a module.py containing an 'import _modulename' statement,
+ # which implies having a corresponding _modulename.so (*NIX), _modulename.pyd (Win32),
+ # unless the -noproxy flag is used
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
@@ -200,7 +203,10 @@ macro(SWIG_ADD_MODULE name language)
${swig_generated_sources}
${swig_other_sources})
string(TOLOWER "${language}" swig_lowercase_language)
- if ("${swig_lowercase_language}" STREQUAL "java")
+ if ("${swig_lowercase_language}" STREQUAL "octave")
+ set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
+ set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".oct")
+ elseif ("${swig_lowercase_language}" STREQUAL "java")
if (APPLE)
# In java you want:
# System.loadLibrary("LIBRARY");
@@ -210,8 +216,7 @@ macro(SWIG_ADD_MODULE name language)
# Linux : libLIBRARY.so
set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
endif ()
- endif ()
- if ("${swig_lowercase_language}" STREQUAL "python")
+ elseif ("${swig_lowercase_language}" STREQUAL "python")
# this is only needed for the python case where a _modulename.so is generated
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
# Python extension modules on Windows must have the extension ".pyd"
@@ -225,6 +230,17 @@ macro(SWIG_ADD_MODULE name language)
if(WIN32 AND NOT CYGWIN)
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
endif()
+ elseif ("${swig_lowercase_language}" STREQUAL "ruby")
+ # In ruby you want:
+ # require 'LIBRARY'
+ # then ruby will look for a library whose name is platform dependent, namely
+ # MacOS : LIBRARY.bundle
+ # Windows: LIBRARY.dll
+ # Linux : LIBRARY.so
+ set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
+ if (APPLE)
+ set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle")
+ endif ()
endif ()
endmacro()
diff --git a/Modules/WIX.template.in b/Modules/WIX.template.in
index 0bc7e10..59a75c7 100644
--- a/Modules/WIX.template.in
+++ b/Modules/WIX.template.in
@@ -39,6 +39,6 @@
<FeatureRef Id="ProductFeature"/>
- <UIRef Id="WixUI_InstallDir" />
+ <UIRef Id="$(var.CPACK_WIX_UI_REF)" />
</Product>
</Wix>
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 570b7e2..17fb52d 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -188,6 +188,8 @@ set(SRCS
cmExtraCodeBlocksGenerator.h
cmExtraEclipseCDT4Generator.cxx
cmExtraEclipseCDT4Generator.h
+ cmExtraKateGenerator.cxx
+ cmExtraKateGenerator.h
cmExtraSublimeTextGenerator.cxx
cmExtraSublimeTextGenerator.h
cmFileTimeComparison.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3523925..aecd074 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 20131202)
+set(CMake_VERSION_TWEAK 20131204)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 1d7681b..91701c2 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -198,6 +198,18 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
<< std::endl);
}
+ if(GetOption("CPACK_WIX_UI_REF") == 0)
+ {
+ std::string defaultRef = "WixUI_InstallDir";
+
+ if(Components.size())
+ {
+ defaultRef = "WixUI_FeatureTree";
+ }
+
+ SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
+ }
+
CollectExtensions("CPACK_WIX_EXTENSIONS", candleExtensions);
CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", candleExtensions);
@@ -296,6 +308,7 @@ bool cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER",
GetOption("CPACK_PACKAGE_NAME"));
CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
+ CopyDefinition(includeFile, "CPACK_WIX_UI_REF");
return true;
}
@@ -401,40 +414,77 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
featureDefinitions.BeginElement("Feature");
featureDefinitions.AddAttribute("Id", "ProductFeature");
- featureDefinitions.AddAttribute("Title", Name);
+ featureDefinitions.AddAttribute("Display", "expand");
+ featureDefinitions.AddAttribute("ConfigurableDirectory", "INSTALL_ROOT");
+
+ std::string cpackPackageName;
+ if(!RequireOption("CPACK_PACKAGE_NAME", cpackPackageName))
+ {
+ return false;
+ }
+ featureDefinitions.AddAttribute("Title", cpackPackageName);
+
featureDefinitions.AddAttribute("Level", "1");
+
+ CreateFeatureHierarchy(featureDefinitions);
+
featureDefinitions.EndElement("Feature");
- featureDefinitions.BeginElement("FeatureRef");
- featureDefinitions.AddAttribute("Id", "ProductFeature");
+ bool hasShortcuts = false;
- std::vector<std::string> cpackPackageExecutablesList;
- const char *cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
- if(cpackPackageExecutables)
+ shortcut_map_t globalShortcuts;
+ if(Components.empty())
{
- cmSystemTools::ExpandListArgument(cpackPackageExecutables,
- cpackPackageExecutablesList);
- if(cpackPackageExecutablesList.size() % 2 != 0 )
+ AddComponentsToFeature(toplevel, "ProductFeature",
+ directoryDefinitions, fileDefinitions, featureDefinitions,
+ globalShortcuts);
+ if(globalShortcuts.size())
+ {
+ hasShortcuts = true;
+ }
+ }
+ else
+ {
+ for(std::map<std::string, cmCPackComponent>::const_iterator
+ i = Components.begin(); i != Components.end(); ++i)
+ {
+ cmCPackComponent const& component = i->second;
+
+ std::string componentPath = toplevel;
+ componentPath += "/";
+ componentPath += component.Name;
+
+ std::string componentFeatureId = "CM_C_" + component.Name;
+
+ shortcut_map_t featureShortcuts;
+ AddComponentsToFeature(componentPath, componentFeatureId,
+ directoryDefinitions, fileDefinitions,
+ featureDefinitions, featureShortcuts);
+ if(featureShortcuts.size())
{
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and "
- "<text label>." << std::endl);
- return false;
+ hasShortcuts = true;
}
- }
- AddDirectoryAndFileDefinitons(
- toplevel, "INSTALL_ROOT",
- directoryDefinitions, fileDefinitions, featureDefinitions,
- cpackPackageExecutablesList);
+ if(featureShortcuts.size())
+ {
+ if(!CreateStartMenuShortcuts(component.Name, componentFeatureId,
+ featureShortcuts, fileDefinitions, featureDefinitions))
+ {
+ return false;
+ }
+ }
+ }
+ }
- if(!CreateStartMenuShortcuts(
- directoryDefinitions, fileDefinitions, featureDefinitions))
+ if(hasShortcuts)
{
+ if(!CreateStartMenuShortcuts(std::string(), "ProductFeature",
+ globalShortcuts, fileDefinitions, featureDefinitions))
+ {
return false;
+ }
}
- featureDefinitions.EndElement("FeatureRef");
featureDefinitions.EndElement("Fragment");
fileDefinitions.EndElement("Fragment");
@@ -444,6 +494,12 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
}
directoryDefinitions.EndElement("Directory");
+
+ if(hasShortcuts)
+ {
+ CreateStartMenuFolder(directoryDefinitions);
+ }
+
directoryDefinitions.EndElement("Directory");
directoryDefinitions.EndElement("Fragment");
@@ -475,16 +531,154 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
return true;
}
-bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
+bool cmCPackWIXGenerator::CreateFeatureHierarchy(
+ cmWIXSourceWriter& featureDefinitions)
+{
+ for(std::map<std::string, cmCPackComponentGroup>::const_iterator
+ i = ComponentGroups.begin(); i != ComponentGroups.end(); ++i)
+ {
+ cmCPackComponentGroup const& group = i->second;
+ if(group.ParentGroup == 0)
+ {
+ if(!EmitFeatureForComponentGroup(featureDefinitions, group))
+ {
+ return false;
+ }
+ }
+ }
+
+ for(std::map<std::string, cmCPackComponent>::const_iterator
+ i = Components.begin(); i != Components.end(); ++i)
+ {
+ cmCPackComponent const& component = i->second;
+
+ if(!component.Group)
+ {
+ if(!EmitFeatureForComponent(featureDefinitions, component))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool cmCPackWIXGenerator::EmitFeatureForComponentGroup(
+ cmWIXSourceWriter& featureDefinitions,
+ cmCPackComponentGroup const& group)
+{
+ featureDefinitions.BeginElement("Feature");
+ featureDefinitions.AddAttribute("Id", "CM_G_" + group.Name);
+
+ if(group.IsExpandedByDefault)
+ {
+ featureDefinitions.AddAttribute("Display", "expand");
+ }
+
+ featureDefinitions.AddAttributeUnlessEmpty(
+ "Title", group.DisplayName);
+
+ featureDefinitions.AddAttributeUnlessEmpty(
+ "Description", group.Description);
+
+ for(std::vector<cmCPackComponentGroup*>::const_iterator
+ i = group.Subgroups.begin(); i != group.Subgroups.end(); ++i)
+ {
+ if(!EmitFeatureForComponentGroup(featureDefinitions, **i))
+ {
+ return false;
+ }
+ }
+
+ for(std::vector<cmCPackComponent*>::const_iterator
+ i = group.Components.begin(); i != group.Components.end(); ++i)
+ {
+ if(!EmitFeatureForComponent(featureDefinitions, **i))
+ {
+ return false;
+ }
+ }
+
+ featureDefinitions.EndElement("Feature");
+
+ return true;
+}
+
+bool cmCPackWIXGenerator::EmitFeatureForComponent(
+ cmWIXSourceWriter& featureDefinitions,
+ cmCPackComponent const& component)
+{
+ featureDefinitions.BeginElement("Feature");
+ featureDefinitions.AddAttribute("Id", "CM_C_" + component.Name);
+
+ featureDefinitions.AddAttributeUnlessEmpty(
+ "Title", component.DisplayName);
+
+ featureDefinitions.AddAttributeUnlessEmpty(
+ "Description", component.Description);
+
+ if(component.IsRequired)
+ {
+ featureDefinitions.AddAttribute("Absent", "disallow");
+ }
+
+ if(component.IsHidden)
+ {
+ featureDefinitions.AddAttribute("Display", "hidden");
+ }
+
+ featureDefinitions.EndElement("Feature");
+
+ return true;
+}
+
+bool cmCPackWIXGenerator::AddComponentsToFeature(
+ std::string const& rootPath,
+ std::string const& featureId,
cmWIXSourceWriter& directoryDefinitions,
cmWIXSourceWriter& fileDefinitions,
- cmWIXSourceWriter& featureDefinitions)
+ cmWIXSourceWriter& featureDefinitions,
+ shortcut_map_t& shortcutMap)
{
- if(shortcutMap.empty())
+ featureDefinitions.BeginElement("FeatureRef");
+ featureDefinitions.AddAttribute("Id", featureId);
+
+ std::vector<std::string> cpackPackageExecutablesList;
+ const char *cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES");
+ if(cpackPackageExecutables)
{
- return true;
+ cmSystemTools::ExpandListArgument(cpackPackageExecutables,
+ cpackPackageExecutablesList);
+ if(cpackPackageExecutablesList.size() % 2 != 0 )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and "
+ "<text label>." << std::endl);
+ return false;
+ }
}
+ AddDirectoryAndFileDefinitons(
+ rootPath, "INSTALL_ROOT",
+ directoryDefinitions, fileDefinitions, featureDefinitions,
+ cpackPackageExecutablesList, shortcutMap);
+
+ featureDefinitions.EndElement("FeatureRef");
+
+ return true;
+}
+
+bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
+ std::string const& cpackComponentName,
+ std::string const& featureId,
+ shortcut_map_t& shortcutMap,
+ cmWIXSourceWriter& fileDefinitions,
+ cmWIXSourceWriter& featureDefinitions)
+{
+ featureDefinitions.BeginElement("FeatureRef");
+ featureDefinitions.AddAttribute("Id", featureId);
+
std::string cpackVendor;
if(!RequireOption("CPACK_PACKAGE_VENDOR", cpackVendor))
{
@@ -497,10 +691,19 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
return false;
}
+ std::string idSuffix;
+ if(!cpackComponentName.empty())
+ {
+ idSuffix += "_";
+ idSuffix += cpackComponentName;
+ }
+
+ std::string componentId = "CM_SHORTCUT" + idSuffix;
+
fileDefinitions.BeginElement("DirectoryRef");
fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
fileDefinitions.BeginElement("Component");
- fileDefinitions.AddAttribute("Id", "SHORTCUT");
+ fileDefinitions.AddAttribute("Id", componentId);
fileDefinitions.AddAttribute("Guid", "*");
for(shortcut_map_t::const_iterator
@@ -522,10 +725,13 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
fileDefinitions.EndElement("Shortcut");
}
- CreateUninstallShortcut(cpackPackageName, fileDefinitions);
+ if(cpackComponentName.empty())
+ {
+ CreateUninstallShortcut(cpackPackageName, fileDefinitions);
+ }
fileDefinitions.BeginElement("RemoveFolder");
- fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
+ fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER" + idSuffix);
fileDefinitions.AddAttribute("On", "uninstall");
fileDefinitions.EndElement("RemoveFolder");
@@ -535,7 +741,15 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
fileDefinitions.BeginElement("RegistryValue");
fileDefinitions.AddAttribute("Root", "HKCU");
fileDefinitions.AddAttribute("Key", registryKey);
- fileDefinitions.AddAttribute("Name", "installed");
+
+ std::string valueName;
+ if(!cpackComponentName.empty())
+ {
+ valueName = cpackComponentName + "_";
+ }
+ valueName += "installed";
+
+ fileDefinitions.AddAttribute("Name", valueName);
fileDefinitions.AddAttribute("Type", "integer");
fileDefinitions.AddAttribute("Value", "1");
fileDefinitions.AddAttribute("KeyPath", "yes");
@@ -545,19 +759,10 @@ bool cmCPackWIXGenerator::CreateStartMenuShortcuts(
fileDefinitions.EndElement("DirectoryRef");
featureDefinitions.BeginElement("ComponentRef");
- featureDefinitions.AddAttribute("Id", "SHORTCUT");
+ featureDefinitions.AddAttribute("Id", componentId);
featureDefinitions.EndElement("ComponentRef");
- directoryDefinitions.BeginElement("Directory");
- directoryDefinitions.AddAttribute("Id", "ProgramMenuFolder");
-
- directoryDefinitions.BeginElement("Directory");
- directoryDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
- const char *startMenuFolder = GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
- directoryDefinitions.AddAttribute("Name", startMenuFolder);
- directoryDefinitions.EndElement("Directory");
-
- directoryDefinitions.EndElement("Directory");
+ featureDefinitions.EndElement("FeatureRef");
return true;
}
@@ -628,7 +833,8 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
cmWIXSourceWriter& directoryDefinitions,
cmWIXSourceWriter& fileDefinitions,
cmWIXSourceWriter& featureDefinitions,
- const std::vector<std::string>& packageExecutables)
+ const std::vector<std::string>& packageExecutables,
+ shortcut_map_t& shortcutMap)
{
cmsys::Directory dir;
dir.Load(topdir.c_str());
@@ -662,7 +868,8 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
directoryDefinitions,
fileDefinitions,
featureDefinitions,
- packageExecutables);
+ packageExecutables,
+ shortcutMap);
directoryDefinitions.EndElement("Directory");
}
@@ -922,3 +1129,18 @@ void cmCPackWIXGenerator::AddCustomFlags(
stream << " " << QuotePath(*i);
}
}
+
+void cmCPackWIXGenerator::CreateStartMenuFolder(
+ cmWIXSourceWriter& directoryDefinitions)
+{
+ directoryDefinitions.BeginElement("Directory");
+ directoryDefinitions.AddAttribute("Id", "ProgramMenuFolder");
+
+ directoryDefinitions.BeginElement("Directory");
+ directoryDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER");
+ const char *startMenuFolder = GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
+ directoryDefinitions.AddAttribute("Name", startMenuFolder);
+ directoryDefinitions.EndElement("Directory");
+
+ directoryDefinitions.EndElement("Directory");
+}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 481a07d..84f68b6 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -56,7 +56,7 @@ protected:
virtual bool SupportsComponentInstallation() const
{
- return false;
+ return true;
}
private:
@@ -79,9 +79,30 @@ private:
bool CreateWiXSourceFiles();
- bool CreateStartMenuShortcuts(
+ bool CreateFeatureHierarchy(
+ cmWIXSourceWriter& featureDefinitions);
+
+ bool EmitFeatureForComponentGroup(
+ cmWIXSourceWriter& featureDefinitions,
+ cmCPackComponentGroup const& group);
+
+ bool EmitFeatureForComponent(
+ cmWIXSourceWriter& featureDefinitions,
+ cmCPackComponent const& component);
+
+ bool AddComponentsToFeature(
+ std::string const& rootPath,
+ std::string const& featureId,
cmWIXSourceWriter& directoryDefinitions,
cmWIXSourceWriter& fileDefinitions,
+ cmWIXSourceWriter& featureDefinitions,
+ shortcut_map_t& shortcutMap);
+
+ bool CreateStartMenuShortcuts(
+ std::string const& cpackComponentName,
+ std::string const& featureId,
+ shortcut_map_t& shortcutMap,
+ cmWIXSourceWriter& fileDefinitions,
cmWIXSourceWriter& featureDefinitions);
void CreateUninstallShortcut(
@@ -106,7 +127,8 @@ private:
cmWIXSourceWriter& directoryDefinitions,
cmWIXSourceWriter& fileDefinitions,
cmWIXSourceWriter& featureDefinitions,
- const std::vector<std::string>& pkgExecutables);
+ const std::vector<std::string>& pkgExecutables,
+ shortcut_map_t& shortcutMap);
bool RequireOption(const std::string& name, std::string& value) const;
@@ -136,10 +158,11 @@ private:
void AddCustomFlags(
const std::string& variableName, std::ostream& stream);
+ void CreateStartMenuFolder(cmWIXSourceWriter& directoryDefinitions);
+
std::vector<std::string> wixSources;
id_map_t pathToIdMap;
ambiguity_map_t idAmbiguityCounter;
- shortcut_map_t shortcutMap;
extension_set_t candleExtensions;
extension_set_t lightExtensions;
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx
index 214b8ac..c8a3922 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx
@@ -123,6 +123,15 @@ void cmWIXSourceWriter::AddAttribute(
file << " " << key << "=\"" << EscapeAttributeValue(utf8) << '"';
}
+void cmWIXSourceWriter::AddAttributeUnlessEmpty(
+ const std::string& key, const std::string& value)
+{
+ if(value.size())
+ {
+ AddAttribute(key, value);
+ }
+}
+
std::string cmWIXSourceWriter::WindowsCodepageToUtf8(const std::string& value)
{
if(value.empty())
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h
index 0c7803c..670d4c0 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -40,6 +40,9 @@ public:
void AddAttribute(
const std::string& key, const std::string& value);
+ void AddAttributeUnlessEmpty(
+ const std::string& key, const std::string& value);
+
static std::string WindowsCodepageToUtf8(const std::string& value);
private:
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 9831d02..8e5fd78 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -64,7 +64,8 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
DoingTargetName,
DoingTargetType,
DoingBuildDir,
- DoingCount };
+ DoingCount,
+ DoingFilterPrefix };
Doing doing = DoingNone;
int arg0 = 0;
for(int i=1; !arg0 && i < argc; ++i)
@@ -98,6 +99,10 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
{
doing = DoingBuildDir;
}
+ else if(strcmp(arg, "--filter-prefix") == 0)
+ {
+ doing = DoingFilterPrefix;
+ }
else if(doing == DoingOutput)
{
this->OptionOutput = arg;
@@ -132,6 +137,11 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
this->OptionBuildDir = arg;
doing = DoingNone;
}
+ else if(doing == DoingFilterPrefix)
+ {
+ this->OptionFilterPrefix = arg;
+ doing = DoingNone;
+ }
}
// Extract the real command line.
@@ -573,8 +583,15 @@ void cmCTestLaunch::DumpFileToXML(std::ostream& fxml,
std::string line;
const char* sep = "";
+
while(cmSystemTools::GetLineFromStream(fin, line))
{
+ if(OptionFilterPrefix.size() && cmSystemTools::StringStartsWith(
+ line.c_str(), OptionFilterPrefix.c_str()))
+ {
+ continue;
+ }
+
fxml << sep << cmXMLSafe(line).Quotes(false);
sep = "\n";
}
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index 7457e83..a86a9df 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -45,6 +45,7 @@ private:
std::string OptionTargetName;
std::string OptionTargetType;
std::string OptionBuildDir;
+ std::string OptionFilterPrefix;
bool ParseArguments(int argc, const char* const* argv);
// The real command line appearing after launcher arguments.
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 50835e2..0d0d05b 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -77,6 +77,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
this->PopulateInterfaceProperty("INTERFACE_COMPILE_OPTIONS", te,
cmGeneratorExpression::BuildInterface,
properties, missingTargets);
+ this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS", te,
+ cmGeneratorExpression::BuildInterface,
+ properties, missingTargets);
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
te, properties);
const bool newCMP0022Behavior =
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index dc62284..f8b4e28 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -233,26 +233,46 @@ static bool checkInterfaceDirs(const std::string &prepro,
const bool inSourceBuild = strcmp(topSourceDir, topBinaryDir) == 0;
+ bool hadFatalError = false;
+
for(std::vector<std::string>::iterator li = parts.begin();
li != parts.end(); ++li)
{
- if (cmGeneratorExpression::Find(*li) != std::string::npos)
+ size_t genexPos = cmGeneratorExpression::Find(*li);
+ if (genexPos == 0)
{
continue;
}
+ cmake::MessageType messageType = cmake::FATAL_ERROR;
+ cmOStringStream e;
+ if (genexPos != std::string::npos)
+ {
+ switch (target->GetPolicyStatusCMP0041())
+ {
+ case cmPolicies::WARN:
+ messageType = cmake::WARNING;
+ e << target->GetMakefile()->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0041) << "\n";
+ break;
+ case cmPolicies::OLD:
+ continue;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ hadFatalError = true;
+ break; // Issue fatal message.
+ }
+ }
if (cmHasLiteralPrefix(li->c_str(), "${_IMPORT_PREFIX}"))
{
continue;
}
if (!cmSystemTools::FileIsFullPath(li->c_str()))
{
- cmOStringStream e;
e << "Target \"" << target->GetName() << "\" "
"INTERFACE_INCLUDE_DIRECTORIES property contains relative path:\n"
" \"" << *li << "\"";
- target->GetMakefile()->IssueMessage(cmake::FATAL_ERROR,
- e.str().c_str());
- return false;
+ target->GetMakefile()->IssueMessage(messageType, e.str().c_str());
}
if (isSubDirectory(li->c_str(), installDir))
{
@@ -260,29 +280,44 @@ static bool checkInterfaceDirs(const std::string &prepro,
}
if (isSubDirectory(li->c_str(), topBinaryDir))
{
- cmOStringStream e;
e << "Target \"" << target->GetName() << "\" "
"INTERFACE_INCLUDE_DIRECTORIES property contains path:\n"
" \"" << *li << "\"\nwhich is prefixed in the build directory.";
- target->GetMakefile()->IssueMessage(cmake::FATAL_ERROR,
- e.str().c_str());
- return false;
+ target->GetMakefile()->IssueMessage(messageType, e.str().c_str());
}
if (!inSourceBuild)
{
if (isSubDirectory(li->c_str(), topSourceDir))
{
- cmOStringStream e;
e << "Target \"" << target->GetName() << "\" "
"INTERFACE_INCLUDE_DIRECTORIES property contains path:\n"
" \"" << *li << "\"\nwhich is prefixed in the source directory.";
- target->GetMakefile()->IssueMessage(cmake::FATAL_ERROR,
- e.str().c_str());
- return false;
+ target->GetMakefile()->IssueMessage(messageType, e.str().c_str());
}
}
}
- return true;
+ return !hadFatalError;
+}
+
+//----------------------------------------------------------------------------
+static void prefixItems(std::string &exportDirs)
+{
+ std::vector<std::string> entries;
+ cmGeneratorExpression::Split(exportDirs, entries);
+ exportDirs = "";
+ const char *sep = "";
+ for(std::vector<std::string>::const_iterator ei = entries.begin();
+ ei != entries.end(); ++ei)
+ {
+ exportDirs += sep;
+ sep = ";";
+ if (!cmSystemTools::FileIsFullPath(ei->c_str())
+ && ei->find("${_IMPORT_PREFIX}") == std::string::npos)
+ {
+ exportDirs += "${_IMPORT_PREFIX}/";
+ }
+ exportDirs += *ei;
+ }
}
//----------------------------------------------------------------------------
@@ -301,7 +336,10 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
cmListFileBacktrace lfbt;
cmGeneratorExpression ge(lfbt);
- std::string dirs = tei->InterfaceIncludeDirectories;
+ std::string dirs = cmGeneratorExpression::Preprocess(
+ tei->InterfaceIncludeDirectories,
+ preprocessRule,
+ true);
this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs = cge->Evaluate(target->GetMakefile(), 0,
@@ -330,6 +368,8 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
return;
}
+ prefixItems(exportDirs);
+
std::string includes = (input?input:"");
const char* sep = input ? ";" : "";
includes += sep + exportDirs;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index ad17556..79e78df 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -140,6 +140,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
te,
cmGeneratorExpression::InstallInterface,
properties, missingTargets);
+ this->PopulateInterfaceProperty("INTERFACE_AUTOUIC_OPTIONS",
+ te,
+ cmGeneratorExpression::InstallInterface,
+ properties, missingTargets);
const bool newCMP0022Behavior =
te->GetPolicyStatusCMP0022() != cmPolicies::WARN
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
new file mode 100644
index 0000000..f020ddb
--- /dev/null
+++ b/Source/cmExtraKateGenerator.cxx
@@ -0,0 +1,372 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2009 Kitware, Inc.
+ Copyright 2004 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmExtraKateGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
+#include "cmLocalUnixMakefileGenerator3.h"
+#include "cmMakefile.h"
+#include "cmake.h"
+#include "cmSourceFile.h"
+#include "cmGeneratedFileStream.h"
+#include "cmTarget.h"
+#include "cmSystemTools.h"
+#include "cmXMLSafe.h"
+
+#include <cmsys/SystemTools.hxx>
+
+//----------------------------------------------------------------------------
+void cmExtraKateGenerator
+::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+{
+ entry.Name = this->GetName();
+ entry.Brief = "Generates Kate project files.";
+}
+
+cmExtraKateGenerator::cmExtraKateGenerator()
+:cmExternalMakefileProjectGenerator()
+{
+#if defined(_WIN32)
+ this->SupportedGlobalGenerators.push_back("MinGW Makefiles");
+ this->SupportedGlobalGenerators.push_back("NMake Makefiles");
+// disable until somebody actually tests it:
+// this->SupportedGlobalGenerators.push_back("MSYS Makefiles");
+#endif
+ this->SupportedGlobalGenerators.push_back("Ninja");
+ this->SupportedGlobalGenerators.push_back("Unix Makefiles");
+}
+
+
+void cmExtraKateGenerator::Generate()
+{
+ const cmMakefile* mf
+ = this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
+ this->ProjectName = this->GenerateProjectName(mf->GetProjectName(),
+ mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
+ this->GetPathBasename(mf->GetHomeOutputDirectory()));
+ this->CreateKateProjectFile(mf);
+ this->CreateDummyKateProjectFile(mf);
+}
+
+
+void cmExtraKateGenerator::CreateKateProjectFile(const cmMakefile* mf) const
+{
+ std::string filename = mf->GetHomeOutputDirectory();
+ filename += "/.kateproject";
+ cmGeneratedFileStream fout(filename.c_str());
+ if (!fout)
+ {
+ return;
+ }
+
+ std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ std::string args = mf->GetRequiredDefinition("CMAKE_KATE_MAKE_ARGUMENTS");
+
+ fout <<
+ "{\n"
+ "\t\"name\": \"" << this->ProjectName << "\",\n"
+ "\t\"directory\": \"" << mf->GetHomeDirectory() << "\",\n"
+ "\t\"files\": [ { " << this->GenerateFilesString(mf) << "} ],\n";
+ this->WriteTargets(mf, fout);
+ fout << "}\n";
+}
+
+
+void
+cmExtraKateGenerator::WriteTargets(const cmMakefile* mf,
+ cmGeneratedFileStream& fout) const
+{
+ fout <<
+ "\t\"build\": {\n"
+ "\t\t\"directory\": \"" << mf->GetHomeOutputDirectory() << "\",\n"
+ "\t\t\"default_target\": \"all\",\n"
+ "\t\t\"prev_target\": \"all\",\n"
+ "\t\t\"clean_target\": \"clean\",\n"
+ "\t\t\"targets\":[\n";
+
+ const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
+ const std::string makeArgs = mf->GetSafeDefinition(
+ "CMAKE_KATE_MAKE_ARGUMENTS");
+
+ this->AppendTarget(fout, "all", make, makeArgs,
+ mf->GetHomeOutputDirectory());
+ this->AppendTarget(fout, "clean", make, makeArgs,
+ mf->GetHomeOutputDirectory());
+
+ // add all executable and library targets and some of the GLOBAL
+ // and UTILITY targets
+ for (std::vector<cmLocalGenerator*>::const_iterator
+ it = this->GlobalGenerator->GetLocalGenerators().begin();
+ it != this->GlobalGenerator->GetLocalGenerators().end();
+ ++it)
+ {
+ const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
+ cmMakefile* makefile=(*it)->GetMakefile();
+ std::string currentDir = makefile->GetCurrentOutputDirectory();
+ bool topLevel = (currentDir == makefile->GetHomeOutputDirectory());
+
+ for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)
+ {
+ switch(ti->second.GetType())
+ {
+ case cmTarget::GLOBAL_TARGET:
+ {
+ bool insertTarget = false;
+ // Only add the global targets from CMAKE_BINARY_DIR,
+ // not from the subdirs
+ if (topLevel)
+ {
+ insertTarget = true;
+ // only add the "edit_cache" target if it's not ccmake, because
+ // this will not work within the IDE
+ if (ti->first == "edit_cache")
+ {
+ const char* editCommand = makefile->GetDefinition
+ ("CMAKE_EDIT_COMMAND");
+ if (editCommand == 0)
+ {
+ insertTarget = false;
+ }
+ else if (strstr(editCommand, "ccmake")!=NULL)
+ {
+ insertTarget = false;
+ }
+ }
+ }
+ if (insertTarget)
+ {
+ this->AppendTarget(fout, ti->first, make, makeArgs, currentDir);
+ }
+ }
+ break;
+ case cmTarget::UTILITY:
+ // Add all utility targets, except the Nightly/Continuous/
+ // Experimental-"sub"targets as e.g. NightlyStart
+ if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
+ || ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
+ || ((ti->first.find("Experimental")==0)
+ && (ti->first!="Experimental")))
+ {
+ break;
+ }
+
+ this->AppendTarget(fout, ti->first, make, makeArgs, currentDir);
+ break;
+ case cmTarget::EXECUTABLE:
+ case cmTarget::STATIC_LIBRARY:
+ case cmTarget::SHARED_LIBRARY:
+ case cmTarget::MODULE_LIBRARY:
+ case cmTarget::OBJECT_LIBRARY:
+ {
+ this->AppendTarget(fout, ti->first, make, makeArgs, currentDir);
+ std::string fastTarget = ti->first;
+ fastTarget += "/fast";
+ this->AppendTarget(fout, fastTarget, make, makeArgs, currentDir);
+
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ //insert rules for compiling, preprocessing and assembling individual files
+ std::vector<std::string> objectFileTargets;
+ (*it)->GetIndividualFileTargets(objectFileTargets);
+ for(std::vector<std::string>::const_iterator fit=objectFileTargets.begin();
+ fit != objectFileTargets.end();
+ ++fit)
+ {
+ this->AppendTarget(fout, *fit, make, makeArgs, currentDir);
+ }
+ }
+
+ fout <<
+ "\t] }\n";
+}
+
+
+void
+cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout,
+ const std::string& target,
+ const std::string& make,
+ const std::string& makeArgs,
+ const std::string& path) const
+{
+ static char JsonSep = ' ';
+
+ fout <<
+ "\t\t\t" << JsonSep << "{\"name\":\"" << target << "\", "
+ "\"build_cmd\":\"" << make << " -C " << path << " " << makeArgs << " "
+ << target << "\"}\n";
+
+ JsonSep = ',';
+}
+
+
+
+void
+cmExtraKateGenerator::CreateDummyKateProjectFile(const cmMakefile* mf) const
+{
+ std::string filename = mf->GetHomeOutputDirectory();
+ filename += "/";
+ filename += this->ProjectName;
+ filename += ".kateproject";
+ cmGeneratedFileStream fout(filename.c_str());
+ if (!fout)
+ {
+ return;
+ }
+
+ fout << "#Generated by cmake, do not edit.\n";
+}
+
+
+std::string
+cmExtraKateGenerator::GenerateFilesString(const cmMakefile* mf) const
+{
+ std::string s = mf->GetHomeDirectory();
+ s += "/.git";
+ if(cmSystemTools::FileExists(s.c_str()))
+ {
+ return std::string("\"git\": 1 ");
+ }
+
+ s = mf->GetHomeDirectory();
+ s += "/.svn";
+ if(cmSystemTools::FileExists(s.c_str()))
+ {
+ return std::string("\"svn\": 1 ");
+ }
+
+ s = mf->GetHomeDirectory();
+ s += "/";
+
+ std::set<std::string> files;
+ std::string tmp;
+ const std::vector<cmLocalGenerator *>& lgs =
+ this->GlobalGenerator->GetLocalGenerators();
+
+ for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin();
+ it!=lgs.end(); it++)
+ {
+ cmMakefile* makefile=(*it)->GetMakefile();
+ const std::vector<std::string>& listFiles=makefile->GetListFiles();
+ for (std::vector<std::string>::const_iterator lt=listFiles.begin();
+ lt!=listFiles.end(); lt++)
+ {
+ tmp=*lt;
+ {
+ files.insert(tmp);
+ }
+ }
+
+ const std::vector<cmSourceFile*>& sources = makefile->GetSourceFiles();
+ for (std::vector<cmSourceFile*>::const_iterator sfIt = sources.begin();
+ sfIt != sources.end(); sfIt++)
+ {
+ cmSourceFile* sf = *sfIt;
+ if (sf->GetPropertyAsBool("GENERATED"))
+ {
+ continue;
+ }
+
+ tmp = sf->GetFullPath();
+ files.insert(tmp);
+ }
+ }
+
+ const char* sep = "";
+ tmp = "\"list\": [";
+ for(std::set<std::string>::const_iterator it = files.begin();
+ it != files.end(); ++it)
+ {
+ tmp += sep;
+ tmp += " \"";
+ tmp += *it;
+ tmp += "\"";
+ sep = ",";
+ }
+ tmp += "] ";
+
+ return tmp;
+}
+
+
+std::string cmExtraKateGenerator::GenerateProjectName(const std::string& name,
+ const std::string& type,
+ const std::string& path) const
+{
+ return name + (type.empty() ? "" : "-") + type + "@" + path;
+}
+
+
+std::string cmExtraKateGenerator::GetPathBasename(const std::string& path)const
+{
+ std::string outputBasename = path;
+ while (outputBasename.size() > 0 &&
+ (outputBasename[outputBasename.size() - 1] == '/' ||
+ outputBasename[outputBasename.size() - 1] == '\\'))
+ {
+ outputBasename.resize(outputBasename.size() - 1);
+ }
+ std::string::size_type loc = outputBasename.find_last_of("/\\");
+ if (loc != std::string::npos)
+ {
+ outputBasename = outputBasename.substr(loc + 1);
+ }
+
+ return outputBasename;
+}
+
+
+// Create the command line for building the given target using the selected
+// make
+std::string cmExtraKateGenerator::BuildMakeCommand(const std::string& make,
+ const char* makefile, const char* target) const
+{
+ std::string command = make;
+ if (strcmp(this->GlobalGenerator->GetName(), "NMake Makefiles")==0)
+ {
+ std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
+ command += " /NOLOGO /f &quot;";
+ command += makefileName;
+ command += "&quot; ";
+ command += " VERBOSE=1 ";
+ command += target;
+ }
+ else if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
+ {
+ // no escaping of spaces in this case, see
+ // http://public.kitware.com/Bug/view.php?id=10014
+ std::string makefileName = makefile;
+ command += " -f &quot;";
+ command += makefileName;
+ command += "&quot; ";
+ command += " VERBOSE=1 ";
+ command += target;
+ }
+ else if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
+ {
+ command += " -v ";
+ command += target;
+ }
+ else
+ {
+ std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
+ command += " -f &quot;";
+ command += makefileName;
+ command += "&quot; ";
+ command += " VERBOSE=1 ";
+ command += target;
+ }
+ return command;
+}
diff --git a/Source/cmExtraKateGenerator.h b/Source/cmExtraKateGenerator.h
new file mode 100644
index 0000000..4979eff
--- /dev/null
+++ b/Source/cmExtraKateGenerator.h
@@ -0,0 +1,62 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2009 Kitware, Inc.
+ Copyright 2013 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmExtraKateGenerator_h
+#define cmExtraKateGenerator_h
+
+#include "cmExternalMakefileProjectGenerator.h"
+
+class cmLocalGenerator;
+class cmMakefile;
+class cmTarget;
+class cmGeneratedFileStream;
+
+/** \class cmExtraKateGenerator
+ * \brief Write Kate project files for Makefile or ninja based projects
+ */
+class cmExtraKateGenerator : public cmExternalMakefileProjectGenerator
+{
+public:
+ cmExtraKateGenerator();
+
+ virtual const char* GetName() const
+ { return cmExtraKateGenerator::GetActualName();}
+ static const char* GetActualName() { return "Kate";}
+ static cmExternalMakefileProjectGenerator* New()
+ { return new cmExtraKateGenerator; }
+ /** Get the documentation entry for this generator. */
+ virtual void GetDocumentation(cmDocumentationEntry& entry,
+ const char* fullName) const;
+
+ virtual void Generate();
+private:
+ void CreateKateProjectFile(const cmMakefile* mf) const;
+ void CreateDummyKateProjectFile(const cmMakefile* mf) const;
+ void WriteTargets(const cmMakefile* mf, cmGeneratedFileStream& fout) const;
+ void AppendTarget(cmGeneratedFileStream& fout,
+ const std::string& target,
+ const std::string& make,
+ const std::string& makeArgs,
+ const std::string& path) const;
+
+ std::string GenerateFilesString(const cmMakefile* mf) const;
+ std::string GetPathBasename(const std::string& path) const;
+ std::string GenerateProjectName(const std::string& name,
+ const std::string& type,
+ const std::string& path) const;
+ std::string BuildMakeCommand(const std::string& make,
+ const char* makefile, const char* target) const;
+
+ std::string ProjectName;
+};
+
+#endif
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index f34a35b..2e66d78 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -245,7 +245,7 @@ static void prefixItems(const std::string &content, std::string &result,
result += sep;
sep = ";";
if (!cmSystemTools::FileIsFullPath(ei->c_str())
- && cmGeneratorExpression::Find(*ei) == std::string::npos)
+ && cmGeneratorExpression::Find(*ei) != 0)
{
result += prefix;
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 7399c7b..92f74f3 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -210,3 +210,11 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingCompileOptions() const
return (strcmp(prop, "COMPILE_OPTIONS") == 0
|| strcmp(prop, "INTERFACE_COMPILE_OPTIONS") == 0 );
}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::EvaluatingAutoUicOptions() const
+{
+ const char *prop = this->Property.c_str();
+ return (strcmp(prop, "AUTOUIC_OPTIONS") == 0
+ || strcmp(prop, "INTERFACE_AUTOUIC_OPTIONS") == 0 );
+}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index c8594e7..fd47ad7 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -20,13 +20,15 @@
F(EvaluatingIncludeDirectories) \
F(EvaluatingSystemIncludeDirectories) \
F(EvaluatingCompileDefinitions) \
- F(EvaluatingCompileOptions)
+ F(EvaluatingCompileOptions) \
+ F(EvaluatingAutoUicOptions)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
F(INCLUDE_DIRECTORIES) \
F(SYSTEM_INCLUDE_DIRECTORIES) \
F(COMPILE_DEFINITIONS) \
- F(COMPILE_OPTIONS)
+ F(COMPILE_OPTIONS) \
+ F(AUTOUIC_OPTIONS)
//----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 17bf041..0f8c4e3 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -199,6 +199,48 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
} strEqualNode;
//----------------------------------------------------------------------------
+static const struct LowerCaseNode : public cmGeneratorExpressionNode
+{
+ LowerCaseNode() {}
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return cmSystemTools::LowerCase(parameters.front());
+ }
+} lowerCaseNode;
+
+//----------------------------------------------------------------------------
+static const struct UpperCaseNode : public cmGeneratorExpressionNode
+{
+ UpperCaseNode() {}
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return cmSystemTools::UpperCase(parameters.front());
+ }
+} upperCaseNode;
+
+//----------------------------------------------------------------------------
+static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
+{
+ MakeCIdentifierNode() {}
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return cmSystemTools::MakeCidentifier(parameters.front().c_str());
+ }
+} makeCIdentifierNode;
+
+//----------------------------------------------------------------------------
static const struct Angle_RNode : public cmGeneratorExpressionNode
{
Angle_RNode() {}
@@ -1442,6 +1484,12 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &targetSoNameFileDirNode;
else if (identifier == "STREQUAL")
return &strEqualNode;
+ else if (identifier == "LOWER_CASE")
+ return &lowerCaseNode;
+ else if (identifier == "UPPER_CASE")
+ return &upperCaseNode;
+ else if (identifier == "MAKE_C_IDENTIFIER")
+ return &makeCIdentifierNode;
else if (identifier == "BOOL")
return &boolNode;
else if (identifier == "ANGLE-R")
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index be0459d..215d483 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3031,23 +3031,23 @@ cmXCodeObject* cmGlobalXCodeGenerator
cmStdString curr_tgt_folder;
for(std::vector<std::string>::size_type i = 0; i < tgt_folders.size();i++)
{
- curr_tgt_folder += tgt_folders[i];
- it = this->TargetGroup.find(curr_tgt_folder);
- if(it == this->TargetGroup.end())
+ if (i != 0)
{
- tgroup = this->CreatePBXGroup(tgroup,tgt_folders[i]);
- this->TargetGroup[curr_tgt_folder] = tgroup;
+ curr_tgt_folder += "/";
}
- else
+ curr_tgt_folder += tgt_folders[i];
+ it = this->TargetGroup.find(curr_tgt_folder);
+ if(it != this->TargetGroup.end())
{
tgroup = it->second;
continue;
}
+ tgroup = this->CreatePBXGroup(tgroup,tgt_folders[i]);
+ this->TargetGroup[curr_tgt_folder] = tgroup;
if(i == 0)
{
this->SourcesGroupChildren->AddObject(tgroup);
}
- curr_tgt_folder += "/";
}
}
this->TargetGroup[target] = tgroup;
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 91ea861..236ca1f 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -228,11 +228,6 @@ void cmInstallCommandIncludesArgument::Parse(
for ( ; it != args->end(); ++it)
{
std::string dir = *it;
- if (!cmSystemTools::FileIsFullPath(it->c_str())
- && cmGeneratorExpression::Find(*it) == std::string::npos)
- {
- dir = "$<INSTALL_PREFIX>/" + dir;
- }
cmSystemTools::ConvertToUnixSlashes(dir);
this->IncludeDirs.push_back(dir);
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d26d6e9..c3c5299 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -807,6 +807,7 @@ static const char* ruleReplaceVars[] =
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
"CMAKE_LINKER",
+ "CMAKE_CL_SHOWINCLUDES_PREFIX",
0
};
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 21700e9..9a89f0f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -266,6 +266,7 @@ public:
const char* Defines;
const char* RuleLauncher;
const char* DependencyFile;
+ const char* FilterPrefix;
};
/** Set whether to treat conversions to SHELL as a link script shell. */
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 5ada88d..6ca386c 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -391,6 +391,11 @@ void cmLocalUnixMakefileGenerator3
(t->second->GetType() == cmTarget::INTERFACE_LIBRARY) ||
(t->second->GetType() == cmTarget::UTILITY))
{
+ if (t->second->Target->IsImported())
+ {
+ continue;
+ }
+
emitted.insert(t->second->GetName());
// for subdirs add a rule to build this specific target by name.
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index b9b469c..0b3018e 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -306,6 +306,11 @@ cmPolicies::cmPolicies()
CMP0040, "CMP0040",
"The target in the TARGET signature of add_custom_command() must exist.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0041, "CMP0041",
+ "Error on relative include with generator expression.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 6834121..245ec4b 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -94,6 +94,7 @@ public:
CMP0039, ///< Utility targets may not have link dependencies
CMP0040, ///< The target in the TARGET signature of
/// add_custom_command() must exist.
+ CMP0041, ///< Error on relative include with generator expression
/** \brief Always the last entry.
*
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a7d20ae..835e3b4 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -365,6 +365,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
std::map<std::string, std::string> configIncludes;
std::map<std::string, std::string> configDefines;
+ std::map<std::string, std::string> configUicOptions;
if (target->GetPropertyAsBool("AUTOMOC"))
{
@@ -373,7 +374,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
}
if (target->GetPropertyAsBool("AUTOUIC"))
{
- this->SetupAutoUicTarget(target);
+ this->SetupAutoUicTarget(target, configUicOptions);
}
if (target->GetPropertyAsBool("AUTORCC"))
{
@@ -388,7 +389,9 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(),
false, true, false);
- if (!configDefines.empty() || !configIncludes.empty())
+ if (!configDefines.empty()
+ || !configIncludes.empty()
+ || !configUicOptions.empty())
{
std::ofstream infoFile(outputFile.c_str(), std::ios::app);
if ( !infoFile )
@@ -419,6 +422,16 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
" " << it->second << ")\n";
}
}
+ if (!configUicOptions.empty())
+ {
+ for (std::map<std::string, std::string>::iterator
+ it = configUicOptions.begin(), end = configUicOptions.end();
+ it != end; ++it)
+ {
+ infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first <<
+ " " << it->second << ")\n";
+ }
+ }
}
}
@@ -513,7 +526,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
config_moc_compile_defs);
if (config_moc_incs != _moc_incs)
{
- configIncludes["_moc_incs_" + *li] =
+ configIncludes[*li] =
cmLocalGenerator::EscapeForCMake(config_moc_incs.c_str());
if(_moc_incs.empty())
{
@@ -522,7 +535,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
}
if (config_moc_compile_defs != _moc_compile_defs)
{
- configDefines["_moc_compile_defs_" + *li] =
+ configDefines[*li] =
cmLocalGenerator::EscapeForCMake(config_moc_compile_defs.c_str());
if(_moc_compile_defs.empty())
{
@@ -565,6 +578,7 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
"translate",
"postfix",
"generator",
+ "include", // Since Qt 5.3
"g"
};
std::vector<std::string> extraOpts;
@@ -600,7 +614,25 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
-void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target)
+static void GetUicOpts(cmTarget *target, const char * config,
+ std::string &optString)
+{
+ std::vector<std::string> opts;
+ target->GetAutoUicOptions(opts, config);
+
+ const char* sep = "";
+ for(std::vector<std::string>::const_iterator optIt = opts.begin();
+ optIt != opts.end();
+ ++optIt)
+ {
+ optString += sep;
+ sep = ";";
+ optString += *optIt;
+ }
+}
+
+void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target,
+ std::map<std::string, std::string> &configUicOptions)
{
cmMakefile *makefile = target->GetMakefile();
@@ -649,10 +681,30 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target)
const char *qtVersion = makefile->GetDefinition("_target_qt_version");
- if (const char* opts = target->GetProperty("AUTOUIC_OPTIONS"))
+ std::string _uic_opts;
+ std::vector<std::string> configs;
+ const char *config = makefile->GetConfigurations(configs);
+ GetUicOpts(target, config, _uic_opts);
+
+ if (!_uic_opts.empty())
+ {
+ _uic_opts = cmLocalGenerator::EscapeForCMake(_uic_opts.c_str());
+ makefile->AddDefinition("_uic_target_options", _uic_opts.c_str());
+ }
+ for (std::vector<std::string>::const_iterator li = configs.begin();
+ li != configs.end(); ++li)
{
- makefile->AddDefinition("_uic_target_options",
- cmLocalGenerator::EscapeForCMake(opts).c_str());
+ std::string config_uic_opts;
+ GetUicOpts(target, li->c_str(), config_uic_opts);
+ if (config_uic_opts != _uic_opts)
+ {
+ configUicOptions[*li] =
+ cmLocalGenerator::EscapeForCMake(config_uic_opts.c_str());
+ if(_uic_opts.empty())
+ {
+ _uic_opts = config_uic_opts;
+ }
+ }
}
for(std::vector<cmSourceFile*>::const_iterator fileIt =
@@ -971,9 +1023,19 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
{
const char *uicOptionsFiles
= makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES");
+ std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS";
+ std::string uicOptionsProp = uicOptionsPropOrig;
+ if(config)
+ {
+ uicOptionsProp += "_";
+ uicOptionsProp += config;
+ }
const char *uicTargetOptions
- = makefile->GetSafeDefinition("AM_UIC_TARGET_OPTIONS");
- cmSystemTools::ExpandListArgument(uicTargetOptions, this->UicTargetOptions);
+ = makefile->GetSafeDefinition(uicOptionsProp.c_str());
+ cmSystemTools::ExpandListArgument(
+ uicTargetOptions ? uicTargetOptions
+ : makefile->GetSafeDefinition(includesPropOrig.c_str()),
+ this->UicTargetOptions);
const char *uicOptionsOptions
= makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS");
std::vector<std::string> uicFilesVec;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 116f174..e877f7d 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -31,7 +31,8 @@ private:
const std::string &autogenTargetName,
std::map<std::string, std::string> &configIncludes,
std::map<std::string, std::string> &configDefines);
- void SetupAutoUicTarget(cmTarget* target);
+ void SetupAutoUicTarget(cmTarget* target,
+ std::map<std::string, std::string> &configUicOptions);
void SetupAutoRccTarget(cmTarget* target);
cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2423b27..fe68a8a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -135,6 +135,7 @@ public:
};
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
+ std::vector<TargetPropertyEntry*> AutoUicOptionsEntries;
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
@@ -143,11 +144,14 @@ public:
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileOptionsEntries;
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
+ CachedLinkInterfaceAutoUicOptionsEntries;
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileDefinitionsEntries;
mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceAutoUicOptionsDone;
};
//----------------------------------------------------------------------------
@@ -182,6 +186,7 @@ cmTargetInternals::~cmTargetInternals()
{
deleteAndClear(this->CachedLinkInterfaceIncludeDirectoriesEntries);
deleteAndClear(this->CachedLinkInterfaceCompileOptionsEntries);
+ deleteAndClear(this->CachedLinkInterfaceAutoUicOptionsEntries);
deleteAndClear(this->CachedLinkInterfaceCompileDefinitionsEntries);
}
@@ -1473,6 +1478,17 @@ void cmTarget::SetProperty(const char* prop, const char* value)
new cmTargetInternals::TargetPropertyEntry(cge));
return;
}
+ if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
+ {
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ cmGeneratorExpression ge(lfbt);
+ deleteAndClear(this->Internal->AutoUicOptionsEntries);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
+ this->Internal->AutoUicOptionsEntries.push_back(
+ new cmTargetInternals::TargetPropertyEntry(cge));
+ return;
+ }
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
{
cmListFileBacktrace lfbt;
@@ -1547,6 +1563,15 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
return;
}
+ if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
+ {
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ cmGeneratorExpression ge(lfbt);
+ this->Internal->AutoUicOptionsEntries.push_back(
+ new cmTargetInternals::TargetPropertyEntry(ge.Parse(value)));
+ return;
+ }
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
{
cmListFileBacktrace lfbt;
@@ -2043,6 +2068,106 @@ static void processCompileOptions(cmTarget const* tgt,
}
//----------------------------------------------------------------------------
+void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
+ const char *config) const
+{
+ std::set<std::string> uniqueOptions;
+ cmListFileBacktrace lfbt;
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ "AUTOUIC_OPTIONS", 0, 0);
+
+ std::vector<std::string> debugProperties;
+ const char *debugProp =
+ this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
+ if (debugProp)
+ {
+ cmSystemTools::ExpandListArgument(debugProp, debugProperties);
+ }
+
+ bool debugOptions = !this->DebugCompileOptionsDone
+ && std::find(debugProperties.begin(),
+ debugProperties.end(),
+ "AUTOUIC_OPTIONS")
+ != debugProperties.end();
+
+ if (this->Makefile->IsGeneratingBuildSystem())
+ {
+ this->DebugAutoUicOptionsDone = true;
+ }
+
+ processCompileOptions(this,
+ this->Internal->AutoUicOptionsEntries,
+ result,
+ uniqueOptions,
+ &dagChecker,
+ config,
+ debugOptions);
+
+ std::string configString = config ? config : "";
+ if (!this->Internal->CacheLinkInterfaceAutoUicOptionsDone[configString])
+ {
+ for (std::vector<cmValueWithOrigin>::const_iterator
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
+ it != end; ++it)
+ {
+ if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+ && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+ {
+ continue;
+ }
+ {
+ cmGeneratorExpression ge(lfbt);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(it->Value);
+ std::string targetResult = cge->Evaluate(this->Makefile, config,
+ false, this, 0, 0);
+ if (!this->Makefile->FindTargetToUse(targetResult.c_str()))
+ {
+ continue;
+ }
+ }
+ std::string optionGenex = "$<TARGET_PROPERTY:" +
+ it->Value + ",INTERFACE_AUTOUIC_OPTIONS>";
+ if (cmGeneratorExpression::Find(it->Value) != std::string::npos)
+ {
+ // Because it->Value is a generator expression, ensure that it
+ // evaluates to the non-empty string before being used in the
+ // TARGET_PROPERTY expression.
+ optionGenex = "$<$<BOOL:" + it->Value + ">:" + optionGenex + ">";
+ }
+ cmGeneratorExpression ge(it->Backtrace);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
+ optionGenex);
+
+ this->Internal
+ ->CachedLinkInterfaceAutoUicOptionsEntries[configString].push_back(
+ new cmTargetInternals::TargetPropertyEntry(cge,
+ it->Value));
+ }
+ }
+
+ processCompileOptions(this,
+ this->Internal->CachedLinkInterfaceAutoUicOptionsEntries[configString],
+ result,
+ uniqueOptions,
+ &dagChecker,
+ config,
+ debugOptions);
+
+ if (!this->Makefile->IsGeneratingBuildSystem())
+ {
+ deleteAndClear(this->Internal->CachedLinkInterfaceAutoUicOptionsEntries);
+ }
+ else
+ {
+ this->Internal->CacheLinkInterfaceAutoUicOptionsDone[configString] = true;
+ }
+}
+
+//----------------------------------------------------------------------------
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
const char *config) const
{
@@ -2749,6 +2874,24 @@ const char *cmTarget::GetProperty(const char* prop,
}
return output.c_str();
}
+ if(strcmp(prop,"AUTOUIC_OPTIONS") == 0)
+ {
+ static std::string output;
+ output = "";
+ std::string sep;
+ typedef cmTargetInternals::TargetPropertyEntry
+ TargetPropertyEntry;
+ for (std::vector<TargetPropertyEntry*>::const_iterator
+ it = this->Internal->AutoUicOptionsEntries.begin(),
+ end = this->Internal->AutoUicOptionsEntries.end();
+ it != end; ++it)
+ {
+ output += sep;
+ output += (*it)->ge->GetInput();
+ sep = ";";
+ }
+ return output.c_str();
+ }
if(strcmp(prop,"COMPILE_DEFINITIONS") == 0)
{
static std::string output;
@@ -5958,6 +6101,7 @@ cmTargetInternalPointer::~cmTargetInternalPointer()
{
deleteAndClear(this->Pointer->IncludeDirectoriesEntries);
deleteAndClear(this->Pointer->CompileOptionsEntries);
+ deleteAndClear(this->Pointer->AutoUicOptionsEntries);
deleteAndClear(this->Pointer->CompileDefinitionsEntries);
delete this->Pointer;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 35ec680..93e8b99 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -25,7 +25,8 @@
F(CMP0008) \
F(CMP0020) \
F(CMP0021) \
- F(CMP0022)
+ F(CMP0022) \
+ F(CMP0041)
class cmake;
class cmMakefile;
@@ -532,6 +533,8 @@ public:
void GetCompileOptions(std::vector<std::string> &result,
const char *config) const;
+ void GetAutoUicOptions(std::vector<std::string> &result,
+ const char *config) const;
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
@@ -689,6 +692,7 @@ private:
bool IsImportedTarget;
mutable bool DebugIncludesDone;
mutable bool DebugCompileOptionsDone;
+ mutable bool DebugAutoUicOptionsDone;
mutable bool DebugCompileDefinitionsDone;
mutable std::set<std::string> LinkImplicitNullProperties;
bool BuildInterfaceIncludesAppended;
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index e7b906c..913bdab 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -50,7 +50,7 @@ std::string cmTargetIncludeDirectoriesCommand
it != content.end(); ++it)
{
if (cmSystemTools::FileIsFullPath(it->c_str())
- || cmGeneratorExpression::Find(*it) != std::string::npos)
+ || cmGeneratorExpression::Find(*it) == 0)
{
dirs += sep + *it;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index bf27c78..741e263 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -73,6 +73,7 @@
# include "cmExtraCodeBlocksGenerator.h"
#endif
#include "cmExtraSublimeTextGenerator.h"
+#include "cmExtraKateGenerator.h"
#ifdef CMAKE_USE_KDEVELOP
# include "cmGlobalKdevelopGenerator.h"
@@ -991,6 +992,8 @@ void cmake::AddDefaultExtraGenerators()
&cmExtraCodeBlocksGenerator::New);
this->AddExtraGenerator(cmExtraSublimeTextGenerator::GetActualName(),
&cmExtraSublimeTextGenerator::New);
+ this->AddExtraGenerator(cmExtraKateGenerator::GetActualName(),
+ &cmExtraKateGenerator::New);
#ifdef CMAKE_USE_ECLIPSE
this->AddExtraGenerator(cmExtraEclipseCDT4Generator::GetActualName(),
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index d4f464c..d3b7b5f 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1294,7 +1294,8 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
// to do the final link. If mt has any value other than 0 or 1090650113
// then there was some problem with the command itself and there was an
// error so return the error code back out of cmake so make can report it.
- if(mtRet != 1090650113)
+ // (when hosted on a posix system the value is 187)
+ if(mtRet != 1090650113 && mtRet != 187)
{
return mtRet;
}
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index 21b8e15..8a564c7 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -45,7 +45,8 @@ add_executable(consumer
target_include_directories(consumer
PRIVATE
$<TARGET_PROPERTY:target_include_directories,INTERFACE_INCLUDE_DIRECTORIES>
- relative_dir
+ relative_dir
+ relative_dir/$<TARGET_PROPERTY:NAME>
)
# Test no items
diff --git a/Tests/CMakeCommands/target_include_directories/consumer.cpp b/Tests/CMakeCommands/target_include_directories/consumer.cpp
index 82b800a..7e3443e 100644
--- a/Tests/CMakeCommands/target_include_directories/consumer.cpp
+++ b/Tests/CMakeCommands/target_include_directories/consumer.cpp
@@ -3,6 +3,7 @@
#include "publicinclude.h"
#include "interfaceinclude.h"
#include "relative_dir.h"
+#include "consumer.h"
#ifdef PRIVATEINCLUDE_DEFINE
#error Unexpected PRIVATEINCLUDE_DEFINE
@@ -24,4 +25,8 @@
#error Expected RELATIVE_DIR_DEFINE
#endif
+#ifndef CONSUMER_DEFINE
+#error Expected CONSUMER_DEFINE
+#endif
+
int main() { return 0; }
diff --git a/Tests/CMakeCommands/target_include_directories/relative_dir/consumer/consumer.h b/Tests/CMakeCommands/target_include_directories/relative_dir/consumer/consumer.h
new file mode 100644
index 0000000..b915373
--- /dev/null
+++ b/Tests/CMakeCommands/target_include_directories/relative_dir/consumer/consumer.h
@@ -0,0 +1,2 @@
+
+#define CONSUMER_DEFINE
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f7a320a..9e74b7d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1081,8 +1081,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
# on that platform.
if(WIN32)
set(run_autogen_test ${CMAKE_CTEST_COMMAND} -V)
+ set(run_autouic_test ${CMAKE_CTEST_COMMAND} -V)
else()
set(run_autogen_test QtAutogen)
+ set(run_autouic_test QtAutoUicInterface)
endif()
find_package(Qt5Widgets QUIET NO_MODULE)
@@ -1100,6 +1102,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
+
+ add_test(Qt5AutoUicInterface ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
+ "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface"
+ ${build_generator_args}
+ --build-project QtAutoUicInterface
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface"
+ --force-new-ctest-process
+ --build-options ${build_options}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
+ --test-command ${run_autouic_test}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface")
endif()
if(QT4_WORKS AND QT_QTGUI_FOUND)
add_test(Qt4Autogen ${CMAKE_CTEST_COMMAND}
@@ -1116,6 +1132,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")
+ add_test(Qt4AutoUicInterface ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
+ "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface"
+ ${build_generator_args}
+ --build-project QtAutoUicInterface
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface"
+ --force-new-ctest-process
+ --build-options ${build_options}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
+ --test-command ${run_autouic_test}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface")
+
add_test(Qt4Targets ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Qt4Targets"
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index b54925a..ecfecdb 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -14,11 +14,16 @@ install(TARGETS mylib
DESTINATION lib
COMPONENT libraries)
-install(TARGETS my-libapp my-other-app
+install(TARGETS my-libapp
RUNTIME
DESTINATION bin
COMPONENT applications)
+install(TARGETS my-other-app
+ RUNTIME
+ DESTINATION bin
+ COMPONENT applications2)
+
install(FILES mylib.h "file with spaces.h"
DESTINATION include
COMPONENT headers)
@@ -56,11 +61,18 @@ cpack_add_component_group(Development
DESCRIPTION "All of the tools you'll ever need to develop software")
cpack_add_component(applications
+ REQUIRED
DISPLAY_NAME "MyLib Application"
DESCRIPTION "An extremely useful application that makes use of MyLib"
GROUP Runtime
INSTALL_TYPES Full)
+cpack_add_component(applications2
+ DISPLAY_NAME "MyLib Extra Application"
+ DESCRIPTION "Another extremely useful application that makes use of MyLib"
+ GROUP Runtime
+ INSTALL_TYPES Full)
+
cpack_add_component(documentation
DISPLAY_NAME "MyLib Documentation"
DESCRIPTION "The extensive suite of MyLib Application documentation files"
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index cbae967..0e2828e 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -311,7 +311,25 @@ install(TARGETS testLibRequired
INCLUDES DESTINATION
installIncludesTest
$<INSTALL_PREFIX>/installIncludesTest2
- )
+ installIncludesTest3/$<TARGET_PROPERTY:NAME>
+ $<TARGET_PROPERTY:NAME>/installIncludesTest4
+ $<INSTALL_INTERFACE:installIncludesTest5$<0:>>
+ $<INSTALL_INTERFACE:$<0:>installIncludesTest6>
+ $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/installIncludesTest7>
+)
+
+target_include_directories(testLibRequired INTERFACE
+ # These can't be in the above install(INCLUDES DESTINATION call because
+ # that is only for installed interfaces. These directories are prefixes
+ # in the build dir, which is an error for the installed interface.
+ # We add them here so that we don't have to add conditions in the Import
+ # component of the test.
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5$<0:>>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/$<0:>installIncludesTest6>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7>
+ $<INSTALL_INTERFACE:installIncludesTest8/$<0:>>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8$<0:>>
+)
install(TARGETS
testLibIncludeRequired1
testLibIncludeRequired2
@@ -334,6 +352,18 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "// No content\n")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "// No content\n")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h"
DESTINATION installIncludesTest
@@ -342,6 +372,30 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest2/installIncludesTest2.h"
DESTINATION installIncludesTest2
)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest3/testLibRequired/installIncludesTest3.h"
+ DESTINATION installIncludesTest3/testLibRequired
+)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/testLibRequired/installIncludesTest4/installIncludesTest4.h"
+ DESTINATION testLibRequired/installIncludesTest4
+)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest5/installIncludesTest5.h"
+ DESTINATION installIncludesTest5
+)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h"
+ DESTINATION installIncludesTest6
+)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h"
+ DESTINATION installIncludesTest7
+)
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h"
+ DESTINATION installIncludesTest8
+)
install(TARGETS testLibDepends testSharedLibDepends EXPORT DependsExp DESTINATION lib )
install(EXPORT DependsExp FILE testLibDependsTargets.cmake DESTINATION lib/cmake/testLibDepends)
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index 48a4c44..953d0ad 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -6,6 +6,12 @@
#include "installIncludesTest.h"
#include "installIncludesTest2.h"
+#include "installIncludesTest3.h"
+#include "installIncludesTest4.h"
+#include "installIncludesTest5.h"
+#include "installIncludesTest6.h"
+#include "installIncludesTest7.h"
+#include "installIncludesTest8.h"
#ifndef testLibRequired_IFACE_DEFINE
#error Expected testLibRequired_IFACE_DEFINE
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index e0df8c2..edadb87 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -193,6 +193,9 @@ add_custom_target(check-part3 ALL
-Dtest_platform_id_Linux=$<PLATFORM_ID:Linux>
-Dtest_platform_id_Windows=$<PLATFORM_ID:Windows>
-Dtest_platform_id_Darwin=$<PLATFORM_ID:Darwin>
+ -Dlower_case=$<LOWER_CASE:MiXeD>
+ -Dupper_case=$<UPPER_CASE:MiXeD>
+ -Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4foo:+bar-$>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 93ea487..a86db31 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -34,3 +34,6 @@ foreach(system Linux Windows Darwin)
check(test_platform_id_${system} 0)
endif()
endforeach()
+check(lower_case "mixed")
+check(upper_case "MIXED")
+check(make_c_identifier "_4foo__bar__")
diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutoUicInterface/CMakeLists.txt
new file mode 100644
index 0000000..555f016
--- /dev/null
+++ b/Tests/QtAutoUicInterface/CMakeLists.txt
@@ -0,0 +1,70 @@
+
+cmake_minimum_required(VERSION 2.8.12)
+
+project(QtAutoUicInterface)
+
+if (QT_TEST_VERSION STREQUAL 4)
+ find_package(Qt4 REQUIRED)
+
+ include(UseQt4)
+
+ set(QT_CORE_TARGET Qt4::QtCore)
+ set(QT_GUI_TARGET Qt4::QtGui)
+else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+ find_package(Qt5Widgets REQUIRED)
+
+ set(QT_CORE_TARGET Qt5::Core)
+ set(QT_GUI_TARGET Qt5::Widgets)
+endif()
+
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+# BEGIN Upstream
+
+set(CMAKE_VERBOSE_MAKEFILE ON)
+
+add_library(KI18n klocalizedstring.cpp)
+target_link_libraries(KI18n ${QT_CORE_TARGET})
+
+set(autouic_options
+ -tr tr2$<$<NOT:$<BOOL:$<TARGET_PROPERTY:NO_KUIT_SEMANTIC>>>:x>i18n
+)
+if (NOT Qt5Widgets_VERSION VERSION_LESS 5.3.0)
+ list(APPEND autouic_options -include klocalizedstring.h)
+endif()
+
+set_property(TARGET KI18n APPEND PROPERTY
+ INTERFACE_AUTOUIC_OPTIONS ${autouic_options}
+)
+
+set(domainProp $<TARGET_PROPERTY:TRANSLATION_DOMAIN>)
+set(nameLower $<LOWER_CASE:$<MAKE_C_IDENTIFIER:$<TARGET_PROPERTY:NAME>>>)
+set(domain_logic
+ $<$<BOOL:${domainProp}>:${domainProp}>$<$<NOT:$<BOOL:${domainProp}>>:${nameLower}>
+)
+set_property(TARGET KI18n APPEND PROPERTY
+ INTERFACE_COMPILE_DEFINITIONS "TRANSLATION_DOMAIN=${domain_logic}"
+)
+
+# END upstream
+
+add_library(LibWidget libwidget.cpp)
+target_link_libraries(LibWidget KI18n ${QT_GUI_TARGET})
+set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON)
+set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain)
+
+add_library(MyWidget mywidget.cpp)
+target_link_libraries(MyWidget KI18n ${QT_GUI_TARGET})
+
+add_executable(QtAutoUicInterface main.cpp)
+target_compile_definitions(QtAutoUicInterface
+ PRIVATE
+ UI_LIBWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/ui_libwidget.h"
+ UI_MYWIDGET_H="${CMAKE_CURRENT_BINARY_DIR}/ui_mywidget.h"
+)
diff --git a/Tests/QtAutoUicInterface/klocalizedstring.cpp b/Tests/QtAutoUicInterface/klocalizedstring.cpp
new file mode 100644
index 0000000..f2324bb
--- /dev/null
+++ b/Tests/QtAutoUicInterface/klocalizedstring.cpp
@@ -0,0 +1,12 @@
+
+#include "klocalizedstring.h"
+
+QString tr2xi18n(const char *text, const char *)
+{
+ return QLatin1String("TranslatedX") + QString::fromLatin1(text);
+}
+
+QString tr2i18n(const char *text, const char *)
+{
+ return QLatin1String("Translated") + QString::fromLatin1(text);
+}
diff --git a/Tests/QtAutoUicInterface/klocalizedstring.h b/Tests/QtAutoUicInterface/klocalizedstring.h
new file mode 100644
index 0000000..559058f
--- /dev/null
+++ b/Tests/QtAutoUicInterface/klocalizedstring.h
@@ -0,0 +1,17 @@
+
+#ifndef KLOCALIZEDSTRING_H
+#define KLOCALIZEDSTRING_H
+
+#include <QString>
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+QString tr2xi18n(const char *text, const char *comment = 0);
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+QString tr2i18n(const char *text, const char *comment = 0);
+
+#endif
diff --git a/Tests/QtAutoUicInterface/libwidget.cpp b/Tests/QtAutoUicInterface/libwidget.cpp
new file mode 100644
index 0000000..8a921b3
--- /dev/null
+++ b/Tests/QtAutoUicInterface/libwidget.cpp
@@ -0,0 +1,9 @@
+
+#include "libwidget.h"
+
+LibWidget::LibWidget(QWidget *parent)
+ : QWidget(parent),
+ ui(new Ui::LibWidget)
+{
+ ui->setupUi(this);
+}
diff --git a/Tests/QtAutoUicInterface/libwidget.h b/Tests/QtAutoUicInterface/libwidget.h
new file mode 100644
index 0000000..8b592ec
--- /dev/null
+++ b/Tests/QtAutoUicInterface/libwidget.h
@@ -0,0 +1,24 @@
+
+#ifndef LIBWIDGET_H
+#define LIBWIDGET_H
+
+#include <QWidget>
+#include <memory>
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
+#include <klocalizedstring.h>
+#endif
+
+#include "ui_libwidget.h"
+
+class LibWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit LibWidget(QWidget *parent = 0);
+
+private:
+ const std::auto_ptr<Ui::LibWidget> ui;
+};
+
+#endif
diff --git a/Tests/QtAutoUicInterface/libwidget.ui b/Tests/QtAutoUicInterface/libwidget.ui
new file mode 100644
index 0000000..897371e
--- /dev/null
+++ b/Tests/QtAutoUicInterface/libwidget.ui
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LibWidget</class>
+ <widget class="QWidget" name="LibWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>60</y>
+ <width>57</width>
+ <height>15</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>LibLabel</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutoUicInterface/main.cpp b/Tests/QtAutoUicInterface/main.cpp
new file mode 100644
index 0000000..42d5958
--- /dev/null
+++ b/Tests/QtAutoUicInterface/main.cpp
@@ -0,0 +1,75 @@
+
+#include <fstream>
+#include <iostream>
+#include <string>
+
+int main(int argc, char **argv)
+{
+ std::ifstream f;
+ f.open(UI_LIBWIDGET_H);
+ if (!f.is_open())
+ {
+ std::cout << "Could not open \"" UI_LIBWIDGET_H "\"." << std::endl;
+ return -1;
+ }
+
+ {
+ bool gotTr2i18n = false;
+
+ while (!f.eof())
+ {
+ std::string output;
+ getline(f, output);
+ if (!gotTr2i18n)
+ {
+ gotTr2i18n = output.find("tr2i18n") != std::string::npos;
+ }
+ if (output.find("tr2xi18n") != std::string::npos)
+ {
+ std::cout << "ui_libwidget,h uses tr2xi18n, though it should not." << std::endl;
+ return -1;
+ }
+ }
+
+ if (!gotTr2i18n)
+ {
+ std::cout << "Did not find tr2i18n in ui_libwidget.h" << std::endl;
+ return -1;
+ }
+ }
+
+ f.close();
+ f.open(UI_MYWIDGET_H);
+ if (!f.is_open())
+ {
+ std::cout << "Could not open \"" UI_MYWIDGET_H "\"." << std::endl;
+ return -1;
+ }
+
+ {
+ bool gotTr2xi18n = false;
+
+ while (!f.eof())
+ {
+ std::string output;
+ getline(f, output);
+ if (!gotTr2xi18n)
+ {
+ gotTr2xi18n = output.find("tr2xi18n") != std::string::npos;
+ }
+ if (output.find("tr2i18n") != std::string::npos)
+ {
+ std::cout << "ui_mywidget,h uses tr2i18n, though it should not." << std::endl;
+ return -1;
+ }
+ }
+ if (!gotTr2xi18n)
+ {
+ std::cout << "Did not find tr2xi18n in ui_mywidget.h" << std::endl;
+ return -1;
+ }
+ }
+ f.close();
+
+ return 0;
+}
diff --git a/Tests/QtAutoUicInterface/mywidget.cpp b/Tests/QtAutoUicInterface/mywidget.cpp
new file mode 100644
index 0000000..b528b1a
--- /dev/null
+++ b/Tests/QtAutoUicInterface/mywidget.cpp
@@ -0,0 +1,9 @@
+
+#include "mywidget.h"
+
+MyWidget::MyWidget(QWidget *parent)
+ : QWidget(parent),
+ ui(new Ui::MyWidget)
+{
+ ui->setupUi(this);
+}
diff --git a/Tests/QtAutoUicInterface/mywidget.h b/Tests/QtAutoUicInterface/mywidget.h
new file mode 100644
index 0000000..c96fb98
--- /dev/null
+++ b/Tests/QtAutoUicInterface/mywidget.h
@@ -0,0 +1,24 @@
+
+#ifndef MYWIDGET_H
+#define MYWIDGET_H
+
+#include <QWidget>
+#include <memory>
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
+#include <klocalizedstring.h>
+#endif
+
+#include "ui_mywidget.h"
+
+class MyWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit MyWidget(QWidget *parent = 0);
+
+private:
+ const std::auto_ptr<Ui::MyWidget> ui;
+};
+
+#endif
diff --git a/Tests/QtAutoUicInterface/mywidget.ui b/Tests/QtAutoUicInterface/mywidget.ui
new file mode 100644
index 0000000..b2b9cc5
--- /dev/null
+++ b/Tests/QtAutoUicInterface/mywidget.ui
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MyWidget</class>
+ <widget class="QWidget" name="MyWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>110</x>
+ <y>40</y>
+ <width>81</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Special button</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt b/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt
new file mode 100644
index 0000000..2ec3aef
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt
@@ -0,0 +1,20 @@
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path:
+
+ "include/\$<TARGET_PROPERTY:NAME>"
+
+
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/CMP0041-NEW-build/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake b/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake
new file mode 100644
index 0000000..605b79a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake
@@ -0,0 +1,12 @@
+
+cmake_policy(SET CMP0041 NEW)
+
+add_library(foo empty.cpp)
+set_property(TARGET foo
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake
new file mode 100644
index 0000000..16cbced
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake
@@ -0,0 +1,12 @@
+
+cmake_policy(SET CMP0041 OLD)
+
+add_library(foo empty.cpp)
+set_property(TARGET foo
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt
new file mode 100644
index 0000000..a7d303e
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt
@@ -0,0 +1,32 @@
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path:
+
+ "include/\$<TARGET_PROPERTY:NAME>"
+
+
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/CMP0041-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake
new file mode 100644
index 0000000..873cbc7
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake
@@ -0,0 +1,10 @@
+
+add_library(foo empty.cpp)
+set_property(TARGET foo
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt
new file mode 100644
index 0000000..9b0a214
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt
@@ -0,0 +1,22 @@
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Error in CMakeLists.txt:
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-build/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake
new file mode 100644
index 0000000..3005108
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake
@@ -0,0 +1,11 @@
+
+cmake_policy(SET CMP0041 NEW)
+
+add_library(foo empty.cpp)
+target_include_directories(foo INTERFACE
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake
new file mode 100644
index 0000000..b5c4e7f
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake
@@ -0,0 +1,11 @@
+
+cmake_policy(SET CMP0041 OLD)
+
+add_library(foo empty.cpp)
+target_include_directories(foo INTERFACE
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt
new file mode 100644
index 0000000..aae2c7a
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt
@@ -0,0 +1,34 @@
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the source directory.
+
+
+CMake Warning in CMakeLists.txt:
+ Policy CMP0041 is not set: Error on relative include with generator
+ expression. Run "cmake --help-policy CMP0041" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
+
+ ".*/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
+
+ which is prefixed in the build directory.
diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake
new file mode 100644
index 0000000..ee4c2a6
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake
@@ -0,0 +1,9 @@
+
+add_library(foo empty.cpp)
+target_include_directories(foo INTERFACE
+ include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
+ ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
+)
+install(TARGETS foo EXPORT FooExport DESTINATION lib)
+install(EXPORT FooExport DESTINATION lib/cmake)
diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt
new file mode 100644
index 0000000..11ea636
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
new file mode 100644
index 0000000..a5e2114
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(CMP0041-OLD)
+run_cmake(CMP0041-NEW)
+run_cmake(CMP0041-WARN)
+run_cmake(CMP0041-tid-OLD)
+run_cmake(CMP0041-tid-NEW)
+run_cmake(CMP0041-tid-WARN)
diff --git a/Tests/RunCMake/CMP0041/empty.cpp b/Tests/RunCMake/CMP0041/empty.cpp
new file mode 100644
index 0000000..bfbbdde
--- /dev/null
+++ b/Tests/RunCMake/CMP0041/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 407f965..593921f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -60,6 +60,7 @@ add_RunCMake_test(CMP0037)
add_RunCMake_test(CMP0038)
add_RunCMake_test(CMP0039)
add_RunCMake_test(CMP0040)
+add_RunCMake_test(CMP0041)
add_RunCMake_test(CTest)
if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)
diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt
index 12cd3c7..f452db1 100644
--- a/Tests/RunCMake/include_directories/CMakeLists.txt
+++ b/Tests/RunCMake/include_directories/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.4)
-project(${RunCMake_TEST} NONE)
+project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index f66823e..c00b924 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -11,3 +11,4 @@ run_cmake(RelativePathInGenex)
run_cmake(CMP0021)
run_cmake(install_config)
run_cmake(incomplete-genex)
+run_cmake(export-NOWARN)
diff --git a/Tests/RunCMake/include_directories/export-NOWARN-result.txt b/Tests/RunCMake/include_directories/export-NOWARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/include_directories/export-NOWARN.cmake
new file mode 100644
index 0000000..307ce5a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/export-NOWARN.cmake
@@ -0,0 +1,62 @@
+
+add_library(foo empty.cpp)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<0:>/include/subdir)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_PREFIX>/include/subdir)
+
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/subdir>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/subdir>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/$<0:>>)
+set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<0:>/include>)
+
+# target_include_directories(foo INTERFACE include/subdir) # Does and should warn. INSTALL_INTERFACE must not list src dir paths.
+target_include_directories(foo INTERFACE $<0:>/include/subdir) # Does not and should not should warn, because it starts with a genex.
+target_include_directories(foo INTERFACE $<INSTALL_PREFIX>/include/subdir)
+
+target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/subdir>)
+target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/$<0:>>)
+
+install(TARGETS foo EXPORT FooTargets DESTINATION lib)
+install(EXPORT FooTargets DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets2
+ DESTINATION lib
+ INCLUDES DESTINATION include # No warning. Implicit install prefix.
+)
+install(EXPORT FooTargets2 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets3
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_PREFIX>include
+)
+install(EXPORT FooTargets3 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets4
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:include>
+)
+install(EXPORT FooTargets4 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets5
+ DESTINATION lib
+ # The $<0:> is evaluated at export time, leaving 'include' behind, which should be treated as above.
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:$<0:>include>
+)
+install(EXPORT FooTargets5 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets6
+ DESTINATION lib
+ INCLUDES DESTINATION $<INSTALL_INTERFACE:include$<0:>>
+)
+install(EXPORT FooTargets6 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets7
+ DESTINATION lib
+ INCLUDES DESTINATION include$<0:>
+)
+install(EXPORT FooTargets7 DESTINATION lib/cmake)
+
+install(TARGETS foo EXPORT FooTargets8
+ DESTINATION lib
+ INCLUDES DESTINATION $<0:>include
+)
+install(EXPORT FooTargets8 DESTINATION lib/cmake)