Commit Graph

63 Commits

Author SHA1 Message Date
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Brad King f154475b65 cmTarget: Refactor GetLocation API
When given a non-NULL configuration the GetLocation returned the
location for the given configuration.  When given a NULL configuration
the GetLocation method returned a location with the build-system
placeholder for the configuration name.  Split the latter use case out
into a separate GetLocationForBuild method and update call sites
accordingly.
2014-03-08 13:05:36 -05:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Ben Boeckel ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Ben Boeckel ec97ed7d0c stringapi: Use strings for property names
Property names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Stephen Kelly f9d5b1fd0f Handle Mac OSX source flags for individual files lazily.
The actual list of files will become config dependent in a follow-up
commit.
2014-02-24 16:45:25 +01:00
Stephen Kelly 64d398416a cmGeneratorTarget: Classify sources on demand, not up front.
Implement a Visitor to hold the sequence of source file tests
for populating outputs.  Use VS 6 and 7 workaround from Brad
King for lack of partial template specialization and function
template specialization capabilities.

This will make it possible to use context dependent generator
expressions to determine the sources of a target.
2014-02-24 16:44:51 +01:00
Stephen Kelly d3682d8647 cmGeneratorTarget: Use a method to access the definition file. 2014-02-24 16:43:25 +01:00
Stephen Kelly 21e91350b0 cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.
The callers already skip non-targets, so unify the target search.

Change supporting functions to accept a container of targets instead
of strings where possible.
2014-02-24 16:43:23 +01:00
Stephen Kelly 84e5f5a004 cmTarget: Move SourceFileFlags to cmGeneratorTarget. 2014-02-24 16:43:23 +01:00
Stephen Kelly 9db9c1fc8b cmTarget: Don't try to get sources of an INTERFACE_LIBRARY.
An an assert to ensure this.
2014-02-14 13:53:14 +01:00
Rolf Eike Beer c768e398f9 cmMakefile: make some methods take const std::string& instead of const char*
Most callers already have a std::string, on which they called c_str() to pass it
into these methods, which internally converted it back to std::string. Pass a
std::string directly to these methods now, avoiding all these conversions.
Those methods that only pass in a const char* will get the conversion to
std::string now only once.
2014-01-16 09:28:29 -05:00
Stephen Kelly 8fd0f2a718 cmGeneratorTarget: Hold a const global generator. 2014-01-12 20:18:11 +01:00
Stephen Kelly 531e40b95e cmTarget: Make GetSourceFiles populate an out-vector parameter.
In a future patch, this will also be populated with extra
sources from the linked dependencies.
2014-01-09 19:38:08 +01:00
Stephen Kelly 38de54cf6f cmGeneratorTarget: Add methods to access source file groups.
These methods and others will be able to get a config parameter
later to implement the INTERFACE_SOURCES feature.
2014-01-09 19:38:07 +01:00
Stephen Kelly 590d238914 cmTarget: Handle NO_SYSTEM_FROM_IMPORTED.
This handling was lost in commit faedd2be (cmTarget: Fix system include
annotation propagation., 2014-01-01).
2014-01-08 16:06:41 +01:00
Stephen Kelly faedd2bea9 cmTarget: Fix system include annotation propagation.
Direct users of IMPORTED targets treat INTERFACE_INCLUDE_DIRECTORIES
as SYSTEM, after commit a63fcbcb (Always consider includes from IMPORTED
targets to be SYSTEM., 2013-08-29).  It was intended that transitive
use of an IMPORTED target would have the same behavior, but that
did not work.  The implementation processed only direct dependencies
in cmTarget::FinalizeSystemIncludeDirectories.

Implement transitive evaluation of dependencies by traversing the
link interface of each target in the link implementation.
2014-01-06 17:25:10 +01:00
Stephen Kelly 259bf0918c Make the cmStrictTargetComparison operate on const cmTarget*. 2013-12-04 13:43:30 +01:00
Stephen Kelly a60cd3d3c6 cmGeneratorTarget: Use the output directory to order cmTargets.
The output directory must be unique, but the source directory
of an add_subdirectory call may be re-used.
2013-11-25 21:13:10 +01:00
Stephen Kelly abb13ea565 Order cmGeneratorTargetsType elements deterministically.
Define a custom ordering functor to deterministically and strictly
order the cmTarget* key. Otherwise the order would be dependent on
runtime pointer values, which breaks assumptions of some generators.

