Skip to content

Commit eb402f4

Browse files
author
Jared Frazier
committed
prevent insource build via top level CMakeLists.txt
1 parent 4dba844 commit eb402f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ project(
1717
LANGUAGES Fortran
1818
)
1919

20+
# Safety net (https://numpy.org/doc/stable/f2py/buildtools/skbuild.html#cmake-modules-only)
21+
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
22+
message(
23+
FATAL_ERROR
24+
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.\n"
25+
)
26+
endif()
27+
2028
# Set paths to Intel oneAPI MKL
2129
if(${ENABLE_SPBLAS})
2230
if (${ENABLE_FIND_INTEL_MKL})

0 commit comments

Comments
 (0)