Accept insourcesubdir builds

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This commit is contained in:
Tomaz Canabrava 2015-11-25 19:24:06 -02:00 committed by Dirk Hohndel
parent 3462da19fd
commit 1f960eef74

View file

@ -24,10 +24,7 @@
# # Ensures that we do an out of source build
MACRO(MACRO_ENSURE_OUT_OF_SOURCE_BUILD MSG)
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
GET_FILENAME_COMPONENT(PARENTDIR ${CMAKE_SOURCE_DIR} PATH)
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir)
MESSAGE( "${CMAKE_SOURCE_DIR} , ${CMAKE_BINARY_DIR}, ${PARENTDIR}")
IF(insource OR insourcesubdir)
IF(insource)
MESSAGE(FATAL_ERROR "${MSG}")
ENDIF(insource OR insourcesubdir)
ENDIF()
ENDMACRO(MACRO_ENSURE_OUT_OF_SOURCE_BUILD)