Path: blob/master/Tests/CMakeCommands/target_link_libraries/SubDirA/CMakeLists.txt
3156 views
add_executable(SubDirA SubDirA.c)12# Link to a target imported in this directory that would not normally3# be visible to the directory in which TopDir is defined.4target_link_libraries(TopDir PUBLIC SameNameImported)5# Do the same through an interface library in the top.6target_link_libraries(TopDirInterface INTERFACE SameNameImported2)78# Link SubDirA to a target imported in this directory that has the same9# name as a target imported in SubDirB's directory. SubDirB will also10# tell us to link its copy. At compile time we verify both are linked.11target_link_libraries(SubDirA PRIVATE SameNameImported)1213# Import a target with the same name as a target imported in SubDirB.14# Distinguish this copy by having a unique usage requirement.15add_library(SameNameImported IMPORTED INTERFACE)16target_compile_definitions(SameNameImported INTERFACE DEF_SameNameImportedSubDirA)17add_library(SameNameImported2 INTERFACE IMPORTED)18target_compile_definitions(SameNameImported2 INTERFACE DEF_SameNameImported2SubDirA)192021