Commit Graph

14286 Commits

Author SHA1 Message Date
Kitware Robot d4a94b8be4 CMake Nightly Date Stamp 2013-03-23 00:01:08 -04:00
Paul Kunysch 0fca154344 CPack: Avoid "format expects 'unsigned int'" warnings
Cast sprintf uid and gid arguments to match the type expected by their
"%-6u" format strings.
2013-03-22 08:53:58 -04:00
Brad King 3ed2d03ee9 Merge branch 'upstream-kwsys' into update-kwsys 2013-03-22 08:08:03 -04:00
Brad King 0b7ad3f091 Replace <TARGET> in CMAKE_<LANG>_COMPILE_OBJECT rule variables
In some languages the compiler may need to know the path of the final
target file for which an object is being compiled.  Honor the <TARGET>
placeholder for compilation rules to support such cases.

Note that this cannot work with OBJECT library targets because the final
target path is not known during compilation (there can even be more than
one final target).

Suggested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2013-03-22 07:52:54 -04:00
Kitware Robot 8bffce955d CMake Nightly Date Stamp 2013-03-22 00:01:08 -04:00
Kitware Robot aa16a433d3 CMake Nightly Date Stamp 2013-03-21 00:01:10 -04:00
Kitware Robot 2557e84d67 CMake Nightly Date Stamp 2013-03-20 00:01:10 -04:00
Brad King 3efede0ccc Merge topic 'automoc-append-implicit-dirs'
753b905 Automoc: append implicit includes after user-specified dirs
2013-03-19 19:37:49 -04:00
Stephen Kelly 753b905ec8 Automoc: append implicit includes after user-specified dirs
The commit d2536579 (Automoc: fix regression #13667, broken build in
phonon, 2012-11-19) changed Automoc to try to re-add the Qt header dir
if it was stripped out as an implicit include from the moc command
line. When invoking a compiler, those directories are stripped out
because they are built-in, but for moc, there are no built-in directories.

The follow-up commit acc22400 (Automoc: get include dirs without
stripping implicit include dirs off, 2012-12-07) went further by not
removing the implicit include dirs, if they were specified specifically
by the user.

This had the remaining problem that the implicit include dirs appeared
in a different order of precedence for moc compared to the compiler.
Resolve that by stripping out the include dirs, where specified for
the moc command line to, and then appending them at the end. Note that
the order of the appended implicit include directories is the order
they are specified in the CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES, not
the order specified by the user.
2013-03-19 19:36:42 -04:00
Brad King fc43477de0 Rename variable for including current directory in interfaces
Rename the variable added by commit 9ce1b9ef (Add
CMAKE_BUILD_INTERFACE_INCLUDES build-variable, 2012-11-25) to
CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE to be more consistent with the
existing CMAKE_INCLUDE_CURRENT_DIR variable.

Suggested-by: Alex Neundorf <neundorf@kde.org>
2013-03-19 16:44:17 -04:00
Brad King 017478570e Merge topic 'expand-version-of-Qt5-gui-fix'
6387f6d cmake-gui: Use the QStandardItemModel workaround until 5.1.0.
2013-03-19 15:20:37 -04:00
Brad King 16695a6d77 Merge topic 'fix-genex-preprocess'
7a619fa Fix cmGeneratorExpression::Preprocess for interleaved inputs.
2013-03-19 15:20:27 -04:00
Stephen Kelly 6387f6d85c cmake-gui: Use the QStandardItemModel workaround until 5.1.0.
If there is a Qt 5.0.3 release, it may or may not contain the patch
that fixes this issue.

 http://thread.gmane.org/gmane.comp.lib.qt.releasing/882

