Commit Graph

2221 Commits

Author SHA1 Message Date
Stephen Kelly 7e707444be Expand includes and defines transitively in 'external' genexes.
This means that we can use expressions of the form

 $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>

to get a list of the interface include directories of foo, including
those coming from dependencies.

We can't have a test of a target which has a single include directory in
its INCLUDE_DIRECTORIES because the shell on the MSYS platforms transforms
a single include directory to include a prefix, which is not what the test
expects. We test a target with two directories instead as a means to
test a target with no link dependencies.
2013-02-23 09:42:24 +01:00
Stephen Kelly 79ae968a18 Revert "Add a way to exclude INTERFACE properties from exported targets."
This reverts commit 2c3654c3de.

The removal of some tests added in commit 77cecb77 (Add includes and compile
definitions with target_link_libraries., 2012-11-05) are also squashed
into this commit.
2013-02-13 15:12:31 +01:00
Stephen Kelly 3df36b5954 Revert "Add the $<LINKED:...> generator expression."
This reverts commit 0b92602b81.

Conflicts:
	Source/cmGeneratorExpressionEvaluator.cxx
	Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
	Tests/CMakeCommands/target_include_directories/CMakeLists.txt
2013-02-13 15:12:31 +01:00
Stephen Kelly e1f908015f Don't populate INTERFACE includes and defines properties in tll.
This is a partial revert of commit 77cecb77 (Add includes and compile
definitions with target_link_libraries., 2012-11-05).

