Enable cmake CMP0077 policy

When building OpenCV as a sub-project using cmake's add_subdirectory()
the OpenCV's build options would be overwritten to its default
state. With cmake 3.13+ the CMP0077 policy, option() honors previous
definitions via set().
pull/16300/head
Augusto Fraga Giachero 5 years ago
parent 8b43861217
commit 2d778434f1
  1. 3
      CMakeLists.txt

@ -68,6 +68,9 @@ if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW) # CMake 3.12+: Include file check macros honor `CMAKE_REQUIRED_LIBRARIES`
endif()
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # CMake 3.13+: option() honors normal variables.
endif()
#
# Configure OpenCV CMake hooks

Loading…
Cancel
Save