Add a test for the interfaces in targets exported from the build tree.

This commit is contained in:
Stephen Kelly 2013-01-12 00:00:42 +01:00 committed by Brad King
parent 6c828f9126
commit 1d47cd94f3
2 changed files with 14 additions and 16 deletions

View File

@ -250,6 +250,7 @@ endif()
# Export from build tree. # Export from build tree.
export(TARGETS testExe1 testLib1 testLib2 testLib3 export(TARGETS testExe1 testLib1 testLib2 testLib3
testExe2libImp testLib3Imp testLib3ImpDep testExe2libImp testLib3Imp testLib3ImpDep
testSharedLibRequired testSharedLibDepends
NAMESPACE bld_ NAMESPACE bld_
FILE ExportBuildTree.cmake FILE ExportBuildTree.cmake
) )

View File

@ -159,22 +159,19 @@ endif()
add_executable(deps_iface deps_iface.c) add_executable(deps_iface deps_iface.c)
target_link_libraries(deps_iface testLibDepends) target_link_libraries(deps_iface testLibDepends)
set_property(TARGET deps_iface APPEND PROPERTY target_include_directories(deps_iface PRIVATE testLibDepends)
COMPILE_DEFINITIONS target_compile_definitions(deps_iface PRIVATE testLibDepends)
$<TARGET_PROPERTY:testLibDepends,INTERFACE_COMPILE_DEFINITIONS>
)
set_property(TARGET deps_iface APPEND PROPERTY
INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:testLibDepends,INTERFACE_INCLUDE_DIRECTORIES>
)
add_executable(deps_shared_iface deps_shared_iface.cpp) add_executable(deps_shared_iface deps_shared_iface.cpp)
target_link_libraries(deps_shared_iface testSharedLibDepends) target_link_libraries(deps_shared_iface testSharedLibDepends)
set_property(TARGET deps_shared_iface APPEND PROPERTY target_include_directories(deps_shared_iface PRIVATE testSharedLibDepends)
COMPILE_DEFINITIONS target_compile_definitions(deps_shared_iface PRIVATE testSharedLibDepends)
$<TARGET_PROPERTY:testSharedLibDepends,INTERFACE_COMPILE_DEFINITIONS>
) #-----------------------------------------------------------------------------
set_property(TARGET deps_shared_iface APPEND PROPERTY # Test that targets imported from the build tree have their dependencies
INCLUDE_DIRECTORIES # evaluated correctly. The above already tests the same for the install tree.
$<TARGET_PROPERTY:testSharedLibDepends,INTERFACE_INCLUDE_DIRECTORIES>
) add_executable(deps_shared_iface2 deps_shared_iface.cpp)
target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends)
target_include_directories(deps_shared_iface2 PRIVATE bld_testSharedLibDepends)
target_compile_definitions(deps_shared_iface2 PRIVATE bld_testSharedLibDepends)