[CMake] How to redirect output (.o file generattion) in specific directory

Amit C. Kr. Saluja aksalujaa at yahoo.com
Mon Nov 12 06:06:46 EST 2007


Eric, 
Thanks for this info!

> EXECUTABLE_OUTPUT_PATH
> LIBRARY_OUTPUT_PATH

These are global CMake variables. If we change it then
the EXECUTABLE & LIBRARY path of all the exe and libs
changes but not for .os The.os are still generated in
CMakeFiles/ directory.

Can CMAKE_CURRENT_BINARY_DIR could do something?

regards
Amit

--- Eric Noulard <eric.noulard at gmail.com> wrote:

> 2007/11/12, Amit C. Kr. Saluja
> <aksalujaa at yahoo.com>:
> > Hi All,
> >
> > If anybody could guide me about, How to redirect
> .o
> > files in user defined directory?
> >
> > I am setting CMAKE_CURRENT_SOURCE_DIR to "../obj"
> but
> > it is generating targets in ~/src/*.o
> 
> You cannot change CMAKE_CURRENT_SOURCE_DIR
> 
> >
> > Can anybody enlighten?
> 
> If you want to separate your sources files from
> generated files
> (be it .o or lib or executable)
> you'd better use out-of-source build which is well
> supported by cmake
> 
> mkdir /path/to/build_tree
> cd /path/to/build_tree
> cmake /path/to/source/tree
> 
> You must remove CMakeCache.txt and other CMakeFiles/
> from your source tree first.
> 
> You may change the generation location of EXECUTABLE
> and LIBRARY
> by setting:
> EXECUTABLE_OUTPUT_PATH
> LIBRARY_OUTPUT_PATH
> 
> see more on
> http://www.cmake.org/Wiki/CMake_Useful_Variables
> 
> -- 
> Erk
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the CMake mailing list