-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathCMakeLists.txt
74 lines (53 loc) · 1.63 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.12.0)
project(plug VERSION 1.4.5)
message(STATUS "~~~ ${PROJECT_NAME} v${PROJECT_VERSION} ~~~")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(PLUG_UNITTEST "Build Unit Tests" ON)
message(STATUS "Unit Tests : ${PLUG_UNITTEST}")
option(PLUG_COVERAGE "Enable Coverage" OFF)
message(STATUS "Coverage : ${PLUG_COVERAGE}")
option(PLUG_LTO "Enable LTO" OFF)
message(STATUS "LTO : ${PLUG_LTO}")
option(PLUG_SANITIZER_ASAN "Enable ASan" OFF)
message(STATUS "ASan : ${PLUG_SANITIZER_ASAN}")
option(PLUG_SANITIZER_UBSAN "Enable UBSan" OFF)
message(STATUS "UBSan : ${PLUG_SANITIZER_UBSAN}")
include(DeprecatedOptions)
if( CMAKE_BUILD_TYPE )
message(STATUS "Build Type : ${CMAKE_BUILD_TYPE}")
else()
message(STATUS "Build Type : None")
endif()
include(GNUInstallDirs)
if( PLUG_LTO )
include(LTO)
endif()
if( PLUG_COVERAGE )
include(Coverage)
endif()
include(Sanitizer)
include(Install)
include(Template)
include(ClangFormat)
add_compile_options(-Wall
-Wextra
-pedantic
-pedantic-errors
-Werror
-Wshadow
-Wold-style-cast
-Wnull-dereference
-Wnon-virtual-dtor
-Woverloaded-virtual
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt6 COMPONENTS Core Widgets Gui REQUIRED)
find_package(libusb-1.0 REQUIRED)
include_directories("include")
add_subdirectory(src)
if( PLUG_UNITTEST )
enable_testing()
add_subdirectory("test")
endif()