From ba33366d454699ac6791518e7ade0dee76c23e3b Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 29 Jan 2015 09:29:58 +0100 Subject: [PATCH] build: warn about building into sources' dir If you build in the source tree, you'll fill the sources with objects and create a mess. Please prefer to build outside sources tree into a temporary place, prefer : cmake build to : cmake . But If you trust your build tools and cleanup is done on each build you can use current dir without any risk. Bug: https://github.com/intel-iot-devkit/upm/pull/75 Change-Id: Ieb914ca359047df8b5dba1c2174e6c61e4526677 Signed-off-by: Philippe Coval Signed-off-by: Mihai Tudor Panu --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ffaa23a..1956f4a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required (VERSION 2.8.11) project (upm) +if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") +message("WARNING: building into sources dir can be risky, prefer other directory") +endif () + find_package (SWIG) if (SWIG_FOUND) include (${SWIG_USE_FILE})