-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
84 lines (67 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.28)
project(
"DSX"
VERSION 1.0
LANGUAGES C CXX)
# Global CMake variables are set here
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Options
option(ENABLE_WARNINGS "Enable to add warnings to a target." ON)
option(ENABLE_WARNINGS_AS_ERRORS "Enable to treat warnings as errors." OFF)
option(ENABLE_SANITIZE_ADDR "Enable address sanitize." OFF)
option(ENABLE_SANITIZE_UNDEF "Enable undefined sanitize." OFF)
option(ENABLE_SANITIZE_LEAK "Enable leak sanitize (Gcc/Clang only)." OFF)
option(ENABLE_SANITIZE_THREAD "Enable thread sanitize (Gcc/Clang only)." OFF)
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
option(ENABLE_CLANG_FORMAT "Enable to add clang-format." OFF)
option(ENABLE_CMAKE_FORMAT "Enable to add cmake-format." OFF)
option(ENABLE_LTO "Enable to add Link Time Optimization." ON)
# CMAKE MODULES
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
include(ConfigSafeGuards)
include(AddGitSubmodule)
include(Docs)
include(Tools)
if(ENABLE_WARNINGS)
include(Warnings)
endif()
add_cmake_format_target()
add_clang_format_target()
if(ENABLE_SANITIZE_ADDR
OR ENABLE_SANITIZE_UNDEF
OR ENABLE_SANITIZE_LEAK
OR ENABLE_SANITIZE_THREAD)
include(Sanitizer)
add_sanitizer_flags()
endif()
if(ENABLE_LTO)
include(LTO)
endif()
# EXTERNAL LIBRARIES
# set (VCPKG_DIR ${CMAKE_SOURCE_DIR}/external/vcpkg)
# you can set any other vcpkg installation on your system
set (VCPKG_DIR ${CMAKE_SOURCE_DIR}/external/vcpkg)
include(${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake)
find_package(fmt CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(implot CONFIG REQUIRED)
find_package(OpenGL REQUIRED)
add_subdirectory(configured)
add_subdirectory(external)
add_subdirectory(app)
add_subdirectory(hidapi)
add_subdirectory(ViGEmClient)
add_subdirectory("json/")
add_subdirectory("traypp/" EXCLUDE_FROM_ALL)
add_subdirectory("Crashlogs/" EXCLUDE_FROM_ALL)
link_libraries(tray)
# INSTALL TARGETS
install(
TARGETS ${EXECUTABLE_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)