summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/target_link_libraries
Commit message (Collapse)AuthorAgeFilesLines
* Tests: add tests for empty-value keyword arguments in target_*Ben Boeckel2018-10-262-0/+5
| | | | | | Not all of these commands accept non-compilable (i.e., IMPORTED) targets, so those calls are currently just commented out. If they ever do start to accept them, the tests should be enabled.
* Testing: Update hard-coded line numbers to [0-9]+ in some testsKyle Edwards2018-10-106-6/+6
|
* target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-1227-11/+77
| | | | | | | | | | | | | | | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
* Revert "target_link_libraries: Allow use with targets in other directories"Brad King2018-07-0315-94/+7
| | | | | | | | | Revert commit v3.12.0-rc1~82^2 (target_link_libraries: Allow use with targets in other directories, 2018-05-11). The RHS target scoping and visibility rules are not clear and will need further investigation before the feature can be added. Issue: #17943
* target_link_libraries: Allow use with targets in other directoriesPatrick Stotko2018-05-1515-7/+94
| | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Fixes: #17943
* target_link_libraries: Slightly fix some error-messages.Deniz Bahadir2017-11-291-2/+2
| | | | | Some error-messages are slightly adjusted to better tell what invocation would be correct instead. Tests are adjusted accordingly.
* Teach target_* commands to set INTERFACE properties of IMPORTED targetsDeniz Bahadir2017-10-265-0/+12
| | | | | | | | | | | Now, several `INTERFACE_*` properties can be set on `IMPORTED` targets, not only via `set_property` and `set_target_properties` but also via `target_compile_definitions`, `target_compile_features`, `target_compile_options`, `target_include_directories`, `target_sources` and `target_link_libraries`. Fixes: #15689 Issue: #17197
* target_link_libraries: Allow linking to UNKNOWN IMPORTED GLOBAL libsBrad King2017-08-312-0/+5
| | | | | | This combination was accidentally rejected. Allow it and add a test. Fixes: #17245
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1/+1
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Fix export of STATIC library PRIVATE non-target dependenciesBrad King2016-02-175-0/+17
| | | | | | | | | | | | | | | | | | | In commit v3.5.0-rc1~43^2 (Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW, 2016-01-15) we taught target_link_libraries to generate `$<LINK_ONLY:$<TARGET_NAME:dep>>` in INTERFACE_LINK_LIBRARIES instead of `$<LINK_ONLY:dep>` so that `dep` can be recognized as a target name and updated during export. However, this approach does not work when `dep` is just a plain library name and not a target because `$<TARGET_NAME:...>` requires the name of a reachable target. Since we do not know during target_link_libraries whether the name will correspond to a reachable target or not, we cannot inject the `$<TARGET_NAME:...>` expression. Revert this change and solve the original problem instead by teaching the export logic to recognize and update target names directly in `$<LINK_ONLY:...>` expressions. Reported-by: Ben Boeckel <ben.boeckel@kitware.com>
* cmComputeLinkInformation: Lookup a target only if we have oneBrad King2015-08-132-0/+11
| | | | | | | | | The change in commit 27252b24 (cmComputeLinkInformation: Simplify generator object access, 2015-08-02) broke the conditional use of a target introduced in commit 41abdc17 (cmGeneratorTarget: Move GetSOName from cmTarget, 2015-08-04). Restore the conditional lookup. Add a test case that hacks platform information variables to trigger this code everywhere.
* cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)Brad King2015-06-256-0/+11
| | | | | | | | | | Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a target that was defined in another (non-ancestor) directory crashes because no execution context is left active. Fix this by getting the execution context from the actual cmMakefile where the current target_link_libraries call takes place. Test this by verifying that such calls correctly produce an error diagnostic instead of crashing.
* Policies: omit warnings about unset policies when they are actually set to NEWNils Gladitz2014-03-312-10/+0
|
* Cygwin: Avoid legacy warnings in RunCMake.* testsBrad King2013-08-131-1/+1
| | | | | | Set the minimum required version of CMake high enough to avoid the warning for CMAKE_LEGACY_CYGWIN_WIN32. The warning appears on stderr and breaks the expected output matching.
* target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signatureStephen Kelly2013-07-2421-0/+149
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.