-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
70 lines (56 loc) · 1.75 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
cmake_minimum_required(VERSION 3.1)
# common
set(CMAKE_CXX_STANDARD 14)
add_compile_options(-Wall)
project(ScopeGUI C CXX)
# OpenGL
find_package(OpenGL REQUIRED)
link_libraries(${OPENGL_LIBRARIES})
# GLFW
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
option(GLFW_INSTALL "Generate installation target" OFF)
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
add_subdirectory(third_party/glfw)
link_libraries(glfw)
# ImGui
set(IMGUI_DIR ${CMAKE_CURRENT_LIST_DIR}/third_party/imgui)
set(GL_DIR ${IMGUI_DIR}/examples/libs/gl3w)
add_library(imgui
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_opengl2.cpp
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp)
target_include_directories(imgui PUBLIC ${IMGUI_DIR} ${GL_DIR} ${IMGUI_DIR}/backends)
link_libraries(imgui)
# SmartSerial
add_subdirectory(modules/SmartSerial)
link_libraries(smartserial)
# asio_net
add_subdirectory(modules/asio_net)
link_libraries(asio_net)
# log
include_directories(modules/log)
# asio
add_definitions(-DASIO_STANDALONE)
include_directories(third_party/asio/asio/include)
if (MINGW)
link_libraries(ws2_32)
endif ()
if (CMAKE_BUILD_TYPE MATCHES "Release")
if (MINGW)
set(CMAKE_EXE_LINKER_FLAGS "-static -s")
endif ()
set(BUILD_AS_APP WIN32 MACOSX_BUNDLE)
endif ()
# ScopeCore
add_subdirectory(modules/ScopeCore)
link_libraries(ScopeCoreGUI)
# App
add_subdirectory(App)
link_libraries(App)
add_executable(${PROJECT_NAME} ${BUILD_AS_APP} main.cpp)