2011-06-30 15:37:56 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for Android samples. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
2012-02-03 12:26:49 +01:00
|
|
|
SET(OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS opencv_contrib opencv_legacy opencv_objdetect opencv_calib3d opencv_features2d opencv_video opencv_highgui opencv_ml opencv_imgproc opencv_flann opencv_core)
|
2011-06-30 15:37:56 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
ocv_check_dependencies(${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS} opencv_java)
|
2011-06-30 15:37:56 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
if(BUILD_ANDROID_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
|
|
|
|
project(android_samples)
|
2011-06-30 15:37:56 +02:00
|
|
|
|
2012-03-03 16:49:23 +01:00
|
|
|
ocv_include_modules(${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS})
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
file(GLOB android_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
|
|
|
|
list(REMOVE_ITEM android_samples hello-android)
|
|
|
|
list(SORT android_samples)
|
2011-07-04 08:33:10 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
foreach(sample ${android_samples})
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${sample}/AndroidManifest.xml")
|
|
|
|
add_android_project("${sample}" "${CMAKE_CURRENT_SOURCE_DIR}/${sample}" INSTALL)
|
2011-07-12 17:59:31 +02:00
|
|
|
endif()
|
2012-02-03 12:26:49 +01:00
|
|
|
endforeach()
|
2011-07-01 15:12:05 +02:00
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
#hello-android sample
|
|
|
|
ADD_EXECUTABLE(hello-android hello-android/main.cpp)
|
|
|
|
TARGET_LINK_LIBRARIES(hello-android ${OPENCV_LINKER_LIBS} ${OPENCV_ANDROID_SAMPLES_REQUIRED_DEPS})
|
|
|
|
set_target_properties(hello-android PROPERTIES OUTPUT_NAME hello-android RUNTIME_OUTPUT_DIRECTORY "${EXECUTABLE_OUTPUT_PATH}")
|
|
|
|
if(INSTALL_ANDROID_EXAMPLES)
|
|
|
|
install(TARGETS hello-android DESTINATION bin COMPONENT main)
|
|
|
|
endif()
|
2011-06-30 15:37:56 +02:00
|
|
|
endif()
|