From f9da906144fecded1666ff26a8cdc73ca53e45ca Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 16 Apr 2012 09:14:26 +0000 Subject: [PATCH] Fixed Android manifest generation and Android samples install --- cmake/OpenCVDetectAndroidSDK.cmake | 2 +- modules/java/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/OpenCVDetectAndroidSDK.cmake b/cmake/OpenCVDetectAndroidSDK.cmake index ca55371b0..12550fd54 100644 --- a/cmake/OpenCVDetectAndroidSDK.cmake +++ b/cmake/OpenCVDetectAndroidSDK.cmake @@ -293,7 +293,7 @@ macro(add_android_project target path) # put the final .apk to the OpenCV's bin folder add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${OpenCV_BINARY_DIR}/bin/${target}.apk") - if(INSTALL_ANDROID_EXAMPLES AND target MATCHES "^example-") + if(INSTALL_ANDROID_EXAMPLES AND "${target}" MATCHES "^example-") install(FILES "${OpenCV_BINARY_DIR}/bin/${target}.apk" DESTINATION "bin" COMPONENT main) endif() endif() diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index ce7b5496b..cc4f1936a 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -188,7 +188,7 @@ if(ANDROID) add_custom_command( OUTPUT "${OpenCV_BINARY_DIR}/${f}" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/android/${f}" "${OpenCV_BINARY_DIR}/${f}" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/android/${f}" + MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/android/${f}" COMMENT "Generating ${f}" ) @@ -224,7 +224,7 @@ if(ANDROID) add_custom_command( OUTPUT ${lib_target_files} COMMAND ${CMAKE_COMMAND} -E remove ${lib_target_files} - COMMAND ${ANDROID_EXECUTABLE} --silent create lib-project --path \"${OpenCV_BINARY_DIR}\" --target \"${lib_target_sdk_target}\" --name OpenCV --package org.opencv 2>\"${CMAKE_CURRENT_BINARY_DIR}/create_lib_project.log\" + COMMAND ${ANDROID_EXECUTABLE} --silent update lib-project --path \"${OpenCV_BINARY_DIR}\" --target \"${lib_target_sdk_target}\" MAIN_DEPENDENCY "${OpenCV_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" DEPENDS ${lib_proj_files} COMMENT "Generating OpenCV Android library project. SDK target: ${lib_target_sdk_target}"