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