-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (63 loc) · 2.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
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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(digital-assistant)
include(FindPkgConfig)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(clone-GSL)
include(clone-imgui)
include(formatting)
message(STATUS "current module path ${CMAKE_MODULE_PATH}")
find_package(Freetype REQUIRED)
find_package(OpenGL 3 REQUIRED)
find_package(SDL2 REQUIRED)
get_property(_subprojects GLOBAL PROPERTY AS_SUBPROJECT)
message(STATUS "subprojects ${_subprojects}")
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/digitalassistant.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/no-warn-imgui.hpp)
add_executable(digitalassistant ${SOURCE_FILES})
add_clangformat(digitalassistant FILES ${SOURCE_FILES})
add_library(imgui OBJECT
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/examples/imgui_impl_opengl3.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/examples/imgui_impl_sdl.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/examples/libs/gl3w/GL/gl3w.c
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/imgui.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/imgui_demo.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/imgui_draw.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/imgui_widgets.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/misc/cpp/imgui_stdlib.cpp
${CMAKE_CURRENT_BINARY_DIR}/imgui-src/misc/freetype/imgui_freetype.cpp)
target_include_directories(imgui
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/imgui-src/examples/libs/gl3w>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/imgui-src/examples>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/imgui-src>
${FREETYPE_INCLUDE_DIRS}
${SDL2_INCLUDE_DIRS})
target_link_libraries(imgui
PUBLIC
${SDL2_LIBRARIES}
${FREETYPE_LIBRARIES}
${CMAKE_DL_LIBS}
OpenGL::GL)
target_compile_options(digitalassistant
PRIVATE
-std=gnu++1z #[[since cxx_std_17 doesn't exist yet]]
-Wall
-Werror
-Wextra
-pedantic
-Wconversion
-Winit-self
-Woverloaded-virtual
-Wunreachable-code
-Wold-style-cast
-Wsign-promo
-Wshadow)
target_include_directories(digitalassistant
PRIVATE
${SDL2_INCLUDE_DIRS})
target_link_libraries(digitalassistant
PRIVATE
GSL
imgui
${SDL2_LIBRARIES})