forked from antirez/rax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (38 loc) · 1.16 KB
/
CMakeLists.txt
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.22)
project(
mr_rax VERSION 0.1.0
DESCRIPTION "MQTT5 data requirements functions"
LANGUAGES C # possibly add CXX for Catch2
)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_EXTENSIONS OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(CTest)
find_package(
Doxygen
REQUIRED dot
OPTIONAL_COMPONENTS mscgen dia
)
if(Doxygen_FOUND)
# add_subdirectory(docs) # TODO
else()
message(STATUS "Doxygen not found, not building docs")
endif()
endif()
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(
FATAL_ERROR "You cannot build in a source directory "
"(or any directory with a CMakeLists.txt file). "
"Please make a build subdirectory and use that. "
"Remove the CMakeCache.txt and CMakeFiles/ just created."
)
endif()
option(UNIT_TESTING "Build with unit tests" ON)
if (UNIT_TESTING)
# set(BUILD_STATIC_LIB ON)
add_subdirectory(tests)
endif()
option(RAX_DEBUG_MSG "Prints a lot of debug prints" OFF)
add_subdirectory(src)