提交 0cab986e 编写于 作者: V Vadim Pisarevsky

applied patches by sigma (ticket #644)

上级 16f50dbe
......@@ -1068,7 +1068,7 @@ set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
set(CMAKE_LIB_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/lib")
#exec_program(${CMAKE_COMMAND} ARGS "-E make_directory \"${CMAKE_BINARY_DIR}/unix-install/\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/unix-install/\"")
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)
if(UNIX)
......@@ -1080,18 +1080,42 @@ endif()
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
# -------------------------------------------------------------------------------------------
if(WIN32)
# Set CMAKE_INCLUDE_DIRS_CONFIGCMAKE to the list of include directories:
# support for 3rdparty libraries.
# This will expand to, for example, <program files>/OpenCV 1.1.0/include
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/include\" \"\${THIS_OPENCV_CONFIG_PATH}/include/opencv\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"${THIS_OPENCV_CONFIG_PATH}\"")
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/include\"
\"\${THIS_OPENCV_CONFIG_PATH}/include/opencv\"
\"\${THIS_OPENCV_CONFIG_PATH}/3rdparty/include\"")
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}\"")
# This will expand to, for example, <program files>/OpenCV 1.1.0/lib
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/lib\"")
# support for 3rdparty libraries.
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/lib\"
\"\${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib\"")
#exec_program(${CMAKE_COMMAND} ARGS "-E make_directory \"${CMAKE_BINARY_DIR}/win-install/\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"")
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/win-install/\"" OUTPUT_VARIABLE RET_VAL)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
# Configure the OpenCVConfig.cmake file to have the right paths pointing to the install directory
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_INSTALL_PREFIX}/OpenCVConfig.cmake" IMMEDIATE @ONLY)
# if videoInput support is enabled (which is by default on WIN32) copy the static library required to the installation path
# DESTINATION could also be "${CMAKE_INSTALL_PREFIX}/lib") to simplify dev environment setup of client applications
IF(HAVE_VIDEOINPUT)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/lib/videoInput.lib" "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/lib/videoInput64.lib"
DESTINATION "${CMAKE_INSTALL_PREFIX}/3rdparty/lib")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include/videoInput.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/3rdparty/include")
ENDIF()
# Add the OpenCV configuration header to the install path
# Useful for instance if a client application checks against the features OpenCV has been compiled with
install(FILES "${CMAKE_BINARY_DIR}/cvconfig.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
endif()
......
......@@ -35,16 +35,20 @@ get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH
# ======================================================
# Include directories to add to the user project:
# ======================================================
INCLUDE_DIRECTORIES(@CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
# Provide the include directories to the caller
SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
# ======================================================
# Link directories to add to the user project:
# ======================================================
LINK_DIRECTORIES("@CMAKE_LIB_DIRS_CONFIGCMAKE@")
# Provide the libs directory anyway, it may be needed in some cases.
SET(OpenCV_LIB_DIR "@CMAKE_LIB_DIRS_CONFIGCMAKE@")
SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@)
LINK_DIRECTORIES(${OpenCV_LIB_DIR})
# ====================================================================
# Link libraries: e.g. opencv_core220.so, opencv_imgproc220d.lib, etc...
......@@ -78,7 +82,7 @@ endif(NOT @CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@ STREQUAL "")
# many more dependencies:
IF (NOT @OPENCV_BUILD_SHARED_LIB@)
# Under static libs, the user of OpenCV needs access to the 3rdparty libs as well:
LINK_DIRECTORIES("@CMAKE_BINARY_DIR@/3rdparty/lib")
#LINK_DIRECTORIES(@CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE@/3rdparty/lib")
SET(OpenCV_LIBS
@OPENCV_LINKER_LIBS@
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册