[CMake] Setting the object file directory.

Eric Bolz ebolz at mitre.org
Tue Oct 5 14:26:05 EDT 2004


My directory looks like this:
There are several source directories under the "src" directory
top ___ src____dir1
     |       |____dir2
     |       |____dir3
     |
     |___solaris
     |               |___linux

My CMakeLists file lives at the top level and I specify the souce files 
as follows:
SET( SOURCES src/dir1/file1.c  src/dir2/file2.c   src/dir3/file3.c )

I'm doing out of source builds from within the solaris and linux 
directories by typing "cmake .."
I want cmake to create a parallel directory tree (for the object files) 
under the name "obj", not "src"
It should look like this:
solaris___obj___dir1
                    |___dir2
                    |___dir3

After all, it will contain object files, not source files.
How can I get cmake to put the object files in a directory called "obj" 
under linux and solaris.



More information about the CMake mailing list