# HG changeset patch # User Akos Ladanyi # Date 2010-08-25 21:34:58 # Node ID e20fecd1945f0d5ac2a82b79a0e7d794de4e6cd9 # Parent 24b3f18ed9e2bea99ab482c493c3db769362ecf0 Add check target for CMake (#388) diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,8 @@ ENABLE_TESTING() +ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND}) + ADD_SUBDIRECTORY(lemon) IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) ADD_SUBDIRECTORY(demo) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -117,7 +117,8 @@ ENDIF() FOREACH(TEST_NAME ${TESTS}) - ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) + ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) ADD_TEST(${TEST_NAME} ${TEST_NAME}) + ADD_DEPENDENCIES(check ${TEST_NAME}) ENDFOREACH()