From 5bcfecb6cc03b581afb12509b9b67d4ff0dd2f28 Mon Sep 17 00:00:00 2001 From: Michael Palimaka Date: Wed, 16 May 2012 03:58:34 +1000 Subject: [PATCH] Use ctest instead of custom target. --- CMakeLists.txt | 5 ++++- tests/CMakeLists.txt | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e00f04d3..4692ebb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,10 @@ configure_file(taglib/taglib_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c add_subdirectory(taglib) add_subdirectory(bindings) -add_subdirectory(tests) +if(BUILD_TESTS) + enable_testing() + add_subdirectory(tests) +endif(BUILD_TESTS) add_subdirectory(examples) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 67b29581..79d19429 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,3 @@ -if(BUILD_TESTS) - INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../taglib ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/toolkit @@ -64,8 +62,4 @@ SET(test_runner_SRCS ADD_EXECUTABLE(test_runner ${test_runner_SRCS}) TARGET_LINK_LIBRARIES(test_runner tag ${CPPUNIT_LIBRARIES}) -ADD_CUSTOM_TARGET(check - ./test_runner - DEPENDS test_runner -) -endif(BUILD_TESTS) +ADD_TEST(test_runner test_runner)