提交 3ec6934d 编写于 作者: V Vadim Pisarevsky

starting to fix CMake scripts for the proper OpenCVConfig.cmake behavior

上级 a7a5dd05
......@@ -1067,7 +1067,18 @@ 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/\"")
# 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\"
\"\${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
# support for 3rdparty libraries.
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/lib\"
\"\${THIS_OPENCV_CONFIG_PATH}/3rdparty/lib\"")
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)
......@@ -1080,25 +1091,12 @@ 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\"
\"\${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
# 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/\"" OUTPUT_VARIABLE RET_VAL)
#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
# Install the OpenCVConfig.cmake file which has the right paths pointing to the install directory
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
......@@ -1114,7 +1112,6 @@ if(WIN32)
# 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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册