-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (31 loc) · 1.15 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
cmake_minimum_required(VERSION 3.6.0)
project(TextEditor2 VERSION 0.1.0)
set(OpenGL_GL_PREFERENCE GLVND)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/imgui)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/nativefiledialog)
# Add your additional source files
set(ADDITIONAL_SOURCES
MyApp.hpp
lib/nativefiledialog/src/include/nfd.hpp
openDialog.cpp
FileDialog.hpp
Menu_bar.hpp
saveDialog.cpp
)
# Add GLFW include directories
include_directories(${CMAKE_SOURCE_DIR}/lib/imgui)
include_directories(${CMAKE_SOURCE_DIR}/lib/glfw/include)
include_directories(${CMAKE_SOURCE_DIR}/lib/nativefiledialog/src/include)
include_directories(${CMAKE_SOURCE_DIR}/lib/fonts/)
# Add GLFW library
add_library(glfw STATIC IMPORTED)
set_target_properties(glfw PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/lib/glfw/libglfw3.a)
# adding executables
add_executable(TextEditor2 main.cpp ${ADDITIONAL_SOURCES})
# Add ImGui source directory
target_link_libraries(TextEditor2 PUBLIC imgui glfw)
# Add native File dialog source
target_link_libraries(TextEditor2 PUBLIC nfd)
# Link the OpenGL library
find_package(OpenGL REQUIRED)
target_link_libraries(TextEditor2 PRIVATE OpenGL::GL)