Test for new cmake
This commit is contained in:
@@ -82,11 +82,28 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
foreach(test_file ${TEST_FILES})
|
||||||
|
get_filename_component(test_name ${test_file} NAME_WE) # utFoo
|
||||||
|
add_executable(${test_name}
|
||||||
|
${SRC_FILES}
|
||||||
|
${INCLUDE_FILES}
|
||||||
|
${test_file}
|
||||||
|
)
|
||||||
|
target_link_libraries(${test_name} PRIVATE GTest::gtest_main)
|
||||||
|
target_include_directories(${test_name} PRIVATE ${INCLUDE_DIR})
|
||||||
|
target_compile_options(${test_name} PRIVATE ${TARGET_COMPILER_OPTIONS})
|
||||||
|
|
||||||
|
include(GoogleTest)
|
||||||
|
gtest_discover_tests(${test_name})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(ut_all
|
add_executable(ut_all
|
||||||
${SRC_FILES}
|
${SRC_FILES}
|
||||||
${INCLUDE_FILES}
|
${INCLUDE_FILES}
|
||||||
${TEST_FILES}
|
${TEST_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(ut_all
|
target_link_libraries(ut_all
|
||||||
GTest::gtest_main
|
GTest::gtest_main
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user