summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeCommands
Commit message (Collapse)AuthorAgeFilesLines
* Test that linking using the debug keyword to tll works.Stephen Kelly2013-05-161-0/+8
|
* Rename variable for including current directory in interfacesBrad King2013-03-191-1/+1
| | | | | | | | | 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>
* Merge topic 'fix-transitive-target-names'Brad King2013-03-122-0/+8
|\ | | | | | | | | | | 1bdd167 Restore support for target names with '+' (#13986) 254687d Only process transitive interface properties for valid target names.
| * Restore support for target names with '+' (#13986)Stephen Kelly2013-03-122-0/+8
| | | | | | | | | | | | | | | | | | 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
* | Remove unused parameters from target_link_libraries tests.Stephen Kelly2013-03-063-3/+3
|/
* Revert "Add the TARGET_DEFINED generator expression"Stephen Kelly2013-02-252-10/+0
| | | | | | | | | | | | | | | | This reverts commit 2bee6f5ba5b3f33817cc00e056a7df60d05c9399. 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
* Remove use of TARGET_DEFINED from the target_link_libraries test.Stephen Kelly2013-02-251-4/+4
| | | | | | Update the unit test introduced in commit 57175d55 (Only use early evaluation termination for transitive properties., 2013-02-07) to not use the expression, but still test the appropriate code.
* Remove use of TARGET_DEFINED from target_include_directories test.Stephen Kelly2013-02-251-3/+3
| | | | | | | Change the unit test introduced in commit 24dcf0c0 (Make sure generator expressions can be used with target_include_directories., 2013-01-16) to not use the expression, but still test the appropriate code.
* Revert "Add the $<LINKED:...> generator expression."Stephen Kelly2013-02-134-23/+0
| | | | | | | | | This reverts commit 0b92602b816e2584db3781b120a1e5200da72ada. Conflicts: Source/cmGeneratorExpressionEvaluator.cxx Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt Tests/CMakeCommands/target_include_directories/CMakeLists.txt
* Don't use LINKED where not needed.Stephen Kelly2013-02-122-2/+2
|
* Only use early evaluation termination for transitive properties.Stephen Kelly2013-02-071-1/+4
| | | | | | 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.
* Add includes and compile definitions with target_link_libraries.Stephen Kelly2013-01-314-4/+51
| | | | | | | | 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.
* Add the $<LINKED:...> generator expression.Stephen Kelly2013-01-314-1/+25
| | | | | | 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.
* Make subclasses responsible for joining content.Stephen Kelly2013-01-295-0/+13
| | | | | This way we can add handling of relative/absolute paths and of -D in compile definitions.
* Don't allow targets args in the new target commands.Stephen Kelly2013-01-292-2/+2
|
* Merge topic 'disallow-IMPORTED-interface-porcelain'Brad King2013-01-235-27/+2
|\ | | | | | | | | | | b98d14d Disallow porcelain to populate includes and defines of IMPORTED targets. 48a4cf2 Revert "Allow target_link_libraries with IMPORTED targets."
| * Disallow porcelain to populate includes and defines of IMPORTED targets.Stephen Kelly2013-01-214-24/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With similar reasoning to the parent commit, as downstreams, we can't determine what $<CONFIG> generator expressions would be appropriate. Upstream would have populated the INTERFACE_INCLUDE_DIRECTORIES with config-specific generator expressions, possibly appropriate for their DEBUG_CONFIGURATIONS. In theory, if we would add include directories for a DEBUG intent, we would have to match the upstream configurations for that. Rather than attempting to discover the appropriate configurations at this time, simplify the feature instead. The use of IMPORTED targets with these commands could still be added in the future if targets would export their DEBUG_CONFIGURATIONS somehow.
| * Revert "Allow target_link_libraries with IMPORTED targets."Stephen Kelly2013-01-211-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9cfe4f1b769597bd9ba179eba46572a9df27f64c. It turns out that correctly adding the content to the IMPORTED_LINK_INTERFACE_LIBARIES_<CONFIG> of an upstream target from the buildsystem of a downstream project is not simple. If upstream had added the INTERFACE content, the config-specific properties would be determined by the DEBUG_CONFIGURATIONS of upstream. As downstream, we don't have any information about what the DEBUG_CONFIGURATIONS of upstream were, so we can't determine which configuration-specific properties to populate. The best we can do is add it to all of them or add it to the ones downstream considers to be DEBUG_CONFIGURATIONS, neither of which is a good solution. So, removing the porcelain API for that is the best approach. A human can still determine which properties to populate and use the set_property API to populate the desired properies. Another solution to this would be for upstream targets to publish what they consider DEBUG_CONFIGURATIONS, but that can be added in a future release.
* | Make sure generator expressions can be used with target_include_directories.Stephen Kelly2013-01-161-1/+6
|/ | | | | Handle the case that a generator expression is used before treating a non-target as an error.
* Add the TARGET_DEFINED generator expressionStephen Kelly2013-01-132-0/+10
| | | | This tests whether the parameter is a usable target.
* Allow generator expressions in LINK_INTERFACE_LIBRARIES.Stephen Kelly2013-01-104-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge topic 'target-includes-defines-commands'Brad King2013-01-106-0/+157
|\ | | | | | | | | | | fc61a7a Add the target_compile_definitions command. 8a37ebe Add the target_include_directories command.
| * Add the target_compile_definitions command.Stephen Kelly2013-01-103-0/+58
| | | | | | | | This is a convenience API to populate the corresponding properties.
| * Add the target_include_directories command.Stephen Kelly2013-01-103-0/+99
| | | | | | | | This is a convenience API to populate the corresponding properties.
* | Merge topic 'tll-IMPORTED-targets'Brad King2013-01-101-0/+3
|\ \ | | | | | | | | | | | | 9cfe4f1 Allow target_link_libraries with IMPORTED targets.
| * | Allow target_link_libraries with IMPORTED targets.Stephen Kelly2013-01-081-0/+3
| |/ | | | | | | | | | | | | | | | | This makes it possible to use: target_link_libraries(foo LINK_INTERFACE_LIBRARIES bar) where foo is an IMPORTED target. Other tll() signatures are not allowed.
* | Merge topic 'LINK_LIBRARIES-property'Brad King2013-01-084-1/+31
|\ \ | | | | | | | | | | | | | | | 7653862 Add LINK_LIBRARIES property for direct target link dependencies 40cf3fb Make linking APIs aware of 'head' target
| * | Add LINK_LIBRARIES property for direct target link dependenciesStephen Kelly2013-01-084-1/+31
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we kept direct link dependencies in OriginalLinkLibraries. The property exposes the information in the CMake language through the get/set_property commands. We preserve the OriginalLinkLibraries value internally to support old APIs like that for CMP0003's OLD behavior, but the property is now authoritative. This follows up from commit d5cf644a (Split link information processing into two steps, 2012-11-01). This will be used later to populate the link interface properties when exporting targets, and will later allow use of generator expressions when linking to libraries with target_link_libraries. Also make targets depend on the (config-specific) union of dependencies. CMake now allows linking to dependencies or not depending on the config. However, generated build systems are not all capable of processing config-specific dependencies, so the targets depend on the union of dependencies for all configs.
* | Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.Stephen Kelly2013-01-085-1/+36
|/ | | | | | | | | | | | | | | | | | | | | | This makes set(CMAKE_BUILD_INTERFACE_INCLUDES ON) add the equivalent of set_property(TARGET tgt APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}> ) to every target. If the headers are in CMAKE_CURRENT_SOURCE_DIR, and the generated headers are in CMAKE_CURRENT_BINARY_DIR, this is a convenient way to build a target bar, which depends on foo, just by using target_link_libraries() and adding the INTERFACE_INCLUDE_DIRECTORIES to the INCLUDE_DIRECTORIES of the target being linked. There will be more-convenient porcelain API to consume the property in the future.
* Merge topic 'fix-test-warnings'Brad King2013-01-031-1/+1
|\ | | | | | | | | b6346f2 Tests: Fix warning about unused variable
| * Tests: Fix warning about unused variableStephen Kelly2013-01-031-1/+1
| | | | | | | | | | | | | | | | | | Resolve this warning: ".../Tests/CMakeCommands/target_link_libraries/depB.cpp", line 8: warning: variable "a" was declared but never referenced DepA a; ^
* | Make targets depend on the link interface of their dependees.Stephen Kelly2013-01-034-1/+25
|/
* Use generalized RunCMake test infrastrucure for build_command testBrad King2012-03-123-154/+0
| | | | | | | The CMakeCommands.build_command test performs output/error checking so move it over to RunCMake to re-use the generalized infrastrucure. This is the only test left using Tests/CMakeCommands/CMakeLists.txt so remove it.
* Use generalized RunCMake test infrastrucure for find_package testBrad King2012-03-1231-341/+0
|
* find_package: Test that REQUIRED aborts processing correctlyBrad King2012-03-0712-3/+26
| | | | | Verify that the command produces a FATAL_ERROR if and only if the missing package is REQUIRED.
* find_package: Test error and warning messages in failure casesBrad King2012-02-2831-0/+318
| | | | | | | | Add a "CMakeCommands.find_package" test to run CMake on a bunch of cases in which find_package fails. Check that the process return code and warning/error messages are as expected. Record expected test output in corresponding files for reference by the check. These files will also serve as a reference for the message text in each case.
* Add infrastructure for CMakeCommands testsBrad King2012-02-282-0/+10
| | | | | Generalize the build_command test framework as a macro to add the test. Process the CMakeCommands subdirectory explicitly.
* GenerateExportHeader test: add newlines before end of fileRolf Eike Beer2012-01-171-1/+1
|
* target_link_libraries: Add LINK_(PUBLIC|PRIVATE) optionsStephen Kelly2011-11-228-0/+127
| | | | | Makes it possible to specify the link dependencies and link interfaces in one command without repetition.
* Fix issue #2336 - honor the -C arg to ctest. Honor it for all stages of ↵David Cole2009-12-042-0/+144
running -D dashboards from the command line and running ctest_configure, ctest_build and ctest_test commands in -S scripts. Also, allow a script to change it by setting the CTEST_CONFIGURATION_TYPE variable: allows for multiple configuration build/test cycles within one script. Add a new signature for the cmake command build_command that accepts CONFIGURATION as one argument. The original build_command signature is still there, but now marked as deprecated in the documentation. Of course... also add CTestConfig tests to verify that -C is honored for -D dashboards and -S scripts.