cmake: prevent in-source builds (#918)

This commit is contained in:
Dennis Brakhane
2024-08-11 14:39:12 +02:00
committed by GitHub
parent 985f31cba4
commit a15a0f6026
+9
View File
@@ -1,5 +1,14 @@
cmake_minimum_required(VERSION 3.12)
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
"In-source builds are not supported!\n"
"Run `git clean -d -f` to clean up the files CMake has created (stash "
"your changes first, if you have made any), then run `cmake -B build "
"<other_options>` followed by `cmake --build build --parallel`"
)
endif()
set(WICKED_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
option(WICKED_DYNAMIC_LIBRARY "Build WickedEngine as a dynamic library" OFF)