From 68a54e7f3c1bcede53dddfa9ef0fb167cd5a771c Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 9 Feb 2012 20:22:36 +0000 Subject: [PATCH] Fixed incorrectly merged patch. --- cmake/OpenCVGenConfig.cmake | 4 ++++ cmake/templates/OpenCVConfig.cmake.in | 16 +++++++++++++--- modules/androidcamera/CMakeLists.txt | 4 +++- modules/highgui/CMakeLists.txt | 3 +-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake index d5fecc7ec..9495eca32 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake @@ -44,6 +44,10 @@ macro(ocv_generate_dependencies_map_configmake suffix configuration) list(GET OPENCV_LIBS_TO_PROCESS 0 __ocv_lib) get_target_property(__libname ${__ocv_lib} LOCATION_${configuration}) get_filename_component(__libname "${__libname}" NAME) + + if(WIN32) + string(REGEX REPLACE "[.]dll$" ".lib" __libname "${__libname}") + endif() set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_LIBNAME_${suffix} \"${__libname}\")\n") set(OPENCV_DEPENDENCIES_MAP_${suffix} "${OPENCV_DEPENDENCIES_MAP_${suffix}}set(OpenCV_${__ocv_lib}_DEPS_${suffix} ${${__ocv_lib}_MODULE_DEPS_${suffix}})\n") diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in index a412d6cc2..10e1cde9c 100644 --- a/cmake/templates/OpenCVConfig.cmake.in +++ b/cmake/templates/OpenCVConfig.cmake.in @@ -18,7 +18,7 @@ # This file will define the following variables: # - # - OpenCV_LIBS : The list of libraries to links against. -# - OpenCV_LIB_DIR : The directory where lib files are. Calling LINK_DIRECTORIES +# - OpenCV_LIB_DIR : The directory(es) where lib files are. Calling LINK_DIRECTORIES # with this path is NOT needed. # - OpenCV_INCLUDE_DIRS : The OpenCV include directories. # - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability @@ -35,7 +35,6 @@ # - OpenCV_LIB_COMPONENTS # - OpenCV_USE_MANGLED_PATHS # - OpenCV_HAVE_ANDROID_CAMERA -# - OpenCV_SOURCE_PATH # # ================================================================================================= @@ -103,7 +102,13 @@ SET(OpenCV2_INCLUDE_DIRS @CMAKE_OPENCV2_INCLUDE_DIRS_CONFIGCMAKE@) if(OpenCV2_INCLUDE_DIRS) include_directories(${OpenCV2_INCLUDE_DIRS}) list(APPEND OpenCV_INCLUDE_DIRS ${OpenCV2_INCLUDE_DIRS}) - if(MSVC) + + set(OpenCV_AddDebugRelease FALSE) + if(MSVC OR CMAKE_GENERATOR MATCHES Xcode) + set(OpenCV_AddDebugRelease TRUE) + endif() + + if(OpenCV_AddDebugRelease) set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_DIR_OPT}/Release") set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_DIR_DBG}/Debug") set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_3RDPARTY_LIB_DIR_OPT}/Release") @@ -247,4 +252,9 @@ endif() # ============================================================== # Compatibility stuff # ============================================================== +if(CMAKE_BUILD_TYPE MATCHES "Debug") + SET(OpenCV_LIB_DIR ${OpenCV_LIB_DIR_DBG} ${OpenCV_3RDPARTY_LIB_DIR_DBG}) +else() + SET(OpenCV_LIB_DIR ${OpenCV_LIB_DIR_OPT} ${OpenCV_3RDPARTY_LIB_DIR_OPT}) +endif() set(OpenCV_LIBRARIES ${OpenCV_LIBS}) diff --git a/modules/androidcamera/CMakeLists.txt b/modules/androidcamera/CMakeLists.txt index 8bc2bf6d4..2ce9831d2 100644 --- a/modules/androidcamera/CMakeLists.txt +++ b/modules/androidcamera/CMakeLists.txt @@ -20,12 +20,14 @@ if(ANDROID_SOURCE_TREE) endif() if(NOT "${ANDROID_VERSION}" STREQUAL "") SET(BUILD_ANDROID_CAMERA_WRAPPER ON) + set(ANDROID_VERSION "${ANDROID_VERSION}" CACHE INTERNAL "Version of Android source tree") endif() endif() +set(BUILD_ANDROID_CAMERA_WRAPPER ${BUILD_ANDROID_CAMERA_WRAPPER} CACHE INTERNAL "Build new wrapper for Android") MARK_AS_ADVANCED(ANDROID_SOURCE_TREE) # process wrapper libs -if (BUILD_ANDROID_CAMERA_WRAPPER) +if(BUILD_ANDROID_CAMERA_WRAPPER) add_subdirectory(camera_wrapper) else() file(GLOB camera_wrappers "${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/lib/${ANDROID_NDK_ABI_NAME}/libnative_camera_r*.so") diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index 92eed7215..1b64ac5de 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -210,8 +210,7 @@ if(APPLE) endif() endif(APPLE) -set(OPENCV_MODULE_ANDROIDCAMERA "ON") #TODO: fix it -if(HAVE_opencv_androidcamera AND OPENCV_MODULE_ANDROIDCAMERA) +if(HAVE_opencv_androidcamera) set(highgui_srcs ${highgui_srcs} src/cap_android.cpp) add_definitions(-DHAVE_ANDROID_NATIVE_CAMERA)#TODO: remove this line endif()