-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
105 lines (85 loc) · 3.51 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.6)
project("DasherUI")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/DasherUI)
add_compile_definitions(HAVE_ROUND)
find_package(OpenGL REQUIRED)
###############################
# Building GLFW Library
###############################
set(GLFW_BUILD_DOCS OFF)
set(GLFW_BUILD_EXAMPLES OFF)
set(GLFW_BUILD_TESTS OFF)
set(GLFW_INSTALL OFF)
set(GLFW_USE_HYBRID_HPG OFF)
set(GLFW_VULKAN_STATIC OFF)
add_subdirectory("Thirdparty/glfw")
###############################
# Building imgui Library
###############################
add_compile_definitions(IMGUI_DEFINE_MATH_OPERATORS)
ADD_library(imgui STATIC
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui.h
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui_demo.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui_draw.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui_tables.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/imgui_widgets.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/misc/cpp/imgui_stdlib.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/backends/imgui_impl_glfw.cpp
${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui/backends/imgui_impl_opengl3.cpp
)
target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Thirdparty/imgui)
target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Thirdparty/glfw/include)
add_dependencies(imgui glfw OpenGL::GL)
###############################
# Building Dasher Library
###############################
add_subdirectory("DasherCore")
###############################
# Misc Libs
###############################
set(NFD_BUILD_TESTS OFF)
set(NFD_INSTALL OFF)
add_subdirectory("Thirdparty/nativefiledialog-extended")
###############################
# DasherUI
###############################
IF (WIN32)
# Hide console window
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
ENDIF()
ADD_Executable(DasherUI
${PROJECT_SOURCE_DIR}/src/DasherController.cpp
${PROJECT_SOURCE_DIR}/src/DasherController.h
${PROJECT_SOURCE_DIR}/src/MainWindow.cpp
${PROJECT_SOURCE_DIR}/src/MainWindow.h
${PROJECT_SOURCE_DIR}/src/DasherUIScreen.cpp
${PROJECT_SOURCE_DIR}/src/DasherUIScreen.h
${PROJECT_SOURCE_DIR}/src/main.cpp
)
target_include_directories(DasherUI PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Thirdparty/)
add_dependencies(DasherUI imgui glfw DasherCore)
target_link_libraries(DasherUI PRIVATE imgui glfw OpenGL::GL DasherCore nfd)
###############################
# Setting up deloyment
###############################
# Copy Data files
file(GLOB RESOURCE_FILES
${PROJECT_SOURCE_DIR}/DasherCore/Data/alphabets/alphabet*.xml
${PROJECT_SOURCE_DIR}/DasherCore/Data/colours/colour*.xml
${PROJECT_SOURCE_DIR}/DasherCore/Data/control/control*.xml
${PROJECT_SOURCE_DIR}/DasherCore/Data/training/training*.txt
)
file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_BINARY_DIR}/DasherUI/Data)
file(GLOB RESOURCE_FILES
${PROJECT_SOURCE_DIR}/Thirdparty/imgui/misc/fonts/*.ttf
${PROJECT_SOURCE_DIR}/Resources/*.*
)
file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_BINARY_DIR}/DasherUI/Resources)
set_property(TARGET DasherUI PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/DasherUI/)
###############################
# Choose Startup Project
###############################
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT DasherUI)