CMake: Give error on attempts to generate within the sources with
authorJacques Beuarain <jacques.beaurain@gmail.com>
Wed, 13 Dec 2006 02:57:57 +0000 (02:57 +0000)
committerJacques Beuarain <jacques.beaurain@gmail.com>
Wed, 13 Dec 2006 02:57:57 +0000 (02:57 +0000)
instructions on how to do it out-of-source

CMakeLists.txt

index 209522d3de0e4d6f7fe23aac75cd7b95dd07ad02..1f5b4d308412b1456cf3284eebddaa501ba3bb59 100644 (file)
 #
 # ***** END GPL/BL DUAL LICENSE BLOCK *****
 
+#-----------------------------------------------------------------------------
+# We don't allow in-source builds. This causes no end of troubles because 
+# all out-of-source builds will use the CMakeCache.txt file there and even 
+# build the libs and objects in it. It will also conflict with the current 
+# Makefile system for Blender
+
+IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+MESSAGE(FATAL_ERROR "CMake generation for blender is not allowed within the source directory! 
+Remove the CMakeCache.txt file and try again from another folder, e.g.: 
+
+   rm CMakeCache.txt 
+   cd ..
+   mkdir cmake-make 
+   cd cmake-make
+   cmake -G \"Unix Makefiles\" ../blender
+")
+ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
 PROJECT(Blender)