[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6540-g824106c
Stephen Kelly
steveire at gmail.com
Tue Dec 31 09:49:30 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 824106c22730f4e329ad07e33263f800b2df11dd (commit)
via c76a3308f9584d4bc86867f17f96570df8866d49 (commit)
via 029d3d7ce3edde2680a8bd9b9ac501ab0ccc1da1 (commit)
via 442301425dfca56aac1ddc6eec7f6505241ffb4c (commit)
via dc3572f140cc9fbe5ed2d45f31def03a9e7aa0bc (commit)
via 76c611c41287f7acc15189b62bb1980f428e88be (commit)
via 83b12235d8ea3b5164aa16c800d3ca8daa1883b3 (commit)
via 727e0ffa8d10a556ed906e3f0f84798eddf072d6 (commit)
via 7f625e1d0e4c0fececa9c1e67f1a3448ea9a0562 (commit)
via 824273ddfecd7656f2d4057571e1ce581cffbfba (commit)
via cf57ae87dedfdaaca4a023631f361c79d0eabb97 (commit)
via 0a7d32718bc07499d4061d455e343ee380a5aaad (commit)
via 8961d27c5c6d14b0351628d417fbddb942e48479 (commit)
via ebc1b2bd833219d5386d34bb1a682a2bbeb7ed3e (commit)
via 0280063faa6bae574fb55852aba3d7f3fe30c1e4 (commit)
via 28c78af6daa9c48d6f4b587271965cb8dc352d9c (commit)
via 9b916918d89ccada2c41ce02e3815fbd9b753a00 (commit)
via af9fc9d77a95a039a7c08bd8c76d19558a81248f (commit)
via 2939ca9a002152666df6d1761976023c9a69a74c (commit)
via 547426fa37244ed9f3187191443e3914f7159549 (commit)
via 89315ba307ff18190f3395acb71d0b1d9090ef3c (commit)
via 54e1d79306475b40c924ea9770503784bc69233d (commit)
via fd8c7dfe38657e9d83a475f09aa322000ce16dd7 (commit)
via 0893edd7d2400bcb2c231c8fbb9a8126e6640123 (commit)
via b51a5a702e73c4a6eaeff0089e85067fa56868cf (commit)
via e737f680b81fbf0f499699c0a47c0ee75786ab82 (commit)
via f0c15a3320a70bf9b7d575048ff280ebc78fecd5 (commit)
via 6bb8fb4bb453c296da628cc674ae5eec6e79ca6a (commit)
via f6d61ba51e0d98a41800fc68884d58bd2f293336 (commit)
via 287a576e057a91e3756fd4a9ee3b312ba9e74557 (commit)
via 73dc0afcd9a2d860224c01ba535425eeb9bd1a95 (commit)
via c374827607f5d93b94a161586b70513db8b21048 (commit)
via de461d610bbb0ce9ee15497c891533bf2a46507b (commit)
via 2fae583e2677704b84c366c0bdf63b4943b62bd0 (commit)
from 521815687860173ba5a2817871f0886fb463ead4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=824106c22730f4e329ad07e33263f800b2df11dd
commit 824106c22730f4e329ad07e33263f800b2df11dd
Merge: 5218156 c76a330
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 09:49:04 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 31 09:49:04 2013 -0500
Merge topic 'minor-cleanups' into next
c76a330 Revert topic.
029d3d7 add_library: Disallow invalid signatures for INTERFACE_LIBRARY.
4423014 cmTarget: Move a variable initialization closer to where it is used.
dc3572f Undefine local preprocessor loop variables.
76c611c Genex: Reform error-checking for nullary/unary expressions.
83b1223 cmTarget: Remove some of the INTERFACE_LIBRARY whitelisted properties.
727e0ff cmTarget: INTERFACE_LIBRARY is always EXCLUDE_FROM_ALL.
7f625e1 export: Rename some variables to reflect content type.
824273d cmTarget: Enable convenient include dir handling for INTERFACE_LIBRARY.
cf57ae8 cmTarget: Remove dead code.
0a7d327 Genex: Add EQUAL expression.
8961d27 cmTarget: Use strtol for numeric parsing.
ebc1b2b Add cmHasLiteralSuffix API.
0280063 cmTarget: Remove support for <CONFIG>_LOCATION property.
28c78af cmTarget: Test impliedByUse number-compatible properties.
9b91691 cmTarget: Don't repeat property origin debug information.
...
diff --cc Tests/RunCMake/interface_library/RunCMakeTest.cmake
index 9ca9a77,0d00b71..f555dfc
--- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
@@@ -4,6 -4,4 +4,5 @@@ run_cmake(invalid_name
run_cmake(target_commands)
run_cmake(no_shared_libs)
run_cmake(whitelist)
+run_cmake(invalid_signature)
run_cmake(genex_link)
- run_cmake(add_dependencies)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c76a3308f9584d4bc86867f17f96570df8866d49
commit c76a3308f9584d4bc86867f17f96570df8866d49
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Dec 25 15:11:50 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:47:25 2013 +0100
Revert topic.
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 2d69c89..45f1102 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -109,21 +109,12 @@ The signature
::
- add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
+ add_library(<name> INTERFACE)
creates an interface target. An interface target does not directly
create build output, though it may have properties set on it and it
may be installed, exported and imported. Typically the INTERFACE_*
properties are populated on the interface target using the
-:command:`set_property`, :command:`target_link_libraries`,
-:command:`target_include_directories`
-and :command:`target_compile_defintions` commands, and then it is used as an
-argument to :command:`target_link_libraries` like any other target.
-
-An ``INTERFACE`` :prop_tgt:`IMPORTED` target may also be created with this
-signature. An :prop_tgt:`IMPORTED` library target references a library defined
-outside the project. The target name has scope in the directory in which it is
-created and below, but the ``GLOBAL`` option extends visibility. It may be
-referenced like any target built within the project. :prop_tgt:`IMPORTED`
-libraries are useful for convenient reference from commands like
-:command:`target_link_libraries`.
+set_property(), target_link_libraries(), target_include_directories()
+and target_compile_defintions() commands, and then it is used as an
+argument to target_link_libraries() like any other target.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 12cfaf8..ed28abd 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -55,8 +55,6 @@ otherwise expands to nothing.
``0`` if ``?`` is ``1``, else ``1``
``$<STREQUAL:a,b>``
``1`` if ``a`` is STREQUAL ``b``, else ``0``
-``$<EQUAL:a,b>``
- ``1`` if ``a`` is EQUAL ``b`` in a numeric comparison, else ``0``
``$<CONFIG:cfg>``
``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index 376ec78..dc301ba 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -131,9 +131,7 @@ It may also provide a CMake package configuration file::
<prefix>/lib/cmake/foo-1.2/FooConfig.cmake
with content defining :prop_tgt:`IMPORTED` targets, or defining variables, such
-as:
-
-.. code-block:: cmake
+as::
# ...
# (compute PREFIX relative to file location)
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 2f4e090..9e26392 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -22,9 +22,7 @@ The :command:`cmake_minimum_required` command does more than report an
error if a too-old version of CMake is used to build a project. It
also sets all policies introduced in that CMake version or earlier to
NEW behavior. To manage policies without increasing the minimum required
-CMake version, the :command:`if(POLICY)` command may be used:
-
-.. code-block:: cmake
+CMake version, the :command:`if(POLICY)` command may be used::
if(POLICY CMP0990)
cmake_policy(SET CMP0990 NEW)
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 97cd650..fbe546e 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -22,23 +22,17 @@ Languages
Languages are enabled by the :command:`project` command. If no project command
is in the top-level CMakeLists file, one will be implicitly generated. By default
-the enabled languages are C and CXX:
-
-.. code-block:: cmake
+the enabled languages are C and CXX::
project(C_Only C)
A special value of NONE can also be used with the :command:`project` command
-to enable no languages:
-
-.. code-block:: cmake
+to enable no languages::
project(MyProject NONE)
The :command:`enable_language` command can be used to enable languages after the
-:command:`project` command:
-
-.. code-block:: cmake
+:command:`project` command::
enable_language(CXX)
@@ -92,9 +86,7 @@ Cross Compiling
If :manual:`cmake(1)` is invoked with the command line parameter
``-DCMAKE_TOOLCHAIN_FILE=path/to/file``, the file will be loaded early to set
values for the compilers. A typical cross-compiling toolchain has content such
-as:
-
-.. code-block:: cmake
+as::
set(CMAKE_SYSTEM_NAME Linux)
@@ -135,9 +127,7 @@ the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables.
Some compilers are inherently cross compilers, such as Clang and the QNX QCC
compiler. The :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a
-value to those supported compilers when compiling:
-
-.. code-block:: cmake
+value to those supported compilers when compiling::
set(CMAKE_SYSTEM_NAME Linux)
@@ -148,9 +138,7 @@ value to those supported compilers when compiling:
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET ${triple})
-Or, for QCC:
-
-.. code-block:: cmake
+Or, for QCC::
set(CMAKE_SYSTEM_NAME QNX)
diff --git a/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
index 5a69ef3..48cc8a1 100644
--- a/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
@@ -1,9 +1,8 @@
AUTOGEN_TARGETS_FOLDER
----------------------
-Name of :prop_tgt:`FOLDER` for ``*_automoc`` targets that are added automatically by
-CMake for targets for which :prop_tgt:`AUTOMOC` is enabled.
+Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
-If not set, CMake uses the :prop_tgt:`FOLDER` property of the parent target as a
+If not set, CMake uses the FOLDER property of the parent target as a
default value for this property. See also the documentation for the
-:prop_tgt:`FOLDER` target property and the :prop_tgt:`AUTOMOC` target property.
+FOLDER target property and the AUTOMOC target property.
diff --git a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
index 671f86a..185e0ec 100644
--- a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
@@ -1,11 +1,10 @@
AUTOMOC_TARGETS_FOLDER
----------------------
-Name of :prop_tgt:`FOLDER` for ``*_automoc`` targets that are added automatically by
-CMake for targets for which :prop_tgt:`AUTOMOC` is enabled.
+Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
-This property is obsolete. Use :prop_gbl:`AUTOGEN_TARGETS_FOLDER` instead.
+This property is obsolete. Use AUTOGEN_TARGETS_FOLDER instead.
-If not set, CMake uses the :prop_tgt:`FOLDER` property of the parent target as a
+If not set, CMake uses the FOLDER property of the parent target as a
default value for this property. See also the documentation for the
-:prop_tgt:`FOLDER` target property and the :prop_tgt:`AUTOMOC` target property.
+FOLDER target property and the AUTOMOC target property.
diff --git a/Help/prop_sf/AUTORCC_OPTIONS.rst b/Help/prop_sf/AUTORCC_OPTIONS.rst
index d9dc4d3..4b6bb10 100644
--- a/Help/prop_sf/AUTORCC_OPTIONS.rst
+++ b/Help/prop_sf/AUTORCC_OPTIONS.rst
@@ -1,13 +1,14 @@
AUTORCC_OPTIONS
---------------
-Additional options for ``rcc`` when using :prop_tgt:`AUTORCC`
+Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target
+property)
This property holds additional command line options which will be used when
-``rcc`` is executed during the build via :prop_tgt:`AUTORCC`, i.e. it is equivalent to the
-optional ``OPTIONS`` argument of the :module:`qt4_add_resources() <FindQt4>` macro.
+rcc is executed during the build via autorcc, i.e. it is equivalent to the
+optional OPTIONS argument of the qt4_add_resources() macro.
By default it is empty.
-The options set on the ``.qrc`` source file may override :prop_tgt:`AUTORCC_OPTIONS` set
+The options set on the .qrc source file may override :prop_tgt:`AUTORCC_OPTIONS` set
on the target.
diff --git a/Help/prop_sf/AUTOUIC_OPTIONS.rst b/Help/prop_sf/AUTOUIC_OPTIONS.rst
index 6dfabb0..a38b2f8 100644
--- a/Help/prop_sf/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_sf/AUTOUIC_OPTIONS.rst
@@ -1,14 +1,14 @@
AUTOUIC_OPTIONS
---------------
-Additional options for ``uic`` when using :prop_tgt:`AUTOUIC`
+Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
This property holds additional command line options
-which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`,
-i.e. it is equivalent to the optional ``OPTIONS`` argument of the
-:module:`qt4_wrap_ui()<FindQt4>` macro.
+which will be used when uic is executed during the build via autouic,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_wrap_ui() macro.
By default it is empty.
-The options set on the ``.ui`` source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
+The options set on the .ui source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
on the target.
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 2bc1881..006c83a 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -3,10 +3,10 @@ AUTOGEN_TARGET_DEPENDS
Target dependencies of the corresponding ``_automoc`` target.
-Targets which have their :prop_tgt:`AUTOMOC` target set to ``TRUE`` have a
+Targets which have their :prop_tgt:`AUTOMOC` target set to true have a
corresponding ``_automoc`` target which is used to autogenerate generate moc
files. As this ``_automoc`` target is created at generate-time, it is not
-possible to define dependencies of it, such as to create inputs for the ``moc``
+possible to define dependencies of it, such as to create inputs for the moc
executable.
The ``AUTOGEN_TARGET_DEPENDS`` target can be set instead to a list of dependencies
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 16094c7..8af1116 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -3,29 +3,29 @@ AUTOMOC
Should the target be processed with automoc (for Qt projects).
-AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc``
+AUTOMOC is a boolean specifying whether CMake will handle the Qt moc
preprocessor automatically, i.e. without having to use the
-:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are
-supported. When this property is set to ``TRUE``, CMake will scan the
-source files at build time and invoke moc accordingly. If an ``#include``
-statement like ``#include "moc_foo.cpp"`` is found, the ``Q_OBJECT`` class
-declaration is expected in the header, and ``moc`` is run on the header
-file. If an ``#include`` statement like ``#include "foo.moc"`` is found, then
-a ``Q_OBJECT`` is expected in the current source file and ``moc`` is run on
+QT4_WRAP_CPP() or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are
+supported. When this property is set to TRUE, CMake will scan the
+source files at build time and invoke moc accordingly. If an #include
+statement like #include "moc_foo.cpp" is found, the Q_OBJECT class
+declaration is expected in the header, and moc is run on the header
+file. If an #include statement like #include "foo.moc" is found, then
+a Q_OBJECT is expected in the current source file and moc is run on
the file itself. Additionally, all header files are parsed for
-``Q_OBJECT`` macros, and if found, ``moc`` is also executed on those files.
+Q_OBJECT macros, and if found, moc is also executed on those files.
The resulting moc files, which are not included as shown above in any
of the source files are included in a generated
-``<targetname>_automoc.cpp`` file, which is compiled as part of the
-target. This property is initialized by the value of the variable
-:variable:`CMAKE_AUTOMOC` if it is set when a target is created.
+<targetname>_automoc.cpp file, which is compiled as part of the
+target.This property is initialized by the value of the variable
+CMAKE_AUTOMOC if it is set when a target is created.
Additional command line options for moc can be set via the
-:prop_tgt:`AUTOMOC_MOC_OPTIONS` property.
+AUTOMOC_MOC_OPTIONS property.
-By setting the :variable:`CMAKE_AUTOMOC_RELAXED_MODE` variable to ``TRUE`` the
-rules for searching the files which will be processed by moc can be relaxed.
+By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules
+for searching the files which will be processed by moc can be relaxed.
See the documentation for this variable for more details.
-The global property :prop_gbl:`AUTOMOC_TARGETS_FOLDER` can be used to group the
+The global property AUTOMOC_TARGETS_FOLDER can be used to group the
automoc targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst b/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
index d086bf5..6ab5c85 100644
--- a/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTOMOC_MOC_OPTIONS
-------------------
-Additional options for moc when using :prop_tgt:`AUTOMOC`
+Additional options for moc when using automoc (see the AUTOMOC property)
-This property is only used if the :prop_tgt:`AUTOMOC` property is set to ``TRUE``
-for this target. In this case, it holds additional command line options
-which will be used when ``moc`` is executed during the build, i.e. it is
-equivalent to the optional ``OPTIONS`` argument of the :module:`qt4_wrap_cpp() <FindQt4>`
+This property is only used if the AUTOMOC property is set to TRUE for
+this target. In this case, it holds additional command line options
+which will be used when moc is executed during the build, i.e. it is
+equivalent to the optional OPTIONS argument of the qt4_wrap_cpp()
macro.
By default it is empty.
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index f6409ea..ef2c9c8 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -4,18 +4,18 @@ AUTORCC
Should the target be processed with autorcc (for Qt projects).
-``AUTORCC`` is a boolean specifying whether CMake will handle
-the Qt ``rcc`` code generator automatically, i.e. without having to use
-the :module:`QT4_ADD_RESOURCES() <FindQt4>` or QT5_ADD_RESOURCES() macro.
-Currently Qt4 and Qt5 are supported.
+AUTORCC is a boolean specifying whether CMake will handle
+the Qt rcc code generator automatically, i.e. without having to use
+the QT4_ADD_RESOURCES() or QT5_ADD_RESOURCES() macro. Currently Qt4 and Qt5 are
+supported.
-When this property is set to ``TRUE``, CMake will handle ``.qrc`` files added
-as target sources at build time and invoke ``rcc`` accordingly.
+When this property is set to TRUE, CMake will handle .qrc files added
+as target sources at build time and invoke rcc accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTORCC`
variable if it is set when a target is created.
Additional command line options for rcc can be set via the
-:prop_sf:`AUTORCC_OPTIONS` source file property on the ``.qrc`` file.
+:prop_sf:`AUTORCC_OPTIONS` source file property on the .qrc file.
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTORCC_OPTIONS.rst b/Help/prop_tgt/AUTORCC_OPTIONS.rst
index 1dd82ee..489e277 100644
--- a/Help/prop_tgt/AUTORCC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTORCC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTORCC_OPTIONS
---------------
-Additional options for ``rcc`` when using :prop_tgt:`AUTORCC`
+Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target property)
This property holds additional command line options
-which will be used when ``rcc`` is executed during the build via :prop_tgt:`AUTORCC`,
-i.e. it is equivalent to the optional ``OPTIONS`` argument of the
-:module:`qt4_add_resources() <FindQt4>` macro.
+which will be used when rcc is executed during the build via autorcc,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_add_resources() macro.
By default it is empty.
@@ -14,4 +14,4 @@ This property is initialized by the value of the variable
:variable:`CMAKE_AUTORCC` if it is set when a target is created.
The options set on the target may be overridden by :prop_sf:`AUTORCC_OPTIONS` set
-on the ``.qrc`` source file.
+on the .qrc source file.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 010c027..548c259 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -3,20 +3,20 @@ AUTOUIC
Should the target be processed with autouic (for Qt projects).
-``AUTOUIC`` is a boolean specifying whether CMake will handle
-the Qt ``uic`` code generator automatically, i.e. without having to use
-the :module:`QT4_WRAP_UI() <FindQt4>` or QT5_WRAP_UI() macro. Currently Qt4
-and Qt5 are supported.
+AUTOUIC is a boolean specifying whether CMake will handle
+the Qt uic code generator automatically, i.e. without having to use
+the QT4_WRAP_UI() or QT5_WRAP_UI() macro. Currently Qt4 and Qt5 are
+supported.
-When this property is set to ``TRUE``, CMake will scan the source files
-at build time and invoke ``uic`` accordingly.
-If an ``#include`` statement like ``#include "ui_foo.h"`` is found in
-``foo.cpp``, a ``foo.ui`` file is expected next to ``foo.cpp``, and ``uic`` is
-run on the ``foo.ui`` file.
+When this property is set to TRUE, CMake will scan the source files
+at build time and invoke uic accordingly.
+If an #include statement like #include "ui_foo.h" is found in
+foo.cpp, a foo.ui file is expected next to foo.cpp, and uic is
+run on the foo.ui file.
This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
variable if it is set when a target is created.
Additional command line options for uic can be set via the
-:prop_sf:`AUTOUIC_OPTIONS` source file property on the ``foo.ui`` file.
+:prop_sf:`AUTOUIC_OPTIONS` source file property on the foo.ui file.
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
index d0f865c..aeec38b 100644
--- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTOUIC_OPTIONS
---------------
-Additional options for uic when using :prop_tgt:`AUTOUIC`
+Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
This property holds additional command line options
-which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`,
-i.e. it is equivalent to the optional ``OPTIONS`` argument of the
-:module:`qt4_wrap_ui() <FindQt4>` macro.
+which will be used when uic is executed during the build via autouic,
+i.e. it is equivalent to the optional OPTIONS argument of the
+qt4_wrap_ui() macro.
By default it is empty.
@@ -14,7 +14,7 @@ This property is initialized by the value of the variable
:variable:`CMAKE_AUTOUIC` if it is set when a target is created.
The options set on the target may be overridden by :prop_sf:`AUTOUIC_OPTIONS` set
-on the ``.ui`` source file.
+on the .ui source file.
This property may use "generator expressions" with the syntax "$<...>".
See the :manual:`cmake-generator-expressions(7)` manual for available
diff --git a/Help/variable/CMAKE_AUTOMOC.rst b/Help/variable/CMAKE_AUTOMOC.rst
index 02e5eb5..87e8a9b 100644
--- a/Help/variable/CMAKE_AUTOMOC.rst
+++ b/Help/variable/CMAKE_AUTOMOC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOMOC
-------------
-Whether to handle ``moc`` automatically for Qt targets.
+Whether to handle moc automatically for Qt targets.
-This variable is used to initialize the :prop_tgt:`AUTOMOC` property on all the
+This variable is used to initialize the AUTOMOC property on all the
targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst b/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
index 09bf5cd..bdbed85 100644
--- a/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
@@ -1,7 +1,8 @@
CMAKE_AUTOMOC_MOC_OPTIONS
-------------------------
-Additional options for ``moc`` when using :variable:`CMAKE_AUTOMOC`.
+Additional options for moc when using automoc (see CMAKE_AUTOMOC).
-This variable is used to initialize the :prop_tgt:`AUTOMOC_MOC_OPTIONS` property
-on all the targets. See that target property for additional information.
+This variable is used to initialize the AUTOMOC_MOC_OPTIONS property
+on all the targets. See that target property for additional
+information.
diff --git a/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst b/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
index a814d40..8858410 100644
--- a/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
+++ b/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
@@ -3,11 +3,11 @@ CMAKE_AUTOMOC_RELAXED_MODE
Switch between strict and relaxed automoc mode.
-By default, :prop_tgt:`AUTOMOC` behaves exactly as described in the documentation
-of the :prop_tgt:`AUTOMOC` target property. When set to ``TRUE``, it accepts more
-input and tries to find the correct input file for ``moc`` even if it
+By default, automoc behaves exactly as described in the documentation
+of the AUTOMOC target property. When set to TRUE, it accepts more
+input and tries to find the correct input file for moc even if it
differs from the documented behaviour. In this mode it e.g. also
checks whether a header file is intended to be processed by moc when a
-``"foo.moc"`` file has been included.
+"foo.moc" file has been included.
Relaxed mode has to be enabled for KDE4 compatibility.
diff --git a/Help/variable/CMAKE_AUTORCC.rst b/Help/variable/CMAKE_AUTORCC.rst
index 067f766..d213993 100644
--- a/Help/variable/CMAKE_AUTORCC.rst
+++ b/Help/variable/CMAKE_AUTORCC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTORCC
-------------
-Whether to handle ``rcc`` automatically for Qt targets.
+Whether to handle rcc automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTORCC` property on all the targets.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
index 298cb6b..5efbfa3 100644
--- a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
@@ -1,7 +1,7 @@
CMAKE_AUTORCC_OPTIONS
---------------------
-Whether to handle ``rcc`` automatically for Qt targets.
+Whether to handle rcc automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTORCC_OPTIONS` property on
all the targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOUIC.rst b/Help/variable/CMAKE_AUTOUIC.rst
index 0beb555..3b016b0 100644
--- a/Help/variable/CMAKE_AUTOUIC.rst
+++ b/Help/variable/CMAKE_AUTOUIC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOUIC
-------------
-Whether to handle ``uic`` automatically for Qt targets.
+Whether to handle uic automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTOUIC` property on all the targets.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
index 3c9b8c4..6a88669 100644
--- a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOUIC_OPTIONS
---------------------
-Whether to handle ``uic`` automatically for Qt targets.
+Whether to handle uic automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTOUIC_OPTIONS` property on
all the targets. See that target property for additional information.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index f83f992..5baf9e0 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -6,11 +6,14 @@
#
# This module provides the function GENERATE_EXPORT_HEADER().
#
-# The ``GENERATE_EXPORT_HEADER`` function can be used to generate a file
+# The GENERATE_EXPORT_HEADER function can be used to generate a file
# suitable for preprocessor inclusion which contains EXPORT macros to be
-# used in library classes::
+# used in library classes.
+#
+# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
+#
+# ::
#
-# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
# [BASE_NAME <base_name>]
# [EXPORT_MACRO_NAME <export_macro_name>]
# [EXPORT_FILE_NAME <export_file_name>]
@@ -20,21 +23,20 @@
# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
# [DEFINE_NO_DEPRECATED]
# [PREFIX_NAME <prefix_name>]
-# )
#
+# )
#
-# The target properties :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>`
-# and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` can be used to add the appropriate
-# compile flags for targets. See the documentation of those target properties,
-# and the convenience variables
-# :variable:`CMAKE_CXX_VISIBILITY_PRESET <CMAKE_<LANG>_VISIBILITY_PRESET>` and
-# :variable:`CMAKE_VISIBILITY_INLINES_HIDDEN`.
+# The target properties CXX_VISIBILITY_PRESET and
+# VISIBILITY_INLINES_HIDDEN can be used to add the appropriate compile
+# flags for targets. See the documentation of those target properties,
+# and the convenience variables CMAKE_CXX_VISIBILITY_PRESET and
+# CMAKE_VISIBILITY_INLINES_HIDDEN.
#
-# By default ``GENERATE_EXPORT_HEADER()`` generates macro names in a file
+# By default GENERATE_EXPORT_HEADER() generates macro names in a file
# name determined by the name of the library. This means that in the
-# simplest case, users of ``GenerateExportHeader`` will be equivalent to:
+# simplest case, users of generate_export_header will be equivalent to:
#
-# .. code-block:: cmake
+# ::
#
# set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
@@ -47,9 +49,10 @@
# )
#
#
+#
# And in the ABI header files:
#
-# .. code-block:: c++
+# ::
#
# #include "somelib_export.h"
# class SOMELIB_EXPORT SomeClass {
@@ -57,16 +60,17 @@
# };
#
#
+#
# The CMake fragment will generate a file in the
-# ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
-# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
-# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``. The
+# ${CMAKE_CURRENT_BINARY_DIR} called somelib_export.h containing the
+# macros SOMELIB_EXPORT, SOMELIB_NO_EXPORT, SOMELIB_DEPRECATED,
+# SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT. The
# resulting file should be installed with other headers in the library.
#
-# The ``BASE_NAME`` argument can be used to override the file name and the
-# names used for the macros:
+# The BASE_NAME argument can be used to override the file name and the
+# names used for the macros
#
-# .. code-block:: cmake
+# ::
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -74,14 +78,14 @@
# )
#
#
-# Generates a file called ``other_name_export.h`` containing the macros
-# ``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
-# etc.
#
-# The ``BASE_NAME`` may be overridden by specifiying other options in the
+# Generates a file called other_name_export.h containing the macros
+# OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and OTHER_NAME_DEPRECATED etc.
+#
+# The BASE_NAME may be overridden by specifiying other options in the
# function. For example:
#
-# .. code-block:: cmake
+# ::
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -89,10 +93,11 @@
# )
#
#
-# creates the macro ``OTHER_NAME_EXPORT`` instead of ``SOMELIB_EXPORT``, but
-# other macros and the generated file name is as default:
#
-# .. code-block:: cmake
+# creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT, but
+# other macros and the generated file name is as default.
+#
+# ::
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -100,16 +105,17 @@
# )
#
#
-# creates the macro ``KDE_DEPRECATED`` instead of ``SOMELIB_DEPRECATED``.
#
-# If ``LIBRARY_TARGET`` is a static library, macros are defined without
+# creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED.
+#
+# If LIBRARY_TARGET is a static library, macros are defined without
# values.
#
# If the same sources are used to create both a shared and a static
-# library, the uppercased symbol ``${BASE_NAME}_STATIC_DEFINE`` should be
-# used when building the static library:
+# library, the uppercased symbol ${BASE_NAME}_STATIC_DEFINE should be
+# used when building the static library
#
-# .. code-block:: cmake
+# ::
#
# add_library(shared_variant SHARED ${lib_SRCS})
# add_library(static_variant ${lib_SRCS})
@@ -117,14 +123,16 @@
# set_target_properties(static_variant PROPERTIES
# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
#
+#
+#
# This will cause the export macros to expand to nothing when building
# the static library.
#
-# If ``DEFINE_NO_DEPRECATED`` is specified, then a macro
-# ``${BASE_NAME}_NO_DEPRECATED`` will be defined This macro can be used to
-# remove deprecated code from preprocessor output:
+# If DEFINE_NO_DEPRECATED is specified, then a macro
+# ${BASE_NAME}_NO_DEPRECATED will be defined This macro can be used to
+# remove deprecated code from preprocessor output.
#
-# .. code-block:: cmake
+# ::
#
# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
# if (EXCLUDE_DEPRECATED)
@@ -133,9 +141,10 @@
# generate_export_header(somelib ${NO_BUILD_DEPRECATED})
#
#
+#
# And then in somelib:
#
-# .. code-block:: c++
+# ::
#
# class SOMELIB_EXPORT SomeClass
# {
@@ -145,38 +154,42 @@
# #endif
# };
#
-# .. code-block:: c++
+#
+#
+# ::
#
# #ifndef SOMELIB_NO_DEPRECATED
# void SomeClass::oldMethod() { }
# #endif
#
#
-# If ``PREFIX_NAME`` is specified, the argument will be used as a prefix to
+#
+# If PREFIX_NAME is specified, the argument will be used as a prefix to
# all generated macros.
#
# For example:
#
-# .. code-block:: cmake
+# ::
#
# generate_export_header(somelib PREFIX_NAME VTK_)
#
-# Generates the macros ``VTK_SOMELIB_EXPORT`` etc.
#
-# ::
#
-# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
+# Generates the macros VTK_SOMELIB_EXPORT etc.
+#
+#
+#
+# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
#
-# The ``ADD_COMPILER_EXPORT_FLAGS`` function adds ``-fvisibility=hidden`` to
-# :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` if supported, and is a no-op
-# on Windows which does not need extra compiler flags for exporting support.
-# You may optionally pass a single argument to ``ADD_COMPILER_EXPORT_FLAGS``
-# that will be populated with the ``CXX_FLAGS`` required to enable visibility
+# The ADD_COMPILER_EXPORT_FLAGS function adds -fvisibility=hidden to
+# CMAKE_CXX_FLAGS if supported, and is a no-op on Windows which does not
+# need extra compiler flags for exporting support. You may optionally
+# pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will be
+# populated with the required CXX_FLAGS required to enable visibility
# support for the compiler/architecture in use.
#
# This function is deprecated. Set the target properties
-# :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
-# :prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.
+# CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN instead.
#=============================================================================
# Copyright 2011 Stephen Kelly <steveire at gmail.com>
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 87bfb3c..e4d7f7f 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -33,15 +33,6 @@ bool cmAddDependenciesCommand
}
if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
{
- if (target->GetType() == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "Cannot add target-level dependencies to INTERFACE library "
- "target \"" << target_name << "\".\n";
- this->SetError(e.str().c_str());
- return false;
- }
-
std::vector<std::string>::const_iterator s = args.begin();
++s; // skip over target_name
for (; s != args.end(); ++s)
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 2627445..0f98f35 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -49,117 +49,47 @@ bool cmAddLibraryCommand
std::string libType = *s;
if(libType == "STATIC")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting STATIC type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::STATIC_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "SHARED")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting SHARED type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::SHARED_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "MODULE")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting MODULE type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::MODULE_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "OBJECT")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting OBJECT type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::OBJECT_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "UNKNOWN")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting UNKNOWN type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::UNKNOWN_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "ALIAS")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting ALIAS type.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
isAlias = true;
}
else if(libType == "INTERFACE")
{
- if (haveSpecifiedType)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting/multiple types.";
- this->SetError(e.str().c_str());
- return false;
- }
- if (isAlias)
- {
- cmOStringStream e;
- e << "INTERFACE library specified with conflicting ALIAS type.";
- this->SetError(e.str().c_str());
- return false;
- }
- if (excludeFromAll)
- {
- cmOStringStream e;
- e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
type = cmTarget::INTERFACE_LIBRARY;
haveSpecifiedType = true;
}
else if(*s == "EXCLUDE_FROM_ALL")
{
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- cmOStringStream e;
- e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
- this->SetError(e.str().c_str());
- return false;
- }
++s;
excludeFromAll = true;
}
@@ -179,24 +109,6 @@ bool cmAddLibraryCommand
}
}
- if (type == cmTarget::INTERFACE_LIBRARY)
- {
- if (s != args.end())
- {
- cmOStringStream e;
- e << "INTERFACE library requires no source arguments.";
- this->SetError(e.str().c_str());
- return false;
- }
- if (importGlobal && !importTarget)
- {
- cmOStringStream e;
- e << "INTERFACE library specified as GLOBAL, but not as IMPORTED.";
- this->SetError(e.str().c_str());
- return false;
- }
- }
-
bool nameOk = cmGeneratorExpression::IsValidTargetName(libName) &&
!cmGlobalGenerator::IsReservedTarget(libName);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 4543f79..2a87e4f 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -825,36 +825,36 @@ cmExportFileGenerator
::SetImportLinkProperty(std::string const& suffix,
cmTarget* target,
const char* propName,
- std::vector<std::string> const& entries,
+ std::vector<std::string> const& libs,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets
)
{
- // Skip the property if there are no entries.
- if(entries.empty())
+ // Skip the property if there are no libraries.
+ if(libs.empty())
{
return;
}
// Construct the property value.
- std::string link_entries;
+ std::string link_libs;
const char* sep = "";
- for(std::vector<std::string>::const_iterator li = entries.begin();
- li != entries.end(); ++li)
+ for(std::vector<std::string>::const_iterator li = libs.begin();
+ li != libs.end(); ++li)
{
// Separate this from the previous entry.
- link_entries += sep;
+ link_libs += sep;
sep = ";";
std::string temp = *li;
this->AddTargetNamespace(temp, target, missingTargets);
- link_entries += temp;
+ link_libs += temp;
}
// Store the property.
std::string prop = propName;
prop += suffix;
- properties[prop] = link_entries;
+ properties[prop] = link_libs;
}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 1438f4d..6fd23b0 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -82,7 +82,7 @@ protected:
std::vector<std::string>& missingTargets);
void SetImportLinkProperty(std::string const& suffix,
cmTarget* target, const char* propName,
- std::vector<std::string> const& entries,
+ std::vector<std::string> const& libs,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 73e9b31..1025dc0 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -114,18 +114,13 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
std::vector<std::string> missingTargets;
bool require2_8_12 = false;
- bool require3_0_0 = false;
- bool requiresConfigFiles = false;
+ bool require2_8_13 = false;
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
tei = allTargets.begin();
tei != allTargets.end(); ++tei)
{
cmTarget* te = (*tei)->Target;
-
- requiresConfigFiles = requiresConfigFiles
- || te->GetType() != cmTarget::INTERFACE_LIBRARY;
-
this->GenerateImportTargetCode(os, te);
ImportPropertyMap properties;
@@ -165,7 +160,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
}
if (te->GetType() == cmTarget::INTERFACE_LIBRARY)
{
- require3_0_0 = true;
+ require2_8_13 = true;
}
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
te, properties);
@@ -174,7 +169,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->GenerateInterfaceProperties(te, os, properties);
}
- if (require3_0_0)
+ if (require2_8_13)
{
this->GenerateRequiredCMakeVersion(os, "2.8.12.20131007");
}
@@ -202,19 +197,15 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
}
this->GenerateImportedFileCheckLoop(os);
- bool result = true;
// Generate an import file for each configuration.
- // Don't do this if we only export INTERFACE_LIBRARY targets.
- if (requiresConfigFiles)
+ bool result = true;
+ for(std::vector<std::string>::const_iterator
+ ci = this->Configurations.begin();
+ ci != this->Configurations.end(); ++ci)
{
- for(std::vector<std::string>::const_iterator
- ci = this->Configurations.begin();
- ci != this->Configurations.end(); ++ci)
+ if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
{
- if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
- {
- result = false;
- }
+ result = false;
}
}
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 8d37b62..d9bc04c 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -36,8 +36,6 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
-#undef FIND_TARGETS
-
this->PopulateProperties(te, properties, emittedDeps);
this->GenerateInterfaceProperties(te, os, properties);
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 3329f8a..55c20d6 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1151,8 +1151,8 @@ void cmFindPackageCommand::AddPrefixesSystemEnvironment()
std::string const& d = *i;
// If the path is a PREFIX/bin case then add its parent instead.
- if((d.size() >= 4 && cmHasLiteralSuffix(d, "/bin")) ||
- (d.size() >= 5 && cmHasLiteralSuffix(d, "/sbin")))
+ if((d.size() >= 4 && strcmp(d.c_str()+d.size()-4, "/bin") == 0) ||
+ (d.size() >= 5 && strcmp(d.c_str()+d.size()-5, "/sbin") == 0))
{
this->AddPathInternal(cmSystemTools::GetFilenamePath(d), EnvPath);
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 84d7735..92f74f3 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -40,7 +40,6 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(TEST_TRANSITIVE_PROPERTY_METHOD)
false)
)
-#undef TEST_TRANSITIVE_PROPERTY_METHOD
{
std::map<cmStdString, std::set<cmStdString> >::const_iterator it
= top->Seen.find(target);
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 98ffd36..fd47ad7 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -56,9 +56,7 @@ struct cmGeneratorExpressionDAGChecker
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) \
bool METHOD () const;
- CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
-
-#undef DECLARE_TRANSITIVE_PROPERTY_METHOD
+CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
bool GetTransitivePropertiesOnly();
void SetTransitivePropertiesOnly()
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index f0e40ea..c8010d0 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -19,7 +19,6 @@
#include <cmsys/String.h>
#include <assert.h>
-#include <errno.h>
//----------------------------------------------------------------------------
#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
@@ -49,7 +48,7 @@ struct cmGeneratorExpressionNode
enum {
DynamicParameters = 0,
OneOrMoreParameters = -1,
- OneOrZeroParameters = -2
+ ZeroOrMoreParameters = -2
};
virtual ~cmGeneratorExpressionNode() {}
@@ -198,92 +197,6 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
} strEqualNode;
//----------------------------------------------------------------------------
-static const struct EqualNode : public cmGeneratorExpressionNode
-{
- EqualNode() {}
-
- virtual int NumExpectedParameters() const { return 2; }
-
- std::string Evaluate(const std::vector<std::string> ¶meters,
- cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content,
- cmGeneratorExpressionDAGChecker *) const
- {
- char *pEnd;
-
- int base = 0;
- bool flipSign = false;
-
- const char *lhs = parameters[0].c_str();
- if (cmHasLiteralPrefix(lhs, "0b"))
- {
- base = 2;
- lhs += 2;
- }
- if (cmHasLiteralPrefix(lhs, "-0b"))
- {
- base = 2;
- lhs += 3;
- flipSign = true;
- }
- if (cmHasLiteralPrefix(lhs, "+0b"))
- {
- base = 2;
- lhs += 3;
- }
-
- long lnum = strtol(lhs, &pEnd, base);
- if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<EQUAL> parameter " + parameters[0] + " is not a valid integer.");
- return std::string();
- }
-
- if (flipSign)
- {
- lnum = -lnum;
- }
-
- base = 0;
- flipSign = false;
-
- const char *rhs = parameters[1].c_str();
- if (cmHasLiteralPrefix(rhs, "0b"))
- {
- base = 2;
- rhs += 2;
- }
- if (cmHasLiteralPrefix(rhs, "-0b"))
- {
- base = 2;
- rhs += 3;
- flipSign = true;
- }
- if (cmHasLiteralPrefix(rhs, "+0b"))
- {
- base = 2;
- rhs += 3;
- }
-
- long rnum = strtol(rhs, &pEnd, base);
- if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<EQUAL> parameter " + parameters[1] + " is not a valid integer.");
- return std::string();
- }
-
- if (flipSign)
- {
- rnum = -rnum;
- }
-
- return lnum == rnum ? "1" : "0";
- }
-} equalNode;
-
-//----------------------------------------------------------------------------
static const struct LowerCaseNode : public cmGeneratorExpressionNode
{
LowerCaseNode() {}
@@ -384,7 +297,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{
CompilerIdNode() {}
- virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
+ virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
std::string EvaluateWithLanguage(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -430,6 +343,12 @@ static const struct CCompilerIdNode : public CompilerIdNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
+ if (parameters.size() != 0 && parameters.size() != 1)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<C_COMPILER_ID> expression requires one or two parameters");
+ return std::string();
+ }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -452,6 +371,12 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
+ if (parameters.size() != 0 && parameters.size() != 1)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<CXX_COMPILER_ID> expression requires one or two parameters");
+ return std::string();
+ }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -469,7 +394,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
{
CompilerVersionNode() {}
- virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
+ virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
std::string EvaluateWithLanguage(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -514,6 +439,12 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
+ if (parameters.size() != 0 && parameters.size() != 1)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<C_COMPILER_VERSION> expression requires one or two parameters");
+ return std::string();
+ }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -536,6 +467,13 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
+ if (parameters.size() != 0 && parameters.size() != 1)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<CXX_COMPILER_VERSION> expression requires one or two "
+ "parameters");
+ return std::string();
+ }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -554,7 +492,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
{
PlatformIdNode() {}
- virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
+ virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
std::string Evaluate(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -772,8 +710,6 @@ static const char* targetPropertyTransitiveWhitelist[] = {
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME)
};
-#undef TRANSITIVE_PROPERTY_NAME
-
std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
cmTarget const* target,
cmTarget const* headTarget,
@@ -1001,7 +937,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
ASSERT_TRANSITIVE_PROPERTY_METHOD)
false);
}
-#undef ASSERT_TRANSITIVE_PROPERTY_METHOD
}
std::string linkedTargetsContent;
@@ -1557,8 +1492,6 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &targetSoNameFileDirNode;
else if (identifier == "STREQUAL")
return &strEqualNode;
- else if (identifier == "EQUAL")
- return &equalNode;
else if (identifier == "LOWER_CASE")
return &lowerCaseNode;
else if (identifier == "UPPER_CASE")
@@ -1800,12 +1733,6 @@ std::string GeneratorExpressionContent::EvaluateParameters(
reportError(context, this->GetOriginalExpression(), "$<" + identifier
+ "> expression requires at least one parameter.");
}
- if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters
- && parameters.size() > 2)
- {
- reportError(context, this->GetOriginalExpression(), "$<" + identifier
- + "> expression requires one or zero parameters.");
- }
return std::string();
}
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index a1454a3..faba7cd 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -298,7 +298,7 @@ bool cmGetPropertyCommand::HandleTargetMode()
return this->StoreResult(target->GetName());
}
}
- return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
+ return false;
}
if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name.c_str()))
{
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index fd267ee..227a948 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1309,13 +1309,13 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
{
cmTarget* t = &ti->second;
- t->AppendBuildInterfaceIncludes();
-
if (t->GetType() == cmTarget::INTERFACE_LIBRARY)
{
continue;
}
+ t->AppendBuildInterfaceIncludes();
+
for (std::vector<cmValueWithOrigin>::const_iterator it
= noconfig_compile_definitions.begin();
it != noconfig_compile_definitions.end(); ++it)
@@ -1880,8 +1880,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
cmTarget& target)
{
- if(target.GetType() == cmTarget::INTERFACE_LIBRARY
- || target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+ if(target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{
// This target is excluded from its directory.
return true;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 381c1f5..b5a46d0 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -488,8 +488,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
dir.c_str());
}
- if(target.GetType() != cmTarget::INTERFACE_LIBRARY
- && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+ if(!target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{
allbuild->AddUtility(target.GetName());
}
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index e20fe02..30c1743 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -55,7 +55,7 @@ bool cmIncludeDirectoryCommand
std::vector<std::string> includes;
- this->GetIncludes(*i, includes);
+ GetIncludes(*i, includes);
if (before)
{
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6883f57..30a1557 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4045,8 +4045,8 @@ cmMakefile::AddImportedTarget(const char* name, cmTarget::TargetType type,
// Create the target.
cmsys::auto_ptr<cmTarget> target(new cmTarget);
target->SetType(type, name);
- target->MarkAsImported();
target->SetMakefile(this);
+ target->MarkAsImported();
// Add to the set of available imported targets.
this->ImportedTargets[name] = target.get();
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 783afe7..eb6e52f 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -391,20 +391,6 @@ inline bool cmHasLiteralPrefixImpl(const char* str1,
return strncmp(str1, str2, N) == 0;
}
-inline bool cmHasLiteralSuffixImpl(const std::string &str1,
- const char *str2,
- size_t N)
-{
- return strcmp(str1.c_str() + str1.size() - N, str2) == 0;
-}
-
-inline bool cmHasLiteralSuffixImpl(const char* str1,
- const char* str2,
- size_t N)
-{
- return strcmp(str1 + strlen(str1) - N, str2) == 0;
-}
-
#if defined(_MSC_VER) && _MSC_VER < 1300 \
|| defined(__GNUC__) && __GNUC__ < 3 \
|| defined(__BORLANDC__)
@@ -416,9 +402,6 @@ inline bool cmHasLiteralSuffixImpl(const char* str1,
#define cmHasLiteralPrefix(STR1, STR2) \
cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1)
-#define cmHasLiteralSuffix(STR1, STR2) \
- cmHasLiteralSuffixImpl(STR1, "" STR2 "", sizeof(STR2) - 1)
-
#else
template<typename T, size_t N>
@@ -434,12 +417,6 @@ bool cmHasLiteralPrefix(T str1, const char (&str2)[N])
return cmHasLiteralPrefixImpl(str1, str2, N - 1);
}
-template<typename T, size_t N>
-bool cmHasLiteralSuffix(T str1, const char (&str2)[N])
-{
- return cmHasLiteralSuffixImpl(str1, str2, N - 1);
-}
-
#endif
struct cmStrCmp {
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1de2358..b8163c8 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -359,11 +359,18 @@ bool cmSystemTools::IsOn(const char* val)
bool cmSystemTools::IsNOTFOUND(const char* val)
{
- if(strcmp(val, "NOTFOUND") == 0)
+ size_t len = strlen(val);
+ const char* notfound = "-NOTFOUND";
+ const size_t lenNotFound = 9;
+ if(len < lenNotFound-1)
{
- return true;
+ return false;
+ }
+ if(len == lenNotFound-1)
+ {
+ return ( strcmp(val, "NOTFOUND") == 0);
}
- return cmHasLiteralSuffix(val, "-NOTFOUND");
+ return ((strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0));
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dbffb6b..a0177fb 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -24,7 +24,6 @@
#include <set>
#include <stdlib.h> // required for atof
#include <assert.h>
-#include <errno.h>
const char* cmTarget::GetTargetTypeName(TargetType targetType)
{
@@ -137,7 +136,7 @@ public:
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
- std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
+ std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceIncludeDirectoriesEntries;
@@ -331,36 +330,34 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Save the backtrace of target construction.
this->Makefile->GetBacktrace(this->Internal->Backtrace);
- if (!this->IsImported())
+ // Initialize the INCLUDE_DIRECTORIES property based on the current value
+ // of the same directory property:
+ const std::vector<cmValueWithOrigin> parentIncludes =
+ this->Makefile->GetIncludeDirectoriesEntries();
+
+ for (std::vector<cmValueWithOrigin>::const_iterator it
+ = parentIncludes.begin(); it != parentIncludes.end(); ++it)
{
- // Initialize the INCLUDE_DIRECTORIES property based on the current value
- // of the same directory property:
- const std::vector<cmValueWithOrigin> parentIncludes =
- this->Makefile->GetIncludeDirectoriesEntries();
+ this->InsertInclude(*it);
+ }
- for (std::vector<cmValueWithOrigin>::const_iterator it
- = parentIncludes.begin(); it != parentIncludes.end(); ++it)
- {
- this->InsertInclude(*it);
- }
- const std::set<cmStdString> parentSystemIncludes =
- this->Makefile->GetSystemIncludeDirectories();
+ const std::set<cmStdString> parentSystemIncludes =
+ this->Makefile->GetSystemIncludeDirectories();
- for (std::set<cmStdString>::const_iterator it
- = parentSystemIncludes.begin();
- it != parentSystemIncludes.end(); ++it)
- {
- this->SystemIncludeDirectories.insert(*it);
- }
+ for (std::set<cmStdString>::const_iterator it
+ = parentSystemIncludes.begin();
+ it != parentSystemIncludes.end(); ++it)
+ {
+ this->SystemIncludeDirectories.insert(*it);
+ }
- const std::vector<cmValueWithOrigin> parentOptions =
- this->Makefile->GetCompileOptionsEntries();
+ const std::vector<cmValueWithOrigin> parentOptions =
+ this->Makefile->GetCompileOptionsEntries();
- for (std::vector<cmValueWithOrigin>::const_iterator it
- = parentOptions.begin(); it != parentOptions.end(); ++it)
- {
- this->InsertCompileOption(*it);
- }
+ for (std::vector<cmValueWithOrigin>::const_iterator it
+ = parentOptions.begin(); it != parentOptions.end(); ++it)
+ {
+ this->InsertCompileOption(*it);
}
if (this->GetType() != INTERFACE_LIBRARY)
@@ -1045,8 +1042,8 @@ cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
void cmTarget::FinalizeSystemIncludeDirectories()
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkImplementationPropertyEntries.begin(),
- end = this->Internal->LinkImplementationPropertyEntries.end();
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -1403,10 +1400,14 @@ static bool whiteListedInterfaceProperty(const char *prop)
"COMPATIBLE_INTERFACE_NUMBER_MAX",
"COMPATIBLE_INTERFACE_NUMBER_MIN",
"COMPATIBLE_INTERFACE_STRING",
+ "EXCLUDE_FROM_ALL",
+ "EXCLUDE_FROM_DEFAULT_BUILD",
"EXPORT_NAME",
+ "IMPORTED_LINK_INTERFACE_LANGUAGES",
"IMPORTED",
"NAME",
- "TYPE"
+ "TYPE",
+ "VERSION"
};
if (std::binary_search(cmArrayBegin(builtIns),
@@ -1417,7 +1418,9 @@ static bool whiteListedInterfaceProperty(const char *prop)
return true;
}
- if (cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
+ if (cmHasLiteralPrefix(prop, "EXCLUDE_FROM_DEFAULT_BUILD_")
+ || cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LANGUAGES_")
+ || cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
{
return true;
}
@@ -1492,11 +1495,11 @@ void cmTarget::SetProperty(const char* prop, const char* value)
}
if (strcmp(prop, "LINK_LIBRARIES") == 0)
{
- this->Internal->LinkImplementationPropertyEntries.clear();
+ this->Internal->LinkInterfacePropertyEntries.clear();
cmListFileBacktrace lfbt;
this->Makefile->GetBacktrace(lfbt);
cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkImplementationPropertyEntries.push_back(entry);
+ this->Internal->LinkInterfacePropertyEntries.push_back(entry);
return;
}
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
@@ -1567,7 +1570,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
cmListFileBacktrace lfbt;
this->Makefile->GetBacktrace(lfbt);
cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkImplementationPropertyEntries.push_back(entry);
+ this->Internal->LinkInterfacePropertyEntries.push_back(entry);
return;
}
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
@@ -1600,7 +1603,6 @@ void cmTarget::AppendBuildInterfaceIncludes()
if(this->GetType() != cmTarget::SHARED_LIBRARY &&
this->GetType() != cmTarget::STATIC_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY &&
- this->GetType() != cmTarget::INTERFACE_LIBRARY &&
!this->IsExecutableWithExports())
{
return;
@@ -1880,8 +1882,8 @@ cmTarget::GetIncludeDirectories(const char *config) const
if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkImplementationPropertyEntries.begin(),
- end = this->Internal->LinkImplementationPropertyEntries.end();
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2109,8 +2111,8 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkImplementationPropertyEntries.begin(),
- end = this->Internal->LinkImplementationPropertyEntries.end();
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2222,8 +2224,8 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkImplementationPropertyEntries.begin(),
- end = this->Internal->LinkImplementationPropertyEntries.end();
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2570,8 +2572,6 @@ void cmTarget::GetTargetVersion(bool soversion,
minor = 0;
patch = 0;
- assert(this->GetType() != INTERFACE_LIBRARY);
-
// Look for a VERSION or SOVERSION property.
const char* prop = soversion? "SOVERSION" : "VERSION";
if(const char* version = this->GetProperty(prop))
@@ -2685,6 +2685,7 @@ const char *cmTarget::GetProperty(const char* prop,
this->GetType() == cmTarget::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY ||
+ this->GetType() == cmTarget::INTERFACE_LIBRARY ||
this->GetType() == cmTarget::UNKNOWN_LIBRARY)
{
if(strcmp(prop,"LOCATION") == 0)
@@ -2719,6 +2720,25 @@ const char *cmTarget::GetProperty(const char* prop,
this->GetLocation(configName.c_str()),
cmProperty::TARGET);
}
+ else
+ {
+ // Support "<CONFIG>_LOCATION" for compatibility.
+ int len = static_cast<int>(strlen(prop));
+ if(len > 9 && strcmp(prop+len-9, "_LOCATION") == 0)
+ {
+ std::string configName(prop, len-9);
+ if(configName != "IMPORTED")
+ {
+ if (!this->HandleLocationPropertyPolicy())
+ {
+ return 0;
+ }
+ this->Properties.SetProperty(prop,
+ this->GetLocation(configName.c_str()),
+ cmProperty::TARGET);
+ }
+ }
+ }
}
if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
{
@@ -2780,8 +2800,8 @@ const char *cmTarget::GetProperty(const char* prop,
output = "";
std::string sep;
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkImplementationPropertyEntries.begin(),
- end = this->Internal->LinkImplementationPropertyEntries.end();
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
output += sep;
@@ -3545,8 +3565,6 @@ void cmTarget::GetLibraryNames(std::string& name,
return;
}
- assert(this->GetType() != INTERFACE_LIBRARY);
-
// Check for library version properties.
const char* version = this->GetProperty("VERSION");
const char* soversion = this->GetProperty("SOVERSION");
@@ -4118,8 +4136,6 @@ std::string cmTarget::GetOutputName(const char* config, bool implib) const
//----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkVersion() const
{
- assert(this->GetType() != INTERFACE_LIBRARY);
-
if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
{
return fversion;
@@ -4198,23 +4214,20 @@ enum CompatibleType
//----------------------------------------------------------------------------
template<typename PropertyType>
-std::pair<bool, PropertyType> consistentProperty(PropertyType lhs,
- PropertyType rhs,
- CompatibleType t);
+PropertyType consistentProperty(PropertyType lhs, PropertyType rhs,
+ CompatibleType t);
//----------------------------------------------------------------------------
template<>
-std::pair<bool, bool> consistentProperty(bool lhs, bool rhs, CompatibleType)
+bool consistentProperty(bool lhs, bool rhs, CompatibleType)
{
- return std::make_pair(lhs == rhs, lhs);
+ return lhs == rhs;
}
//----------------------------------------------------------------------------
-std::pair<bool, const char*> consistentStringProperty(const char *lhs,
- const char *rhs)
+const char * consistentStringProperty(const char *lhs, const char *rhs)
{
- const bool b = strcmp(lhs, rhs) == 0;
- return std::make_pair(b, b ? lhs : 0);
+ return strcmp(lhs, rhs) == 0 ? lhs : 0;
}
#if defined(_MSC_VER) && _MSC_VER <= 1200
@@ -4228,74 +4241,49 @@ cmMinimum(const T& l, const T& r) {return l < r ? l : r;}
#endif
//----------------------------------------------------------------------------
-std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
- const char *rhs,
- CompatibleType t)
+const char * consistentNumberProperty(const char *lhs, const char *rhs,
+ CompatibleType t)
{
- char *pEnd;
-
-#if defined(_MSC_VER)
- static const char* const null_ptr = 0;
-#else
-# define null_ptr 0
-#endif
-
- long lnum = strtol(lhs, &pEnd, 0);
- if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
- {
- return std::pair<bool, const char*>(false, null_ptr);
- }
-
- long rnum = strtol(rhs, &pEnd, 0);
- if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
+ double lnum;
+ double rnum;
+ if(sscanf(lhs, "%lg", &lnum) != 1 ||
+ sscanf(rhs, "%lg", &rnum) != 1)
{
- return std::pair<bool, const char*>(false, null_ptr);
+ return 0;
}
-#if !defined(_MSC_VER)
-#undef null_ptr
-#endif
-
if (t == NumberMaxType)
{
- return std::make_pair(true, cmMaximum(lnum, rnum) == lnum ? lhs : rhs);
+ return cmMaximum(lnum, rnum) == lnum ? lhs : rhs;
}
else
{
- return std::make_pair(true, cmMinimum(lnum, rnum) == lnum ? lhs : rhs);
+ return cmMinimum(lnum, rnum) == lnum ? lhs : rhs;
}
}
//----------------------------------------------------------------------------
template<>
-std::pair<bool, const char*> consistentProperty(const char *lhs,
- const char *rhs,
- CompatibleType t)
+const char* consistentProperty(const char *lhs, const char *rhs,
+ CompatibleType t)
{
if (!lhs && !rhs)
{
- return std::make_pair(true, lhs);
+ return "";
}
if (!lhs)
{
- return std::make_pair(true, rhs);
+ return rhs ? rhs : "";
}
if (!rhs)
{
- return std::make_pair(true, lhs);
+ return lhs ? lhs : "";
}
-
-#if defined(_MSC_VER)
- static const char* const null_ptr = 0;
-#else
-# define null_ptr 0
-#endif
-
switch(t)
{
case BoolType:
assert(!"consistentProperty for strings called with BoolType");
- return std::pair<bool, const char*>(false, null_ptr);
+ return 0;
case StringType:
return consistentStringProperty(lhs, rhs);
case NumberMinType:
@@ -4303,12 +4291,7 @@ std::pair<bool, const char*> consistentProperty(const char *lhs,
return consistentNumberProperty(lhs, rhs, t);
}
assert(!"Unreachable!");
- return std::pair<bool, const char*>(false, null_ptr);
-
-#if !defined(_MSC_VER)
-#undef null_ptr
-#endif
-
+ return 0;
}
template<typename PropertyType>
@@ -4480,7 +4463,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
("INTERFACE_" + p).c_str(), 0);
std::string reportEntry;
- if (ifaceIsSet)
+ if (ifacePropContent)
{
reportEntry += " * Target \"";
reportEntry += li->Target->GetName();
@@ -4493,12 +4476,11 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
if (ifaceIsSet)
{
- std::pair<bool, PropertyType> consistent =
- consistentProperty(propContent,
+ PropertyType consistent = consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent.second);
- if (!consistent.first)
+ report += compatibilityAgree(t, propContent != consistent);
+ if (!consistent)
{
cmOStringStream e;
e << "Property " << p << " on target \""
@@ -4510,7 +4492,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent.second;
+ propContent = consistent;
continue;
}
}
@@ -4524,14 +4506,19 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
propContent = impliedValue<PropertyType>(propContent);
+ reportEntry += " * Target \"";
+ reportEntry += li->Target->GetName();
+ reportEntry += "\" property value \"";
+ reportEntry += valueAsString<PropertyType>(propContent);
+ reportEntry += "\" ";
+
if (ifaceIsSet)
{
- std::pair<bool, PropertyType> consistent =
- consistentProperty(propContent,
+ PropertyType consistent = consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent.second);
- if (!consistent.first)
+ report += compatibilityAgree(t, propContent != consistent);
+ if (!consistent)
{
cmOStringStream e;
e << "Property " << p << " on target \""
@@ -4544,7 +4531,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent.second;
+ propContent = consistent;
continue;
}
}
@@ -4560,12 +4547,11 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
if (propInitialized)
{
- std::pair<bool, PropertyType> consistent =
- consistentProperty(propContent,
+ PropertyType consistent = consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent.second);
- if (!consistent.first)
+ report += compatibilityAgree(t, propContent != consistent);
+ if (!consistent)
{
cmOStringStream e;
e << "The INTERFACE_" << p << " property of \""
@@ -4577,7 +4563,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent.second;
+ propContent = consistent;
continue;
}
}
@@ -5549,6 +5535,9 @@ void cmTarget::ComputeLinkImplementation(const char* config,
LinkImplementation& impl,
cmTarget const* head) const
{
+ // Compute which library configuration to link.
+ cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
+
// Collect libraries directly linked in this configuration.
std::vector<std::string> llibs;
this->GetDirectLinkLibraries(config, llibs, head);
@@ -5641,7 +5630,6 @@ void cmTarget::ComputeLinkImplementation(const char* config,
impl.Libraries.push_back(item);
}
- cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
li != oldllibs.end(); ++li)
@@ -5972,8 +5960,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
<< propsString <<
" property in the dependencies of target \"" << this->GetName() <<
"\". This is not allowed. A property may only require compatibility "
- "in a boolean interpretation, a numeric minimum, a numeric maximum or a "
- "string interpretation, but not a mixture.";
+ "in a boolean interpretation or a string interpretation, but not both.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
}
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index 9467fae..fdb1638 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -48,25 +48,3 @@ endif()
add_library(iface INTERFACE)
add_library(Alias::Iface ALIAS iface)
-
-get_target_property(_notAlias1 foo ALIASED_TARGET)
-if (NOT DEFINED _notAlias1)
- message(SEND_ERROR "_notAlias1 is not defined")
-endif()
-if (_notAlias1)
- message(SEND_ERROR "_notAlias1 is defined, but foo is not an ALIAS")
-endif()
-if (NOT _notAlias1 STREQUAL _notAlias1-NOTFOUND)
- message(SEND_ERROR "_notAlias1 not defined to a -NOTFOUND variant")
-endif()
-
-get_property(_notAlias2 TARGET foo PROPERTY ALIASED_TARGET)
-if (NOT DEFINED _notAlias2)
- message(SEND_ERROR "_notAlias2 is not defined")
-endif()
-if (_notAlias2)
- message(SEND_ERROR "_notAlias2 is defined, but foo is not an ALIAS")
-endif()
-if (NOT _notAlias2 STREQUAL _notAlias2-NOTFOUND)
- message(SEND_ERROR "_notAlias2 not defined to a -NOTFOUND variant")
-endif()
diff --git a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
index 995b32c..1652cf6 100644
--- a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
@@ -12,10 +12,3 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
"DO_GNU_TESTS"
)
endif()
-
-add_compile_options(-rtti)
-add_library(imp UNKNOWN IMPORTED)
-get_target_property(_res imp COMPILE_OPTIONS)
-if (_res)
- message(SEND_ERROR "add_compile_options populated the COMPILE_OPTIONS target property")
-endif()
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
index 14d40aa..900dbd0 100644
--- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
@@ -25,10 +25,3 @@ target_compile_definitions(consumer
target_compile_definitions(consumer
PRIVATE
)
-
-add_definitions(-DSOME_DEF)
-add_library(imp UNKNOWN IMPORTED)
-get_target_property(_res imp COMPILE_DEFINITIONS)
-if (_res)
- message(SEND_ERROR "add_definitions populated the COMPILE_DEFINITIONS target property")
-endif()
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index 661bbaa..8a564c7 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -62,10 +62,3 @@ target_include_directories(consumer
target_include_directories(consumer
SYSTEM PRIVATE
)
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-add_library(imp UNKNOWN IMPORTED)
-get_target_property(_res imp INCLUDE_DIRECTORIES)
-if (_res)
- message(SEND_ERROR "include_directories populated the INCLUDE_DIRECTORIES target property")
-endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 1d573c6..5ea604f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2168,7 +2168,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestConfig/ScriptWithArgs.log"
)
- ADD_TEST_MACRO(CMakeCommands.add_compile_options add_compile_options)
ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
ADD_TEST_MACRO(CMakeCommands.target_include_directories target_include_directories)
ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions)
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 350b518..5e64d2a 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -24,8 +24,6 @@ set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MIN
NUMBER_MIN_PROP1
NUMBER_MIN_PROP2
- NUMBER_MIN_PROP3
- NUMBER_MIN_PROP4
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MAX
@@ -36,7 +34,7 @@ set_property(TARGET iface1 APPEND PROPERTY
set(CMAKE_DEBUG_TARGET_PROPERTIES
BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
STRING_PROP1 STRING_PROP2 STRING_PROP3
- NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MIN_PROP3 NUMBER_MIN_PROP4
+ NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
)
@@ -46,8 +44,6 @@ set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
-set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP3 0x10)
-set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP4 0x10)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
@@ -60,8 +56,6 @@ set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2)
set_property(TARGET CompatibleInterface PROPERTY STRING_PROP3 prop3)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP2 250)
-set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP3 0xa)
-set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP4 0x1A)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP2 250)
@@ -75,8 +69,6 @@ target_compile_definitions(CompatibleInterface
$<$<STREQUAL:$<TARGET_PROPERTY:STRING_PROP3>,prop3>:STRING_PROP3>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP1>,50>:NUMBER_MIN_PROP1=50>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP2>,200>:NUMBER_MIN_PROP2=200>
- $<$<EQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA>
- $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP4>,0x10>:NUMBER_MIN_PROP4=0x10>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP1>,100>:NUMBER_MAX_PROP1=100>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP2>,250>:NUMBER_MAX_PROP2=250>
)
diff --git a/Tests/CompatibleInterface/main.cpp b/Tests/CompatibleInterface/main.cpp
index e23625a..fa299e9 100644
--- a/Tests/CompatibleInterface/main.cpp
+++ b/Tests/CompatibleInterface/main.cpp
@@ -33,9 +33,7 @@ enum {
NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>),
NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>),
NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>),
- NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>),
- NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>),
- NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>)
+ NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>)
};
#include "iface2.h"
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index 9d4793d..f400f13 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -23,10 +23,7 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_
add_library(sharediface INTERFACE)
target_link_libraries(sharediface INTERFACE sharedlib)
-install(TARGETS headeronly sharediface
- EXPORT expInterface
-)
-install(TARGETS sharedlib
+install(TARGETS headeronly sharediface sharedlib
EXPORT expInterface
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib NAMELINK_SKIP
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 4fb7ecd..892f80f 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -196,27 +196,6 @@ add_custom_target(check-part3 ALL
-Dlower_case=$<LOWER_CASE:Mi,XeD>
-Dupper_case=$<UPPER_CASE:MiX,eD>
-Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4f,oo:+bar-$>
- -Dequal1=$<EQUAL:1,2>
- -Dequal2=$<EQUAL:1,1>
- -Dequal3=$<EQUAL:0x1,1>
- -Dequal4=$<EQUAL:0x1,2>
- -Dequal5=$<EQUAL:0xA,0xa>
- -Dequal6=$<EQUAL:0xA,10>
- -Dequal7=$<EQUAL:0xA,012>
- -Dequal8=$<EQUAL:10,012>
- -Dequal9=$<EQUAL:10,010>
- -Dequal10=$<EQUAL:10,0b1010>
- -Dequal11=$<EQUAL:-10,-0xa>
- -Dequal12=$<EQUAL:10,+0xa>
- -Dequal13=$<EQUAL:+10,+0xa>
- -Dequal14=$<EQUAL:+10,0xa>
- -Dequal15=$<EQUAL:-10,-0xa>
- -Dequal16=$<EQUAL:-10,-0b1010>
- -Dequal17=$<EQUAL:-10,+0b1010>
- -Dequal18=$<EQUAL:10,+0b1010>
- -Dequal19=$<EQUAL:10,+012>
- -Dequal20=$<EQUAL:10,-012>
- -Dequal21=$<EQUAL:-10,-012>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 2c6bf49..3361eeb 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -37,24 +37,3 @@ endforeach()
check(lower_case "mi,xed")
check(upper_case "MIX,ED")
check(make_c_identifier "_4f_oo__bar__")
-check(equal1 "0")
-check(equal2 "1")
-check(equal3 "1")
-check(equal4 "0")
-check(equal5 "1")
-check(equal6 "1")
-check(equal7 "1")
-check(equal8 "1")
-check(equal9 "0")
-check(equal10 "1")
-check(equal11 "1")
-check(equal12 "1")
-check(equal13 "1")
-check(equal14 "1")
-check(equal15 "1")
-check(equal16 "1")
-check(equal17 "0")
-check(equal18 "1")
-check(equal19 "1")
-check(equal20 "0")
-check(equal21 "1")
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index b396eb6..8154ced 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -6,15 +6,13 @@ project(InterfaceLibrary)
add_library(iface_nodepends INTERFACE)
target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
-add_subdirectory(headerdir)
-
add_executable(InterfaceLibrary definetestexe.cpp)
-target_link_libraries(InterfaceLibrary iface_nodepends headeriface)
+target_link_libraries(InterfaceLibrary iface_nodepends)
add_subdirectory(libsdir)
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
-target_link_libraries(sharedlibtestexe shared_iface imported::iface)
+target_link_libraries(sharedlibtestexe shared_iface)
add_library(broken EXCLUDE_FROM_ALL broken.cpp)
diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp
index e7a10c1..decd37c 100644
--- a/Tests/InterfaceLibrary/definetestexe.cpp
+++ b/Tests/InterfaceLibrary/definetestexe.cpp
@@ -3,18 +3,6 @@
#error Expected IFACE_DEFINE
#endif
-#include "iface_header.h"
-
-#ifndef IFACE_HEADER_SRCDIR
-#error Expected IFACE_HEADER_SRCDIR
-#endif
-
-#include "iface_header_builddir.h"
-
-#ifndef IFACE_HEADER_BUILDDIR
-#error Expected IFACE_HEADER_BUILDDIR
-#endif
-
int main(int,char**)
{
return 0;
diff --git a/Tests/InterfaceLibrary/headerdir/CMakeLists.txt b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
deleted file mode 100644
index 98f521e..0000000
--- a/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
-
-add_library(headeriface INTERFACE)
-
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/iface_header_builddir.h"
- "#define IFACE_HEADER_BUILDDIR\n"
-)
diff --git a/Tests/InterfaceLibrary/headerdir/iface_header.h b/Tests/InterfaceLibrary/headerdir/iface_header.h
deleted file mode 100644
index 82dd157..0000000
--- a/Tests/InterfaceLibrary/headerdir/iface_header.h
+++ /dev/null
@@ -1 +0,0 @@
-#define IFACE_HEADER_SRCDIR
diff --git a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
index 4e529df..6999646 100644
--- a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
@@ -24,5 +24,3 @@ target_compile_definitions(shareddependlib
add_library(shared_iface INTERFACE)
target_link_libraries(shared_iface INTERFACE sharedlib)
-
-add_library(imported::iface INTERFACE IMPORTED GLOBAL)
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 7b99395..9dd5289 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -47,6 +47,7 @@ add_custom_target(generate_moc_input
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
)
+# set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" PROPERTIES GENERATED TRUE)
add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index e3efe28..0044564 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -25,28 +25,6 @@ CMake Debug Log:
\* Target "CompatibleInterface" property not set.
+
CMake Debug Log:
- Boolean compatibility of property "BOOL_PROP5" for target
- "CompatibleInterface" \(result: "FALSE"\):
-
- \* Target "CompatibleInterface" property not set.
- \* Target "iface1" property value "FALSE" \(Interface set\)
-+
-CMake Debug Log:
- Boolean compatibility of property "BOOL_PROP6" for target
- "CompatibleInterface" \(result: "FALSE"\):
-
- \* Target "CompatibleInterface" property not set.
- \* Target "iface1" property value "FALSE" \(Interface set\)
- \* Target "iface2" property value "FALSE" \(Agree\)
-+
-CMake Debug Log:
- Boolean compatibility of property "BOOL_PROP7" for target
- "CompatibleInterface" \(result: "FALSE"\):
-
- \* Target "CompatibleInterface" property is implied by use.
- \* Target "iface1" property value "FALSE" \(Agree\)
-+
-CMake Debug Log:
String compatibility of property "STRING_PROP1" for target
"CompatibleInterface" \(result: "prop1"\):
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 42a3af2..3214d8e 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -13,9 +13,6 @@ set_property(TARGET iface1 APPEND PROPERTY
BOOL_PROP2
BOOL_PROP3
BOOL_PROP4
- BOOL_PROP5
- BOOL_PROP6
- BOOL_PROP7
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING
@@ -35,7 +32,7 @@ set_property(TARGET iface1 APPEND PROPERTY
)
set(CMAKE_DEBUG_TARGET_PROPERTIES
- BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6 BOOL_PROP7
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
STRING_PROP1 STRING_PROP2 STRING_PROP3
NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
@@ -43,9 +40,6 @@ set(CMAKE_DEBUG_TARGET_PROPERTIES
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
-set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 OFF)
-set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP6 OFF)
-set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP7 OFF)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
@@ -53,15 +47,8 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
-add_library(iface2 INTERFACE)
-set_property(TARGET iface2 PROPERTY INTERFACE_BOOL_PROP6 OFF)
-
-add_library(iface3 INTERFACE)
-
add_executable(CompatibleInterface empty.cpp)
-target_link_libraries(CompatibleInterface iface1 iface2
- $<$<BOOL:$<TARGET_PROPERTY:BOOL_PROP7>>:iface3>
-)
+target_link_libraries(CompatibleInterface iface1)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt
deleted file mode 100644
index 723daec..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error: Property SOMEPROP on target "user" is
-implied to be empty because it was used to determine the link libraries
-already. The INTERFACE_SOMEPROP property on
-dependency "foo" is in conflict.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake
deleted file mode 100644
index a064d76..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-add_library(foo UNKNOWN IMPORTED)
-add_library(bar UNKNOWN IMPORTED)
-
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN SOMEPROP)
-set_property(TARGET foo PROPERTY INTERFACE_SOMEPROP 42)
-
-add_executable(user main.cpp)
-target_link_libraries(user foo $<$<STREQUAL:$<TARGET_PROPERTY:SOMEPROP>,42>:bar>)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
index 900e3f8..5a8f99d 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
@@ -2,5 +2,4 @@ CMake Error in CMakeLists.txt:
Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the
COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user".
This is not allowed. A property may only require compatibility in a
- boolean interpretation, a numeric minimum, a numeric maximum or a string
- interpretation, but not a mixture.
+ boolean interpretation or a string interpretation, but not both.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
index 4bae804..711368a 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
@@ -1,8 +1,9 @@
add_library(foo UNKNOWN IMPORTED)
+add_library(bar UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
add_executable(user main.cpp)
-target_link_libraries(user foo)
+target_link_libraries(user foo bar)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
deleted file mode 100644
index 2cfbae4..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-CMake Error in CMakeLists.txt:
- Property "OTHER" appears in both the COMPATIBLE_INTERFACE_BOOL,
- COMPATIBLE_INTERFACE_NUMBER_MIN and the COMPATIBLE_INTERFACE_STRING
- property in the dependencies of target "user". This is not allowed. A
- property may only require compatibility in a boolean interpretation, a
- numeric minimum, a numeric maximum or a string interpretation, but not a
- mixture.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
deleted file mode 100644
index 164ffd9..0000000
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-
-add_library(foo UNKNOWN IMPORTED)
-
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL OTHER)
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING OTHER)
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN OTHER)
-
-add_executable(user main.cpp)
-target_link_libraries(user foo)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index 0b9729b..b87adc8 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -7,10 +7,8 @@ run_cmake(InterfaceBool-builtin-prop)
run_cmake(InterfaceString-mismatch-depends)
run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
-run_cmake(InterfaceNumber-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
-run_cmake(InterfaceString-Bool-Min-Conflict)
run_cmake(DebugProperties)
if (QT_QMAKE_EXECUTABLE})
diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
index 9ca9a77..0d00b71 100644
--- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
@@ -4,6 +4,4 @@ run_cmake(invalid_name)
run_cmake(target_commands)
run_cmake(no_shared_libs)
run_cmake(whitelist)
-run_cmake(invalid_signature)
run_cmake(genex_link)
-run_cmake(add_dependencies)
diff --git a/Tests/RunCMake/interface_library/add_dependencies-result.txt b/Tests/RunCMake/interface_library/add_dependencies-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/interface_library/add_dependencies-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/interface_library/add_dependencies-stderr.txt b/Tests/RunCMake/interface_library/add_dependencies-stderr.txt
deleted file mode 100644
index c550b68..0000000
--- a/Tests/RunCMake/interface_library/add_dependencies-stderr.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-CMake Error at add_dependencies.cmake:4 \(add_dependencies\):
- add_dependencies Cannot add target-level dependencies to INTERFACE library
- target "iface".
-
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/add_dependencies.cmake b/Tests/RunCMake/interface_library/add_dependencies.cmake
deleted file mode 100644
index 12cdfb4..0000000
--- a/Tests/RunCMake/interface_library/add_dependencies.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-
-add_library(foo empty.cpp)
-add_library(iface INTERFACE)
-add_dependencies(iface foo)
diff --git a/Tests/RunCMake/interface_library/invalid_signature-result.txt b/Tests/RunCMake/interface_library/invalid_signature-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/interface_library/invalid_signature-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt
deleted file mode 100644
index 701586a..0000000
--- a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-CMake Error at invalid_signature.cmake:2 \(add_library\):
- add_library INTERFACE library requires no source arguments.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:3 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:4 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:5 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:6 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:7 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:8 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:9 \(add_library\):
- add_library INTERFACE library specified with conflicting STATIC type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:10 \(add_library\):
- add_library INTERFACE library specified with conflicting SHARED type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:11 \(add_library\):
- add_library INTERFACE library specified with conflicting MODULE type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:12 \(add_library\):
- add_library INTERFACE library specified with conflicting OBJECT type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:13 \(add_library\):
- add_library INTERFACE library specified with conflicting UNKNOWN type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:14 \(add_library\):
- add_library INTERFACE library specified with conflicting ALIAS type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:15 \(add_library\):
- add_library INTERFACE library specified with conflicting ALIAS type.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:16 \(add_library\):
- add_library INTERFACE library specified with conflicting/multiple types.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:17 \(add_library\):
- add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:18 \(add_library\):
- add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at invalid_signature.cmake:20 \(add_library\):
- add_library INTERFACE library requires no source arguments.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/invalid_signature.cmake b/Tests/RunCMake/interface_library/invalid_signature.cmake
deleted file mode 100644
index 67e3267..0000000
--- a/Tests/RunCMake/interface_library/invalid_signature.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-
-add_library(iface1 INTERFACE empty.cpp)
-add_library(iface3 STATIC INTERFACE)
-add_library(iface4 STATIC INTERFACE empty.cpp)
-add_library(iface5 SHARED INTERFACE)
-add_library(iface6 MODULE INTERFACE)
-add_library(iface7 OBJECT INTERFACE)
-add_library(iface8 UNKNOWN INTERFACE)
-add_library(iface9 INTERFACE STATIC)
-add_library(iface10 INTERFACE SHARED)
-add_library(iface11 INTERFACE MODULE)
-add_library(iface12 INTERFACE OBJECT)
-add_library(iface13 INTERFACE UNKNOWN)
-add_library(iface14 INTERFACE ALIAS)
-add_library(iface15 ALIAS INTERFACE)
-add_library(iface16 INTERFACE INTERFACE)
-add_library(iface17 INTERFACE EXCLUDE_FROM_ALL)
-add_library(iface18 EXCLUDE_FROM_ALL INTERFACE)
-add_library(iface19 GLOBAL INTERFACE)
-add_library(iface20 INTERFACE GLOBAL)
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index aa9735e..5e0ef87 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -11,7 +11,8 @@
#=============================================================================
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
+ cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
+ set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 336c74a..1955e42 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -12,16 +12,6 @@
import os
import re
-# Monkey patch for pygments reporting an error when generator expressions are
-# used.
-# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled
-from pygments.lexers import CMakeLexer
-from pygments.token import Name, Operator
-from pygments.lexer import bygroups
-CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
- bygroups(Operator, Name.Variable, Operator)))
-
-
from docutils.parsers.rst import Directive, directives
from docutils.transforms import Transform
try:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=029d3d7ce3edde2680a8bd9b9ac501ab0ccc1da1
commit 029d3d7ce3edde2680a8bd9b9ac501ab0ccc1da1
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 14:52:07 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:41 2013 +0100
add_library: Disallow invalid signatures for INTERFACE_LIBRARY.
Document the valid signatures. Add a test for the IMPORTED GLOBAL
signature.
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 45f1102..2d69c89 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -109,12 +109,21 @@ The signature
::
- add_library(<name> INTERFACE)
+ add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
creates an interface target. An interface target does not directly
create build output, though it may have properties set on it and it
may be installed, exported and imported. Typically the INTERFACE_*
properties are populated on the interface target using the
-set_property(), target_link_libraries(), target_include_directories()
-and target_compile_defintions() commands, and then it is used as an
-argument to target_link_libraries() like any other target.
+:command:`set_property`, :command:`target_link_libraries`,
+:command:`target_include_directories`
+and :command:`target_compile_defintions` commands, and then it is used as an
+argument to :command:`target_link_libraries` like any other target.
+
+An ``INTERFACE`` :prop_tgt:`IMPORTED` target may also be created with this
+signature. An :prop_tgt:`IMPORTED` library target references a library defined
+outside the project. The target name has scope in the directory in which it is
+created and below, but the ``GLOBAL`` option extends visibility. It may be
+referenced like any target built within the project. :prop_tgt:`IMPORTED`
+libraries are useful for convenient reference from commands like
+:command:`target_link_libraries`.
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 0f98f35..2627445 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -49,47 +49,117 @@ bool cmAddLibraryCommand
std::string libType = *s;
if(libType == "STATIC")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting STATIC type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::STATIC_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "SHARED")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting SHARED type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::SHARED_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "MODULE")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting MODULE type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::MODULE_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "OBJECT")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting OBJECT type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::OBJECT_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "UNKNOWN")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting UNKNOWN type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::UNKNOWN_LIBRARY;
haveSpecifiedType = true;
}
else if(libType == "ALIAS")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting ALIAS type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
isAlias = true;
}
else if(libType == "INTERFACE")
{
+ if (haveSpecifiedType)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting/multiple types.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ if (isAlias)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified with conflicting ALIAS type.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ if (excludeFromAll)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
type = cmTarget::INTERFACE_LIBRARY;
haveSpecifiedType = true;
}
else if(*s == "EXCLUDE_FROM_ALL")
{
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
++s;
excludeFromAll = true;
}
@@ -109,6 +179,24 @@ bool cmAddLibraryCommand
}
}
+ if (type == cmTarget::INTERFACE_LIBRARY)
+ {
+ if (s != args.end())
+ {
+ cmOStringStream e;
+ e << "INTERFACE library requires no source arguments.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ if (importGlobal && !importTarget)
+ {
+ cmOStringStream e;
+ e << "INTERFACE library specified as GLOBAL, but not as IMPORTED.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ }
+
bool nameOk = cmGeneratorExpression::IsValidTargetName(libName) &&
!cmGlobalGenerator::IsReservedTarget(libName);
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 396a84a..b396eb6 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -14,7 +14,7 @@ target_link_libraries(InterfaceLibrary iface_nodepends headeriface)
add_subdirectory(libsdir)
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
-target_link_libraries(sharedlibtestexe shared_iface)
+target_link_libraries(sharedlibtestexe shared_iface imported::iface)
add_library(broken EXCLUDE_FROM_ALL broken.cpp)
diff --git a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
index 6999646..4e529df 100644
--- a/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/libsdir/CMakeLists.txt
@@ -24,3 +24,5 @@ target_compile_definitions(shareddependlib
add_library(shared_iface INTERFACE)
target_link_libraries(shared_iface INTERFACE sharedlib)
+
+add_library(imported::iface INTERFACE IMPORTED GLOBAL)
diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
index d76600c..9ca9a77 100644
--- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake
@@ -4,5 +4,6 @@ run_cmake(invalid_name)
run_cmake(target_commands)
run_cmake(no_shared_libs)
run_cmake(whitelist)
+run_cmake(invalid_signature)
run_cmake(genex_link)
run_cmake(add_dependencies)
diff --git a/Tests/RunCMake/interface_library/invalid_signature-result.txt b/Tests/RunCMake/interface_library/invalid_signature-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_signature-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt
new file mode 100644
index 0000000..701586a
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_signature-stderr.txt
@@ -0,0 +1,89 @@
+CMake Error at invalid_signature.cmake:2 \(add_library\):
+ add_library INTERFACE library requires no source arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:3 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:4 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:5 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:6 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:7 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:8 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:9 \(add_library\):
+ add_library INTERFACE library specified with conflicting STATIC type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:10 \(add_library\):
+ add_library INTERFACE library specified with conflicting SHARED type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:11 \(add_library\):
+ add_library INTERFACE library specified with conflicting MODULE type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:12 \(add_library\):
+ add_library INTERFACE library specified with conflicting OBJECT type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:13 \(add_library\):
+ add_library INTERFACE library specified with conflicting UNKNOWN type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:14 \(add_library\):
+ add_library INTERFACE library specified with conflicting ALIAS type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:15 \(add_library\):
+ add_library INTERFACE library specified with conflicting ALIAS type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:16 \(add_library\):
+ add_library INTERFACE library specified with conflicting/multiple types.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:17 \(add_library\):
+ add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:18 \(add_library\):
+ add_library INTERFACE library may not be used with EXCLUDE_FROM_ALL.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at invalid_signature.cmake:20 \(add_library\):
+ add_library INTERFACE library requires no source arguments.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/invalid_signature.cmake b/Tests/RunCMake/interface_library/invalid_signature.cmake
new file mode 100644
index 0000000..67e3267
--- /dev/null
+++ b/Tests/RunCMake/interface_library/invalid_signature.cmake
@@ -0,0 +1,20 @@
+
+add_library(iface1 INTERFACE empty.cpp)
+add_library(iface3 STATIC INTERFACE)
+add_library(iface4 STATIC INTERFACE empty.cpp)
+add_library(iface5 SHARED INTERFACE)
+add_library(iface6 MODULE INTERFACE)
+add_library(iface7 OBJECT INTERFACE)
+add_library(iface8 UNKNOWN INTERFACE)
+add_library(iface9 INTERFACE STATIC)
+add_library(iface10 INTERFACE SHARED)
+add_library(iface11 INTERFACE MODULE)
+add_library(iface12 INTERFACE OBJECT)
+add_library(iface13 INTERFACE UNKNOWN)
+add_library(iface14 INTERFACE ALIAS)
+add_library(iface15 ALIAS INTERFACE)
+add_library(iface16 INTERFACE INTERFACE)
+add_library(iface17 INTERFACE EXCLUDE_FROM_ALL)
+add_library(iface18 EXCLUDE_FROM_ALL INTERFACE)
+add_library(iface19 GLOBAL INTERFACE)
+add_library(iface20 INTERFACE GLOBAL)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=442301425dfca56aac1ddc6eec7f6505241ffb4c
commit 442301425dfca56aac1ddc6eec7f6505241ffb4c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 14:35:14 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:41 2013 +0100
cmTarget: Move a variable initialization closer to where it is used.
This is more readable and easier to reason about.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f94288d..dbffb6b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5549,9 +5549,6 @@ void cmTarget::ComputeLinkImplementation(const char* config,
LinkImplementation& impl,
cmTarget const* head) const
{
- // Compute which library configuration to link.
- cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
-
// Collect libraries directly linked in this configuration.
std::vector<std::string> llibs;
this->GetDirectLinkLibraries(config, llibs, head);
@@ -5644,6 +5641,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
impl.Libraries.push_back(item);
}
+ cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
li != oldllibs.end(); ++li)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc3572f140cc9fbe5ed2d45f31def03a9e7aa0bc
commit dc3572f140cc9fbe5ed2d45f31def03a9e7aa0bc
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 14:34:16 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:41 2013 +0100
Undefine local preprocessor loop variables.
Most occurances of this pattern already contain the undef, so add it to
the rest too.
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index d9bc04c..8d37b62 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -36,6 +36,8 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
+#undef FIND_TARGETS
+
this->PopulateProperties(te, properties, emittedDeps);
this->GenerateInterfaceProperties(te, os, properties);
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 92f74f3..84d7735 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -40,6 +40,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(TEST_TRANSITIVE_PROPERTY_METHOD)
false)
)
+#undef TEST_TRANSITIVE_PROPERTY_METHOD
{
std::map<cmStdString, std::set<cmStdString> >::const_iterator it
= top->Seen.find(target);
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index fd47ad7..98ffd36 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -56,7 +56,9 @@ struct cmGeneratorExpressionDAGChecker
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) \
bool METHOD () const;
-CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
+
+#undef DECLARE_TRANSITIVE_PROPERTY_METHOD
bool GetTransitivePropertiesOnly();
void SetTransitivePropertiesOnly()
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 1ddafca..f0e40ea 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -772,6 +772,8 @@ static const char* targetPropertyTransitiveWhitelist[] = {
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(TRANSITIVE_PROPERTY_NAME)
};
+#undef TRANSITIVE_PROPERTY_NAME
+
std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
cmTarget const* target,
cmTarget const* headTarget,
@@ -999,6 +1001,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
ASSERT_TRANSITIVE_PROPERTY_METHOD)
false);
}
+#undef ASSERT_TRANSITIVE_PROPERTY_METHOD
}
std::string linkedTargetsContent;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76c611c41287f7acc15189b62bb1980f428e88be
commit 76c611c41287f7acc15189b62bb1980f428e88be
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 31 14:28:52 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:41 2013 +0100
Genex: Reform error-checking for nullary/unary expressions.
The error messages were incorrect (reporting that the expression
requires one or two parameters), and repeated. Remove the now-unused
ZeroOrMoreParameters enum value.
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 83d341e..1ddafca 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -49,7 +49,7 @@ struct cmGeneratorExpressionNode
enum {
DynamicParameters = 0,
OneOrMoreParameters = -1,
- ZeroOrMoreParameters = -2
+ OneOrZeroParameters = -2
};
virtual ~cmGeneratorExpressionNode() {}
@@ -384,7 +384,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{
CompilerIdNode() {}
- virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
+ virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
std::string EvaluateWithLanguage(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -430,12 +430,6 @@ static const struct CCompilerIdNode : public CompilerIdNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if (parameters.size() != 0 && parameters.size() != 1)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<C_COMPILER_ID> expression requires one or two parameters");
- return std::string();
- }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -458,12 +452,6 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if (parameters.size() != 0 && parameters.size() != 1)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<CXX_COMPILER_ID> expression requires one or two parameters");
- return std::string();
- }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -481,7 +469,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
{
CompilerVersionNode() {}
- virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
+ virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
std::string EvaluateWithLanguage(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -526,12 +514,6 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if (parameters.size() != 0 && parameters.size() != 1)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<C_COMPILER_VERSION> expression requires one or two parameters");
- return std::string();
- }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -554,13 +536,6 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
const GeneratorExpressionContent *content,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
- if (parameters.size() != 0 && parameters.size() != 1)
- {
- reportError(context, content->GetOriginalExpression(),
- "$<CXX_COMPILER_VERSION> expression requires one or two "
- "parameters");
- return std::string();
- }
if (!context->HeadTarget)
{
reportError(context, content->GetOriginalExpression(),
@@ -579,7 +554,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
{
PlatformIdNode() {}
- virtual int NumExpectedParameters() const { return ZeroOrMoreParameters; }
+ virtual int NumExpectedParameters() const { return OneOrZeroParameters; }
std::string Evaluate(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *context,
@@ -1822,6 +1797,12 @@ std::string GeneratorExpressionContent::EvaluateParameters(
reportError(context, this->GetOriginalExpression(), "$<" + identifier
+ "> expression requires at least one parameter.");
}
+ if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters
+ && parameters.size() > 2)
+ {
+ reportError(context, this->GetOriginalExpression(), "$<" + identifier
+ + "> expression requires one or zero parameters.");
+ }
return std::string();
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83b12235d8ea3b5164aa16c800d3ca8daa1883b3
commit 83b12235d8ea3b5164aa16c800d3ca8daa1883b3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 22:05:55 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:41 2013 +0100
cmTarget: Remove some of the INTERFACE_LIBRARY whitelisted properties.
There is no need to allow EXCLUDE_* properties, because an
INTERFACE_LIBRARY has no direct build output.
IMPORTED_LINK_INTERFACE_LANGUAGES are relevant only to static
libraries.
VERSION is relevant only to the filename of direct build outputs,
which INTERFACE_LIBRARY does not have.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b5a46d0..381c1f5 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -488,7 +488,8 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
dir.c_str());
}
- if(!target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+ if(target.GetType() != cmTarget::INTERFACE_LIBRARY
+ && !target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{
allbuild->AddUtility(target.GetName());
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2b82442..f94288d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1403,14 +1403,10 @@ static bool whiteListedInterfaceProperty(const char *prop)
"COMPATIBLE_INTERFACE_NUMBER_MAX",
"COMPATIBLE_INTERFACE_NUMBER_MIN",
"COMPATIBLE_INTERFACE_STRING",
- "EXCLUDE_FROM_ALL",
- "EXCLUDE_FROM_DEFAULT_BUILD",
"EXPORT_NAME",
- "IMPORTED_LINK_INTERFACE_LANGUAGES",
"IMPORTED",
"NAME",
- "TYPE",
- "VERSION"
+ "TYPE"
};
if (std::binary_search(cmArrayBegin(builtIns),
@@ -1421,9 +1417,7 @@ static bool whiteListedInterfaceProperty(const char *prop)
return true;
}
- if (cmHasLiteralPrefix(prop, "EXCLUDE_FROM_DEFAULT_BUILD_")
- || cmHasLiteralPrefix(prop, "IMPORTED_LINK_INTERFACE_LANGUAGES_")
- || cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
+ if (cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_"))
{
return true;
}
@@ -2576,6 +2570,8 @@ void cmTarget::GetTargetVersion(bool soversion,
minor = 0;
patch = 0;
+ assert(this->GetType() != INTERFACE_LIBRARY);
+
// Look for a VERSION or SOVERSION property.
const char* prop = soversion? "SOVERSION" : "VERSION";
if(const char* version = this->GetProperty(prop))
@@ -3549,6 +3545,8 @@ void cmTarget::GetLibraryNames(std::string& name,
return;
}
+ assert(this->GetType() != INTERFACE_LIBRARY);
+
// Check for library version properties.
const char* version = this->GetProperty("VERSION");
const char* soversion = this->GetProperty("SOVERSION");
@@ -4120,6 +4118,8 @@ std::string cmTarget::GetOutputName(const char* config, bool implib) const
//----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkVersion() const
{
+ assert(this->GetType() != INTERFACE_LIBRARY);
+
if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
{
return fversion;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=727e0ffa8d10a556ed906e3f0f84798eddf072d6
commit 727e0ffa8d10a556ed906e3f0f84798eddf072d6
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 22:12:30 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:40 2013 +0100
cmTarget: INTERFACE_LIBRARY is always EXCLUDE_FROM_ALL.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index bda2a95..fd267ee 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1880,7 +1880,8 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
cmTarget& target)
{
- if(target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+ if(target.GetType() == cmTarget::INTERFACE_LIBRARY
+ || target.GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{
// This target is excluded from its directory.
return true;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f625e1d0e4c0fececa9c1e67f1a3448ea9a0562
commit 7f625e1d0e4c0fececa9c1e67f1a3448ea9a0562
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 22:01:02 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:40 2013 +0100
export: Rename some variables to reflect content type.
This method is used with a list of languages.
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 2a87e4f..4543f79 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -825,36 +825,36 @@ cmExportFileGenerator
::SetImportLinkProperty(std::string const& suffix,
cmTarget* target,
const char* propName,
- std::vector<std::string> const& libs,
+ std::vector<std::string> const& entries,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets
)
{
- // Skip the property if there are no libraries.
- if(libs.empty())
+ // Skip the property if there are no entries.
+ if(entries.empty())
{
return;
}
// Construct the property value.
- std::string link_libs;
+ std::string link_entries;
const char* sep = "";
- for(std::vector<std::string>::const_iterator li = libs.begin();
- li != libs.end(); ++li)
+ for(std::vector<std::string>::const_iterator li = entries.begin();
+ li != entries.end(); ++li)
{
// Separate this from the previous entry.
- link_libs += sep;
+ link_entries += sep;
sep = ";";
std::string temp = *li;
this->AddTargetNamespace(temp, target, missingTargets);
- link_libs += temp;
+ link_entries += temp;
}
// Store the property.
std::string prop = propName;
prop += suffix;
- properties[prop] = link_libs;
+ properties[prop] = link_entries;
}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 6fd23b0..1438f4d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -82,7 +82,7 @@ protected:
std::vector<std::string>& missingTargets);
void SetImportLinkProperty(std::string const& suffix,
cmTarget* target, const char* propName,
- std::vector<std::string> const& libs,
+ std::vector<std::string> const& entries,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=824273ddfecd7656f2d4057571e1ce581cffbfba
commit 824273ddfecd7656f2d4057571e1ce581cffbfba
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 14:35:08 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:40 2013 +0100
cmTarget: Enable convenient include dir handling for INTERFACE_LIBRARY.
Make the CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE variable affect
INTERFACE_LIBRARY targets.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 227a948..bda2a95 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1309,13 +1309,13 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
{
cmTarget* t = &ti->second;
+ t->AppendBuildInterfaceIncludes();
+
if (t->GetType() == cmTarget::INTERFACE_LIBRARY)
{
continue;
}
- t->AppendBuildInterfaceIncludes();
-
for (std::vector<cmValueWithOrigin>::const_iterator it
= noconfig_compile_definitions.begin();
it != noconfig_compile_definitions.end(); ++it)
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3a6f1bd..2b82442 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1606,6 +1606,7 @@ void cmTarget::AppendBuildInterfaceIncludes()
if(this->GetType() != cmTarget::SHARED_LIBRARY &&
this->GetType() != cmTarget::STATIC_LIBRARY &&
this->GetType() != cmTarget::MODULE_LIBRARY &&
+ this->GetType() != cmTarget::INTERFACE_LIBRARY &&
!this->IsExecutableWithExports())
{
return;
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 8154ced..396a84a 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -6,8 +6,10 @@ project(InterfaceLibrary)
add_library(iface_nodepends INTERFACE)
target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
+add_subdirectory(headerdir)
+
add_executable(InterfaceLibrary definetestexe.cpp)
-target_link_libraries(InterfaceLibrary iface_nodepends)
+target_link_libraries(InterfaceLibrary iface_nodepends headeriface)
add_subdirectory(libsdir)
diff --git a/Tests/InterfaceLibrary/definetestexe.cpp b/Tests/InterfaceLibrary/definetestexe.cpp
index decd37c..e7a10c1 100644
--- a/Tests/InterfaceLibrary/definetestexe.cpp
+++ b/Tests/InterfaceLibrary/definetestexe.cpp
@@ -3,6 +3,18 @@
#error Expected IFACE_DEFINE
#endif
+#include "iface_header.h"
+
+#ifndef IFACE_HEADER_SRCDIR
+#error Expected IFACE_HEADER_SRCDIR
+#endif
+
+#include "iface_header_builddir.h"
+
+#ifndef IFACE_HEADER_BUILDDIR
+#error Expected IFACE_HEADER_BUILDDIR
+#endif
+
int main(int,char**)
{
return 0;
diff --git a/Tests/InterfaceLibrary/headerdir/CMakeLists.txt b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
new file mode 100644
index 0000000..98f521e
--- /dev/null
+++ b/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
+
+add_library(headeriface INTERFACE)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/iface_header_builddir.h"
+ "#define IFACE_HEADER_BUILDDIR\n"
+)
diff --git a/Tests/InterfaceLibrary/headerdir/iface_header.h b/Tests/InterfaceLibrary/headerdir/iface_header.h
new file mode 100644
index 0000000..82dd157
--- /dev/null
+++ b/Tests/InterfaceLibrary/headerdir/iface_header.h
@@ -0,0 +1 @@
+#define IFACE_HEADER_SRCDIR
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf57ae87dedfdaaca4a023631f361c79d0eabb97
commit cf57ae87dedfdaaca4a023631f361c79d0eabb97
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 20:35:15 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:40 2013 +0100
cmTarget: Remove dead code.
Whitelisting of properties already ensures that the LOCATION
property will not be read from an INTERFACE_LIBRARY.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 359a919..3a6f1bd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2688,7 +2688,6 @@ const char *cmTarget::GetProperty(const char* prop,
this->GetType() == cmTarget::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY ||
this->GetType() == cmTarget::MODULE_LIBRARY ||
- this->GetType() == cmTarget::INTERFACE_LIBRARY ||
this->GetType() == cmTarget::UNKNOWN_LIBRARY)
{
if(strcmp(prop,"LOCATION") == 0)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a7d32718bc07499d4061d455e343ee380a5aaad
commit 0a7d32718bc07499d4061d455e343ee380a5aaad
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Dec 27 12:42:37 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:40 2013 +0100
Genex: Add EQUAL expression.
Support decimal, hex, octal and binary literals.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index ed28abd..12cfaf8 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -55,6 +55,8 @@ otherwise expands to nothing.
``0`` if ``?`` is ``1``, else ``1``
``$<STREQUAL:a,b>``
``1`` if ``a`` is STREQUAL ``b``, else ``0``
+``$<EQUAL:a,b>``
+ ``1`` if ``a`` is EQUAL ``b`` in a numeric comparison, else ``0``
``$<CONFIG:cfg>``
``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index c8010d0..83d341e 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -19,6 +19,7 @@
#include <cmsys/String.h>
#include <assert.h>
+#include <errno.h>
//----------------------------------------------------------------------------
#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
@@ -197,6 +198,92 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
} strEqualNode;
//----------------------------------------------------------------------------
+static const struct EqualNode : public cmGeneratorExpressionNode
+{
+ EqualNode() {}
+
+ virtual int NumExpectedParameters() const { return 2; }
+
+ std::string Evaluate(const std::vector<std::string> ¶meters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ char *pEnd;
+
+ int base = 0;
+ bool flipSign = false;
+
+ const char *lhs = parameters[0].c_str();
+ if (cmHasLiteralPrefix(lhs, "0b"))
+ {
+ base = 2;
+ lhs += 2;
+ }
+ if (cmHasLiteralPrefix(lhs, "-0b"))
+ {
+ base = 2;
+ lhs += 3;
+ flipSign = true;
+ }
+ if (cmHasLiteralPrefix(lhs, "+0b"))
+ {
+ base = 2;
+ lhs += 3;
+ }
+
+ long lnum = strtol(lhs, &pEnd, base);
+ if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<EQUAL> parameter " + parameters[0] + " is not a valid integer.");
+ return std::string();
+ }
+
+ if (flipSign)
+ {
+ lnum = -lnum;
+ }
+
+ base = 0;
+ flipSign = false;
+
+ const char *rhs = parameters[1].c_str();
+ if (cmHasLiteralPrefix(rhs, "0b"))
+ {
+ base = 2;
+ rhs += 2;
+ }
+ if (cmHasLiteralPrefix(rhs, "-0b"))
+ {
+ base = 2;
+ rhs += 3;
+ flipSign = true;
+ }
+ if (cmHasLiteralPrefix(rhs, "+0b"))
+ {
+ base = 2;
+ rhs += 3;
+ }
+
+ long rnum = strtol(rhs, &pEnd, base);
+ if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<EQUAL> parameter " + parameters[1] + " is not a valid integer.");
+ return std::string();
+ }
+
+ if (flipSign)
+ {
+ rnum = -rnum;
+ }
+
+ return lnum == rnum ? "1" : "0";
+ }
+} equalNode;
+
+//----------------------------------------------------------------------------
static const struct LowerCaseNode : public cmGeneratorExpressionNode
{
LowerCaseNode() {}
@@ -1492,6 +1579,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &targetSoNameFileDirNode;
else if (identifier == "STREQUAL")
return &strEqualNode;
+ else if (identifier == "EQUAL")
+ return &equalNode;
else if (identifier == "LOWER_CASE")
return &lowerCaseNode;
else if (identifier == "UPPER_CASE")
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 47e974a..350b518 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -60,7 +60,7 @@ set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2)
set_property(TARGET CompatibleInterface PROPERTY STRING_PROP3 prop3)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP2 250)
-set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP3 0xA)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP3 0xa)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP4 0x1A)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP2 250)
@@ -75,7 +75,7 @@ target_compile_definitions(CompatibleInterface
$<$<STREQUAL:$<TARGET_PROPERTY:STRING_PROP3>,prop3>:STRING_PROP3>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP1>,50>:NUMBER_MIN_PROP1=50>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP2>,200>:NUMBER_MIN_PROP2=200>
- $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA>
+ $<$<EQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP4>,0x10>:NUMBER_MIN_PROP4=0x10>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP1>,100>:NUMBER_MAX_PROP1=100>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP2>,250>:NUMBER_MAX_PROP2=250>
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 892f80f..4fb7ecd 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -196,6 +196,27 @@ add_custom_target(check-part3 ALL
-Dlower_case=$<LOWER_CASE:Mi,XeD>
-Dupper_case=$<UPPER_CASE:MiX,eD>
-Dmake_c_identifier=$<MAKE_C_IDENTIFIER:4f,oo:+bar-$>
+ -Dequal1=$<EQUAL:1,2>
+ -Dequal2=$<EQUAL:1,1>
+ -Dequal3=$<EQUAL:0x1,1>
+ -Dequal4=$<EQUAL:0x1,2>
+ -Dequal5=$<EQUAL:0xA,0xa>
+ -Dequal6=$<EQUAL:0xA,10>
+ -Dequal7=$<EQUAL:0xA,012>
+ -Dequal8=$<EQUAL:10,012>
+ -Dequal9=$<EQUAL:10,010>
+ -Dequal10=$<EQUAL:10,0b1010>
+ -Dequal11=$<EQUAL:-10,-0xa>
+ -Dequal12=$<EQUAL:10,+0xa>
+ -Dequal13=$<EQUAL:+10,+0xa>
+ -Dequal14=$<EQUAL:+10,0xa>
+ -Dequal15=$<EQUAL:-10,-0xa>
+ -Dequal16=$<EQUAL:-10,-0b1010>
+ -Dequal17=$<EQUAL:-10,+0b1010>
+ -Dequal18=$<EQUAL:10,+0b1010>
+ -Dequal19=$<EQUAL:10,+012>
+ -Dequal20=$<EQUAL:10,-012>
+ -Dequal21=$<EQUAL:-10,-012>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 3)"
VERBATIM
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 3361eeb..2c6bf49 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -37,3 +37,24 @@ endforeach()
check(lower_case "mi,xed")
check(upper_case "MIX,ED")
check(make_c_identifier "_4f_oo__bar__")
+check(equal1 "0")
+check(equal2 "1")
+check(equal3 "1")
+check(equal4 "0")
+check(equal5 "1")
+check(equal6 "1")
+check(equal7 "1")
+check(equal8 "1")
+check(equal9 "0")
+check(equal10 "1")
+check(equal11 "1")
+check(equal12 "1")
+check(equal13 "1")
+check(equal14 "1")
+check(equal15 "1")
+check(equal16 "1")
+check(equal17 "0")
+check(equal18 "1")
+check(equal19 "1")
+check(equal20 "0")
+check(equal21 "1")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8961d27c5c6d14b0351628d417fbddb942e48479
commit 8961d27c5c6d14b0351628d417fbddb942e48479
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 16:04:58 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:39 2013 +0100
cmTarget: Use strtol for numeric parsing.
On Windows apparently sscanf can not handle hex numbers.
Test that numeric comparison works with hex numbers.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index cd2c236..359a919 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -24,6 +24,7 @@
#include <set>
#include <stdlib.h> // required for atof
#include <assert.h>
+#include <errno.h>
const char* cmTarget::GetTargetTypeName(TargetType targetType)
{
@@ -4231,6 +4232,7 @@ std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
const char *rhs,
CompatibleType t)
{
+ char *pEnd;
#if defined(_MSC_VER)
static const char* const null_ptr = 0;
@@ -4238,10 +4240,14 @@ std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
# define null_ptr 0
#endif
- double lnum;
- double rnum;
- if(sscanf(lhs, "%lg", &lnum) != 1 ||
- sscanf(rhs, "%lg", &rnum) != 1)
+ long lnum = strtol(lhs, &pEnd, 0);
+ if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE)
+ {
+ return std::pair<bool, const char*>(false, null_ptr);
+ }
+
+ long rnum = strtol(rhs, &pEnd, 0);
+ if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE)
{
return std::pair<bool, const char*>(false, null_ptr);
}
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 5e64d2a..47e974a 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -24,6 +24,8 @@ set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MIN
NUMBER_MIN_PROP1
NUMBER_MIN_PROP2
+ NUMBER_MIN_PROP3
+ NUMBER_MIN_PROP4
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MAX
@@ -34,7 +36,7 @@ set_property(TARGET iface1 APPEND PROPERTY
set(CMAKE_DEBUG_TARGET_PROPERTIES
BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
STRING_PROP1 STRING_PROP2 STRING_PROP3
- NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
+ NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MIN_PROP3 NUMBER_MIN_PROP4
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
)
@@ -44,6 +46,8 @@ set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP3 0x10)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP4 0x10)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
@@ -56,6 +60,8 @@ set_property(TARGET CompatibleInterface PROPERTY STRING_PROP2 prop2)
set_property(TARGET CompatibleInterface PROPERTY STRING_PROP3 prop3)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP2 250)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP3 0xA)
+set_property(TARGET CompatibleInterface PROPERTY NUMBER_MIN_PROP4 0x1A)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP1 50)
set_property(TARGET CompatibleInterface PROPERTY NUMBER_MAX_PROP2 250)
@@ -69,6 +75,8 @@ target_compile_definitions(CompatibleInterface
$<$<STREQUAL:$<TARGET_PROPERTY:STRING_PROP3>,prop3>:STRING_PROP3>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP1>,50>:NUMBER_MIN_PROP1=50>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP2>,200>:NUMBER_MIN_PROP2=200>
+ $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA>
+ $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP4>,0x10>:NUMBER_MIN_PROP4=0x10>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP1>,100>:NUMBER_MAX_PROP1=100>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP2>,250>:NUMBER_MAX_PROP2=250>
)
diff --git a/Tests/CompatibleInterface/main.cpp b/Tests/CompatibleInterface/main.cpp
index fa299e9..e23625a 100644
--- a/Tests/CompatibleInterface/main.cpp
+++ b/Tests/CompatibleInterface/main.cpp
@@ -33,7 +33,9 @@ enum {
NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>),
NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>),
NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>),
- NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>)
+ NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>),
+ NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>),
+ NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>)
};
#include "iface2.h"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ebc1b2bd833219d5386d34bb1a682a2bbeb7ed3e
commit ebc1b2bd833219d5386d34bb1a682a2bbeb7ed3e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 16:09:46 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:39 2013 +0100
Add cmHasLiteralSuffix API.
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 55c20d6..3329f8a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1151,8 +1151,8 @@ void cmFindPackageCommand::AddPrefixesSystemEnvironment()
std::string const& d = *i;
// If the path is a PREFIX/bin case then add its parent instead.
- if((d.size() >= 4 && strcmp(d.c_str()+d.size()-4, "/bin") == 0) ||
- (d.size() >= 5 && strcmp(d.c_str()+d.size()-5, "/sbin") == 0))
+ if((d.size() >= 4 && cmHasLiteralSuffix(d, "/bin")) ||
+ (d.size() >= 5 && cmHasLiteralSuffix(d, "/sbin")))
{
this->AddPathInternal(cmSystemTools::GetFilenamePath(d), EnvPath);
}
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index eb6e52f..783afe7 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -391,6 +391,20 @@ inline bool cmHasLiteralPrefixImpl(const char* str1,
return strncmp(str1, str2, N) == 0;
}
+inline bool cmHasLiteralSuffixImpl(const std::string &str1,
+ const char *str2,
+ size_t N)
+{
+ return strcmp(str1.c_str() + str1.size() - N, str2) == 0;
+}
+
+inline bool cmHasLiteralSuffixImpl(const char* str1,
+ const char* str2,
+ size_t N)
+{
+ return strcmp(str1 + strlen(str1) - N, str2) == 0;
+}
+
#if defined(_MSC_VER) && _MSC_VER < 1300 \
|| defined(__GNUC__) && __GNUC__ < 3 \
|| defined(__BORLANDC__)
@@ -402,6 +416,9 @@ inline bool cmHasLiteralPrefixImpl(const char* str1,
#define cmHasLiteralPrefix(STR1, STR2) \
cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1)
+#define cmHasLiteralSuffix(STR1, STR2) \
+ cmHasLiteralSuffixImpl(STR1, "" STR2 "", sizeof(STR2) - 1)
+
#else
template<typename T, size_t N>
@@ -417,6 +434,12 @@ bool cmHasLiteralPrefix(T str1, const char (&str2)[N])
return cmHasLiteralPrefixImpl(str1, str2, N - 1);
}
+template<typename T, size_t N>
+bool cmHasLiteralSuffix(T str1, const char (&str2)[N])
+{
+ return cmHasLiteralSuffixImpl(str1, str2, N - 1);
+}
+
#endif
struct cmStrCmp {
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b8163c8..1de2358 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -359,18 +359,11 @@ bool cmSystemTools::IsOn(const char* val)
bool cmSystemTools::IsNOTFOUND(const char* val)
{
- size_t len = strlen(val);
- const char* notfound = "-NOTFOUND";
- const size_t lenNotFound = 9;
- if(len < lenNotFound-1)
+ if(strcmp(val, "NOTFOUND") == 0)
{
- return false;
- }
- if(len == lenNotFound-1)
- {
- return ( strcmp(val, "NOTFOUND") == 0);
+ return true;
}
- return ((strncmp((val + (len - lenNotFound)), notfound, lenNotFound) == 0));
+ return cmHasLiteralSuffix(val, "-NOTFOUND");
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0280063faa6bae574fb55852aba3d7f3fe30c1e4
commit 0280063faa6bae574fb55852aba3d7f3fe30c1e4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 13:16:22 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:39 2013 +0100
cmTarget: Remove support for <CONFIG>_LOCATION property.
It is not documented, is very old, is compatibility code,
is non-uniform and is not needed.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1adbbd8..cd2c236 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2722,25 +2722,6 @@ const char *cmTarget::GetProperty(const char* prop,
this->GetLocation(configName.c_str()),
cmProperty::TARGET);
}
- else
- {
- // Support "<CONFIG>_LOCATION" for compatibility.
- int len = static_cast<int>(strlen(prop));
- if(len > 9 && strcmp(prop+len-9, "_LOCATION") == 0)
- {
- std::string configName(prop, len-9);
- if(configName != "IMPORTED")
- {
- if (!this->HandleLocationPropertyPolicy())
- {
- return 0;
- }
- this->Properties.SetProperty(prop,
- this->GetLocation(configName.c_str()),
- cmProperty::TARGET);
- }
- }
- }
}
if(strcmp(prop,"INCLUDE_DIRECTORIES") == 0)
{
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28c78af6daa9c48d6f4b587271965cb8dc352d9c
commit 28c78af6daa9c48d6f4b587271965cb8dc352d9c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 11:37:34 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:39 2013 +0100
cmTarget: Test impliedByUse number-compatible properties.
Test that it is an error to read a number-compatible property to
determine the link implementation. An alternative would be to
consider the value to be "0", however, that is too arbitrary
given the use-cases of this feature. Values from this feature may
be used in setting a define, where "0" may have special or invalid
meaning and should be explicit.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt
new file mode 100644
index 0000000..723daec
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error: Property SOMEPROP on target "user" is
+implied to be empty because it was used to determine the link libraries
+already. The INTERFACE_SOMEPROP property on
+dependency "foo" is in conflict.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake
new file mode 100644
index 0000000..a064d76
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceNumber-mismatched-use.cmake
@@ -0,0 +1,9 @@
+
+add_library(foo UNKNOWN IMPORTED)
+add_library(bar UNKNOWN IMPORTED)
+
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN SOMEPROP)
+set_property(TARGET foo PROPERTY INTERFACE_SOMEPROP 42)
+
+add_executable(user main.cpp)
+target_link_libraries(user foo $<$<STREQUAL:$<TARGET_PROPERTY:SOMEPROP>,42>:bar>)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index ec52e5f..0b9729b 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ run_cmake(InterfaceBool-builtin-prop)
run_cmake(InterfaceString-mismatch-depends)
run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
+run_cmake(InterfaceNumber-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
run_cmake(InterfaceString-Bool-Min-Conflict)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b916918d89ccada2c41ce02e3815fbd9b753a00
commit 9b916918d89ccada2c41ce02e3815fbd9b753a00
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 10:45:08 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:39 2013 +0100
cmTarget: Don't repeat property origin debug information.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c74450a..1adbbd8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4537,12 +4537,6 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
propContent = impliedValue<PropertyType>(propContent);
- reportEntry += " * Target \"";
- reportEntry += li->Target->GetName();
- reportEntry += "\" property value \"";
- reportEntry += valueAsString<PropertyType>(propContent);
- reportEntry += "\" ";
-
if (ifaceIsSet)
{
std::pair<bool, PropertyType> consistent =
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index 253e246..e3efe28 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -40,6 +40,13 @@ CMake Debug Log:
\* Target "iface2" property value "FALSE" \(Agree\)
+
CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP7" for target
+ "CompatibleInterface" \(result: "FALSE"\):
+
+ \* Target "CompatibleInterface" property is implied by use.
+ \* Target "iface1" property value "FALSE" \(Agree\)
++
+CMake Debug Log:
String compatibility of property "STRING_PROP1" for target
"CompatibleInterface" \(result: "prop1"\):
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 46838d7..42a3af2 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -15,6 +15,7 @@ set_property(TARGET iface1 APPEND PROPERTY
BOOL_PROP4
BOOL_PROP5
BOOL_PROP6
+ BOOL_PROP7
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING
@@ -34,7 +35,7 @@ set_property(TARGET iface1 APPEND PROPERTY
)
set(CMAKE_DEBUG_TARGET_PROPERTIES
- BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6 BOOL_PROP7
STRING_PROP1 STRING_PROP2 STRING_PROP3
NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
@@ -44,6 +45,7 @@ set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 OFF)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP6 OFF)
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP7 OFF)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
@@ -54,8 +56,12 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
add_library(iface2 INTERFACE)
set_property(TARGET iface2 PROPERTY INTERFACE_BOOL_PROP6 OFF)
+add_library(iface3 INTERFACE)
+
add_executable(CompatibleInterface empty.cpp)
-target_link_libraries(CompatibleInterface iface1 iface2)
+target_link_libraries(CompatibleInterface iface1 iface2
+ $<$<BOOL:$<TARGET_PROPERTY:BOOL_PROP7>>:iface3>
+)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af9fc9d77a95a039a7c08bd8c76d19558a81248f
commit af9fc9d77a95a039a7c08bd8c76d19558a81248f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 09:36:08 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
cmTarget: Fix debug report for interface-set compatibility types.
If the dependent target sets the property to boolean false, ensure
that that appears in the debug report. Previously, the report
output contained whether the property was consistent among dependencies,
displaying 'TRUE', instead of the content of the property, which may
be 'FALSE'.
Return a std::pair from the consistentProperty method. This makes
it possible to make the return value for string types easier to
reason about. The return value of consistentProperty was previously
set to an empty static string to emulate a 'true' value for the caller
in commit 816b4a8a (cmTarget: Make consistentProperty
return consistent content., 2013-10-22). The pair makes the
consistency result properly typed.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1e1aff5..c74450a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4216,20 +4216,23 @@ enum CompatibleType
//----------------------------------------------------------------------------
template<typename PropertyType>
-PropertyType consistentProperty(PropertyType lhs, PropertyType rhs,
- CompatibleType t);
+std::pair<bool, PropertyType> consistentProperty(PropertyType lhs,
+ PropertyType rhs,
+ CompatibleType t);
//----------------------------------------------------------------------------
template<>
-bool consistentProperty(bool lhs, bool rhs, CompatibleType)
+std::pair<bool, bool> consistentProperty(bool lhs, bool rhs, CompatibleType)
{
- return lhs == rhs;
+ return std::make_pair(lhs == rhs, lhs);
}
//----------------------------------------------------------------------------
-const char * consistentStringProperty(const char *lhs, const char *rhs)
+std::pair<bool, const char*> consistentStringProperty(const char *lhs,
+ const char *rhs)
{
- return strcmp(lhs, rhs) == 0 ? lhs : 0;
+ const bool b = strcmp(lhs, rhs) == 0;
+ return std::make_pair(b, b ? lhs : 0);
}
#if defined(_MSC_VER) && _MSC_VER <= 1200
@@ -4243,49 +4246,69 @@ cmMinimum(const T& l, const T& r) {return l < r ? l : r;}
#endif
//----------------------------------------------------------------------------
-const char * consistentNumberProperty(const char *lhs, const char *rhs,
- CompatibleType t)
+std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
+ const char *rhs,
+ CompatibleType t)
{
+
+#if defined(_MSC_VER)
+ static const char* const null_ptr = 0;
+#else
+# define null_ptr 0
+#endif
+
double lnum;
double rnum;
if(sscanf(lhs, "%lg", &lnum) != 1 ||
sscanf(rhs, "%lg", &rnum) != 1)
{
- return 0;
+ return std::pair<bool, const char*>(false, null_ptr);
}
+#if !defined(_MSC_VER)
+#undef null_ptr
+#endif
+
if (t == NumberMaxType)
{
- return cmMaximum(lnum, rnum) == lnum ? lhs : rhs;
+ return std::make_pair(true, cmMaximum(lnum, rnum) == lnum ? lhs : rhs);
}
else
{
- return cmMinimum(lnum, rnum) == lnum ? lhs : rhs;
+ return std::make_pair(true, cmMinimum(lnum, rnum) == lnum ? lhs : rhs);
}
}
//----------------------------------------------------------------------------
template<>
-const char* consistentProperty(const char *lhs, const char *rhs,
- CompatibleType t)
+std::pair<bool, const char*> consistentProperty(const char *lhs,
+ const char *rhs,
+ CompatibleType t)
{
if (!lhs && !rhs)
{
- return "";
+ return std::make_pair(true, lhs);
}
if (!lhs)
{
- return rhs ? rhs : "";
+ return std::make_pair(true, rhs);
}
if (!rhs)
{
- return lhs ? lhs : "";
+ return std::make_pair(true, lhs);
}
+
+#if defined(_MSC_VER)
+ static const char* const null_ptr = 0;
+#else
+# define null_ptr 0
+#endif
+
switch(t)
{
case BoolType:
assert(!"consistentProperty for strings called with BoolType");
- return 0;
+ return std::pair<bool, const char*>(false, null_ptr);
case StringType:
return consistentStringProperty(lhs, rhs);
case NumberMinType:
@@ -4293,7 +4316,12 @@ const char* consistentProperty(const char *lhs, const char *rhs,
return consistentNumberProperty(lhs, rhs, t);
}
assert(!"Unreachable!");
- return 0;
+ return std::pair<bool, const char*>(false, null_ptr);
+
+#if !defined(_MSC_VER)
+#undef null_ptr
+#endif
+
}
template<typename PropertyType>
@@ -4478,11 +4506,12 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
if (ifaceIsSet)
{
- PropertyType consistent = consistentProperty(propContent,
+ std::pair<bool, PropertyType> consistent =
+ consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent);
- if (!consistent)
+ report += compatibilityAgree(t, propContent != consistent.second);
+ if (!consistent.first)
{
cmOStringStream e;
e << "Property " << p << " on target \""
@@ -4494,7 +4523,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent;
+ propContent = consistent.second;
continue;
}
}
@@ -4516,11 +4545,12 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
if (ifaceIsSet)
{
- PropertyType consistent = consistentProperty(propContent,
+ std::pair<bool, PropertyType> consistent =
+ consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent);
- if (!consistent)
+ report += compatibilityAgree(t, propContent != consistent.second);
+ if (!consistent.first)
{
cmOStringStream e;
e << "Property " << p << " on target \""
@@ -4533,7 +4563,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent;
+ propContent = consistent.second;
continue;
}
}
@@ -4549,11 +4579,12 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
{
if (propInitialized)
{
- PropertyType consistent = consistentProperty(propContent,
+ std::pair<bool, PropertyType> consistent =
+ consistentProperty(propContent,
ifacePropContent, t);
report += reportEntry;
- report += compatibilityAgree(t, propContent != consistent);
- if (!consistent)
+ report += compatibilityAgree(t, propContent != consistent.second);
+ if (!consistent.first)
{
cmOStringStream e;
e << "The INTERFACE_" << p << " property of \""
@@ -4565,7 +4596,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
}
else
{
- propContent = consistent;
+ propContent = consistent.second;
continue;
}
}
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index 3027266..253e246 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -32,6 +32,14 @@ CMake Debug Log:
\* Target "iface1" property value "FALSE" \(Interface set\)
+
CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP6" for target
+ "CompatibleInterface" \(result: "FALSE"\):
+
+ \* Target "CompatibleInterface" property not set.
+ \* Target "iface1" property value "FALSE" \(Interface set\)
+ \* Target "iface2" property value "FALSE" \(Agree\)
++
+CMake Debug Log:
String compatibility of property "STRING_PROP1" for target
"CompatibleInterface" \(result: "prop1"\):
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 24ffd5f..46838d7 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -14,6 +14,7 @@ set_property(TARGET iface1 APPEND PROPERTY
BOOL_PROP3
BOOL_PROP4
BOOL_PROP5
+ BOOL_PROP6
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING
@@ -33,7 +34,7 @@ set_property(TARGET iface1 APPEND PROPERTY
)
set(CMAKE_DEBUG_TARGET_PROPERTIES
- BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5 BOOL_PROP6
STRING_PROP1 STRING_PROP2 STRING_PROP3
NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
@@ -42,6 +43,7 @@ set(CMAKE_DEBUG_TARGET_PROPERTIES
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 OFF)
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP6 OFF)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
@@ -49,8 +51,11 @@ set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
+add_library(iface2 INTERFACE)
+set_property(TARGET iface2 PROPERTY INTERFACE_BOOL_PROP6 OFF)
+
add_executable(CompatibleInterface empty.cpp)
-target_link_libraries(CompatibleInterface iface1)
+target_link_libraries(CompatibleInterface iface1 iface2)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP2 ON)
set_property(TARGET CompatibleInterface PROPERTY BOOL_PROP3 ON)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2939ca9a002152666df6d1761976023c9a69a74c
commit 2939ca9a002152666df6d1761976023c9a69a74c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 11:13:04 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
cmTarget: Fix reporting interface-set properties which are FALSE.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b89cfcf..1e1aff5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4465,7 +4465,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
("INTERFACE_" + p).c_str(), 0);
std::string reportEntry;
- if (ifacePropContent)
+ if (ifaceIsSet)
{
reportEntry += " * Target \"";
reportEntry += li->Target->GetName();
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index 0044564..3027266 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -25,6 +25,13 @@ CMake Debug Log:
\* Target "CompatibleInterface" property not set.
+
CMake Debug Log:
+ Boolean compatibility of property "BOOL_PROP5" for target
+ "CompatibleInterface" \(result: "FALSE"\):
+
+ \* Target "CompatibleInterface" property not set.
+ \* Target "iface1" property value "FALSE" \(Interface set\)
++
+CMake Debug Log:
String compatibility of property "STRING_PROP1" for target
"CompatibleInterface" \(result: "prop1"\):
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 3214d8e..24ffd5f 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -13,6 +13,7 @@ set_property(TARGET iface1 APPEND PROPERTY
BOOL_PROP2
BOOL_PROP3
BOOL_PROP4
+ BOOL_PROP5
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING
@@ -32,7 +33,7 @@ set_property(TARGET iface1 APPEND PROPERTY
)
set(CMAKE_DEBUG_TARGET_PROPERTIES
- BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5
STRING_PROP1 STRING_PROP2 STRING_PROP3
NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
@@ -40,6 +41,7 @@ set(CMAKE_DEBUG_TARGET_PROPERTIES
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 OFF)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=547426fa37244ed9f3187191443e3914f7159549
commit 547426fa37244ed9f3187191443e3914f7159549
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Dec 27 00:33:17 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
Qt Tests: Remove commented and unneeded line.
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 9dd5289..7b99395 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -47,7 +47,6 @@ add_custom_target(generate_moc_input
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
)
-# set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" PROPERTIES GENERATED TRUE)
add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89315ba307ff18190f3395acb71d0b1d9090ef3c
commit 89315ba307ff18190f3395acb71d0b1d9090ef3c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Dec 27 00:29:52 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
cmTarget: Fix the property compatibility error message
Don't refer to 'both', but a 'mixture'. List all compatible interface
property types possible.
Add another test for a mixture of three compatibilities.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7f8bdb7..b89cfcf 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5962,7 +5962,8 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
<< propsString <<
" property in the dependencies of target \"" << this->GetName() <<
"\". This is not allowed. A property may only require compatibility "
- "in a boolean interpretation or a string interpretation, but not both.";
+ "in a boolean interpretation, a numeric minimum, a numeric maximum or a "
+ "string interpretation, but not a mixture.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
}
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
index 5a8f99d..900e3f8 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt
@@ -2,4 +2,5 @@ CMake Error in CMakeLists.txt:
Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the
COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user".
This is not allowed. A property may only require compatibility in a
- boolean interpretation or a string interpretation, but not both.
+ boolean interpretation, a numeric minimum, a numeric maximum or a string
+ interpretation, but not a mixture.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
index 711368a..4bae804 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
@@ -1,9 +1,8 @@
add_library(foo UNKNOWN IMPORTED)
-add_library(bar UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
add_executable(user main.cpp)
-target_link_libraries(user foo bar)
+target_link_libraries(user foo)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
new file mode 100644
index 0000000..2cfbae4
--- /dev/null
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error in CMakeLists.txt:
+ Property "OTHER" appears in both the COMPATIBLE_INTERFACE_BOOL,
+ COMPATIBLE_INTERFACE_NUMBER_MIN and the COMPATIBLE_INTERFACE_STRING
+ property in the dependencies of target "user". This is not allowed. A
+ property may only require compatibility in a boolean interpretation, a
+ numeric minimum, a numeric maximum or a string interpretation, but not a
+ mixture.
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
similarity index 59%
copy from Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
copy to Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
index 711368a..164ffd9 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Min-Conflict.cmake
@@ -1,9 +1,9 @@
add_library(foo UNKNOWN IMPORTED)
-add_library(bar UNKNOWN IMPORTED)
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
-set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL OTHER)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING OTHER)
+set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN OTHER)
add_executable(user main.cpp)
-target_link_libraries(user foo bar)
+target_link_libraries(user foo)
diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
index b87adc8..ec52e5f 100644
--- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
+run_cmake(InterfaceString-Bool-Min-Conflict)
run_cmake(DebugProperties)
if (QT_QMAKE_EXECUTABLE})
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54e1d79306475b40c924ea9770503784bc69233d
commit 54e1d79306475b40c924ea9770503784bc69233d
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 18:18:04 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
Help: Reformat Qt autogenerator documentation.
diff --git a/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
index 48cc8a1..5a69ef3 100644
--- a/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOGEN_TARGETS_FOLDER.rst
@@ -1,8 +1,9 @@
AUTOGEN_TARGETS_FOLDER
----------------------
-Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
+Name of :prop_tgt:`FOLDER` for ``*_automoc`` targets that are added automatically by
+CMake for targets for which :prop_tgt:`AUTOMOC` is enabled.
-If not set, CMake uses the FOLDER property of the parent target as a
+If not set, CMake uses the :prop_tgt:`FOLDER` property of the parent target as a
default value for this property. See also the documentation for the
-FOLDER target property and the AUTOMOC target property.
+:prop_tgt:`FOLDER` target property and the :prop_tgt:`AUTOMOC` target property.
diff --git a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
index 185e0ec..671f86a 100644
--- a/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
+++ b/Help/prop_gbl/AUTOMOC_TARGETS_FOLDER.rst
@@ -1,10 +1,11 @@
AUTOMOC_TARGETS_FOLDER
----------------------
-Name of FOLDER for ``*_automoc`` targets that are added automatically by CMake for targets for which AUTOMOC is enabled.
+Name of :prop_tgt:`FOLDER` for ``*_automoc`` targets that are added automatically by
+CMake for targets for which :prop_tgt:`AUTOMOC` is enabled.
-This property is obsolete. Use AUTOGEN_TARGETS_FOLDER instead.
+This property is obsolete. Use :prop_gbl:`AUTOGEN_TARGETS_FOLDER` instead.
-If not set, CMake uses the FOLDER property of the parent target as a
+If not set, CMake uses the :prop_tgt:`FOLDER` property of the parent target as a
default value for this property. See also the documentation for the
-FOLDER target property and the AUTOMOC target property.
+:prop_tgt:`FOLDER` target property and the :prop_tgt:`AUTOMOC` target property.
diff --git a/Help/prop_sf/AUTORCC_OPTIONS.rst b/Help/prop_sf/AUTORCC_OPTIONS.rst
index 4b6bb10..d9dc4d3 100644
--- a/Help/prop_sf/AUTORCC_OPTIONS.rst
+++ b/Help/prop_sf/AUTORCC_OPTIONS.rst
@@ -1,14 +1,13 @@
AUTORCC_OPTIONS
---------------
-Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target
-property)
+Additional options for ``rcc`` when using :prop_tgt:`AUTORCC`
This property holds additional command line options which will be used when
-rcc is executed during the build via autorcc, i.e. it is equivalent to the
-optional OPTIONS argument of the qt4_add_resources() macro.
+``rcc`` is executed during the build via :prop_tgt:`AUTORCC`, i.e. it is equivalent to the
+optional ``OPTIONS`` argument of the :module:`qt4_add_resources() <FindQt4>` macro.
By default it is empty.
-The options set on the .qrc source file may override :prop_tgt:`AUTORCC_OPTIONS` set
+The options set on the ``.qrc`` source file may override :prop_tgt:`AUTORCC_OPTIONS` set
on the target.
diff --git a/Help/prop_sf/AUTOUIC_OPTIONS.rst b/Help/prop_sf/AUTOUIC_OPTIONS.rst
index a38b2f8..6dfabb0 100644
--- a/Help/prop_sf/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_sf/AUTOUIC_OPTIONS.rst
@@ -1,14 +1,14 @@
AUTOUIC_OPTIONS
---------------
-Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
+Additional options for ``uic`` when using :prop_tgt:`AUTOUIC`
This property holds additional command line options
-which will be used when uic is executed during the build via autouic,
-i.e. it is equivalent to the optional OPTIONS argument of the
-qt4_wrap_ui() macro.
+which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`,
+i.e. it is equivalent to the optional ``OPTIONS`` argument of the
+:module:`qt4_wrap_ui()<FindQt4>` macro.
By default it is empty.
-The options set on the .ui source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
+The options set on the ``.ui`` source file may override :prop_tgt:`AUTOUIC_OPTIONS` set
on the target.
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 006c83a..2bc1881 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -3,10 +3,10 @@ AUTOGEN_TARGET_DEPENDS
Target dependencies of the corresponding ``_automoc`` target.
-Targets which have their :prop_tgt:`AUTOMOC` target set to true have a
+Targets which have their :prop_tgt:`AUTOMOC` target set to ``TRUE`` have a
corresponding ``_automoc`` target which is used to autogenerate generate moc
files. As this ``_automoc`` target is created at generate-time, it is not
-possible to define dependencies of it, such as to create inputs for the moc
+possible to define dependencies of it, such as to create inputs for the ``moc``
executable.
The ``AUTOGEN_TARGET_DEPENDS`` target can be set instead to a list of dependencies
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 8af1116..16094c7 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -3,29 +3,29 @@ AUTOMOC
Should the target be processed with automoc (for Qt projects).
-AUTOMOC is a boolean specifying whether CMake will handle the Qt moc
+AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc``
preprocessor automatically, i.e. without having to use the
-QT4_WRAP_CPP() or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are
-supported. When this property is set to TRUE, CMake will scan the
-source files at build time and invoke moc accordingly. If an #include
-statement like #include "moc_foo.cpp" is found, the Q_OBJECT class
-declaration is expected in the header, and moc is run on the header
-file. If an #include statement like #include "foo.moc" is found, then
-a Q_OBJECT is expected in the current source file and moc is run on
+:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are
+supported. When this property is set to ``TRUE``, CMake will scan the
+source files at build time and invoke moc accordingly. If an ``#include``
+statement like ``#include "moc_foo.cpp"`` is found, the ``Q_OBJECT`` class
+declaration is expected in the header, and ``moc`` is run on the header
+file. If an ``#include`` statement like ``#include "foo.moc"`` is found, then
+a ``Q_OBJECT`` is expected in the current source file and ``moc`` is run on
the file itself. Additionally, all header files are parsed for
-Q_OBJECT macros, and if found, moc is also executed on those files.
+``Q_OBJECT`` macros, and if found, ``moc`` is also executed on those files.
The resulting moc files, which are not included as shown above in any
of the source files are included in a generated
-<targetname>_automoc.cpp file, which is compiled as part of the
-target.This property is initialized by the value of the variable
-CMAKE_AUTOMOC if it is set when a target is created.
+``<targetname>_automoc.cpp`` file, which is compiled as part of the
+target. This property is initialized by the value of the variable
+:variable:`CMAKE_AUTOMOC` if it is set when a target is created.
Additional command line options for moc can be set via the
-AUTOMOC_MOC_OPTIONS property.
+:prop_tgt:`AUTOMOC_MOC_OPTIONS` property.
-By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules
-for searching the files which will be processed by moc can be relaxed.
+By setting the :variable:`CMAKE_AUTOMOC_RELAXED_MODE` variable to ``TRUE`` the
+rules for searching the files which will be processed by moc can be relaxed.
See the documentation for this variable for more details.
-The global property AUTOMOC_TARGETS_FOLDER can be used to group the
+The global property :prop_gbl:`AUTOMOC_TARGETS_FOLDER` can be used to group the
automoc targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst b/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
index 6ab5c85..d086bf5 100644
--- a/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOMOC_MOC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTOMOC_MOC_OPTIONS
-------------------
-Additional options for moc when using automoc (see the AUTOMOC property)
+Additional options for moc when using :prop_tgt:`AUTOMOC`
-This property is only used if the AUTOMOC property is set to TRUE for
-this target. In this case, it holds additional command line options
-which will be used when moc is executed during the build, i.e. it is
-equivalent to the optional OPTIONS argument of the qt4_wrap_cpp()
+This property is only used if the :prop_tgt:`AUTOMOC` property is set to ``TRUE``
+for this target. In this case, it holds additional command line options
+which will be used when ``moc`` is executed during the build, i.e. it is
+equivalent to the optional ``OPTIONS`` argument of the :module:`qt4_wrap_cpp() <FindQt4>`
macro.
By default it is empty.
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index ef2c9c8..f6409ea 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -4,18 +4,18 @@ AUTORCC
Should the target be processed with autorcc (for Qt projects).
-AUTORCC is a boolean specifying whether CMake will handle
-the Qt rcc code generator automatically, i.e. without having to use
-the QT4_ADD_RESOURCES() or QT5_ADD_RESOURCES() macro. Currently Qt4 and Qt5 are
-supported.
+``AUTORCC`` is a boolean specifying whether CMake will handle
+the Qt ``rcc`` code generator automatically, i.e. without having to use
+the :module:`QT4_ADD_RESOURCES() <FindQt4>` or QT5_ADD_RESOURCES() macro.
+Currently Qt4 and Qt5 are supported.
-When this property is set to TRUE, CMake will handle .qrc files added
-as target sources at build time and invoke rcc accordingly.
+When this property is set to ``TRUE``, CMake will handle ``.qrc`` files added
+as target sources at build time and invoke ``rcc`` accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTORCC`
variable if it is set when a target is created.
Additional command line options for rcc can be set via the
-:prop_sf:`AUTORCC_OPTIONS` source file property on the .qrc file.
+:prop_sf:`AUTORCC_OPTIONS` source file property on the ``.qrc`` file.
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTORCC_OPTIONS.rst b/Help/prop_tgt/AUTORCC_OPTIONS.rst
index 489e277..1dd82ee 100644
--- a/Help/prop_tgt/AUTORCC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTORCC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTORCC_OPTIONS
---------------
-Additional options for rcc when using autorcc (see the :prop_tgt:`AUTORCC` target property)
+Additional options for ``rcc`` when using :prop_tgt:`AUTORCC`
This property holds additional command line options
-which will be used when rcc is executed during the build via autorcc,
-i.e. it is equivalent to the optional OPTIONS argument of the
-qt4_add_resources() macro.
+which will be used when ``rcc`` is executed during the build via :prop_tgt:`AUTORCC`,
+i.e. it is equivalent to the optional ``OPTIONS`` argument of the
+:module:`qt4_add_resources() <FindQt4>` macro.
By default it is empty.
@@ -14,4 +14,4 @@ This property is initialized by the value of the variable
:variable:`CMAKE_AUTORCC` if it is set when a target is created.
The options set on the target may be overridden by :prop_sf:`AUTORCC_OPTIONS` set
-on the .qrc source file.
+on the ``.qrc`` source file.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 548c259..010c027 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -3,20 +3,20 @@ AUTOUIC
Should the target be processed with autouic (for Qt projects).
-AUTOUIC is a boolean specifying whether CMake will handle
-the Qt uic code generator automatically, i.e. without having to use
-the QT4_WRAP_UI() or QT5_WRAP_UI() macro. Currently Qt4 and Qt5 are
-supported.
+``AUTOUIC`` is a boolean specifying whether CMake will handle
+the Qt ``uic`` code generator automatically, i.e. without having to use
+the :module:`QT4_WRAP_UI() <FindQt4>` or QT5_WRAP_UI() macro. Currently Qt4
+and Qt5 are supported.
-When this property is set to TRUE, CMake will scan the source files
-at build time and invoke uic accordingly.
-If an #include statement like #include "ui_foo.h" is found in
-foo.cpp, a foo.ui file is expected next to foo.cpp, and uic is
-run on the foo.ui file.
+When this property is set to ``TRUE``, CMake will scan the source files
+at build time and invoke ``uic`` accordingly.
+If an ``#include`` statement like ``#include "ui_foo.h"`` is found in
+``foo.cpp``, a ``foo.ui`` file is expected next to ``foo.cpp``, and ``uic`` is
+run on the ``foo.ui`` file.
This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
variable if it is set when a target is created.
Additional command line options for uic can be set via the
-:prop_sf:`AUTOUIC_OPTIONS` source file property on the foo.ui file.
+:prop_sf:`AUTOUIC_OPTIONS` source file property on the ``foo.ui`` file.
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
index aeec38b..d0f865c 100644
--- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -1,12 +1,12 @@
AUTOUIC_OPTIONS
---------------
-Additional options for uic when using autouic (see the :prop_tgt:`AUTOUIC` target property)
+Additional options for uic when using :prop_tgt:`AUTOUIC`
This property holds additional command line options
-which will be used when uic is executed during the build via autouic,
-i.e. it is equivalent to the optional OPTIONS argument of the
-qt4_wrap_ui() macro.
+which will be used when ``uic`` is executed during the build via :prop_tgt:`AUTOUIC`,
+i.e. it is equivalent to the optional ``OPTIONS`` argument of the
+:module:`qt4_wrap_ui() <FindQt4>` macro.
By default it is empty.
@@ -14,7 +14,7 @@ This property is initialized by the value of the variable
:variable:`CMAKE_AUTOUIC` if it is set when a target is created.
The options set on the target may be overridden by :prop_sf:`AUTOUIC_OPTIONS` set
-on the .ui source file.
+on the ``.ui`` source file.
This property may use "generator expressions" with the syntax "$<...>".
See the :manual:`cmake-generator-expressions(7)` manual for available
diff --git a/Help/variable/CMAKE_AUTOMOC.rst b/Help/variable/CMAKE_AUTOMOC.rst
index 87e8a9b..02e5eb5 100644
--- a/Help/variable/CMAKE_AUTOMOC.rst
+++ b/Help/variable/CMAKE_AUTOMOC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOMOC
-------------
-Whether to handle moc automatically for Qt targets.
+Whether to handle ``moc`` automatically for Qt targets.
-This variable is used to initialize the AUTOMOC property on all the
+This variable is used to initialize the :prop_tgt:`AUTOMOC` property on all the
targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst b/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
index bdbed85..09bf5cd 100644
--- a/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MOC_OPTIONS.rst
@@ -1,8 +1,7 @@
CMAKE_AUTOMOC_MOC_OPTIONS
-------------------------
-Additional options for moc when using automoc (see CMAKE_AUTOMOC).
+Additional options for ``moc`` when using :variable:`CMAKE_AUTOMOC`.
-This variable is used to initialize the AUTOMOC_MOC_OPTIONS property
-on all the targets. See that target property for additional
-information.
+This variable is used to initialize the :prop_tgt:`AUTOMOC_MOC_OPTIONS` property
+on all the targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst b/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
index 8858410..a814d40 100644
--- a/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
+++ b/Help/variable/CMAKE_AUTOMOC_RELAXED_MODE.rst
@@ -3,11 +3,11 @@ CMAKE_AUTOMOC_RELAXED_MODE
Switch between strict and relaxed automoc mode.
-By default, automoc behaves exactly as described in the documentation
-of the AUTOMOC target property. When set to TRUE, it accepts more
-input and tries to find the correct input file for moc even if it
+By default, :prop_tgt:`AUTOMOC` behaves exactly as described in the documentation
+of the :prop_tgt:`AUTOMOC` target property. When set to ``TRUE``, it accepts more
+input and tries to find the correct input file for ``moc`` even if it
differs from the documented behaviour. In this mode it e.g. also
checks whether a header file is intended to be processed by moc when a
-"foo.moc" file has been included.
+``"foo.moc"`` file has been included.
Relaxed mode has to be enabled for KDE4 compatibility.
diff --git a/Help/variable/CMAKE_AUTORCC.rst b/Help/variable/CMAKE_AUTORCC.rst
index d213993..067f766 100644
--- a/Help/variable/CMAKE_AUTORCC.rst
+++ b/Help/variable/CMAKE_AUTORCC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTORCC
-------------
-Whether to handle rcc automatically for Qt targets.
+Whether to handle ``rcc`` automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTORCC` property on all the targets.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
index 5efbfa3..298cb6b 100644
--- a/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTORCC_OPTIONS.rst
@@ -1,7 +1,7 @@
CMAKE_AUTORCC_OPTIONS
---------------------
-Whether to handle rcc automatically for Qt targets.
+Whether to handle ``rcc`` automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTORCC_OPTIONS` property on
all the targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOUIC.rst b/Help/variable/CMAKE_AUTOUIC.rst
index 3b016b0..0beb555 100644
--- a/Help/variable/CMAKE_AUTOUIC.rst
+++ b/Help/variable/CMAKE_AUTOUIC.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOUIC
-------------
-Whether to handle uic automatically for Qt targets.
+Whether to handle ``uic`` automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTOUIC` property on all the targets.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
index 6a88669..3c9b8c4 100644
--- a/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
+++ b/Help/variable/CMAKE_AUTOUIC_OPTIONS.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOUIC_OPTIONS
---------------------
-Whether to handle uic automatically for Qt targets.
+Whether to handle ``uic`` automatically for Qt targets.
This variable is used to initialize the :prop_tgt:`AUTOUIC_OPTIONS` property on
all the targets. See that target property for additional information.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd8c7dfe38657e9d83a475f09aa322000ce16dd7
commit fd8c7dfe38657e9d83a475f09aa322000ce16dd7
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 14:57:02 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
Help: Mark some code blocks as containing cmake code.
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index dc301ba..376ec78 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -131,7 +131,9 @@ It may also provide a CMake package configuration file::
<prefix>/lib/cmake/foo-1.2/FooConfig.cmake
with content defining :prop_tgt:`IMPORTED` targets, or defining variables, such
-as::
+as:
+
+.. code-block:: cmake
# ...
# (compute PREFIX relative to file location)
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 9e26392..2f4e090 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -22,7 +22,9 @@ The :command:`cmake_minimum_required` command does more than report an
error if a too-old version of CMake is used to build a project. It
also sets all policies introduced in that CMake version or earlier to
NEW behavior. To manage policies without increasing the minimum required
-CMake version, the :command:`if(POLICY)` command may be used::
+CMake version, the :command:`if(POLICY)` command may be used:
+
+.. code-block:: cmake
if(POLICY CMP0990)
cmake_policy(SET CMP0990 NEW)
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index fbe546e..97cd650 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -22,17 +22,23 @@ Languages
Languages are enabled by the :command:`project` command. If no project command
is in the top-level CMakeLists file, one will be implicitly generated. By default
-the enabled languages are C and CXX::
+the enabled languages are C and CXX:
+
+.. code-block:: cmake
project(C_Only C)
A special value of NONE can also be used with the :command:`project` command
-to enable no languages::
+to enable no languages:
+
+.. code-block:: cmake
project(MyProject NONE)
The :command:`enable_language` command can be used to enable languages after the
-:command:`project` command::
+:command:`project` command:
+
+.. code-block:: cmake
enable_language(CXX)
@@ -86,7 +92,9 @@ Cross Compiling
If :manual:`cmake(1)` is invoked with the command line parameter
``-DCMAKE_TOOLCHAIN_FILE=path/to/file``, the file will be loaded early to set
values for the compilers. A typical cross-compiling toolchain has content such
-as::
+as:
+
+.. code-block:: cmake
set(CMAKE_SYSTEM_NAME Linux)
@@ -127,7 +135,9 @@ the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables.
Some compilers are inherently cross compilers, such as Clang and the QNX QCC
compiler. The :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a
-value to those supported compilers when compiling::
+value to those supported compilers when compiling:
+
+.. code-block:: cmake
set(CMAKE_SYSTEM_NAME Linux)
@@ -138,7 +148,9 @@ value to those supported compilers when compiling::
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_COMPILER_TARGET ${triple})
-Or, for QCC::
+Or, for QCC:
+
+.. code-block:: cmake
set(CMAKE_SYSTEM_NAME QNX)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0893edd7d2400bcb2c231c8fbb9a8126e6640123
commit 0893edd7d2400bcb2c231c8fbb9a8126e6640123
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Dec 20 14:12:48 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:38 2013 +0100
GenerateExportHeader: Reformat docs.
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 5baf9e0..f83f992 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -6,14 +6,11 @@
#
# This module provides the function GENERATE_EXPORT_HEADER().
#
-# The GENERATE_EXPORT_HEADER function can be used to generate a file
+# The ``GENERATE_EXPORT_HEADER`` function can be used to generate a file
# suitable for preprocessor inclusion which contains EXPORT macros to be
-# used in library classes.
-#
-# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
-#
-# ::
+# used in library classes::
#
+# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
# [BASE_NAME <base_name>]
# [EXPORT_MACRO_NAME <export_macro_name>]
# [EXPORT_FILE_NAME <export_file_name>]
@@ -23,20 +20,21 @@
# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
# [DEFINE_NO_DEPRECATED]
# [PREFIX_NAME <prefix_name>]
+# )
#
-# )
#
-# The target properties CXX_VISIBILITY_PRESET and
-# VISIBILITY_INLINES_HIDDEN can be used to add the appropriate compile
-# flags for targets. See the documentation of those target properties,
-# and the convenience variables CMAKE_CXX_VISIBILITY_PRESET and
-# CMAKE_VISIBILITY_INLINES_HIDDEN.
+# The target properties :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>`
+# and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` can be used to add the appropriate
+# compile flags for targets. See the documentation of those target properties,
+# and the convenience variables
+# :variable:`CMAKE_CXX_VISIBILITY_PRESET <CMAKE_<LANG>_VISIBILITY_PRESET>` and
+# :variable:`CMAKE_VISIBILITY_INLINES_HIDDEN`.
#
-# By default GENERATE_EXPORT_HEADER() generates macro names in a file
+# By default ``GENERATE_EXPORT_HEADER()`` generates macro names in a file
# name determined by the name of the library. This means that in the
-# simplest case, users of generate_export_header will be equivalent to:
+# simplest case, users of ``GenerateExportHeader`` will be equivalent to:
#
-# ::
+# .. code-block:: cmake
#
# set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
@@ -49,10 +47,9 @@
# )
#
#
-#
# And in the ABI header files:
#
-# ::
+# .. code-block:: c++
#
# #include "somelib_export.h"
# class SOMELIB_EXPORT SomeClass {
@@ -60,17 +57,16 @@
# };
#
#
-#
# The CMake fragment will generate a file in the
-# ${CMAKE_CURRENT_BINARY_DIR} called somelib_export.h containing the
-# macros SOMELIB_EXPORT, SOMELIB_NO_EXPORT, SOMELIB_DEPRECATED,
-# SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT. The
+# ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
+# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
+# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``. The
# resulting file should be installed with other headers in the library.
#
-# The BASE_NAME argument can be used to override the file name and the
-# names used for the macros
+# The ``BASE_NAME`` argument can be used to override the file name and the
+# names used for the macros:
#
-# ::
+# .. code-block:: cmake
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -78,14 +74,14 @@
# )
#
#
+# Generates a file called ``other_name_export.h`` containing the macros
+# ``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
+# etc.
#
-# Generates a file called other_name_export.h containing the macros
-# OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and OTHER_NAME_DEPRECATED etc.
-#
-# The BASE_NAME may be overridden by specifiying other options in the
+# The ``BASE_NAME`` may be overridden by specifiying other options in the
# function. For example:
#
-# ::
+# .. code-block:: cmake
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -93,11 +89,10 @@
# )
#
#
+# creates the macro ``OTHER_NAME_EXPORT`` instead of ``SOMELIB_EXPORT``, but
+# other macros and the generated file name is as default:
#
-# creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT, but
-# other macros and the generated file name is as default.
-#
-# ::
+# .. code-block:: cmake
#
# add_library(somelib someclass.cpp)
# generate_export_header(somelib
@@ -105,17 +100,16 @@
# )
#
#
+# creates the macro ``KDE_DEPRECATED`` instead of ``SOMELIB_DEPRECATED``.
#
-# creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED.
-#
-# If LIBRARY_TARGET is a static library, macros are defined without
+# If ``LIBRARY_TARGET`` is a static library, macros are defined without
# values.
#
# If the same sources are used to create both a shared and a static
-# library, the uppercased symbol ${BASE_NAME}_STATIC_DEFINE should be
-# used when building the static library
+# library, the uppercased symbol ``${BASE_NAME}_STATIC_DEFINE`` should be
+# used when building the static library:
#
-# ::
+# .. code-block:: cmake
#
# add_library(shared_variant SHARED ${lib_SRCS})
# add_library(static_variant ${lib_SRCS})
@@ -123,16 +117,14 @@
# set_target_properties(static_variant PROPERTIES
# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
#
-#
-#
# This will cause the export macros to expand to nothing when building
# the static library.
#
-# If DEFINE_NO_DEPRECATED is specified, then a macro
-# ${BASE_NAME}_NO_DEPRECATED will be defined This macro can be used to
-# remove deprecated code from preprocessor output.
+# If ``DEFINE_NO_DEPRECATED`` is specified, then a macro
+# ``${BASE_NAME}_NO_DEPRECATED`` will be defined This macro can be used to
+# remove deprecated code from preprocessor output:
#
-# ::
+# .. code-block:: cmake
#
# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
# if (EXCLUDE_DEPRECATED)
@@ -141,10 +133,9 @@
# generate_export_header(somelib ${NO_BUILD_DEPRECATED})
#
#
-#
# And then in somelib:
#
-# ::
+# .. code-block:: c++
#
# class SOMELIB_EXPORT SomeClass
# {
@@ -154,42 +145,38 @@
# #endif
# };
#
-#
-#
-# ::
+# .. code-block:: c++
#
# #ifndef SOMELIB_NO_DEPRECATED
# void SomeClass::oldMethod() { }
# #endif
#
#
-#
-# If PREFIX_NAME is specified, the argument will be used as a prefix to
+# If ``PREFIX_NAME`` is specified, the argument will be used as a prefix to
# all generated macros.
#
# For example:
#
-# ::
+# .. code-block:: cmake
#
# generate_export_header(somelib PREFIX_NAME VTK_)
#
+# Generates the macros ``VTK_SOMELIB_EXPORT`` etc.
#
+# ::
#
-# Generates the macros VTK_SOMELIB_EXPORT etc.
-#
-#
-#
-# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
+# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
#
-# The ADD_COMPILER_EXPORT_FLAGS function adds -fvisibility=hidden to
-# CMAKE_CXX_FLAGS if supported, and is a no-op on Windows which does not
-# need extra compiler flags for exporting support. You may optionally
-# pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will be
-# populated with the required CXX_FLAGS required to enable visibility
+# The ``ADD_COMPILER_EXPORT_FLAGS`` function adds ``-fvisibility=hidden`` to
+# :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` if supported, and is a no-op
+# on Windows which does not need extra compiler flags for exporting support.
+# You may optionally pass a single argument to ``ADD_COMPILER_EXPORT_FLAGS``
+# that will be populated with the ``CXX_FLAGS`` required to enable visibility
# support for the compiler/architecture in use.
#
# This function is deprecated. Set the target properties
-# CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN instead.
+# :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
+# :prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.
#=============================================================================
# Copyright 2011 Stephen Kelly <steveire at gmail.com>
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b51a5a702e73c4a6eaeff0089e85067fa56868cf
commit b51a5a702e73c4a6eaeff0089e85067fa56868cf
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 14:11:23 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
cmTarget: Don't update IMPORTED target compilation properties
The include_directories() and add_compile_options() commands
should not append to the corresponding target property for IMPORTED
targets. This is already the case for add_definitions().
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 30a1557..6883f57 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4045,8 +4045,8 @@ cmMakefile::AddImportedTarget(const char* name, cmTarget::TargetType type,
// Create the target.
cmsys::auto_ptr<cmTarget> target(new cmTarget);
target->SetType(type, name);
- target->SetMakefile(this);
target->MarkAsImported();
+ target->SetMakefile(this);
// Add to the set of available imported targets.
this->ImportedTargets[name] = target.get();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 39d9819..7f8bdb7 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -330,34 +330,36 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Save the backtrace of target construction.
this->Makefile->GetBacktrace(this->Internal->Backtrace);
- // Initialize the INCLUDE_DIRECTORIES property based on the current value
- // of the same directory property:
- const std::vector<cmValueWithOrigin> parentIncludes =
- this->Makefile->GetIncludeDirectoriesEntries();
-
- for (std::vector<cmValueWithOrigin>::const_iterator it
- = parentIncludes.begin(); it != parentIncludes.end(); ++it)
+ if (!this->IsImported())
{
- this->InsertInclude(*it);
- }
+ // Initialize the INCLUDE_DIRECTORIES property based on the current value
+ // of the same directory property:
+ const std::vector<cmValueWithOrigin> parentIncludes =
+ this->Makefile->GetIncludeDirectoriesEntries();
- const std::set<cmStdString> parentSystemIncludes =
- this->Makefile->GetSystemIncludeDirectories();
+ for (std::vector<cmValueWithOrigin>::const_iterator it
+ = parentIncludes.begin(); it != parentIncludes.end(); ++it)
+ {
+ this->InsertInclude(*it);
+ }
+ const std::set<cmStdString> parentSystemIncludes =
+ this->Makefile->GetSystemIncludeDirectories();
- for (std::set<cmStdString>::const_iterator it
- = parentSystemIncludes.begin();
- it != parentSystemIncludes.end(); ++it)
- {
- this->SystemIncludeDirectories.insert(*it);
- }
+ for (std::set<cmStdString>::const_iterator it
+ = parentSystemIncludes.begin();
+ it != parentSystemIncludes.end(); ++it)
+ {
+ this->SystemIncludeDirectories.insert(*it);
+ }
- const std::vector<cmValueWithOrigin> parentOptions =
- this->Makefile->GetCompileOptionsEntries();
+ const std::vector<cmValueWithOrigin> parentOptions =
+ this->Makefile->GetCompileOptionsEntries();
- for (std::vector<cmValueWithOrigin>::const_iterator it
- = parentOptions.begin(); it != parentOptions.end(); ++it)
- {
- this->InsertCompileOption(*it);
+ for (std::vector<cmValueWithOrigin>::const_iterator it
+ = parentOptions.begin(); it != parentOptions.end(); ++it)
+ {
+ this->InsertCompileOption(*it);
+ }
}
if (this->GetType() != INTERFACE_LIBRARY)
diff --git a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
index 1652cf6..995b32c 100644
--- a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
@@ -12,3 +12,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
"DO_GNU_TESTS"
)
endif()
+
+add_compile_options(-rtti)
+add_library(imp UNKNOWN IMPORTED)
+get_target_property(_res imp COMPILE_OPTIONS)
+if (_res)
+ message(SEND_ERROR "add_compile_options populated the COMPILE_OPTIONS target property")
+endif()
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
index 900dbd0..14d40aa 100644
--- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
@@ -25,3 +25,10 @@ target_compile_definitions(consumer
target_compile_definitions(consumer
PRIVATE
)
+
+add_definitions(-DSOME_DEF)
+add_library(imp UNKNOWN IMPORTED)
+get_target_property(_res imp COMPILE_DEFINITIONS)
+if (_res)
+ message(SEND_ERROR "add_definitions populated the COMPILE_DEFINITIONS target property")
+endif()
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index 8a564c7..661bbaa 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -62,3 +62,10 @@ target_include_directories(consumer
target_include_directories(consumer
SYSTEM PRIVATE
)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_library(imp UNKNOWN IMPORTED)
+get_target_property(_res imp INCLUDE_DIRECTORIES)
+if (_res)
+ message(SEND_ERROR "include_directories populated the INCLUDE_DIRECTORIES target property")
+endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e737f680b81fbf0f499699c0a47c0ee75786ab82
commit e737f680b81fbf0f499699c0a47c0ee75786ab82
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 14:24:24 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
Run the add_compile_options command unit test.
This has not been executed since it was added in
commit a984f325 (Introduce add_compile_options command., 2013-06-04).
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 5ea604f..1d573c6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2168,6 +2168,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestConfig/ScriptWithArgs.log"
)
+ ADD_TEST_MACRO(CMakeCommands.add_compile_options add_compile_options)
ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries)
ADD_TEST_MACRO(CMakeCommands.target_include_directories target_include_directories)
ADD_TEST_MACRO(CMakeCommands.target_compile_definitions target_compile_definitions)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0c15a3320a70bf9b7d575048ff280ebc78fecd5
commit f0c15a3320a70bf9b7d575048ff280ebc78fecd5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 12:45:44 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
get_property: Fix testing ALIASED_TARGET target property (#14670)
In the case where the argument is not an ALIAS, the variable should
be set to a -NOTFOUND content.
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index faba7cd..a1454a3 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -298,7 +298,7 @@ bool cmGetPropertyCommand::HandleTargetMode()
return this->StoreResult(target->GetName());
}
}
- return false;
+ return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
}
if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name.c_str()))
{
diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index fdb1638..9467fae 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -48,3 +48,25 @@ endif()
add_library(iface INTERFACE)
add_library(Alias::Iface ALIAS iface)
+
+get_target_property(_notAlias1 foo ALIASED_TARGET)
+if (NOT DEFINED _notAlias1)
+ message(SEND_ERROR "_notAlias1 is not defined")
+endif()
+if (_notAlias1)
+ message(SEND_ERROR "_notAlias1 is defined, but foo is not an ALIAS")
+endif()
+if (NOT _notAlias1 STREQUAL _notAlias1-NOTFOUND)
+ message(SEND_ERROR "_notAlias1 not defined to a -NOTFOUND variant")
+endif()
+
+get_property(_notAlias2 TARGET foo PROPERTY ALIASED_TARGET)
+if (NOT DEFINED _notAlias2)
+ message(SEND_ERROR "_notAlias2 is not defined")
+endif()
+if (_notAlias2)
+ message(SEND_ERROR "_notAlias2 is defined, but foo is not an ALIAS")
+endif()
+if (NOT _notAlias2 STREQUAL _notAlias2-NOTFOUND)
+ message(SEND_ERROR "_notAlias2 not defined to a -NOTFOUND variant")
+endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6bb8fb4bb453c296da628cc674ae5eec6e79ca6a
commit 6bb8fb4bb453c296da628cc674ae5eec6e79ca6a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 08:30:30 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
install: Ensure that install(TARGETS) works with no DESTINATION
INTERFACE_LIBRARY targets have no corresponding files, and so
require no DESTINATION to install anything to.
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index f400f13..9d4793d 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -23,7 +23,10 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_
add_library(sharediface INTERFACE)
target_link_libraries(sharediface INTERFACE sharedlib)
-install(TARGETS headeronly sharediface sharedlib
+install(TARGETS headeronly sharediface
+ EXPORT expInterface
+)
+install(TARGETS sharedlib
EXPORT expInterface
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib NAMELINK_SKIP
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6d61ba51e0d98a41800fc68884d58bd2f293336
commit f6d61ba51e0d98a41800fc68884d58bd2f293336
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 08:19:33 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
export: Only generate and install configuration files if needed.
The modern way to create configuration dependent content is using
generator expressions in the main export file. The only non-deprecated
property still generated in the configuration-specific files are
IMPORTED_LOCATION_<CONFIG>
INTERFACE_LIBRARY targets have no location, and no need for those
files.
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 5988567..73e9b31 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -115,12 +115,17 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
bool require2_8_12 = false;
bool require3_0_0 = false;
+ bool requiresConfigFiles = false;
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
tei = allTargets.begin();
tei != allTargets.end(); ++tei)
{
cmTarget* te = (*tei)->Target;
+
+ requiresConfigFiles = requiresConfigFiles
+ || te->GetType() != cmTarget::INTERFACE_LIBRARY;
+
this->GenerateImportTargetCode(os, te);
ImportPropertyMap properties;
@@ -197,15 +202,19 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
}
this->GenerateImportedFileCheckLoop(os);
- // Generate an import file for each configuration.
bool result = true;
- for(std::vector<std::string>::const_iterator
- ci = this->Configurations.begin();
- ci != this->Configurations.end(); ++ci)
+ // Generate an import file for each configuration.
+ // Don't do this if we only export INTERFACE_LIBRARY targets.
+ if (requiresConfigFiles)
{
- if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
+ for(std::vector<std::string>::const_iterator
+ ci = this->Configurations.begin();
+ ci != this->Configurations.end(); ++ci)
{
- result = false;
+ if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
+ {
+ result = false;
+ }
}
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=287a576e057a91e3756fd4a9ee3b312ba9e74557
commit 287a576e057a91e3756fd4a9ee3b312ba9e74557
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 07:49:20 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
Help: Workaround pygments reporting an error for genexes.
Without the workaround, CMake code snippets are not highlighted
at all because pygments can not lex the generator expressions.
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 1955e42..336c74a 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -12,6 +12,16 @@
import os
import re
+# Monkey patch for pygments reporting an error when generator expressions are
+# used.
+# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled
+from pygments.lexers import CMakeLexer
+from pygments.token import Name, Operator
+from pygments.lexer import bygroups
+CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
+ bygroups(Operator, Name.Variable, Operator)))
+
+
from docutils.parsers.rst import Directive, directives
from docutils.transforms import Transform
try:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73dc0afcd9a2d860224c01ba535425eeb9bd1a95
commit 73dc0afcd9a2d860224c01ba535425eeb9bd1a95
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 07:52:23 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:37 2013 +0100
Help: Remove workaround for pre-CMake 2.8.4 code.
The requirement was updated in commit 920ffbf5 (Require CMake 2.8.4
or greater to build CMake, 2013-10-11) and similar snippets were
removed.
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 5e0ef87..aa9735e 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -11,8 +11,7 @@
#=============================================================================
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
- set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
+ cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c374827607f5d93b94a161586b70513db8b21048
commit c374827607f5d93b94a161586b70513db8b21048
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 08:09:39 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:36 2013 +0100
cmTarget: Rename container holding link implementation objects.
Don't erroneously name it for the link implementation. That's
something different.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a0177fb..39d9819 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -136,7 +136,7 @@ public:
std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
std::vector<TargetPropertyEntry*> CompileOptionsEntries;
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
- std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
+ std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceIncludeDirectoriesEntries;
@@ -1042,8 +1042,8 @@ cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
void cmTarget::FinalizeSystemIncludeDirectories()
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkInterfacePropertyEntries.begin(),
- end = this->Internal->LinkInterfacePropertyEntries.end();
+ it = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -1495,11 +1495,11 @@ void cmTarget::SetProperty(const char* prop, const char* value)
}
if (strcmp(prop, "LINK_LIBRARIES") == 0)
{
- this->Internal->LinkInterfacePropertyEntries.clear();
+ this->Internal->LinkImplementationPropertyEntries.clear();
cmListFileBacktrace lfbt;
this->Makefile->GetBacktrace(lfbt);
cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkInterfacePropertyEntries.push_back(entry);
+ this->Internal->LinkImplementationPropertyEntries.push_back(entry);
return;
}
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
@@ -1570,7 +1570,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
cmListFileBacktrace lfbt;
this->Makefile->GetBacktrace(lfbt);
cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkInterfacePropertyEntries.push_back(entry);
+ this->Internal->LinkImplementationPropertyEntries.push_back(entry);
return;
}
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
@@ -1882,8 +1882,8 @@ cmTarget::GetIncludeDirectories(const char *config) const
if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkInterfacePropertyEntries.begin(),
- end = this->Internal->LinkInterfacePropertyEntries.end();
+ it = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2111,8 +2111,8 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkInterfacePropertyEntries.begin(),
- end = this->Internal->LinkInterfacePropertyEntries.end();
+ it = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2224,8 +2224,8 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
{
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkInterfacePropertyEntries.begin(),
- end = this->Internal->LinkInterfacePropertyEntries.end();
+ it = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
if (!cmGeneratorExpression::IsValidTargetName(it->Value)
@@ -2800,8 +2800,8 @@ const char *cmTarget::GetProperty(const char* prop,
output = "";
std::string sep;
for (std::vector<cmValueWithOrigin>::const_iterator
- it = this->Internal->LinkInterfacePropertyEntries.begin(),
- end = this->Internal->LinkInterfacePropertyEntries.end();
+ it = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
output += sep;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de461d610bbb0ce9ee15497c891533bf2a46507b
commit de461d610bbb0ce9ee15497c891533bf2a46507b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Dec 10 18:59:21 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:36 2013 +0100
install: Rename variable referencing cmake version.
The next version is 3.0.0, not 2.8.13.
The version generated in the export file should be updated in
the release branch in both cmExportInstallFileGenerator and
cmExportBuildFileGenerator.
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 1025dc0..5988567 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -114,7 +114,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
std::vector<std::string> missingTargets;
bool require2_8_12 = false;
- bool require2_8_13 = false;
+ bool require3_0_0 = false;
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
tei = allTargets.begin();
@@ -160,7 +160,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
}
if (te->GetType() == cmTarget::INTERFACE_LIBRARY)
{
- require2_8_13 = true;
+ require3_0_0 = true;
}
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
te, properties);
@@ -169,7 +169,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->GenerateInterfaceProperties(te, os, properties);
}
- if (require2_8_13)
+ if (require3_0_0)
{
this->GenerateRequiredCMakeVersion(os, "2.8.12.20131007");
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2fae583e2677704b84c366c0bdf63b4943b62bd0
commit 2fae583e2677704b84c366c0bdf63b4943b62bd0
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 26 08:06:36 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Dec 31 15:32:36 2013 +0100
Style: Use this-> when invoking member function.
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 30c1743..e20fe02 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -55,7 +55,7 @@ bool cmIncludeDirectoryCommand
std::vector<std::string> includes;
- GetIncludes(*i, includes);
+ this->GetIncludes(*i, includes);
if (before)
{
-----------------------------------------------------------------------
Summary of changes:
Source/cmAddDependenciesCommand.cxx | 9 ---------
.../RunCMake/interface_library/RunCMakeTest.cmake | 1 -
.../interface_library/add_dependencies-result.txt | 1 -
.../interface_library/add_dependencies-stderr.txt | 6 ------
.../interface_library/add_dependencies.cmake | 4 ----
5 files changed, 0 insertions(+), 21 deletions(-)
delete mode 100644 Tests/RunCMake/interface_library/add_dependencies-result.txt
delete mode 100644 Tests/RunCMake/interface_library/add_dependencies-stderr.txt
delete mode 100644 Tests/RunCMake/interface_library/add_dependencies.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list