diff --git a/CMakeLists.txt b/CMakeLists.txt index 08fa0f0b95..18ffce8ee4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -676,8 +676,19 @@ status("") status(" OpenCV modules:") string(REPLACE "opencv_" "" OPENCV_MODULES_BUILD_ST "${OPENCV_MODULES_BUILD}") string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_USER_ST "${OPENCV_MODULES_DISABLED_USER}") -string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO}") string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_FORCE_ST "${OPENCV_MODULES_DISABLED_FORCE}") +set(OPENCV_MODULES_DISABLED_AUTO_ST "") +foreach(m ${OPENCV_MODULES_DISABLED_AUTO}) + set(__mdeps "") + foreach(d ${OPENCV_MODULE_${m}_DEPS}) + if(d MATCHES "^opencv_" AND NOT HAVE_${d}) + list(APPEND __mdeps ${d}) + endif() + endforeach() + list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})") +endforeach() +string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST "${OPENCV_MODULES_DISABLED_AUTO_ST}") + status(" To be built:" OPENCV_MODULES_BUILD THEN ${OPENCV_MODULES_BUILD_ST} ELSE "-") status(" Disabled by user:" OPENCV_MODULES_DISABLED_USER THEN ${OPENCV_MODULES_DISABLED_USER_ST} ELSE "-") status(" Disabled by dependency:" OPENCV_MODULES_DISABLED_AUTO THEN ${OPENCV_MODULES_DISABLED_AUTO_ST} ELSE "-") diff --git a/android/android.toolchain.cmake b/android/android.toolchain.cmake index de980de0d7..1cbd29902f 100644 --- a/android/android.toolchain.cmake +++ b/android/android.toolchain.cmake @@ -169,6 +169,7 @@ # [~] fixed CMAKE_SYSTEM_PROCESSOR change on ANDROID_ABI change # [+] improved toolchain loading speed # [+] added assembler language support (.S) +# [+] allowed preset search paths and extra search suffixes # ------------------------------------------------------------------------------ cmake_minimum_required( VERSION 2.6.3 ) @@ -187,14 +188,20 @@ set( CMAKE_SYSTEM_NAME Linux ) #this one not so much set( CMAKE_SYSTEM_VERSION 1 ) -set( ANDROID_SUPPORTED_NDK_VERSIONS -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" ) -if( CMAKE_HOST_WIN32 ) - file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS ) - set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}/android-ndk" "$ENV{SystemDrive}/NVPACK/android-ndk" ) -else() - set( ANDROID_NDK_SEARCH_PATHS /opt/android-ndk "$ENV{HOME}/NVPACK/android-ndk" ) +set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" ) +if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS) + if( CMAKE_HOST_WIN32 ) + file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS ) + set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}/android-ndk" "$ENV{SystemDrive}/NVPACK/android-ndk" ) + else() + file( TO_CMAKE_PATH "$ENV{HOME}" ANDROID_NDK_SEARCH_PATHS ) + set( ANDROID_NDK_SEARCH_PATHS /opt/android-ndk "${ANDROID_NDK_SEARCH_PATHS}/NVPACK/android-ndk" ) + endif() +endif() +if(NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH) + set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain ) endif() -set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain ) + set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" ) set( ANDROID_SUPPORTED_ABIS_x86 "x86" ) diff --git a/cmake/OpenCVDetectAndroidSDK.cmake b/cmake/OpenCVDetectAndroidSDK.cmake index 74db943b5c..bc3dc87187 100644 --- a/cmake/OpenCVDetectAndroidSDK.cmake +++ b/cmake/OpenCVDetectAndroidSDK.cmake @@ -1,5 +1,6 @@ file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH) file(TO_CMAKE_PATH "$ENV{ANDROID_SDK}" ANDROID_SDK_ENV_PATH) +file(TO_CMAKE_PATH "$ENV{HOME}" HOME_ENV_PATH) #find android SDK find_host_program(ANDROID_EXECUTABLE @@ -14,12 +15,12 @@ find_host_program(ANDROID_EXECUTABLE "/opt/android-sdk-mac_x86/tools/" "/opt/android-sdk-mac_86/tools/" "/opt/android-sdk/tools/" - "$ENV{HOME}/NVPACK/android-sdk-linux_x86/tools/" - "$ENV{HOME}/NVPACK/android-sdk-linux_86/tools/" - "$ENV{HOME}/NVPACK/android-sdk-linux/tools/" - "$ENV{HOME}/NVPACK/android-sdk-mac_x86/tools/" - "$ENV{HOME}/NVPACK/android-sdk-mac_86/tools/" - "$ENV{HOME}/NVPACK/android-sdk-mac/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-linux_x86/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-linux_86/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-linux/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-mac_x86/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-mac_86/tools/" + "${HOME_ENV_PATH}/NVPACK/android-sdk-mac/tools/" "$ENV{SystemDrive}/NVPACK/android-sdk-windows/tools/" ) @@ -36,20 +37,20 @@ if(ANDROID_EXECUTABLE) list(GET line 0 line_name) list(GET line 1 line_value) string(REPLACE "." "_" line_name ${line_name}) - SET(ANDROID_TOOLS_${line_name} "${line_value}") + SET(ANDROID_TOOLS_${line_name} "${line_value}" CACHE INTERNAL "from ${ANDROID_SDK_TOOLS_PATH}/source.properties") MARK_AS_ADVANCED(ANDROID_TOOLS_${line_name}) endforeach() endif() if(NOT ANDROID_TOOLS_Pkg_Revision) - SET(ANDROID_TOOLS_Pkg_Revision "Unknown") + SET(ANDROID_TOOLS_Pkg_Revision "Unknown" CACHE INTERNAL "") MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Revision) endif() if(NOT ANDROID_TOOLS_Pkg_Desc) - SET(ANDROID_TOOLS_Pkg_Desc "Android SDK Tools, revision ${ANDROID_TOOLS_Pkg_Revision}.") + SET(ANDROID_TOOLS_Pkg_Desc "Android SDK Tools, revision ${ANDROID_TOOLS_Pkg_Revision}." CACHE INTERNAL "") if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 11) - SET(ANDROID_TOOLS_Pkg_Desc "${ANDROID_TOOLS_Pkg_Desc} It is recommended to update your SDK tools to revision 12 or newer.") + SET(ANDROID_TOOLS_Pkg_Desc "${ANDROID_TOOLS_Pkg_Desc} It is recommended to update your SDK tools to revision 12 or newer." CACHE INTERNAL "") endif() MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Desc) endif() diff --git a/cmake/OpenCVDetectApacheAnt.cmake b/cmake/OpenCVDetectApacheAnt.cmake index 0572d199f2..679ecb829d 100644 --- a/cmake/OpenCVDetectApacheAnt.cmake +++ b/cmake/OpenCVDetectApacheAnt.cmake @@ -11,6 +11,7 @@ if(ANT_EXECUTABLE) OUTPUT_VARIABLE ANT_VERSION_FULL OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}") + set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion") message(STATUS " Found apache ant ${ANT_VERSION}: ${ANT_EXECUTABLE}") endif()