Commit Graph

584 Commits

Author SHA1 Message Date
Stephen Kelly 6d7abb6326 cmOutputConverter: Extract from cmLocalGenerator.
The Convert methods never belonged to the local generator concept, so
split them out now.  The cmOutputConverter is cheap to construct and
destroy, so it can be instantiated where needed to perform
conversions.  This will allow further decoupling of cmLocalGenerator
from the configure step.

Inherit cmLocalGenerator from cmOutputConverter for the purpose of
source compatibility.
2015-06-06 09:15:55 +02:00
Stephen Kelly 1f4ef39603 cmLocalGenerator: Remove some commented lines of code.
They've been commented out for a decade, which seems long enough.
2015-06-04 19:25:37 +02:00
Brad King 0886880e3b Merge topic 'cmMakefile-Configure'
7657e8b1 cmMakefile: Introduce a local cmMakefile variable.
4e8f242d cmMakefile: Store unconfigured cmMakefiles.
d65e0123 cmMakefile: Implement ConfigureSubDirectory in terms of cmMakefile.
f059ed16 cmMakefile: Move Configure responsibility from cmLocalGenerator.
a653611d cmake: Replace CurrentLocalGenerator concept with CurrentMakefile.
69a038a9 cmMakefile: Refactor directories specified with the subdirs command.
08637970 cmLocalGenerator: ComputeObjectMaxPath just before generating.
27e11c6f Merge Configure state with GeneratingBuildSystem state.
363caa2f cmLocalGenerator: De-virtualize Configure().
2015-06-04 09:13:35 -04:00
Brad King d6fe79f3ab Merge topic 'remove-CMAKE_USE_RELATIVE_PATHS'
6e570f85 cmLocalGenerator: Remove 'optional' parameter from Convert.
3d8c6cd9 cmLocalGenerator: Remove obsolete method.
e44e6bcc Port away from obsolete method.
1335992c Remove CMAKE_USE_RELATIVE_PATHS variable.
2015-06-04 09:13:33 -04:00
Stephen Kelly f059ed165b cmMakefile: Move Configure responsibility from cmLocalGenerator.
The generator should only have a function at generate time.
2015-06-04 09:06:41 -04:00
Stephen Kelly a653611db0 cmake: Replace CurrentLocalGenerator concept with CurrentMakefile. 2015-06-04 09:06:41 -04:00
Stephen Kelly 69a038a9e9 cmMakefile: Refactor directories specified with the subdirs command.
Store the directories on the cmMakefile as explicitly not-configured-yet.
2015-06-04 09:06:41 -04:00
Stephen Kelly 0863797037 cmLocalGenerator: ComputeObjectMaxPath just before generating. 2015-06-04 09:06:41 -04:00
Stephen Kelly 27e11c6fea Merge Configure state with GeneratingBuildSystem state. 2015-06-04 09:06:40 -04:00
Stephen Kelly 6e570f857a cmLocalGenerator: Remove 'optional' parameter from Convert.
Port callers away from it.
2015-06-04 09:06:09 -04:00
Stephen Kelly 3d8c6cd964 cmLocalGenerator: Remove obsolete method. 2015-06-03 11:44:26 -04:00
Stephen Kelly 1335992c8f Remove CMAKE_USE_RELATIVE_PATHS variable.
The test for this variable was removed in commit v2.8.8~330^2~7 (complex:
Remove ancient unused ComplexRelativePaths test, 2011-12-23).

Commit v3.1.0-rc1~425^2~2 (backtrace: Convert to local paths in
IssueMessage, 2014-03-12) appears to have accidentally made some backtraces
print relative paths with the variable because conversions which used to be
done at configure time, before the variable had an effect are now potentially
done at generate time.

The documentation of the variable says not to use it, and the docs are wrong in
that the variable actually applies in per-directory scope.

The read of the variable makes it harder to split conversion methods from
cmLocalGenerator where they don't belong.  Remove it now.
2015-06-03 11:43:31 -04:00
Stephen Kelly cf1233a0ea cmState: Rename GetParent method.
Leave the namespace open for other Parent types.
2015-06-03 01:15:03 +02:00
Brad King c12fc3573b Merge topic 'inject-state-snapshot'
3b880a07 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
e12afe76 cmState: Host some state from the cmGlobalGenerator.
c7b79aa1 cmGlobalGenerator: Require a cmake instance in ctor.
01e1cd5c cmState: Move snapshot creation to the cmake instance.
2015-05-27 09:23:01 -04:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a
cmState::Snapshot.  Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent.  Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.

This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
2015-05-27 09:18:32 -04:00
Stephen Kelly e12afe766e cmState: Host some state from the cmGlobalGenerator. 2015-05-27 09:18:31 -04:00
Brad King 700f1c3b2b Honor visibility properties for all target types (#15556)
The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first
merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property',
2013-06-05) but worked only for shared libraries and executables with
exports.  Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader:
Deprecate add_compiler_export_flags function., 2013-09-02) the
add_compiler_export_flags function was used to add visibility flags to
all targets.

The visibility flags are useful for sources in all target types because
they may be later linked into shared libraries or executables with
exports.  Introduce policy CMP0063 to enable them for all target types
while preserving compatibility with existing projects that do not expect
this.
2015-05-26 09:03:16 -04:00
Stephen Kelly 01e1cd5c1f cmState: Move snapshot creation to the cmake instance.
Don't create a snapshot in Initialize(), but leave the creation
responsibility to the cmake instance instead.  Previously, the
cmState would Initialize() in its constructor, and the cmake instance
would re-Initialize() during Configure().  The end result was the
same and there would be one snapshot present.  However, cmLocalGenerator
also created a snapshot on construction, and that one was used, leaving
the first snapshot unused, and potential for off-by-one errors.

Fix that by making the cmLocalGenerator use the existing snapshot
if it is top-level.  Add a CurrentSnapshot to the cmake instance and
populated it while configuring a directory.  This will eventually
replace the 'current local generator' concept.  Fix the GetParent
implementation to be able to return the first snapshot.
2015-05-24 13:30:24 +02:00
Stephen Kelly e54d2fdf50 Convert: Remove specification of default parameter. 2015-05-20 11:21:10 -04:00
Stephen Kelly 20c2fe4d10 cmLocalGenerator: Get enabled languages from cmState. 2015-05-20 11:21:10 -04:00
Stephen Kelly 7601a7b12d cmLocalGenerator: Implement IsRootMakefile in terms of cmState. 2015-05-20 11:21:09 -04:00
Stephen Kelly 4080ca497e cmLocalGenerator: Inline ReadListFile method. 2015-05-20 11:21:09 -04:00
Brad King 6fbd4cae0d Use cmSystemTools::GetCMakeCommand() to get path to cmake internally
This is much simpler than finding a way to lookup "CMAKE_COMMAND"
everywhere.
2015-05-20 11:20:42 -04:00
Brad King be248ab435 Merge topic 'refactor-cmLocalGenerator'
fa9eb814 cmLocalGenerator: Remove redundant path access.
1933f3d1 cmLocalGenerator: Remove redundant path conversions.
9e4b6cc2 cmState: Store computed relative paths to to current directories.
991f5e49 cmState::Snapshot: Store components for current directories.
57bdc1a2 cmState: Compute and store directory components.
2015-05-19 11:09:39 -04:00
Stephen Kelly 2047144f49 cmLocalGenerator: Remove unused IgnoreLibPrefix. 2015-05-18 20:06:20 +02:00
Stephen Kelly fa9eb814b3 cmLocalGenerator: Remove redundant path access. 2015-05-16 08:12:02 +02:00
Stephen Kelly 1933f3d1a3 cmLocalGenerator: Remove redundant path conversions.
The methods just called store the paths in already-converted form.
2015-05-16 08:12:02 +02:00
Stephen Kelly 9e4b6cc2ce cmState: Store computed relative paths to to current directories. 2015-05-16 08:12:02 +02:00
Stephen Kelly 991f5e4968 cmState::Snapshot: Store components for current directories.
Remove this responsibility from cmLocalGenerator.
2015-05-16 08:12:01 +02:00
Stephen Kelly 57bdc1a2f7 cmState: Compute and store directory components.
There is no need to duplicate these in all cmLocalGenerators.

Rename the symbols according to current conventions.

Add explicit calls to Set{Source,Binary}Directory with empty strings
in order to trigger the population of the components containers with
the current working directory in cmLocalGenerator.  Having
directories set to empty is a special case in CMake, which is relied
on for the `if(CMAKE_BINARY_DIR)` condition at the end of
CMakeDetermineSystem.cmake.
2015-05-16 08:11:33 +02:00
Stephen Kelly ce167b546d cmMakefile: Handle CMP0014 before configuring the generator. 2015-05-14 21:26:13 +02:00
Stephen Kelly 7baef75649 cmLocalGenerator: Assert that there is a parent.
If the CMakeLists.txt file does not exist, there must be a parent.
The case for the top-level of the project is already handled in
cmake::DoPreConfigureChecks.
2015-05-14 21:04:17 +02:00
Stephen Kelly c5059c9000 cmLocalGenerator: Add abstraction to check if top-level.
Move from the cmLocalNinjaGenerator.  Fix the case of the name.
2015-05-14 20:44:55 +02:00
Stephen Kelly b17686d2bb cmGlobalGenerator: Move some flags from cmLocalGenerator.
These flags are global, and so they belong here instead of being
set on each local generator.
2015-05-14 20:36:28 +02:00
Stephen Kelly ed41a8e7b4 cmLocalGenerator: Port loops to cmState::Snapshot.
Make this code less dependent on being part of cmLocalGenerator,
where it doesn't really belong.
2015-05-14 20:36:28 +02:00
Stephen Kelly e7f7c2e208 cmLocalGenerator: Convert two recursive methods to loops. 2015-05-14 20:36:28 +02:00
Stephen Kelly c5cb3a734d cmLocalGenerator: Get project directories from the cmState.
Make this class and cmMakefile less interdependent.
2015-05-14 20:36:28 +02:00
Stephen Kelly 76b598319f cmLocalGenerator: Initialize state before creating cmMakefile.
Access the state from the local generator in the cmMakefile.
2015-05-14 20:36:28 +02:00
Stephen Kelly 34c9ee2ed7 cmLocalGenerator: Require a global generator in the constructor.
Port generator factory methods to pass it.
2015-05-14 20:36:27 +02:00
Stephen Kelly a3139d4b15 cmLocalGenerator: Remove EscapeForShellOldStyle to only caller. 2015-05-14 20:30:09 +02:00
Stephen Kelly de21168612 Port to static cmPolicies API. 2015-05-04 22:32:20 +02:00
Stephen Kelly 86f3cd0f7e cmMakefile: Require the localGenerator in the constructor.
Move the contents of cmMakeile::SetLocalGenerator to the Initialize
method.
2015-04-28 07:50:57 +02:00
Stephen Kelly a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly 55d80d0a85 cmMakefile: Rename GetCurrent{,Source}Directory.
Match the names used in cmake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly fcf246acd1 cmMakefile: Populate Home directories on initialize. 2015-04-21 00:12:51 +02:00
Brad King f438cd3731 Merge topic 'clean-up-ReadListFile'
05245b42 cmMakefile: Move some preamble out of the Internal method.
6e23a4bd cmMakefile: Remove always-null first parameter to ReadListFile.
d21ebcb2 cmMakefile: Swap parameters of calls to ReadListFile.
95a27267 cmMakefile: Extract conditional code to caller.
7d248547 cmMakefile: Remove intermediate variable.
9db15954 cmMakefile: Move condition to the only calling context where it is true.
5d4480a8 cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers.
3a8ac242 cmMakefile: Collapse nested conditional.
5947d9b0 cmMakefile: Convert filenametoread into a std::string.
e2d0e0fb cmMakefile: Remove intermediate variable.
3a1ad171 cmMakefile: Combine duplicate condition.
f0dae032 cmMakefile: Re-order independent statements.
08da8742 cmMakefile: Split a conditional.
3dc4fe02 cmMakefile: Re-order independent variable setting.
e4f8f1f1 cmMakefile: Remove intermediate variable.
2d6121a9 cmMakefile: Remove use of intermediate variable.
...
2015-04-20 14:37:05 -04:00
Brad King 5e0e65c189 Merge topic 'add-GreenHills-MULTI-generator'
66b641f4 Help: Add notes for topic 'add-GreenHills-MULTI-generator'
48004d9d Add a 'Green Hills MULTI' generator on Windows
051d8be1 cmLocalGenerator: Constify some cmTarget and cmGeneratorTarget arguments
2015-04-20 14:02:52 -04:00
Stephen Kelly 68f791cd06 cmMakefile: Add a method for processing buildsystem files.
These are different from other ListFiles in that a project() command is
required if it is top-level.
2015-04-18 15:29:17 +02:00