-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
80 lines (66 loc) · 3.35 KB
/
CMakeLists.txt
File metadata and controls
80 lines (66 loc) · 3.35 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
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
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 3.10)
# Set the project name and specify the C++ standard
project(CourseManagementSystem VERSION 1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include_directories(${PROJECT_SOURCE_DIR}/external/stb_image) # Added for stb_image
include_directories(${PROJECT_SOURCE_DIR}/external/localGlad/include) # Include GLAD headers
#Interface library for template-based data structures
add_library(data_structures INTERFACE)
target_include_directories(data_structures INTERFACE ${PROJECT_SOURCE_DIR}/src/data_structures)
# Entity library
file(GLOB ENTITY_SOURCES ${PROJECT_SOURCE_DIR}/src/entities/*.cpp)
add_library(entity_lib ${ENTITY_SOURCES})
target_include_directories(entity_lib PUBLIC ${PROJECT_SOURCE_DIR}/src/entities)
# Service library
file (GLOB SERVICE_SOURCES ${PROJECT_SOURCE_DIR}/src/services/*.cpp)
add_library(service_lib ${SERVICE_SOURCES})
target_include_directories(service_lib PUBLIC ${PROJECT_SOURCE_DIR}/src/services)
# Utility library
file(GLOB UTILITY_SOURCES ${PROJECT_SOURCE_DIR}/src/utils/*.cpp)
add_library(utility_lib ${UTILITY_SOURCES})
target_include_directories(utility_lib PUBLIC ${PROJECT_SOURCE_DIR}/src/utils)
# GUI library
file(GLOB GUI_SOURCES ${PROJECT_SOURCE_DIR}/src/gui/styles/*.h
${PROJECT_SOURCE_DIR}/src/gui/components/*.cpp
${PROJECT_SOURCE_DIR}/src/gui/views/*/*.cpp
${PROJECT_SOURCE_DIR}/src/utils/stb_image_setup.cpp
${PROJECT_SOURCE_DIR}/src/gui/managers/*.cpp
)
add_library(gui_lib ${GUI_SOURCES})
target_include_directories(gui_lib PUBLIC ${PROJECT_SOURCE_DIR}/src/gui)
# Linked other libraries to gui_lib
target_link_libraries(gui_lib PUBLIC ImGui glfw GLAD OpenGL::GL data_structures entity_lib service_lib bcrypt utility_lib)
# Add the main ImGui source files
file(GLOB IMGUI_SOURCES
${PROJECT_SOURCE_DIR}/external/imgui/*.cpp
${PROJECT_SOURCE_DIR}/external/imgui/backends/imgui_impl_glfw.cpp
${PROJECT_SOURCE_DIR}/external/imgui/backends/imgui_impl_opengl3.cpp
)
add_library(ImGui ${IMGUI_SOURCES})
target_include_directories(ImGui PUBLIC
${PROJECT_SOURCE_DIR}/external/imgui
${PROJECT_SOURCE_DIR}/external/imgui/backends
${PROJECT_SOURCE_DIR}/external/glfw/include # Add GLFW include directory
)
target_compile_definitions(ImGui PRIVATE IMGUI_IMPL_OPENGL_LOADER_GLAD)
# Main executable
add_executable(CourseManagementSystem ${PROJECT_SOURCE_DIR}/src/main.cpp)
find_package(OpenGL REQUIRED)
target_link_libraries(CourseManagementSystem PRIVATE entity_lib service_lib bcrypt utility_lib gui_lib ImGui glfw GLAD OpenGL::GL)
# If you're using GLFW, OpenGL, or other libraries, link them here as well
# e.g., target_link_libraries(CourseManagementSystem PRIVATE glfw OpenGL ...)
add_subdirectory(external/glfw)
add_library(GLAD ${PROJECT_SOURCE_DIR}/external/localGlad/src/glad.c)
target_include_directories(GLAD PUBLIC external/localGlad/include)
target_include_directories(CourseManagementSystem PRIVATE ${PROJECT_SOURCE_DIR}/external/glfw/include)
# bcrypt library
add_subdirectory(external/libbcrypt-master)
target_include_directories(CourseManagementSystem PRIVATE external/libbcrypt-master/include)
# Unit testing
enable_testing()
add_subdirectory(${PROJECT_SOURCE_DIR}/external/googletest)
add_subdirectory(tests)
# add global path to assets
add_definitions(-DASSETS_PATH="${PROJECT_SOURCE_DIR}/assets/")
add_definitions(-DROOT_DATA_PATH="${PROJECT_SOURCE_DIR}/data/")