cmake: fix cross-compilation problems

- unexpected pkg-config module (we should not use host binary)
- bump cmake_minimum_required to 3.5 in toolchain files
This commit is contained in:
Alexander Alekhin 2021-08-05 11:42:58 +00:00
parent 5af09e73f2
commit 4ff76cad2a
4 changed files with 8 additions and 4 deletions

View File

@ -25,7 +25,9 @@ endif()
# Detect available dependencies
#
include(FindPkgConfig)
if(NOT PROJECT_NAME STREQUAL "OpenCV")
include(FindPkgConfig)
endif()
macro(add_backend backend_id cond_var)
if(${cond_var})

View File

@ -1,4 +1,6 @@
include(FindPkgConfig)
if(NOT PROJECT_NAME STREQUAL "OpenCV")
include(FindPkgConfig)
endif()
macro(add_backend backend_id cond_var)
if(${cond_var})

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)
# load settings in case of "try compile"
set(TOOLCHAIN_CONFIG_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain.config.cmake")

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)
if(COMMAND toolchain_save_config)
return() # prevent recursive call