Commit Graph

13720 Commits

Author SHA1 Message Date
Stephen Kelly bf5ece51c3 Keep track of properties used to determine linker libraries.
Those properties can't later be implicitly defined by the interface
of those link libraries.
2013-01-08 20:38:16 +01:00
Brad King a9f1bf4380 Merge topic 'LINK_LIBRARIES-property'
7653862 Add LINK_LIBRARIES property for direct target link dependencies
40cf3fb Make linking APIs aware of 'head' target
2013-01-08 14:32:41 -05:00
Brad King e41d4951b3 Merge topic 'update-kwsys'
6f6afbd Merge branch 'upstream-kwsys' into update-kwsys
495fa24 KWSys 2013-01-07 (fc60c8b8)
2013-01-08 14:32:37 -05:00
Brad King 6095e9fda6 Merge topic 'include-dirs-convenience'
9ce1b9e Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.
2013-01-08 14:32:28 -05:00
Brad King 9549ac1df5 Merge topic 'vs11-external-object'
b684b39 VS11: Simplify external object file handling (#13831)
2013-01-08 14:32:17 -05:00
Brad King af770bc27e Merge topic 'deprecate-load_command'
09a0da7 Revert "load_command: Deprecate and document pending removal"
2013-01-08 14:31:57 -05:00
Stephen Kelly 9ce1b9ef29 Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.
This makes

 set(CMAKE_BUILD_INTERFACE_INCLUDES ON)

add the equivalent of

 set_property(TARGET tgt APPEND PROPERTY
   INTERFACE_INCLUDE_DIRECTORIES
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}>
 )

to every target.

If the headers are in CMAKE_CURRENT_SOURCE_DIR, and the generated headers
are in CMAKE_CURRENT_BINARY_DIR, this is a convenient way to build a target
bar, which depends on foo, just by using target_link_libraries() and adding
the INTERFACE_INCLUDE_DIRECTORIES to the INCLUDE_DIRECTORIES of the target
being linked. There will be more-convenient porcelain API to consume the
property in the future.
2013-01-08 14:14:27 -05:00
Stephen Kelly 7653862798 Add LINK_LIBRARIES property for direct target link dependencies
Previously we kept direct link dependencies in OriginalLinkLibraries.
The property exposes the information in the CMake language through the
get/set_property commands.  We preserve the OriginalLinkLibraries value
internally to support old APIs like that for CMP0003's OLD behavior, but
the property is now authoritative.  This follows up from commit d5cf644a
(Split link information processing into two steps, 2012-11-01).

This will be used later to populate the link interface properties when
exporting targets, and will later allow use of generator expressions
when linking to libraries with target_link_libraries.

Also make targets depend on the (config-specific) union of dependencies.
CMake now allows linking to dependencies or not depending on the config.
However, generated build systems are not all capable of processing
config-specific dependencies, so the targets depend on the union of
dependencies for all configs.
2013-01-08 09:02:43 -05:00
Stephen Kelly 40cf3fb95b Make linking APIs aware of 'head' target
The 'head' is the dependent target to be linked with the current target.
It will be used to evaluate generator expressions with proper handling
of mapped configurations and is used as the source target of properties.

