From 31e18bff069e0f5417932cf23bfb970ad2625630 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Wed, 21 Sep 2016 14:02:34 +0200 Subject: [PATCH] Add warning for builds within source tree --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index af3b873c1..c286b6e07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,9 @@ endif() # CMake does not allow to add dependencies to "builtin" targets like package_source. # We therefore wrap package_source in our own dist target. +if("${MOZART_BUILD_DIR}/" MATCHES "${MOZART_DIR}/.*") + message(WARNING "You are compiling inside the source tree. Generating source tarballs will not work correctly.") +endif() add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) configure_file(cmake_local/MozartConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_local/MozartConfigVersion.cmake @ONLY)