interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / unit-tests / clar / CMakeLists.txt

39 lines · 702 bytes Raw Blame History
1include(CheckFunctionExists)
2
3cmake_minimum_required(VERSION 3.16..3.29)
4
5project(clar LANGUAGES C)
6
7option(BUILD_EXAMPLE "Build the example." ON)
8
9check_function_exists(realpath CLAR_HAS_REALPATH)
10if(CLAR_HAS_REALPATH)
11 add_compile_definitions(-DCLAR_HAS_REALPATH)
12endif()
13
14add_library(clar INTERFACE)
15target_sources(clar INTERFACE
16 clar.c
17 clar.h
18 clar/fixtures.h
19 clar/fs.h
20 clar/print.h
21 clar/sandbox.h
22 clar/summary.h
23)
24set_target_properties(clar PROPERTIES
25 C_STANDARD 90
26 C_STANDARD_REQUIRED ON
27 C_EXTENSIONS OFF
28)
29
30if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
31 include(CTest)
32 if(BUILD_TESTING)
33 add_subdirectory(test)
34 endif()
35
36 if(BUILD_EXAMPLE)
37 add_subdirectory(example)
38 endif()
39endif()