File: CMakeLists.txt

package info (click to toggle)
rapidfuzz-cpp 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,480 kB
  • sloc: cpp: 30,893; python: 63; makefile: 26; sh: 8
file content (49 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# This is an amalgam of the rapidfuzz top-level CMakeLists.txt and the
# test one.

# Cmake config largely taken from catch2
cmake_minimum_required(VERSION 3.5)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
  cmake_policy(SET CMP0135 NEW)
endif()

project(rapidfuzz-test LANGUAGES CXX VERSION 3.0.0)

# Turn on the verbose
set(CMAKE_VERBOSE_MAKEFILE ON)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

set(CMAKE_SYSTEM_PREFIX_PATH "/usr")
find_package(rapidfuzz REQUIRED)
find_package(Catch2 3 REQUIRED)

add_library(rapidfuzz-test INTERFACE)

target_compile_features(rapidfuzz-test INTERFACE cxx_std_17)

target_include_directories(rapidfuzz-test
    INTERFACE
      $<BUILD_INTERFACE:${SOURCES_DIR}/..>
)

include(CTest)
enable_testing()

function(rapidfuzz_add_test test)
    add_executable(test_${test} tests-${test}.cpp)
    target_link_libraries(test_${test} ${PROJECT_NAME})
    target_link_libraries(test_${test} Catch2::Catch2WithMain)
    if (RAPIDFUZZ_ENABLE_LINTERS)
        target_link_libraries(test_${test} project_warnings)
    endif()
    add_test(NAME ${test} COMMAND test_${test})
endfunction()

rapidfuzz_add_test(fuzz)
rapidfuzz_add_test(common)

add_subdirectory(distance)