As the interface includes and defines are now determined by the link
closure, there is no need to populate the corresponding properties
explicitly.
2013-02-13 15:12:31 +01:00
Stephen Kelly 567c8d103e Revert "Don't allow utility or global targets in the LINKED expression."
This reverts commit 9712362b45.
2013-02-13 15:12:31 +01:00
Stephen Kelly 5c9f5e313f Don't use LINKED where not needed. 2013-02-12 10:39:35 +01:00
Brad King 813b519280 Merge topic 'minor-fixes'
ba48e63 Generate config-specific interface link libraries propeties.
deb51a7 Remove unused forward declarations.
9712362 Don't allow utility or global targets in the LINKED expression.
faa927e Make sure INTERFACE properties work with OBJECT libraries.
510fdcb Whitelist target types in target_{include_directories,compile_definitions}
4de7178 Ensure that the build interface includes have been added.
df74bc3 Only append build interface include dirs to particular targets.
d4e5c67 Don't keep track of content determined by target property values.
1fb545a Move a special case for PIC from the genex to the cmTarget code.
57175d5 Only use early evaluation termination for transitive properties.
4cf161a Fix determination of evaluating link libraries.
3a298c0 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
655e98b Ensure type specific compatible interface properties do not intersect.
46e2896 The COMPATIBLE_INTERFACE does not affect the target it is set on.
5f926a5 Test printing origin of include dirs from tll().
7c0ec75 De-duplicate validation of genex target names.
...
2013-02-11 13:59:48 -05:00
Stephen Kelly 9712362b45 Don't allow utility or global targets in the LINKED expression.
The LINKED expression is exclusively for handling INTERFACE content
and it does not make sense for utility targets to have INTERFACE
content.
2013-02-08 21:44:11 +01:00
Stephen Kelly faa927e273 Make sure INTERFACE properties work with OBJECT libraries. 2013-02-08 20:10:22 +01:00
Brad King 7dab997771 Merge topic 'generator-toolset'
56ca8d4 Tests: Add generator toolset support
f36c665 Tests: Consolidate ctest --build-and-test generator options
c0debb1 Merge branch 'master' into generator-toolset
daae0d2 ExternalProject: Propagate the generator toolset
e3841cf CTest: Add options to set generator toolset
f980a80 Xcode: Implement generator toolset selection (#9831, #13802)
650c647 VS: Implement generator toolset selection (#10722, #13774)
4fd5342 CMake: Add -T option to choose a generator toolset
118c32f Merge branch 'xcode-duplicate-flags-13354' into generator-toolset
cf8645e Tests: Run ctest custom commands with VERBATIM
5b2fba5 ExternalProject: Simplify CMake command line generation
2013-02-08 13:38:56 -05:00
Brad King 98cca40d9b Merge topic 'implicit-lib-canonical-path'
10e8b2d Normalize full paths in implicit link library list
2013-02-08 13:38:10 -05:00
Stephen Kelly 510fdcb188 Whitelist target types in target_{include_directories,compile_definitions}
Setting include directories or compile definitions on a target created
with add_custom_target does not make sense.
2013-02-08 19:21:30 +01:00
Stephen Kelly 4de71786e8 Ensure that the build interface includes have been added.
This is needed in the case that Automoc is used, as that calls
GetIncludeDirectories, which may cache the resulting include dirs
too early in the generate step.

Also, because the automoc step is so early, we can't cache the
include directories at that point. At that point the build interface
of all dependencies are not populated yet, so we'd be caching the
includes before appending the build interface. Only start caching
when we're definitely generating the buildsystem. At that point, the
includes should be stable.

We still need to invoke AppendBuildInterfaceIncludes
in the GlobalGenerator because the build interface includes affect
mostly the dependencies of targets (such as the automoc targets),
rather than the targets themselves, so the build interface needs
to be appended for all targets before generation is done.
2013-02-08 12:54:27 +01:00
Brad King 56ca8d4e63 Tests: Add generator toolset support
Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
2013-02-07 11:09:56 -05:00
Brad King f36c665df8 Tests: Consolidate ctest --build-and-test generator options
All ctest --build-and-test invocations require the options

  --build-generator ${CMAKE_GENERATOR}
  --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}

to be passed and have consistent values, except for a few special cases.
Collect the generator options in a variable instead of repeating the
options everywhere explicitly.
2013-02-07 11:09:24 -05:00
Brad King c0debb1f89 Merge branch 'master' into generator-toolset
We need the latest Tests/CMakeLists.txt so we can refactor all tests.
2013-02-07 11:09:01 -05:00
Brad King f980a80495 Xcode: Implement generator toolset selection (#9831, #13802)
Implement generator toolset selection (cmake -T) for Xcode > 2.0 by
adding the GCC_VERSION build setting to project files.
2013-02-07 11:07:48 -05:00
Brad King 650c647160 VS: Implement generator toolset selection (#10722, #13774)
Implement generator toolset selection (cmake -T) for VS >= 10 by setting
the PlatformToolset.  Extend the RunCMake.GeneratorToolset test case to
verify CMAKE_GENERATOR_TOOLSET when the generator supports -T.

Since commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23)
all MSVC version information is detected during the compiler id step
from the actual compiler invoked by generated build systems rather than
hard-coded in VS generators.  Therefore we can set the PlatformToolset
in VS >= 10 project files and support toolsets from other VS versions.
2013-02-07 11:06:28 -05:00
Brad King 4fd5342956 CMake: Add -T option to choose a generator toolset
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases.
Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is
rejected when the generator doesn't support it, and that two -T options
are always rejected.
2013-02-07 10:53:19 -05:00
Stephen Kelly 57175d559e Only use early evaluation termination for transitive properties.
We need to make sure expressions which evaluate TARGET_PROPERTY:TYPE
multiple times for example get the correct result each time, and
not an empty string instead.
2013-02-07 16:21:09 +01:00
Stephen Kelly 655e98bf71 Ensure type specific compatible interface properties do not intersect.
Before, the boolean version would always win, and the string one would
be ignored.
2013-02-07 16:21:09 +01:00
Stephen Kelly 46e28960a5 The COMPATIBLE_INTERFACE does not affect the target it is set on.
Test and document this.
2013-02-07 16:21:09 +01:00
Stephen Kelly 5f926a5802 Test printing origin of include dirs from tll(). 2013-02-07 16:21:09 +01:00
Brad King 10e8b2da37 Normalize full paths in implicit link library list
Teach CMakeParseImplicitLinkInfo to convert implicit link library full
paths to a canonical form.  This makes them more reproducible in case
different language compiler front-ends add the same library by different
paths e.g. ".../libA.a" and "...//libA.a".

Add a case to the CMake.ImplicitLinkInfo test to cover removal of extra
slashes from both library and directory paths.
2013-02-06 16:22:02 -05:00
Brad King ec85306025 Merge topic 'tll-includes-defines'
e48d842 Cache context-independent includes on evaluation.
089fe1c Optimize genex evaluation for includes and defines.
179f495 find_package: Reword <package>_NO_INTERFACES documentation
e7b579b Test workaround of bad interface include directories from depends.
77cecb7 Add includes and compile definitions with target_link_libraries.
0b92602 Add the $<LINKED:...> generator expression.
0fa7f69 Add API to check if we're reading a includes or defines property.
2c3654c Add a way to exclude INTERFACE properties from exported targets.
d4297d5 Export targets to a targets file, not a Config file.
df4d2b2 Make it an error for INSTALL_PREFIX to be evaluated.
7ceeba9 Advance more when preprocessing exported strings.
30268b4 Handle reading empty properties defined by the link interface.
2013-02-05 14:46:43 -05:00
Brad King 020525845a Merge topic 'add-ExternalData-module'
5484c60 Merge branch 'vs6-rule-files' into add-ExternalData-module
1fd8d01 ExternalData: Attach download rules to content links in IDEs
a6d3ffc Fix Module.ExternalData test on VS 6
aed590a Fix Module.ExternalData test on Cygwin
06e8ded Merge branch 'fix-atomic-rename-on-Windows' into add-ExternalData-module
e2e0d2e ExternalData: Collapse ../ components in DATA{} paths
ee2abfd ExternalData: Add support for SHA 1 and 2 hash algorithms
aa8b228 ExternalData: Generalize hash algo/ext handling
9e518a8 ExternalData: Allow DATA{} syntax to reference directories
175ed02 ExternalData: Allow ()-groups in series match regex
4befecc ExternalData: Add tests covering interfaces and errors
bcd2580 ExternalData: Improve series matching using an explicit syntax
c0cebcb ExternalData: Remove unused private interface
5275993 ExternalData: Cleanup stray TODO and typo in comments
7bb8344 ExternalData: Do not match directory names when resolving DATA{}
00d801f ExternalData: Remove compatibility with CMake < 2.8.5
...
2013-02-05 14:46:40 -05:00
Brad King a6d3ffcb1f Fix Module.ExternalData test on VS 6
Run the test with the ctest --build-noclean option.  The test
CMakeLists.txt file already uses file(REMOVE_RECURSE) to clean out
downloaded data anyway.  Some file removed by "msdev ... /clean" causes
CMake to re-run in the middle of the build step and file(REMOVE_RECURSE)
wipes out already-generated files.
2013-02-04 15:19:56 -05:00
Brad King aed590a7e0 Fix Module.ExternalData test on Cygwin
In ExternalData_URL_TEMPLATES add a leading slash to the path after
file:// only if the path does not already start with one.
2013-02-04 15:19:49 -05:00
Stephen Kelly e7b579bd01 Test workaround of bad interface include directories from depends. 2013-01-31 17:34:20 +01:00
Stephen Kelly 77cecb778f Add includes and compile definitions with target_link_libraries.
This establishes that linking is used to propagate usage-requirements
between targets in CMake code. The use of the target_link_libraries
command as the API for this is chosen because introducing a new command
would introduce confusion due to multiple commands which differ only in
a subtle way.
2013-01-31 17:34:20 +01:00
Stephen Kelly 0b92602b81 Add the $<LINKED:...> generator expression.
This is both a short form of using a TARGET_DEFINED expression
together with a TARGET_PROPERTY definition, and a way to strip
non-target content from interface properties when exporting.
2013-01-31 17:34:20 +01:00
Stephen Kelly d4297d5697 Export targets to a targets file, not a Config file. 2013-01-31 17:27:06 +01:00
Stephen Kelly df4d2b28b2 Make it an error for INSTALL_PREFIX to be evaluated.
An empty string is not likely going to produce expected results
in any evaluation context. It is replaced by preprocessing
currently.
2013-01-31 17:27:06 +01:00
Brad King 19f3208a06 Tests: Avoid CTestLimitDashJ crash on Borland 5.8 builds
The test added by commit e378ba5f (Add CTestLimitDashJ test, 2012-12-26)
crashes with CTest compiled by Borland 5.8.  There seems to be interaction
among the large number of internal ctest runs.  It is probably related to
the undiscovered underlying issue mentioned in commit 32478069 (CTest:
Prevent creation of unbounded number of tests in ctest, 2012-12-18) when
fixing the symptom covered by the CTestLimitDashJ test.

Add --force-new-ctest-process to avoid the crash.  Further investigation
will still be needed to identify the true problem.
2013-01-31 10:58:16 -05:00
Brad King 118c32f8f2 Merge branch 'xcode-duplicate-flags-13354' into generator-toolset 2013-01-31 09:58:50 -05:00
Brad King cf8645e82d Tests: Run ctest custom commands with VERBATIM 2013-01-31 09:58:05 -05:00
Stephen Kelly 30268b46f8 Handle reading empty properties defined by the link interface.
This was segfaulting before.
2013-01-31 11:18:49 +01:00
Brad King e2e0d2e3c7 ExternalData: Collapse ../ components in DATA{} paths
Relative path components need to be normalized out even if they appear
in the middle of a caller-supplied string.
2013-01-30 14:55:12 -05:00
Brad King ee2abfdc89 ExternalData: Add support for SHA 1 and 2 hash algorithms
Update the Module.ExternalData and RunCMake.ExternalData tests to cover
some of them.
2013-01-30 10:05:07 -05:00
Brad King 9e518a8169 ExternalData: Allow DATA{} syntax to reference directories
Use a trailing slash to reference a directory.  Require that a list
of associated files be specified to select from within the directory.
One may simply use DATA{Dir/,REGEX:.*} to reference all files but
get a directory passed on the command line.
2013-01-30 10:05:07 -05:00
Brad King 175ed02207 ExternalData: Allow ()-groups in series match regex
Refactor use of the ExternalData_SERIES_MATCH value to avoid assuming
that it has no ()-groups that interfere with group indexing.

Extend the Module.ExternalData test to cover this case.
2013-01-30 10:05:07 -05:00
Brad King 4befecc77c ExternalData: Add tests covering interfaces and errors
Add a Module.ExternalData test to verify data retrieval and test
argument DATA{} references.

Add a RunCMake.ExternalData test to verify error handling and automatic
transformation of a raw data to a content link and staged object.
2013-01-30 10:04:54 -05:00
Brad King da2b0245a3 Merge topic 'fix-target-property-commands'
7bf490e Make subclasses responsible for joining content.
f6b16d4 Don't allow targets args in the new target commands.
b3a7e19 Make the Property name protected so that subclasses can use it.
2013-01-30 09:38:52 -05:00
Brad King 2eb7cee117 Merge topic 'fix-TARGET_PROPERTY-extraction'
5daaa5c Fix TARGET_PROPERTY target extractions.
2013-01-29 14:52:34 -05:00
Stephen Kelly 7bf490e9bb Make subclasses responsible for joining content.
This way we can add handling of relative/absolute paths and of
-D in compile definitions.
2013-01-29 19:34:04 +01:00
Stephen Kelly f6b16d4b06 Don't allow targets args in the new target commands. 2013-01-29 18:44:54 +01:00
Stephen Kelly 5daaa5c48d Fix TARGET_PROPERTY target extractions.
We need to make sure we can export targets which have content such
as $<0:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>

That means making not finding a target non-fatal here.
2013-01-29 10:56:09 -05:00
Stephen Kelly 34d1ade048 Add the INSTALL_PREFIX genex. 2013-01-27 09:59:26 +01:00
Brad King 48ab5050de Merge topic 'debug-ProcessorCount'
4d0e2e8 ProcessorCount test: require SystemInformation process to work
e03f83f ProcessorCount test: fix path to cmsysTestsCxx executable
2013-01-25 13:38:17 -05:00
Rolf Eike Beer 4d0e2e81e9 ProcessorCount test: require SystemInformation process to work
Currently this silently fails on some systems. Make sure those things get
noticed so we can fix that.
2013-01-25 00:31:41 +01:00