File: utils.cmake

package info (click to toggle)
xdg-utils-cxx 1.0.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 456 kB
  • sloc: cpp: 2,461; ansic: 10; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
SET(PROJECT_TESTS_TARGETS "" CACHE INTERNAL "Available tests targets")

function(add_gtest name srcs)
    add_executable(${name} ${srcs})
    target_link_libraries(${name} GTest::GTest GTest::Main)

    if(${CMAKE_VERSION} VERSION_LESS "3.10.0")
        add_test(${name} ${name})
    else()
        gtest_discover_tests(${name})
    endif()

    SET(PROJECT_TESTS_TARGETS ${PROJECT_TESTS_TARGETS} "${name}" CACHE INTERNAL "Available tests targets")
endfunction()