Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #24 from xsacha/hunter-3.4.2
Browse files Browse the repository at this point in the history
Hunter 3.4.2
  • Loading branch information
ruslo authored Jul 5, 2018
2 parents 9e1b1e5 + 476e8e3 commit 0c0567a
Show file tree
Hide file tree
Showing 17 changed files with 671 additions and 37 deletions.
7 changes: 6 additions & 1 deletion 3rdparty/ippicv/ippicv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(download_ippicv root_var)
set(OPENCV_ICV_NAME "ippicv_2017u3_mac_ia32_general_20180518.tgz")
set(OPENCV_ICV_HASH "698660b975b62bee3ef6c5af51e97544")
endif()
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
elseif((UNIX AND NOT ANDROID) OR (UNIX AND CMAKE_ANDROID_ARCH MATCHES "x86"))
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
if(X86_64)
Expand All @@ -38,6 +38,11 @@ function(download_ippicv root_var)
return()
endif()

if(HUNTER_ENABLED)
hunter_add_package(ippicv)
set(OPENCV_ICV_URL "file://${IPPICV_ROOT}")
endif()

set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
ocv_download(FILENAME ${OPENCV_ICV_NAME}
HASH ${OPENCV_ICV_HASH}
Expand Down
33 changes: 21 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,18 @@ if(DEFINED CMAKE_BUILD_TYPE)
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()

enable_testing()
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.19.68.tar.gz"
SHA1 "ad0d042d8ec56a3c6a4bda1e657f1f65b494ab12"
)

project(OpenCV CXX C)

if(IOS)
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math")
endif()

if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()
Expand Down Expand Up @@ -363,12 +371,9 @@ ocv_cmake_hook(POST_OPTIONS)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications")

if(ANDROID)
if(ANDROID_ABI MATCHES "NEON")
if(CMAKE_ANDROID_ARM_NEON)
set(ENABLE_NEON ON)
endif()
if(ANDROID_ABI MATCHES "VFPV3")
set(ENABLE_VFPV3 ON)
endif()
endif()

if(ANDROID OR WIN32)
Expand All @@ -391,13 +396,13 @@ else()
endif()

if(ANDROID)
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${CMAKE_ANDROID_ARCH_ABI}")
else()
ocv_update(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
endif()

if(ANDROID)
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${CMAKE_ANDROID_ARCH_ABI}")
else()
ocv_update(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
endif()
Expand All @@ -419,11 +424,11 @@ else()
endif()

if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
ocv_update(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH sdk/native/staticlibs/${ANDROID_NDK_ABI_NAME})
ocv_update(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${CMAKE_ANDROID_ARCH_ABI}")
ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${CMAKE_ANDROID_ARCH_ABI}")
ocv_update(OPENCV_LIB_INSTALL_PATH sdk/native/libs/${CMAKE_ANDROID_ARCH_ABI})
ocv_update(OPENCV_LIB_ARCHIVE_INSTALL_PATH sdk/native/staticlibs/${CMAKE_ANDROID_ARCH_ABI})
ocv_update(OPENCV_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${CMAKE_ANDROID_ARCH_ABI})
ocv_update(OPENCV_CONFIG_INSTALL_PATH sdk/native/jni)
ocv_update(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
Expand Down Expand Up @@ -523,6 +528,10 @@ ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
# Path for additional modules
# ----------------------------------------------------------------------------
set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV modules (can be ;-separated list of paths)")
if(OPENCV_WITH_EXTRA_MODULES)
hunter_add_package(OpenCV-Extra)
set(OPENCV_EXTRA_MODULES_PATH "${OPENCV-EXTRA_ROOT}/modules")
endif()

# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
Expand Down
Loading

0 comments on commit 0c0567a

Please sign in to comment.