Skip to content

Commit

Permalink
CMake: Disable in-place builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Dec 13, 2024
1 parent b200c23 commit 64f9397
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ include(FetchContent)
include(espresso_option_enum)
include(espresso_enable_avx2_support)

if(EXISTS "${PROJECT_BINARY_DIR}/CMakeLists.txt")
message(
FATAL_ERROR
"${PROJECT_NAME} cannot be built in-place. Instead, create a build directory and run CMake from there. A new file 'CMakeCache.txt' and a new folder 'CMakeFiles' have just been created by CMake in the current folder and need to be removed."
)
endif()

#
# CMake internal vars
#
Expand Down

0 comments on commit 64f9397

Please sign in to comment.