Commit Graph

2479 Commits

Author SHA1 Message Date
Stephen Kelly 370bf55415 Add the ALIAS target concept for libraries and executables.
* The ALIAS name must match a validity regex.
* Executables and libraries may be aliased.
* An ALIAS acts immutable. It can not be used as the lhs
  of target_link_libraries or other commands.
* An ALIAS can be used with add_custom_command, add_custom_target,
  and add_test in the same way regular targets can.
* The target of an ALIAS can be retrieved with the ALIASED_TARGET
  target property.
* An ALIAS does not appear in the generated buildsystem. It
  is kept separate from cmMakefile::Targets for that reason.
* A target may have multiple aliases.
* An ALIAS target may not itself have an alias.
* An IMPORTED target may not have an alias.
* An ALIAS may not be exported or imported.
2013-08-02 15:21:00 +02:00
Brad King b341bf2178 Merge topic 'INCLUDES-DESTINATION-no-config'
80e652f Export: Process generator expressions from INCLUDES DESTINATION.
4355815 cmTarget: Add NAME property
2013-08-01 08:54:15 -04:00
Stephen Kelly 80e652f5cc Export: Process generator expressions from INCLUDES DESTINATION.
Configuration sensitive expressions are not permitted.
2013-08-01 00:37:25 +02:00
Stephen Kelly c0b8682200 Allow target commands to be invoked with no items (#14325).
Code such as

 target_include_directories(foo PRIVATE ${items})

should not work or break based on whether items is defined or not.
2013-07-31 16:06:34 +02:00
Brad King e3b6ab92db Merge topic 'static_library_flags'
33e6e0b VS6: Add handling of CMAKE_*_LINKER_FLAGS_<CONFIG> variables
152dfda Add additonal tests for the linker flags
20ed496 Add documentation for the missing CMAKE_*_LINKER_FLAGS_* variables
54f7019 Add CMAKE_STATIC_LINKER_FLAGS to CMakeCommonLanguageInclude
2a43c30 Add support for CMAKE_STATIC_LINKER_FLAGS
14bbf83 Unify the way the flags of a static library are read
2013-07-31 08:49:01 -04:00
Brad King 4e3675ae91 Merge topic 'ninja_bad_cmcldeps_paths'
d12459f VS 6: Tell BuildDepends test to tolerate ninjadep failure
2013-07-31 08:48:52 -04:00
Brad King b728ec3c31 Merge topic 'install-interface-includes'
72d13ff install: Remove error condition using INCLUDES DESTINATION without EXPORT.
2013-07-31 08:48:36 -04:00
Patrick Gansterer 152dfdab11 Add additonal tests for the linker flags
Extend Tests/LinkFlags to test libraries of the type MODULE and
the content of the CMAKE_*_LINKER_FLAGS_* variables.
2013-07-31 08:41:08 -04:00
Brad King d12459f79e VS 6: Tell BuildDepends test to tolerate ninjadep failure
The VS 6 IDE does not want to recompile a particular source after
a particular header it includes is modified, even by hand.  For
now just silence the failure and document it with a comment.
2013-07-30 09:41:46 -04:00
Brad King c18117a129 Merge topic 'fix-export-includes-crash'
f868e47 Fix crash on export of target with empty INTERFACE_INCLUDE_DIRECTORIES.
2013-07-29 09:59:29 -04:00
Brad King 63728df6e5 Merge topic 'memcheck_pre_post_args'
c0756b6 Revert "CTest: fix pre and post test commands with spaces" (#13887)
2013-07-29 09:55:27 -04:00
Brad King 50c5eb508c Merge topic 'ninja_bad_cmcldeps_paths'
9275554 Ninja: Update BuildDepends test to verify cmcldeps depfiles.
6fa9d0a Ninja: Make cmcldeps depfile output more consistent with 'ninja -t msvc'
2013-07-29 09:54:48 -04:00
Brad King 3dace78c2c Merge topic 'minor-cleanups'
b8dc7fa Genex: Disallow LINKER_LANGUAGE only when used on a static library.
c8a10ba cmTarget: Fix iface libraries and languages for static libraries.
f94bdb3 cmTarget: Remove duplicates when printing traces of tll signatures
ff3d5fa Export: Fix typo of LINK_INTERFACE_LIBRARIES.
79a7a81 Docs: Document variables for default visibility values.
6f6391b Docs: Generalize and de-duplicate VISIBILITY_PREFIX docs.
d8cb47f Docs: Trim trailing whitespace in generated doc.
f10e648 Docs: Document existing target property debugging options.
4f4d69f Qt4Macros: Simplify some variable population.
a413a40 Qt4Macros: Remove undefined varible use.
b60a29e Qt4Macros: Remove unneeded generate CONDITION.
e454cba Docs: Document file(GENERATE) CONDITION as optional.
2013-07-29 09:54:34 -04:00
Stephen Kelly f868e47236 Fix crash on export of target with empty INTERFACE_INCLUDE_DIRECTORIES.
The new feature of install(TARGETS ... INCLUDES DESTINATION) introduced
in commit 650e61f8 (Add a convenient way to add the includes install
dir to the INTERFACE., 2013-01-05) introduced this crash. If the
new feature is used with a target which has no
INTERFACE_INCLUDE_DIRECTORIES, a segfault occurred.
2013-07-29 15:50:24 +02:00
Stephen Kelly 72d13ff482 install: Remove error condition using INCLUDES DESTINATION without EXPORT.
Commit 650e61f8 (Add a convenient way to add the includes install
dir to the INTERFACE., 2013-01-05) introduced an error case for
using the install(TARGETS) command with specified INCLUDES DESTINATION,
but no specified EXPORT set.

It is convenient to use a variable to set the various destinations
for different outputs (as KDE does), and some targets such as
executables are installed but not exported. This was triggering
the error case, but as it is a common case, remove the error.
2013-07-29 15:16:15 +02:00
Rolf Eike Beer c0756b6dd6 Revert "CTest: fix pre and post test commands with spaces" (#13887)
This reverts commit 6187876dea.

It was actually possible before to have paths with spaces in them, the spaces
just need to be quoted. This way spaces will work as argument separators.
2013-07-27 22:05:47 +02:00
Stephen Kelly b8dc7fad23 Genex: Disallow LINKER_LANGUAGE only when used on a static library.
For shared libraries and executables, the linker_language is
indepenedent of the linked libraries.
2013-07-26 16:58:25 +02:00
Robert Maynard 9275554496 Ninja: Update BuildDepends test to verify cmcldeps depfiles. 2013-07-26 10:12:03 -04:00
Stephen Kelly c8a10ba9ad cmTarget: Fix iface libraries and languages for static libraries. 2013-07-26 15:15:42 +02:00
Brad King dda6e93666 Merge topic 'install-interface-relative'
d777b8e Genex: Allow relative paths in INSTALL_INTERFACE.
2013-07-26 09:01:19 -04:00
Brad King c82b1cbe83 Merge topic 'install-interface-includes'
650e61f Add a convenient way to add the includes install dir to the INTERFACE.
2013-07-26 09:01:06 -04:00
Stephen Kelly ff3d5fae5d Export: Fix typo of LINK_INTERFACE_LIBRARIES.
Refer correctly to the old property, not the new one.
2013-07-26 13:10:06 +02:00
Brad King 10e54cd6c9 Merge topic 'dev/export-target-without-language'
5837f19 export: Error when exporting a target without a language
2013-07-25 08:47:49 -04:00
Brad King 17fb435b21 Merge topic 'doc-RunCMake-strips-expected'
c80a4f9 Tests/RunCMake: Document stripping of expected output
2013-07-25 08:47:17 -04:00
Ben Boeckel 5837f19690 export: Error when exporting a target without a language
First, it prevents a NULL dereference and second it reiterates that
targets without languages are not supported by CMake.

Add a RunCMake.ExportWithoutLanguage test exporting a library without a
languages.
2013-07-25 08:44:57 -04:00
Ben Boeckel c80a4f92ce Tests/RunCMake: Document stripping of expected output
Document that trailing newlines are stripped from the -stdout.txt
and -stderr.txt content before using as a regular expression.
2013-07-25 08:38:53 -04:00
Brad King 2f8dace125 Merge topic 'tll-new-signatures'
b655865 target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
2013-07-25 08:37:16 -04:00
Brad King 9f8fcdd2d8 Merge topic 'compile-defs-debugging'
a43e5e0 Test COMPILE_DEFINITIONS target property get/set/get round-trip
2013-07-25 08:37:13 -04:00
Stephen Kelly d777b8e716 Genex: Allow relative paths in INSTALL_INTERFACE.
These paths can be prepended with the ${_IMPORT_PREFIX} generated
in the export file.

Such relative paths were previously an error.
2013-07-25 14:31:22 +02:00
Brad King a43e5e0ad5 Test COMPILE_DEFINITIONS target property get/set/get round-trip
Teach the Preprocess test to get, set, and then get the same value for
the COMPILE_DEFINITIONS target property and verify that the value is not
changed.  This ensures the internal structured storage of the property
value can reproduce the original string value.
2013-07-24 13:25:47 -04:00
Stephen Kelly b655865bbf target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
Add a new signature to help populate INTERFACE_LINK_LIBRARIES and
LINK_LIBRARIES cleanly in a single call.  Add policy CMP0023 to control
whether the keyword signatures can be mixed with uses of the plain
signatures on the same target.
2013-07-24 11:52:44 -04:00
Brad King 828ddb6813 Merge topic 'framework-interface-includes'
f5ca872 Use linked frameworks as a source of include directories.
2013-07-24 11:50:49 -04:00
Stephen Kelly f5ca872e8b Use linked frameworks as a source of include directories. 2013-07-24 11:49:06 -04:00
Stephen Kelly 650e61f833 Add a convenient way to add the includes install dir to the INTERFACE.
Export the INCLUDES DESTINATION without appending to the
INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target
can be exported multiple times with different INCLUDES DESTINATION
without unintended cross-pollution of export sets.
2013-07-24 17:32:58 +02:00
Brad King e31c4bd9a6 Merge topic 'dev/property-append-with-empty-string'
31bd83e set_property: Do not remove a property when APPENDing nothing
2013-07-24 11:02:44 -04:00
Brad King 571d050415 Merge topic 'fix-mapped-config-genex'
10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
2013-07-24 11:02:19 -04:00
Brad King 6077847edc Merge topic 'remove-LINK_LANGUAGE-genex'
4f6bd70 Remove the LINK_LANGUAGE generator expression.
2013-07-24 11:02:14 -04:00
Ben Boeckel 31bd83e9fc set_property: Do not remove a property when APPENDing nothing 2013-07-24 10:50:15 -04:00
Stephen Kelly 10a069b504 Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
The old code checked only that there was a LOCATION for the
specified config, but did not check whether the config actually
mapped.

Task-number: 14292
2013-07-24 10:43:02 -04:00
Stephen Kelly 4f6bd7022b Remove the LINK_LANGUAGE generator expression.
It accepted an optional argument to test for equality, but no way
to get the linker language of a particular target.

TARGET_PROPERTY provides this flexibility and STREQUAL provides
the necessary API for equality test.

Extend the CompileDefinitions test to cover accessing the
property of another target.
2013-07-24 10:40:00 -04:00
Brad King 8521a909ba Merge topic 'rpath-on-mac'
603bc59 OS X: Fix regression handling frameworks for Ninja
e645ff0 OS X: Enable rpath support on Mac OS X when find_library() is used.
2013-07-22 09:48:44 -04:00
Brad King fd8746d038 Merge topic 'SelectLibraryConfigurations'
04d4dc3 SelectLibraryConfigurations: Use -NOTFOUND instead of copying the vars
07b44e7 SelectLibraryConfigurations: Do not cache the _LIBRARY variable
2013-07-22 09:48:39 -04:00
Brad King 29859c09af Merge topic 'cpack-wix'
bf23891 CPackWIX: Add support for custom WiX templates
155bb01 CMakeCPack: Provide an upgrade guid for WiX
bfa2e29 CPackWIX: Add option to specify the language(s) of the installer
6e51ea9 CPackWIX: Handle multiple shortcuts in the start menu
6d77e1a CPackWIX: Fix MSI package layout regression from parent
8c0e325 CPackWIX: Handle CPACK_PACKAGE_EXECUTABLES (#13967)
2013-07-22 09:48:32 -04:00
Daniele E. Domenichelli 04d4dc3374 SelectLibraryConfigurations: Use -NOTFOUND instead of copying the vars
If one of the libraries (_DEBUG or _RELEASE) is not set, the value is
set to the value of the other one.  FindQt4, from which the macro is
extracted, sets the values to XXX_LIBRARY_{DEBUG,RELEASE}-NOTFOUND
instead.  In both cases the XXX_LIBRARY is correct, but using NOTFOUND
makes it easier to understand which one is missing.

Update Tests/CMakeOnly/SelectLibraryConfigurations with the new logic.
2013-07-22 09:37:33 -04:00
Fredrik Axelsson 8c0e32550c CPackWIX: Handle CPACK_PACKAGE_EXECUTABLES (#13967)
Add start menu items including an uninstall shortcut.  Add variable
CPACK_WIX_PROGRAM_MENU_FOLDER to configure folder name.
2013-07-19 10:49:00 -04:00
Brad King 4dc4018553 Teach compiler ABI check to tolerate try_compile COPY_FILE failure
In CMakeDetermineCompilerABI we use try_compile with the COPY_FILE
option to get a copy of the compiled binary used to detect the ABI
information.  We already tolerate the case when compilation fails.
However, when compilation appears to succeed but does not produce the
expected executable the try_compile command immediately reports an error
because the COPY_FILE fails.

Tolerate COPY_FILE failure without stopping the overall configuration
process by using the try_compile COPY_FILE_ERROR option to capture the
error message.  Log the full error to CMakeError.log and simply report
failure to detect the ABI as if compilation had failed.

Teach the RunCMake.Configure test to cover this case and verify that the
messages show up as expected both in stdout and in CMakeError.log.
2013-07-17 15:40:44 -04:00
Brad King f82c751d7b Merge topic 'INTERFACE_LINK_LIBRARIES-prop'
295a42c Fix ExportImport test cmp0022NEW build on Watcom
2013-07-17 08:47:30 -04:00
Brad King 295a42c96c Fix ExportImport test cmp0022NEW build on Watcom
The test uses generate_export_header(cmp0022OLD ...) to generate the
cmp0022_export.h header used by both cmp0022OLD and cmp0022NEW.  In
the latter the _EXPORTS symbol does not match what the header expects
so the library does not export anything.  The Watcom linker does not
like to create shared libraries that do not export any symbols.

Fix this by setting the DEFINE_SYMBOL property on cmp0022NEW to match
that of cmp0022OLD as the header expects.
2013-07-16 14:08:50 -04:00
Brad King 9c119b829d Merge topic 'obsolete-qt4-macros'
cb7f32f Mark qt4_use_modules and qt4_automoc as obsolete.
2013-07-16 13:59:22 -04:00
Brad King 41a2fb5ba0 Merge topic 'tid-system-argument'
9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
1925cff Add a SYSTEM parameter to target_include_directories (#14180)
286f227 Extend the cmTargetPropCommandBase interface property handling.
83498d4 Store system include directories in the cmTarget.
f1fcbe3 Add Target API to determine if an include is a system include.
2679a34 Remove unused variable.
2013-07-16 13:59:07 -04:00