From 9aa37f310820128635e5b46d740cfa0fb49dc846 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 15 Nov 2009 00:11:33 -0500 Subject: [PATCH] prevent in-source builds. hope it's ok with you... it's still possible, of course, to have the build dir as a subdir of the source dir. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09934cdcc..ee93e3de3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ project(Eigen) cmake_minimum_required(VERSION 2.6.2) +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.") +endif() + # automatically parse the version number file(READ "${CMAKE_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header) string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}") @@ -164,6 +168,7 @@ if(cmake_generator_tolower MATCHES "makefile") message("make install | Install to ${CMAKE_INSTALL_PREFIX}") message(" | * To change that: cmake . -DCMAKE_INSTALL_PREFIX=yourpath") message("make doc | Generate the API documentation, requires Doxygen & LaTeX") + message("make check | Build and run the unit-tests") message("make blas | Build BLAS library (not the same thing as Eigen)") message("--------------+----------------------------------------------------------------") endif()