X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fcmake%2FBBTKPreventInSourceBuild.cmake;h=8126ce8985a8c3f1c4f5f8361ed9a467965df05e;hb=2fcebb64014dd4d699d34716a6658d3f954ec749;hp=de12a492d72a5112866f5d3e82a4ecba663a6268;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/kernel/cmake/BBTKPreventInSourceBuild.cmake b/kernel/cmake/BBTKPreventInSourceBuild.cmake index de12a49..8126ce8 100644 --- a/kernel/cmake/BBTKPreventInSourceBuild.cmake +++ b/kernel/cmake/BBTKPreventInSourceBuild.cmake @@ -1,6 +1,9 @@ -#----------------------------------------------------------------------------- -# Building in the source tree is forbidden ! -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}) -#----------------------------------------------------------------------------- +IF(NOT ALLOW_IN_SOURCE_BUILD) + #--------------------------------------------------------------------------- + # Building in the source tree is forbidden ! + # (except if 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 ALLOW_IN_SOURCE_BUILD)