Commit Graph

16462 Commits

Author SHA1 Message Date
Brad King 9f3ed029ce cmTarget: Constify GetTransitivePropertyTargets results
Populate a vector of "cmTarget const*" instead of "cmTarget*".
2014-06-23 09:17:06 -04:00
Brad King 6f0951af01 cmTarget: Drop 'head' target from GetImportInfo
Move generator expression evaluation for imported library lists out of
GetImportInfo and into a new GetImportLinkInterface helper.  This avoids
duplicating the computation and storage of all imported target info just
because some of it is parameterized on the 'head' target.
2014-06-23 09:17:06 -04:00
Brad King 0dc9e88d76 cmTarget: Remove 'head' argument from GetLinkImplementation
Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make
linking APIs aware of 'head' target, 2013-01-04) turned out not to be
needed.  The "link implementation" of a target never needs to be
computed with anything but itself as the 'head' target (except for
CMP0022 OLD behavior because then it is the link interface).

Remove the unused 'head' target paths.  Add "internal" versions of
cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries
to support the CMP0022 OLD behavior without otherwise exposing the
'head' target option of these methods.
2014-06-23 09:17:00 -04:00
Brad King 4ac72455fd cmTarget: Drop 'head' argument from GetLinkClosure
It is only ever passed the 'this' target itself.
2014-06-23 09:14:45 -04:00
Brad King bcdb7ff9df cmTarget: Remove 'head' argument from GetLinkerLanguage
It is only ever called with the 'this' target as the head.

Co-Author: Stephen Kelly <steveire@gmail.com>
2014-06-23 09:14:45 -04:00
Brad King bd9b667bbe cmComputeLinkInformation: Remove 'head' argument
It is only ever constructed with the current target as its own 'head'.

Co-Author: Stephen Kelly <steveire@gmail.com>
2014-06-23 09:14:45 -04:00
Brad King 06328dd58e cmTarget: Remove 'head' argument from GetLinkInformation
No call sites use it anyway.

