COIN-OR::LEMON - Graph Library

Changeset 679:9c7639f3a741 in lemon-main for test


Ignore:
Timestamp:
05/29/09 13:44:37 (15 years ago)
Author:
Akos Ladanyi <ladanyi@…>
Branch:
default
Phase:
public
Message:

Minor CMake improvements

  • Use the empty ELSE(), ENDIF(), ENDMACRO(), etc. syntax since this improves readability and requires less typing.
  • Use FIND_PACKAGE() instead of INCLUDE().
  • Use the value of CMAKE_COMMAND variable instead of cmake, since this works even if cmake is not in the PATH.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/CMakeLists.txt

    r649 r679  
    44)
    55
    6 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
     6LINK_DIRECTORIES(
     7  ${PROJECT_BINARY_DIR}/lemon
     8)
    79
    810SET(TESTS
     
    3638  suurballe_test
    3739  time_measure_test
    38   unionfind_test)
     40  unionfind_test
     41)
    3942
    4043IF(LEMON_HAVE_LP)
    4144  ADD_EXECUTABLE(lp_test lp_test.cc)
    4245  SET(LP_TEST_LIBS lemon)
     46
    4347  IF(LEMON_HAVE_GLPK)
    4448    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    45   ENDIF(LEMON_HAVE_GLPK)
     49  ENDIF()
    4650  IF(LEMON_HAVE_CPLEX)
    4751    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    48   ENDIF(LEMON_HAVE_CPLEX)
     52  ENDIF()
    4953  IF(LEMON_HAVE_CLP)
    5054    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    51   ENDIF(LEMON_HAVE_CLP)
     55  ENDIF()
     56
    5257  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    5358  ADD_TEST(lp_test lp_test)
     
    5762    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    5863    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    59       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    60       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    61       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     64      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
     65      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
     66      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    6267    )
    63   ENDIF(WIN32 AND LEMON_HAVE_GLPK)
     68  ENDIF()
     69
    6470  IF(WIN32 AND LEMON_HAVE_CPLEX)
    6571    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    6672    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    6773    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    68       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     74      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    6975    )
    70   ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
    71 ENDIF(LEMON_HAVE_LP)
     76  ENDIF()
     77ENDIF()
    7278
    7379IF(LEMON_HAVE_MIP)
    7480  ADD_EXECUTABLE(mip_test mip_test.cc)
    7581  SET(MIP_TEST_LIBS lemon)
     82
    7683  IF(LEMON_HAVE_GLPK)
    7784    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    78   ENDIF(LEMON_HAVE_GLPK)
     85  ENDIF()
    7986  IF(LEMON_HAVE_CPLEX)
    8087    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    81   ENDIF(LEMON_HAVE_CPLEX)
     88  ENDIF()
    8289  IF(LEMON_HAVE_CBC)
    8390    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    84   ENDIF(LEMON_HAVE_CBC)
     91  ENDIF()
     92
    8593  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    8694  ADD_TEST(mip_test mip_test)
     
    9098    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    9199    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    92       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    93       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    94       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     100      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
     101      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
     102      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    95103    )
    96   ENDIF(WIN32 AND LEMON_HAVE_GLPK)
     104  ENDIF()
     105
    97106  IF(WIN32 AND LEMON_HAVE_CPLEX)
    98107    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    99108    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    100109    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    101       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     110      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    102111    )
    103   ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
    104 ENDIF(LEMON_HAVE_MIP)
     112  ENDIF()
     113ENDIF()
    105114
    106115FOREACH(TEST_NAME ${TESTS})
     
    108117  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    109118  ADD_TEST(${TEST_NAME} ${TEST_NAME})
    110 ENDFOREACH(TEST_NAME)
     119ENDFOREACH()
Note: See TracChangeset for help on using the changeset viewer.