From f7fec3c1b585b99642ba498a98a1f401c6950a95 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 23 Jun 2011 12:37:35 +0000 Subject: [PATCH] warn user in the case of in-source builds --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebeefd92a7..b74c4173c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1608,6 +1608,11 @@ message(STATUS " cvconfig.h is in: ${OPENCV_CONFIG_FILE_INCLUDE_DIR message(STATUS "-----------------------------------------------------------------") message(STATUS "") +# warn in the case of in-source build +if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree") +endif() + #---------------------------------------------------------------------------- # Generate the OpenCVConfig.cmake file for unix # installation in CMAKE_INSTALL_PREFIX