简单的文件夹结构就像
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/SubDirLib
Root/CMakeLists.txt
add_subdirectory(SubA)
add_subdirectory(SubB)
在Root/CMakeLists.txt