Add unittests always, if google test was found
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@534 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -9,13 +9,15 @@ include_directories (
|
|||||||
find_package(GoogleTest)
|
find_package(GoogleTest)
|
||||||
|
|
||||||
if(GTEST_FOUND)
|
if(GTEST_FOUND)
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
# Set correct include paths so that the compiler can find the headers
|
# Set correct include paths so that the compiler can find the headers
|
||||||
include_directories(${GTEST_INCLUDE_DIRS})
|
include_directories(${GTEST_INCLUDE_DIRS})
|
||||||
# set additional link directories
|
# set additional link directories
|
||||||
link_directories(${GTEST_LIBRARY_DIR} )
|
link_directories(${GTEST_LIBRARY_DIR} )
|
||||||
# Create new target named unittests_hexmeshing
|
# Create new target named unittests_hexmeshing
|
||||||
add_executable(unittests EXCLUDE_FROM_ALL unittests.cc)
|
add_executable(unittests unittests.cc)
|
||||||
|
|
||||||
if ( NOT WIN32)
|
if ( NOT WIN32)
|
||||||
# Link against all necessary libraries
|
# 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/)
|
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)
|
else(GTEST_FOUND)
|
||||||
message("Google testing framework was not found!")
|
message("Google testing framework was not found!")
|
||||||
endif(GTEST_FOUND)
|
endif(GTEST_FOUND)
|
||||||
|
|||||||
Reference in New Issue
Block a user