I recently had to help out a CMake newbie, who had run CMake in the
source directory.  Then he re-read the instructions on build setup for
our programs, and did it the right way -- i.e. he configured a build
directory for an out of source build.

Problem is, if you run CMake and configure the source directory, CMake
will assume you want an in-source build, even if you try and configure
an out-of-source build directory. So you get this mystifying behavior.

# sourcedir is 'test', in same directory as test-build

cd test               # source dir
cmake               # whoops, configured in the source directory!
cd ../test-build    # come to senses, go to out-of-srouce build.
cmake ../test      # try configuring for out of source build
make                 # now you get a "Makefile not found" error!

In order to get rid of the problem you have to delete CMakeCache.txt
in the source directory -- at a minimum -- before you can configure
the out-of-source build.  I ended up going through the source code
trying to get rid of CMake droppings, which are numerous!
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to