[CMake] Building Subdirectories For A Single Target

Tim realmi2 at yahoo.com
Mon Oct 8 09:42:42 EDT 2007


My project is a shared library. I just moved the
project over to CMake from autotools. The sources for
the target is divided up into several
subdirectories(which also contain sources in
subdirectories). I need to be able to build all the
sources recursively and have them all linked into the
same target. I can't seem to find a single clue
anywhere of how to accomplish it. Even looking at
existing projects and examples the only instances
where I see subdirectories being used with CMake is
when they are different targets.
So far the only way I can get the project to build is
to put a list of all source files in the
CMakeLists.txt of the top-level source directory which
to me seems like an ugly hack. Not to mention if I try
to use CMake to generate an Xcode project file it puts
all the sources into one flat folder which looks very,
especially since some files have the same name but are
in different directories.

I am also looking for a way to execute a script in my
project directory with an argument(The argument being
the install root of the project).


	
	
		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html


More information about the CMake mailing list