[CMake] use of wildcard

Kevin Tucker ktucker at birdstep.com
Tue Feb 6 19:06:01 EST 2007


Found this documentation:

 

*	AUX_SOURCE_DIRECTORY: Find all source files in a directory.

  AUX_SOURCE_DIRECTORY(dir VARIABLE)

Collects the names of all the source files in the specified directory
and stores the list in the variable provided. This command is intended
to be used by projects that use explicit template instantiation.
Template instantiation files can be stored in a "Templates" subdirectory
and collected automatically using this command to avoid manually listing
all instantiations.

It is tempting to use this command to avoid writing the list of source
files for a library or executable target. While this seems to work,
there is no way for CMake to generate a build system that knows when a
new source file has been added. Normally the generated build system
knows when it needs to rerun CMake because the CMakeLists.txt file is
modified to add a new source. When the source is just added to the
directory without modifying this file, one would have to manually rerun
CMake to generate a build system incorporating the new file. 

________________________________

From: cmake-bounces+ktucker=birdstep.com at cmake.org
[mailto:cmake-bounces+ktucker=birdstep.com at cmake.org] On Behalf Of
Jean-Christophe Roux
Sent: Tuesday, February 06, 2007 3:35 PM
To: cmake at cmake.org
Subject: [CMake] use of wildcard

 

Hello,

How do I capture every file of a folder in one command? For instance,
instead of
set(SOURCE_FILES     a.cpp b.cpp ... zzz.cpp)
I'd like to write something like:
set(SOURCE_FILES  dir1/* dir2/*.cpp)
that would save a lot of typing and maintenance.

Thanks for any clue

 

________________________________

Get your own web address.
<http://us.rd.yahoo.com/evt=49678/*http:/smallbusiness.yahoo.com/domains
/?p=BESTDEAL> 
Have a HUGE year through Yahoo! Small Business.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070206/a35ea0d4/attachment.htm


More information about the CMake mailing list