CMakeLists.txt(add_library)的CMake错误:

时间:2017-01-23 10:48:16

标签: cmake

我不想编译外部库:

它适用于源的完整路径,如:

add_library(timetool   "../src/wnt/foo.cxx"
                       "../../../../include/foo.h"

它没有' T工作

add_library(timetool   "../src/wnt/*.cxx"
                       "../../../../include/*.h"

我收到错误消息:

CMake Error at CMakeLists.txt:25 (add_library):
Cannot find source file:

../src/*.cxx

Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

我该怎么做才能解决问题?

1 个答案:

答案 0 :(得分:0)

这就是解决方案!函数add_library

中没有whildcards
file(GLOB timetool_SRC   "../src/wnt/*.cxx"
                         "../../../../include/*.h"

add_library(timetool ${timetool_SRC}