From 4cc8240c5a38a0fd7a5af52ccf65f1bb585c4b3c Mon Sep 17 00:00:00 2001 From: Khobaib <150820696+khobaib529@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:38:23 +0600 Subject: [PATCH] update to make sure the source directory and build directory are different --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 512e5c3d..0255f571 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ # Note: CMake support is community-based. The maintainers do not use CMake # internally. +if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}") + message(FATAL_ERROR " +FATAL: In-source builds are not allowed. + You should create a separate directory for build files. +") +endif() + cmake_minimum_required(VERSION 3.13) project(googletest-distribution)