Commit Graph

936 Commits

Author SHA1 Message Date
Brad King 5a5ef00106 Merge topic 'clean-up-cmMakefile'
8dc3a67c cmMakefile: Out-of-line the directory methods.
0f3c8cfa cmMakefile: Use method abstraction to access directories.
b288a997 cmMakefile: Rename SetStart* directory API to SetCurrent*.
932d53bc cmMakefile: Remove redundant method duplication.
32b8f03a cmMakefile: Port users of GetStart* methods to new names.
54d6a918 cmMakefile: Rename GetCurrent{Output,Binary}Directory.
55d80d0a cmMakefile: Rename GetCurrent{,Source}Directory.
b23cf06f cmake: Remove redundant start directories.
fcf246ac cmMakefile: Populate Home directories on initialize.
8878bea7 cmake: Initialize Home directories on cmake for find-package mode.
044dc815 Use the Home directories from the cmake class where intended.
d67e8f24 cmake: Fix directory used to find the cache
1ea085d1 cmMakefile: Initialize dir definitions early.
f034bb2f Remove redundant calls to MakeStartDirectoriesCurrent.
3a68c323 cmMakefile: Fix wrong parameter names.
2015-04-21 09:42:07 -04:00
Stephen Kelly 8dc3a67c9c cmMakefile: Out-of-line the directory methods. 2015-04-21 09:41:27 -04:00
Stephen Kelly 0f3c8cfa96 cmMakefile: Use method abstraction to access directories. 2015-04-21 09:41:27 -04:00
Stephen Kelly 8090904198 cmMakefile: Disable copy constructor.
It is no longer necessary to be able to copy it.  Additionally, this
gives us one less reason to copy cmTarget.
2015-04-21 00:26:37 +02:00
Stephen Kelly b288a997e9 cmMakefile: Rename SetStart* directory API to SetCurrent*. 2015-04-21 00:15:20 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +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 b23cf06f86 cmake: Remove redundant start directories.
They are maintained as containing the same content as the 'home'
directories, but they are never read from.

Fix some comments and help strings which confused the two by
name. They actually mean what is called CMAKE_SOURCE_DIR in
cmake code.
2015-04-21 00:12:51 +02:00
Stephen Kelly fcf246acd1 cmMakefile: Populate Home directories on initialize. 2015-04-21 00:12:51 +02:00
Stephen Kelly 1ea085d1b6 cmMakefile: Initialize dir definitions early. 2015-04-21 00:12:51 +02:00
Stephen Kelly 3a68c323ba cmMakefile: Fix wrong parameter names. 2015-04-21 00:12:51 +02:00
Stephen Kelly 05245b4229 cmMakefile: Move some preamble out of the Internal method. 2015-04-18 15:31:18 +02:00
Stephen Kelly 6e23a4bddd cmMakefile: Remove always-null first parameter to ReadListFile. 2015-04-18 15:31:18 +02:00
Stephen Kelly d21ebcb244 cmMakefile: Swap parameters of calls to ReadListFile.
The version with a null first parameter is now equivalent.
2015-04-18 15:31:18 +02:00
Stephen Kelly 95a27267da cmMakefile: Extract conditional code to caller. 2015-04-18 15:31:17 +02:00
Stephen Kelly 7d24854736 cmMakefile: Remove intermediate variable. 2015-04-18 15:31:17 +02:00
Stephen Kelly 9db1595410 cmMakefile: Move condition to the only calling context where it is true.
Call the Internal method with equivalent parameters, passing a null first
argument.

A duplicate path computation exists inside the external_in condition now,
but that is harmless at this point.
2015-04-18 15:31:11 +02:00
Stephen Kelly 5d4480a8c7 cmMakefile: Populate CMAKE_PARENT_LIST_FILE in callers.
Because all external callers of this method pass a null first
parameter, this change has no effect for them.

