0

I wan't to compile an external library:

It works with the complete path of the source like:

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

It DOESN'T works

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

And I get the error message:

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

What can I do to solve the Problem?

marco.m
  • 4,573
  • 2
  • 26
  • 41
post4dirk
  • 313
  • 4
  • 16

1 Answers1

0

And that is the solution! No whildcards in function add_library

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

add_library(timetool ${timetool_SRC}
post4dirk
  • 313
  • 4
  • 16
  • You should change add_library(timetool ${timetool_SRC} to add_library(timetool ${timetool_SRC}) you forgot ')'. – blitu12345 Apr 04 '19 at 07:44