Commit Graph

680 Commits

Author SHA1 Message Date
Brad King 26d6c095d6 Merge topic 'refactor-cache-api'
ba404938 cmCacheManager: Port consumers to non-iterator API.
f3922a9a Port QtDialog to non-iterator cache API.
3e6a76e4 Port CursesDialog to non-iterator cache API.
9e641567 cmMakefile: Port away from CacheEntry.Initialized.
1e2dbfce cmCacheManager: Add non-iterator-based API.
60a62a91 cmCacheManager: Return a C string from GetValue.
77f2807c cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.
14973054 Add API for cache loading, deleting and saving to the cmake class.
1f2c12eb cmMakefile: Remove cache version accessors.
97c50a8d cmMakefile: Simplify GetDefinitions implementation.
2015-04-09 11:32:36 -04: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
Stephen Kelly 77f2807ce5 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.
Being initialized is a requirement for this method to return something,
and is what differentiates it from using GetIterator with it.GetValue.
2015-04-07 23:25:44 +02:00
Stephen Kelly 14973054a2 Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-07 23:25:39 +02:00
Brad King 3347c5e4f9 Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits.  The
GetCacheEntryValue API returns a pointer to memory freed on return.
It will have to be revised along with the rest of the original topic.
2015-04-07 17:15:04 -04:00
Brad King 1e3843373f cmake: Show in --help how to select VS target platform (#15422)
* Re-order VS generators from newest to oldest.

* Show how to specify a VS generator with a target platform

* Increase the option output indentation to avoid extra wrapping
  with longer generator names.
2015-04-07 16:47:53 -04:00
Stephen Kelly 9410e24a4a 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-06 17:58:55 +02:00
Stephen Kelly 9ada4c0433 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.
Being initialized is a requirement for this method to return something,
and is what differentiates it from using GetIterator with it.GetValue.
2015-04-06 17:58:55 +02:00
Stephen Kelly 1fe7f24c2b Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-06 17:58:55 +02:00
Stephen Kelly 629e948936 cmake: Clear member rather than explicit erase. 2015-04-05 10:26:10 +02:00
Stephen Kelly d280bae98f cmake: Be clear that there is no chaining after global properties. 2015-04-05 10:26:09 +02:00
Stephen Kelly 47acfe1d1e cmake: Remove unused member. 2015-04-05 10:10:00 +02:00
Stanislav Ionascu f85db2f323 Qbs: Add new 'extra' generator for qbs project files 2015-03-20 10:25:11 -04:00
Stephen Kelly 7916d7bac6 Include cmAlgorithms where it is used. 2015-03-11 00:17:29 +01:00
Gregor Jasny ce935ebe50 cmake: Teach --build to honor CMAKE_VERBOSE_MAKEFILE for Ninja
The Ninja build system does not support a in-file verbositiy switch.
Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE
setting and pass it as an optional '-v' argument to Ninja.  This can
serve as a reasonable fallback.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-02-26 09:51:11 -05:00
Brad King cbffbf7437 Merge topic 'cmStandardIncludes-cleanup'
af65da0a cmStandardIncludes: Remove list include.
e848cc50 cmStandardIncludes: Remove deque include.
5fea6898 cmStandardIncludes: Remove some VS6 workarounds.
2015-02-10 12:56:08 -05:00
Stephen Kelly af65da0aa9 cmStandardIncludes: Remove list include.
Include it only where used.
2015-02-06 19:04:53 +01:00
Stephen Kelly 683fafea08 Replace a loop with std::transform. 2015-02-06 19:04:09 +01:00
Jean-Christophe Fillion-Robin 6cc0f6b512 cmake: Display "loading initial cache" message on stdout
This message has been on stderr since the "-C" option was first added,
but it is informational and not an error.  Other informational messages
go to stdout, so send this one there too.
2015-01-26 09:44:44 -05:00
Stephen Kelly fd0c036c0c Replace 'foo.length() >= 1' pattern with !foo.empty() 2015-01-18 14:25:25 +01:00
Stephen Kelly f09fde2d21 Replace 'foo.length() > 0' pattern with !foo.empty(). 2015-01-18 14:25:25 +01:00
Stephen Kelly fd7b371293 Replace foo.size() pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly 930bd47816 Replace 'foo.size() == 0' pattern with foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly d92887efab Replace 'foo.size() > 0' pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly 4a6e795b0c Use the cmDeleteAll algorithm instead of trivial raw loops. 2015-01-13 23:00:17 +01:00
Brad King dd6c596c12 Merge topic 'join-algorithm'
55a73e6b Use the cmJoin algorithm where possible.
8dc8d756 cmStandardIncludes: Add a join algorithm for string containers.
b5813cee cmInstallCommand: Remove unused variable.
2015-01-12 09:41:02 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Stephen Kelly 55a73e6b1f Use the cmJoin algorithm where possible. 2015-01-08 22:28:18 +01:00
Stephen Kelly 5eb4d7590e Remove some unneeded c_str calls. 2014-11-23 11:09:54 +01:00
Brad King e943fa8a19 Merge topic 'vs14-is-2015'
f5afb90d VS: Rename VS 14 generator to 'Visual Studio 14 2015'
2014-11-17 09:40:51 -05:00
Brad King f5afb90d7c VS: Rename VS 14 generator to 'Visual Studio 14 2015'
Now that we know the year component of this VS version we
can add it to the generator name.  For convenience, map
the name without the year to the name with the year.
2014-11-14 14:23:36 -05:00
Brad King 210230e216 Merge topic 'remove-borland-build'
2db55ffa Remove borland workarounds.
2014-10-21 15:08:03 -04:00
Stephen Kelly 2db55ffa56 Remove borland workarounds.
CMake 3.0 is the last release to require to be able to build with
Borland.
2014-10-15 23:16:44 +02:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Brad King eb7d815649 cmake: Add -A option to specify a generator platform
Define the 'cmake -A' option to set CMAKE_GENERATOR_PLATFORM
without having to spell out the whole variable name.  We choose
the name '-A' for "platform" because '-P' is already taken, and
in the common use case the "platform" is actually an architecture
(e.g. x64).

Teach the RunCMake test infrastructure to use -A to pass the generator
platform.  Extend the RunCMake.GeneratorPlatform test with a case to
verify that the -A option cannot be repeated.
2014-09-15 10:26:59 -04:00
Brad King 0f1f1271e6 CMake: Add CMAKE_GENERATOR_PLATFORM option
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_PLATFORM and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorPlatform test to cover basic use cases for the
option.  Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and
that it is rejected when the generator does not support a user setting.
2014-09-05 14:38:05 -04:00
Brad King 30983ebec1 cmGlobalGenerator: Take Build output argument by reference
No call sites pass NULL to the output argument, so take it by
reference to avoid the if(output) conditions.  Propagate the
change through the TryCompile APIs that call it.
2014-07-31 12:49:51 -04:00
Brad King f5c0efdbe4 cmGlobalGenerator: Create a non-virtual 'DoGenerate' method
Make the virtual 'Generate' method protected.  Make 'DoGenerate'
the main entry point to generation.  This gives cmGlobalGenerator
a chance to do some early operations before the individual
generator-specific implementations take over.
2014-07-22 15:05:36 -04:00
Brad King 65624c39e3 VS14: Add Visual Studio 14 generator (#14982)
Call the generator "Visual Studio 14" without any year because this
version of VS does not provide a year in the product name.

Copy cmGlobalVisualStudio12Generator to cmGlobalVisualStudio14Generator
and update version numbers accordingly.  Add the VS14 enumeration value.
Teach the platform module Windows-MSVC to set MSVC14 and document the
variable.  Teach module InstallRequiredSystemLibraries to look for the VS
14 runtime libraries.

Teach tests CheckCompilerRelatedVariables, VSExternalInclude, and
RunCMake.GeneratorToolset to treat VS 14 as they do VS 10, 11, and 12.

Co-Author: Pawel Stopinski <diokhan@go2.pl>
2014-06-25 14:51:19 -04:00
Brad King 23ffb72ab3 cmake: Fix read-after-free while checking command-line arguments
Since commit v2.8.12~300^2~1 (CLI: Suppress the unused warning if the
key value pair is cached, 2013-05-16), cmake::SetCacheArgs saves a
cachedValue pointer and may cause the memory to be freed (by setting the
cache entry) before reading it again.  Fix this by saving the old value
in a separate string.
2014-06-12 11:24:17 -04:00
Ben Boeckel 2a1b2d8486 backtrace: Convert to local paths in IssueMessage
This is the only place we care show the FilePath to the user, so defer
the expensive relative path calculation until here.
2014-06-05 12:44:19 -04:00
Ben Boeckel efc205695d cmake: remove dummy backtraces for IssueMessage 2014-06-05 12:44:17 -04:00
Brad King 528e8af19f Allow a toolchain file to specify a generator toolset
Delay use of CMAKE_GENERATOR_TOOLSET until the CMakeSystem.cmake
file has been configured and loaded during the first project() or
enable_language() command.  This gives the toolchain file named by
CMAKE_TOOLCHAIN_FILE a chance to set CMAKE_GENERATOR_TOOLSET.  This
point is still early enough to set the generator toolset prior to
the initialization of any languages that might use the toolset.

The cmake::GeneratorToolset member variable remains an indication
of what was specified by the -T option or loaded from the cache.
It does not need to be updated based on the toolchain file setting.
The cmMakefile::TryCompile can still pass cmake::GeneratorToolset
into the inner instance because the try-compiled project will do
platform and language initialization using the CMakeSystem module
configured for the outer project.

Extend the RunCMake.GeneratorToolset test with cases that use a
toolchain file to set CMAKE_GENERATOR_TOOLSET.
2014-06-04 14:27:02 -04:00
Brad King 99d6fa0aa1 Merge topic 'fix-build-crash-on-bad-generator'
44e2923f cmake: Fix --build crash on bad CMAKE_GENERATOR in cache
2014-06-04 09:18:46 -04:00
Brad King 44e2923f33 cmake: Fix --build crash on bad CMAKE_GENERATOR in cache
If we fail to create the generator named by CMAKE_GENERATOR, exit
with an error message instead of crashing.  While at it, fix the
wording of the error message when CMAKE_GENERATOR is not set.

Extend the RunCMake.CommandLine test with cases covering the
"cmake --build" option when the named directory does not provide
a CMakeCache.txt with a valid CMAKE_GENERATOR.
2014-06-03 11:52:19 -04:00
Brad King 8df4d03d99 Merge topic 'cpack-properties'
d0b1d2a6 CPackWiX: Implement CPACK_NEVER_OVERWRITE and CPACK_PERMANENT properties
15a8af21 Add an "installed file" property scope
2014-05-28 12:34:36 -04:00
Brad King af34639724 Merge topic 'fix-cache-self-assignment'
1cd37527 cmCacheManager: Avoid cache entry self-assignment
326d15a3 cmake: Tolerate missing HELPSTRING on compiler change
2014-05-28 12:34:30 -04:00
Nils Gladitz 15a8af21e8 Add an "installed file" property scope
Teach set_property and get_property an "INSTALL" property type to be
associated with install-tree file paths.  Make the properties available
to CPack for use during packaging.  Add a "prop_inst" Sphinx domain
object type for documentation of such properties.
2014-05-28 12:28:18 -04:00
Brad King 326d15a329 cmake: Tolerate missing HELPSTRING on compiler change
Teach cmake::HandleDeleteCacheVariables to tolerate a missing HELPSTRING
(NULL pointer) when saving cache entries.  In the absence of other bugs
this should not be possible, but avoid the crash just in case.
2014-05-27 16:11:04 -04:00
Stephen Kelly e0890d03a4 Features: Extend concept to C language.
Add properties and variables corresponding to CXX equivalents.

Add features for c_function_prototypes (C90), c_restrict (C99),
c_variadic_macros (C99) and c_static_assert (C11). This feature
set can be extended later.

Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader
to conditionally represent the c_restrict feature.
2014-05-15 00:15:18 +02:00