[CMake] Applying command to source files

Eric Noulard eric.noulard at gmail.com
Fri Nov 16 11:00:41 EST 2007


2007/11/15, Mike Jackson <imikejackson at gmail.com>:
> What about looking at the FindQt4.cmake file. Aren't there macros
> that run 'moc' over a list of files and produce new source code files
> from that? Might be a good place to start...

I did that.
But those MACROS take source file lists as argument
and I would like to avoid to "manually" respecify files which have
already been specified in ADD_LIBRARY or ADD_EXECUTABLE.

2007/11/16, Brandon Van Every <bvanevery at gmail.com>:
> On Nov 15, 2007 3:04 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
> > I currently lack a command which could give me
> > all sources files in a directory.
>
> FILE(GLOB ... ?

Yep. You are right.
I will do that if I have no other mean to get the list of file
which was _already_ specified in ADD_LIBRARY and ADD_EXECUTABLE.

To be more precise I was thinking of something like:

GET_DIRECTORY_PROPERTY(SRCFILES
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
SOURCES_FILES)

or

GET_DIRECTORY_PROPERTY(SRCFILES
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
SOURCES_FILES
LANG "CXX")

Which is not currently available.
-- 
Erk


More information about the CMake mailing list