@@ -110,14 +110,12 @@ if(POLICY CMP0056)
110
110
cmake_policy (SET CMP0056 NEW )
111
111
endif ()
112
112
113
- include (cmake/OpenCVUtils.cmake )
114
-
115
- if (OPENCV_CXX11 )
116
- #cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
117
- set (CMAKE_CXX_STANDARD 11 )
118
- set (CMAKE_CXX_STANDARD_REQUIRED TRUE )
113
+ if (POLICY CMP0067 )
114
+ cmake_policy (SET CMP0067 NEW )
119
115
endif ()
120
116
117
+ include (cmake/OpenCVUtils.cmake )
118
+
121
119
# must go before the project command
122
120
ocv_update (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE )
123
121
if (DEFINED CMAKE_BUILD_TYPE )
@@ -149,6 +147,7 @@ endif()
149
147
# ----------------------------------------------------------------------------
150
148
# Detect compiler and target platform architecture
151
149
# ----------------------------------------------------------------------------
150
+ OCV_OPTION (ENABLE_CXX11 "Enable C++11 compilation mode" "${OPENCV_CXX11} " )
152
151
include (cmake/OpenCVDetectCXXCompiler.cmake )
153
152
154
153
# Add these standard paths to the search paths for FIND_LIBRARY
@@ -305,7 +304,6 @@ OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binar
305
304
306
305
# OpenCV build options
307
306
# ===================================================
308
- OCV_OPTION (OPENCV_CXX11 "Enable C++11 compilation mode" OFF )
309
307
OCV_OPTION (ENABLE_CCACHE "Use ccache" (UNIX AND NOT IOS AND (CMAKE_GENERATOR MATCHES "Makefile" OR CMAKE_GENERATOR MATCHES "Ninja" )) )
310
308
OCV_OPTION (ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS AND NOT CMAKE_CROSSCOMPILING ) )
311
309
OCV_OPTION (ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode ) )
@@ -963,8 +961,8 @@ string(STRIP "${OPENCV_COMPILER_STR}" OPENCV_COMPILER_STR)
963
961
status ("" )
964
962
status (" C/C++:" )
965
963
status (" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO )
966
- if (OPENCV_CXX11 )
967
- status (" C++11:" " YES" )
964
+ if (ENABLE_CXX11 OR HAVE_CXX11 )
965
+ status (" C++11:" HAVE_CXX11 THEN YES ELSE NO )
968
966
endif ()
969
967
status (" C++ Compiler:" ${OPENCV_COMPILER_STR} )
970
968
status (" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} )
0 commit comments