COIN-OR::LEMON - Graph Library

Changeset 620:c3ce597c11ae in lemon-1.2 for test/CMakeLists.txt


Ignore:
Timestamp:
04/23/09 08:29:50 (11 years ago)
Author:
Akos Ladanyi <ladanyi@…>
Branch:
default
Phase:
public
Message:

FindCPLEX for CMake (#256)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/CMakeLists.txt

    r619 r620  
    3939IF(HAVE_LP)
    4040  ADD_EXECUTABLE(lp_test lp_test.cc)
     41  SET(LP_TEST_LIBS lemon)
    4142  IF(HAVE_GLPK)
    42     TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
     43    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    4344  ENDIF(HAVE_GLPK)
     45  IF(HAVE_CPLEX)
     46    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
     47  ENDIF(HAVE_CPLEX)
     48  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    4449  ADD_TEST(lp_test lp_test)
    4550
     
    5358    )
    5459  ENDIF(WIN32 AND HAVE_GLPK)
     60  IF(WIN32 AND HAVE_CPLEX)
     61    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
     62    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     63    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
     64      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     65    )
     66  ENDIF(WIN32 AND HAVE_CPLEX)
    5567ENDIF(HAVE_LP)
    5668
    5769IF(HAVE_MIP)
    5870  ADD_EXECUTABLE(mip_test mip_test.cc)
     71  SET(MIP_TEST_LIBS lemon)
    5972  IF(HAVE_GLPK)
    60     TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
     73    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    6174  ENDIF(HAVE_GLPK)
     75  IF(HAVE_CPLEX)
     76    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
     77  ENDIF(HAVE_CPLEX)
     78  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    6279  ADD_TEST(mip_test mip_test)
    6380
     
    7188    )
    7289  ENDIF(WIN32 AND HAVE_GLPK)
     90  IF(WIN32 AND HAVE_CPLEX)
     91    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
     92    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     93    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
     94      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     95    )
     96  ENDIF(WIN32 AND HAVE_CPLEX)
    7397ENDIF(HAVE_MIP)
    7498
Note: See TracChangeset for help on using the changeset viewer.