Hi all,

I just spent an hour debugging a very strange phenomenon running CMake
on Mac OS-X, which in the end turned out to be trivial, but completely
unexpected for me.

The problem was caused by the fact that CMake had accidentally been run
once from the source directory. When running CMake in an empty binary
directory it seemed to somehow fail to set CMAKE_BINARY_DIR correctly.

Cause of the problem turned out to be the order in which CMake searches
for the CMakeCache.txt file: first in the directory containing the
CMakeLists.txt file (CMAKE_SOURCE_DIR), then in the (binary) directory
that CMake is being run from (CMAKE_BINARY_DIR). 

Wouldn't it be more logical to start in the binary directory and then
look in the source directory? Or, probably even better, completely
ignore the source directory when searching for the cache file.

Best regards,
Marcel Loose.


_______________________________________________
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