Just use the workaround until 5.1.0 which certainly will contain the
fix. Don't use the workaround before Qt 5.0.0.
2013-03-19 15:14:46 -04:00
Brad King 763a6dcd33 string: Fix regex documentation of '^' and '$' (#14028)
They match at the beginning and end of the input, not by line.

Reported-by: Martin Perzl <martin.perzl@web.de>
2013-03-19 13:14:22 -04:00
Kitware Robot 5dfa6240eb CMake Nightly Date Stamp 2013-03-19 00:01:07 -04:00
Stephen Kelly 7a619fa6fb Fix cmGeneratorExpression::Preprocess for interleaved inputs.
We can't find both preprocessing expressions at once, because then
the BUILD_INTERFACE will always be favored if both are present, even
if INSTALL_INTERFACE appears first.

This was affecting the behavior of install(EXPORT) because the
INTERFACE_INCLUDE_DIRECTORIES contained entries like

 /foo/include;$<INSTALL_INTERFACE:/bar/include>

As the INSTALL_INTERFACE always evaluates to '0', it always needs
to be preprocessed properly.
2013-03-18 15:09:47 +01:00
Brad King 85f7caabbb Merge topic 'CMAKE_AUTOMOC-Qt5-docs'
1b386b3 Document that CMAKE_AUTOMOC works with Qt 5.
2013-03-18 09:41:55 -04:00
Brad King a402bc4d5a Merge topic 'TI_DSP_to_TI'
27e6f6e TI compiler: add automatic detection of prefix and suffixes
b301586 rename TI_DSP toolchain to TI, since it works also for the ARM compiler
12b25df Determine C/CXX/Fortran compiler: fix indentation
7baa55a Determine C/CXX/Fortran compiler: minor restructuring
2013-03-18 09:41:37 -04:00
Kitware Robot ef63fa592a CMake Nightly Date Stamp 2013-03-18 00:01:04 -04:00
Kitware Robot d7a2a9c319 CMake Nightly Date Stamp 2013-03-17 00:01:13 -04:00
Stephen Kelly 1b386b3407 Document that CMAKE_AUTOMOC works with Qt 5. 2013-03-16 19:31:04 +01:00
Kitware Robot 253a913654 CMake Nightly Date Stamp 2013-03-16 00:01:09 -04:00
Kitware Robot 03b0ceebe5 CMake Nightly Date Stamp 2013-03-15 00:01:08 -04:00
Alex Neundorf b3015862e5 rename TI_DSP toolchain to TI, since it works also for the ARM compiler
Additionally, look for a special ar and strip

Alex
2013-03-14 21:47:59 +01:00
Robert Maynard db87209b6d CMake 2.8.11-rc1 2013-03-14 12:54:08 -04:00
Kitware Robot ae84d24b21 CMake Nightly Date Stamp 2013-03-14 00:01:10 -04:00
Brad King a95968fec9 Merge topic 'ninja-escape-line-breaks'
3b4436a Ninja: escape line breaks in literals
2013-03-13 13:42:00 -04:00
Brad King 0c1621ff95 Merge topic 'qt5-fixes'
404e1d6 cmake-gui: Workaround bug in Qt 5.0.0 to 5.0.3 QStandardItemModel
5144f6f cmake-gui: Use -fPIE if required by Qt.
2013-03-13 13:34:41 -04:00
Brad King 8128940ac1 Merge topic 'cleanup-early-include-CTest-failure'
d90f49b CTest: Fail early without PROJECT_BINARY_DIR (#14005)
2e1c2bd build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
4e5cb37 Refactor RunCMake.build_command test to allow more cases
2013-03-13 13:34:36 -04:00
Brad King 26bfece1af Merge topic 'fix-automoc-no-qt'
a223a3b Automoc: Don't create automoc targets if Qt is not used (#13999)
65b5c1e Merge branch 'property-link-depends-no-crash' into fix-automoc-no-qt
2013-03-13 13:34:24 -04:00
Brad King 9a02a26702 Merge topic 'property-link-depends-no-crash'
ab079ee Avoid crash when checking property compatibility without link info
92a2ab7 Avoid crash when checking property link dependencies without link info
2013-03-13 13:34:20 -04:00
Brad King 7d9d0efc7b Merge topic 'genex-SEMICOLON'
7f3bb8b Add $<SEMICOLON> generator expression.
2013-03-13 13:34:16 -04:00
Brad King 0707e0d422 Merge topic 'add_subdirectory-trailing-slashes'
1df4928 add_subdirectory: Compute output dir with consistent slashes (#10072)
2013-03-13 13:34:02 -04:00
Brad King 26436346fb Merge topic 'doc-fixes'
3cf2f67 Documentation: Clarify a few subtleties
2013-03-13 13:33:53 -04:00
Kitware Robot a9c83592bf CMake Nightly Date Stamp 2013-03-13 00:01:11 -04:00
Stephen Kelly 404e1d675a cmake-gui: Workaround bug in Qt 5.0.0 to 5.0.3 QStandardItemModel
The commit in qtbase 9dfba89c (Add implementations of QAIM::sibling in
public APIs., 2012-09-26) added a buggy implementation of sibling(), and
the commit f136701b (Use the base implementation of
QAbstractItemModel::sibling in QSIM., 2013-02-21) resolves it.
Workaround the bug for Qt releases that have it.
2013-03-12 18:41:26 -04:00
Stephen Kelly 5144f6fb11 cmake-gui: Use -fPIE if required by Qt. 2013-03-12 18:41:15 -04:00
Brad King 2e1c2bd2dd build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
If CMAKE_MAKE_PROGRAM is not set fail with an error message instead of
crashing.  Suggest calling project() or enable_language() first to
ensure that CMAKE_MAKE_PROGRAM is set.
2013-03-12 18:17:40 -04:00
Stephen Kelly a223a3b65f Automoc: Don't create automoc targets if Qt is not used (#13999)
Commit 79568f95 (automoc: Add source file to target early to set the
linker language, 2013-02-20) changed automoc initialization to a two
step process. In the first step, the generated source file was added
to the target, which allows the link language to be determined.

However, this bypassed the check for the availability of Qt itself.
At build-time the automoc file could not be generated because the moc
tool was not available to create it.

The solution is to only add the automoc file to the target if Qt is
found.
2013-03-12 17:42:02 -04:00
Brad King 65b5c1e064 Merge branch 'property-link-depends-no-crash' into fix-automoc-no-qt 2013-03-12 17:39:03 -04:00
Brad King ab079ee682 Avoid crash when checking property compatibility without link info
Teach the compatibility check added by commit 042ecf04 (Add API to
calculate link-interface-dependent bool properties or error, 2013-01-06)
to return early if no link information is available.  This avoids
crashing in a case that should fail with an error message.
2013-03-12 17:25:59 -04:00
Brad King 92a2ab70b6 Avoid crash when checking property link dependencies without link info
Teach the isLinkDependentProperty helper added by commit e9879910 (Make
INTERFACE determined properties readable in generator expressions,
2013-01-19) to return early if no link information is available.
2013-03-12 17:17:24 -04:00
Jean-Christophe Fillion-Robin 7f3bb8b392 Add $<SEMICOLON> generator expression.
This expression is useful to put a ';' in a command line argument
without dividing the argument during CMake list expansion.
2013-03-12 16:46:03 -04:00
Brad King 451ddcbf73 Merge topic 'ninja-mingw-lang'
2271ca3 Ninja: the Ninja generator does not support Fortran yet.
751f712 Ninja: use MinGW generator code in EnableLanguage()
2013-03-12 13:46:55 -04:00
Brad King 556ae30717 Merge topic 'install-export-usr-move'
0c727b9 install(EXPORT): Force absolute paths for usr-move
2013-03-12 13:46:51 -04:00
Brad King 32fb1f2371 Merge topic 'vs7-empty-groups'
545fdec VS: Avoid empty source groups in some cases (#3474)
2013-03-12 13:46:47 -04:00
Brad King 19922ac1d2 Merge topic 'cpack-nsis-no-release-version'
7947890 CPack: Fix NSIS version check without release version (#9721)
2013-03-12 13:46:43 -04:00
Brad King 950541618c Merge topic 'fix-transitive-target-names'
1bdd167 Restore support for target names with '+' (#13986)
254687d Only process transitive interface properties for valid target names.
2013-03-12 13:46:40 -04:00
Brad King d74d154704 Merge topic 'update-find_package-docs'
b73e05d Mention that IMPORTED targets may be created by a find_package call.
2013-03-12 13:46:31 -04:00
Stephen Kelly 1bdd167577 Restore support for target names with '+' (#13986)
Extend the range of valid target names with the + sign.  This character
can commonly be used for target names, such as those containing 'c++'.
Add a test but skip it for Borland and Watcom tools which do not support
the character.

Suggested-By: Benjamin Kloster
2013-03-12 13:39:11 -04:00
Brad King 1df49282a5 add_subdirectory: Compute output dir with consistent slashes (#10072)
When the command is invoked without an explicit build directory path we
compute it from the source directory path.  When either the source or
build tree is the root of a Windows drive letter it will have a trailing
slash.  Handle slashes consistently when substituting the current output
directory for the current source directory.

While at it, use cmSystemTools::IsSubDirectory instead of FindLastString
to verify that the source directory is a subdirectory.

Inspired-by: Graham Menhennitt <graham@menhennitt.com.au>
2013-03-12 11:52:52 -04:00
Petr Kmoch 3cf2f67adc Documentation: Clarify a few subtleties
* Clarify accepted values of <LANG> suffix in CMAKE_COMPILER_IS_GNU<LANG>.

* Clarify fact that target property GENERATOR_FILE_NAME usually cannot be
  used at configure time.

* Clarify that enable_language() can only be used in global scope of
  top-level project using language.

* State that enable_language(... OPTIONAL) currently doesn't work.

* Document regular expression operator precedence.
2013-03-12 09:29:55 -04:00
Kitware Robot 51fc4fb3c1 CMake Nightly Date Stamp 2013-03-12 00:01:18 -04:00
Kitware Robot 5990a5637e CMake Nightly Date Stamp 2013-03-11 00:01:12 -04:00
Peter Kümmel 2271ca3496 Ninja: the Ninja generator does not support Fortran yet. 2013-03-10 11:36:57 +01:00
Kitware Robot 2e0229ae0a CMake Nightly Date Stamp 2013-03-10 00:01:11 -05:00
Peter Kümmel 3b4436aa90 Ninja: escape line breaks in literals
BUG: 13591
2013-03-09 12:06:24 +01:00
Peter Kümmel 751f712e1a Ninja: use MinGW generator code in EnableLanguage() 2013-03-09 11:28:45 +01:00
Kitware Robot 2e80f10763 CMake Nightly Date Stamp 2013-03-09 00:01:10 -05:00
Brad King 0c727b906a install(EXPORT): Force absolute paths for usr-move
If the absolute install(EXPORT) destination for the CMAKE_INSTALL_PREFIX
used during configuration is under (/usr)?/lib(64)? then assume the
current build is for a system package installation instead of a
relocatable distribution.  Generate an absolute path for _IMPORT_PREFIX
in the target exports file instead of generating code to compute the
value relative to the file location.  This is necessary for
distributions implementing a move to /usr such as:

 https://wiki.archlinux.org/index.php/DeveloperWiki:usrlib
 "All files in the /lib directory have been moved to /usr/lib and now
  /lib is a symlink to usr/lib."

The relative path computation is not reliable because the targets file
could be installed through cross-prefix a symlink and loaded without it
or vice versa.

A similar change was made for package configuration file generation by
commit d4774140 (configure_package_config_file: force absolute paths for
usr-move, 2013-01-24).
2013-03-08 09:55:18 -05:00
Anton Helwart 545fdec4f8 VS: Avoid empty source groups in some cases (#3474)
Teach the WriteGroup method return true if a group or any of its
children have source files.  Have children write their output to a
temporay cmOStringStream.  Add it to the real output only if not empty.
2013-03-08 08:27:12 -05:00
Gerald Hofmann 794789047d CPack: Fix NSIS version check without release version (#9721)
Only check a release version for the minimum required version.  If NSIS
returns a CVS build version string (as when built by Macports), skip the
version check altogether and assume a sufficiently new version.  Also
correctly handle the case where the version check fails and the
CPACK_TOPLEVEL_DIRECTORY option is not set.

Co-Author: Graham Menhennitt <graham@menhennitt.com.au>
2013-03-08 08:17:05 -05:00
Kitware Robot aa027af9af CMake Nightly Date Stamp 2013-03-08 00:01:09 -05:00
Kitware Robot 06a45e8169 CMake Nightly Date Stamp 2013-03-07 00:01:10 -05:00
Stephen Kelly b73e05d7c9 Mention that IMPORTED targets may be created by a find_package call. 2013-03-06 21:35:20 +01:00
Stephen Kelly 254687d31f Only process transitive interface properties for valid target names.
Commit a1c4905f (Use the link information as a source of compile
definitions and includes., 2013-02-12) introduced the use of link
information as the source of target properties via the TARGET_PROPERTY
generator expression. This generator expression has a strict
interpretation of a valid target name and emits a fatal error for
invalid names.

Ensure that only targets with names valid for use with TARGET_PROPERTY
or targets which are determined by generator expressions are processed
by it. This means that at worst, invalid target names do not participate
in the transitive evaluation of properties, but the validation
generator expression can be extended where needed to resolve that.
2013-03-06 17:42:08 +01:00
Kitware Robot efdf152fe1 CMake Nightly Date Stamp 2013-03-06 00:01:10 -05:00
Brad King 631b7b8e15 Merge topic 'vs10-stack-size'
308c5a2 VS 10: Fix CMAKE_<LANG>_STACK_SIZE implementation (#13968)
2013-03-05 14:10:55 -05:00
Kitware Robot 4871960ea0 CMake Nightly Date Stamp 2013-03-05 00:01:11 -05:00
Brad King e6b4641bfa Merge topic 'fix-genex-RPATH-handling'
dcb5907 Fix RPATH information when only a genex is used as a link library.
2013-03-04 15:40:20 -05:00
Brad King 91d86838a9 Merge topic 'fix-genex-split-duplication'
f93a388 Fix the cmGeneratorExpression::Split when leading chars are present.
2013-03-04 15:40:14 -05:00
Brad King 8106570606 Merge topic 'ctest_update-Git-HEAD'
78b81b7 CTest: Fix ctest_update with 'HEAD' file in source tree
2013-03-04 15:40:08 -05:00
Brad King f954bb3d99 Merge topic 'xcode-COMBINE_HIDPI_IMAGES'
10d7bf4 Xcode: Generate recommended artwork setting (#13954)
2013-03-04 15:39:57 -05:00
Brad King b4bb074d8b Merge topic 'remove-TARGET_DEFINED-genex'
cbf0756 Revert "Add the TARGET_DEFINED generator expression"
21a342c Remove use of TARGET_DEFINED from the target_link_libraries test.
47b8d32 Remove use of TARGET_DEFINED from the ExportImport test.
2e39d21 Remove use of TARGET_DEFINED from target_include_directories test.
2013-03-04 15:39:45 -05:00
Brad King 308c5a2670 VS 10: Fix CMAKE_<LANG>_STACK_SIZE implementation (#13968)
Use the /STACK: flag to pass the value through flag parsing so that the
generator converts it to the StackReserveSize project file option.  The
option was accidentally left out by commit 7491f529 (first pass at VS
10, 2009-06-25).

Suggested-by: goatboy160@yahoo.com
2013-03-04 08:18:28 -05:00
Kitware Robot 2ea18eb0c7 CMake Nightly Date Stamp 2013-03-04 00:01:04 -05:00
Kitware Robot 368bd3d346 CMake Nightly Date Stamp 2013-03-03 00:01:04 -05:00
Kitware Robot 0d85927210 CMake Nightly Date Stamp 2013-03-02 00:01:06 -05:00
Kitware Robot 567a7af311 CMake Nightly Date Stamp 2013-03-01 00:01:09 -05:00
Stephen Kelly dcb5907ed6 Fix RPATH information when only a genex is used as a link library.
As of commit 1da75022 (Don't include generator expressions in
old-style link handling., 2012-12-23), such entries are not
included in the LinkLibraries member. Generator expressions in
LinkLibraries are not processed anyway, so port to the new way
of getting link information.
2013-02-28 18:25:33 +01:00
Stephen Kelly f93a388c9c Fix the cmGeneratorExpression::Split when leading chars are present.
In the case of input like

 foo$<1:bar>

the preGenex should be 'foo'. In that case, the search for a ';'
will not find one, and there is no preceding input to process as a
non-genex list.

Previously, the result of 'splitting' such a string would instead
be a vector containing the same string two times.
2013-02-28 17:54:11 +01:00
Brad King 78b81b773c CTest: Fix ctest_update with 'HEAD' file in source tree
Add the '--' command-line separator to make the HEAD reference
unambiguous.  Extend the CTest.UpdateGIT test to cover this case.
2013-02-28 11:52:30 -05:00
Kitware Robot 42c56c824c CMake Nightly Date Stamp 2013-02-28 00:01:01 -05:00
Kitware Robot 2929768541 CMake Nightly Date Stamp 2013-02-27 00:01:12 -05:00
Brad King 10d7bf4e62 Xcode: Generate recommended artwork setting (#13954)
Add the COMBINE_HIDPI_IMAGES = YES setting to all Xcode project targets.
Otherwise Xcode may ask the user to "Update to recommended settings".
2013-02-26 12:54:01 -05:00
Kitware Robot 793bf3fdac CMake Nightly Date Stamp 2013-02-26 00:01:08 -05:00
Brad King b74c35f57e Merge topic 'memoize-link-iface-includes-defines'
42ebb18 Memoize includes and defines from interface libraries.
2013-02-25 13:12:16 -05:00
Brad King 57072c12d2 Merge topic 'interface-property-external-read'
8dfdf1c Fix the tests for evaluating includes and defines.
98a6725 Fix constness of accessors.
7e70744 Expand includes and defines transitively in 'external' genexes.
d1a2729 Fix DAG checker finding cycling dependencies.
e72eaad Workaround broken code where a target has itself in its link iface.
ec2c67b Strip stray semicolons when evaluating generator expressions.
2013-02-25 13:12:12 -05:00
Brad King 990c440ddd Merge topic 'ide-compiler-vars-Fortran'
9f94181 VS: Restore CMAKE_GENERATOR_FC variable
2013-02-25 13:12:09 -05:00
Brad King b887bca6ee Merge topic 'try_compile-targets'
236133e Handle targets in the LINK_LIBRARIES of try_compile.
1c0597c Add a new Export generator for IMPORTED targets.
f2ab17d Keep track of all targets seen while evaluating a genex.
2013-02-25 13:12:02 -05:00
Brad King 6e567cabea Merge topic 'fix-automoc-linker-language'
79568f9 automoc: Add source file to target early to set the linker language
2013-02-25 13:11:55 -05:00
Brad King e674af906a Merge topic 'ExportFileGenerator_GenerateNicerErrorCheckingCode'
11d0c66 export files: rewrite the code for checking required targets
2013-02-25 13:11:44 -05:00
Brad King 05529c7109 Merge topic 'cmLocalGenerator_RemoveVirtuals'
f497dbc cmLocalGenerator: remove "virtual" where not used
2013-02-25 13:11:34 -05:00
Stephen Kelly cbf07569ed Revert "Add the TARGET_DEFINED generator expression"
This reverts commit 2bee6f5ba5.

This expression is not used, and has a semantic which is not completely
optimal (namely considering utility targets to be targets, though
usually we are interested in linkable targets).

Remove it so that we have more freedom to define better expressions in
the future.

Conflicts:
        Source/cmGeneratorExpressionEvaluator.cxx
        Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
        Tests/CMakeCommands/target_compile_definitions/consumer.cpp
2013-02-25 15:35:11 +01:00
Kitware Robot e597ba2928 CMake Nightly Date Stamp 2013-02-25 00:01:07 -05:00
Stephen Kelly 42ebb1886f Memoize includes and defines from interface libraries.
This is similar in spirit to commit e48d8420 (Cache context-independent
includes on evaluation., 2013-02-03), but it is needed since commit
a1c4905f (Use the link information as a source of compile definitions
and includes., 2013-02-12), which changed how includes and defines
are determined. As they are now determined through the link interface,
we need to cache the result of evaluating them through that.

In the case of the includes, the result was already being cached
and then immediately disposed. Store the result as a member variable
instead to make use of the caching.
2013-02-24 22:04:20 +01:00
Kitware Robot 2de047669f CMake Nightly Date Stamp 2013-02-24 00:01:07 -05:00
Stephen Kelly 8dfdf1c734 Fix the tests for evaluating includes and defines.
We should also check whether the INTERFACE_ variant of a property
is being read, and in the case of the compile definitions, we should
test the _<CONFIG> suffixed variants. That is already available
through the use of the methods.

This way, we use the ALREADY_SEEN optimization when evaluating
the includes of a target in 'external' generator expressions, ie, those
used in a add_custom_command invokation, as opposed to evaluating the
INCLUDE_DIRECTORIES of a target itself via GetIncludeDirectories.
2013-02-23 09:42:24 +01:00
Stephen Kelly 98a672528d Fix constness of accessors. 2013-02-23 09:42:24 +01:00
Stephen Kelly 7e707444be Expand includes and defines transitively in 'external' genexes.
This means that we can use expressions of the form

 $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>

to get a list of the interface include directories of foo, including
those coming from dependencies.

We can't have a test of a target which has a single include directory in
its INCLUDE_DIRECTORIES because the shell on the MSYS platforms transforms
a single include directory to include a prefix, which is not what the test
expects. We test a target with two directories instead as a means to
test a target with no link dependencies.
2013-02-23 09:42:24 +01:00
Stephen Kelly d1a2729b1a Fix DAG checker finding cycling dependencies.
Before this patch, the following is reported falsely as a self-reference:

 target_link_libraries(empty2 LINK_PUBLIC empty3)
 target_link_libraries(empty3 LINK_PUBLIC empty2)

 add_custom_target(...
    -DINCLUDES=$<TARGET_PROPERTY:empty2,INTERFACE_INCLUDE_DIRECTORIES>
 )

The reason is that the existing code assumed that all reading of
include directories would be done through cmTarget::GetIncludeDirectories()
and would therefore be initialized with a DagChecker. That is not the case
if reading the property with an 'external' generator expression.
2013-02-23 09:42:06 +01:00
Stephen Kelly e72eaadc42 Workaround broken code where a target has itself in its link iface.
There is a test for this since commit 8e756d2b (Tolerate cycles in
shared library link interfaces (#12647), 2012-01-12), so make sure
it continues to pass, even as we require no self-references in new
INTERFACE_ property generator expressions.
2013-02-23 09:41:22 +01:00
Kitware Robot 976cdf5488 CMake Nightly Date Stamp 2013-02-23 00:01:12 -05:00
Brad King 9f94181634 VS: Restore CMAKE_GENERATOR_FC variable
In commit bed6c388 (VS,Xcode: Remove unused CMAKE_GENERATOR_* variables,
2013-02-19) we removed this variable among others from the VS generator
claiming they were all not used.  In fact the Fortran compiler detection
module CMakeDetermineFortranCompiler.cmake uses CMAKE_GENERATOR_FC even
for the Visual Studio IDE generators because it does not use the full
IDE compiler id detection like the C and C++ language files do.
2013-02-22 16:12:48 -05:00
Stephen Kelly 236133e79e Handle targets in the LINK_LIBRARIES of try_compile.
Imported targets are re-exported so that they can be used by the
try_compile generated code with target_link_libraries.

This makes the use of the cmake_expand_imported_targets macro
obsolete. The macro is not able to expand the generator expressions
which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content.
Instead it just sees them as 'not a target'.
2013-02-22 08:35:39 -05:00
Stephen Kelly 1c0597c25b Add a new Export generator for IMPORTED targets.
This is to be used during try_compile using LINK_LIBRARIES in the
srcfile signature and, in the future, TARGETS in the binary dir
signature.
2013-02-22 08:35:38 -05:00
Stephen Kelly f2ab17d4db Keep track of all targets seen while evaluating a genex.
As dependencies of the generator expression, these will re-exported
in try_compile generated code.
2013-02-22 08:35:29 -05:00
Stephen Kelly 79568f95ab automoc: Add source file to target early to set the linker language
Previously, GetIncludeDirectories was called before calling
target->AddSourceFile(mocCppSource). Since commit a1c4905f (Use the
link information as a source of compile definitions and
includes., 2013-02-12), the include directories are determined by
the link information.

Valid link information requires that the linker language can be
determined, which depends on the source files languages and the
dependent targets languages. In the case of the no_link_languages
target in the unit test, there are no dependencies and the additional
source file no_link_languages_automoc.cpp is added to the target
at generate-time. That file can be used to determine the linker
language, but it must be added to the target before calling
GetIncludeDirectories.
2013-02-22 08:29:33 -05:00
Kitware Robot 3bb57bab7b CMake Nightly Date Stamp 2013-02-22 00:01:09 -05:00
Kitware Robot f7474f3a01 CMake Nightly Date Stamp 2013-02-21 00:01:08 -05:00
Alex Neundorf 11d0c66206 export files: rewrite the code for checking required targets
Instead of generating a whole bunch of repeated if-statements
now a foreach()-loop is generated in the targets-file.
Also now a comment is inserted in the generated file if no
targets from other export sets are used, so if somebody looks
at the file he can see whether the information about missing
imported targets has been generated or not.

Alex
2013-02-20 20:09:45 +01:00
Alex Neundorf f497dbce93 cmLocalGenerator: remove "virtual" where not used
This patch makes several functions of cmLocalGenerator which are marked
as virtual non-virtual, since they are not reimplemented anywhere.

Alex
2013-02-20 19:48:39 +01:00
Brad King f7029572ca Merge topic 'xcode-target-depends'
b005140 Xcode: Each target dependency edge needs a unique object (#13935)
781ea6d Xcode: Drop check for circular target dependencies
2013-02-20 08:09:47 -05:00
Brad King fc7b4d5cf3 Merge topic 'compiler-change-cleanup'
e83e6a1 Test Unix Makefiles generator support for changing compilers
c307e1c Tests/RunCMake: Allow tests to control build tree behavior
2963c98 Merge branch 'empty-compiler-crash' into compiler-change-cleanup
1df09e5 Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)
2013-02-20 08:09:40 -05:00
Brad King f1cd42f818 Merge topic 'ide-compiler-vars-cleanup'
bed6c38 VS,Xcode: Remove unused CMAKE_GENERATOR_* variables
2013-02-20 08:09:34 -05:00
Brad King 414658f057 Merge topic 'xcode-organize-sources'
f6a8983 Xcode: Sort source files
0816cae Xcode: Fix nested source group handling (#12943)
2013-02-20 08:09:17 -05:00
Kitware Robot 4515b09731 CMake Nightly Date Stamp 2013-02-20 00:01:08 -05:00
Brad King b005140451 Xcode: Each target dependency edge needs a unique object (#13935)
Generate a unique PBXTargetDependency and PBXContainerItemProxy for
every edge in the dependency graph as required by the Xcode format.
Xcode only accidentally loads project files that re-use the same
PBXTargetDependency for every edge leading to a single target.  If one
is removed by hand in the IDE then Xcode may crash due to dangling
references from the others.

Since cmGlobalXCodeGenerator::AddDependTarget is called exactly once for
every edge in the target dependency graph we do not need to keep track
of which edges have been visited to avoid generating duplicates.
2013-02-19 16:45:58 -05:00
Brad King 781ea6d1ca Xcode: Drop check for circular target dependencies
The modern cmComputeTargetDepends guarantees there will by no cycles.
Drop the Xcode generator's check which only handled length 1 and 2
cycles anyway.
2013-02-19 16:06:38 -05:00
Brad King 6535fcefeb Merge topic 'ninja-custom-command-implicit'
bbea30e Ninja: remove implicit dependency on custom command outputs
2013-02-19 14:58:56 -05:00
Brad King 71b217ecc9 Merge topic 'sublime-text-2-generator'
f616ff2 Update generator to use new cmGeneratorTarget api.
674bd6e Merge branch 'master' into sublime-text-2-generator
4760ead Remove ability to generate sublime clang files.
da0898e Correct missing parameter to CMP0018Flags call.
badb40d Merge branch 'master' into sublime-text-2-generator
b3ae61f Merge branch 'master' into sublime-text-2-generator
089d9cc SublimeText 2 Gen: Set the sublimeclang_options_script property.
44c2eee Merge branch 'master' into sublime-text-2-generator
304b885 Sublime Text 2 Gen: Per-source Compile flags are now saved in a separate file.
5b2aa3d SublimeText2 Gen: Fixed the issue where include directory flags used -D
90bcb77 SublimeText2 Gen: Improved use of define, include flags from CMAKE_C(XX)_FLAGS
cc84072 Merge branch 'master' into sublime-text-2-generator
8670cbe Define flags in CMAKE_C(XX)_FLAGS are now included in SublimeClang settings.
d022d4e Merge branch 'master' into sublime-text-2-generator
9cd3e70 Fixed Sublime Text project generation for in-source builds
44f35f7 Added a CMAKE_SUBLIMECLANG_DISABLED variable that disables SublimeClang.
...
2013-02-19 14:58:42 -05:00
Robert Maynard f616ff2c25 Update generator to use new cmGeneratorTarget api. 2013-02-19 14:45:18 -05:00
Robert Maynard 674bd6e778 Merge branch 'master' into sublime-text-2-generator 2013-02-19 14:44:57 -05:00
Robert Maynard 4760eade42 Remove ability to generate sublime clang files.
SublimeClang is a optional plugin to SublimeText and I felt it
shouldn't be part of the generator for the following reasons:

1. Reduces the amount of sublime and sublimeClang specific
   code we have to maintain inside CMake.
2. In testing the SublimeClang commands generated did not work
   for the VTK project.

For people that do want this feature I recommend that they
looking into https://gist.github.com/robertmaynard/4724705 for a
way to use CMAKE_EXPORT_COMPILE_COMMANDS to generate JSON files
that can be used by SublimeClang.
2013-02-19 14:43:20 -05:00
Robert Maynard da0898e0a2 Correct missing parameter to CMP0018Flags call. 2013-02-19 14:42:43 -05:00
Robert Maynard badb40d0f8 Merge branch 'master' into sublime-text-2-generator
Resolve conflict in Source/cmDocumentVariables.cxx by adding both
variables.
2013-02-19 14:42:00 -05:00
Brad King bed6c38896 VS,Xcode: Remove unused CMAKE_GENERATOR_* variables
Since the topic merged to master by commit 34a02846 (Merge topic
'ide-compiler-id', 2012-08-24), these variables are not used by
CMakeDetermine*Compiler.cmake for VS and Xcode generators.  Drop the
code that sets them.
2013-02-19 09:29:11 -05:00
Kitware Robot dea92c2f39 CMake Nightly Date Stamp 2013-02-19 00:01:10 -05:00
Brad King 2963c9828c Merge branch 'empty-compiler-crash' into compiler-change-cleanup 2013-02-18 10:07:03 -05:00
Brad King 1df09e5773 Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)
Since commit e015df7d (...delete CMakeFiles directory when cache is
deleted, 2006-02-20) we deleted the files in the CMakeFiles directory
when deleting CMakeCache.txt in order to reset the build tree to a fresh
state.  This allowed commit fd33bf93 (fix for bug 6102, allow users to
change the compiler, 2007-12-13) to delete CMakeCache.txt when the user
changes the compiler and CMakeFiles/CMake<lang>Compiler.cmake and other
platform information files would go with it to allow a fresh start.

Then commit 7195aca5 (Make platform information files specific to the
CMake version, 2012-08-24) moved the platform information files to a
subdirectory e.g. CMakeFiles/<version>/CMake<lang>Compiler.cmake where
<version> is the current CMake version.  This causes the compiler change
logic to fail to remove all old compiler information.  Then on the next
configuration CMake<lang>Compiler.cmake would set CMAKE_<lang>_COMPILER
back to the old value and re-trigger the compiler change logic.  This
causes an infinite loop of cache deletion and compiler reset.

Fix this simply by teaching cmCacheManager::DeleteCache to remove the
entire CMakeFiles directory recursively whenever it removes an existing
CMakeCache.txt.  This fully resets the build tree to configure with a
fresh compiler.
2013-02-18 09:58:34 -05:00
Alexander Chehovsky f6a8983db4 Xcode: Sort source files
Since Xcode doesn't sort the files on its own, let's sort them in our
generator to make navigation easier.  Visual Studio, QtCreator, and
kdevelop all display files sorted.
2013-02-18 08:47:14 -05:00
Alexander Chehovsky 0816caecac Xcode: Fix nested source group handling (#12943)
Teach the code path for nested sources build the group map key in the
same way as non-nested code path does.
2013-02-18 08:47:10 -05:00
Stephen Kelly ec2c67bcf3 Strip stray semicolons when evaluating generator expressions. 2013-02-18 12:07:32 +01:00
Kitware Robot a0ac2c59fe CMake Nightly Date Stamp 2013-02-18 00:01:04 -05:00
Kitware Robot 0ad58af444 CMake Nightly Date Stamp 2013-02-17 00:01:06 -05:00
Peter Kümmel bbea30eec8 Ninja: remove implicit dependency on custom command outputs
Revert aa2e1e9cae
With this commit all files are rebuild when only one moc file has changed.

BUG 0013874
2013-02-16 13:45:28 +01:00
Kitware Robot 77eccc20ee CMake Nightly Date Stamp 2013-02-16 00:01:10 -05:00
Brad King 5698d9b865 Merge topic 'vs-atomic-generated-stamp'
2dc17f8 VS: Replace generation timestamp file atomically
2013-02-15 13:13:14 -05:00
Brad King e85f1c28d4 Merge topic 'rpath-use-implicit-link-dirs'
95a9c80 Merge topic 'LINK_LIBRARIES-property' into rpath-use-implicit-link-dirs
baa33ac AIX-GNU: Put implicit link directories in runtime libpath (#13909)
171b099 Avoid duplicate RPATH entries
2013-02-15 13:12:31 -05:00
Brad King bc6b0326b3 Merge topic 'windows-ce-vs-subsystem'
cf82d1e VS: Specify WinCE subsystems correctly in VS 9 2008
8f4cae7 VS: Specify WinCE subsystem also for DLLs
2013-02-15 13:12:08 -05:00
Brad King c1dc807494 Merge topic 'file-REMOVE_RECURSE-symlink'
f123367 file: Do not remove symlinked directories recursively (#10538)
2013-02-15 13:11:27 -05:00
Brad King 0e2ed9b097 Merge topic 'linked-usage-cleanup'
fde949d Don't add target-specific interface includes and defines to Qt 4 targets.
79ae968 Revert "Add a way to exclude INTERFACE properties from exported targets."
71bf96e Revert "find_package: Reword <package>_NO_INTERFACES documentation"
3df36b5 Revert "Add the $<LINKED:...> generator expression."
e1f9080 Don't populate INTERFACE includes and defines properties in tll.
567c8d1 Revert "Don't allow utility or global targets in the LINKED expression."
a1c4905 Use the link information as a source of compile definitions and includes.
5c9f5e3 Don't use LINKED where not needed.
5b88504 Rename the IncludeDirectoriesEntry to be more generic.
b030323 Fix determination of when we're evaluating compile definitions.
2013-02-15 13:11:04 -05:00
Kitware Robot 57833095ff CMake Nightly Date Stamp 2013-02-15 00:01:22 -05:00
Brad King 95a9c80cac Merge topic 'LINK_LIBRARIES-property' into rpath-use-implicit-link-dirs
Resolve a logical conflict in the signature of cmTarget::GetLinkClosure.
2013-02-14 10:18:31 -05:00
Brad King baa33acbda AIX-GNU: Put implicit link directories in runtime libpath (#13909)
The GNU compiler front-ends on AIX invoke the linker with flags of the
form "-L/path/to/gnu/runtime/lib" to tell ld where to find the language
runtime libraries.  They depend on the default libpath behavior
documented in "man ld" to add the -L paths also to the runtime libpath
so the dynamic loader can find the language runtime libraries.  This
differs from platforms whose linkers have distinct -rpath flags that
non-system compilers can use to tell the dynamic loader where to find
their language runtime libraries.

Since commit 96fd5909 (Implement linking with paths to library files,
2008-01-22) CMake always passes "-Wl,-blibpath:" followed by any
project-defined RPATH plus "/usr/lib:/lib" in order to explicitly set
the runtime libpath and avoid getting all the project -L paths in the
runtime libpath.  The explicit libpath prevents the GNU compiler runtime
library -L paths from being placed in the libpath and then the dynamic
loader fails to find the language runtime libraries.

CMake already detects the implicit link directories for each language
since commit 07ea19ad (Implicit link info for C, CXX, and Fortran,
2009-07-23).  Add the implicit link directories to the explicit runtime
libpath for GNU compilers on AIX to fix this use case.
2013-02-14 10:16:36 -05:00
Brad King 171b0993d9 Avoid duplicate RPATH entries
Teach cmComputeLinkInformation::GetRPath to avoid adding the same
directory to the output runtime path more than once.
2013-02-14 10:14:56 -05:00
Kitware Robot 63233635d2 CMake Nightly Date Stamp 2013-02-14 00:01:17 -05:00
Mark Salisbury cf82d1e166 VS: Specify WinCE subsystems correctly in VS 9 2008 2013-02-13 13:37:49 -05:00
Mark Salisbury 8f4cae7aa6 VS: Specify WinCE subsystem also for DLLs
This fixes a link error in VS 2005: unresolved external symbol
__DllMainCRTStartup@12.
2013-02-13 13:37:18 -05:00
Brad King f123367254 file: Do not remove symlinked directories recursively (#10538)
If a symlink points at a directory the symlink should be removed but not
the content of the directory.
2013-02-13 10:00:50 -05:00
Stephen Kelly 79ae968a18 Revert "Add a way to exclude INTERFACE properties from exported targets."
This reverts commit 2c3654c3de.

The removal of some tests added in commit 77cecb77 (Add includes and compile
definitions with target_link_libraries., 2012-11-05) are also squashed
into this commit.
2013-02-13 15:12:31 +01:00
Stephen Kelly 71bf96ec78 Revert "find_package: Reword <package>_NO_INTERFACES documentation"
This reverts commit 179f495602.
2013-02-13 15:12:31 +01:00
Stephen Kelly 3df36b5954 Revert "Add the $<LINKED:...> generator expression."
This reverts commit 0b92602b81.

Conflicts:
	Source/cmGeneratorExpressionEvaluator.cxx
	Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
	Tests/CMakeCommands/target_include_directories/CMakeLists.txt
2013-02-13 15:12:31 +01:00
Stephen Kelly e1f908015f Don't populate INTERFACE includes and defines properties in tll.
This is a partial revert of commit 77cecb77 (Add includes and compile
definitions with target_link_libraries., 2012-11-05).

As the interface includes and defines are now determined by the link
closure, there is no need to populate the corresponding properties
explicitly.
2013-02-13 15:12:31 +01:00
Stephen Kelly 567c8d103e Revert "Don't allow utility or global targets in the LINKED expression."
This reverts commit 9712362b45.
2013-02-13 15:12:31 +01:00
Stephen Kelly a1c4905f72 Use the link information as a source of compile definitions and includes.
After evaluating the INTERFACE_INCLUDE_DIRECTORIES, of a target in a
generator expression, also read the INTERFACE_INCLUDE_DIRECTORIES of
its link interface dependencies.

That means that code such as this will result in the 'user' target
using /bar/include and /foo/include:

 add_library(foo ...)
 target_include_directories(foo INTERFACE /foo/include)
 add_library(bar ...)
 target_include_directories(bar INTERFACE /bar/include)
 target_link_libraries(bar LINK_PUBLIC foo)

 add_executable(user ...)
 target_include_directories(user PRIVATE
    $<TARGET_PROPERTY:bar,INTERFACE_INCLUDE_DIRECTORIES>)

Also process the interface include directories from direct link
dependencies for in-build targets.

The situation is similar for the INTERFACE_COMPILE_DEFINITIONS. The
include directories related code is currently more complex because
we also need to store a backtrace at configure-time for the purpose
of debugging includes. The compile definitions related code will use
the same pattern in the future.

This is not a change in behavior, as existing code has the same effect,
but that existing code will be removed in follow-up commits.
2013-02-13 15:12:30 +01:00
Kitware Robot 1324500669 CMake Nightly Date Stamp 2013-02-13 00:01:25 -05:00
Brad King c6c9838c63 Merge topic 'UseMakefileHeaderExtensions'
27e14a8 automoc: use the header extensions from cmMakefile
10511aa automoc: use a std::vector<> instead a std::list
2013-02-12 14:42:12 -05:00
Brad King 3f1a0ad7ac Merge topic 'empty-compiler-crash'
ccfeefa Fix crash on empty CMAKE_<lang>_COMPILER value (#13901)
2013-02-12 14:42:00 -05:00
Brad King 2dc17f88dd VS: Replace generation timestamp file atomically
Since commit 34c882a9 (Allow VS 7 project Rebuild and Solution Rebuild to
work, 2007-11-10) we use a "CMakeFiles/generated.stamp" and some
associated files in the build tree to avoid re-running CMake when the
inputs have not changed but VS has cleaned the outputs it knows about.

When we do not really need to re-run we restore the generated.stamp file.
The non-re-run case can happen in multiple targets in parallel in VS >= 10
so we must restore the file atomically to avoid races.  Write the stamp
file to a random temporary name and then atomically rename it to the real
stamp file.
2013-02-12 13:55:53 -05:00
Stephen Kelly 5b88504f65 Rename the IncludeDirectoriesEntry to be more generic. 2013-02-12 10:39:35 +01:00
Stephen Kelly b030323c13 Fix determination of when we're evaluating compile definitions.
Also handle the config-specific property.
2013-02-12 10:39:34 +01:00
Kitware Robot da6109df0f CMake Nightly Date Stamp 2013-02-12 00:01:21 -05:00
Brad King 813b519280 Merge topic 'minor-fixes'
ba48e63 Generate config-specific interface link libraries propeties.
deb51a7 Remove unused forward declarations.
9712362 Don't allow utility or global targets in the LINKED expression.
faa927e Make sure INTERFACE properties work with OBJECT libraries.
510fdcb Whitelist target types in target_{include_directories,compile_definitions}
4de7178 Ensure that the build interface includes have been added.
df74bc3 Only append build interface include dirs to particular targets.
d4e5c67 Don't keep track of content determined by target property values.
1fb545a Move a special case for PIC from the genex to the cmTarget code.
57175d5 Only use early evaluation termination for transitive properties.
4cf161a Fix determination of evaluating link libraries.
3a298c0 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
655e98b Ensure type specific compatible interface properties do not intersect.
46e2896 The COMPATIBLE_INTERFACE does not affect the target it is set on.
5f926a5 Test printing origin of include dirs from tll().
7c0ec75 De-duplicate validation of genex target names.
...
2013-02-11 13:59:48 -05:00
Kitware Robot f65616b648 CMake Nightly Date Stamp 2013-02-11 00:01:27 -05:00
Alex Neundorf 27e14a813c automoc: use the header extensions from cmMakefile
Instead of having an own set of C header extensions, use
cmMakefile::GetHeaderExtensions() (#13904)

Alex
2013-02-10 18:10:20 +01:00
Alex Neundorf 10511aa084 automoc: use a std::vector<> instead a std::list
Alex
2013-02-10 17:49:42 +01:00
Kitware Robot 12806779be CMake Nightly Date Stamp 2013-02-10 00:01:20 -05:00
Stephen Kelly deb51a7113 Remove unused forward declarations. 2013-02-09 10:25:05 +01:00
Kitware Robot 4db712f6ef CMake Nightly Date Stamp 2013-02-09 00:01:19 -05:00
Brad King ccfeefae35 Fix crash on empty CMAKE_<lang>_COMPILER value (#13901)
Since commit fd33bf93 (fix for bug 6102, allow users to change the
compiler, 2007-12-13) we keep an internal ;-list of language compiler
variable and value pairs.  Preserve empty values on expansion to ensure
that the key/value pairing remains consistent.
2013-02-08 16:33:52 -05:00
Stephen Kelly 9712362b45 Don't allow utility or global targets in the LINKED expression.
The LINKED expression is exclusively for handling INTERFACE content
and it does not make sense for utility targets to have INTERFACE
content.
2013-02-08 21:44:11 +01:00
Stephen Kelly faa927e273 Make sure INTERFACE properties work with OBJECT libraries. 2013-02-08 20:10:22 +01:00
Brad King 7df05c8198 Merge topic 'style-fixes'
2ce7231 Style: Use this-> when invoking member functions.
2013-02-08 13:41:54 -05:00
Brad King 7dab997771 Merge topic 'generator-toolset'
56ca8d4 Tests: Add generator toolset support
f36c665 Tests: Consolidate ctest --build-and-test generator options
c0debb1 Merge branch 'master' into generator-toolset
daae0d2 ExternalProject: Propagate the generator toolset
e3841cf CTest: Add options to set generator toolset
f980a80 Xcode: Implement generator toolset selection (#9831, #13802)
650c647 VS: Implement generator toolset selection (#10722, #13774)
4fd5342 CMake: Add -T option to choose a generator toolset
118c32f Merge branch 'xcode-duplicate-flags-13354' into generator-toolset
cf8645e Tests: Run ctest custom commands with VERBATIM
5b2fba5 ExternalProject: Simplify CMake command line generation
2013-02-08 13:38:56 -05:00
Brad King f4d1474013 Merge topic 'exit-without-working-directory'
a943b5c Fail early if no current working directory exists
2013-02-08 13:38:43 -05:00
Brad King e8df4cab82 Merge topic 'update-kwsys'
7df291f Merge branch 'upstream-kwsys' into update-kwsys
9d66f74 KWSys 2013-02-05 (5c34ed2e)
2013-02-08 13:38:23 -05:00
Stephen Kelly 510fdcb188 Whitelist target types in target_{include_directories,compile_definitions}
Setting include directories or compile definitions on a target created
with add_custom_target does not make sense.
2013-02-08 19:21:30 +01:00
Stephen Kelly 4de71786e8 Ensure that the build interface includes have been added.
This is needed in the case that Automoc is used, as that calls
GetIncludeDirectories, which may cache the resulting include dirs
too early in the generate step.

Also, because the automoc step is so early, we can't cache the
include directories at that point. At that point the build interface
of all dependencies are not populated yet, so we'd be caching the
includes before appending the build interface. Only start caching
when we're definitely generating the buildsystem. At that point, the
includes should be stable.

We still need to invoke AppendBuildInterfaceIncludes
in the GlobalGenerator because the build interface includes affect
mostly the dependencies of targets (such as the automoc targets),
rather than the targets themselves, so the build interface needs
to be appended for all targets before generation is done.
2013-02-08 12:54:27 +01:00
Kitware Robot bc96f95a16 CMake Nightly Date Stamp 2013-02-08 00:01:15 -05:00
Stephen Kelly df74bc34d4 Only append build interface include dirs to particular targets.
We shouldn't set the property on all custom targets.
2013-02-07 21:57:35 +01:00
Brad King c0debb1f89 Merge branch 'master' into generator-toolset
We need the latest Tests/CMakeLists.txt so we can refactor all tests.
2013-02-07 11:09:01 -05:00
Brad King e3841cf4a2 CTest: Add options to set generator toolset
The ctest_configure command already reads the CTEST_CMAKE_GENERATOR
variable to get the value for the cmake -G option.  Read new variable
CTEST_CMAKE_GENERATOR_TOOLSET for -T.

The "ctest --build-and-test" mode already has "--build-generator" to
specify the -G option to CMake.  Add a "--build-generator-toolset" option
to specify the -T value.
2013-02-07 11:08:32 -05:00
Brad King f980a80495 Xcode: Implement generator toolset selection (#9831, #13802)
Implement generator toolset selection (cmake -T) for Xcode > 2.0 by
adding the GCC_VERSION build setting to project files.
2013-02-07 11:07:48 -05:00
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
Stephen Kelly d4e5c6787c Don't keep track of content determined by target property values.
This tracking was added during the development of commit 042ecf04
(Add API to calculate link-interface-dependent bool properties
or error., 2013-01-06), but was never used.

It was not necessary to use the content because what is really
useful in that logic is to determine if a property has been implied
to be null by appearing in a LINK_LIBRARIES genex.

I think the motivating usecase for developing the feature of
keeping track of the targets relevant to a property was that I
thought it would  make it possible to allow requiring granular
compatibility of interface properties only for targets which
depended on the interface property. Eg:

 add_library(foo ...)
 add_library(bar ...)

 add_executable(user ...)
 # Read the INTERFACE_POSITION_INDEPENDENT_CODE from bar, but not
 # from foo:
 target_link_libraries(user foo $<$<TARGET_PROPERTY:POSTITION_INDEPENDENT_CODE>:bar>)

This obviously doesn't make sense. We require that INTERFACE
properties are consistent across all linked targets instead.
2013-02-07 16:21:09 +01:00
Stephen Kelly 1fb545ad3a Move a special case for PIC from the genex to the cmTarget code. 2013-02-07 16:21:09 +01:00
Stephen Kelly 57175d559e Only use early evaluation termination for transitive properties.
We need to make sure expressions which evaluate TARGET_PROPERTY:TYPE
multiple times for example get the correct result each time, and
not an empty string instead.
2013-02-07 16:21:09 +01:00
Stephen Kelly 4cf161a5e7 Fix determination of evaluating link libraries.
Added in commit 6fbe3ce4 (Exclude the LINK_LIBRARIES related properties
from INTERFACE evaluation., 2013-01-23)
2013-02-07 16:21:09 +01:00
Stephen Kelly 3a298c0bf4 Fix generation of COMPILE_DEFINITIONS in DependInfo.cmake.
As INTERFACE_COMPILE_DEFINITIONS are now possible, we can have
situations like this:

 add_library(foo ...)
 add_library(bar ...)
 target_link_libraries(foo bar)

 target_compile_definitions(bar INTERFACE SOME_DEF)

The INTERFACE_COMPILE_DEFINITIONS of bar determine how foo should be
compiled, and if they change, foo should be rebuilt.

Additionally, as of commit d1446ca7 (Append the COMPILE_DEFINITIONS
from the Makefile to all targets., 2012-09-17), we don't need to
read definitions from the makefile if we read them from the target,
so also de-duplicate the cached info.

The DependInfo for INTERFACE_INCLUDE_DIRECTORIES is already handled
correctly.
2013-02-07 16:21:09 +01:00
Stephen Kelly 655e98bf71 Ensure type specific compatible interface properties do not intersect.
Before, the boolean version would always win, and the string one would
be ignored.
2013-02-07 16:21:09 +01:00
Stephen Kelly 46e28960a5 The COMPATIBLE_INTERFACE does not affect the target it is set on.
Test and document this.
2013-02-07 16:21:09 +01:00
Stephen Kelly 7c0ec75cfa De-duplicate validation of genex target names. 2013-02-07 16:21:08 +01:00
Stephen Kelly 92e98dd909 Deduplicate the isGeneratorExpression method.
This API seems like the most appropriate.
2013-02-07 16:21:08 +01:00
Brad King a943b5c4f3 Fail early if no current working directory exists
Remove the old "nocwd" behavior that attempts to provide the "--help"
output when no working directory is available.  The long help output
scrolls the real error message out of typical terminal sizes.  Also
execute as little code as possible when no working directory exists.
2013-02-07 08:53:50 -05:00
Brad King 7df291fb6e Merge branch 'upstream-kwsys' into update-kwsys 2013-02-07 08:34:56 -05:00
Stephen Kelly 1714c27a74 Process generator expressions for 'system' include directories.
Since commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property., 2012-09-18), it is possible to use
generator expressions with the include_directories command.

As that command can also have a SYSTEM argument, ensure that the
result of using that argument with generator expressions gives a
sane result.
2013-02-07 10:03:30 +01:00
Kitware Robot bc75f4c4c6 CMake Nightly Date Stamp 2013-02-07 00:01:14 -05:00
Stephen Kelly 2ce7231f56 Style: Use this-> when invoking member functions. 2013-02-07 00:10:04 +01:00
Kitware Robot 47eacab06d CMake Nightly Date Stamp 2013-02-06 00:01:19 -05:00
Brad King ec85306025 Merge topic 'tll-includes-defines'
e48d842 Cache context-independent includes on evaluation.
089fe1c Optimize genex evaluation for includes and defines.
179f495 find_package: Reword <package>_NO_INTERFACES documentation
e7b579b Test workaround of bad interface include directories from depends.
77cecb7 Add includes and compile definitions with target_link_libraries.
0b92602 Add the $<LINKED:...> generator expression.
0fa7f69 Add API to check if we're reading a includes or defines property.
2c3654c Add a way to exclude INTERFACE properties from exported targets.
d4297d5 Export targets to a targets file, not a Config file.
df4d2b2 Make it an error for INSTALL_PREFIX to be evaluated.
7ceeba9 Advance more when preprocessing exported strings.
30268b4 Handle reading empty properties defined by the link interface.
2013-02-05 14:46:43 -05:00
Brad King 252c5211b5 Merge topic 'ninja-link-rsp-newlines'
a55d5ca Ninja: Avoid LNK1170 linker error
2013-02-05 14:46:36 -05:00
Brad King e6b72e8b87 Merge topic 'vs6-rule-files'
0f24a66 VS 6: Create .rule file directory before file
2013-02-05 14:46:32 -05:00
Brad King 9ff34ff2fd Merge topic 'fix-atomic-rename-on-Windows'
59b568e Fix cmSystemTools::RenameFile race on Windows
2013-02-05 14:46:27 -05:00
Brad King d1660f0895 Merge topic 'fix-include-directories-unix-path'
b6f6654 Use the result of converting to a unix path.
2013-02-05 14:46:23 -05:00
Brad King 50de1247a0 Merge topic 'update-kwsys'
588d705 Merge branch 'upstream-kwsys' into update-kwsys
23ae484 KWSys 2013-01-31 (5b0d1bd9)
2013-02-05 14:46:13 -05:00
Brad King 4341fd2579 Merge topic 'new-command-class-type-macros'
9397270 Fix use of cmTypeMacro in new command classes
2013-02-05 14:45:57 -05:00
Stephen Kelly b6f6654267 Use the result of converting to a unix path.
The commit 18a3195a ('Keep track of INCLUDE_DIRECTORIES as a vector
of structs.', 2012-11-19) moved the handling of includes from
cmGeneratorTarget to cmTarget, but in the process introduced this
bug.
2013-02-05 09:19:27 +01:00
Kitware Robot f77a1147f5 CMake Nightly Date Stamp 2013-02-05 00:01:16 -05:00
Patrick Gansterer a55d5ca481 Ninja: Avoid LNK1170 linker error
link.exe has problems with very very long lines in rsp files too.
Use $in_newline instead of $in variable for rspcontent which
separates the arguments with a newline instead of a simple space
and was specially made for this purpose.
2013-02-04 16:26:39 -05:00
Brad King 59b568e5e8 Fix cmSystemTools::RenameFile race on Windows
Since commit d46d8df0 (Re-implemented cmGeneratedFileStream to look like a
real stream and replace the destination file atomically, 2004-11-03) our
RenameFile implementation tries to deal with MoveFile not replacing
read-only files.  In order to avoid the Get/SetFileAttributes pair we used
stat to test for existence of the destination file.  This has a race in
which the destination could be created between the test for existence and
the MoveFile call.

Remove the stat call and use GetFileAttributes to detect whether the file
exists.  This shortens the race but does not eliminate it.  Use a loop to
try multiple times in case we lose the race.  While at it, drop Win9x
support and always use MoveFileEx.
2013-02-04 15:15:21 -05:00
Kitware Robot 8669f64d54 CMake Nightly Date Stamp 2013-02-04 00:01:18 -05:00
Stephen Kelly e48d84209c Cache context-independent includes on evaluation.
Generator expressions whose output depends on the configuration
now record that fact. The GetIncludeDirectories method can use
that result to cache the include directories for later calls.

GetIncludeDirectories is called multiple times for a target
for each configuration, so this should restore performance for
multi-config generators.
2013-02-03 23:04:03 +01:00
Brad King 0f24a66715 VS 6: Create .rule file directory before file
The VS 6 IDE wants .rule files to exist in order to run the rule attached
to it.  When creating the dummy .rule file make sure the directory exists.
2013-02-03 12:03:14 -05:00
Kitware Robot a25f26f54f CMake Nightly Date Stamp 2013-02-03 00:01:21 -05:00
Stephen Kelly 089fe1c13d Optimize genex evaluation for includes and defines.
While porting boost to use these features, the generation step took
too long (several minutes before I stopped it). The reason was that
the boost libraries form a large interdependent mesh. The libraries
list their dependencies in their INTERFACE such as:

 $<LINKED:boost::core>;$<LINKED:boost::config>;$<LINKED:boost::mpl>

As boost::core already depends on the boost::config libraries, that
expression has no impact on the end-content, as it is removed after
the generation step. There is no DAG issue though, so the generator
expression evaluation would fully evaluate them. In the case of the
config library, it also depends on the core library, so all depends
are followed through that again, despite the fact that they've just
been evaluated. After this patch, the evaluation skips libraries if
they have already been seen via depends or directly in the content.

This patch keeps track of targets whose INTERFACE has been consumed
already. The INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS properties
are whitelisted because repeated content will be stripped out later
during generation. For other properties now and in the future, that
may not be the case.
2013-02-02 15:06:53 +01:00
Kitware Robot 425c56788d CMake Nightly Date Stamp 2013-02-02 00:01:22 -05:00
Brad King 179f495602 find_package: Reword <package>_NO_INTERFACES documentation 2013-02-01 10:30:57 -05:00
Brad King 588d705cb1 Merge branch 'upstream-kwsys' into update-kwsys 2013-02-01 09:28:50 -05:00
Kitware Robot 1638124680 CMake Nightly Date Stamp 2013-02-01 00:01:16 -05:00
Stephen Kelly 77cecb778f Add includes and compile definitions with target_link_libraries.
This establishes that linking is used to propagate usage-requirements
between targets in CMake code. The use of the target_link_libraries
command as the API for this is chosen because introducing a new command
would introduce confusion due to multiple commands which differ only in
a subtle way.
2013-01-31 17:34:20 +01:00
Stephen Kelly 0b92602b81 Add the $<LINKED:...> generator expression.
This is both a short form of using a TARGET_DEFINED expression
together with a TARGET_PROPERTY definition, and a way to strip
non-target content from interface properties when exporting.
2013-01-31 17:34:20 +01:00
Stephen Kelly 0fa7f69c0e Add API to check if we're reading a includes or defines property.
This will allow the implementation of the LINKED generator expression.
2013-01-31 17:30:49 +01:00
Stephen Kelly 2c3654c3de Add a way to exclude INTERFACE properties from exported targets.
Projects set interface requirements upstream, and existing
downstreams use of target_link_libraries will consume those interfaces.

This can create a backward compatibility concern as the result may
be changing the order of include directories of downstreams, or another
side-effect of using the INTERFACE properties.

Provide a way for them to emulate the behavior of a version-based
policy in the config file.
2013-01-31 17:29:04 +01:00
Stephen Kelly df4d2b28b2 Make it an error for INSTALL_PREFIX to be evaluated.
An empty string is not likely going to produce expected results
in any evaluation context. It is replaced by preprocessing
currently.
2013-01-31 17:27:06 +01:00
Brad King 9397270d73 Fix use of cmTypeMacro in new command classes
Both commit 8a37ebec (Add the target_include_directories command,
2013-01-01) and commit fc61a7a7 (Add the target_compile_definitions
command, 2013-01-08) added command implementations deriving from the new
cmTargetPropCommandBase class.  Fix cmTypeMacro declarations of the
inheritance relationship.
2013-01-31 11:08:40 -05:00
Stephen Kelly 7ceeba992b Advance more when preprocessing exported strings.
When evaluating TARGET_PROPERTY here, we can skip to the comma
location. We need to calculate it though as the string may have
just been changed.
2013-01-31 11:18:52 +01:00
Stephen Kelly 30268b46f8 Handle reading empty properties defined by the link interface.
This was segfaulting before.
2013-01-31 11:18:49 +01:00
Kitware Robot fc2638f0b4 CMake Nightly Date Stamp 2013-01-31 00:01:16 -05:00
Brad King da2b0245a3 Merge topic 'fix-target-property-commands'
7bf490e Make subclasses responsible for joining content.
f6b16d4 Don't allow targets args in the new target commands.
b3a7e19 Make the Property name protected so that subclasses can use it.
2013-01-30 09:38:52 -05:00
Kitware Robot 7462a8a8c3 CMake Nightly Date Stamp 2013-01-30 00:01:21 -05:00
Brad King 2eb7cee117 Merge topic 'fix-TARGET_PROPERTY-extraction'
5daaa5c Fix TARGET_PROPERTY target extractions.
2013-01-29 14:52:34 -05:00
Brad King 32b9e67057 Merge topic 'DocumentRelativePathHandling'
a7d6ebb documentation: handling of relative paths by include- and link_directories()
2013-01-29 14:52:22 -05:00
Brad King 5f78d2057f Merge topic 'fix-relocatable-include-dirs'
34d1ade Add the INSTALL_PREFIX genex.
3a17197 Generate the _IMPORT_PREFIX in the non-config export file.
2013-01-29 14:52:19 -05:00
Brad King 3e7bba3fb2 Merge topic 'fix-automoc-compile-defs'
429e369 Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc.
0e10782 Move GetCompileDefinitions to cmTarget.
2013-01-29 14:52:13 -05:00
Stephen Kelly 429e369974 Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc.
Fixes #13493.
2013-01-29 14:11:49 -05:00
Stephen Kelly 0e10782ba7 Move GetCompileDefinitions to cmTarget. 2013-01-29 14:11:49 -05:00
Stephen Kelly 7bf490e9bb Make subclasses responsible for joining content.
This way we can add handling of relative/absolute paths and of
-D in compile definitions.
2013-01-29 19:34:04 +01:00
Stephen Kelly f6b16d4b06 Don't allow targets args in the new target commands. 2013-01-29 18:44:54 +01:00
Stephen Kelly b3a7e19ee4 Make the Property name protected so that subclasses can use it.
Makes subclasses more dry in upcoming patches.
2013-01-29 17:20:45 +01:00
Stephen Kelly 5daaa5c48d Fix TARGET_PROPERTY target extractions.
We need to make sure we can export targets which have content such
as $<0:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES>

That means making not finding a target non-fatal here.
2013-01-29 10:56:09 -05:00
Kitware Robot 61d641dccb CMake Nightly Date Stamp 2013-01-29 00:01:18 -05:00
Kitware Robot e2afc40d06 CMake Nightly Date Stamp 2013-01-28 00:01:18 -05:00
Alex Neundorf a7d6ebb01b documentation: handling of relative paths by include- and link_directories()
Alex
2013-01-27 18:00:14 +01:00
Stephen Kelly 34d1ade048 Add the INSTALL_PREFIX genex. 2013-01-27 09:59:26 +01:00
Stephen Kelly 3a1719793f Generate the _IMPORT_PREFIX in the non-config export file. 2013-01-27 09:42:54 +01:00
Kitware Robot 00ba2545fa CMake Nightly Date Stamp 2013-01-27 00:01:25 -05:00
Kitware Robot f7db6d115d CMake Nightly Date Stamp 2013-01-26 00:01:18 -05:00
Brad King aa6ad9c903 Merge topic 'generator-expression-lf'
6c57c31 doc: fix linebreaks in generator expression documentation
2013-01-25 13:38:13 -05:00