test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 05 Nov 2009 15:48:01 +0100
changeset 783 ef88c0a30f85
parent 763 93cd93e82f9b
parent 698 f9746e45246e
child 799 6be1f9bd2ac0
permissions -rw-r--r--
Merge #293
     1 INCLUDE_DIRECTORIES(
     2   ${PROJECT_SOURCE_DIR}
     3   ${PROJECT_BINARY_DIR}
     4 )
     5 
     6 LINK_DIRECTORIES(
     7   ${PROJECT_BINARY_DIR}/lemon
     8 )
     9 
    10 SET(TESTS
    11   adaptors_test
    12   bellman_ford_test
    13   bfs_test
    14   circulation_test
    15   connectivity_test
    16   counter_test
    17   dfs_test
    18   digraph_test
    19   dijkstra_test
    20   dim_test
    21   edge_set_test
    22   error_test
    23   euler_test
    24   gomory_hu_test
    25   graph_copy_test
    26   graph_test
    27   graph_utils_test
    28   hao_orlin_test
    29   heap_test
    30   kruskal_test
    31   maps_test
    32   matching_test
    33   min_cost_arborescence_test
    34   min_cost_flow_test
    35   min_mean_cycle_test
    36   path_test
    37   preflow_test
    38   radix_sort_test
    39   random_test
    40   suurballe_test
    41   time_measure_test
    42   unionfind_test
    43 )
    44 
    45 IF(LEMON_HAVE_LP)
    46   ADD_EXECUTABLE(lp_test lp_test.cc)
    47   SET(LP_TEST_LIBS lemon)
    48 
    49   IF(LEMON_HAVE_GLPK)
    50     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    51   ENDIF()
    52   IF(LEMON_HAVE_CPLEX)
    53     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    54   ENDIF()
    55   IF(LEMON_HAVE_CLP)
    56     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    57   ENDIF()
    58 
    59   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    60   ADD_TEST(lp_test lp_test)
    61 
    62   IF(WIN32 AND LEMON_HAVE_GLPK)
    63     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    64     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    65     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    66       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    67       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    68       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    69     )
    70   ENDIF()
    71 
    72   IF(WIN32 AND LEMON_HAVE_CPLEX)
    73     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    74     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    75     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    76       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    77     )
    78   ENDIF()
    79 ENDIF()
    80 
    81 IF(LEMON_HAVE_MIP)
    82   ADD_EXECUTABLE(mip_test mip_test.cc)
    83   SET(MIP_TEST_LIBS lemon)
    84 
    85   IF(LEMON_HAVE_GLPK)
    86     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    87   ENDIF()
    88   IF(LEMON_HAVE_CPLEX)
    89     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    90   ENDIF()
    91   IF(LEMON_HAVE_CBC)
    92     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    93   ENDIF()
    94 
    95   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    96   ADD_TEST(mip_test mip_test)
    97 
    98   IF(WIN32 AND LEMON_HAVE_GLPK)
    99     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   100     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   101     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   102       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
   103       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
   104       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
   105     )
   106   ENDIF()
   107 
   108   IF(WIN32 AND LEMON_HAVE_CPLEX)
   109     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   110     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   111     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   112       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   113     )
   114   ENDIF()
   115 ENDIF()
   116 
   117 FOREACH(TEST_NAME ${TESTS})
   118   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   119   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   120   ADD_TEST(${TEST_NAME} ${TEST_NAME})
   121 ENDFOREACH()