diff --git a/CMakeLists.txt b/CMakeLists.txt index c013986f1a74d..32db4189d49a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ if(POLICY CMP0141) cmake_policy(SET CMP0141 NEW) endif() +if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed.") +endif() + #============================= # Project / Package metadata #=============================