-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
56 lines (44 loc) · 1.18 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
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.22)
project(
MACRO
VERSION 1.0.0
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 11)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
option(BUILD_TEST_SUITE "Build test suite" ON)
option(BUILD_DOC "Build API documentation" ON)
option(MACRO_INSTALL "Generate the install target" ON)
set(MACRO_LIBRARY_TYPE
"${MACRO_LIBRARY_TYPE}"
CACHE STRING "Library type override (STATIC, SHARED, or leave empty for BUILD_SHARED_LIBS)"
)
if(MACRO_LIBRARY_TYPE)
if(NOT MACRO_LIBRARY_TYPE STREQUAL "SHARED" AND NOT MACRO_LIBRARY_TYPE STREQUAL "STATIC")
set(MACRO_LIBRARY_TYPE "${BUILD_SHARED_LIBS}")
endif()
else()
if(BUILD_SHARED_LIBS)
set(MACRO_LIBRARY_TYPE "SHARED")
else()
set(MACRO_LIBRARY_TYPE "STATIC")
endif()
endif()
if(NOT WIN32)
find_package(Threads REQUIRED)
endif()
add_subdirectory(src)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BUILD_TEST_SUITE)
add_subdirectory(test)
endif()
if(BUILD_DOC)
add_subdirectory(doc)
endif()