Commit Graph

20286 Commits

Author SHA1 Message Date
Brad King 650c647160 VS: Implement generator toolset selection (#10722, #13774)
Implement generator toolset selection (cmake -T) for VS >= 10 by setting
the PlatformToolset.  Extend the RunCMake.GeneratorToolset test case to
verify CMAKE_GENERATOR_TOOLSET when the generator supports -T.

Since commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23)
all MSVC version information is detected during the compiler id step
from the actual compiler invoked by generated build systems rather than
hard-coded in VS generators.  Therefore we can set the PlatformToolset
in VS >= 10 project files and support toolsets from other VS versions.
2013-02-07 11:06:28 -05:00
Brad King 4fd5342956 CMake: Add -T option to choose a generator toolset
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases.
Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is
rejected when the generator doesn't support it, and that two -T options
are always rejected.
2013-02-07 10:53:19 -05:00
Brad King 118c32f8f2 Merge branch 'xcode-duplicate-flags-13354' into generator-toolset 2013-01-31 09:58:50 -05:00
Brad King cf8645e82d Tests: Run ctest custom commands with VERBATIM 2013-01-31 09:58:05 -05:00
Brad King 5b2fba5d40 ExternalProject: Simplify CMake command line generation
Append the source directory to the command line option in a separate
step instead of duplicating it with each possible generator.
2013-01-31 09:58:05 -05:00
Robert Maynard f447db7f10 XCode generator won't infinitely parse compiler flags (bug #13354).
When parsing the compiler flag list we reduce the search space on
each iteration to be the subset of the string we hadn't searched
before.
2013-01-18 11:55:50 -05:00
Kitware Robot c482dd8c97 CMake Nightly Date Stamp 2013-01-18 00:01:03 -05:00
Kitware Robot 2b5459cd1a CMake Nightly Date Stamp 2013-01-17 00:01:19 -05:00
Kitware Robot c2ab74acb9 CMake Nightly Date Stamp 2013-01-16 00:01:30 -05:00
Brad King 3a7d1ce3ff Merge topic 'test-export-iface-genex'
1d74ba2 Test evaluation target via export for generator expressions
522bdac Export the INTERFACE_PIC property.
4ee872c Make the BUILD_INTERFACE of export()ed targets work.
1d47cd9 Add a test for the interfaces in targets exported from the build tree.
6c828f9 Move the exported check for file existence.
cfd4f0a Move the exported check for dependencies of targets
d8fe1fc Only generate one check per missing target.
f623d37 Don't write a comment in the export file without the code.
b279f2b Strip consecutive semicolons when preprocessing genex strings.
2013-01-15 14:43:05 -05:00
Stephen Kelly 1d74ba21f6 Test evaluation target via export for generator expressions 2013-01-15 14:36:22 -05:00
Stephen Kelly 522bdac149 Export the INTERFACE_PIC property. 2013-01-15 14:36:22 -05:00
Stephen Kelly 4ee872cb99 Make the BUILD_INTERFACE of export()ed targets work.
The existing BUILD_INTERFACE code is executed at generate time, which
is too late for export().
2013-01-15 14:36:22 -05:00
Stephen Kelly 1d47cd94f3 Add a test for the interfaces in targets exported from the build tree. 2013-01-15 14:36:22 -05:00
Stephen Kelly 6c828f9126 Move the exported check for file existence.
Check only once, in the Config.cmake file, instead of once in each
Config-<cfg>.cmake file.
2013-01-15 14:36:21 -05:00
Stephen Kelly cfd4f0a4f4 Move the exported check for dependencies of targets
Check only once, in the Config.cmake file, instead of once in each
Config-<cfg>.cmake file.
2013-01-15 14:36:21 -05:00
Stephen Kelly d8fe1fcd80 Only generate one check per missing target. 2013-01-15 14:36:21 -05:00
Stephen Kelly f623d37a95 Don't write a comment in the export file without the code. 2013-01-15 14:36:21 -05:00
Stephen Kelly b279f2b431 Strip consecutive semicolons when preprocessing genex strings. 2013-01-15 14:36:21 -05:00
Brad King 33d4e0db3f Merge topic 'update-kwsys'
e2c756f Merge branch 'upstream-kwsys' into update-kwsys
4ba0ac7 KWSys 2013-01-14 (6fa1c99f)
6f57a90 Merge branch 'upstream-kwsys' into update-kwsys
6318834 KWSys 2013-01-10 (608d6b47)
2013-01-15 14:34:43 -05:00
Brad King 9a7da738f1 Merge topic 'TARGET_DEFINED-genex'
2bee6f5 Add the TARGET_DEFINED generator expression
2013-01-15 14:34:38 -05:00
Brad King a269e65de4 Merge topic 'commands-genex-docs'
7c7b94f Document the use of generator expressions in new commands.
2013-01-15 14:34:33 -05:00
Brad King 8d91e23565 Merge topic 'tll-allow-genex'
1da7502 Don't include generator expressions in old-style link handling.
2013-01-15 14:34:29 -05:00
Brad King 0dce5bc2f2 Merge topic 'compatible-INTERFACE-user-properties'
7171fd0 Add a way to check INTERFACE user property compatibility.
2013-01-15 14:34:24 -05:00
Brad King d870867570 Merge topic 'fix-empty-link-line-crash'
8ff1d47 CMake: Skip empty link.txt lines (#13845)
2013-01-15 14:34:20 -05:00
Stephen Kelly 7171fd0a90 Add a way to check INTERFACE user property compatibility. 2013-01-15 14:33:45 -05:00
Kitware Robot 3a40a8adf3 CMake Nightly Date Stamp 2013-01-15 00:01:13 -05:00
Brad King e2c756fcf0 Merge branch 'upstream-kwsys' into update-kwsys 2013-01-14 09:41:52 -05:00
KWSys Robot 4ba0ac7be4 KWSys 2013-01-14 (6fa1c99f)
Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ 6fa1c99f | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 608d6b47..6fa1c99f
Brad King (1):
      84827cc1 Process: Avoid argv[0]==NULL from parsing empty command line

Rolf Eike Beer (8):
      e041cd66 SystemInformation: factor out QueryMemoryBySysconf()
      ea850fa0 SystemInformation: factor out QueryProcessorBySysconf()
      57f06d49 SystemInformation: count processors with sysconf() on Solaris
      c6057a06 SystemInformation: fix "Multi-character character constant"
      5a27bd4f SystemInformation: make IsHyperThreadingSupported() return bool
      342c0ad2 SystemInformation: query memory size with sysconf() on Solaris
      f0b857c1 SystemInformation: cache result of IsHyperThreadingSupported()
      ab0c2a09 SystemInformation: try using assembler with BorlandC

Change-Id: I072371ed35eed892a5ef62a9e9e6cad734e961d9
2013-01-14 09:41:45 -05:00
Kitware Robot 36480eaf5c CMake Nightly Date Stamp 2013-01-14 00:01:23 -05:00
Stephen Kelly 2bee6f5ba5 Add the TARGET_DEFINED generator expression
This tests whether the parameter is a usable target.
2013-01-14 00:08:47 +01:00
Stephen Kelly 7c7b94f21f Document the use of generator expressions in new commands. 2013-01-13 10:04:40 +01:00
Stephen Kelly 1da75022bb Don't include generator expressions in old-style link handling.
Don't add generator expressions to variables which are used
for CMP0003, CMP0004, and the old-style _LIB_DEPENDS content. They
will not be evaluated when read anyway and would probably confuse
the code reading them.

This makes it legitimate to use target_link_libraries with generator
expressions as arguments.
2013-01-13 09:59:42 +01:00
Kitware Robot 9822f8c931 CMake Nightly Date Stamp 2013-01-13 00:01:16 -05:00
Kitware Robot 3367d0cc7f CMake Nightly Date Stamp 2013-01-12 00:01:19 -05:00
Brad King 6f57a9041e Merge branch 'upstream-kwsys' into update-kwsys 2013-01-11 11:34:59 -05:00
KWSys Robot 6318834b95 KWSys 2013-01-10 (608d6b47)
Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ 608d6b47 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' fc60c8b8..608d6b47
Rolf Eike Beer (6):
      297758a5 SystemInformation: fix conversion warning
      79ef34ef SystemInformation: fix calling kwsysProcess_WaitForData()
      f1068caf SystemInformation: speed up copying process data
      7dfc27d5 SystemInformation: check CPU vendor and SSE support on OpenBSD
      494d9d7a SystemInformation: get stepping code on Intel Macs
      608d6b47 SystemInformation: determine processor features on Intel Macs

Change-Id: I7f5bc5b7af2bf7d4e5c1ee291c286add0f17a7d5
2013-01-11 11:34:55 -05:00
Brad King c0c8ef85fc Merge topic 'LINK_INTERFACE_LIBRARIES-genex'
77d2646 Allow generator expressions in LINK_INTERFACE_LIBRARIES.
94aeaf7 Split LINK_INTERFACE_LIBRARIES export handling into dedicated method.
a3aedb8 Split the generator expression before extracting targets.
b6036d1 Extract the AddTargetNamespace method.
cb1afbf Don't pass a position when determining if a target name is a literal.
f99196d Add cmGeneratorExpression::Split() API.
2013-01-11 11:32:13 -05:00
Brad King ffe93315a2 Merge topic 'fix-imported-lib-linking-test'
93034a8 Fix linking to imported libraries test.
2013-01-11 11:32:09 -05:00
Brad King 8ff1d4714f CMake: Skip empty link.txt lines (#13845)
In the implementation of "cmake -E cmake_link_script", skip lines from
the input file that are empty or contain only whitespace.  Do not try to
run a child with no command line.
2013-01-11 10:57:39 -05:00
Kitware Robot 5929086634 CMake Nightly Date Stamp 2013-01-11 00:01:18 -05:00
Stephen Kelly 77d2646784 Allow generator expressions in LINK_INTERFACE_LIBRARIES.
The Config and IMPORTED_ variants may also contain generator
expressions.

If 'the implementation is the interface', then the result of
evaluating the expressions at generate time is used to populate
the IMPORTED_LINK_INTERFACE_LIBRARIES property.

1) In the case of non-static libraries, this is fine because the
  user still has the option to populate the LINK_INTERFACE_LIBRARIES
  with generator expressions if that is what is wanted.

2) In the case of static libraries, this prevents a footgun,
  enforcing that the interface and the implementation are really
  the same.

  Otherwise, the LINK_LIBRARIES could contain a generator
  expression which is evaluated with a different context at build
  time, and when used as an imported target. That would mean that the
  result of evaluating the INTERFACE_LINK_LIBRARIES property for
  a static library would not necessarily be the 'link implementation'.

  For example:

    add_library(libone STATIC libone.cpp)
    add_library(libtwo STATIC libtwo.cpp)
    add_library(libthree STATIC libthree.cpp)

    target_link_libraries(libtwo
      $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>:libone>)
    target_link_libraries(libthree libtwo)

  If the LINK_LIBRARIES content was simply copied to the
  IMPORTED_LINK_INTERFACE_LIBRARIES, then libthree links to libone, but
  executables linking to libthree will not link to libone.

3) As the 'implementation is the interface' concept is to be
  deprecated in the future anyway, this should be fine.
2013-01-10 23:04:06 +01:00
Stephen Kelly 94aeaf72c7 Split LINK_INTERFACE_LIBRARIES export handling into dedicated method. 2013-01-10 18:06:57 +01:00
Stephen Kelly a3aedb8152 Split the generator expression before extracting targets.
Now that we're processing a LINK_INTERFACE_LIBRARIES string, it
can contain targets. Make sure they are extracted for
namespacing purposes.

This needs to be restricted to strings which can actually have
targets named in them. For example, this is not done for
INTERFACE_COMPILE_DEFINITIONS, because even if there is a target
named 'foo', the string 'foo' in that property means that '-Dfoo'
will be set when compiling.
2013-01-10 18:06:57 +01:00
Stephen Kelly b6036d104a Extract the AddTargetNamespace method. 2013-01-10 18:06:03 +01:00
Stephen Kelly cb1afbf466 Don't pass a position when determining if a target name is a literal.
The lastPos refers to a position in a different string.
2013-01-10 18:06:03 +01:00
Stephen Kelly f99196dc0c Add cmGeneratorExpression::Split() API.
It can split a string like

 "A;$<1:B>;$<1:C>;D;E;$<1:F;G;H>;$<1:I>;J"

into

 "A" "$<1:B>" "$<1:C>" "D" "E" "$<1:F;G;H>" "$<1:I>" "J"
2013-01-10 18:06:03 +01:00
Stephen Kelly 93034a8350 Fix linking to imported libraries test.
Make a C executable instead of attempting to make a C++ static
library (and not really succeeding). This was introduced in
commit 894f52f3 (Handle INTERFACE properties transitively for
includes and defines., 2012-09-23).
2013-01-10 17:13:19 +01:00
Brad King 378899ce87 Merge topic 'INTERFACE_POSITION_INDEPENDENT_CODE'
3581b96 Process the INTERFACE_PIC property from linked dependencies
042ecf0 Add API to calculate link-interface-dependent bool properties or error.
bf5ece5 Keep track of properties used to determine linker libraries.
2013-01-10 10:22:52 -05:00
Brad King 325e92fa22 Merge topic 'target-includes-defines-commands'
fc61a7a Add the target_compile_definitions command.
8a37ebe Add the target_include_directories command.
2013-01-10 10:22:46 -05:00