[CMake] Out-of-source build broken ?

Bill Hoffman bill.hoffman at kitware.com
Wed Jun 18 16:23:48 EDT 2008


Emmanuel Blot wrote:
> I can't figure out why CMake keeps building in the source directory 
> rather than in the current directory:
> 
> $ cmake --version
> cmake version 2.6-patch 0
> 
> $ echo $PWD
> /home/eblot/t380/host/build/project
> 
> $ cmake ../../src/project
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/eblot/t380/host/src/project
> 
> Should I need to set some specific configuration parameters to enable 
> out-of-source build ?
> 
> This issue occurs on Cygwin (WinXP SP3) - at least
> 

Once you configure in the source tree, CMake will continue to use the 
same build tree.  So, you need to remove the CMakeCache.txt and 
CMakeFiles directory and any configured files from your source tree and 
try again.

-Bill

-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518-371-3971 (phone and fax)


More information about the CMake mailing list