]> Creatis software - crea.git/blob - cmake/PreventInSourceBuild.cmake
Initial revision
[crea.git] / cmake / PreventInSourceBuild.cmake
1 IF(NOT ALLOW_IN_SOURCE_BUILD)
2   #---------------------------------------------------------------------------
3   # Building in the source tree is forbidden ! 
4   # (except if ALLOW_IN_SOURCE_BUILD is set, e.g. for packaging with rpmbuild)
5   IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
6     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")
7   ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
8   #---------------------------------------------------------------------------
9 ENDIF(NOT ALLOW_IN_SOURCE_BUILD)