cmake: refactoring of OpenCVConfig
- removed OpenCV_LIB_DIR* vars (they are broken and not required anymore) - OpenCVConfig.cmake doesn't contain ANDROID/CUDA code if there is no such support - removed OpenCV2_INCLUDE_DIRS_CONFIGCMAKE, merged into OpenCV_INCLUDE_DIRS_CONFIGCMAKE - fix hard-coded relative paths for OpenCV_INSTALL_PATH - removed OpenCV_TBB_ARCH - switch OpenCVConfig.cmake into 2-level mode for Android SDK
This commit is contained in:
@@ -30,6 +30,19 @@ function(ocv_cmake_eval var_name)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(ocv_cmake_configure file_name var_name)
|
||||
configure_file(${file_name} "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${ARGN})
|
||||
file(READ "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${var_name})
|
||||
endmacro()
|
||||
|
||||
macro(ocv_update VAR)
|
||||
if(NOT DEFINED ${VAR})
|
||||
set(${VAR} ${ARGN})
|
||||
else()
|
||||
#ocv_debug_message("Preserve old value for ${VAR}: ${${VAR}}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Search packages for host system instead of packages for target system
|
||||
# in case of cross compilation thess macro should be defined by toolchain file
|
||||
if(NOT COMMAND find_host_package)
|
||||
@@ -71,6 +84,19 @@ macro(ocv_check_environment_variables)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(ocv_path_join result_var P1 P2)
|
||||
string(REGEX REPLACE "^[/]+" "" P2 "${P2}")
|
||||
if("${P1}" STREQUAL "")
|
||||
set(${result_var} "${P2}")
|
||||
elseif("${P1}" STREQUAL "/")
|
||||
set(${result_var} "/${P2}")
|
||||
elseif("${P2}" STREQUAL "")
|
||||
set(${result_var} "${P1}")
|
||||
else()
|
||||
set(${result_var} "${P1}/${P2}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# rename modules target to world if needed
|
||||
macro(_ocv_fix_target target_var)
|
||||
if(BUILD_opencv_world)
|
||||
@@ -359,7 +385,7 @@ macro(CHECK_MODULE module_name define)
|
||||
endmacro()
|
||||
|
||||
|
||||
set(OPENCV_BUILD_INFO_FILE "${OpenCV_BINARY_DIR}/version_string.tmp")
|
||||
set(OPENCV_BUILD_INFO_FILE "${CMAKE_BINARY_DIR}/version_string.tmp")
|
||||
file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
|
||||
function(ocv_output_status msg)
|
||||
message(STATUS "${msg}")
|
||||
|
||||
Reference in New Issue
Block a user