From 020f9a6047765a4409873c1554d6269389ad506d Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Fri, 13 Apr 2012 11:55:12 +0000 Subject: [PATCH] Updated Clp library related code in CMakeLists.txt --- CMakeLists.txt | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 945bb73cb..797cc5627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,7 @@ OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON OCV_OPTION(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON IF WIN32 ) OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF WIN32 ) OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) ) -OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF IF (NOT ANDROID AND NOT IOS) ) +OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF IF (UNIX AND NOT ANDROID AND NOT IOS) ) # OpenCV build components # =================================================== @@ -532,15 +532,25 @@ endif() set(HAVE_CLP FALSE) if(WITH_CLP) - find_path(CLP_INCLUDE_PATH "coin" - PATHS "/usr/local/include" "/usr/include" "/opt/include" - DOC "The path to Clp headers") - if(CLP_INCLUDE_PATH) - ocv_include_directories(${CLP_INCLUDE_PATH}) - set(CLP_LIBRARY_DIR "${CLP_INCLUDE_PATH}/../lib" CACHE PATH "Full path of Clp library directory") - link_directories(${CLP_LIBRARY_DIR}) - set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp OsiClp CoinUtils) + PKG_CHECK_MODULES(CLP clp) + if(CLP_FOUND) set(HAVE_CLP TRUE) + if(NOT ${CLP_INCLUDE_DIRS} STREQUAL "") + ocv_include_directories(${CLP_INCLUDE_DIRS}) + endif() + link_directories(${CLP_LIBRARY_DIRS}) + set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CLP_LIBRARIES}) + else() + find_path(CLP_INCLUDE_PATH "coin" + PATHS "/usr/local/include" "/usr/include" "/opt/include" + DOC "The path to Clp headers") + if(CLP_INCLUDE_PATH) + ocv_include_directories(${CLP_INCLUDE_PATH}) + set(CLP_LIBRARY_DIR "${CLP_INCLUDE_PATH}/../lib" CACHE PATH "Full path of Clp library directory") + link_directories(${CLP_LIBRARY_DIR}) + set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} Clp CoinUtils bz2 z lapack blas m) + set(HAVE_CLP TRUE) + endif() endif() endif()