With cmake is best to require out-of-source builds, and to avoid intalling into the same directory as the build was performed. Both of these situations can cause very confusing situations that can frustrate new users of the software package, so check for and provide guidance to the end-users. These files were initially contributed to the ITK (www.itk.org) project and have been widely re-used by many other projects. NOTE: This patch is dependant on pull request #16
10 lines
297 B
CMake
10 lines
297 B
CMake
string(TOLOWER "${CMAKE_INSTALL_PREFIX}" _PREFIX)
|
|
string(TOLOWER "${ITK_BINARY_DIR}" _BUILD)
|
|
if("${_PREFIX}" STREQUAL "${_BUILD}")
|
|
message(FATAL_ERROR
|
|
"The current CMAKE_INSTALL_PREFIX points at the build tree:\n"
|
|
" ${CMAKE_INSTALL_PREFIX}\n"
|
|
"This is not supported."
|
|
)
|
|
endif()
|