0

简单的文件夹结构就像

Root
    CMakeLists.txt
    SubA
        CMakeLists.txt
        some files to be built...
    SubB
        CMakeLists.txt
        some files to be built...

假设我add_library(SubDirLib fooX.cpp)SubA/CMakeLists.txt其中X 分别是 A 和 B ,SubB/CMakeLists.txt我如何链接两个库SubA/SubDirLib和?请注意,如果我打电话,它将是名称冲突SubB/SubDirLibRoot/CMakeLists.txt

add_subdirectory(SubA)
add_subdirectory(SubB)

Root/CMakeLists.txt

4

0 回答 0