This requires that memoization is done with a key of a pair of target
and config, instead of just config, because now the result also depends
on the target.  Removing the memoization entirely is not an option
because it slows cmake down considerably.
2013-01-08 08:53:25 -05:00
Brad King 6f6afbd69f Merge branch 'upstream-kwsys' into update-kwsys 2013-01-08 08:42:58 -05:00
Kitware Robot 97758f2920 CMake Nightly Date Stamp 2013-01-08 00:01:19 -05:00
Brad King c2cde7f104 Merge topic 'osx-implicit-link-dirs'
cc676c3 OS X: Detect implicit linker framework search paths
2dd67c7 OS X: Detect implicit link directories on modern toolchains
ba58d0c OS X: Link with all framework search paths, not just the last
2013-01-07 14:23:04 -05:00
Brad King db925e3532 Merge topic 'interface-includes-defines'
894f52f Handle INTERFACE properties transitively for includes and defines.
f5b1980 Populate the ExportedTargets member early in GenerateMainFile
c67b812 Make cycles in target properties ignored, not an error.
d0f950f Use mapped config properties to evaluate $<CONFIG>
26def17 Make all relevant targets available in the genex context.
0c657dc Add API to populate INTERFACE properties in exported targets.
e04f737 Add API to extract target names from a genex string.
b0c8f73 Add the TARGET_NAME generator expression.
77475fe Allow generator expressions to require literals.
b2f1700 GenEx: Add expressions to specify build- or install-only values
2013-01-07 14:20:13 -05:00
Brad King b5ab3f0707 Merge topic 'ninja-codeblocks-gui'
76c4430 Ninja: fix building from Codeblocks GUI
2013-01-07 14:20:04 -05:00
Brad King bb68d60571 Merge topic 'doc-Xcode-obj-lib-workaround'
51988a4 add_library: Document object library portability suggestion
2013-01-07 14:19:57 -05:00
Brad King 34f959e5b1 Merge topic 'fix-genex-with-no-target'
e767ffc Don't crash when a target is expected but is not available.
2013-01-07 14:19:47 -05:00
Brad King b684b39581 VS11: Simplify external object file handling (#13831)
Since commit 9a6ff950 (Fix for bug where VS2010 did not use .obj files as
part of the build, 2011-04-01) and commit b291d9e7 (VS10: Fix external
objects generated outside target, 2012-03-19) we try to detect whether an
external object file is also a custom command output in the same target.
This is because VS10 includes .obj custom command outputs on the link line
by default.

VS 11 supports a "<LinkObjects ...>false</LinkObjects>" setting in custom
command rules to tell VS not to link the outputs.  From the VS help:

 Specify whether the Inputs and output files with specific extensions (.obj,
 .lib, .res, .rsc) are passed to the linker.

Treat all external object files the same and add "<Object>" settings for them.
2013-01-07 11:42:53 -05:00
Brad King 09a0da7789 Revert "load_command: Deprecate and document pending removal"
This reverts commit d2d43986e7.
We will add a policy to remove the command more gracefully.
2013-01-07 10:31:07 -05:00
Kitware Robot c7550d5ef1 CMake Nightly Date Stamp 2013-01-07 00:01:16 -05:00
Kitware Robot 427ef82498 CMake Nightly Date Stamp 2013-01-06 00:01:29 -05:00
Peter Kümmel 76c4430971 Ninja: fix building from Codeblocks GUI
Many thx to Chuck Frayman

BUG: 13652
2013-01-05 08:29:58 +01:00
Kitware Robot 0c1f291a27 CMake Nightly Date Stamp 2013-01-05 00:01:14 -05:00
Stephen Kelly 894f52f32d Handle INTERFACE properties transitively for includes and defines.
Contextually, the behavior is as if the properties content from another
target is included in the string and then the result is evaluated.
2013-01-05 01:18:37 +01:00
Stephen Kelly f5b1980fb2 Populate the ExportedTargets member early in GenerateMainFile
The member variable is checked to determine whether to call
HandleMissingTarget(). As that could be called during the loop in
the comming commits, ensure that it contains all targets being
exported.
2013-01-05 01:18:37 +01:00
Stephen Kelly c67b8124f7 Make cycles in target properties ignored, not an error.
Constructs such as these are an error as they are direct self-references:

 set_property(TARGET foo APPEND PROPERTY
   INCLUDE_DIRECTORIES $<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>)
 set_property(TARGET foo APPEND PROPERTY
   INCLUDE_DIRECTORIES $<TARGET_PROPERTY:INCLUDE_DIRECTORIES>)

However, this is an indirect self-reference in a cycle, and not an error:

 set_property(TARGET foo APPEND PROPERTY
   INCLUDE_DIRECTORIES $<TARGET_PROPERTY:bar,INCLUDE_DIRECTORIES>)
 set_property(TARGET bar APPEND PROPERTY
   INCLUDE_DIRECTORIES $<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>)
2013-01-05 01:18:36 +01:00
Stephen Kelly d0f950fdba Use mapped config properties to evaluate $<CONFIG> 2013-01-05 01:18:36 +01:00
Stephen Kelly 26def1771d Make all relevant targets available in the genex context.
The current node being evaluated transitively in the generator
expression must be available to resolve mapped configs.
2013-01-05 01:18:36 +01:00
Stephen Kelly 0c657dc637 Add API to populate INTERFACE properties in exported targets.
The INTERFACE properties need to be preprocessed for context (build
location or install location) and to extract target names etc.
2013-01-05 01:18:36 +01:00
Stephen Kelly e04f737c7a Add API to extract target names from a genex string.
The TARGET_NAME expression, which requires a literal, provides
target names. $<TARGET_PROPERTY:tgt,prop> also provides target
names in the cases where tgt is a literal, so that TARGET_NAME is
not needed then in addition.
2013-01-05 01:18:36 +01:00
Stephen Kelly b0c8f73eb6 Add the TARGET_NAME generator expression.
It will be used as a preprocessing marker.
2013-01-05 01:05:09 +01:00
Stephen Kelly 77475fe61d Allow generator expressions to require literals. 2013-01-05 01:05:09 +01:00
Stephen Kelly b2f1700bc7 GenEx: Add expressions to specify build- or install-only values
This is for specifying INCLUDE_DIRECTORIES relevant to the build-location
or the install location for example:

 set_property(TARGET foo PROPERTY
   INTERFACE_INCLUDE_DIRECTORIES
   "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
   "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>"
 )

A 'bar' target can then use:

 set_property(TARGET bar PROPERTY
   INCLUDE_DIRECTORIES
   "$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>"
 )

and it will work whether foo is in the same project, or an imported target
from an installation location, or an imported target from a build location
generated by the export() command.

Because the generator expressions are only evaluated at build-time, these
new expressions are equivalent to the ZeroNode and OneNode.

The GeneratorExpression test is split into parts. Some shells can't run
the custom command as it is getting too long.
2013-01-05 01:05:08 +01:00
Brad King 51988a4f91 add_library: Document object library portability suggestion
Xcode and VS <= 7.1 will not build targets that have no source files
besides $<TARGET_OBJECTS:...>.  Suggest in the documentation that
projects always add at least one real source file.
2013-01-04 09:38:22 -05:00
Kitware Robot 95b74cafed CMake Nightly Date Stamp 2013-01-04 00:01:13 -05:00
Stephen Kelly e767ffcda5 Don't crash when a target is expected but is not available. 2013-01-03 20:56:32 +01:00
Brad King 1a25113959 Merge topic 'fix-13789-wix-ui-enhancements'
3793dca CPack: WIX Product Icon, UI Banner, UI Dialog support (#13789)
2013-01-03 13:53:24 -05:00
Brad King 9f8975a1a9 Merge topic 'include-dirs-debugging'
0941d62 Add a way to print the origins of used include directories.
18a3195 Keep track of INCLUDE_DIRECTORIES as a vector of structs.
76ea420 Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions
2013-01-03 13:53:21 -05:00
Brad King e2969c503b Merge topic 'fix-12904-avoid-overflow'
e378ba5 Add CTestLimitDashJ test (#12904)
3247806 CTest: Prevent creation of unbounded number of tests in ctest (#12904)
2013-01-03 13:53:18 -05:00
Brad King de53c4c695 Merge topic 'iface-depends'
3096202 Make targets depend on the link interface of their dependees.
2013-01-03 13:53:15 -05:00
Brad King 690d6baece Merge topic 'genex-cleanup'
7d736af Replace some 'if' with 'else if'
2013-01-03 13:53:11 -05:00
Brad King 60cf243fc1 Merge topic 'update-kwsys'
81c0be4 Merge branch 'upstream-kwsys' into update-kwsys
567e7d9 KWSys 2012-12-21 (8ce09af5)
2c24ca9 Remove references to KWSys Process Win9x support
e33fa5b Merge branch 'upstream-kwsys' into update-kwsys
a0f91f1 KWSys 2012-12-19 (933eb822)
2013-01-03 13:53:08 -05:00
Brad King 3475f51f57 Merge topic 'fix-undef-warnings'
310455c Fix some warnings from -Wundef
2013-01-03 13:53:05 -05:00
Stephen Kelly 0941d6232a Add a way to print the origins of used include directories. 2013-01-03 13:45:40 -05:00
Stephen Kelly 18a3195ad5 Keep track of INCLUDE_DIRECTORIES as a vector of structs.
The struct can keep track of where the include came from, which gives
us proper backtraces.
2013-01-03 13:45:40 -05:00
Stephen Kelly 3096202932 Make targets depend on the link interface of their dependees. 2013-01-03 13:31:50 -05:00
Kitware Robot 510c9cfe03 CMake Nightly Date Stamp 2013-01-03 00:01:17 -05:00
Kitware Robot 953043e679 CMake Nightly Date Stamp 2013-01-02 00:01:16 -05:00
Kitware Robot 74be149bb3 CMake Nightly Date Stamp 2013-01-01 00:01:05 -05:00
Kitware Robot 34a8c82378 CMake Nightly Date Stamp 2012-12-31 00:01:17 -05:00
Kitware Robot 2716d8976f CMake Nightly Date Stamp 2012-12-30 00:01:07 -05:00