test/CMakeLists.txt
branch1.1
changeset 843 189760a7cdd0
parent 668 b536eaacb39b
parent 539 d8ca76573eb3
child 696 76cbcb3e9bbb
equal deleted inserted replaced
32:5491e7c72197 33:4e60d0ea3242
    34   random_test
    34   random_test
    35   suurballe_test
    35   suurballe_test
    36   time_measure_test
    36   time_measure_test
    37   unionfind_test)
    37   unionfind_test)
    38 
    38 
    39 IF(HAVE_LP)
    39 IF(LEMON_HAVE_LP)
    40   ADD_EXECUTABLE(lp_test lp_test.cc)
    40   ADD_EXECUTABLE(lp_test lp_test.cc)
    41   SET(LP_TEST_LIBS lemon)
    41   SET(LP_TEST_LIBS lemon)
    42   IF(HAVE_GLPK)
    42   IF(LEMON_HAVE_GLPK)
    43     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    43     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    44   ENDIF(HAVE_GLPK)
    44   ENDIF(LEMON_HAVE_GLPK)
    45   IF(HAVE_CPLEX)
    45   IF(LEMON_HAVE_CPLEX)
    46     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    46     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    47   ENDIF(HAVE_CPLEX)
    47   ENDIF(LEMON_HAVE_CPLEX)
    48   IF(HAVE_CLP)
    48   IF(LEMON_HAVE_CLP)
    49     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    49     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    50   ENDIF(HAVE_CLP)
    50   ENDIF(LEMON_HAVE_CLP)
    51   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    51   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    52   ADD_TEST(lp_test lp_test)
    52   ADD_TEST(lp_test lp_test)
    53 
    53 
    54   IF(WIN32 AND HAVE_GLPK)
    54   IF(WIN32 AND LEMON_HAVE_GLPK)
    55     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    55     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    56     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    56     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    57     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    57     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    58       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    58       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    59       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    59       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    60       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    60       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    61     )
    61     )
    62   ENDIF(WIN32 AND HAVE_GLPK)
    62   ENDIF(WIN32 AND LEMON_HAVE_GLPK)
    63   IF(WIN32 AND HAVE_CPLEX)
    63   IF(WIN32 AND LEMON_HAVE_CPLEX)
    64     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    64     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    65     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    65     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    66     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    66     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    67       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    67       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    68     )
    68     )
    69   ENDIF(WIN32 AND HAVE_CPLEX)
    69   ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
    70 ENDIF(HAVE_LP)
    70 ENDIF(LEMON_HAVE_LP)
    71 
    71 
    72 IF(HAVE_MIP)
    72 IF(LEMON_HAVE_MIP)
    73   ADD_EXECUTABLE(mip_test mip_test.cc)
    73   ADD_EXECUTABLE(mip_test mip_test.cc)
    74   SET(MIP_TEST_LIBS lemon)
    74   SET(MIP_TEST_LIBS lemon)
    75   IF(HAVE_GLPK)
    75   IF(LEMON_HAVE_GLPK)
    76     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    76     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    77   ENDIF(HAVE_GLPK)
    77   ENDIF(LEMON_HAVE_GLPK)
    78   IF(HAVE_CPLEX)
    78   IF(LEMON_HAVE_CPLEX)
    79     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    79     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    80   ENDIF(HAVE_CPLEX)
    80   ENDIF(LEMON_HAVE_CPLEX)
    81   IF(HAVE_CBC)
    81   IF(LEMON_HAVE_CBC)
    82     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    82     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    83   ENDIF(HAVE_CBC)
    83   ENDIF(LEMON_HAVE_CBC)
    84   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    84   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    85   ADD_TEST(mip_test mip_test)
    85   ADD_TEST(mip_test mip_test)
    86 
    86 
    87   IF(WIN32 AND HAVE_GLPK)
    87   IF(WIN32 AND LEMON_HAVE_GLPK)
    88     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    88     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    89     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    89     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    90     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    90     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    91       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    91       COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    92       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    92       COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    93       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    93       COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    94     )
    94     )
    95   ENDIF(WIN32 AND HAVE_GLPK)
    95   ENDIF(WIN32 AND LEMON_HAVE_GLPK)
    96   IF(WIN32 AND HAVE_CPLEX)
    96   IF(WIN32 AND LEMON_HAVE_CPLEX)
    97     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    97     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    98     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    98     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    99     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    99     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   100       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   100       COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   101     )
   101     )
   102   ENDIF(WIN32 AND HAVE_CPLEX)
   102   ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
   103 ENDIF(HAVE_MIP)
   103 ENDIF(LEMON_HAVE_MIP)
   104 
   104 
   105 FOREACH(TEST_NAME ${TESTS})
   105 FOREACH(TEST_NAME ${TESTS})
   106   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   106   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   107   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   107   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   108   ADD_TEST(${TEST_NAME} ${TEST_NAME})
   108   ADD_TEST(${TEST_NAME} ${TEST_NAME})