How to exclude one file from cmake `file (GLOB ...) template?

My CMakeLists.txt contains the following line:

file(GLOB lib_srcs Half/half.cpp Iex/*.cpp IlmThread/*.cpp Imath/*.cpp IlmImf/*.cpp)

and the IlmImf folder contains b44ExpLogTable.cpp , which I need to exclude from the assembly.

How to do it?

+49
cmake
Mar 21 '13 at 14:49
source share
1 answer

You can use the list function to manage the list, for example:

 list(REMOVE_ITEM <list> <value> [<value> ...]) 

In your case, maybe something like this will work:

 list(REMOVE_ITEM lib_srcs "IlmImf/b44ExpLogTable.cpp") 
+65
Mar 21 '13 at 15:12
source share



All Articles