From 3692eb6976afee0ee6776f51289689b9065f06c1 Mon Sep 17 00:00:00 2001 From: Ethan Rublee Date: Thu, 23 Jun 2011 19:48:15 +0000 Subject: [PATCH] This fixes external project error with cmake/unix and boost. An example error: Cannot generate a safe linker search path for target tod_ectomodule because files in some directories may conflict with libraries in implicit directories --- OpenCVConfig.cmake.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenCVConfig.cmake.in b/OpenCVConfig.cmake.in index 7234be2f2b..fa37ccc7e7 100644 --- a/OpenCVConfig.cmake.in +++ b/OpenCVConfig.cmake.in @@ -31,22 +31,22 @@ SET(OpenCV_COMPUTE_CAPABILITIES @OpenCV_CUDA_CC@) # Extract the directory where *this* file has been installed (determined at cmake run-time) # This variable may or may not be used below, depending on the parsing of OpenCVConfig.cmake get_filename_component(THIS_OPENCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH) +#Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings +get_filename_component(OPENCV_INSTALL_PATH "${CMAKE_CURRENT_LIST_FILE}/../.." REALPATH) # ====================================================== # Include directories to add to the user project: # ====================================================== - # Provide the include directories to the caller -SET(OpenCV_INCLUDE_DIRS @CMAKE_INCLUDE_DIRS_CONFIGCMAKE@) - +SET(OpenCV_INCLUDE_DIRS "${OPENCV_INSTALL_PATH}/include/opencv;${OPENCV_INSTALL_PATH}/include") +message(STATUS "OpenCV Includes : ${OpenCV_INCLUDE_DIRS}") INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) # ====================================================== # Link directories to add to the user project: # ====================================================== - # Provide the libs directory anyway, it may be needed in some cases. -SET(OpenCV_LIB_DIR @CMAKE_LIB_DIRS_CONFIGCMAKE@) +SET(OpenCV_LIB_DIR "${OPENCV_INSTALL_PATH}/lib") LINK_DIRECTORIES(${OpenCV_LIB_DIR})