The functor orders first by target name, and then by directory. Multiple
global targets may have the same name, such as edit_cache, but their
directory differentiates them.
2013-11-22 15:06:25 +01:00
Stephen Kelly 0f876439e9 cmGeneratorTarget: Make GetIncludeDirectories const. 2013-11-19 18:07:04 +01:00
Stephen Kelly af4c1096f6 cmGeneratorTarget: Make some accessors const. 2013-11-03 22:27:28 +01:00
Brad King 7a616e75b8 Merge topic 'use-generator-target'
07f5788 Move TraceDependencies to cmGeneratorTarget.
fa03777 Do not populate SourceEntries in AddSourceFile.
2013-10-31 09:40:13 -04:00
Stephen Kelly 07f5788385 Move TraceDependencies to cmGeneratorTarget. 2013-10-30 21:29:45 +01:00
Brad King 8a6e82724c Merge topic 'use-generator-target'
638843a Remove the Location member from cmTarget.
90ef1cf Move GenerateTargetManifest to cmGeneratorTarget.
25f1df3 Split CreateGeneratorTargets into two methods.
2013-10-30 14:55:35 -04:00
Nils Gladitz f037b9b726 Generators: don't append sources from utility targets to objectSources 2013-10-28 14:25:28 +01:00
Stephen Kelly 90ef1cfe48 Move GenerateTargetManifest to cmGeneratorTarget. 2013-10-27 20:29:45 +01:00
Stephen Kelly 25f1df3e81 Split CreateGeneratorTargets into two methods.
As the generate-time-related API is moving to cmGeneratorTarget, almost
all of generation code needs to be able to access instances of it.
2013-10-27 20:29:34 +01:00
Stephen Kelly 5e15f39886 Normalize system directories from the interface target property
The input dir being tested is normalized, so ensure that the entries
in the vector are normalized too (eg no trailing slash).
2013-08-29 10:28:52 +02:00
Stephen Kelly 9cf3547e1c Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
Unlike other target properties, this does not have a corresponding
non-INTERFACE variant.

This allows propagation of system attribute on include directories
from link dependents.
2013-07-16 13:44:57 -04:00
Stephen Kelly 83498d4135 Store system include directories in the cmTarget.
Entries from the cmMakefile are processed and maintained similarly
to other include directories. The include_directories(SYSTEM)
signature affects all following targets, and all prior targets
in the same makefile.
2013-07-02 16:40:02 +02:00
Stephen Kelly f1fcbe3fde Add Target API to determine if an include is a system include.
The implementation can be modified later so that system includes
can be determined on a per-target basis.
2013-07-02 16:40:02 +02:00
John Farrier 79ec7868d0 VS: Add Windows Forms Support
Add support to maintain designer functionality for Visual Studio C++
Windows Forms projects.  Also add a test project showing how to use
the CMakeLists.txt file and, when successfully configured, will allow
use of the designer for the included form.
2013-05-16 13:06:44 -04:00
Stephen Kelly 0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -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 76ea420fb9 Use cmsys::auto_ptr to manage cmCompiledGeneratorExpressions
The compiled generator expressions need to outlive the creating
type. For the same reason, store the input string in a std::string.
2012-12-20 12:17:37 +01:00
Stephen Kelly 0bbae6f95f Revert "Move GetLinkInformation to cmGeneratorTarget"
As we can't move all linking related code from cmTarget, it makes
sense to reverse the move in some cases.

This reverts commit 4f5384e75c.
2012-11-21 15:49:37 +01:00
Stephen Kelly d8a59ea4b3 Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
Following from the discussion here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5170
 (Re: Generator expressisons in target properties, 26 Oct 12:10)

we can't split cmTarget API for linking into cmGeneratorTarget. In
the future we will probably also need to move the include and compile
definitions API back to cmTarget so that it can be used by export().
2012-11-21 00:11:54 +01:00
Stephen Kelly 2a6bd96c13 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.
2012-10-17 16:24:14 -04:00
Stephen Kelly 083de7ed35 Process generator expressions in the COMPILE_DEFINITIONS target property. 2012-09-28 08:50:16 -04:00
Stephen Kelly 08cb4fa4c0 Process generator expressions in the INCLUDE_DIRECTORIES property.
This use of generator expressions, like all others to come which operate
on target properties, must initalize the dag checker.
2012-09-28 08:50:10 -04:00
Stephen Kelly b8e61d687a Refactor GetCompileDefinitions a bit.
It is now easier to add generator expressions.
2012-09-21 13:31:12 +02:00
Stephen Kelly 2c2b25b203 Return a std::string from GetCompileDefinitions. 2012-09-21 13:28:54 +02:00
Stephen Kelly 9a160871d0 Convert paths in INCLUDE_DIRECTORIES property to Unix slashes.
Duplicate some of the logic from the include_directories command.
2012-09-21 13:28:54 +02:00
Stephen Kelly 879fd354c1 Revert "Move GenerateTargetManifest to cmGeneratorTarget."
This reverts commit 987e12e2f9.

GenerateTargetManifest is called by the global generator before it
creates the generator targets, so we can't move it to cmGeneratorTarget
yet.
2012-09-20 08:34:30 +02:00
Stephen Kelly c31f3d99f8 Add a wrapper for accessing config-specific compile-definitions. 2012-09-19 15:32:19 +02:00
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Stephen Kelly 9facfd1336 Move GetCreateRuleVariable to cmGeneratorTarget. 2012-09-19 15:31:32 +02:00