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
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to