Co-Author: Stephen Kelly <steveire@gmail.com>
2014-06-23 09:14:45 -04:00
Brad King 56aed7005a cmTarget: Cache GetLinkImplementationClosure results
Store them internally and return by reference to avoid duplicate
computation.
2014-06-23 09:14:44 -04:00
Brad King cbf689c7dd cmTarget: Rename Get{TransitiveTarget => LinkImplementation}Closure
The method computes the transitive closure of targets starting with
the current target link implementation libraries.  Clarify the name.
2014-06-23 09:14:44 -04:00
Brad King 2f0004c143 cmTarget: Remove 'head' argument from GetTransitiveTargetClosure
The method is never called with any headTarget besides "this".
2014-06-23 09:14:44 -04:00
Brad King 962f2c3529 cmComputeLinkDepends: Simplify CheckWrongConfigItem implementation
Combine the outer two if() conditions into a single one with &&.
2014-06-23 09:14:44 -04:00
Brad King e838e0a977 cmTarget: Simplify processILibs implementation
Combine the outer two if() conditions into a single one with &&.
Scope inner lookup result inside its condition.
2014-06-23 09:14:43 -04:00
Brad King 7b85938973 cmComputeTargetDepends: Remove unused 'linking' argument
The AddInterfaceDepends method is never called with a non-true value for
its 'linking' argument.  Drop it.
2014-06-23 08:50:08 -04:00
Brad King 8d15a1bbfb cmTarget: De-duplicate library list expansion
Create an ExpandLinkItems method to handle evaluation of generator
expressions in a library list and expansion of the ;-list into a vector.
Replace some duplicate copies of the implementation with calls to the
new helper.
2014-06-23 08:50:08 -04:00
Brad King 6354df92b1 cmTarget: Remove unused GetInterfaceLinkLibraries method 2014-06-23 08:50:08 -04:00
Kitware Robot 562d5f576a CMake Nightly Date Stamp 2014-06-23 00:01:06 -04:00
Kitware Robot 7c4d890da3 CMake Nightly Date Stamp 2014-06-22 00:01:07 -04:00
Kitware Robot 17d98786ad CMake Nightly Date Stamp 2014-06-21 00:01:06 -04:00
Kitware Robot aaf7071932 CMake Nightly Date Stamp 2014-06-20 00:01:11 -04:00
Kitware Robot e68a009367 CMake Nightly Date Stamp 2014-06-19 00:01:07 -04:00
Kitware Robot 6af77a2f07 CMake Nightly Date Stamp 2014-06-18 00:01:08 -04:00
Clinton Stimpson b6b493a4ed Encoding: Fix debug asserts parsing command line options with non-ascii chars.
With MSVC, isspace() will assert with non-ascii characters.
2014-06-17 09:26:42 -06:00
Kitware Robot 85025ae7c3 CMake Nightly Date Stamp 2014-06-17 00:01:08 -04:00
Brad King 9dc88ee951 Merge topic 'fix-valgrind-in-path'
58cc3c22 Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
2014-06-16 20:24:38 -06:00
Brad King 6b05e03de4 Merge topic 'fix-valgrind-in-path'
58cc3c22 Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
2014-06-16 08:54:50 -04:00
Brad King e2789429aa Merge topic 'features-cleanups'
f0a0f3dc WCDH: Fix compiler id test for compatibility macros.
627ad96b Project: Detect other compilers before detecting Clang.
bc950169 WCDH: Remove noise from generated defines.
eecd93fc Features: Escape the COMPILE_OPTIONS for dialects.
2014-06-16 08:54:48 -04:00
Brad King 0b028c6f0a Merge topic 'ninja-avoid-double-phony'
04377f1b Ninja: Remove CMake includes from explicit depends (#14972)
2014-06-16 08:54:46 -04:00
Brad King 3eb50bbe8c Merge topic 'vs-subdir-sln-depends'
cb67509b VS: Remove unused parameter of WriteTargetConfigurations
790e1677 VS: Fix subproject .sln dependencies on custom targets
5fba44cf VS: Move VS-only API out of cmGlobalGenerator
2014-06-16 08:54:44 -04:00
Brad King 94d1879ba0 Merge topic 'cmake-no-args-output'
de7c2882 cmake,ccmake: Produce shorter output on no arguments (#14973)
2014-06-16 08:54:43 -04:00
Adam Strzelecki 04377f1b31 Ninja: Remove CMake includes from explicit depends (#14972)
It may happen that CMake include is an explicit dependency for some command,
while all CMake includes are set phony in WriteTargetRebuildManifest, this may
lead to duplicate phony generate rules which causes ninja warnings.

We need to remove implicit CMake includes in WriteUnknownExplicitDependencies.

This fixes FindCUDA ninja warnings.
2014-06-16 08:51:38 -04:00
Kitware Robot 8af01cd5e9 CMake Nightly Date Stamp 2014-06-16 00:01:06 -04:00
Kitware Robot 81ff6da63a CMake Nightly Date Stamp 2014-06-15 00:01:06 -04:00
Kitware Robot b1ad4fae8a CMake Nightly Date Stamp 2014-06-14 00:01:14 -04:00
Brad King d7bbfa41f6 Merge topic 'fix-read-after-free'
5b2c2d2f Merge branch 'backport-fix-read-after-free' into fix-read-after-free
23ffb72a cmake: Fix read-after-free while checking command-line arguments
fe44f057 cmake: Fix read-after-free while checking command-line arguments
2014-06-13 15:45:07 -04:00
Brad King 8be1a711b2 Merge topic 'add_jacoco_coverage_parsing'
558c2190 CTest: Add Jacoco Coverage functionality
2014-06-13 15:45:03 -04:00
Brad King f69501dfe2 Merge topic 'setlocale'
c746b00e Encoding:  Change to only set LC_CTYPE to fix encoding issues with libarchive.
2014-06-13 15:44:59 -04:00
Bill Hoffman 58cc3c22ef Fix ctest to allow valgrind to show up in the path name of a memcheck tool.
For testing purposes CMake creates dummy memory checkers.  The dummy checkers
are in the CMake build tree. Before this change when the path contained the
string valgrind, such as CMake-valgrind, all the checkers were thought to
be valgrind, and this caused tests to fail.
2014-06-13 14:42:43 -04:00
Stephen Kelly eecd93fcca Features: Escape the COMPILE_OPTIONS for dialects.
Allow for future handling as a list, not a string which may contain
whitespace.
2014-06-13 18:50:10 +02:00
Brad King cb67509b06 VS: Remove unused parameter of WriteTargetConfigurations
The cmGlobalVisualStudio7Generator::WriteTargetConfigurations
'root' parameter is no longer used, so remove it.
2014-06-13 08:57:34 -04:00
Adam Strzelecki de7c2882ff cmake,ccmake: Produce shorter output on no arguments (#14973)
Instead printing complete help cmake/ccmake now prints only Usage section and
extra information how to get more help or start your build.

Implementation Details:

  Usage help type was renamed to Help, and new Usage was introduces that prints
  only command line usage information without any extra details.

  Commands add some extra information when no arguments are passed.
2014-06-13 08:36:43 -04:00
Kitware Robot ba36363121 CMake Nightly Date Stamp 2014-06-13 00:01:07 -04:00
Brad King bd20dd6b8a Merge topic 'dev/variable-lookup'
e17a69bc cmDefinitions: Use a hashmap for faster checks
3b21705d cmDefinitions: Avoid a find-then-insert when setting variables
5abfde6c cmDefinitions: Don't store parent lookups
2014-06-12 11:28:44 -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
Brad King 790e167718 VS: Fix subproject .sln dependencies on custom targets
Each project listed in a .sln must be marked (or not) as part of the
"default build" for each configuration.  For targets created by the
add_custom_target() command we add them to the default build if they
are not excluded in some way or if another target depends on them.
In the top-level .sln, a custom target is excluded if it is not
created with the ALL option to add_custom_target.  In subdirectory
.sln files, a target may also be excluded if it is not within the
directory and is brought into the solution only due to a dependency
from another target in the solution.

Fix the "IsPartOfDefaultBuild" and "IsDependedOn" methods to check
every target to be included in the .sln for a dependency on the
custom target.  Otherwise transitive dependencies through targets
not in the current subdirectory will not be considered.

Extend the SubProject test with a custom target to cover this case.

Reported-by: William Deurwaarder <William.Deurwaarder@tomtom.com>
Reported-by: Dirk Steenpass <dirk.steenpass@gmail.com>
2014-06-12 11:14:06 -04:00
Joseph Snyder 558c2190e8 CTest: Add Jacoco Coverage functionality
Add the ability to parse the XML output of the Jacoco tool.

Jacoco (www.eclemma.org/jacoco) is a Java coverage tool.
Add and integrate a class for the parser and
include a test which utilizes the new parser.
2014-06-12 10:38:19 -04:00
Brad King 5fba44cf41 VS: Move VS-only API out of cmGlobalGenerator
Move the IsDependedOn method to cmGlobalVisualStudio7Generator
since that is the only caller.
2014-06-12 10:26:35 -04:00
Clinton Stimpson c746b00eee Encoding: Change to only set LC_CTYPE to fix encoding issues with libarchive.
Changing all categories with LC_ALL causes test failures in some locales.
For example, in some locales, the decimal characer could be a comma instead of period.
2014-06-11 22:29:16 -06:00
Kitware Robot b041fc13db CMake Nightly Date Stamp 2014-06-12 00:01:07 -04:00
Kitware Robot fff405fdbf CMake Nightly Date Stamp 2014-06-11 00:01:12 -04:00
Brad King e0471ae2f9 Merge topic 'no-parse-directory'
b1c113d9 cmake: Do not open directories as scripts (#14966)
2014-06-10 09:17:41 -04:00
Brad King 2944bf164e Merge topic 'android-platform'
42f74df6 Add basic Android platform module
2014-06-10 09:17:39 -04:00
Brad King f1b91a8af6 Merge topic 'vs10-refactor'
1edaef39 VS: Factor MS-tool-specific vcxproj settings into helper
808f4b1f VS: Re-order logic to group MS-tool-specific options together
13e6d559 VS: Set some options directly instead of using flag map
8f4bdcc6 VS: Remove always-true condition on compile options block
eaa9f2f8 VS: Refactor internal generator factory logic
2b3e7b6f VS: Fix vcxproj specification of empty output file extension
39af06e7 VS: Fix vcxproj elements specifying binary output locations
ee329d54 VS: Refactor flag table lookup
2014-06-10 09:17:36 -04:00
Brad King 0c73273b1a Merge topic 'dev/static-regex'
1b003c1f cmTarget: Remove an unused variable
7492a7b8 regex: Search on strings where possible
3e7194a2 regex: Use static regexs where possible
2014-06-10 09:17:35 -04:00
Kitware Robot 58f8e6bc5c CMake Nightly Date Stamp 2014-06-10 00:01:20 -04:00
Brad King b1c113d9a7 cmake: Do not open directories as scripts (#14966)
Check if a file path is a directory before opening it.  Extend the
RunCMake.CommandLine test with a case running "cmake -P" on a directory.
2014-06-09 16:21:11 -04:00
Ben Boeckel e17a69bc74 cmDefinitions: Use a hashmap for faster checks
The hash map is much faster at checking that the map won't have what
we're looking for so that we can just go to the parent scope instead.
2014-06-09 14:46:45 -04:00
Ben Boeckel 3b21705d53 cmDefinitions: Avoid a find-then-insert when setting variables
Searching the map is not necessary.
2014-06-09 14:46:45 -04:00
Ben Boeckel 5abfde6cb8 cmDefinitions: Don't store parent lookups
When looking up scopes, it is faster to not store the lookup locally to
keep the maps smaller and avoid extra allocations and rebalancing.
2014-06-09 14:46:45 -04:00
Ben Boeckel 1b003c1f95 cmTarget: Remove an unused variable 2014-06-09 14:45:35 -04:00
Ben Boeckel 7492a7b846 regex: Search on strings where possible 2014-06-09 14:45:35 -04:00
Ben Boeckel 3e7194a215 regex: Use static regexs where possible
Rather than declaring and compiling a constant regex every time a chunk
of code is executed, build the regex once.
2014-06-09 14:45:35 -04:00
Brad King 1edaef39f1 VS: Factor MS-tool-specific vcxproj settings into helper
Factor a WriteMSToolConfigurationValues helper method out of the
cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues method
to isolate the configuration settings specific to MS tools.
2014-06-09 11:00:03 -04:00
Brad King 808f4b1fa4 VS: Re-order logic to group MS-tool-specific options together 2014-06-09 11:00:01 -04:00
Brad King 13e6d5595f VS: Set some options directly instead of using flag map
Instead of passing /TC, /TP, and /STACK: as strings to be parsed through
the flag map, directly set the results in the options map.
2014-06-09 10:59:59 -04:00
Brad King 8f4bdcc6cb VS: Remove always-true condition on compile options block
The cmVisualStudio10TargetGenerator::ComputeClOptions method is
only called when the target type compiles, so do not duplicate
that check in the implementation.
2014-06-09 10:59:57 -04:00
Brad King eaa9f2f8ee VS: Refactor internal generator factory logic
Consume the space before the platform name as soon as possible
instead of including it in the comparison.
2014-06-09 10:59:55 -04:00
Brad King 2b3e7b6f94 VS: Fix vcxproj specification of empty output file extension
When a binary output file is to have no extension, the TargetExt
element in the vcxproj cannot be left empty because VS will choose
a default extension.  Instead use "." because the Windows filesystem
will treat that as an empty extension.
2014-06-09 10:59:53 -04:00
Brad King 39af06e7f7 VS: Fix vcxproj elements specifying binary output locations
Fix generation of OutDir, IntDir, TargetName, and TargetExt element
values to encode the values for XML.
2014-06-09 10:59:51 -04:00
Brad King ee329d543c VS: Refactor flag table lookup
In cmVisualStudio10TargetGenerator, convert the static functions
currently used to lookup the flag table for each tool into class
methods.  This avoids passing the this->LocalGenerator member and
gives the methods access to other information that may be useful
in the future.
2014-06-09 10:59:48 -04:00
Brad King 55d6aa36a5 CMake 3.0.0 2014-06-09 10:51:47 -04:00
Brad King a0861931ea Merge topic 'dev/backtrace-performance'
86be733f cmGeneratorExpression: Add workaround for Borland compiler
3495ab0a tests: update unused variable test expected output
2a1b2d84 backtrace: Convert to local paths in IssueMessage
a0829205 genex: remove the need for backtraces
efc20569 cmake: remove dummy backtraces for IssueMessage
d46c650d cmMakefile: return a backtrace
2014-06-09 10:28:44 -04:00
Brad King 9af1f985fd Merge topic 'fix-ctest-label-regex'
887532f0 CTest: Fix combined inclusive/exclusive label regular expressions
2014-06-09 10:28:33 -04:00
Kitware Robot 2649d79470 CMake Nightly Date Stamp 2014-06-09 00:01:06 -04:00
Kitware Robot c4fe537562 CMake Nightly Date Stamp 2014-06-08 00:01:07 -04:00
Kitware Robot fc7d878616 CMake Nightly Date Stamp 2014-06-07 00:01:14 -04:00
Brad King 42f74df6d4 Add basic Android platform module
Create a Platform/Android module that includes Platform/Linux since
Android is based on Linux.  Provide only the minimal settings needed to
get builds with Android NDK toolchains to work.

Disable use of RPATH since the Android loader ignores it and we cannot
predict the install destination anyway.

Android supports soname but shared library names must end in ".so" and
we cannot represent the versioned names with associated symlinks on all
host operating systems anyway.  However, we do want the SONAME of
library files to be set so that linking to them by path to the library
file produces NEEDED entries with the soname and not the path.  Add a
new CMAKE_PLATFORM_NO_VERSIONED_SONAME setting to tell the
cmTarget::GetLibraryNames method that not to use the VERSION or
SOVERSION target properties in the soname.
2014-06-06 14:03:42 -04:00
Brad King 86be733fa5 cmGeneratorExpression: Add workaround for Borland compiler 2014-06-06 09:51:33 -04:00
Brad King c6e7c18bcc Merge topic 'xcode-15-string-apis'
23dc6aa1 Xcode: Fix single-configuration generation for version 1.5
2014-06-06 09:44:55 -04:00
Brad King 09c5fdfaa3 Merge topic 'compile-OBJECT_FILE_DIR'
8256ccb7 Add OBJECT_FILE_DIR rule placeholder for compilation lines
2014-06-06 09:44:53 -04:00
Nils Gladitz 887532f0f0 CTest: Fix combined inclusive/exclusive label regular expressions 2014-06-06 10:28:18 +02:00
Kitware Robot 47cde18849 CMake Nightly Date Stamp 2014-06-06 00:01:08 -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 a08292059e genex: remove the need for backtraces
Rather than making dummy backtraces and passing them around, just make
backtraces optional.
2014-06-05 12:44:18 -04:00
Ben Boeckel efc205695d cmake: remove dummy backtraces for IssueMessage 2014-06-05 12:44:17 -04:00
Ben Boeckel d46c650d67 cmMakefile: return a backtrace
This allows backtraces to be fully controlled by the makefile rather
than externally (and makes changing how they are manipulated easier).
2014-06-05 12:44:04 -04:00
Brad King 88818b6805 Merge topic 'delay-generator-toolset'
528e8af1 Allow a toolchain file to specify a generator toolset
98afb454 VS: Split user- and generator-provided PlatformToolset
3e9f6e36 Xcode: Rename internal variable {Platform => Generator}Toolset
2014-06-05 11:31:00 -04:00
Brad King eca798149b Merge branch 'fix-ctest-option-summary' into release 2014-06-05 10:57:02 -04:00
Brad King 2db73edc5c Merge topic 'fix-ctest-option-summary'
6446eb09 CTest: Added option description for --output-on-failure
2014-06-05 10:55:31 -04:00
Brad King 994f4b71fc Merge topic 'expand_cobertura_coverage'
50daf239 CTest: Generalize Cobertura coverage format handling
a2822d30 CTest: Rename coverage implementation for "Python" to "Cobertura"
2014-06-05 10:55:29 -04:00
Brad King 5d360f23fa Merge topic 'setlocale'
730e3862 Encoding: Add setlocale() to applications.
2014-06-05 10:55:27 -04:00
Nils Gladitz 6446eb099a CTest: Added option description for --output-on-failure
Without it the option list is cut short after --debug.
2014-06-05 10:51:39 -04:00
Brad King 23dc6aa194 Xcode: Fix single-configuration generation for version 1.5
In commit 84fdc992 (stringapi: Pass configuration names as strings,
2014-02-09) a few code paths for the Xcode 1.5 single-configuration
generator were not updated to use an empty configuration name instead of
a NULL pointer when no configuration is specified in CMAKE_BUILD_TYPE.
Fix them now.
2014-06-05 09:43:13 -04:00
Brad King 8256ccb78c Add OBJECT_FILE_DIR rule placeholder for compilation lines
Some compilers do not offer an option to specify the path to the object
file, but rather only to the directory in which to place the object
file.  See issue 14876 for some examples.  Add a new OBJECT_FILE_DIR
placeholder to specify the directory containing the object file for the
current compilation.  This may differ from the main target OBJECT_DIR
when the object corresponds to a source in a subdirectory.
2014-06-05 08:58:29 -04:00
Kitware Robot 8ab2d7d462 CMake Nightly Date Stamp 2014-06-05 00:01:10 -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 98afb4549f VS: Split user- and generator-provided PlatformToolset
Divide the cmGlobalVisualStudio10Generator "PlatformToolset" member into
two members representing the generator-selected default toolset and the
user-specified CMAKE_GENERATOR_TOOLSET value.  Prefer the user-specified
value, if any, and then fall back to the generator-selected default.
2014-06-04 13:16:37 -04:00
Brad King 3e9f6e36f3 Xcode: Rename internal variable {Platform => Generator}Toolset
The latter matches with CMAKE_GENERATOR_TOOLSET better.
2014-06-04 13:16:37 -04:00
Joseph Snyder 50daf239b0 CTest: Generalize Cobertura coverage format handling
Add support for Cobertura coverage files written by Java.

Add a test which uses the report from a Java run of Cobertura to calculate coverage.

In the documentation of CTEST_COVERAGE_COMMAND, give a sample .sh file to merge
the Cobertura .ser files and generate the XML report from the merged file.
2014-06-04 14:26:19 +00:00
Joseph Snyder a2822d3089 CTest: Rename coverage implementation for "Python" to "Cobertura"
The coverage.py tool writes out an XML that conforms to the Cobertura
Coverage tool standard.  Rename the cmParsePythonCoverage files to
instead be cmParseCoberturaCoverage.
2014-06-04 14:21:52 +00: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