summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/set.rst163
-rw-r--r--Help/command/set_directory_properties.rst9
-rw-r--r--Help/command/set_source_files_properties.rst6
-rw-r--r--Help/command/set_tests_properties.rst30
-rw-r--r--Help/command/target_include_directories.rst3
-rw-r--r--Help/command/target_link_libraries.rst215
-rw-r--r--Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt38
-rw-r--r--Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt25
-rw-r--r--Help/manual/OPTIONS_BUILD.txt12
-rw-r--r--Help/manual/cmake-buildsystem.7.rst5
-rw-r--r--Help/manual/cmake-generators.7.rst26
-rw-r--r--Help/manual/cmake-language.7.rst2
-rw-r--r--Help/manual/cmake-packages.7.rst178
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake-properties.7.rst17
-rw-r--r--Help/policy/CMP0059.rst17
-rw-r--r--Help/prop_dir/DEFINITIONS.rst11
-rw-r--r--Help/prop_sf/VS_XAML_TYPE.rst6
-rw-r--r--Help/prop_test/FAIL_REGULAR_EXPRESSION.rst11
-rw-r--r--Help/prop_test/PASS_REGULAR_EXPRESSION.rst10
-rw-r--r--Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst3
-rw-r--r--Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst3
-rw-r--r--Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst3
-rw-r--r--Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst3
-rw-r--r--Help/release/dev/FindCUDA-StaticRuntime.rst7
-rw-r--r--Help/release/dev/remove-DEFINITIONS-directory-property.rst6
-rw-r--r--Help/release/dev/vs-xaml.rst6
-rw-r--r--Modules/FindCUDA.cmake85
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx5
-rw-r--r--Source/CPack/cpack.cxx3
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx2
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx1
-rw-r--r--Source/cmCacheManager.cxx38
-rw-r--r--Source/cmCacheManager.h6
-rw-r--r--Source/cmDependsC.cxx21
-rw-r--r--Source/cmGeneratorExpressionNode.cxx1
-rw-r--r--Source/cmGeneratorTarget.cxx49
-rw-r--r--Source/cmGeneratorTarget.h13
-rw-r--r--Source/cmGlobalGenerator.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmListFileCache.cxx6
-rw-r--r--Source/cmListFileCache.h5
-rw-r--r--Source/cmMakefile.cxx37
-rw-r--r--Source/cmMakefile.h44
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h2
-rw-r--r--Source/cmSubdirCommand.cxx7
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx80
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h3
-rw-r--r--Source/cmake.cxx8
-rw-r--r--Source/cmake.h4
-rw-r--r--Tests/CMakeLists.txt11
-rw-r--r--Tests/CMakeTests/ELFTest.cmake.in2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt18
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0059/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake1
-rw-r--r--Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake20
-rw-r--r--Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt10
-rw-r--r--Tests/RunCMake/CPackSymlinks/testcpacksym.tarbin0 -> 10240 bytes
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends-check.cmake13
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends/test.c2
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends/test.h1
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.hbin0 -> 58 bytes
-rw-r--r--Tests/VSWindowsFormsResx/CMakeLists.txt2
-rw-r--r--Tests/VSXaml/App.xaml7
-rw-r--r--Tests/VSXaml/App.xaml.cpp125
-rw-r--r--Tests/VSXaml/App.xaml.h27
-rw-r--r--Tests/VSXaml/Assets/Logo.scale-100.pngbin0 -> 801 bytes
-rw-r--r--Tests/VSXaml/Assets/SmallLogo.scale-100.pngbin0 -> 329 bytes
-rw-r--r--Tests/VSXaml/Assets/SplashScreen.scale-100.pngbin0 -> 2146 bytes
-rw-r--r--Tests/VSXaml/Assets/StoreLogo.scale-100.pngbin0 -> 429 bytes
-rw-r--r--Tests/VSXaml/CMakeLists.txt52
-rw-r--r--Tests/VSXaml/MainPage.xaml14
-rw-r--r--Tests/VSXaml/MainPage.xaml.cpp27
-rw-r--r--Tests/VSXaml/MainPage.xaml.h21
-rw-r--r--Tests/VSXaml/Package.appxmanifest41
-rw-r--r--Tests/VSXaml/VSXaml_TemporaryKey.pfxbin0 -> 2560 bytes
-rw-r--r--Tests/VSXaml/pch.cpp6
-rw-r--r--Tests/VSXaml/pch.h11
-rw-r--r--Utilities/cmliblzma/config.h.in8
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c3
94 files changed, 1279 insertions, 492 deletions
diff --git a/Help/command/set.rst b/Help/command/set.rst
index 7a59550..d04b880 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -1,116 +1,89 @@
set
---
-Set a CMake, cache or environment variable to a given value.
+Set a normal, cache, or environment variable to a given value.
+See the :ref:`cmake-language(7) variables <CMake Language Variables>`
+documentation for the scopes and interaction of normal variables
+and cache entries.
+
+Signatures of this command that specify a ``<value>...`` placeholder
+expect zero or more arguments. Multiple arguments will be joined as
+a :ref:`;-list <CMake Language Lists>` to form the actual variable
+value to be set. Zero arguments will cause normal variables to be
+unset. See the :command:`unset` command to unset variables explicitly.
+
+Set Normal Variable
+^^^^^^^^^^^^^^^^^^^
::
- set(<variable> <value>
- [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
+ set(<variable> <value>... [PARENT_SCOPE])
+
+Set the given ``<variable>`` in the current function or directory scope.
-Within CMake sets <variable> to the value <value>. <value> is
-expanded before <variable> is set to it. Normally, set will set a
-regular CMake variable. If CACHE is present, then the <variable> is
-put in the cache instead, unless it is already in the cache. See
-section 'Variable types in CMake' below for details of regular and
-cache variables and their interactions. If CACHE is used, <type> and
-<docstring> are required. <type> is used by the CMake GUI to choose a
-widget with which the user sets a value. The value for <type> may be
-one of
+If the ``PARENT_SCOPE`` option is given the variable will be set in
+the scope above the current scope. Each new directory or function
+creates a new scope. This command will set the value of a variable
+into the parent directory or calling function (whichever is applicable
+to the case at hand).
+
+Set Cache Entry
+^^^^^^^^^^^^^^^
::
- FILEPATH = File chooser dialog.
- PATH = Directory chooser dialog.
- STRING = Arbitrary string.
- BOOL = Boolean ON/OFF checkbox.
- INTERNAL = No GUI entry (used for persistent variables).
+ set(<variable> <value>... CACHE <type> <docstring> [FORCE])
-If <type> is INTERNAL, the cache variable is marked as internal, and
-will not be shown to the user in tools like cmake-gui. This is
-intended for values that should be persisted in the cache, but which
-users should not normally change. INTERNAL implies FORCE.
+Set the given cache ``<variable>`` (cache entry). Since cache entries
+are meant to provide user-settable values this does not overwrite
+existing cache entries by default. Use the ``FORCE`` option to
+overwrite existing entries.
-Normally, set(...CACHE...) creates cache variables, but does not
-modify them. If FORCE is specified, the value of the cache variable
-is set, even if the variable is already in the cache. This should
-normally be avoided, as it will remove any changes to the cache
-variable's value by the user.
+The ``<type>`` must be specified as one of:
-If PARENT_SCOPE is present, the variable will be set in the scope
-above the current scope. Each new directory or function creates a new
-scope. This command will set the value of a variable into the parent
-directory or calling function (whichever is applicable to the case at
-hand). PARENT_SCOPE cannot be combined with CACHE.
+``BOOL``
+ Boolean ``ON/OFF`` value. :manual:`cmake-gui(1)` offers a checkbox.
-If <value> is not specified then the variable is removed instead of
-set. See also: the unset() command.
+``FILEPATH``
+ Path to a file on disk. :manual:`cmake-gui(1)` offers a file dialog.
-::
+``PATH``
+ Path to a directory on disk. :manual:`cmake-gui(1)` offers a file dialog.
- set(<variable> <value1> ... <valueN>)
+``STRING``
+ A line of text. :manual:`cmake-gui(1)` offers a text field or a
+ drop-down selection if the :prop_cache:`STRINGS` cache entry
+ property is set.
-In this case <variable> is set to a semicolon separated list of
-values.
+``INTERNAL``
+ A line of text. :manual:`cmake-gui(1)` does not show internal entries.
+ They may be used to store variables persistently across runs.
+ Use of this type implies ``FORCE``.
-<variable> can be an environment variable such as:
+The ``<docstring>`` must be specified as a line of text providing
+a quick summary of the option for presentation to :manual:`cmake-gui(1)`
+users.
+
+If the cache entry does not exist prior to the call or the ``FORCE``
+option is given then the cache entry will be set to the given value.
+Furthermore, any normal variable binding in the current scope will
+be removed to expose the newly cached value to any immediately
+following evaluation.
+
+It is possible for the cache entry to exist prior to the call but
+have no type set if it was created on the :manual:`cmake(1)` command
+line by a user through the ``-D<var>=<value>`` option without
+specifying a type. In this case the ``set`` command will add the
+type. Furthermore, if the ``<type>`` is ``PATH`` or ``FILEPATH``
+and the ``<value>`` provided on the command line is a relative path,
+then the ``set`` command will treat the path as relative to the
+current working directory and convert it to an absolute path.
+
+Set Environment Variable
+^^^^^^^^^^^^^^^^^^^^^^^^
::
- set( ENV{PATH} /home/martink )
-
-in which case the environment variable will be set.
-
-*** Variable types in CMake ***
-
-In CMake there are two types of variables: normal variables and cache
-variables. Normal variables are meant for the internal use of the
-script (just like variables in most programming languages); they are
-not persisted across CMake runs. Cache variables (unless set with
-INTERNAL) are mostly intended for configuration settings where the
-first CMake run determines a suitable default value, which the user
-can then override, by editing the cache with tools such as ccmake or
-cmake-gui. Cache variables are stored in the CMake cache file, and
-are persisted across CMake runs.
-
-Both types can exist at the same time with the same name but different
-values. When ${FOO} is evaluated, CMake first looks for a normal
-variable 'FOO' in scope and uses it if set. If and only if no normal
-variable exists then it falls back to the cache variable 'FOO'.
-
-Some examples:
-
-The code 'set(FOO "x")' sets the normal variable 'FOO'. It does not
-touch the cache, but it will hide any existing cache value 'FOO'.
-
-The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache,
-ignoring any normal variable of the same name. If 'FOO' is in the
-cache then nothing happens to either the normal variable or the cache
-variable. If 'FOO' is not in the cache, then it is added to the
-cache.
-
-Finally, whenever a cache variable is added or modified by a command,
-CMake also *removes* the normal variable of the same name from the
-current scope so that an immediately following evaluation of it will
-expose the newly cached value.
-
-Normally projects should avoid using normal and cache variables of the
-same name, as this interaction can be hard to follow. However, in
-some situations it can be useful. One example (used by some
-projects):
-
-A project has a subproject in its source tree. The child project has
-its own CMakeLists.txt, which is included from the parent
-CMakeLists.txt using add_subdirectory(). Now, if the parent and the
-child project provide the same option (for example a compiler option),
-the parent gets the first chance to add a user-editable option to the
-cache. Normally, the child would then use the same value that the
-parent uses. However, it may be necessary to hard-code the value for
-the child project's option while still allowing the user to edit the
-value used by the parent project. The parent project can achieve this
-simply by setting a normal variable with the same name as the option
-in a scope sufficient to hide the option's cache variable from the
-child completely. The parent has already set the cache variable, so
-the child's set(...CACHE...) will do nothing, and evaluating the
-option variable will use the value from the normal variable, which
-hides the cache variable.
+ set(ENV{<variable>} <value>...)
+
+Set the current process environment ``<variable>`` to the given value.
diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst
index 834013a..e485fce 100644
--- a/Help/command/set_directory_properties.rst
+++ b/Help/command/set_directory_properties.rst
@@ -7,9 +7,6 @@ Set a property of the directory.
set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
-Set a property for the current directory and subdirectories. If the
-property is not found, CMake will report an error. The properties
-include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES,
-INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES.
-ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned as
-a part of "make clean" stage.
+Set a property for the current directory and subdirectories. See
+:ref:`Directory Properties` for the list of properties known
+to CMake.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index 8ea02a3..b4904e8 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -10,6 +10,6 @@ Source files can have properties that affect how they are built.
[prop2 value2 [...]])
Set properties associated with source files using a key/value paired
-list. See properties documentation for those known to CMake.
-Unrecognized properties are ignored. Source file properties are
-visible only to targets added in the same directory (CMakeLists.txt).
+list. See :ref:`Source File Properties` for the list of properties known
+to CMake. Source file properties are visible only to targets added
+in the same directory (CMakeLists.txt).
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst
index afac847..3efb165 100644
--- a/Help/command/set_tests_properties.rst
+++ b/Help/command/set_tests_properties.rst
@@ -8,29 +8,7 @@ Set a property of the tests.
set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
Set a property for the tests. If the test is not found, CMake
-will report an error. Generator expressions will be expanded the same
-as supported by the test's add_test call. The properties include:
-
-WILL_FAIL: If set to true, this will invert the pass/fail flag of the
-test.
-
-PASS_REGULAR_EXPRESSION: If set, the test output will be checked
-against the specified regular expressions and at least one of the
-regular expressions has to match, otherwise the test will fail.
-
-::
-
- Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok"
-
-FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of
-specified regular expressions, the test will fail.
-
-::
-
- Example: FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
-
-Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a list
-of regular expressions.
-
-TIMEOUT: Setting this will limit the test runtime to the number of
-seconds specified.
+will report an error.
+:manual:`Generator expressions <cmake-generator-expressions(7)>` will be
+expanded the same as supported by the test's :command:`add_test` call. See
+:ref:`Test Properties` for the list of properties known to CMake.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 1d236ce..30ec2cb 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -55,5 +55,8 @@ installation prefix. For example:
$<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
)
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index e6a82b6..393c8b4 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -1,38 +1,107 @@
target_link_libraries
---------------------
-Link a target to given libraries.
+.. only:: html
+
+ .. contents::
+
+Specify libraries or flags to use when linking a given target and/or
+its dependents. :ref:`Usage requirements <Target Usage Requirements>`
+from linked library targets will be propagated. Usage requirements
+of a target's dependencies affect compilation of its own sources.
+
+Overview
+^^^^^^^^
+
+This command has several signatures as detailed in subsections below.
+All of them have the general form::
+
+ target_link_libraries(<target> ... <item>... ...)
+
+The named ``<target>`` must have been created in the current directory by
+a command such as :command:`add_executable` or :command:`add_library`.
+Repeated calls for the same ``<target>`` append items in the order called.
+Each ``<item>`` may be:
+
+* **A library target name**: The generated link line will have the
+ full path to the linkable library file associated with the target.
+ The buildsystem will have a dependency to re-link ``<target>`` if
+ the library file changes.
+
+ The named target must be created by :command:`add_library` within
+ the project or as an :ref:`IMPORTED library <Imported Targets>`.
+ If it is created within the project an ordering dependency will
+ automatically be added in the build system to make sure the named
+ library target is up-to-date before the ``<target>`` links.
+
+* **A full path to a library file**: The generated link line will
+ normally preserve the full path to the file. However, there are
+ some cases where CMake must ask the linker to search for the library
+ (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it
+ appears in a system library directory that the compiler front-end
+ may replace with an alternative. Either way, the buildsystem will
+ have a dependency to re-link ``<target>`` if the library file changes.
+
+ If the library file is in a Mac OSX framework, the ``Headers`` directory
+ of the framework will also be processed as a
+ :ref:`usage requirement <Target Usage Requirements>`. This has the same
+ effect as passing the framework directory as an include directory.
+
+* **A plain library name**: The generated link line will ask the linker
+ to search for the library (e.g. ``foo`` becomes ``-lfoo`` or ``foo.lib``).
+
+* **A link flag**: Item names starting with ``-``, but not ``-l`` or
+ ``-framework``, are treated as linker flags. Note that such flags will
+ be treated like any other library link item for purposes of transitive
+ dependencies, so they are generally safe to specify only as private link
+ items that will not propagate to dependents.
+
+* A ``debug``, ``optimized``, or ``general`` keyword immediately followed
+ by another ``<item>``. The item following such a keyword will be used
+ only for the corresponding build configuration. The ``debug`` keyword
+ corresponds to the ``Debug`` configuration (or to configurations named
+ in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set).
+ The ``optimized`` keyword corresponds to all other configurations. The
+ ``general`` keyword corresponds to all configurations, and is purely
+ optional. Higher granularity may be achieved for per-configuration
+ rules by creating and linking to
+ :ref:`IMPORTED library targets <Imported Targets>`.
+
+Items containing ``::``, such as ``Foo::Bar``, are assumed to be
+:ref:`IMPORTED <Imported Targets>` or :ref:`ALIAS <Alias Targets>` library
+target names and will cause an error if no such target exists.
+See policy :policy:`CMP0028`.
+
+Arguments to ``target_link_libraries`` may use "generator expressions"
+with the syntax ``$<...>``. Note however, that generator expressions
+will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`.
+See the :manual:`cmake-generator-expressions(7)` manual for available
+expressions. See the :manual:`cmake-buildsystem(7)` manual for more on
+defining buildsystem properties.
+
+Libraries for a Target and/or its Dependents
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+::
+
+ target_link_libraries(<target>
+ <PRIVATE|PUBLIC|INTERFACE> <item>...
+ [<PRIVATE|PUBLIC|INTERFACE> <item>...]...)
+
+The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to
+specify both the link dependencies and the link interface in one command.
+Libraries and targets following ``PUBLIC`` are linked to, and are made
+part of the link interface. Libraries and targets following ``PRIVATE``
+are linked to, but are not made part of the link interface. Libraries
+following ``INTERFACE`` are appended to the link interface and are not
+used for linking ``<target>``.
+
+Libraries for both a Target and its Dependents
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
- target_link_libraries(<target> [item1 [item2 [...]]]
- [[debug|optimized|general] <item>] ...)
-
-Specify libraries or flags to use when linking a given target. The
-named ``<target>`` must have been created in the current directory by a
-command such as :command:`add_executable` or :command:`add_library`. The
-remaining arguments specify library names or flags. Repeated calls for
-the same ``<target>`` append items in the order called.
-
-If a library name matches that of another target in the project a
-dependency will automatically be added in the build system to make sure
-the library being linked is up-to-date before the target links. Item names
-starting with ``-``, but not ``-l`` or ``-framework``, are treated as
-linker flags. Note that such flags will be treated like any other library
-link item for purposes of transitive dependencies, so they are generally
-safe to specify only as private link items that will not propagate to
-dependents of ``<target>``.
-
-A ``debug``, ``optimized``, or ``general`` keyword indicates that the
-library immediately following it is to be used only for the
-corresponding build configuration. The ``debug`` keyword corresponds to
-the Debug configuration (or to configurations named in the
-:prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set). The
-``optimized`` keyword corresponds to all other configurations. The
-``general`` keyword corresponds to all configurations, and is purely
-optional (assumed if omitted). Higher granularity may be achieved for
-per-configuration rules by creating and linking to
-:ref:`IMPORTED library targets <Imported Targets>`.
+ target_link_libraries(<target> <item>...)
Library dependencies are transitive by default with this signature.
When this target is linked into another target then the libraries
@@ -45,40 +114,34 @@ by setting the property directly. When :policy:`CMP0022` is not set to
of this command may set the property making any libraries linked
exclusively by this signature private.
-CMake will also propagate :ref:`usage requirements <Target Usage Requirements>`
-from linked library targets. Usage requirements of dependencies affect
-compilation of sources in the ``<target>``.
-
-.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES`
-.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
-
-If an ``<item>`` is a library in a Mac OX framework, the ``Headers``
-directory of the framework will also be processed as a
-:ref:`usage requirement <Target Usage Requirements>`. This has the same
-effect as passing the framework directory as an include directory.
-
---------------------------------------------------------------------------
+Libraries for a Target and/or its Dependents (Legacy)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
target_link_libraries(<target>
- <PRIVATE|PUBLIC|INTERFACE> <lib> ...
- [<PRIVATE|PUBLIC|INTERFACE> <lib> ... ] ...])
+ <LINK_PRIVATE|LINK_PUBLIC> <lib>...
+ [<LINK_PRIVATE|LINK_PUBLIC> <lib>...]...)
-The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to
-specify both the link dependencies and the link interface in one command.
-Libraries and targets following ``PUBLIC`` are linked to, and are made
-part of the link interface. Libraries and targets following ``PRIVATE``
-are linked to, but are not made part of the link interface. Libraries
-following ``INTERFACE`` are appended to the link interface and are not
-used for linking ``<target>``.
+The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both
+the link dependencies and the link interface in one command.
+
+This signature is for compatibility only. Prefer the ``PUBLIC`` or
+``PRIVATE`` keywords instead.
+
+Libraries and targets following ``LINK_PUBLIC`` are linked to, and are
+made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
+:policy:`CMP0022` is not ``NEW``, they are also made part of the
+:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following
+``LINK_PRIVATE`` are linked to, but are not made part of the
+:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`).
---------------------------------------------------------------------------
+Libraries for Dependents Only (Legacy)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
- target_link_libraries(<target> LINK_INTERFACE_LIBRARIES
- [[debug|optimized|general] <lib>] ...)
+ target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <item>...)
The ``LINK_INTERFACE_LIBRARIES`` mode appends the libraries to the
:prop_tgt:`INTERFACE_LINK_LIBRARIES` target property instead of using them
@@ -102,28 +165,8 @@ is not ``NEW``, they are also appended to the
``general`` (or without any keyword) are treated as if specified for both
``debug`` and ``optimized``.
---------------------------------------------------------------------------
-
-::
-
- target_link_libraries(<target>
- <LINK_PRIVATE|LINK_PUBLIC>
- [[debug|optimized|general] <lib>] ...
- [<LINK_PRIVATE|LINK_PUBLIC>
- [[debug|optimized|general] <lib>] ...])
-
-The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both
-the link dependencies and the link interface in one command.
-
-This signature is for compatibility only. Prefer the ``PUBLIC`` or
-``PRIVATE`` keywords instead.
-
-Libraries and targets following ``LINK_PUBLIC`` are linked to, and are
-made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
-:policy:`CMP0022` is not ``NEW``, they are also made part of the
-:prop_tgt:`LINK_INTERFACE_LIBRARIES`. Libraries and targets following
-``LINK_PRIVATE`` are linked to, but are not made part of the
-:prop_tgt:`INTERFACE_LINK_LIBRARIES` (or :prop_tgt:`LINK_INTERFACE_LIBRARIES`).
+Cyclic Dependencies of Static Libraries
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The library dependency graph is normally acyclic (a DAG), but in the case
of mutually-dependent ``STATIC`` libraries CMake allows the graph to
@@ -142,14 +185,14 @@ For example, the code
links ``main`` to ``A B A B``. While one repetition is usually
sufficient, pathological object file and symbol arrangements can require
-more. One may handle such cases by manually repeating the component in
-the last ``target_link_libraries`` call. However, if two archives are
-really so interdependent they should probably be combined into a single
-archive.
+more. One may handle such cases by using the
+:prop_tgt:`LINK_INTERFACE_MULTIPLICITY` target property or by manually
+repeating the component in the last ``target_link_libraries`` call.
+However, if two archives are really so interdependent they should probably
+be combined into a single archive, perhaps by using :ref:`Object Libraries`.
-Arguments to target_link_libraries may use "generator expressions"
-with the syntax ``$<...>``. Note however, that generator expressions
-will not be used in OLD handling of :policy:`CMP0003` or :policy:`CMP0004`.
-See the :manual:`cmake-generator-expressions(7)` manual for available
-expressions. See the :manual:`cmake-buildsystem(7)` manual for more on
-defining buildsystem properties.
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
diff --git a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
index 33f7183..a54d728 100644
--- a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
+++ b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
@@ -1,30 +1,18 @@
Note that it is not advisable to populate the ``INSTALL_INTERFACE`` of the
-|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies.
-That would hard-code into installed packages the include directory paths
-for dependencies **as found on the machine the package was made on**.
+|INTERFACE_PROPERTY_LINK| of a target with absolute paths to the include
+directories of dependencies. That would hard-code into installed packages
+the include directory paths for dependencies
+**as found on the machine the package was made on**.
The ``INSTALL_INTERFACE`` of the |INTERFACE_PROPERTY_LINK| is only
-suitable for specifying the required include directories of the target itself,
-not its dependencies.
+suitable for specifying the required include directories for headers
+provided with the target itself, not those provided by the transitive
+dependencies listed in its :prop_tgt:`INTERFACE_LINK_LIBRARIES` target
+property. Those dependencies should themselves be targets that specify
+their own header locations in |INTERFACE_PROPERTY_LINK|.
-That is, code like this is incorrect for targets which will be used to
-generate :manual:`cmake-packages(7)`:
-
-.. code-block:: cmake
-
- target_include_directories(mylib INTERFACE
- $<INSTALL_INTERFACE:${Boost_INCLUDE_DIRS};${OtherDep_INCLUDE_DIRS}>
- )
-
-Dependencies must provide their own :ref:`IMPORTED targets <Imported Targets>`
-which have their own |INTERFACE_PROPERTY_LINK| populated
-appropriately. Those :ref:`IMPORTED targets <Imported Targets>` may then be
-used with the :command:`target_link_libraries` command for ``mylib``.
-
-That way, when a consumer uses the installed package, the
-consumer will run the appropriate :command:`find_package` command to find
-the dependencies on their own machine and populate the
-:ref:`IMPORTED targets <Imported Targets>` with appropriate paths. See
-:ref:`Creating Packages` for more. Note that many modules currently shipped
-with CMake do not currently provide :ref:`IMPORTED targets <Imported Targets>`.
+See the :ref:`Creating Relocatable Packages` section of the
+:manual:`cmake-packages(7)` manual for discussion of additional care
+that must be taken when specifying usage requirements while creating
+packages for redistribution.
diff --git a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt
index ceefa4d..46e84ac 100644
--- a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt
+++ b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt
@@ -1,23 +1,10 @@
Note that it is not advisable to populate the
-|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies.
-That would hard-code into installed packages the include directory paths
+|INTERFACE_PROPERTY_LINK| of a target with absolute paths to dependencies.
+That would hard-code into installed packages the library file paths
for dependencies **as found on the machine the package was made on**.
-That is, code like this is incorrect for targets which will be used to
-generate :manual:`cmake-packages(7)`:
-
-.. code-block:: cmake
-
- target_link_libraries(mylib INTERFACE
- ${Boost_LIBRARIES};${OtherDep_LIBRARIES}
- )
-
-Dependencies must provide their own :ref:`IMPORTED targets <Imported Targets>`
-which have their own :prop_tgt:`IMPORTED_LOCATION` populated
-appropriately. That way, when a consumer uses the installed package, the
-consumer will run the appropriate :command:`find_package` command to find
-the dependencies on their own machine and populate the
-:ref:`IMPORTED targets <Imported Targets>` with appropriate paths. See
-:ref:`Creating Packages` for more. Note that many modules currently shipped
-with CMake do not currently provide :ref:`IMPORTED targets <Imported Targets>`.
+See the :ref:`Creating Relocatable Packages` section of the
+:manual:`cmake-packages(7)` manual for discussion of additional care
+that must be taken when specifying usage requirements while creating
+packages for redistribution.
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 363d0aa..e4c5873 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -10,7 +10,7 @@
containing SET commands that use the CACHE option, not a
cache-format file.
-``-D <var>:<type>=<value>``
+``-D <var>:<type>=<value>, -D <var>=<value>``
Create a cmake cache entry.
When cmake is first run in an empty build tree, it creates a
@@ -19,6 +19,14 @@
takes priority over the project's default value. The option may be
repeated for as many cache entries as desired.
+ If the ``:<type>`` portion is given it must be one of the types
+ specified by the :command:`set` command documentation for its
+ ``CACHE`` signature.
+ If the ``:<type>`` portion is omitted the entry will be created
+ with no type if it does not exist with a type already. If a
+ command in the project sets the type to ``PATH`` or ``FILEPATH``
+ then the ``<value>`` will be converted to an absolute path.
+
``-U <globbing_expr>``
Remove matching entries from CMake cache.
@@ -35,7 +43,7 @@
CMake may support multiple native build systems on certain
platforms. A generator is responsible for generating a particular
build system. Possible generator names are specified in the
- Generators section.
+ :manual:`cmake-generators(7)` manual.
``-T <toolset-name>``
Specify toolset name if supported by generator.
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 002f2c2..ae5e58e 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -143,6 +143,11 @@ use particular :prop_tgt:`COMPILE_OPTIONS` or
the properties must be **requirements**, not merely recommendations or
convenience.
+See the :ref:`Creating Relocatable Packages` section of the
+:manual:`cmake-packages(7)` manual for discussion of additional care
+that must be taken when specifying usage requirements while creating
+packages for redistribution.
+
Target Properties
-----------------
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 804229b..6f76fb1 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -34,6 +34,11 @@ These generators support command-line build tools. In order to use them,
one must launch CMake from a command-line prompt whose environment is
already configured for the chosen compiler and build tool.
+.. _`Makefile Generators`:
+
+Makefile Generators
+^^^^^^^^^^^^^^^^^^^
+
.. toctree::
:maxdepth: 1
@@ -42,10 +47,17 @@ already configured for the chosen compiler and build tool.
/generator/MinGW Makefiles
/generator/NMake Makefiles
/generator/NMake Makefiles JOM
- /generator/Ninja
/generator/Unix Makefiles
/generator/Watcom WMake
+Ninja Generator
+^^^^^^^^^^^^^^^
+
+.. toctree::
+ :maxdepth: 1
+
+ /generator/Ninja
+
IDE Build Tool Generators
-------------------------
@@ -53,6 +65,11 @@ These generators support Integrated Development Environment (IDE)
project files. Since the IDEs configure their own environment
one may launch CMake from any environment.
+.. _`Visual Studio Generators`:
+
+Visual Studio Generators
+^^^^^^^^^^^^^^^^^^^^^^^^
+
.. toctree::
:maxdepth: 1
@@ -65,6 +82,13 @@ one may launch CMake from any environment.
/generator/Visual Studio 11 2012
/generator/Visual Studio 12 2013
/generator/Visual Studio 14 2015
+
+Xcode Generator
+^^^^^^^^^^^^^^^
+
+.. toctree::
+ :maxdepth: 1
+
/generator/Xcode
Extra Generators
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 4a9f0b5..41542c9 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -485,6 +485,8 @@ The :command:`macro`/:command:`endmacro`, and
:command:`function`/:command:`endfunction` commands delimit
code blocks to be recorded for later invocation as commands.
+.. _`CMake Language Variables`:
+
Variables
=========
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index 3367ba4..b9073a5 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -373,38 +373,6 @@ attempt to use version 3 together with version 4. Packages can choose to
employ such a pattern if different major versions of the package are designed
to be incompatible.
-Note that it is not advisable to populate any properties which may contain
-paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and
-:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevnt to dependencies.
-That would hard-code into installed packages the include directory or library
-paths for dependencies **as found on the machine the package was made on**.
-
-That is, code like this is incorrect for targets which will be used to
-generate config file packages:
-
-.. code-block:: cmake
-
- target_link_libraries(ClimbingStats INTERFACE
- ${Boost_LIBRARIES};${OtherDep_LIBRARIES}>
- )
- target_include_directories(ClimbingStats INTERFACE
- $<INSTALL_INTERFACE:${Boost_INCLUDE_DIRS};${OtherDep_INCLUDE_DIRS}>
- )
-
-Dependencies must provide their own :ref:`IMPORTED targets <Imported Targets>`
-which have their own :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and
-:prop_tgt:`IMPORTED_LOCATION` populated appropriately. Those
-:ref:`IMPORTED targets <Imported Targets>` may then be
-used with the :command:`target_link_libraries` command for ``ClimbingStats``.
-
-That way, when a consumer uses the installed package, the
-consumer will run the appropriate :command:`find_package` command (via the
-find_dependency macro described below) to find
-the dependencies on their own machine and populate the
-:ref:`IMPORTED targets <Imported Targets>` with appropriate paths. Note that
-many modules currently shipped with CMake do not currently provide
-:ref:`IMPORTED targets <Imported Targets>`.
-
A ``NAMESPACE`` with double-colons is specified when exporting the targets
for installation. This convention of double-colons gives CMake a hint that
the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams
@@ -418,6 +386,9 @@ directory in the :variable:`CMAKE_INSTALL_PREFIX`. When the ``IMPORTED``
target is used by downsteam, it automatically consumes the entries from
that property.
+Creating a Package Configuration File
+-------------------------------------
+
In this case, the ``ClimbingStatsConfig.cmake`` file could be as simple as:
.. code-block:: cmake
@@ -429,44 +400,6 @@ should be provided by the ``ClimbingStats`` package, they should
be in a separate file which is installed to the same location as the
``ClimbingStatsConfig.cmake`` file, and included from there.
-Packages created by :command:`install(EXPORT)` are designed to be relocatable,
-using paths relative to the location of the package itself. When defining
-the interface of a target for ``EXPORT``, keep in mind that the include
-directories should be specified as relative paths which are relative to the
-:variable:`CMAKE_INSTALL_PREFIX`:
-
-.. code-block:: cmake
-
- target_include_directories(tgt INTERFACE
- # Wrong, not relocatable:
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/TgtName>
- )
-
- target_include_directories(tgt INTERFACE
- # Ok, relocatable:
- $<INSTALL_INTERFACE:include/TgtName>
- )
-
-The ``$<INSTALL_PREFIX>``
-:manual:`generator expression <cmake-generator-expressions(7)>` may be used as
-a placeholder for the install prefix without resulting in a non-relocatable
-package. This is necessary if complex generator expressions are used:
-
-.. code-block:: cmake
-
- target_include_directories(tgt INTERFACE
- # Ok, relocatable:
- $<INSTALL_INTERFACE:$<$<CONFIG:Debug>:$<INSTALL_PREFIX>/include/TgtName>>
- )
-
-The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets
-definition file which is specific to the build-tree, and is not relocatable.
-This can similiarly be used with a suitable package configuration file and
-package version file to define a package for the build tree which may be used
-without installation. Consumers of the build tree can simply ensure that the
-:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the
-``ClimbingStats_DIR`` to ``<build_dir>/ClimbingStats`` in the cache.
-
This can also be extended to cover dependencies:
.. code-block:: cmake
@@ -526,6 +459,111 @@ could not be found because an invalid component was specified. This message
variable can be set for any case where the ``_FOUND`` variable is set to ``False``,
and will be displayed to the user.
+Creating a Package Configuration File for the Build Tree
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets
+definition file which is specific to the build-tree, and is not relocatable.
+This can similiarly be used with a suitable package configuration file and
+package version file to define a package for the build tree which may be used
+without installation. Consumers of the build tree can simply ensure that the
+:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the
+``ClimbingStats_DIR`` to ``<build_dir>/ClimbingStats`` in the cache.
+
+.. _`Creating Relocatable Packages`:
+
+Creating Relocatable Packages
+-----------------------------
+
+A relocatable package must not reference absolute paths of files on
+the machine where the package is built that will not exist on the
+machines where the package may be installed.
+
+Packages created by :command:`install(EXPORT)` are designed to be relocatable,
+using paths relative to the location of the package itself. When defining
+the interface of a target for ``EXPORT``, keep in mind that the include
+directories should be specified as relative paths which are relative to the
+:variable:`CMAKE_INSTALL_PREFIX`:
+
+.. code-block:: cmake
+
+ target_include_directories(tgt INTERFACE
+ # Wrong, not relocatable:
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/TgtName>
+ )
+
+ target_include_directories(tgt INTERFACE
+ # Ok, relocatable:
+ $<INSTALL_INTERFACE:include/TgtName>
+ )
+
+The ``$<INSTALL_PREFIX>``
+:manual:`generator expression <cmake-generator-expressions(7)>` may be used as
+a placeholder for the install prefix without resulting in a non-relocatable
+package. This is necessary if complex generator expressions are used:
+
+.. code-block:: cmake
+
+ target_include_directories(tgt INTERFACE
+ # Ok, relocatable:
+ $<INSTALL_INTERFACE:$<$<CONFIG:Debug>:$<INSTALL_PREFIX>/include/TgtName>>
+ )
+
+This also applies to paths referencing external dependencies.
+It is not advisable to populate any properties which may contain
+paths, such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` and
+:prop_tgt:`INTERFACE_LINK_LIBRARIES`, with paths relevant to dependencies.
+For example, this code may not work well for a relocatable package:
+
+.. code-block:: cmake
+
+ target_link_libraries(ClimbingStats INTERFACE
+ ${Foo_LIBRARIES} ${Bar_LIBRARIES}
+ )
+ target_include_directories(ClimbingStats INTERFACE
+ "$<INSTALL_INTERFACE:${Foo_INCLUDE_DIRS};${Bar_INCLUDE_DIRS}>"
+ )
+
+The referenced variables may contain the absolute paths to libraries
+and include directories **as found on the machine the package was made on**.
+This would create a package with hard-coded paths to dependencies and not
+suitable for relocation.
+
+Ideally such dependencies should be used through their own
+:ref:`IMPORTED targets <Imported Targets>` that have their own
+:prop_tgt:`IMPORTED_LOCATION` and usage requirement properties
+such as :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` populated
+appropriately. Those imported targets may then be used with
+the :command:`target_link_libraries` command for ``ClimbingStats``:
+
+.. code-block:: cmake
+
+ target_link_libraries(ClimbingStats INTERFACE Foo::Foo Bar::Bar)
+
+With this approach the package references its external dependencies
+only through the names of :ref:`IMPORTED targets <Imported Targets>`.
+When a consumer uses the installed package, the consumer will run the
+appropriate :command:`find_package` commands (via the ``find_dependency``
+macro described above) to find the dependencies and populate the
+imported targets with appropriate paths on their own machine.
+
+Unfortunately many :manual:`modules <cmake-modules(7)>` shipped with
+CMake do not yet provide :ref:`IMPORTED targets <Imported Targets>`
+because their development pre-dated this approach. This may improve
+incrementally over time. Workarounds to create relocatable packages
+using such modules include:
+
+* When building the package, specify each ``Foo_LIBRARY`` cache
+ entry as just a library name, e.g. ``-DFoo_LIBRARY=foo``. This
+ tells the corresponding find module to populate the ``Foo_LIBRARIES``
+ with just ``foo`` to ask the linker to search for the library
+ instead of hard-coding a path.
+
+* Or, after installing the package content but before creating the
+ package installation binary for redistribution, manually replace
+ the absolute paths with placeholders for substitution by the
+ installation tool when the package is installed.
+
.. _`Package Registry`:
Package Registry
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 228df14..d2960de 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -116,3 +116,4 @@ All Policies
/policy/CMP0056
/policy/CMP0057
/policy/CMP0058
+ /policy/CMP0059
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 1dff33e..affa75f 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -7,6 +7,8 @@ cmake-properties(7)
.. contents::
+.. _`Global Properties`:
+
Properties of Global Scope
==========================
@@ -41,6 +43,8 @@ Properties of Global Scope
/prop_gbl/TARGET_SUPPORTS_SHARED_LIBS
/prop_gbl/USE_FOLDERS
+.. _`Directory Properties`:
+
Properties on Directories
=========================
@@ -72,6 +76,8 @@ Properties on Directories
/prop_dir/VS_GLOBAL_SECTION_POST_section
/prop_dir/VS_GLOBAL_SECTION_PRE_section
+.. _`Target Properties`:
+
Properties on Targets
=====================
@@ -245,6 +251,8 @@ Properties on Targets
/prop_tgt/XCODE_ATTRIBUTE_an-attribute
/prop_tgt/XCTEST
+.. _`Test Properties`:
+
Properties on Tests
===================
@@ -269,6 +277,8 @@ Properties on Tests
/prop_test/WILL_FAIL
/prop_test/WORKING_DIRECTORY
+.. _`Source File Properties`:
+
Properties on Source Files
==========================
@@ -298,10 +308,13 @@ Properties on Source Files
/prop_sf/VS_SHADER_FLAGS
/prop_sf/VS_SHADER_MODEL
/prop_sf/VS_SHADER_TYPE
+ /prop_sf/VS_XAML_TYPE
/prop_sf/WRAP_EXCLUDE
/prop_sf/XCODE_EXPLICIT_FILE_TYPE
/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE
+.. _`Cache Entry Properties`:
+
Properties on Cache Entries
===========================
@@ -315,6 +328,8 @@ Properties on Cache Entries
/prop_cache/TYPE
/prop_cache/VALUE
+.. _`Installed File Properties`:
+
Properties on Installed Files
=============================
@@ -330,7 +345,7 @@ Properties on Installed Files
Deprecated Properties on Directories
-=====================================
+====================================
.. toctree::
:maxdepth: 1
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
new file mode 100644
index 0000000..e40f450
--- /dev/null
+++ b/Help/policy/CMP0059.rst
@@ -0,0 +1,17 @@
+CMP0059
+-------
+
+Don't treat ``DEFINITIONS`` as a built-in directory property.
+
+CMake 3.3 and above no longer make a list of definitions available through
+the :prop_dir:`DEFINITIONS` directory property. The
+:prop_dir:`COMPILE_DEFINITIONS` directory property may be used instead.
+
+The ``OLD`` behavior for this policy is to provide the list of flags given
+so far to the :command:`add_definitions` command. The ``NEW`` behavior is
+to behave as a normal user-defined directory property.
+
+This policy was introduced in CMake version 3.3.
+CMake version |release| warns when the policy is not set and uses
+``OLD`` behavior. Use the :command:`cmake_policy` command to set
+it to ``OLD`` or ``NEW`` explicitly.
diff --git a/Help/prop_dir/DEFINITIONS.rst b/Help/prop_dir/DEFINITIONS.rst
index 22f7c15..79ac3f3 100644
--- a/Help/prop_dir/DEFINITIONS.rst
+++ b/Help/prop_dir/DEFINITIONS.rst
@@ -1,8 +1,13 @@
DEFINITIONS
-----------
-For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.
+For CMake 2.4 compatibility only. Use :prop_dir:`COMPILE_DEFINITIONS`
+instead.
This read-only property specifies the list of flags given so far to
-the add_definitions command. It is intended for debugging purposes.
-Use the COMPILE_DEFINITIONS instead.
+the :command:`add_definitions` command. It is intended for debugging
+purposes. Use the :prop_dir:`COMPILE_DEFINITIONS` directory property
+instead.
+
+This built-in read-only property does not exist if policy
+:policy:`CMP0059` is set to ``NEW``.
diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst
new file mode 100644
index 0000000..e92191d
--- /dev/null
+++ b/Help/prop_sf/VS_XAML_TYPE.rst
@@ -0,0 +1,6 @@
+VS_XAML_TYPE
+------------
+
+Mark a XAML source file as a different type than the default ``Page``.
+The most common usage would be to set the default App.xaml file as
+ApplicationDefinition.
diff --git a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
index b02d17d..facf902 100644
--- a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
@@ -4,5 +4,12 @@ FAIL_REGULAR_EXPRESSION
If the output matches this regular expression the test will fail.
If set, if the output matches one of specified regular expressions,
-the test will fail.For example: FAIL_REGULAR_EXPRESSION
-"[^a-z]Error;ERROR;Failed"
+the test will fail. Example:
+
+.. code-block:: cmake
+
+ set_tests_properties(mytest PROPERTIES
+ FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
+ )
+
+``FAIL_REGULAR_EXPRESSION`` expects a list of regular expressions.
diff --git a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
index bb35f77..0cd6215 100644
--- a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
@@ -5,4 +5,12 @@ The output must match this regular expression for the test to pass.
If set, the test output will be checked against the specified regular
expressions and at least one of the regular expressions has to match,
-otherwise the test will fail.
+otherwise the test will fail. Example:
+
+.. code-block:: cmake
+
+ set_tests_properties(mytest PROPERTIES
+ PASS_REGULAR_EXPRESSION "TestPassed;All ok"
+ )
+
+``PASS_REGULAR_EXPRESSION`` expects a list of regular expressions.
diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
index 1cfd7a8..b1c40b2 100644
--- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
@@ -22,5 +22,8 @@ installation prefix. For example:
$<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
)
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES``
.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
index 55b7b8d..832d12b 100644
--- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
@@ -17,5 +17,8 @@ with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES``
.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
index 2e859eb..2dcf45c 100644
--- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
+++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
@@ -24,5 +24,8 @@ property if policy :policy:`CMP0022` is ``NEW``.
This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES`
instead.
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES``
.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
index 7f2b5dd..22ee5a6 100644
--- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
+++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
@@ -13,5 +13,8 @@ property if policy :policy:`CMP0022` is ``NEW``.
This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES`
instead.
+Creating Relocatable Packages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
.. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES_<CONFIG>``
.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
diff --git a/Help/release/dev/FindCUDA-StaticRuntime.rst b/Help/release/dev/FindCUDA-StaticRuntime.rst
new file mode 100644
index 0000000..112596c
--- /dev/null
+++ b/Help/release/dev/FindCUDA-StaticRuntime.rst
@@ -0,0 +1,7 @@
+FindCUDA-StaticRuntime
+----------------------
+
+* The :module:`FindCUDA` module now defaults to using the static
+ CUDA runtime library if it is available. A new
+ ``CUDA_USE_STATIC_CUDA_RUNTIME`` option is offered to control
+ this behavior.
diff --git a/Help/release/dev/remove-DEFINITIONS-directory-property.rst b/Help/release/dev/remove-DEFINITIONS-directory-property.rst
new file mode 100644
index 0000000..d8e50f0
--- /dev/null
+++ b/Help/release/dev/remove-DEFINITIONS-directory-property.rst
@@ -0,0 +1,6 @@
+remove-DEFINITIONS-property
+---------------------------
+
+* The :command:`add_definitions()` command no longer causes a
+ :prop_dir:`DEFINITIONS` directory property to be populated. See policy
+ :policy:`CMP0059`.
diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst
new file mode 100644
index 0000000..575899f
--- /dev/null
+++ b/Help/release/dev/vs-xaml.rst
@@ -0,0 +1,6 @@
+vs-xaml
+-------
+
+* The :ref:`Visual Studio Generators` learned to support ``.xaml``
+ source files and automatically associate them with corresponding
+ ``.h`` and ``.cpp`` sources.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 81e1cad..8f80993 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -106,6 +106,11 @@
# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
#
+# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
+# -- When enabled the static version of the CUDA runtime library will be used
+# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support
+# this option, then it will be silently disabled.
+#
# CUDA_VERBOSE_BUILD (Default OFF)
# -- Set to ON to see all the commands used when building the CUDA file. When
# using a Makefile generator the value defaults to VERBOSE (run make
@@ -272,6 +277,8 @@
# CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
# implementation (alterative to:
# CUDA_ADD_CUBLAS_TO_TARGET macro).
+# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
+# Only available for CUDA version 5.5+
# CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
# Only available for CUDA version 4.0+.
# CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
@@ -518,11 +525,12 @@ macro(cuda_unset_include_and_libraries)
# This only existed in the 3.0 version of the CUDA toolkit
unset(CUDA_CUDARTEMU_LIBRARY CACHE)
endif()
- unset(CUDA_cupti_LIBRARY CACHE)
+ unset(CUDA_cudart_static_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE)
unset(CUDA_cufft_LIBRARY CACHE)
unset(CUDA_cufftemu_LIBRARY CACHE)
+ unset(CUDA_cupti_LIBRARY CACHE)
unset(CUDA_curand_LIBRARY CACHE)
unset(CUDA_cusolver_LIBRARY CACHE)
unset(CUDA_cusparse_LIBRARY CACHE)
@@ -532,6 +540,8 @@ macro(cuda_unset_include_and_libraries)
unset(CUDA_npps_LIBRARY CACHE)
unset(CUDA_nvcuvenc_LIBRARY CACHE)
unset(CUDA_nvcuvid_LIBRARY CACHE)
+
+ unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE)
endmacro()
# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed,
@@ -539,8 +549,8 @@ endmacro()
if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_TOOLKIT_TARGET_DIR CACHE)
unset(CUDA_NVCC_EXECUTABLE CACHE)
- unset(CUDA_VERSION CACHE)
cuda_unset_include_and_libraries()
+ unset(CUDA_VERSION CACHE)
endif()
if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}")
@@ -696,6 +706,53 @@ if(CUDA_VERSION VERSION_EQUAL "3.0")
CUDA_CUDARTEMU_LIBRARY
)
endif()
+if(NOT CUDA_VERSION VERSION_LESS "5.5")
+ cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library")
+ mark_as_advanced(CUDA_cudart_static_LIBRARY)
+endif()
+if(CUDA_cudart_static_LIBRARY)
+ # Set whether to use the static cuda runtime.
+ option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON)
+else()
+ option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF)
+endif()
+
+if(CUDA_USE_STATIC_CUDA_RUNTIME)
+ if(UNIX)
+ # Check for the dependent libraries. Here we look for pthreads.
+ if (DEFINED CMAKE_THREAD_PREFER_PTHREAD)
+ set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD})
+ endif()
+ set(CMAKE_THREAD_PREFER_PTHREAD 1)
+
+ # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;}
+ # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and
+ # -Werror causes the try_compile to fail. We will just temporarily disable other flags
+ # when doing the find_package command here.
+ set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS})
+ set(CMAKE_C_FLAGS "-fPIC")
+ find_package(Threads REQUIRED)
+ set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags})
+
+ if (DEFINED _cuda_cmake_thread_prefer_pthread)
+ set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread})
+ unset(_cuda_cmake_thread_prefer_pthread)
+ else()
+ unset(CMAKE_THREAD_PREFER_PTHREAD)
+ endif()
+ if (NOT APPLE)
+ # Here is librt that has things such as, clock_gettime, shm_open, and shm_unlink.
+ find_library(CUDA_rt_LIBRARY rt)
+ find_library(CUDA_dl_LIBRARY dl)
+ if (NOT CUDA_rt_LIBRARY)
+ message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.")
+ endif()
+ if (NOT CUDA_dl_LIBRARY)
+ message(WARNING "Expecting to find libdl for libcudart_static, but didn't find it.")
+ endif()
+ endif()
+ endif()
+endif()
# CUPTI library showed up in cuda toolkit 4.0
if(NOT CUDA_VERSION VERSION_LESS "4.0")
@@ -703,12 +760,32 @@ if(NOT CUDA_VERSION VERSION_LESS "4.0")
mark_as_advanced(CUDA_cupti_LIBRARY)
endif()
+# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are
+# using the CUDA runtime. For the dynamic version of the runtime, most of the
+# dependencies are brough in, but for the static version there are additional libraries
+# and linker commands needed.
+# Initialize to empty
+set(CUDA_LIBRARIES)
+
# If we are using emulation mode and we found the cudartemu library then use
# that one instead of cudart.
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
- set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
+ list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
+elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY)
+ list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+ if (CUDA_rt_LIBRARY)
+ list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
+ endif()
+ if (CUDA_dl_LIBRARY)
+ list(APPEND CUDA_LIBRARIES ${CUDA_dl_LIBRARY})
+ endif()
+ if(APPLE)
+ # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that
+ # the static cuda runtime can find it at runtime.
+ list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib)
+ endif()
else()
- set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+ list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
endif()
# 1.1 toolkit on linux doesn't appear to have a separate library on
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 19d6c87..eed106d 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150402)
+set(CMake_VERSION_PATCH 20150407)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 67005ef..995eb0d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1499,7 +1499,10 @@ bool cmCPackGenerator::SupportsComponentInstallation() const
//----------------------------------------------------------------------
bool cmCPackGenerator::WantsComponentInstallation() const
{
- return (!IsOn("CPACK_MONOLITHIC_INSTALL") & SupportsComponentInstallation());
+ return (!IsOn("CPACK_MONOLITHIC_INSTALL")
+ && SupportsComponentInstallation()
+ // check that package at least has components
+ && !(this->ComponentGroups.empty() || this->Components.empty()));
}
//----------------------------------------------------------------------
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 6106472..00b23cd 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -203,6 +203,9 @@ int main (int argc, char const* const* argv)
cmgg.SetCMakeInstance(&cminst);
cmsys::auto_ptr<cmLocalGenerator> cmlg(cmgg.CreateLocalGenerator());
cmMakefile* globalMF = cmlg->GetMakefile();
+#if defined(__CYGWIN__)
+ globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
+#endif
bool cpackConfigFileSpecified = true;
if ( cpackConfigFile.empty() )
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 01598bc..9d55c1a 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -122,7 +122,7 @@ bool cmAddSubDirectoryCommand::InitialPass
// Add the subdirectory using the computed full paths.
this->Makefile->AddSubDirectory(srcPath, binPath,
- excludeFromAll, false, true);
+ excludeFromAll, true);
return true;
}
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index a30d992..b8238f8 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -26,7 +26,6 @@ bool cmAuxSourceDirectoryCommand::InitialPass
std::string sourceListValue;
std::string templateDirectory = args[0];
- this->Makefile->AddExtraDirectory(templateDirectory.c_str());
std::string tdir;
if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str()))
{
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 0c77891..fa7eff3 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -76,22 +76,10 @@ bool cmCacheManager::IsType(const char* s)
return false;
}
-bool cmCacheManager::LoadCache(cmMakefile* mf)
-{
- return this->LoadCache(mf->GetHomeOutputDirectory());
-}
-
-
bool cmCacheManager::LoadCache(const std::string& path)
{
- return this->LoadCache(path,true);
-}
-
-bool cmCacheManager::LoadCache(const std::string& path,
- bool internal)
-{
std::set<std::string> emptySet;
- return this->LoadCache(path, internal, emptySet, emptySet);
+ return this->LoadCache(path, true, emptySet, emptySet);
}
static bool ParseEntryWithoutType(const std::string& entry,
@@ -418,12 +406,6 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os,
}
}
-bool cmCacheManager::SaveCache(cmMakefile* mf)
-{
- return this->SaveCache(mf->GetHomeOutputDirectory());
-}
-
-
bool cmCacheManager::SaveCache(const std::string& path)
{
std::string cacheFile = path;
@@ -914,21 +896,3 @@ bool cmCacheManager::CacheIterator::PropertyExists(
{
return this->GetProperty(prop)? true:false;
}
-
-//----------------------------------------------------------------------------
-bool cmCacheManager::NeedCacheCompatibility(int major, int minor)
-{
- // Compatibility is not needed if the cache version is zero because
- // the cache was created or modified by the user.
- if(this->CacheMajorVersion == 0)
- {
- return false;
- }
-
- // Compatibility is needed if the cache version is equal to or lower
- // than the given version.
- cmIML_INT_uint64_t actual_compat =
- CMake_VERSION_ENCODE(this->CacheMajorVersion, this->CacheMinorVersion, 0);
- return (actual_compat &&
- actual_compat <= CMake_VERSION_ENCODE(major, minor, 0));
-}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index d9a9112..f7f8776 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -105,17 +105,12 @@ public:
static const char* TypeToString(CacheEntryType);
static bool IsType(const char*);
- ///! Load a cache for given makefile. Loads from ouput home.
- bool LoadCache(cmMakefile*);
///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const std::string& path);
- bool LoadCache(const std::string& path, bool internal);
bool LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes,
std::set<std::string>& includes);
- ///! Save cache for given makefile. Saves to ouput home CMakeCache.txt.
- bool SaveCache(cmMakefile*) ;
///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt
bool SaveCache(const std::string& path) ;
@@ -149,7 +144,6 @@ public:
{ return this->CacheMajorVersion; }
unsigned int GetCacheMinorVersion() const
{ return this->CacheMinorVersion; }
- bool NeedCacheCompatibility(int major, int minor);
protected:
///! Add an entry into the cache
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 63d8fa6..6cdd4c1 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -242,13 +242,22 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
cmsys::ifstream fin(fullName.c_str());
if(fin)
{
- // Add this file as a dependency.
- dependencies.insert(fullName);
+ cmsys::FStream::BOM bom = cmsys::FStream::ReadBOM(fin);
+ if(bom == cmsys::FStream::BOM_None ||
+ bom == cmsys::FStream::BOM_UTF8)
+ {
+ // Add this file as a dependency.
+ dependencies.insert(fullName);
- // Scan this file for new dependencies. Pass the directory
- // containing the file to handle double-quote includes.
- std::string dir = cmSystemTools::GetFilenamePath(fullName);
- this->Scan(fin, dir.c_str(), fullName);
+ // Scan this file for new dependencies. Pass the directory
+ // containing the file to handle double-quote includes.
+ std::string dir = cmSystemTools::GetFilenamePath(fullName);
+ this->Scan(fin, dir.c_str(), fullName);
+ }
+ else
+ {
+ // Skip file with encoding we do not implement.
+ }
}
}
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 673dcb9..2654851 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1554,7 +1554,6 @@ class ArtifactPdbTag;
class ArtifactPathTag;
class ArtifactDirTag;
-class ArtifactNameTag;
//----------------------------------------------------------------------------
template<typename ArtifactT>
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e0af47a..41d12d7 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -56,6 +56,7 @@ struct ResxTag {};
struct ModuleDefinitionFileTag {};
struct AppManifestTag{};
struct CertificatesTag{};
+struct XamlTag{};
template<typename Tag, typename OtherTag>
struct IsSameTag
@@ -98,6 +99,20 @@ struct DoAccept<true>
data.ExpectedResxHeaders.insert(hFileName);
data.ResxSources.push_back(f);
}
+ static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f)
+ {
+ // Build and save the name of the corresponding .h and .cpp file
+ // This relationship will be used later when building the project files.
+ // Both names would have been auto generated from Visual Studio
+ // where the user supplied the file name and Visual Studio
+ // appended the suffix.
+ std::string xaml = f->GetFullPath();
+ std::string hFileName = xaml + ".h";
+ std::string cppFileName = xaml + ".cpp";
+ data.ExpectedXamlHeaders.insert(hFileName);
+ data.ExpectedXamlSources.insert(cppFileName);
+ data.XamlSources.push_back(f);
+ }
static void Do(std::string& data, cmSourceFile* f)
{
data = f->GetFullPath();
@@ -186,6 +201,10 @@ struct TagVisitor
{
DoAccept<IsSameTag<Tag, CertificatesTag>::Result>::Do(this->Data, sf);
}
+ else if (ext == "xaml")
+ {
+ DoAccept<IsSameTag<Tag, XamlTag>::Result>::Do(this->Data, sf);
+ }
else if(this->Header.find(sf->GetFullPath().c_str()))
{
DoAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>::Do(this->Data, sf);
@@ -438,6 +457,36 @@ cmGeneratorTarget
}
//----------------------------------------------------------------------------
+void
+cmGeneratorTarget::GetExpectedXamlHeaders(std::set<std::string>& headers,
+ const std::string& config) const
+{
+ XamlData data;
+ IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
+ headers = data.ExpectedXamlHeaders;
+}
+
+//----------------------------------------------------------------------------
+void
+cmGeneratorTarget::GetExpectedXamlSources(std::set<std::string>& srcs,
+ const std::string& config) const
+{
+ XamlData data;
+ IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
+ srcs = data.ExpectedXamlSources;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget
+::GetXamlSources(std::vector<cmSourceFile const*>& srcs,
+ const std::string& config) const
+{
+ XamlData data;
+ IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
+ srcs = data.XamlSources;
+}
+
+//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const
{
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c329cf5..c79aa72 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -58,6 +58,12 @@ public:
const std::string& config) const;
void GetCertificates(std::vector<cmSourceFile const*>&,
const std::string& config) const;
+ void GetXamlSources(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetExpectedXamlHeaders(std::set<std::string>&,
+ const std::string& config) const;
+ void GetExpectedXamlSources(std::set<std::string>&,
+ const std::string& config) const;
void ComputeObjectMapping();
@@ -132,6 +138,13 @@ public:
mutable std::set<std::string> ExpectedResxHeaders;
mutable std::vector<cmSourceFile const*> ResxSources;
};
+
+ struct XamlData {
+ std::set<std::string> ExpectedXamlHeaders;
+ std::set<std::string> ExpectedXamlSources;
+ std::vector<cmSourceFile const*> XamlSources;
+ };
+
private:
friend class cmTargetTraceDependencies;
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8123c99..3c0a0e2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1537,10 +1537,9 @@ void cmGlobalGenerator::CheckLocalGenerators()
std::map<std::string, std::string> notFoundMap;
// std::set<std::string> notFoundMap;
// after it is all done do a ConfigureFinalPass
- cmCacheManager* manager = 0;
+ cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager();
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
- manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager();
this->LocalGenerators[i]->ConfigureFinalPass();
cmTargets &targets =
this->LocalGenerators[i]->GetMakefile()->GetTargets();
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f139ad1..5e584a4 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -865,6 +865,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
{
sourcecode += ".asm";
}
+ else if (ext == "metal")
+ {
+ sourcecode += ".metal";
+ }
//else
// {
// // Already specialized above or we leave sourcecode == "sourcecode"
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 3e26349..ddcea9b 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -146,18 +146,12 @@ bool cmListFile::ParseFile(const char* filename,
}
bool parseError = false;
- this->ModifiedTime = cmSystemTools::ModifiedTime(filename);
{
cmListFileParser parser(this, mf, filename);
parseError = !parser.ParseFile();
}
- if(parseError)
- {
- this->ModifiedTime = 0;
- }
-
// do we need a cmake_policy(VERSION call?
if(topLevel)
{
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 2ca9b8e..544ff1b 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -85,15 +85,10 @@ class cmListFileBacktrace: public std::vector<cmListFileContext>
struct cmListFile
{
- cmListFile()
- :ModifiedTime(0)
- {
- }
bool ParseFile(const char* path,
bool topLevel,
cmMakefile *mf);
- long int ModifiedTime;
std::vector<cmListFileFunction> Functions;
};
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7f355a6..215ee16 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -101,7 +101,6 @@ cmMakefile::cmMakefile(): Internal(new Internals)
this->AddDefaultDefinitions();
this->Initialize();
- this->PreOrder = false;
this->GeneratingBuildSystem = false;
this->SuppressWatches = false;
@@ -113,8 +112,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->Internal->VarInitStack.push(mf.Internal->VarInitStack.top());
this->Internal->VarUsageStack.push(mf.Internal->VarUsageStack.top());
- this->Prefix = mf.Prefix;
- this->AuxSourceDirectories = mf.AuxSourceDirectories;
this->cmStartDirectory = mf.cmStartDirectory;
this->StartOutputDirectory = mf.StartOutputDirectory;
this->cmHomeDirectory = mf.cmHomeDirectory;
@@ -145,9 +142,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->LocalGenerator = mf.LocalGenerator;
this->FunctionBlockers = mf.FunctionBlockers;
this->MacrosList = mf.MacrosList;
- this->SubDirectoryOrder = mf.SubDirectoryOrder;
this->Properties = mf.Properties;
- this->PreOrder = mf.PreOrder;
this->WarnUnused = mf.WarnUnused;
this->Initialize();
this->CheckSystemVars = mf.CheckSystemVars;
@@ -189,11 +184,6 @@ unsigned int cmMakefile::GetCacheMinorVersion() const
return this->GetCacheManager()->GetCacheMinorVersion();
}
-bool cmMakefile::NeedCacheCompatibility(int major, int minor) const
-{
- return this->GetCacheManager()->NeedCacheCompatibility(major, minor);
-}
-
cmMakefile::~cmMakefile()
{
cmDeleteAll(this->InstallGenerators);
@@ -1697,7 +1687,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
}
void cmMakefile::AddSubDirectory(const std::string& sub,
- bool excludeFromAll, bool preorder)
+ bool excludeFromAll)
{
// the source path must be made full if it isn't already
std::string srcPath = sub;
@@ -1719,13 +1709,13 @@ void cmMakefile::AddSubDirectory(const std::string& sub,
this->AddSubDirectory(srcPath, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
void cmMakefile::AddSubDirectory(const std::string& srcPath,
const std::string& binPath,
- bool excludeFromAll, bool preorder,
+ bool excludeFromAll,
bool immediate)
{
// Make sure the binary directory is unique.
@@ -1747,7 +1737,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
{
lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
- lg2->GetMakefile()->SetPreOrder(preorder);
if (immediate)
{
@@ -2256,11 +2245,6 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
#endif
-void cmMakefile::AddExtraDirectory(const char* dir)
-{
- this->AuxSourceDirectories.push_back(dir);
-}
-
static bool mightExpandVariablesCMP0019(const char* s)
{
return s && *s && strstr(s,"${") && strchr(s,'}');
@@ -4220,8 +4204,19 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "DEFINITIONS")
{
- output += this->DefineFlagsOrig;
- return output.c_str();
+ switch(this->GetPolicyStatus(cmPolicies::CMP0059))
+ {
+ case cmPolicies::WARN:
+ this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
+ GetPolicyWarning(cmPolicies::CMP0059));
+ case cmPolicies::OLD:
+ output += this->DefineFlagsOrig;
+ return output.c_str();
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ break;
+ }
}
else if (prop == "LINK_DIRECTORIES")
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e98f1d9..920b6b7 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -78,9 +78,6 @@ public:
bool VariableInitialized(const std::string& ) const;
/* return true if a variable has been used */
bool VariableUsed(const std::string& ) const;
- /** Return whether compatibility features needed for a version of
- the cache or lower should be enabled. */
- bool NeedCacheCompatibility(int major, int minor) const;
/**
* Construct an empty makefile.
@@ -292,11 +289,10 @@ public:
/**
* Add a subdirectory to the build.
*/
- void AddSubDirectory(const std::string&, bool excludeFromAll=false,
- bool preorder = false);
+ void AddSubDirectory(const std::string&, bool excludeFromAll=false);
void AddSubDirectory(const std::string& fullSrcDir,
const std::string& fullBinDir,
- bool excludeFromAll, bool preorder,
+ bool excludeFromAll,
bool immediate);
/**
@@ -433,15 +429,6 @@ public:
bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const;
- /**
- * Add an auxiliary directory to the build.
- */
- void AddExtraDirectory(const char* dir);
-
-
- /**
- * Add an auxiliary directory to the build.
- */
void MakeStartDirectoriesCurrent()
{
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
@@ -620,12 +607,6 @@ public:
cmSourceFile* GetOrCreateSource(const std::string& sourceName,
bool generated = false);
- /**
- * Obtain a list of auxiliary source directories.
- */
- const std::vector<std::string>& GetAuxSourceDirectories() const
- {return this->AuxSourceDirectories;}
-
//@{
/**
* Return a list of extensions associated with source and header
@@ -792,10 +773,6 @@ public:
///enabled.
void EnableLanguage(std::vector<std::string>const& languages, bool optional);
- /**
- * Set/Get the name of the parent directories CMakeLists file
- * given a current CMakeLists file name
- */
cmCacheManager *GetCacheManager() const;
/**
@@ -879,10 +856,6 @@ public:
///! Initialize a makefile from its parent
void InitializeFromParent();
- ///! Set/Get the preorder flag
- void SetPreOrder(bool p) { this->PreOrder = p; }
- bool GetPreOrder() const { return this->PreOrder; }
-
void AddInstallGenerator(cmInstallGenerator* g)
{ if(g) this->InstallGenerators.push_back(g); }
std::vector<cmInstallGenerator*>& GetInstallGenerators()
@@ -976,9 +949,6 @@ protected:
// Check for a an unused variable
void CheckForUnused(const char* reason, const std::string& name) const;
- std::string Prefix;
- std::vector<std::string> AuxSourceDirectories; //
-
std::string cmStartDirectory;
std::string StartOutputDirectory;
std::string cmHomeDirectory;
@@ -1008,9 +978,8 @@ protected:
// directories.
std::set<std::string> SystemIncludeDirectories;
- std::vector<std::string> ListFiles; // list of command files loaded
- std::vector<std::string> OutputFiles; // list of command files loaded
-
+ std::vector<std::string> ListFiles;
+ std::vector<std::string> OutputFiles;
cmTarget::LinkLibraryVectorType LinkLibraries;
@@ -1067,8 +1036,6 @@ private:
std::vector<std::string> MacrosList;
- std::map<std::string, bool> SubDirectoryOrder;
-
mutable cmsys::RegularExpression cmDefineRegex;
mutable cmsys::RegularExpression cmDefine01Regex;
mutable cmsys::RegularExpression cmAtVarRegex;
@@ -1076,9 +1043,6 @@ private:
cmPropertyMap Properties;
- // should this makefile be processed before or after processing the parent
- bool PreOrder;
-
// Unused variable flags
bool WarnUnused;
bool CheckSystemVars;
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 592df8f..0a61bca 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -385,6 +385,11 @@ cmPolicies::cmPolicies()
CMP0058, "CMP0058",
"Ninja requires custom command byproducts to be explicit.",
3,3,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0059, "CMP0059",
+ "Do no treat DEFINITIONS as a built-in directory property.",
+ 3,3,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index b18b337..ced9d8c 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -116,6 +116,8 @@ public:
CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications
/// for the same file.
CMP0058, ///< Ninja requires custom command byproducts to be explicit
+ CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory
+ /// property.
/** \brief Always the last entry.
*
diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx
index 93ad4f3..7cb2edc 100644
--- a/Source/cmSubdirCommand.cxx
+++ b/Source/cmSubdirCommand.cxx
@@ -22,7 +22,6 @@ bool cmSubdirCommand
}
bool res = true;
bool excludeFromAll = false;
- bool preorder = false;
for(std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i)
@@ -34,7 +33,7 @@ bool cmSubdirCommand
}
if(*i == "PREORDER")
{
- preorder = true;
+ // Ignored
continue;
}
@@ -48,7 +47,7 @@ bool cmSubdirCommand
std::string(this->Makefile->GetCurrentOutputDirectory()) +
"/" + i->c_str();
this->Makefile->AddSubDirectory(srcPath, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
// otherwise it is a full path
else if ( cmSystemTools::FileIsDirectory(*i) )
@@ -59,7 +58,7 @@ bool cmSubdirCommand
std::string(this->Makefile->GetCurrentOutputDirectory()) +
"/" + cmSystemTools::GetFilenameName(*i);
this->Makefile->AddSubDirectory(*i, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
else
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 19444ed..dad6f93 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteAllSources();
this->WriteDotNetReferences();
this->WriteEmbeddedResourceGroup();
+ this->WriteXamlFilesGroup();
this->WriteWinRTReferences();
this->WriteProjectReferences();
this->WriteString(
@@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
this->WriteString("<DependentUpon>", 3);
std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h";
- (*this->BuildFileStream ) << hFileName;
- this->WriteString("</DependentUpon>\n", 3);
+ (*this->BuildFileStream) << hFileName << "</DependentUpon>\n";
std::vector<std::string> const * configs =
this->GlobalGenerator->GetConfigurations();
@@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
}
}
+void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup()
+{
+ std::vector<cmSourceFile const*> xamlObjs;
+ this->GeneratorTarget->GetXamlSources(xamlObjs, "");
+ if (!xamlObjs.empty())
+ {
+ this->WriteString("<ItemGroup>\n", 1);
+ for (std::vector<cmSourceFile const*>::const_iterator
+ oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi)
+ {
+ std::string obj = (*oi)->GetFullPath();
+ std::string xamlType;
+ const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE");
+ if (xamlTypeProperty)
+ {
+ xamlType = xamlTypeProperty;
+ }
+ else
+ {
+ xamlType = "Page";
+ }
+
+ this->WriteSource(xamlType, *oi, ">\n");
+ this->WriteString("<SubType>Designer</SubType>\n", 3);
+ this->WriteString("</", 2);
+ (*this->BuildFileStream) << xamlType << ">\n";
+
+ }
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences()
{
if(this->MSTools)
@@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name,
void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf)
{
- if(this->IsResxHeader(sf->GetFullPath()))
+ std::string const& fileName = sf->GetFullPath();
+ if (this->IsResxHeader(fileName))
{
this->WriteSource("ClInclude", sf, ">\n");
this->WriteString("<FileType>CppForm</FileType>\n", 3);
this->WriteString("</ClInclude>\n", 2);
}
+ else if (this->IsXamlHeader(fileName))
+ {
+ this->WriteSource("ClInclude", sf, ">\n");
+ this->WriteString("<DependentUpon>", 3);
+ std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
+ (*this->BuildFileStream) << xamlFileName << "</DependentUpon>\n";
+ this->WriteString("</ClInclude>\n", 2);
+ }
else
{
this->WriteSource("ClInclude", sf);
@@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
" ", "\n", lang);
}
}
+ if (this->IsXamlSource(source->GetFullPath()))
+ {
+ (*this->BuildFileStream) << firstString;
+ firstString = ""; // only do firstString once
+ hasFlags = true;
+ this->WriteString("<DependentUpon>", 3);
+ const std::string& fileName = source->GetFullPath();
+ std::string xamlFileName = fileName.substr(0, fileName.find_last_of("."));
+ (*this->BuildFileStream) << xamlFileName << "</DependentUpon>\n";
+ }
+
return hasFlags;
}
@@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator::
return it != expectedResxHeaders.end();
}
+bool cmVisualStudio10TargetGenerator::
+IsXamlHeader(const std::string& headerFile)
+{
+ std::set<std::string> expectedXamlHeaders;
+ this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, "");
+
+ std::set<std::string>::const_iterator it =
+ expectedXamlHeaders.find(headerFile);
+ return it != expectedXamlHeaders.end();
+}
+
+bool cmVisualStudio10TargetGenerator::
+IsXamlSource(const std::string& sourceFile)
+{
+ std::set<std::string> expectedXamlSources;
+ this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, "");
+
+ std::set<std::string>::const_iterator it =
+ expectedXamlSources.find(sourceFile);
+ return it != expectedXamlSources.end();
+}
+
void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
{
bool isAppContainer = false;
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index a02dfa8..a2776de 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -69,6 +69,7 @@ private:
void WriteEmbeddedResourceGroup();
void WriteWinRTReferences();
void WriteWinRTPackageCertificateKeyFile();
+ void WriteXamlFilesGroup();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
void VerifyNecessaryFiles();
@@ -119,6 +120,8 @@ private:
void AddMissingSourceGroups(std::set<cmSourceGroup*>& groupsUsed,
const std::vector<cmSourceGroup>& allGroups);
bool IsResxHeader(const std::string& headerFile);
+ bool IsXamlHeader(const std::string& headerFile);
+ bool IsXamlSource(const std::string& headerFile);
cmIDEFlagTable const* GetClFlagTable() const;
cmIDEFlagTable const* GetRcFlagTable() const;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 51df7f2..5c52a1a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -188,7 +188,6 @@ void cmake::InitializeProperties()
{
this->Properties.clear();
this->Properties.SetCMakeInstance(this);
- this->AccessedProperties.clear();
this->PropertyDefinitions.clear();
// initialize properties
@@ -213,7 +212,7 @@ void cmake::CleanupCommandsAndMacros()
delete j->second;
}
}
- this->Commands.erase(this->Commands.begin(), this->Commands.end());
+ this->Commands.clear();
std::vector<cmCommand*>::iterator it;
for ( it = commands.begin(); it != commands.end();
++ it )
@@ -2274,8 +2273,6 @@ const char *cmake::GetProperty(const std::string& prop)
const char *cmake::GetProperty(const std::string& prop,
cmProperty::ScopeType scope)
{
- bool chain = false;
-
// watch for special properties
std::string output = "";
if ( prop == "CACHE_VARIABLES" )
@@ -2333,7 +2330,8 @@ const char *cmake::GetProperty(const std::string& prop,
return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
}
#undef STRING_LIST_ELEMENT
- return this->Properties.GetPropertyValue(prop, scope, chain);
+ bool dummy = false;
+ return this->Properties.GetPropertyValue(prop, scope, dummy);
}
bool cmake::GetPropertyAsBool(const std::string& prop)
diff --git a/Source/cmake.h b/Source/cmake.h
index 60ffcd4..c22b329 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -287,9 +287,6 @@ class cmake
cmProperty::ScopeType scope);
bool GetPropertyAsBool(const std::string& prop);
- // Get the properties
- cmPropertyMap &GetProperties() { return this->Properties; }
-
///! Get or create an cmInstalledFile instance and return a pointer to it
cmInstalledFile *GetOrCreateInstalledFile(
cmMakefile* mf, const std::string& name);
@@ -383,7 +380,6 @@ protected:
void InitializeProperties();
int HandleDeleteCacheVariables(const std::string& var);
cmPropertyMap Properties;
- std::set<std::pair<std::string,cmProperty::ScopeType> > AccessedProperties;
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
PropertyDefinitions;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d9988b2..f80191b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1)
add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1)
add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1)
+
+ add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VSXaml"
+ "${CMake_BINARY_DIR}/Tests/VSXaml"
+ --build-generator "Visual Studio 12 2013"
+ --build-project VSXaml
+ --build-config $<CONFIGURATION>
+ --build-options -DCMAKE_SYSTEM_NAME=WindowsStore
+ -DCMAKE_SYSTEM_VERSION=8.1
+ )
endif()
if(vs11 AND wp80)
add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0)
diff --git a/Tests/CMakeTests/ELFTest.cmake.in b/Tests/CMakeTests/ELFTest.cmake.in
index 0271abb..4635778 100644
--- a/Tests/CMakeTests/ELFTest.cmake.in
+++ b/Tests/CMakeTests/ELFTest.cmake.in
@@ -11,7 +11,7 @@ set(out "@CMAKE_CURRENT_BINARY_DIR@/ELF-Out")
file(REMOVE_RECURSE "${out}")
file(MAKE_DIRECTORY "${out}")
foreach(f ${names})
- file(COPY ${in}/${f} DESTINATION ${out})
+ file(COPY ${in}/${f} DESTINATION ${out} NO_SOURCE_PERMISSIONS)
list(APPEND files "${out}/${f}")
endforeach()
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
new file mode 100644
index 0000000..76992d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
@@ -0,0 +1,2 @@
+DEFS:
+CUSTOM CONTENT:CUSTOM_CONTENT
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
new file mode 100644
index 0000000..f7b9303
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 NEW)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
new file mode 100644
index 0000000..e35e8c5
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
@@ -0,0 +1,2 @@
+DEFS: -DSOME_DEF
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
new file mode 100644
index 0000000..2555774
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 OLD)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
new file mode 100644
index 0000000..4e04d15
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
@@ -0,0 +1,18 @@
+CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\):
+ Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+ property. Run "cmake --help-policy CMP0059" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+DEFS: -DSOME_DEF
+CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\):
+ Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+ property. Run "cmake --help-policy CMP0059" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
new file mode 100644
index 0000000..9d0b49c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
@@ -0,0 +1,17 @@
+
+
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMakeLists.txt b/Tests/RunCMake/CMP0059/CMakeLists.txt
new file mode 100644
index 0000000..ef2163c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0059/RunCMakeTest.cmake b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
new file mode 100644
index 0000000..9b57579
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0059-OLD)
+run_cmake(CMP0059-NEW)
+run_cmake(CMP0059-WARN)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 7b9c810..60a8a82 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -64,6 +64,7 @@ add_RunCMake_test(CMP0053)
add_RunCMake_test(CMP0054)
add_RunCMake_test(CMP0055)
add_RunCMake_test(CMP0057)
+add_RunCMake_test(CMP0059)
if(CMAKE_GENERATOR STREQUAL "Ninja")
add_RunCMake_test(Ninja)
endif()
@@ -203,6 +204,11 @@ add_RunCMake_test(install)
add_RunCMake_test(CPackInstallProperties)
add_RunCMake_test(ExternalProject)
add_RunCMake_test(CTestCommandLine)
+# Only run this test on unix platforms that support
+# symbolic links
+if(UNIX)
+ add_RunCMake_test(CPackSymlinks)
+endif()
set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES)
add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake
index 3ace6a8..31e729b 100644
--- a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake
+++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake
@@ -1,5 +1,4 @@
install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static)
-install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable)
set(CPACK_PACKAGE_RELOCATABLE TRUE)
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")
diff --git a/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake
new file mode 100644
index 0000000..439d95e
--- /dev/null
+++ b/Tests/RunCMake/CPackSymlinks/RunCMakeTest.cmake
@@ -0,0 +1,20 @@
+include(RunCMake)
+
+function(run_cpack_symlink_test)
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks-build")
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/SrcSymlinks")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
+ run_cmake_command(SrcSymlinksTar
+ ${CMAKE_COMMAND} -E chdir ${RunCMake_TEST_SOURCE_DIR}
+ ${CMAKE_COMMAND} -E tar xvf ${RunCMake_SOURCE_DIR}/testcpacksym.tar
+ )
+ run_cmake(SrcSymlinksCMake)
+ run_cmake_command(SrcSymlinksCPack
+ ${CMAKE_CPACK_COMMAND} --config CPackSourceConfig.cmake
+ )
+endfunction()
+
+run_cpack_symlink_test()
diff --git a/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt
new file mode 100644
index 0000000..24ad124
--- /dev/null
+++ b/Tests/RunCMake/CPackSymlinks/SrcSymlinksTar-stdout.txt
@@ -0,0 +1,10 @@
+^x CMakeLists.txt
+x cygwin/
+x cygwin/build.sh
+x cygwin/setup.patch
+x include/
+x include/src.h
+x link.h
+x real.h
+x src/
+x src/src.h$
diff --git a/Tests/RunCMake/CPackSymlinks/testcpacksym.tar b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar
new file mode 100644
index 0000000..a44c656
--- /dev/null
+++ b/Tests/RunCMake/CPackSymlinks/testcpacksym.tar
Binary files differ
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index a9c49e7..e8b4584 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -80,3 +80,29 @@ run_cmake(D_nested_cache)
set(RunCMake_TEST_OPTIONS
"-DFOO:STRING=-DBAR:BOOL=BAZ")
run_cmake(D_typed_nested_cache)
+
+function(run_cmake_depends)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}/cmake_depends")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/cmake_depends-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/DependInfo.cmake" "
+set(CMAKE_DEPENDS_LANGUAGES \"C\")
+set(CMAKE_DEPENDS_CHECK_C
+ \"${RunCMake_TEST_SOURCE_DIR}/test.c\"
+ \"${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/test.c.o\"
+ )
+")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/CMakeDirectoryInformation.cmake" "
+set(CMAKE_RELATIVE_PATH_TOP_SOURCE \"${RunCMake_TEST_SOURCE_DIR}\")
+set(CMAKE_RELATIVE_PATH_TOP_BINARY \"${RunCMake_TEST_BINARY_DIR}\")
+")
+ run_cmake_command(cmake_depends ${CMAKE_COMMAND} -E cmake_depends
+ "Unix Makefiles"
+ ${RunCMake_TEST_SOURCE_DIR} ${RunCMake_TEST_SOURCE_DIR}
+ ${RunCMake_TEST_BINARY_DIR} ${RunCMake_TEST_BINARY_DIR}
+ ${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/DependInfo.cmake
+ )
+endfunction()
+run_cmake_depends()
diff --git a/Tests/RunCMake/CommandLine/cmake_depends-check.cmake b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake
new file mode 100644
index 0000000..031478b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake
@@ -0,0 +1,13 @@
+set(depend_make "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/DepTarget.dir/depend.make")
+if(EXISTS "${depend_make}")
+ file(READ "${depend_make}" depend_make_content)
+ string(REGEX REPLACE "\n+$" "" depend_make_content "${depend_make_content}")
+ if(NOT depend_make_content MATCHES "
+CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.c
+CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.h$")
+ string(REPLACE "\n" "\n " depend_make_content " ${depend_make_content}")
+ set(RunCMake_TEST_FAILED "depend.make does not have expected content:\n${depend_make_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "depend.make missing:\n ${depend_make}")
+endif()
diff --git a/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt b/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt
new file mode 100644
index 0000000..8fe092b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cmake_depends-stdout.txt
@@ -0,0 +1 @@
+^Scanning dependencies of target DepTarget$
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.c b/Tests/RunCMake/CommandLine/cmake_depends/test.c
new file mode 100644
index 0000000..92c056f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cmake_depends/test.c
@@ -0,0 +1,2 @@
+#include "test.h"
+#include "test_UTF-16LE.h"
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.h b/Tests/RunCMake/CommandLine/cmake_depends/test.h
new file mode 100644
index 0000000..fd87388
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cmake_depends/test.h
@@ -0,0 +1 @@
+void test(void) {}
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
new file mode 100644
index 0000000..bf56ec6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
Binary files differ
diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt
index 4373810..43c4833 100644
--- a/Tests/VSWindowsFormsResx/CMakeLists.txt
+++ b/Tests/VSWindowsFormsResx/CMakeLists.txt
@@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles)
include(CheckIncludeFile)
# Note: The designable form is assumed to have a .h extension as is default in Visual Studio.
-# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio
+# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio
set(TARGET_H
WindowsFormsResx/MyForm.h
diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml
new file mode 100644
index 0000000..eecf2c1
--- /dev/null
+++ b/Tests/VSXaml/App.xaml
@@ -0,0 +1,7 @@
+<Application
+ x:Class="VSXaml.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:VSXaml">
+
+</Application>
diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp
new file mode 100644
index 0000000..334dc1f
--- /dev/null
+++ b/Tests/VSXaml/App.xaml.cpp
@@ -0,0 +1,125 @@
+//
+// App.xaml.cpp
+// Implementation of the App class.
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+
+using namespace VSXaml;
+
+using namespace Platform;
+using namespace Windows::ApplicationModel;
+using namespace Windows::ApplicationModel::Activation;
+using namespace Windows::Foundation;
+using namespace Windows::Foundation::Collections;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+using namespace Windows::UI::Xaml::Data;
+using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI::Xaml::Interop;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Navigation;
+
+// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
+
+/// <summary>
+/// Initializes the singleton application object. This is the first line of authored code
+/// executed, and as such is the logical equivalent of main() or WinMain().
+/// </summary>
+App::App()
+{
+ InitializeComponent();
+ Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
+}
+
+/// <summary>
+/// Invoked when the application is launched normally by the end user. Other entry points
+/// will be used such as when the application is launched to open a specific file.
+/// </summary>
+/// <param name="e">Details about the launch request and process.</param>
+void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
+{
+
+#if _DEBUG
+ // Show graphics profiling information while debugging.
+ if (IsDebuggerPresent())
+ {
+ // Display the current frame rate counters
+ DebugSettings->EnableFrameRateCounter = true;
+ }
+#endif
+
+ auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
+
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == nullptr)
+ {
+ // Create a Frame to act as the navigation context and associate it with
+ // a SuspensionManager key
+ rootFrame = ref new Frame();
+
+ // Set the default language
+ rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0);
+
+ rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
+
+ if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
+ {
+ // TODO: Restore the saved session state only when appropriate, scheduling the
+ // final launch steps after the restore is complete
+
+ }
+
+ if (rootFrame->Content == nullptr)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
+ }
+ // Place the frame in the current Window
+ Window::Current->Content = rootFrame;
+ // Ensure the current window is active
+ Window::Current->Activate();
+ }
+ else
+ {
+ if (rootFrame->Content == nullptr)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
+ }
+ // Ensure the current window is active
+ Window::Current->Activate();
+ }
+}
+
+/// <summary>
+/// Invoked when application execution is being suspended. Application state is saved
+/// without knowing whether the application will be terminated or resumed with the contents
+/// of memory still intact.
+/// </summary>
+/// <param name="sender">The source of the suspend request.</param>
+/// <param name="e">Details about the suspend request.</param>
+void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
+{
+ (void) sender; // Unused parameter
+ (void) e; // Unused parameter
+
+ //TODO: Save application state and stop any background activity
+}
+
+/// <summary>
+/// Invoked when Navigation to a certain page fails
+/// </summary>
+/// <param name="sender">The Frame which failed navigation</param>
+/// <param name="e">Details about the navigation failure</param>
+void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
+{
+ throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
+} \ No newline at end of file
diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h
new file mode 100644
index 0000000..1f65bda
--- /dev/null
+++ b/Tests/VSXaml/App.xaml.h
@@ -0,0 +1,27 @@
+//
+// App.xaml.h
+// Declaration of the App class.
+//
+
+#pragma once
+
+#include "App.g.h"
+
+namespace VSXaml
+{
+ /// <summary>
+ /// Provides application-specific behavior to supplement the default Application class.
+ /// </summary>
+ ref class App sealed
+ {
+ protected:
+ virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
+
+ internal:
+ App();
+
+ private:
+ void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
+ void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
+ };
+}
diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png
new file mode 100644
index 0000000..e26771c
--- /dev/null
+++ b/Tests/VSXaml/Assets/Logo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
new file mode 100644
index 0000000..1eb0d9d
--- /dev/null
+++ b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
new file mode 100644
index 0000000..c951e03
--- /dev/null
+++ b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
new file mode 100644
index 0000000..dcb6727
--- /dev/null
+++ b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt
new file mode 100644
index 0000000..f384c82
--- /dev/null
+++ b/Tests/VSXaml/CMakeLists.txt
@@ -0,0 +1,52 @@
+cmake_minimum_required(VERSION 3.2)
+project(VSXaml)
+
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+set(SOURCE_FILES
+ App.xaml.cpp
+ MainPage.xaml.cpp
+ pch.cpp
+ )
+
+set(HEADER_FILES
+ App.xaml.h
+ MainPage.xaml.h
+ pch.h
+ )
+
+set(XAML_FILES
+ App.xaml
+ MainPage.xaml
+ )
+
+set(ASSET_FILES
+ Assets/Logo.scale-100.png
+ Assets/SmallLogo.scale-100.png
+ Assets/SplashScreen.scale-100.png
+ Assets/StoreLogo.scale-100.png
+ )
+
+set(CONTENT_FILES
+ Package.appxmanifest
+ )
+
+set(RESOURCE_FILES
+ ${CONTENT_FILES} ${ASSET_FILES}
+ VSXaml_TemporaryKey.pfx)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
+set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
+set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets")
+
+set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition")
+
+source_group("Source Files" FILES ${SOURCE_FILES})
+source_group("Header Files" FILES ${HEADER_FILES})
+source_group("Resource Files" FILES ${RESOURCE_FILES})
+source_group("Xaml Files" FILES ${XAML_FILES})
+
+add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES})
+set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE)
diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml
new file mode 100644
index 0000000..62139ca
--- /dev/null
+++ b/Tests/VSXaml/MainPage.xaml
@@ -0,0 +1,14 @@
+<Page
+ x:Class="VSXaml.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:VSXaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d">
+
+ <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+ <TextBlock Text="I'm a CMake XAML App" HorizontalAlignment="Center" VerticalAlignment="Center"
+ Style="{StaticResource HeaderTextBlockStyle}"/>
+ </Grid>
+</Page>
diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp
new file mode 100644
index 0000000..d0a64e8
--- /dev/null
+++ b/Tests/VSXaml/MainPage.xaml.cpp
@@ -0,0 +1,27 @@
+//
+// MainPage.xaml.cpp
+// Implementation of the MainPage class.
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+
+using namespace VSXaml;
+
+using namespace Platform;
+using namespace Windows::Foundation;
+using namespace Windows::Foundation::Collections;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+using namespace Windows::UI::Xaml::Data;
+using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+MainPage::MainPage()
+{
+ InitializeComponent();
+}
diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h
new file mode 100644
index 0000000..ccc781b
--- /dev/null
+++ b/Tests/VSXaml/MainPage.xaml.h
@@ -0,0 +1,21 @@
+//
+// MainPage.xaml.h
+// Declaration of the MainPage class.
+//
+
+#pragma once
+
+#include "MainPage.g.h"
+
+namespace VSXaml
+{
+ /// <summary>
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ /// </summary>
+ public ref class MainPage sealed
+ {
+ public:
+ MainPage();
+
+ };
+}
diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest
new file mode 100644
index 0000000..873a64a
--- /dev/null
+++ b/Tests/VSXaml/Package.appxmanifest
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
+
+ <Identity Name="19ff96f1-8379-4e14-8b9d-04648b3b36a9"
+ Publisher="CN=Microsoft"
+ Version="1.0.0.0" />
+
+ <Properties>
+ <DisplayName>VSXaml</DisplayName>
+ <PublisherDisplayName>Microsoft</PublisherDisplayName>
+ <Logo>Assets\StoreLogo.png</Logo>
+ </Properties>
+
+ <Prerequisites>
+ <OSMinVersion>6.3.0</OSMinVersion>
+ <OSMaxVersionTested>6.3.0</OSMaxVersionTested>
+ </Prerequisites>
+
+ <Resources>
+ <Resource Language="x-generate"/>
+ </Resources>
+
+ <Applications>
+ <Application Id="App"
+ Executable="$targetnametoken$.exe"
+ EntryPoint="VSXaml.App">
+ <m2:VisualElements
+ DisplayName="VSXaml"
+ Square150x150Logo="Assets\Logo.png"
+ Square30x30Logo="Assets\SmallLogo.png"
+ Description="VSXaml"
+ ForegroundText="light"
+ BackgroundColor="#464646">
+ <m2:SplashScreen Image="Assets\SplashScreen.png" />
+ </m2:VisualElements>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="internetClient" />
+ </Capabilities>
+</Package> \ No newline at end of file
diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx
new file mode 100644
index 0000000..1cad999
--- /dev/null
+++ b/Tests/VSXaml/VSXaml_TemporaryKey.pfx
Binary files differ
diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp
new file mode 100644
index 0000000..01484ff
--- /dev/null
+++ b/Tests/VSXaml/pch.cpp
@@ -0,0 +1,6 @@
+//
+// pch.cpp
+// Include the standard header and generate the precompiled header.
+//
+
+#include "pch.h"
diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h
new file mode 100644
index 0000000..2c4354d
--- /dev/null
+++ b/Tests/VSXaml/pch.h
@@ -0,0 +1,11 @@
+//
+// pch.h
+// Header for standard system include files.
+//
+
+#pragma once
+
+#include <collection.h>
+#include <ppltasks.h>
+
+#include "App.xaml.h"
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 017c435..9c53150 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -280,4 +280,10 @@ typedef uint64_t uintmax_t;
/* Define to 1 if the system supports fast unaligned access to 16-bit and
32-bit integers. */
-#define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
+ || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
+ || defined(__amd64) || defined(__amd64__) \
+ || defined(__powerpc) || defined(__powerpc__) \
+ || defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
+# define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#endif
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
index d3a6348..fc54d8d 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -8,6 +8,9 @@
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
+#if defined(__IBMC__)
+# pragma options optimize=0
+#endif
#include "lzma_encoder_private.h"
#include "fastpos.h"