test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Mon, 28 Feb 2011 09:58:07 +0100
branch1.2
changeset 902 79fab87ee483
parent 799 6be1f9bd2ac0
parent 869 636dadefe1e6
child 905 d149eaf24638
child 942 2b6bffe0e7e8
permissions -rw-r--r--
Merge bugfix #414 to branch 1.2
     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   fractional_matching_test
    25   gomory_hu_test
    26   graph_copy_test
    27   graph_test
    28   graph_utils_test
    29   hao_orlin_test
    30   heap_test
    31   kruskal_test
    32   maps_test
    33   matching_test
    34   min_cost_arborescence_test
    35   min_cost_flow_test
    36   min_mean_cycle_test
    37   path_test
    38   planarity_test
    39   preflow_test
    40   radix_sort_test
    41   random_test
    42   suurballe_test
    43   time_measure_test
    44   unionfind_test
    45 )
    46 
    47 IF(LEMON_HAVE_LP)
    48   ADD_EXECUTABLE(lp_test lp_test.cc)
    49   SET(LP_TEST_LIBS lemon)
    50 
    51   IF(LEMON_HAVE_GLPK)
    52     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    53   ENDIF()
    54   IF(LEMON_HAVE_CPLEX)
    55     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    56   ENDIF()
    57   IF(LEMON_HAVE_CLP)
    58     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    59   ENDIF()
    60 
    61   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    62   ADD_TEST(lp_test lp_test)
    63 
    64   IF(WIN32 AND LEMON_HAVE_GLPK)
    65     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    66     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    67     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    68       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    69       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    70       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    71     )
    72   ENDIF()
    73 
    74   IF(WIN32 AND LEMON_HAVE_CPLEX)
    75     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    76     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    77     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    78       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    79     )
    80   ENDIF()
    81 ENDIF()
    82 
    83 IF(LEMON_HAVE_MIP)
    84   ADD_EXECUTABLE(mip_test mip_test.cc)
    85   SET(MIP_TEST_LIBS lemon)
    86 
    87   IF(LEMON_HAVE_GLPK)
    88     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    89   ENDIF()
    90   IF(LEMON_HAVE_CPLEX)
    91     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    92   ENDIF()
    93   IF(LEMON_HAVE_CBC)
    94     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    95   ENDIF()
    96 
    97   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    98   ADD_TEST(mip_test mip_test)
    99 
   100   IF(WIN32 AND LEMON_HAVE_GLPK)
   101     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   102     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   103     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   104       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
   105       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
   106       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
   107     )
   108   ENDIF()
   109 
   110   IF(WIN32 AND LEMON_HAVE_CPLEX)
   111     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   112     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   113     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   114       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   115     )
   116   ENDIF()
   117 ENDIF()
   118 
   119 FOREACH(TEST_NAME ${TESTS})
   120   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   121   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   122   ADD_TEST(${TEST_NAME} ${TEST_NAME})
   123 ENDFOREACH()