From ea5d01558cff845298bd47547ae786ff77a7ffb8 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Wed, 25 Jan 2012 13:41:12 +0000 Subject: [PATCH] Updating opencv module definition in cmake (continued) --- modules/androidcamera/CMakeLists.txt | 39 ++++------------------------ modules/stitching/CMakeLists.txt | 10 ++++--- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/modules/androidcamera/CMakeLists.txt b/modules/androidcamera/CMakeLists.txt index 88a69fe981..a910a07547 100644 --- a/modules/androidcamera/CMakeLists.txt +++ b/modules/androidcamera/CMakeLists.txt @@ -2,42 +2,13 @@ IF(NOT ANDROID OR NOT WITH_ANDROID_CAMERA) return() ENDIF() +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper") +set(OPENCV_ANDROIDCAMERA_MODULE_TYPE STATIC) +define_opencv_moduleEx(androidcamera INTERNAL log dl) + if (BUILD_ANDROID_CAMERA_WRAPPER) add_subdirectory(camera_wrapper) -endif() - -project(opencv_androidcamera) - -INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper ) -SET( LIBRARY_DEPS ${LIBRARY_DEPS} log dl ) - -SET( the_target opencv_androidcamera ) - -ADD_LIBRARY( ${the_target} STATIC src/camera_activity.cpp ) - -if (BUILD_SHARED_LIBS) - add_definitions(-DCVAPI_EXPORTS) -endif() - -TARGET_LINK_LIBRARIES( ${the_target} ${LIBRARY_DEPS} ) - -SET_TARGET_PROPERTIES(${the_target} PROPERTIES - DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" - OUTPUT_NAME "${the_target}${OPENCV_DLLVERSION}" - DEFINE_SYMBOL "CVAPI_EXPORTS" - ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} - RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} - ) - -IF (NOT BUILD_SHARED_LIBS) - install(TARGETS ${the_target} - RUNTIME DESTINATION bin COMPONENT main - ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main - LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main - ) -ENDIF() - -if (NOT BUILD_ANDROID_CAMERA_WRAPPER) +else() file(GLOB camera_wrappers "${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/lib/${ANDROID_NDK_ABI_NAME}/libnative_camera_r*.so") foreach(wrapper ${camera_wrappers}) diff --git a/modules/stitching/CMakeLists.txt b/modules/stitching/CMakeLists.txt index edeaa63c4f..20866ee5cd 100644 --- a/modules/stitching/CMakeLists.txt +++ b/modules/stitching/CMakeLists.txt @@ -2,8 +2,10 @@ if(IOS) return() endif() -if(ANDROID) - define_opencv_module(stitching opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_flann opencv_objdetect) -else() - define_opencv_module(stitching opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_flann opencv_objdetect opencv_gpu) +set(DEPS opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_flann opencv_objdetect) +if(NOT ANDROID) + set(DEPS ${DEPS} opencv_gpu) endif() + +define_opencv_module(stitching ${DEPS}) +