[Cmake] Out of Source Builds

William A. Hoffman billlist at nycap.rr.com
Fri, 02 Jan 2004 09:40:53 -0500


In most cmake projects Release and Debug would not be in the subdirs of
the project.  You would do this:

aps/CMakeLists.txt
aps-debug  -- do an out of source build here cmake ../aps -D:CMAKE_BUILD_TYPE=Debug
aps-release -- do an out of source build here cmake ../aps -D:CMAKE_BUILD_TYPE=Release


For Visual Studio IDE projects the Debug and Release are handled as part
of the IDE build process.  For nmake, the above would work.



-Bill


At 01:08 PM 12/30/2003, Andy Preston wrote:
>I'm trying to setup a project under Linux right now and have a problem
>that doesn't make much sense to me. What I'm trying to do is setup Debug
>and Release builds of my library. I have a top level subdirectory for my
>library which has a CMakeLists.txt that simply does
>
>PROJECT(aps)
>SUBDIRS(Release Debug)
>
>I then have three subdirectories, src, Debug and Release. The src
>directory has a CMakeLists.txt that correctly sets up the library. Thats
>working fine.
>
>If I go into the Debug/Release directory and do "cmake ../src", then go
>back up into the main library directory "make clean/all" works as
>expected. If I then touch the main CMakeLists.txt, and then run make, it
>rebuilds the Makefiles, include the Debug/Release ones. The Debug/Release
>Makefiles have their SOURCE_DIR set their directory(Debug/Release) instead
>of the src directory. If I then rerun "cmake ../src" then all is well.
>
>Do I need a CMakeLists.txt in the Debug/Release directories to point the
>source back to the src directory ?
>
>Also how will this setup of Debug/Release translate into a VC6/7 project ?
>Previous to using CMake, I was using SlickEdit to generate my Makefiles.
>This setup the Makefile to take a CFG=Debug/Release argument with the
>appropriate code in the Makefile to switch. This is the same method used
>by VC6 generated makefiles.
>
>thanks,
>
>Andy
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake