Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
dca9ca1c
Commit
dca9ca1c
authored
Apr 23, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11363 from mshabunin:compat-vc2017
parents
29b4fd27
abce51fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
OpenCVConfig.root-WIN32.cmake.in
cmake/templates/OpenCVConfig.root-WIN32.cmake.in
+34
-18
No files found.
cmake/templates/OpenCVConfig.root-WIN32.cmake.in
View file @
dca9ca1c
...
...
@@ -43,7 +43,7 @@ endif()
if(NOT DEFINED OpenCV_STATIC)
# look for global setting
if(BUILD_SHARED_LIBS)
if(
NOT DEFINED BUILD_SHARED_LIBS OR
BUILD_SHARED_LIBS)
set(OpenCV_STATIC OFF)
else()
set(OpenCV_STATIC ON)
...
...
@@ -57,6 +57,33 @@ if(NOT DEFINED OpenCV_CUDA)
endif()
endif()
function(check_one_config RES)
set(${RES} "" PARENT_SCOPE)
if(NOT OpenCV_RUNTIME OR NOT OpenCV_ARCH)
return()
endif()
set(candidates)
if(OpenCV_STATIC)
list(APPEND candidates "${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
endif()
if(OpenCV_CUDA)
list(APPEND candidates "gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
endif()
if(OpenCV_CUDA AND OpenCV_STATIC)
list(APPEND candidates "gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
endif()
list(APPEND candidates "${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
foreach(c ${candidates})
set(p "${OpenCV_CONFIG_PATH}/${c}")
if(EXISTS "${p}/OpenCVConfig.cmake")
set(${RES} "${p}" PARENT_SCOPE)
return()
endif()
endforeach()
endfunction()
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
if(DEFINED OpenCV_ARCH AND DEFINED OpenCV_RUNTIME)
# custom overridden values
elseif(MSVC)
...
...
@@ -82,6 +109,10 @@ elseif(MSVC)
set(OpenCV_RUNTIME vc14)
elseif(MSVC_VERSION MATCHES "^191[0-9]$")
set(OpenCV_RUNTIME vc15)
check_one_config(has_VS2017)
if(NOT has_VS2017)
set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
endif()
endif()
elseif(MINGW)
set(OpenCV_RUNTIME mingw)
...
...
@@ -97,29 +128,14 @@ elseif(MINGW)
endif()
endif()
check_one_config(OpenCV_LIB_PATH)
if(NOT OpenCV_FIND_QUIETLY)
message(STATUS "OpenCV ARCH: ${OpenCV_ARCH}")
message(STATUS "OpenCV RUNTIME: ${OpenCV_RUNTIME}")
message(STATUS "OpenCV STATIC: ${OpenCV_STATIC}")
endif()
get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(OpenCV_RUNTIME AND OpenCV_ARCH)
if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
else()
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
endif()
elseif(EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
else()
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
endif()
endif()
endif()
if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment