mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
Merge pull request #8582 from alalek:cmake_disable_insource_builds
This commit is contained in:
commit
f77e9bc995
@ -6,6 +6,13 @@
|
|||||||
#
|
#
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Disable in-source builds to prevent source tree corruption.
|
||||||
|
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
|
||||||
|
message(FATAL_ERROR "
|
||||||
|
FATAL: In-source builds are not allowed.
|
||||||
|
You should create separate directory for build files.
|
||||||
|
")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
include(cmake/OpenCVMinDepVersions.cmake)
|
include(cmake/OpenCVMinDepVersions.cmake)
|
||||||
@ -1397,13 +1404,6 @@ status("")
|
|||||||
|
|
||||||
ocv_finalize_status()
|
ocv_finalize_status()
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# Warn in the case of in-source build
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
|
||||||
message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# CPack stuff
|
# CPack stuff
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user