-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.32 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
cmake_minimum_required(VERSION 3.0)
project(Dot)
# turn off compiler warnings
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -std=c++14")
endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/external/glfw")
add_subdirectory("${PROJECT_SOURCE_DIR}/external/glad")
add_subdirectory("${PROJECT_SOURCE_DIR}/external/lua")
add_subdirectory("${PROJECT_SOURCE_DIR}/external/serial")
include_directories("${PROJECT_SOURCE_DIR}/external/glad/include")
include_directories("${PROJECT_SOURCE_DIR}/external/lua/include")
include_directories("${PROJECT_SOURCE_DIR}/external/imgui/include")
include_directories("${PROJECT_SOURCE_DIR}/external/serial/include")
file(GLOB PROJECT_FILES "src/*.h" "src/*.cpp")
file(GLOB IMGUI_SOURCES "external/imgui/src/*.cpp")
# create the executable
source_group("external" FILES ${IMGUI_SOURCES})
add_executable(Dot ${PROJECT_FILES} ${IMGUI_SOURCES})
# add libraries
target_link_libraries(Dot glfw ${GLFW_LIBRARIES} glad lua serial)
if(MSVC)
target_link_libraries(Dot glfw ${GLFW_LIBRARIES} Setupapi winmm)
target_compile_definitions(Dot PRIVATE "-D__WINDOWS_MM__")
else()
target_link_libraries(Dot glfw ${GLFW_LIBRARIES} rt pthread asound ${GTK3_LIBRARIES})
target_compile_definitions(Dot PRIVATE "-D__LINUX_ALSA__")
endif()