-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
73 lines (61 loc) · 2.61 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.16)
# Set the project name to your project name
project(fbide CXX)
include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)
# Link this 'library' to set the c++ standard / compileSource-time options requested
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_17)
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF)
if(ENABLE_BUILD_WITH_TIME_TRACE)
add_compile_definitions(project_options INTERFACE -ftime-trace)
endif()
endif()
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
# standard compiler warnings
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
# allow for static analysis options
include(cmake/StaticAnalyzers.cmake)
if (MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
endif()
endif()
#-----------------------------------------------------------------------------------------------------------------------
# wxWidgets
#-----------------------------------------------------------------------------------------------------------------------
if (MSVC)
SET(WX_ROOT_DIR ${WXWIN})
SET(wxWidgets_ROOT_DIR ${WXWIN})
if(CMAKE_CL_64)
set(wxWidgets_LIB_DIR ${WX_ROOT_DIR}/lib/vc_x64_lib)
else()
set(wxWidgets_LIB_DIR ${WX_ROOT_DIR}/lib/vc_lib)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(wxWidgets_CONFIGURATION mswud)
else()
set(wxWidgets_CONFIGURATION mswu)
endif()
set(WXLIBS core base aui scintilla)
else()
set(WXLIBS core base aui)
endif()
find_package(wxWidgets 3.1 COMPONENTS ${WXLIBS} REQUIRED)
#-----------------------------------------------------------------------------------------------------------------------
# YAML
#-----------------------------------------------------------------------------------------------------------------------
find_package(yaml-cpp CONFIG REQUIRED PATHS ${YAML_DIST_PATH})
#-----------------------------------------------------------------------------------------------------------------------
# fbide
#-----------------------------------------------------------------------------------------------------------------------
add_subdirectory(wxSTC)
add_subdirectory(src)