2017-01-23 63 views
0

我wan't編譯外部庫:CMake的錯誤:

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

它不工作:

它與像源的完整路徑

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 

我能做些什麼來解決問題?

+0

@弗洛裏安:謝謝,你要對 「無whildcards在功能'add_library'」 – post4dirk

回答

0

這就是解決方案!在功能上沒有whildcards add_library

file(GLOB timetool_SRC "../src/wnt/*.cxx" 
         "../../../../include/*.h" 

add_library(timetool ${timetool_SRC}