File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 4
4
# From the off-tree build directory, invoke:
5
5
# $ cmake <PATH_TO_OPENCV_ROOT>
6
6
#
7
- #
8
- # - OCT-2008: Initial version <joseluisblancoc@gmail.com>
9
- #
10
7
# ----------------------------------------------------------------------------
11
8
9
+ # Disable in-source builds to prevent source tree corruption.
10
+ if (" ${CMAKE_SOURCE_DIR} " STREQUAL " ${CMAKE_BINARY_DIR} " )
11
+ message (FATAL_ERROR "
12
+ FATAL: In-source builds are not allowed.
13
+ You should create separate directory for build files.
14
+ " )
15
+ endif ()
16
+
12
17
set (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
13
18
14
19
# Following block can broke build in case of cross-compilng
@@ -1094,13 +1099,6 @@ status("")
1094
1099
1095
1100
ocv_finalize_status ()
1096
1101
1097
- # ----------------------------------------------------------------------------
1098
- # Warn in the case of in-source build
1099
- # ----------------------------------------------------------------------------
1100
- if ("${CMAKE_CURRENT_SOURCE_DIR} " STREQUAL "${CMAKE_CURRENT_BINARY_DIR} " )
1101
- message (WARNING "The source directory is the same as binary directory. \" make clean\" may damage the source tree" )
1102
- endif ()
1103
-
1104
1102
# ----------------------------------------------------------------------------
1105
1103
# CPack stuff
1106
1104
# ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments