Merge
authorAlpar Juttner <alpar@cs.elte.hu>
Sat, 25 Apr 2009 17:51:09 +0100
changeset 6241f631044c290
parent 623 7c1324b35d89
parent 621 b536eaacb39b
child 626 58357e986a08
Merge
     1.1 --- a/CMakeLists.txt	Sat Apr 25 02:12:41 2009 +0200
     1.2 +++ b/CMakeLists.txt	Sat Apr 25 17:51:09 2009 +0100
     1.3 @@ -14,6 +14,8 @@
     1.4  INCLUDE(FindDoxygen)
     1.5  INCLUDE(FindGhostscript)
     1.6  FIND_PACKAGE(GLPK 4.33)
     1.7 +FIND_PACKAGE(CPLEX)
     1.8 +FIND_PACKAGE(COIN)
     1.9  
    1.10  ADD_DEFINITIONS(-DHAVE_CONFIG_H)
    1.11  
    1.12 @@ -26,12 +28,6 @@
    1.13  # C4996: 'function': was declared deprecated
    1.14  ENDIF(MSVC)
    1.15  
    1.16 -IF(GLPK_FOUND)
    1.17 -  SET(HAVE_LP TRUE)
    1.18 -  SET(HAVE_MIP TRUE)
    1.19 -  SET(HAVE_GLPK TRUE)
    1.20 -ENDIF(GLPK_FOUND)
    1.21 -
    1.22  INCLUDE(CheckTypeSize)
    1.23  CHECK_TYPE_SIZE("long long" LONG_LONG)
    1.24  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/cmake/FindCOIN.cmake	Sat Apr 25 17:51:09 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 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/cmake/FindCPLEX.cmake	Sat Apr 25 17:51:09 2009 +0100
     3.3 @@ -0,0 +1,27 @@
     3.4 +FIND_PATH(CPLEX_INCLUDE_DIR
     3.5 +  ilcplex/cplex.h
     3.6 +  PATHS "C:/ILOG/CPLEX91/include")
     3.7 +
     3.8 +FIND_LIBRARY(CPLEX_LIBRARY
     3.9 +  NAMES cplex91
    3.10 +  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda")
    3.11 +
    3.12 +INCLUDE(FindPackageHandleStandardArgs)
    3.13 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    3.14 +
    3.15 +FIND_PATH(CPLEX_BIN_DIR
    3.16 +  cplex91.dll
    3.17 +  PATHS "C:/ILOG/CPLEX91/bin/x86_win32")
    3.18 +
    3.19 +IF(CPLEX_FOUND)
    3.20 +  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    3.21 +  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    3.22 +ENDIF(CPLEX_FOUND)
    3.23 +
    3.24 +MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    3.25 +
    3.26 +IF(CPLEX_FOUND)
    3.27 +  SET(HAVE_LP TRUE)
    3.28 +  SET(HAVE_MIP TRUE)
    3.29 +  SET(HAVE_CPLEX TRUE)
    3.30 +ENDIF(CPLEX_FOUND)
     4.1 --- a/cmake/FindGLPK.cmake	Sat Apr 25 02:12:41 2009 +0200
     4.2 +++ b/cmake/FindGLPK.cmake	Sat Apr 25 17:51:09 2009 +0100
     4.3 @@ -13,8 +13,15 @@
     4.4  FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)
     4.5  
     4.6  IF(GLPK_FOUND)
     4.7 +  SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
     4.8    SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
     4.9    SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
    4.10  ENDIF(GLPK_FOUND)
    4.11  
    4.12  MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
    4.13 +
    4.14 +IF(GLPK_FOUND)
    4.15 +  SET(HAVE_LP TRUE)
    4.16 +  SET(HAVE_MIP TRUE)
    4.17 +  SET(HAVE_GLPK TRUE)
    4.18 +ENDIF(GLPK_FOUND)
     5.1 --- a/lemon/CMakeLists.txt	Sat Apr 25 02:12:41 2009 +0200
     5.2 +++ b/lemon/CMakeLists.txt	Sat Apr 25 17:51:09 2009 +0100
     5.3 @@ -20,7 +20,7 @@
     5.4  
     5.5  IF(HAVE_GLPK)
     5.6    SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
     5.7 -  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
     5.8 +  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
     5.9    IF(WIN32)
    5.10      INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
    5.11      INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
    5.12 @@ -28,6 +28,21 @@
    5.13    ENDIF(WIN32)
    5.14  ENDIF(HAVE_GLPK)
    5.15  
    5.16 +IF(HAVE_CPLEX)
    5.17 +  SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
    5.18 +  INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
    5.19 +ENDIF(HAVE_CPLEX)
    5.20 +
    5.21 +IF(HAVE_CLP)
    5.22 +  SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
    5.23 +  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    5.24 +ENDIF(HAVE_CLP)
    5.25 +
    5.26 +IF(HAVE_CBC)
    5.27 +  SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
    5.28 +  INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    5.29 +ENDIF(HAVE_CBC)
    5.30 +
    5.31  ADD_LIBRARY(lemon ${LEMON_SOURCES})
    5.32  
    5.33  INSTALL(
     6.1 --- a/lemon/config.h.cmake	Sat Apr 25 02:12:41 2009 +0200
     6.2 +++ b/lemon/config.h.cmake	Sat Apr 25 17:51:09 2009 +0100
     6.3 @@ -2,3 +2,6 @@
     6.4  #cmakedefine HAVE_LP 1
     6.5  #cmakedefine HAVE_MIP 1
     6.6  #cmakedefine HAVE_GLPK 1
     6.7 +#cmakedefine HAVE_CPLEX 1
     6.8 +#cmakedefine HAVE_CLP 1
     6.9 +#cmakedefine HAVE_CBC 1
     7.1 --- a/test/CMakeLists.txt	Sat Apr 25 02:12:41 2009 +0200
     7.2 +++ b/test/CMakeLists.txt	Sat Apr 25 17:51:09 2009 +0100
     7.3 @@ -3,10 +3,6 @@
     7.4    ${PROJECT_BINARY_DIR}
     7.5  )
     7.6  
     7.7 -IF(HAVE_GLPK)
     7.8 -  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
     7.9 -ENDIF(HAVE_GLPK)
    7.10 -
    7.11  LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    7.12  
    7.13  SET(TESTS
    7.14 @@ -42,9 +38,17 @@
    7.15  
    7.16  IF(HAVE_LP)
    7.17    ADD_EXECUTABLE(lp_test lp_test.cc)
    7.18 +  SET(LP_TEST_LIBS lemon)
    7.19    IF(HAVE_GLPK)
    7.20 -    TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
    7.21 +    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    7.22    ENDIF(HAVE_GLPK)
    7.23 +  IF(HAVE_CPLEX)
    7.24 +    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    7.25 +  ENDIF(HAVE_CPLEX)
    7.26 +  IF(HAVE_CLP)
    7.27 +    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    7.28 +  ENDIF(HAVE_CLP)
    7.29 +  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    7.30    ADD_TEST(lp_test lp_test)
    7.31  
    7.32    IF(WIN32 AND HAVE_GLPK)
    7.33 @@ -56,13 +60,28 @@
    7.34        COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    7.35      )
    7.36    ENDIF(WIN32 AND HAVE_GLPK)
    7.37 +  IF(WIN32 AND HAVE_CPLEX)
    7.38 +    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    7.39 +    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    7.40 +    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    7.41 +      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    7.42 +    )
    7.43 +  ENDIF(WIN32 AND HAVE_CPLEX)
    7.44  ENDIF(HAVE_LP)
    7.45  
    7.46  IF(HAVE_MIP)
    7.47    ADD_EXECUTABLE(mip_test mip_test.cc)
    7.48 +  SET(MIP_TEST_LIBS lemon)
    7.49    IF(HAVE_GLPK)
    7.50 -    TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
    7.51 +    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    7.52    ENDIF(HAVE_GLPK)
    7.53 +  IF(HAVE_CPLEX)
    7.54 +    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    7.55 +  ENDIF(HAVE_CPLEX)
    7.56 +  IF(HAVE_CBC)
    7.57 +    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    7.58 +  ENDIF(HAVE_CBC)
    7.59 +  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    7.60    ADD_TEST(mip_test mip_test)
    7.61  
    7.62    IF(WIN32 AND HAVE_GLPK)
    7.63 @@ -74,6 +93,13 @@
    7.64        COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    7.65      )
    7.66    ENDIF(WIN32 AND HAVE_GLPK)
    7.67 +  IF(WIN32 AND HAVE_CPLEX)
    7.68 +    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    7.69 +    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    7.70 +    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    7.71 +      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    7.72 +    )
    7.73 +  ENDIF(WIN32 AND HAVE_CPLEX)
    7.74  ENDIF(HAVE_MIP)
    7.75  
    7.76  FOREACH(TEST_NAME ${TESTS})