Commit Graph

20453 Commits

Author SHA1 Message Date
Yves Frederix c610402825 Avoid occasional use-after-free when a variable watch is executed
Re-lookup a variable value when an associated VariableWatch is executed
in cmMakefile::GetDefinition.

This fixes a problem with 'def' sometimes becoming invalid due to memory
reallocation inside an std::vector. In this case, the problem was that
if the call to VariableAccessed actually executed a callback function,
the internal state of the makefile has changed due to the associated
function scope being pushed. This in turn implies that a new
cmDefinitions instance was pushed in cmMakefile::VarTree. As
cmLinkedTree is based on an std::vector, this push can have triggered
reallocation of its internal memory buffer. However, as the value of
'def', which was computed on method entry, actually points to a property
of one of the cmDefinitions instances in cmMakefile::VarTree,
reallocation can invalidate the value of 'def' so that it cannot simply
be returned at the end of the function. The solution implemented here is
to simply lookup the value of 'def' again.
2016-03-23 16:17:36 -04:00
Taylor Braun-Jones ad140c6e1b VS: Put ALL_BUILD in the PREDEFINED_TARGETS_FOLDER 2016-03-23 13:22:15 -04:00
Taylor Braun-Jones f069be0548 VS: Fix default target support for targets nested inside a folder
It's not actually the first target in a `.sln` file that is treated as
the default startup project, but rather the first fully defined target.
2016-03-23 13:22:15 -04:00
Zack Galbreath 06b7f5d2ca CTest: Only apply the secondary test timeout once
This commit fixes a bug in the implementation of the test property
TIMEOUT_AFTER_MATCH.  The new timeout value was being applied
every time a line was output by the test after the match had been
encountered.  Now the new timeout value is only set once.

