Commit Graph

18653 Commits

Author SHA1 Message Date
Stephen Kelly 92cecd9369 cmMakefile: Add automatic scopes to listfile readers. 2015-06-30 23:14:18 +02:00
Stephen Kelly 276c62253e cmMakefile: Move the IncludeScope to where it is used. 2015-06-30 23:14:17 +02:00
Brad King 7e3ac12df4 Merge topic 'enable_language-fail-earlier'
327490e6 enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early
2015-06-30 10:23:31 -04:00
Betsy McPhail f62d301b92 ctest: Optionally avoid starting tests that may exceed a given CPU load
Add a TestLoad setting to CTest that can be set via a new --test-load
command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to
the ctest_test command.  Teach cmCTestMultiProcessHandler to measure
the CPU load and avoid starting tests that may take more than the
spare load currently available.  The expression

 <current_load> + <test_processors> <= <max-load>

must be true to start a new test.

Co-Author: Zack Galbreath <zack.galbreath@kitware.com>
2015-06-30 10:21:37 -04:00
Zack Galbreath 07c550caa2 cmCTestMultiProcessHandler: Refactor RUN_SERIAL implementation
The original implementation of the RUN_SERIAL test property worked by
having such a test consume all available processors.  Instead use an
explicit flag to indicate that a serial test is running.  This avoids
artificially inflating the number of processors a test is expected to
consume.
2015-06-30 10:21:37 -04:00
Brad King 8bf5a80b96 cmSystemTools: Add StringToULong helper
Convert a string to an unsigned integer and reject any extra input.
2015-06-30 10:21:37 -04:00
Kitware Robot 5ff47ea93d CMake Nightly Date Stamp 2015-06-30 00:01:04 -04:00
Brad King 327490e698 enable_language: Allow CMakeDetermine<LANG>Compiler module to fail early
If the module reports a FATAL_ERROR, skip the rest of the steps to
enable the language to avoid unnecessary following error messages.
2015-06-29 16:18:32 -04:00
Kitware Robot ebd5eeb656 CMake Nightly Date Stamp 2015-06-29 00:01:04 -04:00
Kitware Robot e5f991f62f CMake Nightly Date Stamp 2015-06-28 00:01:04 -04:00
Kitware Robot b702415d3a CMake Nightly Date Stamp 2015-06-27 00:01:05 -04:00
Brad King 6c098a4a72 Merge topic 'fix-target_link_libraries-wrong-dir'
30c2e1dd cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
2015-06-26 08:41:16 -04:00
Kitware Robot 086b19aeda CMake Nightly Date Stamp 2015-06-26 00:01:05 -04:00
Brad King 1051c4c810 Merge topic 'export-escaping'
60eb396f Export: Escape exported property values when writing CMake language files
2015-06-25 10:39:21 -04:00
Brad King bd5bf762c8 Merge topic 'cmake-gui-osx-install-command-line'
d2cf92ec cmake-gui: Change --install to use /usr/local/bin by default (#15627)
2015-06-25 10:39:19 -04:00
Brad King 30c2e1dd16 cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext
for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a
target that was defined in another (non-ancestor) directory crashes
because no execution context is left active.  Fix this by getting the
execution context from the actual cmMakefile where the current
target_link_libraries call takes place.  Test this by verifying that
such calls correctly produce an error diagnostic instead of crashing.
2015-06-25 09:14:26 -04:00
Kitware Robot 6de440e201 CMake Nightly Date Stamp 2015-06-25 00:01:04 -04:00
Brad King 60eb396f10 Export: Escape exported property values when writing CMake language files
When writing export files, correctly encode property values that contain
characters special to the CMake language parser.  We must ensure that
they parse correctly when loaded on the consuming side.

Reported-by: Dan Liew <dan@su-root.co.uk>
2015-06-24 09:19:39 -04:00
Brad King d2cf92ec26 cmake-gui: Change --install to use /usr/local/bin by default (#15627)
In commit v3.3.0-rc1~49^2~2 (cmake-gui: Add --install option to add
command-line tools on OS X, 2015-05-19) the option default was set to
/usr/bin because that is where the old command line install dialog
placed the symlinks.  A better default is /usr/local/bin because it is
meant for locally installed software rather than Apple-installed tools.
Also, as of OS X El Capitan, special privileges are required even for
root to modify /usr/bin but not /usr/local/bin.
2015-06-24 08:57:50 -04:00
Kitware Robot 6b5e94baa2 CMake Nightly Date Stamp 2015-06-24 00:01:06 -04:00
Brad King 56e5d4e180 Merge topic 'use-generator-target'
e7714235 Get the local generator from the GeneratorTarget.
5aa556be cmMakefileTargetGenerator: Require cmGeneratorTarget.
bb88668a cmNinjaGenerator: Require cmGeneratorTarget.
a3b210fd cmGeneratorTarget: Require a cmLocalGenerator to construct.
8ec60c67 cmGlobalGenerator: Create GeneratorTargets with a local generator.
dee197fe GHS: Use a cmGeneratorTarget in generator API.
b2b41b83 cmGeneratorTarget: Add accessor for cmLocalGenerator.
2e9333a1 C::B: Get the Makefile from the LocalGenerator, not vice-versa.
2015-06-23 09:08:20 -04:00
Brad King 5ab7dd544e Merge topic 'fix-function-missing-end'
5d85fb4f Fix assertion failure on unmatched function or macro
2015-06-23 09:08:18 -04:00
Brad King bddfe77d12 Merge topic 'qt-autogen-always-run'
2bf22a4b QtAutogen: Add comment explaining why rcc cannot use PRE_BUILD
0e346427 QtAutogen: Always run autogen step even when rcc is enabled (#15608)
2015-06-23 09:08:15 -04:00
Brad King 2bf22a4b90 QtAutogen: Add comment explaining why rcc cannot use PRE_BUILD 2015-06-23 09:05:30 -04:00
Kitware Robot 6ccb534df3 CMake Nightly Date Stamp 2015-06-23 00:01:05 -04:00
Stephen Kelly e77142350d Get the local generator from the GeneratorTarget.
The Makefile should not know the LocalGenerator at all
2015-06-22 13:23:46 -04:00
Stephen Kelly 5aa556be56 cmMakefileTargetGenerator: Require cmGeneratorTarget. 2015-06-22 13:23:45 -04:00
Stephen Kelly bb88668add cmNinjaGenerator: Require cmGeneratorTarget. 2015-06-22 13:23:45 -04:00
Stephen Kelly a3b210fd6c cmGeneratorTarget: Require a cmLocalGenerator to construct. 2015-06-22 13:23:45 -04:00
Stephen Kelly 8ec60c675a cmGlobalGenerator: Create GeneratorTargets with a local generator. 2015-06-22 13:23:45 -04:00
Stephen Kelly dee197fe61 GHS: Use a cmGeneratorTarget in generator API. 2015-06-22 13:23:45 -04:00
Stephen Kelly b2b41b83ff cmGeneratorTarget: Add accessor for cmLocalGenerator. 2015-06-22 13:23:45 -04:00
Stephen Kelly 2e9333a1d0 C::B: Get the Makefile from the LocalGenerator, not vice-versa.
The Makefile is a configure-time concept, and the LocalGenerator
is a generate time concept.  The LocalGenerator should not be available
from the Makefile.
2015-06-22 13:23:42 -04:00
Brad King ec6d6be57d Merge topic 'minor-cleanups'
820986ed cmLocalGenerator: Constify GetIncludeDirectories method.
b3e2e332 QtAutogen: Get the global generator from the Makefile.
61c0113c cmLocalUnixMakefileGenerator3: Remove unused method.
080489b8 cmMakefile: Use member directly instead of through method.
8bfaadfa cmMakefile: Move IsRoot API from cmLocalGenerator.
217c243d cmake: Update the current snapshot when Resetting.
eb05dcd6 cmLocalGenerator: Add IssueMessage method.
cfae7fa4 cmMakefile: Use cmOutputConverter instead of cmLocalGenerator.
ccf7760f cmOutputConverter: Constify API.
2015-06-22 13:00:32 -04:00
Brad King 24a0825585 Merge topic 'clean-up-ReadListFile'
81eb2c58 cmMakefile: Simplify filename handling.
5c837686 cmMakefile: Make the IncludeScope more responsible.
c10ab014 cmMakefile: Move IncludeScope.
3404f8a0 cmMakefile: Move ListFile parsing responsibility out of internal method.
a1858136 cmMakefile: Rename parameter.
ad47e6e5 cmMakefile: Inline ReadListFileInternal into caller.
254be613 cmMakefile: Move resource management into the IncludeScope.
826b6e68 cmMakefile: Move IncludeScope to ReadDependentFile.
e53072d6 cmMakefile: Move IncludeScope instance.
b7166afa cmMakefile: Remove File from IncludeScope.
27f229b9 cmMakefile: Move include scope out of ReadListFileInternal.
9166b49d cmMakefile: Change order of raii scopes.
384a0dba cmMakefile: Simplify condition handling.
5e24ff17 cmMakefile: Split file handling from execution.
d5aaa2b9 cmMakefile: Move check for unused variables.
fff3c6cd cmMakefile: Move a container population.
...
2015-06-22 13:00:30 -04:00
Brad King c7180e822b Merge topic 'clean-up-cmListFileArgument'
782657db cmListFileArgument: Remove FilePath member.
a863c59f cmMakefile: Use GetExecutionFileStack method.
076760a6 cmMakefile: Add filename context to ExpandArguments.
569f4785 cmFunctionCommand: Store the FilePath when creating the prototype.
f971ab04 cmMacroCommand: Store the FilePath when creating the prototype.
2015-06-22 13:00:29 -04:00
Brad King 5d85fb4f40 Fix assertion failure on unmatched function or macro
The fix in commit v3.2.3~3^2 (Fix assertion failure on unmatched foreach
in function, 2015-05-18) broke handling of unmatched non-loop blocks
because it assumed all function blockers removed during error unwinding
were for loops, essentially switching the set of mishandled cases.

The purpose of the loop block push/pop operations is to define a scope
matching the lifetime of the loop function blockers.  Since our function
blockers already have the proper lifetime, simply move the push/pop
operations to their constructor/destructor.

Extend the RunCMake.Syntax test with a case covering this.
2015-06-22 11:41:51 -04:00
Kitware Robot f4144af905 CMake Nightly Date Stamp 2015-06-22 00:01:04 -04:00
Stephen Kelly 820986edff cmLocalGenerator: Constify GetIncludeDirectories method. 2015-06-21 21:14:09 +02:00
Stephen Kelly b3e2e332eb QtAutogen: Get the global generator from the Makefile. 2015-06-21 21:14:08 +02:00
Stephen Kelly 61c0113c13 cmLocalUnixMakefileGenerator3: Remove unused method. 2015-06-21 21:14:07 +02:00
Stephen Kelly 080489b8a9 cmMakefile: Use member directly instead of through method.
This function will not be around much longer anyway.
2015-06-21 21:14:06 +02:00
Stephen Kelly 8bfaadfa39 cmMakefile: Move IsRoot API from cmLocalGenerator. 2015-06-21 21:14:05 +02:00
Stephen Kelly 782657db48 cmListFileArgument: Remove FilePath member.
It is now unused.
2015-06-21 20:57:26 +02:00
Stephen Kelly a863c59f70 cmMakefile: Use GetExecutionFileStack method. 2015-06-21 20:57:25 +02:00
Stephen Kelly 076760a63c cmMakefile: Add filename context to ExpandArguments.
The cmListFileArgument currently stores a FilePath for use in this
method.  The filename is the same as the CMAKE_CURRENT_LIST_FILE,
except if executing a macro or function defined in another file.

Set the context filename when expanding the arguments of macros and
functions using the filename recorded when defining the prototype.
2015-06-21 20:57:25 +02:00
Stephen Kelly 569f478537 cmFunctionCommand: Store the FilePath when creating the prototype. 2015-06-21 20:31:28 +02:00
Stephen Kelly f971ab04cf cmMacroCommand: Store the FilePath when creating the prototype.
Instead of setting it each time the macro is invoked.
2015-06-21 20:31:27 +02:00
Stephen Kelly 217c243db0 cmake: Update the current snapshot when Resetting.
This will matter when definitions are stored in the cmState.
2015-06-21 20:19:53 +02:00
Stephen Kelly eb05dcd6c9 cmLocalGenerator: Add IssueMessage method.
For use at generate-time instead of the cmMakefile method of the same name.
2015-06-21 20:17:59 +02:00
Stephen Kelly cfae7fa408 cmMakefile: Use cmOutputConverter instead of cmLocalGenerator. 2015-06-21 20:17:18 +02:00
Stephen Kelly ccf7760f00 cmOutputConverter: Constify API. 2015-06-21 20:13:28 +02:00
Stephen Kelly 81eb2c58a1 cmMakefile: Simplify filename handling.
This method has only one caller.
2015-06-21 20:10:52 +02:00
Stephen Kelly 5c83768628 cmMakefile: Make the IncludeScope more responsible.
It is now responsible for all resource management when
including a file.
2015-06-21 20:10:52 +02:00
Stephen Kelly c10ab01434 cmMakefile: Move IncludeScope. 2015-06-21 20:10:52 +02:00
Stephen Kelly 3404f8a081 cmMakefile: Move ListFile parsing responsibility out of internal method. 2015-06-21 20:10:51 +02:00
Stephen Kelly a1858136c2 cmMakefile: Rename parameter. 2015-06-21 20:10:51 +02:00
Stephen Kelly ad47e6e5bc cmMakefile: Inline ReadListFileInternal into caller. 2015-06-21 20:10:50 +02:00
Stephen Kelly 254be613b8 cmMakefile: Move resource management into the IncludeScope. 2015-06-21 20:10:50 +02:00
Stephen Kelly 826b6e6818 cmMakefile: Move IncludeScope to ReadDependentFile.
Add replacement simple push/pop in the other two callers of
ReadListFile.
2015-06-21 20:10:50 +02:00
Stephen Kelly e53072d638 cmMakefile: Move IncludeScope instance. 2015-06-21 20:10:49 +02:00
Stephen Kelly b7166afa6d cmMakefile: Remove File from IncludeScope.
Get it from the Makefile instead.
2015-06-21 20:10:49 +02:00
Stephen Kelly 27f229b970 cmMakefile: Move include scope out of ReadListFileInternal.
Simplify the ReadListFileInternal API.
2015-06-21 20:10:48 +02:00
Stephen Kelly 9166b49d70 cmMakefile: Change order of raii scopes. 2015-06-21 20:10:48 +02:00
Stephen Kelly 384a0dba63 cmMakefile: Simplify condition handling. 2015-06-21 20:10:48 +02:00
Stephen Kelly 5e24ff17a2 cmMakefile: Split file handling from execution. 2015-06-21 20:10:47 +02:00
Stephen Kelly d5aaa2b96f cmMakefile: Move check for unused variables. 2015-06-21 20:10:47 +02:00
Stephen Kelly fff3c6cd1c cmMakefile: Move a container population. 2015-06-21 20:10:47 +02:00
Stephen Kelly a6e661b848 cmMakefile: Rename variables. 2015-06-21 20:10:46 +02:00
Stephen Kelly fe38bb2c29 cmMakefile: Change return type of ReadListFileInternal. 2015-06-21 20:10:46 +02:00
Stephen Kelly ac10fc0958 cmMakefile: Move listfile parsing responsibility. 2015-06-21 20:10:45 +02:00
Kitware Robot 155ef53597 CMake Nightly Date Stamp 2015-06-21 00:01:03 -04:00
Kitware Robot 4fa99b9922 CMake Nightly Date Stamp 2015-06-20 00:01:04 -04:00
Brad King 0e346427a2 QtAutogen: Always run autogen step even when rcc is enabled (#15608)
In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input
changes, 2014-09-17) the "cmake -E cmake_autogen" rule was switched from
always running to running as a custom command with dependencies if rcc
is enabled.  This is not correct because automoc always needs to re-run.
Switch back to always running the command.
2015-06-19 10:29:38 -04:00
Kitware Robot 66a2675e2b CMake Nightly Date Stamp 2015-06-19 00:01:07 -04:00
Brad King 9223c6cb12 Merge topic 'update-kwsys'
502430e3 Merge branch 'upstream-kwsys' into update-kwsys
da4cddd7 KWSys 2015-06-15 (d217407c)
2015-06-18 09:05:19 -04:00
Kitware Robot f17e89c004 CMake Nightly Date Stamp 2015-06-18 00:01:04 -04:00
Kitware Robot ee5c40a5f8 CMake Nightly Date Stamp 2015-06-17 00:01:04 -04:00
Brad King ee223dfa91 Merge topic 'fix-windows-preprocessor-checks'
83af11d4 Fix preprocessor checks WIN32 => _WIN32
2015-06-16 10:39:12 -04:00
Brad King e5ed8b22cb Merge topic 'cmake--build-dir'
90ad087a cmake: Fix --build <relative-dir> for VS generators (#15609)
7195ec92 Tests: Extend RunCMake.CommandLine to cover --build with no arg
2015-06-16 10:39:10 -04:00
Brad King 502430e39c Merge branch 'upstream-kwsys' into update-kwsys 2015-06-16 08:49:12 -04:00
Kitware Robot 157396b131 CMake Nightly Date Stamp 2015-06-16 00:01:05 -04:00
Brad King 83af11d411 Fix preprocessor checks WIN32 => _WIN32
The latter is predefined by Windows toolchains and is more reliable.

Reported-by: Michael Stürmer <michael.stuermer@schaeffler.com>
2015-06-15 09:58:29 -04:00
Brad King c1113705d7 Merge topic 'compiler-launcher'
698f7597 Add options to launch the compiler through tools like ccache or distcc
2015-06-15 09:45:28 -04:00
Brad King 919b116f98 Merge topic 'ctest_update-RETURN_VALUE'
493388ce ctest_update: Fix RETURN_VALUE on VCS tool failure (#15610)
bcf25803 Tests: Teach CTest.Update* tests to check ctest_update return code
b6667729 Tests: Simplify CTest.UpdateGIT QUIET mode test
2015-06-15 09:45:27 -04:00
Brad King f8bc48413c Merge topic 'fix-fast-special-targets'
0efe4944 cmGlobalGenerator: Add ComputeHomeRelativeOutputPath method.
bc1211fa cmLocalUnixMakefileGenerator3: Remove unused variable.
2015-06-15 09:45:25 -04:00
Bill Hoffman 698f75971b Add options to launch the compiler through tools like ccache or distcc
Create a <LANG>_COMPILER_LAUNCHER target property (initialized by a
CMAKE_<LANG>_COMPILER_LAUNCHER variable) to specify a compiler launcher
tool.  This will supersede the CMAKE_<LANG>_COMPILER_ARG1 approach to
using such tools.  The old approach set CMAKE_<LANG>_COMPILER to the
launcher tool while the new approach leaves this variable set to the
actual compiler.

Implement this property for Makefile and Ninja generators.  It cannot be
implemented for VS or Xcode generators as the IDE build tools offer no
such hooks.
2015-06-15 09:36:48 -04:00
Kitware Robot 9cbb9ed4c9 CMake Nightly Date Stamp 2015-06-15 00:01:03 -04:00
Kitware Robot 081f6d9172 CMake Nightly Date Stamp 2015-06-14 00:01:04 -04:00
Stephen Kelly 0efe4944e1 cmGlobalGenerator: Add ComputeHomeRelativeOutputPath method.
Fix generation of tgt/fast build targets.

Commit 363caa2f (cmLocalGenerator: De-virtualize Configure().,
2015-05-30) moved the computation of HomeRelativeOutputPath from
Configure-time to Generate-time, because it is only used at
Generate-time.  However, that commit caused the member for one
local generator to be computed immediately before generating with
that local generator, whereas previously the members of all local
generators were computed before generating any of them.

The HomeRelativeOutputPath is used by the GetRelativeTargetDirectory
method, which is called by the
cmGlobalUnixMakefileGenerator3::WriteConvenienceRules method.  That
method is called by the
cmLocalUnixMakefileGenerator3::WriteLocalMakefile method when generating
for the top-most (ie, the first) local generator.  At that point,
the HomeRelativeOutputPath is not yet computed.

Fix that by computing the member just before generating anything.
This will eventually be done in the cmLocalUnixMakefileGenerator3
constructor instead, but further refactoring is needed to make
that possible.
2015-06-13 08:38:27 +02:00
Stephen Kelly bc1211fa7d cmLocalUnixMakefileGenerator3: Remove unused variable. 2015-06-13 08:38:19 +02:00
Kitware Robot 98133d3d4d CMake Nightly Date Stamp 2015-06-13 00:01:05 -04:00
Kitware Robot 03e2248188 CMake Nightly Date Stamp 2015-06-12 00:01:04 -04:00
Brad King 90ad087ab9 cmake: Fix --build <relative-dir> for VS generators (#15609)
The VS >= 10 generators need to parse the .sln file from the build
directory to locate targets in subdirectories.  This occurs after we
change the working directory to the build tree.  If a relative directory
other than "." was given then we would change to it and also refer to
the .sln file location with it.  Fix this by converting the build tree
to a full path always.  This will also give a more informative error
message when the directory does not exist.
2015-06-11 16:04:21 -04:00
Brad King d569008868 Merge topic 'fix-CMP0009-future-states'
a3a8177e cmFileCommand: Fix implementation of CMP0009.
2015-06-11 13:16:19 -04:00
Brad King 71d5245990 Merge topic 'minor-cleanups'
22d09ecf cmLocalGenerator: Remove ConfigureFinalPass.
821a711b project(): Remove unused variable.
2015-06-11 13:16:16 -04:00
Brad King 493388ce48 ctest_update: Fix RETURN_VALUE on VCS tool failure (#15610)
Make RETURN_VALUE report -1 if the update command failed as the
documentation claims.  Also avoid reporting a ctest script-level failure
if the update command fails because we still correctly administered the
update step.
2015-06-11 11:00:48 -04:00
Kitware Robot 07ee7bac74 CMake Nightly Date Stamp 2015-06-11 00:01:03 -04:00
Kitware Robot c9ee5de4af CMake Nightly Date Stamp 2015-06-10 00:01:06 -04:00
Stephen Kelly a3a8177edd cmFileCommand: Fix implementation of CMP0009. 2015-06-10 00:06:29 +02:00