summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2008-11-14 03:43:18 +0000
committerOscar Fuentes <ofv@wanadoo.es>2008-11-14 03:43:18 +0000
commit6326a0d5090110c334a3a554bfb10b37a6fe4709 (patch)
tree0552ab2f0a81a0d4557f403c0a0b0d183105b2da /CMakeLists.txt
parentc663beecdb6d87409ac4891c1a8febdf12013ad2 (diff)
downloadllvm-6326a0d5090110c334a3a554bfb10b37a6fe4709.tar.gz
llvm-6326a0d5090110c334a3a554bfb10b37a6fe4709.tar.bz2
llvm-6326a0d5090110c334a3a554bfb10b37a6fe4709.tar.xz
CMake: Disallow in-source builds except when building with the Visual
Studio IDE. CMake would overwrite the makefiles distributed with LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15dcf7fa2b..f3c89f1938 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,15 @@ set(PACKAGE_NAME llvm)
set(PACKAGE_VERSION svn)
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
+if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
+ message(FATAL_ERROR "In-source builds are not allowed.
+CMake would overwrite the makefiles distributed with LLVM.
+Please create a directory and run cmake from there, passing the path
+to this source directory as the last argument.
+This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
+Please delete them.")
+endif()
+
include(FindPerl)
set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})