1.1 --- a/test/CMakeLists.txt Fri Oct 16 10:21:37 2009 +0200
1.2 +++ b/test/CMakeLists.txt Thu Nov 05 15:50:01 2009 +0100
1.3 @@ -1,31 +1,121 @@
1.4 INCLUDE_DIRECTORIES(
1.5 - ${CMAKE_SOURCE_DIR}
1.6 + ${PROJECT_SOURCE_DIR}
1.7 ${PROJECT_BINARY_DIR}
1.8 )
1.9
1.10 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
1.11 +LINK_DIRECTORIES(
1.12 + ${PROJECT_BINARY_DIR}/lemon
1.13 +)
1.14
1.15 SET(TESTS
1.16 + adaptors_test
1.17 + bellman_ford_test
1.18 bfs_test
1.19 + circulation_test
1.20 + connectivity_test
1.21 counter_test
1.22 dfs_test
1.23 digraph_test
1.24 dijkstra_test
1.25 dim_test
1.26 + edge_set_test
1.27 error_test
1.28 + euler_test
1.29 + gomory_hu_test
1.30 graph_copy_test
1.31 graph_test
1.32 graph_utils_test
1.33 + hao_orlin_test
1.34 heap_test
1.35 kruskal_test
1.36 maps_test
1.37 + matching_test
1.38 + min_cost_arborescence_test
1.39 + min_cost_flow_test
1.40 + min_mean_cycle_test
1.41 + path_test
1.42 + preflow_test
1.43 + radix_sort_test
1.44 random_test
1.45 - path_test
1.46 + suurballe_test
1.47 time_measure_test
1.48 - unionfind_test)
1.49 + unionfind_test
1.50 +)
1.51 +
1.52 +IF(LEMON_HAVE_LP)
1.53 + ADD_EXECUTABLE(lp_test lp_test.cc)
1.54 + SET(LP_TEST_LIBS lemon)
1.55 +
1.56 + IF(LEMON_HAVE_GLPK)
1.57 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
1.58 + ENDIF()
1.59 + IF(LEMON_HAVE_CPLEX)
1.60 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
1.61 + ENDIF()
1.62 + IF(LEMON_HAVE_CLP)
1.63 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
1.64 + ENDIF()
1.65 +
1.66 + TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
1.67 + ADD_TEST(lp_test lp_test)
1.68 +
1.69 + IF(WIN32 AND LEMON_HAVE_GLPK)
1.70 + GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
1.71 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.72 + ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
1.73 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
1.74 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
1.75 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
1.76 + )
1.77 + ENDIF()
1.78 +
1.79 + IF(WIN32 AND LEMON_HAVE_CPLEX)
1.80 + GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
1.81 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.82 + ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
1.83 + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
1.84 + )
1.85 + ENDIF()
1.86 +ENDIF()
1.87 +
1.88 +IF(LEMON_HAVE_MIP)
1.89 + ADD_EXECUTABLE(mip_test mip_test.cc)
1.90 + SET(MIP_TEST_LIBS lemon)
1.91 +
1.92 + IF(LEMON_HAVE_GLPK)
1.93 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
1.94 + ENDIF()
1.95 + IF(LEMON_HAVE_CPLEX)
1.96 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
1.97 + ENDIF()
1.98 + IF(LEMON_HAVE_CBC)
1.99 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
1.100 + ENDIF()
1.101 +
1.102 + TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
1.103 + ADD_TEST(mip_test mip_test)
1.104 +
1.105 + IF(WIN32 AND LEMON_HAVE_GLPK)
1.106 + GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
1.107 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.108 + ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
1.109 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
1.110 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
1.111 + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
1.112 + )
1.113 + ENDIF()
1.114 +
1.115 + IF(WIN32 AND LEMON_HAVE_CPLEX)
1.116 + GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
1.117 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.118 + ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
1.119 + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
1.120 + )
1.121 + ENDIF()
1.122 +ENDIF()
1.123
1.124 FOREACH(TEST_NAME ${TESTS})
1.125 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
1.126 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
1.127 ADD_TEST(${TEST_NAME} ${TEST_NAME})
1.128 -ENDFOREACH(TEST_NAME)
1.129 +ENDFOREACH()