-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
82 lines (62 loc) · 2.25 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
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0076 NEW)
project(nightingale VERSION 1.0)
add_executable(nightingale)
set_property(TARGET nightingale PROPERTY CXX_STANDARD 14)
# find_package(glfw3)
include(glfw.cmake)
# find_package(imgui)
include(imgui.cmake)
target_sources(nightingale
PUBLIC
main_glfw.cpp
app.cpp
audio.cpp
widgets.cpp
app.h
audio.h
widgets.h
miniaudio.h
embedded_font_ShareTechMono.inc
embedded_font_fontawesome.inc
PRIVATE
libs/gl3w/GL/gl3w.c)
add_subdirectory("libs")
include_directories(
${PROJECT_SOURCE_DIR}/libs/nativefiledialog/src/include
)
set_target_properties(nightingale PROPERTIES COMPILE_FLAGS "-DIMGUI_IMPL_OPENGL_LOADER_GL3W")
find_package(OpenGL REQUIRED)
include_directories(
libs/gl3w)
target_compile_definitions(nightingale
PRIVATE BUILT_RESOURCE_PATH=${PROJECT_SOURCE_DIR})
target_link_libraries(nightingale
imgui
nativefiledialog
glfw)
if (APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
target_link_libraries(nightingale ${COREFOUNDATION_LIBRARY})
find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(nightingale ${COCOA_LIBRARY})
find_library(OPENGL_LIBRARY OpenGL)
target_link_libraries(nightingale ${OPENGL_LIBRARY})
endif (APPLE)
#set_source_files_properties(embedded_font_ShareTechMono.inc PROPERTIES GENERATED 1)
#set_source_files_properties(embedded_font_fontawesome.inc PROPERTIES GENERATED 1)
add_custom_command(
OUTPUT "${PROJECT_SOURCE_DIR}/embedded_font_ShareTechMono.inc"
COMMAND binary_to_compressed_c -base85 ${PROJECT_SOURCE_DIR}/fonts/ShareTechMono-Regular.ttf ShareTechMono > ${PROJECT_SOURCE_DIR}/embedded_font_ShareTechMono.inc
COMMENT "Embedding font: ShareTechMono-Regular.ttf"
MAIN_DEPENDENCY "fonts/ShareTechMono-Regular.ttf"
VERBATIM)
add_custom_command(
OUTPUT "${PROJECT_SOURCE_DIR}/embedded_font_fontawesome.inc"
COMMAND binary_to_compressed_c -base85 ${PROJECT_SOURCE_DIR}/fonts/fontawesome-webfont.ttf fontawesome > ${PROJECT_SOURCE_DIR}/embedded_font_fontawesome.inc
COMMENT "Embedding font: fontawesome-webfont.ttf"
MAIN_DEPENDENCY "fonts/fontawesome-webfont.ttf"
VERBATIM)
install(TARGETS nightingale
BUNDLE DESTINATION bin
RUNTIME DESTINATION bin)