[CMake] File globbing with relative path

jbd evadream.mlist at evadream.net
Mon Jun 26 13:16:50 EDT 2006


Hello everybody,

Sorry for this question, i didn't find a solution on the web or even
in the 2.2 version book, but i'm quite a beginner regarding CMake =)

I'd like to retrieve the relative path of a list of files. For example :
FILE (GLOB SRC_FILES Test*.cxx Test*.cpp Test*.c)

Here, SRC_FILES will contain all the file i requested with their full path.
Is their a clean way to retrieve a list containing only the relative path
of those files ?

I can do that :
FOREACH(myfile ${SRC_FILES})
	FILE(RELATIVE_PATH TMP ${CMAKE_CURRENT_SOURCE_DIR} ${myfile})
	# here TMP contain the relative path
ENDFOREACH(myfile ${SRC_FILES})

But i don't know how to rebuild a new list, or to replace the first one.

Any idea ?

Thank you !



More information about the CMake mailing list