-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
43 lines (31 loc) · 1.52 KB
/
CMakeLists.txt
File metadata and controls
43 lines (31 loc) · 1.52 KB
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
cmake_minimum_required(VERSION 3.5)
# For Code::Blocks generator
set(CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES ON)
# For other code editors
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Main application name
set(EXE "birdcpp")
# Main directories
set(INCLUDE_DIRECTORY "include")
set(SOURCE_DIRECTORY "src")
# Individual library directories
set(IMGUI_DIR "include/imgui")
set(FILE_DIALOG_DIR "include/ImGuiFileDialog")
set(ICON_FONT_CPP "include/IconFontCppHeaders")
# Main application source and hearders
file(GLOB Source CONFIGURE_DEPENDS ${SOURCE_DIRECTORY}/*.cpp ${SOURCE_DIRECTORY}/backends/imgui/*.cpp)
file(GLOB Headers CONFIGURE_DEPENDS ${SOURCE_DIRECTORY}/*.h ${SOURCE_DIRECTORY}/backends/imgui/*.h)
# ImGui source and headers to compile and link
file(GLOB ImGUISource CONFIGURE_DEPENDS ${IMGUI_DIR}/*.cpp)
file(GLOB ImGUIHeaders CONFIGURE_DEPENDS ${IMGUI_DIR}/*.h)
# ImGuiFileDialog source and headers to compile and link
file(GLOB FileDialogSource CONFIGURE_DEPENDS ${FILE_DIALOG_DIR}/*.cpp)
file(GLOB FileDialogHeaders CONFIGURE_DEPENDS ${FILE_DIALOG_DIR}/*.h ${FILE_DIALOG_DIR}/dirent/*.h ${FILE_DIALOG_DIR}/stb/*.h)
# Main application
project(${EXE})
# We uses SDL2 for windowing and input handling
find_package(SDL2 REQUIRED)
include_directories(${EXE} ${SDL2_INCLUDE_DIRS})
add_executable(${EXE} ${Source} ${Headers} ${ImGUISource} ${ImGUIHeaders} ${FileDialogSource} ${FileDialogHeaders})
target_include_directories(${EXE} PRIVATE ${INCLUDE_DIRECTORY} ${IMGUI_DIR} ${FILE_DIALOG_DIR})
target_link_libraries(${EXE} GL dl ${SDL2_LIBRARIES})