MACRO(CREA_PREVENT_IN_SOURCE_BUILD) IF(NOT CREA_ALLOW_IN_SOURCE_BUILD) #------------------------------------------------------------------------ # Building in the source tree is forbidden ! # except if CREA_ALLOW_IN_SOURCE_BUILD is set, # e.g. for packaging with rpmbuild IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) MESSAGE(FATAL_ERROR "Building in the source tree is not allowed !! Quit; remove the file 'CMakeCache.txt' and the folder 'CMakeFiles' and build outside the sources") ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) #------------------------------------------------------------------------ ENDIF(NOT CREA_ALLOW_IN_SOURCE_BUILD) ENDMACRO(CREA_PREVENT_IN_SOURCE_BUILD)