# HG changeset patch # User SokoL_SD # Date 1248082390 0 # Node ID f2f4c9cbadc2bbc7ab6a9b91fb0c429a41ee0add # Parent e792a5287673ceaadf7f7c1ac5e64b9909fe3c22 Fix #28. You cannot build in the sources folder by default but can override this behavior using ALLOW_IN_SOURCE_BUILDS option. However, in this case you'll have to use 'cmake . && make' instead of make. Otherwise, the generator won't start. diff -r e792a5287673 -r f2f4c9cbadc2 CMakeLists.txt --- a/CMakeLists.txt Mon Jul 20 08:40:33 2009 +0000 +++ b/CMakeLists.txt Mon Jul 20 09:33:10 2009 +0000 @@ -6,19 +6,18 @@ ########################################################## if(NOT SECOND_RUN) -option(FORCE_IN_SOURCE_BUILD "Force the in-source building" "OFF") -if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT FORCE_IN_SOURCE_BUILD) +option(ALLOW_IN_SOURCE_BUILDS "Allow in-source builds" "OFF") +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE_BUILDS) message(FATAL_ERROR "In-source builds are not allowed. 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. - Or you can restart cmake with `-DFORCE_IN_SOURCE_BUILD=1`, but it is not + Or you can restart cmake with `-DALLOW_IN_SOURCE_BUILDS=1`, but it is not recomended. ") -endif() - +endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE_BUILDS) FIND_PACKAGE(Qt4 REQUIRED) set (QT_USE_QTMAIN false)