Path: blob/master/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
3156 views
add_executable(SubDirB SubDirB.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 debug SameNameImported optimized SameNameImported)5# Do the same through an interface library in the top.6target_link_libraries(TopDirInterface INTERFACE debug SameNameImported2 optimized SameNameImported2)78# Link to a list of targets imported in this directory that would not9# normally be visible to the directory in which TopDir is defined.10target_link_libraries(TopDir PUBLIC "$<1:SameNameImported;SameNameImported>")1112# Link SubDirA to a target imported in this directory that has the same13# name as a target imported in SubDirA's directory. We verify when14# compiling SubDirA that it sees our target and its own.15target_link_libraries(SubDirA PRIVATE SameNameImported)1617# Import a target with the same name as a target imported in SubDirA.18# Distinguish this copy by having a unique usage requirement.19add_library(SameNameImported IMPORTED INTERFACE)20target_compile_definitions(SameNameImported INTERFACE DEF_SameNameImportedSubDirB)21add_library(SameNameImported2 INTERFACE IMPORTED)22target_compile_definitions(SameNameImported2 INTERFACE DEF_SameNameImported2SubDirB)232425