[CMake] Force out of source build
hsanson
hsanson at gmail.com
Fri Jun 6 00:14:18 EDT 2008
I want to make sure I don't run cmake inside my source tree.
I tried something like
IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
MESSAGE(FATAL "Don't build inside the source tree")
ENDIF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
But seems the STREQUAL only works if the second argument is a string,
not a variable.
So how can I cause CMake to fail if I run it on the source directory??
thanks
Horacio
More information about the CMake
mailing list