Fixed Android SDK build - again.
authorRoman Donchenko <roman.donchenko@itseez.com>
Fri, 25 Oct 2013 15:10:13 +0000 (19:10 +0400)
committerRoman Donchenko <roman.donchenko@itseez.com>
Fri, 25 Oct 2013 15:12:32 +0000 (19:12 +0400)
cmake/OpenCVGenConfig.cmake
cmake/templates/OpenCVConfig.cmake.in

index b7f026d..362841b 100644 (file)
@@ -76,7 +76,9 @@ endif()
 
 set(modules_file_suffix "")
 if(ANDROID)
-  set(modules_file_suffix "-${ANDROID_NDK_ABI_NAME}")
+  # the REPLACE here is needed, because OpenCVModules_armeabi.cmake includes
+  # OpenCVModules_armeabi-*.cmake, which would match OpenCVModules_armeabi-v7a*.cmake.
+  string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
 endif()
 
 export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules${modules_file_suffix}.cmake")
index 2f28413..ee1eb59 100644 (file)
 #
 # ===================================================================================
 
-if(NOT ANDROID)
-  include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules.cmake)
-else()
-  include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules-${ANDROID_NDK_ABI_NAME}.cmake)
+set(modules_file_suffix "")
+if(ANDROID)
+  string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}")
 endif()
 
+include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake)
+
 # TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)
 
 # Version Compute Capability from which OpenCV has been compiled is remembered