+if(GTEST_FOUND)
+ file(GLOB files gtest_runner.cc *-helpers.cc *_test.cc)
+ add_executable(libapt_test ${files})
+ target_include_directories(libapt_test PRIVATE ${GTEST_INCLUDE_DIRS})
+ target_link_libraries(libapt_test ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} apt-private apt-inst)
+ if (GTEST_DEPENDENCIES)
+ add_dependencies(libapt_test ${GTEST_DEPENDENCIES})
+ endif()
+ add_test(NAME AptTests
+ COMMAND libapt_test
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})