[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6772-g3b4d3e4
Stephen Kelly
steveire at gmail.com
Mon Jan 6 12:47:43 EST 2014
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 3b4d3e44a8d282e39a884539c9a95a4873e452d2 (commit)
via 383bd727041ff60ebb8fce29cd06473594d6fc01 (commit)
via 76488e2565db489e702a4245902ea55b3be0c4b8 (commit)
via 6fccb5bf8d9823e39705aea0425d770f1923a3dc (commit)
via f413074ae51119078e93d5b8819d485eef6c70f3 (commit)
via af3813cfd09baf6594e0bb663db8159cf4b5d67a (commit)
via ea3867402a62fc6c91135d764d8685a56781e9ff (commit)
via 7cf19ae5f16e271fa85f840dac314049c44ea055 (commit)
via 1e499c6b7e9f74edc31cf59824fe0084897c0ff5 (commit)
via 9c9f69fb9c0c1ab1f62de646cffe48485bd893af (commit)
via 6eb32181052e2262fd2b8ed1d6fa19e279d7ae5e (commit)
via 646c6ec2f975238c11e2be02912fae0872843772 (commit)
via 711fb38f726fe3ef1209c81ae7b3220c5ca1512b (commit)
via 802a28fc5e19136b947b2f7d136de31c1d10b578 (commit)
from be21e65cfb8cf7caabdfcb067edf5ac2b1509a7f (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=3b4d3e44a8d282e39a884539c9a95a4873e452d2
commit 3b4d3e44a8d282e39a884539c9a95a4873e452d2
Merge: be21e65 383bd72
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 12:47:42 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 6 12:47:42 2014 -0500
Merge topic 'minor-cleanups' into next
383bd72 Help: Document the target properties exported to IMPORTED targets.
76488e2 CompatibleInterface: Test debugging of not-set property.
6fccb5b Help: Note that language-specific 'built-ins' are set by the project command.
f413074 Help: Mention CMAKE_DISABLE_FIND_PACKAGE_<PackageName> in package docs.
af3813c Tests: simplify Qt4 target usage
ea38674 Help: Fix typo: 'target' -> 'target property'
7cf19ae Test: Remove obsolete commented code.
1e499c6 Help: Fix some erroneous code block markers in Module docs.
9c9f69f Genex: Make EQUAL support upper case binary literals
6eb3218 Genex: Fix case of methods in the dag checker.
646c6ec Genex: Use a preprocessor loop to implement transitive DAG check.
711fb38 Genex: List transitive properties and methods as a table, not two lists.
802a28f Add cmHasLiteralSuffix API.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=383bd727041ff60ebb8fce29cd06473594d6fc01
commit 383bd727041ff60ebb8fce29cd06473594d6fc01
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 4 12:34:02 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:46 2014 +0100
Help: Document the target properties exported to IMPORTED targets.
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index be60ebb..03f9115 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -218,6 +218,8 @@ each keyword:
PRIVATE serialization
)
+.. _`Compatible Interface Properties`:
+
Compatible Interface Properties
-------------------------------
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index 3eda829..b572bf7 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -280,6 +280,12 @@ shared library:
add_library(ClimbingStats SHARED climbingstats.cpp)
generate_export_header(ClimbingStats)
+ set_property(TARGET ClimbingStats PROPERTY VERSION ${Upstream_VERSION})
+ set_property(TARGET ClimbingStats PROPERTY SOVERSION 3)
+ set_property(TARGET ClimbingStats PROPERTY INTERFACE_ClimbingStats_MAJOR_VERSION 3)
+ set_property(TARGET ClimbingStats APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING ClimbingStats_MAJOR_VERSION
+ )
install(TARGETS ClimbingStats EXPORT ClimbingStatsTargets
LIBRARY DESTINATION lib
@@ -346,6 +352,22 @@ targets, suitable for use by downsteams and arranges to install it to
and a ``cmake/ClimbingStatsConfig.cmake`` are installed to the same location,
completing the package.
+The generated :prop_tgt:`IMPORTED` targets have appropriate properties set
+to define their usage requirements, such as
+:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`,
+:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` and other relevant built-in
+``INTERFACE_`` properties. The ``INTERFACE`` variant of user-defined
+properties listed in :prop_tgt:`COMPATIBLE_INTERFACE_STRING` and
+other :ref:`Compatible Interface Properties` are also propagated to the
+generated :prop_tgt:`IMPORTED` targets. In the above case,
+``ClimbingStats_MAJOR_VERSION`` is defined as a string which must be
+compatible among the dependencies of any depender. By setting this custom
+defined user property in this version and in the next version of
+``ClimbingStats``, :manual:`cmake(1)` will issue a diagnostic if there is an
+attempt to use version 3 together with version 4. Packages can choose to
+employ such a pattern if different major versions of the package are designed
+to be incompatible.
+
A ``NAMESPACE`` with double-colons is specified when exporting the targets
for installation. This convention of double-colons gives CMake a hint that
the name is an :prop_tgt:`IMPORTED` target when it is used by downstreams
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76488e2565db489e702a4245902ea55b3be0c4b8
commit 76488e2565db489e702a4245902ea55b3be0c4b8
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 18:23:58 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:46 2014 +0100
CompatibleInterface: Test debugging of not-set property.
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
index e3efe28..17b8a5c 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties-stderr.txt
@@ -67,6 +67,12 @@ CMake Debug Log:
\* Target "CompatibleInterface" has property content "prop3"
+
CMake Debug Log:
+ String compatibility of property "STRING_PROP4" for target
+ "CompatibleInterface" \(result: "\(unset\)"\):
+
+ \* Target "CompatibleInterface" property not set.
++
+CMake Debug Log:
Numeric minimum compatibility of property "NUMBER_MIN_PROP1" for target
"CompatibleInterface" \(result: "50"\):
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 42a3af2..0196611 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -22,6 +22,7 @@ set_property(TARGET iface1 APPEND PROPERTY
STRING_PROP1
STRING_PROP2
STRING_PROP3
+ STRING_PROP4 # Not set.
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MIN
@@ -36,7 +37,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
- STRING_PROP1 STRING_PROP2 STRING_PROP3
+ STRING_PROP1 STRING_PROP2 STRING_PROP3 STRING_PROP4
NUMBER_MIN_PROP1 NUMBER_MIN_PROP2
NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fccb5bf8d9823e39705aea0425d770f1923a3dc
commit 6fccb5bf8d9823e39705aea0425d770f1923a3dc
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 5 04:41:08 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:46 2014 +0100
Help: Note that language-specific 'built-ins' are set by the project command.
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 97cd650..fb529ad 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -20,7 +20,11 @@ with information about compiler and utility paths.
Languages
=========
-Languages are enabled by the :command:`project` command. If no project command
+Languages are enabled by the :command:`project` command. Language-specific
+built-in variables, such as
+:variable:`CMAKE_CXX_COMPILER <CMAKE_<LANG>_COMPILER>`,
+:variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` etc are set by
+invoking 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:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f413074ae51119078e93d5b8819d485eef6c70f3
commit f413074ae51119078e93d5b8819d485eef6c70f3
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:35:31 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Help: Mention CMAKE_DISABLE_FIND_PACKAGE_<PackageName> in package docs.
diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst
index 376ec78..3eda829 100644
--- a/Help/manual/cmake-packages.7.rst
+++ b/Help/manual/cmake-packages.7.rst
@@ -72,6 +72,10 @@ or as a separate ``OPTIONAL_COMPONENTS`` list:
Handling of ``COMPONENTS`` and ``OPTIONAL_COMPONENTS`` is defined by the
package.
+By setting the :variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable to
+``TRUE``, the ``PackageName`` package will not be searched, and will always
+be ``NOTFOUND``.
+
Config-file Packages
--------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af3813cfd09baf6594e0bb663db8159cf4b5d67a
commit af3813cfd09baf6594e0bb663db8159cf4b5d67a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:24:28 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Tests: simplify Qt4 target usage
This content was copied from another test where both the Core and Gui
targets are used.
diff --git a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake
index 86bd5a0..03635e2 100644
--- a/Tests/RunCMake/CompatibleInterface/AutoUic.cmake
+++ b/Tests/RunCMake/CompatibleInterface/AutoUic.cmake
@@ -1,9 +1,6 @@
find_package(Qt4 REQUIRED)
-set(QT_CORE_TARGET Qt4::QtCore)
-set(QT_GUI_TARGET Qt4::QtGui)
-
set(CMAKE_AUTOUIC ON)
set(CMAKE_DEBUG_TARGET_PROPERTIES AUTOUIC_OPTIONS)
@@ -19,4 +16,4 @@ set_property(TARGET OtherI18n APPEND PROPERTY
)
add_library(LibWidget empty.cpp)
-target_link_libraries(LibWidget KI18n OtherI18n ${QT_GUI_TARGET})
+target_link_libraries(LibWidget KI18n OtherI18n Qt4::QtGui)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea3867402a62fc6c91135d764d8685a56781e9ff
commit ea3867402a62fc6c91135d764d8685a56781e9ff
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:17:54 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Help: Fix typo: 'target' -> 'target property'
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 2bc1881..3e6c4d1 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -9,6 +9,6 @@ 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``
executable.
-The ``AUTOGEN_TARGET_DEPENDS`` target can be set instead to a list of dependencies
-for the ``_automoc`` target. The buildsystem will be generated to depend on its
-contents.
+The ``AUTOGEN_TARGET_DEPENDS`` target property can be set instead to a list of
+dependencies for the ``_automoc`` target. The buildsystem will be generated to
+depend on its contents.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cf19ae5f16e271fa85f840dac314049c44ea055
commit 7cf19ae5f16e271fa85f840dac314049c44ea055
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:15:23 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Test: Remove obsolete commented code.
This should not have survived in commit a247911a (Tests: Don't read
the LOCATION property from build targets., 2013-11-18).
diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt
index b8d5a04..c60de84 100644
--- a/Tests/LinkDirectory/CMakeLists.txt
+++ b/Tests/LinkDirectory/CMakeLists.txt
@@ -11,13 +11,11 @@ endif()
add_library(mylibA STATIC mylibA.c)
set_property(TARGET mylibA PROPERTY
ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/External/lib")
-# get_property(mylibA TARGET mylibA PROPERTY LOCATION)
# Build a library into our build tree relative to the subproject build tree.
add_library(mylibB STATIC mylibB.c)
set_property(TARGET mylibB PROPERTY
ARCHIVE_OUTPUT_DIRECTORY "${LinkDirectory_BINARY_DIR}/lib")
-# get_property(mylibB TARGET mylibB PROPERTY LOCATION)
# Create a custom target to drive the subproject build.
include(ExternalProject)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e499c6b7e9f74edc31cf59824fe0084897c0ff5
commit 1e499c6b7e9f74edc31cf59824fe0084897c0ff5
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 4 20:43:10 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Help: Fix some erroneous code block markers in Module docs.
There are many style errors in these files. This patch fixes only
the syntactical errors.
The script which ported these to rst made some mistakes. Use a new
script to find problematic code:
.#!/usr/bin/env python
import os
rootDir = '.'
def checkFile(fname):
f = open(fname)
lines = f.readlines()
started = False
counter = 0
for l in lines:
if "#" in l:
started = True
elif started:
return
lin = l.find("(")
if lin != -1 and l.find(")", lin) == -1 and \
not "(To distribute this file outside of CMake, substitute the full" in l:
for lp in lines[counter+1:]:
if lp == "# ::\n":
print "\n\n######### " + fname + "\n\n"
print ''.join(lines[max(counter-2, 0):counter+6])
break
elif lp == "#\n" :
continue
break
counter += 1
for dirName, subdirList, fileList in os.walk(rootDir):
for fname in fileList:
checkFile(os.path.join(dirName, fname))
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index 47ac316..58cf440 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -2,13 +2,8 @@
# CMakeExpandImportedTargets
# --------------------------
#
-#
-#
# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
-#
-# ::
-#
-# [CONFIGURATION <config>] )
+# [CONFIGURATION <config>])
#
#
#
diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake
index 72832ad..e553b4b 100644
--- a/Modules/CMakePrintHelpers.cmake
+++ b/Modules/CMakePrintHelpers.cmake
@@ -9,14 +9,11 @@
#
#
# CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]
-#
-# ::
-#
-# [SOURCES source1 .. sourceN]
-# [DIRECTORIES dir1 .. dirN]
-# [TESTS test1 .. testN]
-# [CACHE_ENTRIES entry1 .. entryN]
-# PROPERTIES prop1 .. propN )
+# [SOURCES source1 .. sourceN]
+# [DIRECTORIES dir1 .. dirN]
+# [TESTS test1 .. testN]
+# [CACHE_ENTRIES entry1 .. entryN]
+# PROPERTIES prop1 .. propN )
#
#
#
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index a4ed8d5..74c2fe1 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -4,11 +4,8 @@
#
# Check if the given struct or class has the specified member variable
#
-# CHECK_STRUCT_HAS_MEMBER (<struct> <member> <header> <variable>
-#
-# ::
-#
-# [LANGUAGE <language>])
+# CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
+# [LANGUAGE <language>])
#
#
#
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index f7f242b..cf7eeec 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -9,19 +9,15 @@
# information on how to load Java into your CMake project.
#
# add_jar(target_name
-#
-# ::
-#
-# [SOURCES] source1 [source2 ...] [resource1 ...]
-# [INCLUDE_JARS jar1 [jar2 ...]]
-# [ENTRY_POINT entry]
-# [VERSION version]
-# [OUTPUT_NAME name]
-# [OUTPUT_DIR dir]
+# [SOURCES] source1 [source2 ...] [resource1 ...]
+# [INCLUDE_JARS jar1 [jar2 ...]]
+# [ENTRY_POINT entry]
+# [VERSION version]
+# [OUTPUT_NAME name]
+# [OUTPUT_DIR dir]
# )
#
#
-#
# This command creates a <target_name>.jar. It compiles the given
# source files (source) and adds the given resource files (resource) to
# the jar file. If only resource files are given then just a jar file
@@ -191,18 +187,15 @@
#
#
#
-# find_jar(<VAR>
-#
-# ::
#
-# name | NAMES name1 [name2 ...]
-# [PATHS path1 [path2 ... ENV var]]
-# [VERSIONS version1 [version2]]
-# [DOC "cache documentation string"]
+# find_jar(<VAR>
+# name | NAMES name1 [name2 ...]
+# [PATHS path1 [path2 ... ENV var]]
+# [VERSIONS version1 [version2]]
+# [DOC "cache documentation string"]
# )
#
#
-#
# This command is used to find a full path to the named jar. A cache
# entry named by <VAR> is created to stor the result of this command.
# If the full path to a jar is found the result is stored in the
@@ -227,23 +220,21 @@
# DESTINATION. It should be called in the same scope as add_jar() or it
# will fail.
#
-# create_javadoc(<VAR>
#
-# ::
#
-# PACKAGES pkg1 [pkg2 ...]
-# [SOURCEPATH <sourcepath>]
-# [CLASSPATH <classpath>]
-# [INSTALLPATH <install path>]
-# [DOCTITLE "the documentation title"]
-# [WINDOWTITLE "the title of the document"]
-# [AUTHOR TRUE|FALSE]
-# [USE TRUE|FALSE]
-# [VERSION TRUE|FALSE]
+# create_javadoc(<VAR>
+# PACKAGES pkg1 [pkg2 ...]
+# [SOURCEPATH <sourcepath>]
+# [CLASSPATH <classpath>]
+# [INSTALLPATH <install path>]
+# [DOCTITLE "the documentation title"]
+# [WINDOWTITLE "the title of the document"]
+# [AUTHOR TRUE|FALSE]
+# [USE TRUE|FALSE]
+# [VERSION TRUE|FALSE]
# )
#
#
-#
# Create java documentation based on files or packages. For more
# details please read the javadoc manpage.
#
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 67cab4a..11ca205 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -22,11 +22,9 @@
# swig generated module (swig -outdir option) The name-specific variable
# SWIG_MODULE_<name>_EXTRA_DEPS may be used to specify extra
# dependencies for the generated modules. If the source file generated
-# by swig need some special flag you can use
-# set_source_files_properties( ${swig_generated_file_fullname}
-#
-# ::
+# by swig need some special flag you can use::
#
+# set_source_files_properties( ${swig_generated_file_fullname}
# PROPERTIES COMPILE_FLAGS "-bla")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c9f69fb9c0c1ab1f62de646cffe48485bd893af
commit 9c9f69fb9c0c1ab1f62de646cffe48485bd893af
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jan 4 19:38:23 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Genex: Make EQUAL support upper case binary literals
As C++11, python, D and java do.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
Add test for uppercase hex literals.
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index fec43b9..259ba94 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -215,18 +215,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode
bool flipSign = false;
const char *lhs = parameters[0].c_str();
- if (cmHasLiteralPrefix(lhs, "0b"))
+ if (cmHasLiteralPrefix(lhs, "0b") || cmHasLiteralPrefix(lhs, "0B"))
{
base = 2;
lhs += 2;
}
- if (cmHasLiteralPrefix(lhs, "-0b"))
+ if (cmHasLiteralPrefix(lhs, "-0b") || cmHasLiteralPrefix(lhs, "-0B"))
{
base = 2;
lhs += 3;
flipSign = true;
}
- if (cmHasLiteralPrefix(lhs, "+0b"))
+ if (cmHasLiteralPrefix(lhs, "+0b") || cmHasLiteralPrefix(lhs, "+0B"))
{
base = 2;
lhs += 3;
@@ -249,18 +249,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode
flipSign = false;
const char *rhs = parameters[1].c_str();
- if (cmHasLiteralPrefix(rhs, "0b"))
+ if (cmHasLiteralPrefix(rhs, "0b") || cmHasLiteralPrefix(rhs, "0B"))
{
base = 2;
rhs += 2;
}
- if (cmHasLiteralPrefix(rhs, "-0b"))
+ if (cmHasLiteralPrefix(rhs, "-0b") || cmHasLiteralPrefix(rhs, "-0B"))
{
base = 2;
rhs += 3;
flipSign = true;
}
- if (cmHasLiteralPrefix(rhs, "+0b"))
+ if (cmHasLiteralPrefix(rhs, "+0b") || cmHasLiteralPrefix(rhs, "+0B"))
{
base = 2;
rhs += 3;
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 4fb7ecd..9512efc 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -199,7 +199,7 @@ add_custom_target(check-part3 ALL
-Dequal1=$<EQUAL:1,2>
-Dequal2=$<EQUAL:1,1>
-Dequal3=$<EQUAL:0x1,1>
- -Dequal4=$<EQUAL:0x1,2>
+ -Dequal4=$<EQUAL:0X1,2>
-Dequal5=$<EQUAL:0xA,0xa>
-Dequal6=$<EQUAL:0xA,10>
-Dequal7=$<EQUAL:0xA,012>
@@ -208,15 +208,17 @@ add_custom_target(check-part3 ALL
-Dequal10=$<EQUAL:10,0b1010>
-Dequal11=$<EQUAL:-10,-0xa>
-Dequal12=$<EQUAL:10,+0xa>
- -Dequal13=$<EQUAL:+10,+0xa>
+ -Dequal13=$<EQUAL:+10,+0Xa>
-Dequal14=$<EQUAL:+10,0xa>
- -Dequal15=$<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>
+ -Dequal18=$<EQUAL:10,+0B1010>
+ -Dequal19=$<EQUAL:10,-0B1010>
+ -Dequal20=$<EQUAL:10,0B1010>
+ -Dequal21=$<EQUAL:10,+012>
+ -Dequal22=$<EQUAL:10,-012>
+ -Dequal23=$<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..70ccfe1 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -55,6 +55,8 @@ check(equal15 "1")
check(equal16 "1")
check(equal17 "0")
check(equal18 "1")
-check(equal19 "1")
-check(equal20 "0")
+check(equal19 "0")
+check(equal20 "1")
check(equal21 "1")
+check(equal22 "0")
+check(equal23 "1")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6eb32181052e2262fd2b8ed1d6fa19e279d7ae5e
commit 6eb32181052e2262fd2b8ed1d6fa19e279d7ae5e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 5 05:25:09 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Genex: Fix case of methods in the dag checker.
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 3e97163..e7e1d34 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -31,7 +31,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
top = p;
p = p->Parent;
}
- this->CheckResult = this->checkGraph();
+ this->CheckResult = this->CheckGraph();
#define TEST_TRANSITIVE_PROPERTY_METHOD(METHOD) \
top->METHOD () ||
@@ -61,13 +61,13 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
//----------------------------------------------------------------------------
cmGeneratorExpressionDAGChecker::Result
-cmGeneratorExpressionDAGChecker::check() const
+cmGeneratorExpressionDAGChecker::Check() const
{
return this->CheckResult;
}
//----------------------------------------------------------------------------
-void cmGeneratorExpressionDAGChecker::reportError(
+void cmGeneratorExpressionDAGChecker::ReportError(
cmGeneratorExpressionContext *context,
const std::string &expr)
{
@@ -125,7 +125,7 @@ void cmGeneratorExpressionDAGChecker::reportError(
//----------------------------------------------------------------------------
cmGeneratorExpressionDAGChecker::Result
-cmGeneratorExpressionDAGChecker::checkGraph() const
+cmGeneratorExpressionDAGChecker::CheckGraph() const
{
const cmGeneratorExpressionDAGChecker *parent = this->Parent;
while (parent)
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 1636492..b6effa1 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -52,9 +52,9 @@ struct cmGeneratorExpressionDAGChecker
ALREADY_SEEN
};
- Result check() const;
+ Result Check() const;
- void reportError(cmGeneratorExpressionContext *context,
+ void ReportError(cmGeneratorExpressionContext *context,
const std::string &expr);
bool EvaluatingLinkLibraries(const char *tgt = 0);
@@ -71,7 +71,7 @@ struct cmGeneratorExpressionDAGChecker
{ this->TransitivePropertiesOnly = true; }
private:
- Result checkGraph() const;
+ Result CheckGraph() const;
private:
const cmGeneratorExpressionDAGChecker * const Parent;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index f0e40ea..fec43b9 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -957,10 +957,10 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
content,
dagCheckerParent);
- switch (dagChecker.check())
+ switch (dagChecker.Check())
{
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
- dagChecker.reportError(context, content->GetOriginalExpression());
+ dagChecker.ReportError(context, content->GetOriginalExpression());
return std::string();
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE:
// No error. We just skip cyclic references.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=646c6ec2f975238c11e2be02912fae0872843772
commit 646c6ec2f975238c11e2be02912fae0872843772
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 5 12:40:38 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:45 2014 +0100
Genex: Use a preprocessor loop to implement transitive DAG check.
The other infrastructure for transitive property handling is
already using a preprocessor loop.
Implement special backward-compatibility handling of
COMPILE_DEFINITIONS_<CONFIG> using a template switch for the
extra check.
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index c2c4e20..3e97163 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -179,44 +179,37 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt)
|| strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0;
}
-//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingIncludeDirectories() const
+enum TransitiveProperty {
+#define DEFINE_ENUM_ENTRY(NAME) NAME,
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(DEFINE_ENUM_ENTRY)
+#undef DEFINE_ENUM_ENTRY
+ TransitivePropertyTerminal
+};
+
+template<TransitiveProperty>
+bool additionalTest(const char* const)
{
- const char *prop = this->Property.c_str();
- return (strcmp(prop, "INCLUDE_DIRECTORIES") == 0
- || strcmp(prop, "INTERFACE_INCLUDE_DIRECTORIES") == 0 );
+ return false;
}
-//----------------------------------------------------------------------------
-bool
-cmGeneratorExpressionDAGChecker::EvaluatingSystemIncludeDirectories() const
+template<>
+bool additionalTest<COMPILE_DEFINITIONS>(const char* const prop)
{
- const char *prop = this->Property.c_str();
- return (strcmp(prop, "SYSTEM_INCLUDE_DIRECTORIES") == 0
- || strcmp(prop, "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES") == 0);
+ return cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_");
}
-//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingCompileDefinitions() const
-{
- const char *prop = this->Property.c_str();
- return (strcmp(prop, "COMPILE_DEFINITIONS") == 0
- || strcmp(prop, "INTERFACE_COMPILE_DEFINITIONS") == 0
- || cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_"));
+#define DEFINE_TRANSITIVE_PROPERTY_METHOD(METHOD, PROPERTY) \
+bool cmGeneratorExpressionDAGChecker::METHOD() const \
+{ \
+ const char* const prop = this->Property.c_str(); \
+ if (strcmp(prop, #PROPERTY) == 0 \
+ || strcmp(prop, "INTERFACE_" #PROPERTY) == 0) \
+ { \
+ return true; \
+ } \
+ return additionalTest<PROPERTY>(prop); \
}
-//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingCompileOptions() const
-{
- const char *prop = this->Property.c_str();
- return (strcmp(prop, "COMPILE_OPTIONS") == 0
- || strcmp(prop, "INTERFACE_COMPILE_OPTIONS") == 0 );
-}
+CM_FOR_EACH_TRANSITIVE_PROPERTY(DEFINE_TRANSITIVE_PROPERTY_METHOD)
-//----------------------------------------------------------------------------
-bool cmGeneratorExpressionDAGChecker::EvaluatingAutoUicOptions() const
-{
- const char *prop = this->Property.c_str();
- return (strcmp(prop, "AUTOUIC_OPTIONS") == 0
- || strcmp(prop, "INTERFACE_AUTOUIC_OPTIONS") == 0 );
-}
+#undef DEFINE_TRANSITIVE_PROPERTY_METHOD
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 812e985..1636492 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -16,6 +16,7 @@
#include "cmGeneratorExpressionEvaluator.h"
+#define CM_SELECT_BOTH(F, A1, A2) F(A1, A2)
#define CM_SELECT_FIRST(F, A1, A2) F(A1)
#define CM_SELECT_SECOND(F, A1, A2) F(A2)
@@ -26,6 +27,9 @@
SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \
SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS)
+#define CM_FOR_EACH_TRANSITIVE_PROPERTY(F) \
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_BOTH)
+
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(F) \
CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_FIRST)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=711fb38f726fe3ef1209c81ae7b3220c5ca1512b
commit 711fb38f726fe3ef1209c81ae7b3220c5ca1512b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 5 05:13:39 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:44 2014 +0100
Genex: List transitive properties and methods as a table, not two lists.
Introduce a new set of macros to select the column.
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 98ffd36..812e985 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -16,19 +16,21 @@
#include "cmGeneratorExpressionEvaluator.h"
+#define CM_SELECT_FIRST(F, A1, A2) F(A1)
+#define CM_SELECT_SECOND(F, A1, A2) F(A2)
+
+#define CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, SELECT) \
+ SELECT(F, EvaluatingIncludeDirectories, INCLUDE_DIRECTORIES) \
+ SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \
+ SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \
+ SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \
+ SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS)
+
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(F) \
- F(EvaluatingIncludeDirectories) \
- F(EvaluatingSystemIncludeDirectories) \
- F(EvaluatingCompileDefinitions) \
- F(EvaluatingCompileOptions) \
- F(EvaluatingAutoUicOptions)
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_FIRST)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
- F(INCLUDE_DIRECTORIES) \
- F(SYSTEM_INCLUDE_DIRECTORIES) \
- F(COMPILE_DEFINITIONS) \
- F(COMPILE_OPTIONS) \
- F(AUTOUIC_OPTIONS)
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_SECOND)
//----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=802a28fc5e19136b947b2f7d136de31c1d10b578
commit 802a28fc5e19136b947b2f7d136de31c1d10b578
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Dec 30 16:09:46 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 18:46:44 2014 +0100
Add cmHasLiteralSuffix API.
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 55c20d6..12bb807 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((cmHasLiteralSuffix(d, "/bin")) ||
+ (cmHasLiteralSuffix(d, "/sbin")))
{
this->AddPathInternal(cmSystemTools::GetFilenamePath(d), EnvPath);
}
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index eb6e52f..ebfa8f9 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -391,6 +391,22 @@ 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)
+{
+ size_t len = str1.size();
+ return len >= N && strcmp(str1.c_str() + len - N, str2) == 0;
+}
+
+inline bool cmHasLiteralSuffixImpl(const char* str1,
+ const char* str2,
+ size_t N)
+{
+ size_t len = strlen(str1);
+ return len >= N && strcmp(str1 + len - N, str2) == 0;
+}
+
#if defined(_MSC_VER) && _MSC_VER < 1300 \
|| defined(__GNUC__) && __GNUC__ < 3 \
|| defined(__BORLANDC__)
@@ -402,6 +418,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 +436,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");
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list