Fixed some cmake 2.6 compatibility issues.

pull/13383/head
Andrey Kamaev 13 years ago
parent 1554d7ab65
commit fb2c288627
  1. 13
      CMakeLists.txt
  2. 8
      android/android.toolchain.cmake

@ -37,14 +37,14 @@ endif(NOT CMAKE_TOOLCHAIN_FILE)
# Top level OpenCV project
# --------------------------------------------------------------
if(NOT IOS)
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.6.3)
else()
cmake_minimum_required(VERSION 2.8)
endif()
project(OpenCV)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE)
if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()
@ -448,7 +448,12 @@ endif()
set(WITH_TBB OFF CACHE BOOL "Include Intel TBB support")
set(WITH_IPP OFF CACHE BOOL "Include Intel IPP support")
set(WITH_EIGEN ON CACHE BOOL "Include Eigen2/Eigen3 support")
set(WITH_CUDA ON CACHE BOOL "Include NVidia Cuda Runtime support")
if( CMAKE_VERSION VERSION_GREATER "2.8")
set(WITH_CUDA ON CACHE BOOL "Include NVidia Cuda Runtime support")
else()
set(WITH_CUDA OFF CACHE BOOL "Include NVidia Cuda Runtime support")
endif()
set(WITH_OPENNI OFF CACHE BOOL "Include OpenNI support")
set(WITH_XIMEA OFF CACHE BOOL "Include XIMEA cameras support")
@ -824,7 +829,7 @@ if (BUILD_JAVA_SUPPORT)
endif()
SET(ANDROID_SDK_TARGET ${ANDROID_SDK_TARGET} CACHE STRING "SDK target for Android tests and samples")
if (ANDROID_PROCESS EQUAL 0)
if (ANDROID_PROCESS EQUAL 0 AND CMAKE_VERSION VERSION_GREATER "2.8")
set_property( CACHE ANDROID_SDK_TARGET PROPERTY STRINGS ${ANDROID_SDK_TARGETS} )
endif()
string(REGEX MATCH "[0-9]+$" ANDROID_SDK_TARGET_LEVEL "${ANDROID_SDK_TARGET}")

@ -172,7 +172,9 @@ if( EXISTS "${ANDROID_NDK}" )
set( PossibleAndroidLevels "3;4;5;8;9" )
set( ANDROID_API_LEVEL ${ANDROID_API_LEVEL} CACHE STRING "android API level" )
set_property( CACHE ANDROID_API_LEVEL PROPERTY STRINGS ${PossibleAndroidLevels} )
if( CMAKE_VERSION VERSION_GREATER "2.8")
set_property( CACHE ANDROID_API_LEVEL PROPERTY STRINGS ${PossibleAndroidLevels} )
endif()
if( NOT ANDROID_API_LEVEL GREATER 2 )
set( ANDROID_API_LEVEL 8)
@ -237,7 +239,9 @@ IF( NOT ARM_TARGET)
set( ARM_TARGET armeabi-v7a )
ENDIF()
set( ARM_TARGET "${ARM_TARGET}" CACHE INTERNAL "the arm target for android, recommend armeabi-v7a for floating point support and NEON." )
set_property( CACHE ARM_TARGET PROPERTY STRINGS ${PossibleArmTargets} )
if( CMAKE_VERSION VERSION_GREATER "2.8")
set_property( CACHE ARM_TARGET PROPERTY STRINGS ${PossibleArmTargets} )
endif()
#set these flags for client use
if( ARM_TARGET STREQUAL "armeabi" )

Loading…
Cancel
Save