From df009745bb78dda9ff6a65d218daf12d8ade62bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 23 Feb 2012 14:00:41 +0000 Subject: [PATCH] Add unittests always, if google test was found git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@534 fdac6126-5c0c-442c-9429-916003d36597 --- src/Unittests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Unittests/CMakeLists.txt b/src/Unittests/CMakeLists.txt index 30e4112a..f4899061 100644 --- a/src/Unittests/CMakeLists.txt +++ b/src/Unittests/CMakeLists.txt @@ -9,13 +9,15 @@ include_directories ( find_package(GoogleTest) if(GTEST_FOUND) + + enable_testing() # Set correct include paths so that the compiler can find the headers include_directories(${GTEST_INCLUDE_DIRS}) # set additional link directories link_directories(${GTEST_LIBRARY_DIR} ) # Create new target named unittests_hexmeshing - add_executable(unittests EXCLUDE_FROM_ALL unittests.cc) + add_executable(unittests unittests.cc) if ( NOT WIN32) # Link against all necessary libraries @@ -50,6 +52,8 @@ if(GTEST_FOUND) acg_copy_after_build(unittests ${CMAKE_CURRENT_SOURCE_DIR}/TestFiles ${CMAKE_BINARY_DIR}/Unittests/) + add_test(NAME AllTestsIn_OpenMesh_tests WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Unittests" COMMAND "${CMAKE_BINARY_DIR}/Unittests/unittests") + else(GTEST_FOUND) message("Google testing framework was not found!") endif(GTEST_FOUND)