X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=c2124c4bce0136dc40167d3aafc48b92425455df;hb=3a0ae3df58d4648eb8c43781955df71f1a7ab135;hp=f34d882881bd38699c0e61decc99741696374f23;hpb=b61692b66772e3f6f8482bd7015cc1fc5f18e4c6;p=simgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f34d8828..c2124c4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,14 @@ string(STRIP ${versionFile} SIMGEAR_VERSION) # use simgear version also as the SO version (if building SOs) SET(SIMGEAR_SOVERSION ${SIMGEAR_VERSION}) +# Warning when build is not an out-of-source build. +string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" InSourceBuild) +if(InSourceBuild) + message(WARNING "Avoid building inside the source tree!") + message(WARNING "Create a separate build directory instead (i.e. 'sgbuild') and call CMake from there: ") + message(WARNING " mkdir ../sgbuild && cd ../sgbuild && cmake ${CMAKE_SOURCE_DIR}") +endif(InSourceBuild) + #packaging SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")