mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 14:01:21 +00:00
750eb105c2
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.
16 lines
558 B
CMake
16 lines
558 B
CMake
cmake_minimum_required(VERSION 2.7.20090708)
|
|
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
|
|
# not set the property:
|
|
#set_property(TARGET LinkLanguage PROPERTY LINKER_LANGUAGE CXX)
|