tests get their own CmakeLists
This commit is contained in:
parent
edd351fce0
commit
32da243239
|
@ -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)
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue