From 275fcf8fcf2715a5ebe2069aca2657436d70ec23 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sat, 14 Mar 2026 16:56:54 -0400 Subject: [PATCH] Improve CMake-in-tree fatal error message --- CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 319e7f47..053fe42a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,15 +10,12 @@ project(rgbds include(CTest) -# get real path of source and binary directories +# Reject in-source builds, as they may conflict with the Makefile. get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) - -# reject in-source builds, may conflict with Makefile if(srcdir STREQUAL bindir) - message("RGBDS should not be built in the source directory.") - message("Instead, create a separate build directory and specify to CMake the path to the source directory.") - message(FATAL_ERROR "Terminating configuration") + message(FATAL_ERROR "RGBDS should not be built in the source directory. +Instead, create a separate build directory and specify to CMake the path to the source directory.") endif() include(CMakeDependentOption)