${PROJECT_BINARY_DIR}/lemon
SET(TEST_WITH_VALGRIND "NO" CACHE STRING
"Run the test with valgrind (YES/NO).")
SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
max_cardinality_search_test
min_cost_arborescence_test
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
ADD_EXECUTABLE(lp_test lp_test.cc)
ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ADD_TEST(lp_test lp_test)
IF(WIN32 AND LEMON_HAVE_GLPK)
GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
IF(WIN32 AND LEMON_HAVE_CPLEX)
GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
ADD_EXECUTABLE(mip_test mip_test.cc)
ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ADD_TEST(mip_test mip_test)
IF(WIN32 AND LEMON_HAVE_GLPK)
GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
IF(WIN32 AND LEMON_HAVE_CPLEX)
GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
FOREACH(TEST_NAME ${TESTS})
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
ADD_TEST(${TEST_NAME} ${TEST_NAME})
ADD_DEPENDENCIES(check ${TEST_NAME})