mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 01:51:49 +08:00
NEW: disallow in-source builds
This commit is contained in:
parent
f07c013c7f
commit
fad34678f1
@ -24,6 +24,9 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
# Find includes in the build directories
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# error message when user tries to make in-source build!
|
||||
include(jkqtplotter_noInsourceBuilds)
|
||||
|
||||
# Common Includes for JKQtPlotter
|
||||
include(jkqtplotter_common_include)
|
||||
|
||||
|
11
cmake/jkqtplotter_noInsourceBuilds.cmake
Normal file
11
cmake/jkqtplotter_noInsourceBuilds.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
message(FATAL_ERROR
|
||||
"\n"
|
||||
"In-source builds are not allowed.\n"
|
||||
"Instead, provide a path to build tree like so:\n"
|
||||
"cmake -B <destination>\n"
|
||||
"\n"
|
||||
"To remove files you accidentally created execute:\n"
|
||||
"rm -rf CMakeFiles CMakeCache.txt\n"
|
||||
)
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user