Fixed Android install target

pull/13383/head
Andrey Kamaev 14 years ago
parent d84b5a9b36
commit 6e8b4e646a
  1. 4
      CMakeLists.txt
  2. 30
      OpenCVConfig.cmake.in
  3. 4
      modules/androidcamera/CMakeLists.txt

@ -1167,10 +1167,10 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINA
# -------------------------------------------------------------------------------------------
# Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/include/opencv" "${CMAKE_INSTALL_PREFIX}/include")
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../include/opencv" "\${THIS_OPENCV_CONFIG_PATH}/../../include\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../lib\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/unix-install/\"" OUTPUT_VARIABLE RET_VAL)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)

@ -91,14 +91,10 @@ endif(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
# many more dependencies:
IF (NOT @BUILD_SHARED_LIBS@)
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../3rdparty/lib)
if(WIN32)
if(WIN32 AND NOT ANDROID)
LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib)
elseif(ANDROID)
LINK_DIRECTORIES(@CMAKE_BINARY_DIR@/3rdparty/lib)
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/3rdparty/lib)
else()
LINK_DIRECTORIES(@CMAKE_LIB_DIRS_CONFIGCMAKE@/../share/opencv/3rdparty/lib)
LINK_DIRECTORIES("${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib")
endif()
set(OpenCV_LIBS @OPENCV_LINKER_LIBS@ @IPP_LIBS@ @HIGHGUI_LIBRARIES@ ${OpenCV_LIBS})
@ -122,16 +118,18 @@ ENDIF(NOT @BUILD_SHARED_LIBS@)
# ======================================================
IF (ANDROID)
macro( COPY_NATIVE_CAMERA_LIBS target )
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_location "${target_location}" PATH)
file(GLOB camera_wrappers "${OpenCV_LIB_DIR}/libnative_camera_r*.so")
foreach(wrapper ${camera_wrappers})
ADD_CUSTOM_COMMAND(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
)
endforeach()
IF( ARMEABI_V7A)
get_target_property(target_location ${target} LOCATION)
get_filename_component(target_location "${target_location}" PATH)
file(GLOB camera_wrappers "${OpenCV_LIB_DIR}/libnative_camera_r*.so")
foreach(wrapper ${camera_wrappers})
ADD_CUSTOM_COMMAND(
TARGET ${target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${target_location}"
)
endforeach()
ENDIF( ARMEABI_V7A )
endmacro()
ENDIF(ANDROID)

@ -45,4 +45,8 @@ foreach(wrapper ${camera_wrappers})
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${LIBRARY_OUTPUT_PATH}"
)
get_filename_component(wrapper_name "${wrapper}" NAME)
install(FILES "${LIBRARY_OUTPUT_PATH}/${wrapper_name}"
DESTINATION lib
COMPONENT main)
endforeach()
Loading…
Cancel
Save