-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
66 lines (55 loc) · 1.88 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
cmake_minimum_required(VERSION 3.28.0)
project("zide")
set(CMAKE_CXX_STANDARD 17)
set(SOURCES
src/undo_redo.cpp
src/init.cpp
src/utils.cpp
src/theme.cpp
src/app.cpp
src/colorswatch.cpp
src/editor.cpp
src/menubar.cpp
src/timeline.cpp
src/toolbar.cpp
src/IMGUI/imgui.cpp
src/IMGUI/imgui_demo.cpp
src/IMGUI/imgui_draw.cpp
src/IMGUI/imgui_tables.cpp
src/IMGUI/imgui_widgets.cpp
src/IMGUI/imgui_impl_glfw.cpp
src/IMGUI/imgui_impl_opengl3.cpp
src/main.cpp
)
find_package(OpenGL REQUIRED)
if(OpenGL_FOUND)
message ("✅ OPENGL FOUND !!!")
else()
message (FATAL_ERROR "❌ Cannot find OPENGL")
endif()
# NOTE:
# DIRECTORY CONFIGURATIONS
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(GLFW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/glfw-3.4)
set(GLAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/glad)
set(NFD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/nativefiledialog)
# NOTE: FINDING GLFW
add_subdirectory(${GLFW_DIR})
include_directories(${GLFW_DIR}/include)
# NOTE: FINDING GLAD
add_library(glad STATIC ${GLAD_DIR}/src/glad.c)
include_directories(${GLAD_DIR}/include)
# Add NativeFileDialog subdirectory
add_subdirectory(${NFD_DIR})
include_directories(${NFD_DIR}/src ${NFD_DIR}/include)
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include/IMGUI)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)
if(APPLE)
target_link_libraries(${PROJECT_NAME} OpenGL::GL glfw glad nativefiledialog "-framework Cocoa" "-framework IOKit" "-framework CoreFoundation")
elseif(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
target_link_libraries(${PROJECT_NAME} OpenGL::GL glfw glad nativefiledialog ${X11_LIBRARIES} ${CMAKE_DL_LIBS})
endif()