ladanyi@539: INCLUDE_DIRECTORIES( ladanyi@596: ${PROJECT_SOURCE_DIR} ladanyi@539: ${PROJECT_BINARY_DIR} ladanyi@539: ) ladanyi@141: ladanyi@726: LINK_DIRECTORIES( ladanyi@726: ${PROJECT_BINARY_DIR}/lemon ladanyi@726: ) ladanyi@539: alpar@1044: SET(TEST_WITH_VALGRIND "NO" CACHE STRING alpar@1044: "Run the test with valgrind (YES/NO).") alpar@1044: SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") ladanyi@141: alpar@225: SET(TESTS deba@559: adaptors_test kpeter@745: bellman_ford_test ladanyi@141: bfs_test alpar@443: circulation_test kpeter@696: connectivity_test ladanyi@141: counter_test ladanyi@141: dfs_test ladanyi@141: digraph_test kpeter@170: dijkstra_test ladanyi@141: dim_test deba@559: edge_set_test ladanyi@141: error_test ladanyi@569: euler_test deba@948: fractional_matching_test tapolcai@590: gomory_hu_test deba@200: graph_copy_test ladanyi@141: graph_test kpeter@171: graph_utils_test deba@426: hao_orlin_test deba@203: heap_test ladanyi@141: kruskal_test alpar@1067: lgf_test ladanyi@141: maps_test kpeter@641: matching_test deba@522: min_cost_arborescence_test kpeter@648: min_cost_flow_test kpeter@810: min_mean_cycle_test alpar@443: path_test deba@861: planarity_test alpar@443: preflow_test ladanyi@496: radix_sort_test alpar@225: random_test alpar@443: suurballe_test ladanyi@141: time_measure_test ladanyi@726: unionfind_test ladanyi@726: ) ladanyi@539: ladanyi@674: IF(LEMON_HAVE_LP) alpar@1033: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@1033: ADD_EXECUTABLE(lp_test lp_test.cc) alpar@1033: ELSE() alpar@1033: ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) alpar@1033: ENDIF() alpar@1033: ladanyi@667: SET(LP_TEST_LIBS lemon) ladanyi@726: ladanyi@674: IF(LEMON_HAVE_GLPK) ladanyi@667: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@674: IF(LEMON_HAVE_CPLEX) ladanyi@667: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@674: IF(LEMON_HAVE_CLP) ladanyi@668: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@726: ladanyi@667: TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) ladanyi@496: ADD_TEST(lp_test lp_test) alpar@1061: ADD_DEPENDENCIES(check lp_test) ladanyi@496: ladanyi@674: IF(WIN32 AND LEMON_HAVE_GLPK) ladanyi@496: GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) ladanyi@496: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@496: ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ladanyi@496: ) ladanyi@726: ENDIF() ladanyi@726: ladanyi@674: IF(WIN32 AND LEMON_HAVE_CPLEX) ladanyi@667: GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) ladanyi@667: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@667: ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} ladanyi@667: ) ladanyi@726: ENDIF() ladanyi@726: ENDIF() ladanyi@496: ladanyi@674: IF(LEMON_HAVE_MIP) alpar@1033: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@1033: ADD_EXECUTABLE(mip_test mip_test.cc) alpar@1033: ELSE() alpar@1033: ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) alpar@1033: ENDIF() alpar@1033: ladanyi@667: SET(MIP_TEST_LIBS lemon) ladanyi@726: ladanyi@674: IF(LEMON_HAVE_GLPK) ladanyi@667: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@674: IF(LEMON_HAVE_CPLEX) ladanyi@667: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@674: IF(LEMON_HAVE_CBC) ladanyi@668: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) ladanyi@726: ENDIF() ladanyi@726: ladanyi@667: TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) ladanyi@496: ADD_TEST(mip_test mip_test) alpar@1061: ADD_DEPENDENCIES(check mip_test) ladanyi@496: ladanyi@674: IF(WIN32 AND LEMON_HAVE_GLPK) ladanyi@496: GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) ladanyi@496: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@496: ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ladanyi@496: ) ladanyi@726: ENDIF() ladanyi@726: ladanyi@674: IF(WIN32 AND LEMON_HAVE_CPLEX) ladanyi@667: GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) ladanyi@667: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@667: ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD ladanyi@726: COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} ladanyi@667: ) ladanyi@726: ENDIF() ladanyi@726: ENDIF() ladanyi@141: alpar@225: FOREACH(TEST_NAME ${TESTS}) alpar@1033: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@1033: ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) alpar@1033: ELSE() alpar@1033: ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) alpar@1033: ENDIF() alpar@225: TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) alpar@1044: IF(TEST_WITH_VALGRIND) alpar@1044: ADD_TEST(${TEST_NAME} alpar@1044: valgrind --error-exitcode=1 ${VALGRIND_FLAGS} alpar@1044: ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) alpar@1044: ELSE() alpar@1044: ADD_TEST(${TEST_NAME} ${TEST_NAME}) alpar@1044: ENDIF() alpar@1033: ADD_DEPENDENCIES(check ${TEST_NAME}) ladanyi@726: ENDFOREACH()