FindCOIN for CMake (#256)
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Thu, 23 Apr 2009 07:30:40 +0100
changeset 613b536eaacb39b
parent 612 c3ce597c11ae
child 616 1f631044c290
FindCOIN for CMake (#256)
CMakeLists.txt
cmake/FindCOIN.cmake
lemon/CMakeLists.txt
lemon/config.h.cmake
test/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Thu Apr 23 07:29:50 2009 +0100
     1.2 +++ b/CMakeLists.txt	Thu Apr 23 07:30:40 2009 +0100
     1.3 @@ -15,6 +15,7 @@
     1.4  INCLUDE(FindGhostscript)
     1.5  FIND_PACKAGE(GLPK 4.33)
     1.6  FIND_PACKAGE(CPLEX)
     1.7 +FIND_PACKAGE(COIN)
     1.8  
     1.9  ADD_DEFINITIONS(-DHAVE_CONFIG_H)
    1.10  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/cmake/FindCOIN.cmake	Thu Apr 23 07:30:40 2009 +0100
     2.3 @@ -0,0 +1,68 @@
     2.4 +SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
     2.5 +
     2.6 +FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
     2.7 +  PATHS ${COIN_ROOT_DIR}/include)
     2.8 +
     2.9 +FIND_LIBRARY(COIN_CBC_LIBRARY libCbc
    2.10 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.11 +FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY libCbcSolver
    2.12 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.13 +FIND_LIBRARY(COIN_CGL_LIBRARY libCgl
    2.14 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.15 +FIND_LIBRARY(COIN_CLP_LIBRARY libClp
    2.16 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.17 +FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY libCoinUtils
    2.18 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.19 +FIND_LIBRARY(COIN_OSI_LIBRARY libOsi
    2.20 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.21 +FIND_LIBRARY(COIN_OSI_CBC_LIBRARY libOsiCbc
    2.22 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.23 +FIND_LIBRARY(COIN_OSI_CLP_LIBRARY libOsiClp
    2.24 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.25 +FIND_LIBRARY(COIN_OSI_VOL_LIBRARY libOsiVol
    2.26 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.27 +FIND_LIBRARY(COIN_VOL_LIBRARY libVol
    2.28 +  PATHS ${COIN_ROOT_DIR}/lib)
    2.29 +
    2.30 +INCLUDE(FindPackageHandleStandardArgs)
    2.31 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
    2.32 +  COIN_INCLUDE_DIR
    2.33 +  COIN_CBC_LIBRARY
    2.34 +  COIN_CBC_SOLVER_LIBRARY
    2.35 +  COIN_CGL_LIBRARY
    2.36 +  COIN_CLP_LIBRARY
    2.37 +  COIN_COIN_UTILS_LIBRARY
    2.38 +  COIN_OSI_LIBRARY
    2.39 +  COIN_OSI_CBC_LIBRARY
    2.40 +  COIN_OSI_CLP_LIBRARY
    2.41 +  COIN_OSI_VOL_LIBRARY
    2.42 +  COIN_VOL_LIBRARY
    2.43 +)
    2.44 +
    2.45 +IF(COIN_FOUND)
    2.46 +  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    2.47 +  SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_OSI_VOL_LIBRARY};${COIN_VOL_LIBRARY}")
    2.48 +  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    2.49 +  SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
    2.50 +ENDIF(COIN_FOUND)
    2.51 +
    2.52 +MARK_AS_ADVANCED(
    2.53 +  COIN_INCLUDE_DIR
    2.54 +  COIN_CBC_LIBRARY
    2.55 +  COIN_CBC_SOLVER_LIBRARY
    2.56 +  COIN_CGL_LIBRARY
    2.57 +  COIN_CLP_LIBRARY
    2.58 +  COIN_COIN_UTILS_LIBRARY
    2.59 +  COIN_OSI_LIBRARY
    2.60 +  COIN_OSI_CBC_LIBRARY
    2.61 +  COIN_OSI_CLP_LIBRARY
    2.62 +  COIN_OSI_VOL_LIBRARY
    2.63 +  COIN_VOL_LIBRARY
    2.64 +)
    2.65 +
    2.66 +IF(COIN_FOUND)
    2.67 +  SET(HAVE_LP TRUE)
    2.68 +  SET(HAVE_MIP TRUE)
    2.69 +  SET(HAVE_CLP TRUE)
    2.70 +  SET(HAVE_CBC TRUE)
    2.71 +ENDIF(COIN_FOUND)
     3.1 --- a/lemon/CMakeLists.txt	Thu Apr 23 07:29:50 2009 +0100
     3.2 +++ b/lemon/CMakeLists.txt	Thu Apr 23 07:30:40 2009 +0100
     3.3 @@ -33,6 +33,16 @@
     3.4    INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
     3.5  ENDIF(HAVE_CPLEX)
     3.6  
     3.7 +IF(HAVE_CLP)
     3.8 +  SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
     3.9 +  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    3.10 +ENDIF(HAVE_CLP)
    3.11 +
    3.12 +IF(HAVE_CBC)
    3.13 +  SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
    3.14 +  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    3.15 +ENDIF(HAVE_CBC)
    3.16 +
    3.17  ADD_LIBRARY(lemon ${LEMON_SOURCES})
    3.18  
    3.19  INSTALL(
     4.1 --- a/lemon/config.h.cmake	Thu Apr 23 07:29:50 2009 +0100
     4.2 +++ b/lemon/config.h.cmake	Thu Apr 23 07:30:40 2009 +0100
     4.3 @@ -3,3 +3,5 @@
     4.4  #cmakedefine HAVE_MIP 1
     4.5  #cmakedefine HAVE_GLPK 1
     4.6  #cmakedefine HAVE_CPLEX 1
     4.7 +#cmakedefine HAVE_CLP 1
     4.8 +#cmakedefine HAVE_CBC 1
     5.1 --- a/test/CMakeLists.txt	Thu Apr 23 07:29:50 2009 +0100
     5.2 +++ b/test/CMakeLists.txt	Thu Apr 23 07:30:40 2009 +0100
     5.3 @@ -45,6 +45,9 @@
     5.4    IF(HAVE_CPLEX)
     5.5      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
     5.6    ENDIF(HAVE_CPLEX)
     5.7 +  IF(HAVE_CLP)
     5.8 +    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
     5.9 +  ENDIF(HAVE_CLP)
    5.10    TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    5.11    ADD_TEST(lp_test lp_test)
    5.12  
    5.13 @@ -75,6 +78,9 @@
    5.14    IF(HAVE_CPLEX)
    5.15      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    5.16    ENDIF(HAVE_CPLEX)
    5.17 +  IF(HAVE_CBC)
    5.18 +    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    5.19 +  ENDIF(HAVE_CBC)
    5.20    TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    5.21    ADD_TEST(mip_test mip_test)
    5.22