This commit also improves some output formatting related to this
property.
2016-03-23 12:09:41 -04:00
Brad King 405766757c Merge topic 'use-cmXMLWriter'
51465da1 CPack/IFW: port to cmXMLWriter
754485af cmExtraEclipseCDT4Generator: port to cmXMLWriter
c45671b0 cmGlobalKdevelopGenerator: port to cmXMLWriter
dcdc270e cmExtraCodeLiteGenerator: port to cmXMLWriter
27e09764 cmExtraCodeBlocksGenerator: port to cmXMLWriter
d7407621 cmXMLWriter: add Doctype() method
dd27e313 cmXMLWriter: overload Element() method for empty elements
2016-03-23 11:19:19 -04:00
Daniel Pfeifer 51465da1ec CPack/IFW: port to cmXMLWriter 2016-03-23 11:18:16 -04:00
Daniel Pfeifer 754485afff cmExtraEclipseCDT4Generator: port to cmXMLWriter 2016-03-23 11:18:15 -04:00
Daniel Pfeifer c45671b0f1 cmGlobalKdevelopGenerator: port to cmXMLWriter 2016-03-23 11:18:15 -04:00
Kitware Robot 38caf1bb74 CMake Nightly Date Stamp 2016-03-23 00:01:06 -04:00
Brad King 6201c1a6ce Merge topic 'timeout_after_match'
de7afd29 Help: Add notes for topic 'timeout_after_match'
993e48d0 CTest: Optionally use a secondary test timeout after matching output
2016-03-22 16:09:28 -04:00
Attila Krasznahorkay b1e1aa1e6a Makefile: Optionally scan only source and build trees for dependencies
Add a `CMAKE_DEPENDS_IN_PROJECT_ONLY` variable to activate the behavior.
2016-03-22 16:04:15 -04:00
Zack Galbreath 993e48d045 CTest: Optionally use a secondary test timeout after matching output
Allow a test N seconds to complete after we detect a matching line in
its output.  Activate this behavior with a new TIMEOUT_AFTER_MATCH test
property.
2016-03-22 11:17:55 -04:00
Brad King 41c17c1d2e Merge topic 'ghs-try_compile'
bf3e76d2 GHS: Fix try_compile (#15975)
2016-03-22 11:15:41 -04:00
Brad King 2f9e6551c0 Merge topic 'ninja-directory-targets'
9ead71df Help: Add notes for topic 'ninja-directory-targets'
e9bf8ec8 Ninja: Add test for `$subdir/all` targets
ca575fe9 Ninja: Add `$subdir/all` targets
2016-03-22 11:15:38 -04:00
Davy Durham 78ec046130 VS: Add option to choose the `.sln` startup project (#15578)
Add a `VS_STARTUP_PROJECT` directory property to specify the project
that should be placed first in the `.sln` file so that it will be
selected as the default startup project.

Co-Author: Taylor Braun-Jones <taylor.braunjones@avigilon.com>
2016-03-22 07:57:00 -04:00
Kitware Robot 1449b11e19 CMake Nightly Date Stamp 2016-03-22 00:01:06 -04:00
Geoff Viola bf3e76d214 GHS: Fix try_compile (#15975) 2016-03-21 10:35:01 -04:00
Daniel Pfeifer dcdc270eeb cmExtraCodeLiteGenerator: port to cmXMLWriter 2016-03-21 10:11:53 -04:00
Daniel Pfeifer 27e0976453 cmExtraCodeBlocksGenerator: port to cmXMLWriter 2016-03-21 10:11:53 -04:00
Daniel Pfeifer d740762181 cmXMLWriter: add Doctype() method 2016-03-21 10:11:53 -04:00
Daniel Pfeifer dd27e31351 cmXMLWriter: overload Element() method for empty elements 2016-03-21 10:11:53 -04:00
Brad King cd992170db Merge topic 'cpack-osx-optional-CoreServices'
d84ba668 CPack: Avoid using OS X CoreServices if compiler fails on header (#16021)
2016-03-21 09:39:24 -04:00
Kitware Robot bbab373b00 CMake Nightly Date Stamp 2016-03-21 00:01:04 -04:00
Kitware Robot 33594f20fa CMake Nightly Date Stamp 2016-03-20 00:01:07 -04:00
Kitware Robot a9cb00cd50 CMake Nightly Date Stamp 2016-03-19 00:01:05 -04:00
Brad King d9857c8457 Merge branch 'cpack-osx-optional-CoreServices' into release 2016-03-18 11:15:15 -04:00
Brad King d84ba668d7 CPack: Avoid using OS X CoreServices if compiler fails on header (#16021)
Some compilers on OS X report errors in the CoreServices framework headers.
Check for support of the header ahead of time and compile the relevant code
only when the header is available.
2016-03-18 11:12:51 -04:00
Charles Huet ca575fe935 Ninja: Add `$subdir/all` targets
With the Makefile generator one can use `cd $subdir; make all` to build
all targets associated with a given subdirectory.  This is not possible
to do with the Ninja generator since there is only one `build.ninja`
file at the top of the build tree.  However, we can approximate it by
allowing one to run `ninja $subdir/all` at the top of the tree to build
the targets in the corresponding subdirectory.

Port logic from cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2 to
cmGlobalNinjaGenerator in order to produce equivalent directory-level
targets.
2016-03-18 10:59:01 -04:00
Brad King b7eb7e0f78 Merge topic 'cmake-gui-osx-identifier'
7b990e82 cmake-gui: Populate CFBundleIdentifier in our Info.plist file (#16023)
2016-03-18 09:43:18 -04:00
Brad King 66d146431d Merge topic 'cpack-osx-no-carbon'
c718070c CPack: Avoid requiring Carbon framework on OS X (#16021)
2016-03-18 09:43:15 -04:00
Brad King 9e5f914d86 Merge topic 'vs-remote-directory'
a3bcf2aa VS: Fix WinCE remote debugger tool per-config target name
2016-03-18 09:43:13 -04:00
Kitware Robot 908259084f CMake Nightly Date Stamp 2016-03-18 00:01:06 -04:00
Brad King 1b034123e7 Merge branch 'cmake-gui-osx-identifier' into release 2016-03-17 16:30:00 -04:00
Brad King 7b990e82c5 cmake-gui: Populate CFBundleIdentifier in our Info.plist file (#16023) 2016-03-17 16:07:39 -04:00
Sean McBride c718070c08 CPack: Avoid requiring Carbon framework on OS X (#16021)
In commit v3.5.0-rc1~232^2 (CPackDMG: Add support for multilingual SLAs,
2015-10-19) we added use of the Carbon framework in order to get access
to its APIs to convert Script Manager RegionCode values.  This is not
necessary.  Instead we can use CoreServices.

While at it, replace individual CoreFoundation includes with including
the entire framework, which is the correct way.
2016-03-17 13:53:51 -04:00
Brad King d9fc4dfe3c Merge topic 'use-GetCMakeRoot'
3144857e Avoid depending on CMAKE_ROOT cache entry internally (#16015)
2016-03-17 09:41:32 -04:00
Brad King a3bcf2aa2c VS: Fix WinCE remote debugger tool per-config target name
Fix the DebuggerTool RemoteExecutable value added by commit a22f9967
(VS: Optionally generate remote directory for WinCE projects,
2016-02-15) to account for the configuration when computing the target
name.
2016-03-17 09:37:51 -04:00
Kitware Robot 811e297454 CMake Nightly Date Stamp 2016-03-17 00:01:06 -04:00
Brad King f5eda70690 Merge topic 'vs-remote-directory'
a22f9967 VS: Optionally generate remote directory for WinCE projects
2016-03-16 09:08:01 -04:00
Brad King 3144857e1e Avoid depending on CMAKE_ROOT cache entry internally (#16015)
Use cmSystemTools::GetCMakeRoot() which always knows the location of our
resources.  Do not depend on CMAKE_ROOT because the user could unset it
from the cache.
2016-03-16 09:03:26 -04:00
Kitware Robot 98f3edcec9 CMake Nightly Date Stamp 2016-03-16 00:01:05 -04:00
Andrej Bosik a22f996725 VS: Optionally generate remote directory for WinCE projects
Teach the VS 2008 and 2005 generators to set the `RemoteDirectory`
in `DeploymentTool` and the `RemoteExecutable` in `DebuggerTool`.
Use a `DEPLOYMENT_REMOTE_DIRECTORY` target property to specify the
value.
2016-03-15 14:34:26 -04:00
Kitware Robot 1d4ab06a70 CMake Nightly Date Stamp 2016-03-15 00:01:08 -04:00
Brad King a87253154e Merge topic 'remove-vs7.0-generator'
f47b4f68 Drop Visual Studio 7 generator for VS .NET 2002
2016-03-14 10:37:50 -04:00
Kitware Robot b775ba20c6 CMake Nightly Date Stamp 2016-03-14 00:01:03 -04:00
Kitware Robot 96a19fc324 CMake Nightly Date Stamp 2016-03-13 00:01:03 -05:00
Kitware Robot c374cae510 CMake Nightly Date Stamp 2016-03-12 00:01:05 -05:00
Brad King f47b4f68a9 Drop Visual Studio 7 generator for VS .NET 2002
This generator has been deprecated since CMake 3.3.  Remove it.
2016-03-11 08:53:50 -05:00
Kitware Robot 114b693d49 CMake Nightly Date Stamp 2016-03-11 00:01:04 -05:00
Brad King 2b64dc7cab Merge topic 'update-kwsys'
fd466fe6 Merge branch 'upstream-KWSys' into update-kwsys
cd4fef30 KWSys 2016-03-09 (36d8666f)
2016-03-10 09:16:26 -05:00
Brad King 1ed74b9d22 Merge topic 'remove-vs6-generator'
b42866a3 Drop Visual Studio 6 generator
cd9ba3ec cmLocalVisualStudio7Generator: Fix name of helper function
2016-03-10 09:16:23 -05:00
Brad King 612a8b3bd8 Merge topic 'vs-clang-cl'
491b41dd Help: Add notes for topic 'vs-clang-cl'
ad6d27ac Tests: do not build PrecompiledHeader on Clang/C2
a0f0541f Tests: fix PDBDirectoryAndName on Clang/C2
3541af67 Tests: fix Plugin building on Clang/C2
1902c293 Tests: fix complexOneConfig building on Clang/C2
cab2ec11 Tests: fix Complex building on Clang/C2
ada3736c Tests: fix Module.GenerateExportHeader building on Clang/C2
123b7e13 Tests: fix AliasTarget building on Clang/C2
445d4d4b VS 14: Add flag map for -std= to CppLanguageStandard tag in project files
0a785eb4 Features: Clang has no cxx_decltype_incomplete_return_type in MSVC sim mode
2c2ec488 VS: in Clang/C2 toolset, setup correct compiler settings
37afe00f CMakeDetermineCompilerId: Add detection of clang.exe bundled with VS
2016-03-10 09:16:16 -05:00
Brad King 707b400e74 Merge topic 'xcode-regenerate-on-deleted-files'
111cd679 Xcode: ReRunCMake even if files disappeared (#15992)
2016-03-10 09:16:08 -05:00
Mariusz Pluciński 445d4d4bf4 VS 14: Add flag map for -std= to CppLanguageStandard tag in project files
This is used by the Clang/C2 toolset.
2016-03-10 09:11:40 -05:00
Mariusz Pluciński 2c2ec4883b VS: in Clang/C2 toolset, setup correct compiler settings 2016-03-10 09:11:39 -05:00
Kitware Robot af35bede1a CMake Nightly Date Stamp 2016-03-10 00:01:06 -05:00
Gregor Jasny 111cd67919 Xcode: ReRunCMake even if files disappeared (#15992) 2016-03-09 20:33:01 +01:00
Brad King b42866a34a Drop Visual Studio 6 generator
This generator has been deprecated since CMake 3.3.  Remove it.
Update documentation, modules, and tests to drop content specific
to this generator.
2016-03-09 09:42:18 -05:00
Brad King cd9ba3ec45 cmLocalVisualStudio7Generator: Fix name of helper function
Rename `cmLVS6G_IsFAT` to `cmLVS7G_IsFAT` since it is for the local
VS 7 generator and not VS 6.
2016-03-09 09:42:04 -05:00
Brad King fd466fe657 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-03-09 (36d8666f)
2016-03-09 09:10:55 -05:00
Brad King b19bc31277 Merge topic 'update-kwsys'
ea04ec09 Merge branch 'upstream-KWSys' into update-kwsys
4ba9b473 KWSys 2016-03-08 (6b60c184)
2016-03-09 08:50:06 -05:00
Kitware Robot 6b9dc804ee CMake Nightly Date Stamp 2016-03-09 00:01:06 -05:00
Brad King ea04ec09d8 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-03-08 (6b60c184)
2016-03-08 09:29:23 -05:00
Brad King b369959eb5 CMake 3.5.0 2016-03-08 08:44:49 -05:00
Brad King 7f1c9fae38 Merge topic 'ninja-osx-versions'
9e165a64 Ninja: Add OS X dylib versioning (#14140)
1f2b39c6 cmCommonTargetGenerator: Adopt AppendOSXVerFlag method
2016-03-08 08:39:40 -05:00
Brad King a6e6f93b6c Merge topic 'toolchain-file-project'
72e0dc58 Diagnose recursive project/enable_language without crashing (#15999)
2016-03-08 08:39:37 -05:00
Brad King 79e05af4a3 Merge topic 'vs14-debug-enum-older-toolsets'
3f15665a VS: Fix VS 2015 .vcxproj debug setting for v100 toolset (#15986)
2016-03-08 08:39:32 -05:00
Kitware Robot 1d1b72a20d CMake Nightly Date Stamp 2016-03-08 00:01:09 -05:00
Bruce Stephens 9e165a64ad Ninja: Add OS X dylib versioning (#14140)
Teach the Ninja generator to add the `-current_version` and the
`-compatibility_version` flags based on the VERSION and SOVERSION target
properties just as the Makefile generators do.

Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
2016-03-07 15:03:21 -05:00
Bruce Stephens 1f2b39c6ce cmCommonTargetGenerator: Adopt AppendOSXVerFlag method
Move this method from cmMakefileLibraryTargetGenerator so it can be
re-used for the Ninja generator too.

Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
2016-03-07 14:57:26 -05:00
Brad King 72e0dc58d3 Diagnose recursive project/enable_language without crashing (#15999)
Calling `project()` or `enable_language()` from a toolchain file will
infinitely recurse since those commands load the toolchain file.
Diagnose and reject this case with an error message instead of crashing
when the stack eventually overflows.
2016-03-07 13:52:38 -05:00
Brad King 15a4afe47a Merge branch 'vs14-debug-enum-older-toolsets' into release 2016-03-07 10:09:33 -05:00
Brad King 3aa6fea69c VS: Fix VS 2015 .vcxproj debug setting for older toolsets (#15986)
Since commit v3.4.2~2^2 (VS: Fix VS 2015 .vcxproj file value for
GenerateDebugInformation, 2016-01-08) we generate invalid project
files for the v110 and v120 toolsets.  VS complains:

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(639,9):
    error MSB4030: "Debug" is an invalid value for the "GenerateDebugInformation" parameter of
    the "Link" task. The "GenerateDebugInformation" parameter is of type "System.Boolean".

This reveals that our VS flag map selection should be based on the
toolset instead of the version of VS.  However, that will be a
non-trivial change so for now fix this particular use case by
hard-coding a correction to the flag map.

Reported-by: Gregor Jasny <gjasny@googlemail.com>
2016-03-07 10:09:09 -05:00
Brad King 3f15665a45 VS: Fix VS 2015 .vcxproj debug setting for v100 toolset (#15986) 2016-03-07 10:07:39 -05:00
Brad King 9fcc8ff455 Merge topic 'vs-vcxproj-ConfigurationType'
6122909c VS: Add option to set `ConfigurationType` of a .vcxproj file
2016-03-07 10:02:40 -05:00
Kitware Robot 4debd8beb1 CMake Nightly Date Stamp 2016-03-07 00:01:05 -05:00
Kitware Robot 7cc8262823 CMake Nightly Date Stamp 2016-03-06 00:01:04 -05:00
Kitware Robot 1bf42fa9b9 CMake Nightly Date Stamp 2016-03-05 00:01:04 -05:00
Kitware Robot 831801671c CMake Nightly Date Stamp 2016-03-04 00:01:03 -05:00
Kitware Robot f37f422a7f CMake Nightly Date Stamp 2016-03-03 00:01:05 -05:00
Kitware Robot 8913ccca43 CMake Nightly Date Stamp 2016-03-02 00:01:05 -05:00
Kitware Robot 3cc22dffb7 CMake Nightly Date Stamp 2016-03-01 00:01:04 -05:00
Kitware Robot 26d615ad9f CMake Nightly Date Stamp 2016-02-29 00:01:04 -05:00
Kitware Robot b500c98c91 CMake Nightly Date Stamp 2016-02-28 00:01:03 -05:00
Kitware Robot 499be36a64 CMake Nightly Date Stamp 2016-02-27 00:01:04 -05:00
Fabian Otto 6122909c33 VS: Add option to set `ConfigurationType` of a .vcxproj file
Add a VS_CONFIGURATION_TYPE target property to set this value
explicitly.  This is useful to build a Windows Kernel Mode Driver,
for example.
2016-02-26 10:52:13 -05:00
Brad King 467f83d2e5 Merge topic 'fix_coverage_file_searching'
bc29ed54 CTest: Make coverage file selection more specific.
2016-02-26 10:31:30 -05:00
Brad King 79d4b5bec9 Merge topic 'try_compile-target-type'
7f1bd9fe try_compile: Add option to control type of target
2016-02-26 10:31:28 -05:00
Brad King cc7a1b1941 Merge topic 'file-download-status-hash-mismatch'
6c9586f9 file(DOWNLOAD): Fill STATUS variable on hash mismatch (#15987)
2016-02-26 10:31:24 -05:00
Kitware Robot 9f7a2328ac CMake Nightly Date Stamp 2016-02-26 00:01:05 -05:00
Joseph Snyder bc29ed542b CTest: Make coverage file selection more specific.
When performing some other testing, the globs for Blanket.js and Delphi
code coverage are picking up unintended files.  Change the query for the
Delphi coverage to follow the naming convention, and check the second line
of the found JSON files for certain text before parsing them as coverage files.
2016-02-25 13:01:37 -05:00
Brad King 6c9586f9c7 file(DOWNLOAD): Fill STATUS variable on hash mismatch (#15987)
Although we fail with an error on a hash mismatch, it is not a fatal
error so the script may continue processing.  If the download itself had
no error then report in the STATUS variable that the operation was not
successful due to the hash mismatch.

Suggested-by: Tobias Hieta <tobias@hieta.se>
2016-02-25 11:40:50 -05:00
Brad King f8af218ea1 Merge topic 'vs14-debug-enum-older-toolsets'
dc422d27 VS: Fix VS 2015 .vcxproj debug setting for older toolsets (#15986)
2016-02-25 09:00:27 -05:00
Brad King c842411dc5 Merge topic 'AddNewEclipseVersions'
aff38945 Eclipse: only add C/CXX macros if the language is enabled
6ee6b17e Eclipse: add newer version numbers
2016-02-25 09:00:24 -05:00
Kitware Robot 9b6fdbfb92 CMake Nightly Date Stamp 2016-02-25 00:01:08 -05:00
Alex Neundorf aff38945d6 Eclipse: only add C/CXX macros if the language is enabled
With this patch, the builtin macros and include dirs are only
added to the project file if the C/CXX langauges are really enabled.
I.e. before this patch the CXX-stuff was in the project file as soon
as CXX had been enabled at least once for this build tree.
I.e. disabling CXX later on did not remove the CXX macros etc.
from the project file (related to #15150)

Alex
2016-02-24 22:13:04 +01:00
Brad King dc422d271e VS: Fix VS 2015 .vcxproj debug setting for older toolsets (#15986)
Since commit v3.4.2~2^2 (VS: Fix VS 2015 .vcxproj file value for
GenerateDebugInformation, 2016-01-08) we generate invalid project
files for the v110 and v120 toolsets.  VS complains:

    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(639,9):
    error MSB4030: "Debug" is an invalid value for the "GenerateDebugInformation" parameter of
    the "Link" task. The "GenerateDebugInformation" parameter is of type "System.Boolean".

This reveals that our VS flag map selection should be based on the
toolset instead of the version of VS.  However, that will be a
non-trivial change so for now fix this particular use case by
hard-coding a correction to the flag map.

Reported-by: Gregor Jasny <gjasny@googlemail.com>
2016-02-24 12:29:50 -05:00
Brad King 2039bf40e4 Merge topic 'CodeBlocksParallelFlag'
84ccd4f7 CodeBlocks: generate parallel project files (make -j)
2016-02-24 09:39:25 -05:00
Brad King 99895f85b3 Merge topic 'xcode-refactor-xcodeobject'
b860a925 Xcode: Refactor block writes to allow any level of nesting
2016-02-24 09:39:22 -05:00
Brad King 2186cff370 Merge topic 'xcode-remove-reftype'
572797f9 Xcode: Write refType only for Xcode 1.5
2016-02-24 09:39:20 -05:00
Brad King 0f48312386 Merge topic 'update-kwsys'
d010ba9f Merge branch 'upstream-KWSys' into update-kwsys
a132064b KWSys 2016-02-22 (4847aedd)
2016-02-24 09:39:18 -05:00
Brad King be98577f13 Merge topic 'revert-automoc-src-per-dir'
091b649e Revert "Automoc: Fix support of files with the same name (#12873)"
2016-02-24 09:39:08 -05:00
Robert Goulet b860a92582 Xcode: Refactor block writes to allow any level of nesting
Reviewed-by: Gregor Jasny <gjasny@googlemail.com>
2016-02-24 09:36:54 -05:00
Gregor Jasny 572797f984 Xcode: Write refType only for Xcode 1.5
This field is not expected by newer versions.
2016-02-24 09:35:54 -05:00
Kitware Robot 3dd42fe4eb CMake Nightly Date Stamp 2016-02-24 00:01:05 -05:00
Alex Neundorf 84ccd4f746 CodeBlocks: generate parallel project files (make -j)
This is done the same way as for Eclipse: cmake tries to determine
the number of CPUs, and then adds the respective -jN to the make
invocations in the project file.

Alex
2016-02-23 22:37:44 +01:00
Kitware Robot f389e6d6e2 CMake Nightly Date Stamp 2016-02-23 00:01:05 -05:00
Brad King d010ba9fa7 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-02-22 (4847aedd)
2016-02-22 09:03:40 -05:00
Kitware Robot df246f7c7f CMake Nightly Date Stamp 2016-02-22 00:01:03 -05:00
Kitware Robot 7e32bd945a CMake Nightly Date Stamp 2016-02-21 00:01:03 -05:00
Kitware Robot 6872a4fde0 CMake Nightly Date Stamp 2016-02-20 00:01:05 -05:00
Brad King 7f1bd9fe69 try_compile: Add option to control type of target
Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use
of `add_library(... STATIC ...)` for the generated test project.
This will be useful for cross-compiling toolchains that cannot
link a binary without custom flags or scripts.
2016-02-19 14:07:38 -05:00
Brad King 39a80a1feb Merge topic 'reduce-entropy-consumption'
f23f18ab cmSystemTools: Avoid excess entropy consumption by RandomSeed (#15976)
b13a74b3 cmSystemTools: Remove unused include <fcntl.h>
2016-02-19 09:47:41 -05:00
Brad King c387325d4a Merge topic 'unix-timestamps'
6727270b CMake: Extend TIMESTAMP sub-commands with new unix time format specifier
2016-02-19 09:47:39 -05:00
Brad King 3e3a12a4ab Merge topic 'fix-CPACK_INSTALL_CMAKE_PROJECTS-subdirectory'
26fdd9c3 CPack: Fix CPACK_INSTALL_CMAKE_PROJECTS SubDirectory (4th) option
2016-02-19 09:47:36 -05:00
Cristian Rodríguez f23f18ab68 cmSystemTools: Avoid excess entropy consumption by RandomSeed (#15976)
Read `/dev/urandom` without buffering to avoid taking more than we need.
2016-02-19 09:44:59 -05:00
Brad King b13a74b35b cmSystemTools: Remove unused include <fcntl.h>
We do not seem to need this header anymore, and including it on AIX
causes `#define open open64` which breaks `std::ifstream::open` calls.
2016-02-19 09:44:59 -05:00
Brad King 091b649e19 Revert "Automoc: Fix support of files with the same name (#12873)"
This reverts commit 9beb2744d7.
Our AUTOMOC documentation states that it should be possible to
`#include "moc_foo.cpp"` in `foo.cpp`, and this will not work if
the file is placed in a different directory.  Another solution
will need to be found to the original problem.

Reported-by: Stephen Kelly <steveire@gmail.com>
2016-02-19 08:59:17 -05:00
Kitware Robot 29c266eb56 CMake Nightly Date Stamp 2016-02-19 00:01:05 -05:00
Brad King d203761520 CMake 3.5.0-rc3 2016-02-18 10:41:26 -05:00
Jose-Luis Blanco-Claraco 6727270b75 CMake: Extend TIMESTAMP sub-commands with new unix time format specifier
The new `%s` format specifier is substituted by file()/string()
`TIMESTAMP` sub-commands with the number of seconds since unix-epoch
(1970-01-01 00:00:00 UTC).

Co-Author: Nils Gladitz <nilsgladitz@gmail.com>
2016-02-18 10:30:13 -05:00
Brad King 2321e63734 Merge topic 'fix-static-private-non-target-depends'
87f44b75 Fix export of STATIC library PRIVATE non-target dependencies
2016-02-18 10:08:01 -05:00
Brad King 135a0df525 Merge topic 'automoc-src-per-dir'
9beb2744 Automoc: Fix support of files with the same name (#12873)
2016-02-18 10:07:56 -05:00
Daniel Wirtz 26fdd9c30a CPack: Fix CPACK_INSTALL_CMAKE_PROJECTS SubDirectory (4th) option 2016-02-18 09:37:59 -05:00
Kitware Robot ede2a6ea6b CMake Nightly Date Stamp 2016-02-18 00:01:04 -05:00
Brad King ef10f5259a Merge branch 'fix-static-private-non-target-depends' into release 2016-02-17 14:03:11 -05:00
Brad King 87f44b7525 Fix export of STATIC library PRIVATE non-target dependencies
In commit v3.5.0-rc1~43^2 (Fix export of STATIC library PRIVATE
dependencies with CMP0022 NEW, 2016-01-15) we taught
target_link_libraries to generate `$<LINK_ONLY:$<TARGET_NAME:dep>>` in
INTERFACE_LINK_LIBRARIES instead of `$<LINK_ONLY:dep>` so that `dep` can
be recognized as a target name and updated during export.  However, this
approach does not work when `dep` is just a plain library name and not a
target because `$<TARGET_NAME:...>` requires the name of a reachable
target.

Since we do not know during target_link_libraries whether the name will
correspond to a reachable target or not, we cannot inject the
`$<TARGET_NAME:...>` expression.  Revert this change and solve the
original problem instead by teaching the export logic to recognize and
update target names directly in `$<LINK_ONLY:...>` expressions.

Reported-by: Ben Boeckel <ben.boeckel@kitware.com>
2016-02-17 14:01:11 -05:00
Brad King 445a37fc51 Merge topic 'CodeBlocks-more-compilers'
184da3f4 CodeBlocks: improve support for different compilers
2016-02-17 10:25:26 -05:00
Kitware Robot 4468e083f4 CMake Nightly Date Stamp 2016-02-17 00:01:05 -05:00
Mariusz Pluciński 9beb2744d7 Automoc: Fix support of files with the same name (#12873) 2016-02-16 10:45:19 -05:00
Melven Roehrig-Zoellner 184da3f4f6 CodeBlocks: improve support for different compilers
More elaborate selection of the `compiler` tag in the generated
CodeBlocks project file:

* Fortran language support

* support for several of the predefined compilers recognized by
  CodeBlocks (16.01)
2016-02-16 10:18:38 -05:00
Brad King a64fa04b4b Merge topic 'cmake-gui-reset-generator'
da490e11 cmake-gui: Fix cmState initialization when changing generators (#15959)
2016-02-16 09:52:36 -05:00
Brad King e0a3009cda Merge topic 'fix-cmake_parse_arguments-expansion'
c8c45a2c cmake_parse_arguments: Restore ;-list argument flattening
2016-02-16 09:52:34 -05:00
Brad King c0a0c7d3f2 Merge topic 'ninja-deterministic-gen'
46fa9583 Ninja: Fix non-determinism in generated target dependency order (#15968)
2016-02-16 09:52:25 -05:00
Kitware Robot 28126b8927 CMake Nightly Date Stamp 2016-02-16 00:01:03 -05:00
Kitware Robot f03cb192e9 CMake Nightly Date Stamp 2016-02-15 00:01:04 -05:00
Kitware Robot 7534a4d567 CMake Nightly Date Stamp 2016-02-14 00:01:03 -05:00
Kitware Robot dec7d5c4de CMake Nightly Date Stamp 2016-02-13 00:01:09 -05:00
Brad King 229a5bc903 Merge branch 'fix-cmake_parse_arguments-expansion' into release 2016-02-12 11:25:36 -05:00
Dimitar Yordanov c8c45a2c4e cmake_parse_arguments: Restore ;-list argument flattening
The re-implementation in commit v3.5.0-rc1~116^2~1 (CMakeParseArguments:
replace by native cmake_parse_arguments command, 2015-12-05) introduced
a regression when parsing the ARGN arguments with cmake_parse_arguments.
The original implementation used

    foreach(currentArg ${ARGN})

to iterate over input arguments.  This flattened ;-lists within the
arguments whether they were quoted or not.  Fix our new implementation
to preserve this behavior and add a test case to cover it.

Signed-off-by: Dimitar Yordanov <dimitar.yordanov@sap.com>
Signed-off-by: Matthias Maennich <matthias.maennich@sap.com>
2016-02-12 11:19:40 -05:00
Brad King 2410a20ebb Merge branch 'cmake-gui-reset-generator' into release 2016-02-12 10:22:31 -05:00
Brad King da490e1159 cmake-gui: Fix cmState initialization when changing generators (#15959)
Refactoring in commit v3.3.0-rc1~29^2~1 (cmState: Host some state from
the cmGlobalGenerator, 2015-05-24) moved storage of some generator
traits over to cmState.  However, it accidentally removed initialization
of the values from the cmGlobalGenerator constructor.  This is needed
because generator subclasses update the settings in their constructors.
Since a single cmState instance is shared across multiple build trees by
cmake-gui, initializing the values in its constructor is not enough.
Fix this by restoring the needed initializations to the
cmGlobalGenerator constructor.
2016-02-12 10:21:00 -05:00
Brad King 1c8dadd914 Merge topic 'fix-warnings'
e1ea1df0 cmListFileCache: Fix warning about inconsistent use of class/struct
2016-02-12 09:03:52 -05:00
Brad King 46fa958362 Ninja: Fix non-determinism in generated target dependency order (#15968)
We represent target dependency sets as `set<cmTargetDepend>` which
orders by a `cmGeneratorTarget const*` pointer value.  Therefore the
order of dependencies encountered in AppendTargetDepends is not
predictable.  Sort them by content to make the result deterministic.
2016-02-12 08:51:58 -05:00
Kitware Robot 3fd326695f CMake Nightly Date Stamp 2016-02-12 00:01:04 -05:00
Tobias Hunger e1ea1df07e cmListFileCache: Fix warning about inconsistent use of class/struct
Exposed by Clang trunk.
2016-02-11 13:38:02 -05:00
Brad King 53108f8008 Merge topic 'ninja-deterministic-gen'
59ade844 Ninja: Fix non-determinism in generated build statement order (#15968)
2016-02-11 10:41:18 -05:00
Brad King 59ade844ef Ninja: Fix non-determinism in generated build statement order (#15968)
Generate custom command build statements in the order we encounter
source files specifying them.  Do not depend on pointer values of
internally allocated structures for ordering.
2016-02-11 08:53:37 -05:00
Kitware Robot d83abbf9e3 CMake Nightly Date Stamp 2016-02-11 00:01:04 -05:00
Brad King 8d1b37a2b2 CMake 3.5.0-rc2 2016-02-10 09:23:57 -05:00
Brad King 7540deb185 Merge topic 'curl-pre-7.21.5'
1ea55acf cmCurl: Fix compilation with system curl versions prior to 7.21.5
2016-02-10 08:49:30 -05:00
Kitware Robot 0def7e6e70 CMake Nightly Date Stamp 2016-02-10 00:01:05 -05:00
Brad King b162dd9ea0 Merge branch 'curl-pre-7.21.5' into release 2016-02-09 13:26:50 -05:00
Brad King 1ea55acf8a cmCurl: Fix compilation with system curl versions prior to 7.21.5
This version introduced CURLE_NOT_BUILT_IN which we have used since
commit v3.4.0-rc1~211^2~4 (cmCurl: Tolerate lack of CURLOPT_CAPATH
support, 2015-08-12).  For older versions, just define the name to the
then-unused error code so that we can compile.
2016-02-09 13:24:19 -05:00
Brad King a887c7f1fd Merge topic 'fix-target-lookup-performance-regression'
9b7d5871 Improve internal generator target structure lookup
6cbf6a51 Fix internal target lookup performance regression
2016-02-09 10:10:23 -05:00
Brad King 3b8c0fbfd7 Merge topic 'install-EXCLUDE_FROM_ALL'
586e56d0 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL'
d321c196 Tests: Add cases for install() command EXCLUDE_FROM_ALL option
18ce97c4 install: Add EXCLUDE_FROM_ALL option (#14921)
2016-02-09 10:10:15 -05:00
Brad King e509c0e6d4 Merge topic 'fix-install-EXPORT-crash'
a1ad098d Tests: Avoid OS X 10.5 limitation warning in RunCMake.install test
47460f3e install(EXPORT): Fix crash on target in another directory
e86383e1 Tests: Use newer policy settings in RunCMake.install test
2016-02-09 10:10:09 -05:00
Kitware Robot 41c38ee7cd CMake Nightly Date Stamp 2016-02-09 00:01:05 -05:00
Brad King 0570b4e4ea Merge branch 'fix-target-lookup-performance-regression' into release 2016-02-08 13:23:45 -05:00
Brad King 9b7d5871b8 Improve internal generator target structure lookup
In commit v3.5.0-rc1~272^2~6 (cmGlobalGenerator: Add FindGeneratorTarget
API, 2015-10-25) a lookup was implemented via linear search.  Replace it
with an efficient data structure.

Suggested-by: Stephen Kelly <steveire@gmail.com>
2016-02-08 13:08:11 -05:00
Brad King 6cbf6a5197 Fix internal target lookup performance regression
Refactoring in commit v3.5.0-rc1~272^2~13 (cmGlobalGenerator: Remove
direct storage of targets, 2015-10-25) replaced an efficient data
structure mapping from target name to cmTarget instance with a linear
search.  Lookups through cmGlobalGenerator::FindTarget are done a lot.
Restore the efficient mapping structure with a name indicating its
purpose.

Reported-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2016-02-08 13:08:11 -05:00
Brad King 656bf0da2c Merge branch 'fix-install-EXPORT-crash' into release 2016-02-08 10:46:42 -05:00
Brad King cb409699a4 Merge branch 'fix-Fortran-module-in-subdir' into release 2016-02-08 10:35:30 -05:00
Brad King a7e2021fea Merge topic 'fix-Fortran-module-in-subdir'
c5eb21b6 Fix dependency scanning configuration in subdirectories
2016-02-08 10:33:04 -05:00
Brad King 5643088bb1 Merge topic 'fix-pedantic-warnings'
58a4a771 Make cmLinkInterface:: and cmGeneratorTarget::Multiplicity unsigned ints
2016-02-08 10:32:57 -05:00
Brad King 08e5362004 Merge topic 'error-multiple-targets'
497cad7c cmake: Teach --build to reject multiple --target options
886acd80 Help: Fix reference to `cmake --build` in cmake(1) manual
2016-02-08 10:32:55 -05:00
Kitware Robot ccb2a26095 CMake Nightly Date Stamp 2016-02-08 00:01:05 -05:00
Kitware Robot c8100794b4 CMake Nightly Date Stamp 2016-02-07 00:01:03 -05:00
Kitware Robot d276b6e997 CMake Nightly Date Stamp 2016-02-06 00:01:04 -05:00
Sebastian Schuberth 497cad7c88 cmake: Teach --build to reject multiple --target options
Previously we did not clearly document that `--target` is only supported
to be specified once.  Even worse, specifying it multiple times would
silently ignore any previously specified targets and only build the last
target.

Update the documentation to specify this.  Update the implementation to
reject multiple `--target` options to prevent user errors.
2016-02-05 11:48:16 -05:00
Brad King 47460f3e15 install(EXPORT): Fix crash on target in another directory
Refactoring merged by commit v3.5.0-rc1~299 (Merge topic
'use-generator-target', 2015-10-20) in and around
commit v3.5.0-rc1~299^2~13 (cmExportSet: Store a cmGeneratorTarget,
2015-10-17) changed export sets to delay looking up actual targets and
stores only their names.  However, in InstallCommand::HandleExportMode
we need to lookup targets immediately to check them for
EXPORT_LINK_INTERFACE_LIBRARIES.  The check was accidentally made local
to the current directory, so if an export set contains a target from
another directory the lookup fails and CMake crashes.  Fix the check to
look up the target name globally, and tolerate when no target is found
just in case.

Reported-by: Kelly Thompson <kgt@lanl.gov>
2016-02-05 09:45:16 -05:00
Brad King c5eb21b6d1 Fix dependency scanning configuration in subdirectories
Refactoring in commit v3.5.0-rc1~347^2~2 (Set the current dirs on the
snapshot before creating the cmMakefile) accidentally changed the
source and binary directories configured in `cmake -E cmake_depends`
for use during dependency scanning.  This can cause the wrong directory
information to be loaded.  It also breaks Fortran module dependency
scanning for modules provided by targets in subdirectories that do
not have Fortran_MODULE_DIRECTORY set.

Fix the dependency scanning directory configuration and add a test to
cover the Fortran module case in which the breakage was observed.

Reported-by: Kelly Thompson <kgt@lanl.gov>
2016-02-05 09:26:44 -05:00
Kitware Robot 5ee00b71e9 CMake Nightly Date Stamp 2016-02-05 00:01:04 -05:00
Christoph Grüninger 58a4a77132 Make cmLinkInterface:: and cmGeneratorTarget::Multiplicity unsigned ints 2016-02-04 10:57:02 -05:00
Brad King 7b1fbcc4b0 Merge topic 'list-FILTER-command'
0205f882 list: Add FILTER subcommand (#3986)
2016-02-04 10:53:14 -05:00
Nick Lewis 18ce97c4a2 install: Add EXCLUDE_FROM_ALL option (#14921)
Let us take an example of a project that has some tests in a component
that need to be installed into a dedicated test package.  The user
expectation is that the result could be achieved by typing the
following:

    make
    make tests
    make install
    DESTDIR=/testpkgs make install-tests

However this results in test components in the default installation as
well as the testpkg.

Add an EXCLUDE_FROM_ALL option to the install() command to tell it that
the installation rule should not be included unless its component is
explicitly specified for installation.
2016-02-04 09:16:56 -05:00
Kitware Robot bfd1b3aaba CMake Nightly Date Stamp 2016-02-04 00:01:04 -05:00
Ashley Whetter 0205f882ae list: Add FILTER subcommand (#3986)
Create a `list(FILTER)` command to filter lists by regular expression.
2016-02-03 11:13:17 -05:00
Kitware Robot a58abc69c2 CMake Nightly Date Stamp 2016-02-03 00:01:03 -05:00
Brad King c84dfa7457 Begin post-3.5 development 2016-02-02 08:40:37 -05:00
Brad King 8a8d22cf1e CMake 3.5.0-rc1 version update 2016-02-02 08:37:05 -05:00
Brad King 570e84b44b Merge topic 'remove-stray-semicolon'
ccb2d5c0 cmAlgorithms.h: remove superfluous semicolon after method
2016-02-02 08:33:23 -05:00
Brad King f8e5e5bb03 Merge topic 'fix-CMAKE_MATCH-self-match'
6ffc4323 cmConditionEvaluator: Fix matching of `CMAKE_MATCH_*` values (#15944)
2016-02-02 08:33:20 -05:00
Kitware Robot 6a230df636 CMake Nightly Date Stamp 2016-02-02 00:01:05 -05:00
Christoph Grüninger ccb2d5c07f cmAlgorithms.h: remove superfluous semicolon after method 2016-02-01 10:47:25 -05:00
Brad King c022b6f686 Merge topic 'clarify-add_custom_command-TARGET-scope'
d257d681 add_custom_command: Clarify error when TARGET is out of scope (#15681)
4d53e0a7 Help: Clarify `add_custom_command(TARGET)` scope (#15681)
8c615af4 Help: Clarify policy `CMP0040` documentation (#15681)
63c5808f Help: Clarify scope of `if(TARGET)` expression
a336e438 Help: Improve markup in `if` command documentation
88968265 Help: Improve markup in `get_target_property` documentation
2016-02-01 10:43:51 -05:00
Brad King 6ffc432367 cmConditionEvaluator: Fix matching of `CMAKE_MATCH_*` values (#15944)
While evaluating `if(MATCHES)` we get a `const char*` pointer to the
string to be matched.  On code like

    if(CMAKE_MATCH_COUNT MATCHES "Y")

the string to be matched may be owned by our own result variables.
We must move the value to our own buffer before clearing them.
Otherwise we risk reading freed storage.
2016-02-01 10:05:10 -05:00
Kitware Robot e18d0df5ed CMake Nightly Date Stamp 2016-02-01 00:01:03 -05:00
Kitware Robot 13b4ef24e1 CMake Nightly Date Stamp 2016-01-31 00:01:03 -05:00
Kitware Robot f270404a3d CMake Nightly Date Stamp 2016-01-30 00:01:03 -05:00
Kitware Robot 76a51dfab8 CMake Nightly Date Stamp 2016-01-29 00:01:04 -05:00
Brad King d257d68138 add_custom_command: Clarify error when TARGET is out of scope (#15681)
The add_custom_command(TARGET) signature only works for targets defined
in the current directory.  Clarify this in the error message when the
target exists but was defined elsewhere.

Inspired-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2016-01-28 10:33:26 -05:00
Kitware Robot 5335d27552 CMake Nightly Date Stamp 2016-01-28 00:01:04 -05:00
Kitware Robot 30e294f68f CMake Nightly Date Stamp 2016-01-27 00:01:03 -05:00
Kitware Robot e7eab0ec40 CMake Nightly Date Stamp 2016-01-26 00:01:13 -05:00
Brad King 0586f1798e Merge topic 'vs-win10-sdk'
d7e863c1 VS: Do not fail on Windows 10 with VS 2015 if no SDK is available (#15929)
2016-01-25 09:47:11 -05:00
Kitware Robot b9dadca90b CMake Nightly Date Stamp 2016-01-25 00:01:03 -05:00
Kitware Robot 490483b947 CMake Nightly Date Stamp 2016-01-24 00:01:03 -05:00
Kitware Robot 4a3fa1e8a0 CMake Nightly Date Stamp 2016-01-23 00:01:04 -05:00
Brad King dcf977ea1a Merge topic 'fix-use-generator-target'
7dbfdddf cmExportInstallFileGenerator: Fix crash in FindNamespaces
2016-01-22 09:25:30 -05:00
Kitware Robot f81ccc5753 CMake Nightly Date Stamp 2016-01-22 00:01:03 -05:00
Brad King 3e7794a2e6 Merge topic 'reduce-allocations'
70788e92 Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix.
bd2384f5 Optimize cmMakefile::ExpandVariablesInStringNew.
ad9394f4 Remove temporary allocations in cmMacroHelper::InvokeInitialPass.
f9599ed4 Remove temporary allocations by extending the lifetime of the retval.
275f2a85 Remove temporary allocations when calling cmGeneratorTarget::GetName.
2016-01-21 13:55:53 -05:00
Brad King 563a6c7be0 Merge topic 'cmake-E-time-quoting'
1787269e cmake: Fix `-E time` argument passing to child
2016-01-21 13:55:47 -05:00
Brad King d7e863c1c1 VS: Do not fail on Windows 10 with VS 2015 if no SDK is available (#15929)
Since commit v3.4.0-rc1~5^2~1 (VS: Add support for selecting the Windows
10 SDK, 2015-09-30) the VS 2015 generator requires a Windows 10 SDK to
be available when CMAKE_SYSTEM_VERSION specifies Windows 10 (e.g.  when
building on a Windows 10 host).  Howewver, it is possible to install VS
2015 without any Windows 10 SDK.  Instead of failing with an error
message about the lack of a Windows 10 SDK, simply tolerate this case
and use the default Windows 8.1 SDK.  Since building for Windows Store
still requires the SDK, retain the diagnostic in that case.
2016-01-21 11:50:28 -05:00
Andrey Pokrovskiy 7dbfdddf33 cmExportInstallFileGenerator: Fix crash in FindNamespaces
Refactoring merged by commit 9afbb733ec (Merge topic
'use-generator-target', 2015-10-20) in and around commit 381e7afd
(cmExportSet: Store a cmGeneratorTarget, 2015-10-17) forgot to update
one place in this method.  This leads to a crash in code such as

  add_library(A a.c)
  add_library(B b.c)
  target_link_libraries(B A)
  install(TARGETS B DESTINATION lib EXPORT ExpB)
  install(EXPORT ExpB DESTINATION lib/cmake/test)
  add_executable(C c.c)
  install(TARGETS C DESTINATION bin EXPORT ExpC)

Fix the target name reference to avoid using an unpopulated Target
pointer.
2016-01-21 10:53:30 -05:00
Kitware Robot 750ae8d5a8 CMake Nightly Date Stamp 2016-01-21 00:01:04 -05:00
Milian Wolff 70788e9264 Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix.
When the first argument passed is a std::string, we need to take it
by const&, otherwise we copy the string and trigger a temporary
allocation. This patch removes a few 10k temporary allocations when
running the CMake daemon on the KDevelop build dir.

This hotspot was found with heaptrack.
2016-01-20 21:20:55 +01:00
Milian Wolff bd2384f593 Optimize cmMakefile::ExpandVariablesInStringNew.
We can remove the temporary allocations required for the
default-constructed t_lookup passed into the openstack by refactoring
the code slightly. Furthermore, we use a vector instead of a stack,
since the latter is based on a deque which is not required for a
heap / lifo structure.

This patch removes ~215k allocations.

This hotspot was found with heaptrack.
2016-01-20 21:20:55 +01:00
Milian Wolff ad9394f4fd Remove temporary allocations in cmMacroHelper::InvokeInitialPass.
This code used to convert std::string's to raw C strings only to
put that back into a std::string. This patch thus removes ~70k
temporary allocations when running the CMake daemon on KDevelop.

This hotspot was found with heaptrack.
2016-01-20 21:20:55 +01:00
Milian Wolff f9599ed42f Remove temporary allocations by extending the lifetime of the retval.
See also Herb Sutter's article on the "most important const":
http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/

When running the CMake daemon on the KDevelop build dir, this removes
some hundreds of thousands of temporary allocations.

This hotspot was found with heaptrack.
2016-01-20 21:20:55 +01:00
Milian Wolff 275f2a85b2 Remove temporary allocations when calling cmGeneratorTarget::GetName.
This happens quite often from within comparisons such as in
NamedGeneratorTargetFinder or FindGeneratorTargetImpl. It is the
top hotspot of both, number of allocations as well as number of
temporary allocations - the majority of calls lead to temporary
allocations.

In raw numbers, this patch removes ~1E6 temporary allocations of
1.5E6 temporary allocations in total when running the cmake daemon
on the KDevelop build dir. That is 2/3 of the total.

This hotspot was found with heaptrack.
2016-01-20 21:20:54 +01:00
Brad King 1787269ef3 cmake: Fix `-E time` argument passing to child
Since this command was introduced in 2002 it has incorrectly constructed
the child process command line by concatenating arguments separated by
spaces with no quoting.  Fix this by passing the command argument vector
directly to RunSingleCommand without an intermediate quoting and
re-parsing step.

Reported-by: Andrey Pokrovskiy <wonder.mice@gmail.com>
2016-01-20 08:55:23 -05:00
Brad King d8bced813c Merge topic 'cleanup-RunSingleCommand'
1040e690 cmSystemTools: Teach RunSingleCommand to merge child pipes when possible
ce3b713b cmSystemTools: Simplify RunSingleCommand output string construction
dc039cc0 cmSystemTools: Drop redundant condition in RunSingleCommand
ffa2a8c9 cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purpose
92e9bb21 cmcmd.cxx: Remove unused code in __run_iwyu implementation
fb1526f5 cmake: Change `-E chdir` to pass through stdout/stderr directly
2016-01-20 08:33:41 -05:00
Brad King ae5f30b36a Merge topic 'mfc-utility-targets'
a15e375c Fix MFC setting on utility targets (#15867)
2016-01-20 08:33:38 -05:00
Brad King 184be68580 Merge topic 'cache-parse-error-line-number'
77cd74a3 Print line number of cache parse errors (#11109)
2016-01-20 08:33:35 -05:00
Kitware Robot 15fe480bf0 CMake Nightly Date Stamp 2016-01-20 00:01:12 -05:00
Clinton Stimpson a15e375cdd Fix MFC setting on utility targets (#15867)
Multi-byte MFC is deprecated, and some projects will not compile if MFC is enabled.
2016-01-19 14:04:15 -07:00
Brad King 1040e690c6 cmSystemTools: Teach RunSingleCommand to merge child pipes when possible
Audit the code to make sure there are no callers that use OUTPUT_MERGE
with separate capture strings.  Then change RunSingleCommand to
implement output merging by giving the child process a single pipe for
both its stdout and stderr descriptors.  This will more cleanly merge
the content on atomic write boundaries in the child instead of on
arbitrary buffering boundaries in the parent.
2016-01-19 15:55:05 -05:00
Brad King ce3b713baa cmSystemTools: Simplify RunSingleCommand output string construction
Assign to the result strings instead setting to empty and appending.
The old approach was left from when we directly buffered output in
the strings.
2016-01-19 15:51:00 -05:00
Brad King dc039cc02c cmSystemTools: Drop redundant condition in RunSingleCommand
The output processing loop is already guarded by a condition so we do
not need to repeat the condition inside the loop.
2016-01-19 15:49:48 -05:00
Brad King ffa2a8c967 cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purpose
The OUTPUT_NORMAL value is not really "normal" and has only one caller.
Rename it to OUTPUT_FORWARD to clarify that we are explicitly forwarding
the output.
2016-01-19 15:47:48 -05:00
Brad King 92e9bb2175 cmcmd.cxx: Remove unused code in __run_iwyu implementation
Do not try to capture stderr with OUTPUT_PASSTHROUGH.  RunSingleCommand
will never populate it.
2016-01-19 15:46:15 -05:00
Brad King fb1526f57f cmake: Change `-E chdir` to pass through stdout/stderr directly
Use OUTPUT_PASSTHROUGH instead of OUTPUT_NORMAL in order to avoid
buffering the output just to re-print it.
2016-01-19 15:44:30 -05:00
Ashley Whetter 77cd74a3ea Print line number of cache parse errors (#11109)
Track the line number while parsing `CMakeCache.txt` files and include
it in a parse failure error message.
2016-01-19 10:19:42 -05:00
Brad King 249aac71d0 Merge topic 'export-static-private-depend'
aea1b036 Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW
e5cbec14 Tests: Use CMP0022 NEW behavior in some ExportImport cases
0ca122fc Tests: Isolate policy changes in ExportImport test
2016-01-19 09:35:46 -05:00
Brad King caf4985346 Merge topic 'rpath-preserve-compiler-defined'
3ec92267 install: Do not remove compiler-defined RPATH entries
2016-01-19 09:35:33 -05:00
Kitware Robot 5079cc1243 CMake Nightly Date Stamp 2016-01-19 00:01:07 -05:00
Kitware Robot 03c0303d2e CMake Nightly Date Stamp 2016-01-18 00:01:06 -05:00
Kitware Robot 27410a9c62 CMake Nightly Date Stamp 2016-01-17 00:01:07 -05:00
Kitware Robot 66942a764c CMake Nightly Date Stamp 2016-01-16 00:01:07 -05:00
Lior Goldberg 3ec9226779 install: Do not remove compiler-defined RPATH entries
Some compilers may add their own RPATH entries when invoking the linker.
For example, a GCC installation may contain the following definition in
the specs file:

  *link_libgcc:
  %D -rpath <<some specific rpath in which libstdc++.so can be found>>

In this case binaries may contain RPATH entries that CMake did not add.
When we update the RPATH on installation we must preserve these entries
even if CMake thinks the INSTALL_RPATH value should be empty.

Fix this by always using file(RPATH_CHANGE) and teach it to behave as
file(RPATH_REMOVE) if the actual RPATH in the file is empty after
replacing the build-tree RPATH with the install-tree RPATH.  This will
preserve any compiler-added RPATH value instead of removing it.
2016-01-15 14:53:24 -05:00
Brad King aea1b03617 Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW
The target_link_libraries command records the PRIVATE dependencies of a
STATIC library in INTERFACE_LINK_LIBRARIES as "$<LINK_ONLY:dep>".  This
hides the target name from export namespacing logic inside a generator
expression.  When user-written generator expressions reference a target
name they must put it inside a "$<TARGET_NAME:dep>" expression to allow
the export logic to rename the target.  In the case that the private
dependency is not already a generator expression, target_link_libraries
must use "$<LINK_ONLY:$<TARGET_NAME:dep>>" to allow the export logic to
rename the target.

Reported-by: Tamás Kenéz <tamas.kenez@gmail.com>
2016-01-15 10:18:53 -05:00
Kitware Robot b8d002af1a CMake Nightly Date Stamp 2016-01-15 00:01:07 -05:00
Brad King f3fd50ad4b Merge topic 'report_failed_tests'
a7393cbd ctest_test: Report which tests failed even when QUIET is used
2016-01-14 11:42:26 -05:00
Brad King 9cf6388698 Merge topic 'install-DIRECTORY-genex'
630c8aa8 install: Allow generator expressions in DIRECTORY
2016-01-14 11:42:20 -05:00
Kitware Robot 6be2dedaed CMake Nightly Date Stamp 2016-01-14 00:01:07 -05:00
Zack Galbreath a7393cbd40 ctest_test: Report which tests failed even when QUIET is used
Since commit v3.3.0-rc1~410^2~3 (ctest_test: Add QUIET option,
2015-02-17) if tests fail when QUIET is used one sees:

  The following tests FAILED:

but not the subsequent line(s) indicating which tests failed.
Restore the list of failed tests.
2016-01-13 10:32:24 -05:00
Brad King 05ab4b7c66 Merge topic 'vs-debug-fastlink'
fc5d6592 VS: Map link `/debug:fastlink` flag to VS 2015 IDE property (#15894)
2016-01-13 09:33:21 -05:00
Brad King 59dac28856 Merge topic 'cmake-W-options'
82166701 cmake-gui: Add options to control warning-as-error messages
28f2d750 Add -Werror and -Wno-error command-line options
2016-01-13 09:33:18 -05:00
Brad King ef3202fb98 Merge topic 'update-kwsys'
33cafa68 Merge branch 'upstream-KWSys' into update-kwsys
ffcc235c KWSys 2016-01-11 (bc07fbf7)
2016-01-13 09:33:13 -05:00
Yves Frederix 630c8aa843 install: Allow generator expressions in DIRECTORY
Teach install(DIRECTORY) to support generator expressions in the list
of directories, much like install(FILES) already supports.
2016-01-13 09:02:06 -05:00
Kitware Robot 39b7954d4d CMake Nightly Date Stamp 2016-01-13 00:01:10 -05:00
Michael Scott 821667018c cmake-gui: Add options to control warning-as-error messages
Add new widgets to the warning messages dialog to control treating
warnings as errors.
2016-01-12 14:03:32 -05:00
Michael Scott 28f2d750ed Add -Werror and -Wno-error command-line options
Expand the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and
downgrading warning and error messages. Implement support for these new
formats for the dev and deprecated message types.

Add tests and updated documentation for new options.
2016-01-12 14:02:51 -05:00
Brad King fc5d659229 VS: Map link `/debug:fastlink` flag to VS 2015 IDE property (#15894)
Suggested-by: Thomas Laguzzi <tholag@gmail.com>
2016-01-12 13:59:59 -05:00
Brad King 33cafa68b8 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-01-11 (bc07fbf7)
2016-01-12 10:55:49 -05:00
Brad King ae7398c0a7 Merge topic 'vs-win10-sdk'
a57caf7e VS: Fix Windows 10 SDK version selection (#15831)
ad594de8 cmSystemTools: Add VersionCompareEqual helper
c173e37f VS: Do not select a partial Windows 10 SDK folder (#15831)
2016-01-12 10:53:45 -05:00
Brad King 0355421035 Merge topic 'update-kwsys'
9821924d Merge branch 'upstream-KWSys' into update-kwsys
8e7356a2 KWSys 2016-01-11 (e8bf616e)
2016-01-12 10:23:07 -05:00
Brad King 31a58b438f Merge topic 'vs-global-properties'
af39f115 VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
2016-01-12 10:23:02 -05:00
Brad King b3c10efb08 Merge topic 'vs-link-debug-property'
b3677b35 VS: Map the link `/debug` to its IDE property
c22da7cf VS: Drop unused condition in link debug flag generation
4ca9df8b cmIDEOptions: Add support for case-insensitive flags
2016-01-12 10:22:59 -05:00