From 7bd189503adb5ca31d5a731a65355a86bd27a1ed Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 18 Nov 2015 10:59:48 +0300 Subject: cmake: check for build directory is separated directory from sources --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea7f4f0..53cdc393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.6) cmake_policy(SET CMP0005 NEW) cmake_policy(SET CMP0003 OLD) +if (CMAKE_BINARY_DIR STREQUAL CMAKE_HOME_DIRECTORY) + message(FATAL_ERROR "Building in source directory is forbidden. Please make separated build directory.") +endif () + project(accel-ppp C) include(cmake/cpack.cmake) -- cgit v1.2.3