summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: fc500ab1b0924454be2f3d6fa317d8e0195fd63f (plain)
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
50
cmake_minimum_required(VERSION 3.19...3.27)

if(${CMAKE_VERSION} VERSION_LESS 3.12)
    cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()

project(libfud
    VERSION 1.0.0
    DESCRIPTION "Library of FUD"
    LANGUAGES CXX C)

set(CXX_CPPCHECK "project=build/compile_commands.json;enable=information;force")

set(CMAKE_EXPORT_COMPILE_COMMANDS true)

add_library(libfud SHARED
    source/libfud.cpp
    source/fud_memory.cpp
    source/fud_c_file.cpp
    source/fud_string.cpp
    source/fud_utf8.cpp
    source/fud_utf8_iterator.cpp
    )

target_compile_options(libfud PRIVATE ${FUD_WARNINGS})

target_include_directories(libfud PUBLIC include)

set_target_properties(
    libfud PROPERTIES
    CXX_STANDARD 20
    C_STANDARD 23
    CXX_EXTENSIONS OFF
    C_EXTENSIONS OFF
    CXX_STANDARD_REQUIRED ON)

if (FUD_TEST)
add_subdirectory(test)
endif ()

if (FUD_DOC)
    find_package(Doxygen
        REQUIRED dot
        OPTIONAL_COMPONENTS mscgen dia)

    doxygen_add_docs(docs
        include
        # CONFIG_FILE "Doxyfile"
    )
endif()