2012-02-03 19:26:49 +08:00
|
|
|
if(ANDROID)
|
|
|
|
# --------------------------------------------------------------------------------------------
|
|
|
|
# Installation for Android ndk-build makefile: OpenCV.mk
|
|
|
|
# Part 1/2: ${BIN_DIR}/OpenCV.mk -> For use *without* "make install"
|
|
|
|
# Part 2/2: ${BIN_DIR}/unix-install/OpenCV.mk -> For use with "make install"
|
|
|
|
# -------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# build type
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set(OPENCV_LIBTYPE_CONFIGMAKE "SHARED")
|
|
|
|
else()
|
|
|
|
set(OPENCV_LIBTYPE_CONFIGMAKE "STATIC")
|
|
|
|
endif()
|
|
|
|
|
2012-03-24 01:03:05 +08:00
|
|
|
if(BUILD_FAT_JAVA_LIB)
|
|
|
|
set(OPENCV_LIBTYPE_CONFIGMAKE "SHARED")
|
|
|
|
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE "STATIC")
|
|
|
|
else()
|
|
|
|
set(OPENCV_STATIC_LIBTYPE_CONFIGMAKE ${OPENCV_LIBTYPE_CONFIGMAKE})
|
|
|
|
endif()
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
# build the list of opencv libs and dependencies for all modules
|
2015-04-06 21:12:00 +08:00
|
|
|
ocv_get_all_libs(OPENCV_MODULES_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE)
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2015-04-06 21:12:00 +08:00
|
|
|
# list -> string
|
|
|
|
string(REPLACE ";" " " OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
|
|
|
string(REPLACE ";" " " OPENCV_EXTRA_COMPONENTS_CONFIGMAKE "${OPENCV_EXTRA_COMPONENTS_CONFIGMAKE}")
|
|
|
|
string(REPLACE ";" " " OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE "${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE}")
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2015-04-06 21:12:00 +08:00
|
|
|
# replace 'opencv_<module>' -> '<module>''
|
2012-02-03 19:26:49 +08:00
|
|
|
string(REPLACE "opencv_" "" OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
|
|
|
|
2015-04-06 21:12:00 +08:00
|
|
|
|
2012-11-19 16:58:17 +08:00
|
|
|
# prepare 3rd-party component list without TBB for armeabi and mips platforms. TBB is useless there.
|
|
|
|
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
|
|
|
foreach(mod ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB})
|
|
|
|
string(REPLACE "tbb" "" OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB "${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB}")
|
|
|
|
endforeach()
|
|
|
|
|
2012-03-24 01:03:05 +08:00
|
|
|
if(BUILD_FAT_JAVA_LIB)
|
2015-06-04 00:01:48 +08:00
|
|
|
set(OPENCV_LIBS_CONFIGMAKE java3)
|
2012-03-24 01:03:05 +08:00
|
|
|
else()
|
|
|
|
set(OPENCV_LIBS_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
|
|
|
endif()
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
# -------------------------------------------------------------------------------------------
|
|
|
|
# Part 1/2: ${BIN_DIR}/OpenCV.mk -> For use *without* "make install"
|
|
|
|
# -------------------------------------------------------------------------------------------
|
|
|
|
set(OPENCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_CONFIG_FILE_INCLUDE_DIR}\" \"${OpenCV_SOURCE_DIR}/include\" \"${OpenCV_SOURCE_DIR}/include/opencv\"")
|
|
|
|
set(OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE "\"${OpenCV_SOURCE_DIR}\"")
|
2012-09-06 20:09:20 +08:00
|
|
|
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
|
|
|
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/3rdparty/lib/\$(OPENCV_TARGET_ARCH_ABI)")
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2014-01-29 23:34:02 +08:00
|
|
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/OpenCV.mk" @ONLY)
|
2012-02-03 19:26:49 +08:00
|
|
|
|
|
|
|
# -------------------------------------------------------------------------------------------
|
|
|
|
# Part 2/2: ${BIN_DIR}/unix-install/OpenCV.mk -> For use with "make install"
|
|
|
|
# -------------------------------------------------------------------------------------------
|
2012-06-29 01:23:50 +08:00
|
|
|
set(OPENCV_INCLUDE_DIRS_CONFIGCMAKE "\"\$(LOCAL_PATH)/\$(OPENCV_THIS_DIR)/include/opencv\" \"\$(LOCAL_PATH)/\$(OPENCV_THIS_DIR)/include\"")
|
2012-02-03 19:26:49 +08:00
|
|
|
set(OPENCV_BASE_INCLUDE_DIR_CONFIGCMAKE "")
|
2012-09-06 20:09:20 +08:00
|
|
|
set(OPENCV_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
|
|
|
set(OPENCV_3RDPARTY_LIBS_DIR_CONFIGCMAKE "\$(OPENCV_THIS_DIR)/../3rdparty/libs/\$(OPENCV_TARGET_ARCH_ABI)")
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2014-01-29 23:34:02 +08:00
|
|
|
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCV.mk.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk" @ONLY)
|
2014-01-17 20:30:31 +08:00
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCV.mk DESTINATION ${OPENCV_CONFIG_INSTALL_PATH} COMPONENT dev)
|
2012-02-03 19:26:49 +08:00
|
|
|
endif(ANDROID)
|