diff options
author | Brad King <brad.king@kitware.com> | 2009-10-05 13:07:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-10-05 13:07:09 (GMT) |
commit | 750eb105c225a2c1b9e012fbae2cead4f12b83d4 (patch) | |
tree | e2594219ad744e47213da1a3dd748287fcd8d2f7 /Tests/LinkLanguage | |
parent | 0fb5b2c88c18925fae141a2fcf47a135d710bec4 (diff) | |
download | CMake-750eb105c225a2c1b9e012fbae2cead4f12b83d4.zip CMake-750eb105c225a2c1b9e012fbae2cead4f12b83d4.tar.gz CMake-750eb105c225a2c1b9e012fbae2cead4f12b83d4.tar.bz2 |
Test target link information invalidation
We test this by adding export(TARGETS) to the LinkLanguage test to
export the executable before the library is linked to it. Since
export(TARGETS) computes the link interface of the target (so that it
can export it), this ensures that the information is recomputed after
the link library is added.
Diffstat (limited to 'Tests/LinkLanguage')
-rw-r--r-- | Tests/LinkLanguage/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/LinkLanguage/CMakeLists.txt b/Tests/LinkLanguage/CMakeLists.txt index 89c2982..b4e5392 100644 --- a/Tests/LinkLanguage/CMakeLists.txt +++ b/Tests/LinkLanguage/CMakeLists.txt @@ -3,6 +3,11 @@ project(LinkLanguage C CXX) add_library(foo STATIC foo.cxx) add_executable(LinkLanguage LinkLanguage.c) + +# Export the target now to compute its link interface and implementation. +# This tests that the link info is recomputed after the library is linked. +export(TARGETS LinkLanguage FILE LinkLanguageTargets.cmake) + target_link_libraries(LinkLanguage foo) # CMake should now automatically choose CXX for linking, so we need |