This also makes it obvious that the CMAKE_PARENT_LIST_FILE is set to
the name of the file being read itself for CMakeLists.txt files,
which may not make any sense.
2015-04-18 15:29:20 +02:00
Stephen Kelly 3a8ac2423e cmMakefile: Collapse nested conditional. 2015-04-18 15:29:19 +02:00
Stephen Kelly 5947d9b031 cmMakefile: Convert filenametoread into a std::string.
Remove other intermediate variables.
2015-04-18 15:29:19 +02:00
Stephen Kelly e2d0e0fbeb cmMakefile: Remove intermediate variable. 2015-04-18 15:29:19 +02:00
Stephen Kelly 3a1ad1713f cmMakefile: Combine duplicate condition. 2015-04-18 15:29:19 +02:00
Stephen Kelly f0dae032ee cmMakefile: Re-order independent statements. 2015-04-18 15:29:19 +02:00
Stephen Kelly 08da874270 cmMakefile: Split a conditional. 2015-04-18 15:29:19 +02:00
Stephen Kelly 3dc4fe02e6 cmMakefile: Re-order independent variable setting. 2015-04-18 15:29:19 +02:00
Stephen Kelly e4f8f1f1b7 cmMakefile: Remove intermediate variable. 2015-04-18 15:29:18 +02:00
Stephen Kelly 2d6121a9a7 cmMakefile: Remove use of intermediate variable. 2015-04-18 15:29:18 +02:00
Stephen Kelly bdd4c5f5ba cmMakefile: Move variable definition above a condition. 2015-04-18 15:29:18 +02:00
Stephen Kelly 524ce89542 cmMakefile: Change condition to its equivalent.
This makes it easier to reason about follow-up commits.
2015-04-18 15:29:18 +02:00
Stephen Kelly 813cd719c4 cmMakefile: Determine the file to read before calling Internal. 2015-04-18 15:29:18 +02:00
Stephen Kelly 5c201f1ee6 cmMakefile: Remove duplication in ReadListFile. 2015-04-18 15:29:18 +02:00
Stephen Kelly 0d9555779d cmMakefile: Delegate ListFile reading to internal method. 2015-04-18 15:29:17 +02:00
Stephen Kelly 846608f267 cmMakefile: Remove useless condition. 2015-04-18 15:29:17 +02:00
Stephen Kelly a2f2aeee2f cmMakefile: Add wrapper for reading listfiles which have an origin.
Such files are delegates from other files, and so they set the
CMAKE_PARENT_LIST_FILE to the originator.  They also may set a
policy scope.
2015-04-18 15:29:17 +02: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
Stephen Kelly 5bb4248a80 cmMakefile: Remove fullPath parameter from ReadListFile.
There is no reason for this to be a responsibility of
ReadListFile.  Additionally, the only user of it already computes
it itself.
2015-04-18 15:29:17 +02:00
Stephen Kelly 5d056c0dd8 Port Global property interaction to cmState. 2015-04-15 11:43:50 -04:00
Stephen Kelly 0076b5d834 cmake: Remove the happy global property scope pattern.
Global properties are already global in scope, so remove the
overload for specifying it and port users of the API.

The call from cmMakefile::GetProperty can be simplified because
the scope is only used during chaining, and there is no further
chaining after processing global properties.
2015-04-15 11:43:50 -04:00
Stephen Kelly 0aec491328 Port cmCommand consumers to cmState. 2015-04-15 11:43:49 -04:00
Stephen Kelly b159bff732 Move property definition to cmState. 2015-04-13 20:13:13 +02:00
Brad King 62c5e6f1a1 Merge topic 'introduce-cmState'
f081c5bd cmState: Move CacheEntryType enum from cmCacheManager.
f71fdf0e cmMakefile: Remove unused CacheManager accessor.
ff7169a0 Port to cmState.
a6b1ad13 Introduce cmState class.
2015-04-13 11:45:02 -04:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Stephen Kelly f71fdf0ec8 cmMakefile: Remove unused CacheManager accessor.
Remove unneeded friend declarations from cmCacheManager.
2015-04-13 11:44:15 -04:00
Stephen Kelly ff7169a03c Port to cmState. 2015-04-13 11:44:15 -04:00
Stephen Kelly a6b1ad1309 Introduce cmState class.
At this point, it is an interface to the cache.  It will be extended
to be a universal interface for access to and manipulation of
configuration-time data (defintions, properties on targets,
directories, source files etc).

This will allow porting all command implementations away
from the cmMakefile and cmTarget classes, and result in something
more-purely related to configuration-time processing of cmake
commands.  That should serve at least the following goals:

 * Split the CMake implementation more definitively into three
   stages: Configuration, computation and generation, and be able to
   implement each optimally for memory access patterns etc.
 * Make better IDE integration possible by making more configuration
   data available.
 * Make it possiblte to use a smaller library than CMakeLib.a in
   cpack and ctest, resulting in smaller executables.
 * Make it possible to run the configure step multiple times in
   the same CMake run (#14539).

Manage its lifetime in the cmake class, and add a convenience accessor
to cmMakefile.
2015-04-13 11:44:14 -04:00
Stephen Kelly ea819b29f8 cmMakefile: Remove unused method. 2015-04-12 23:10:45 +02:00
Stephen Kelly 6ad86c7fc4 cmMakefile: Remove bad comment. 2015-04-12 23:10:45 +02:00
Stephen Kelly fca2b542b4 cmMakefile: Internalize setting of CMakeInstance on Properties. 2015-04-12 23:10:45 +02:00
Stephen Kelly 7bb4e3db06 cmMakefile: Out-of-line Home directory accessors. 2015-04-12 23:10:44 +02:00
Stephen Kelly ba404938a2 cmCacheManager: Port consumers to non-iterator API.
This simplifies reasoning about the follow-up commit which ports
away from cmCacheManager to a class with the same method names.
2015-04-08 18:47:00 +02:00