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 #21 from xsacha/hunter-3.4.0
Browse files Browse the repository at this point in the history
Hunter 3.4.0
  • Loading branch information
ruslo authored Jan 8, 2018
2 parents 6d4f664 + 159118f commit fea936a
Show file tree
Hide file tree
Showing 18 changed files with 678 additions and 47 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_20170822.tgz")
set(OPENCV_ICV_HASH "49b05a669042753ae75895a445ebd612")
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
43 changes: 24 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,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 @@ -340,12 +348,9 @@ include(cmake/OpenCVVersion.cmake)
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 @@ -368,13 +373,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 @@ -396,10 +401,10 @@ 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_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_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 @@ -487,6 +492,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")
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 Expand Up @@ -1038,16 +1047,12 @@ status(" Non-free algorithms:" OPENCV_ENABLE_NONFREE THEN "YES" ELSE "NO")
if(ANDROID)
status("")
status(" Android: ")
status(" Android ABI:" ${ANDROID_ABI})
status(" Android ABI:" ${CMAKE_ANDROID_ARCH_ABI})
status(" STL type:" ${ANDROID_STL})
status(" Native API level:" android-${ANDROID_NATIVE_API_LEVEL})
android_get_compatible_target(android_sdk_target_status ${ANDROID_NATIVE_API_LEVEL} ${ANDROID_SDK_TARGET} 11)
status(" Native API level:" android-${CMAKE_SYSTEM_VERSION})
android_get_compatible_target(android_sdk_target_status ${CMAKE_SYSTEM_VERSION} ${ANDROID_SDK_TARGET} 11)
status(" SDK target:" "${android_sdk_target_status}")
if(BUILD_WITH_ANDROID_NDK)
status(" Android NDK:" "${ANDROID_NDK} (toolchain: ${ANDROID_TOOLCHAIN_NAME})")
elseif(BUILD_WITH_STANDALONE_TOOLCHAIN)
status(" Android toolchain:" "${ANDROID_STANDALONE_TOOLCHAIN}")
endif()
status(" Android NDK:" "${CMAKE_ANDROID_NDK} (toolchain: ${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION})")
status(" android tool:" ANDROID_EXECUTABLE THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
endif()

Expand Down
Loading

0 comments on commit fea936a

Please sign in to comment.