1
0
Fork 0

tests get their own CmakeLists

This commit is contained in:
Kevin Matz 2021-08-22 15:32:46 -04:00
parent edd351fce0
commit 32da243239
2 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.20)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -20,12 +20,6 @@ set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTOMOC OFF)
set(CMAKE_AUTORCC OFF)
find_package(GTest REQUIRED)
file(GLOB SRCS test/*.cpp)
add_executable(Tests ${SRCS})
target_link_libraries(Tests GTest::GTest ESTA)
gtest_discover_tests(Tests)
set(SOURCE_FILES
acn/appliance.cpp
acn/appliance.h
@ -134,3 +128,5 @@ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_LIBRARY)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(test)

8
test/CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
find_package(GTest)
if (GTest_FOUND)
file(GLOB SRCS *.cpp)
add_executable(Tests ${SRCS})
target_link_libraries(Tests GTest::gtest ESTA)
gtest_discover_tests(Tests)
endif()