Skip to content

Commit

Permalink
Imgui add to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
V-KMilev committed May 13, 2023
1 parent bd13ab8 commit e326cc5
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions CmakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,27 @@ set(THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party)
set(GLFW_DIR ${THIRD_PARTY_DIR}/glfw)
set(GLM_DIR ${THIRD_PARTY_DIR}/glm)
set(STB_DIR ${THIRD_PARTY_DIR}/stb_image)
set(IMGUI_DIR ${THIRD_PARTY_DIR}/imgui )

set(CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core)
set(COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common)

set(IMGUI
"${IMGUI_DIR}/backends/imgui_impl_opengl3.h"
"${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp"

"${IMGUI_DIR}/backends/imgui_impl_glfw.h"
"${IMGUI_DIR}/backends/imgui_impl_glfw.cpp"

"${IMGUI_DIR}/imgui_demo.cpp"
"${IMGUI_DIR}/imgui_draw.cpp"
"${IMGUI_DIR}/imgui_tables.cpp"
"${IMGUI_DIR}/imgui_widgets.cpp"

"${IMGUI_DIR}/imgui.h"
"${IMGUI_DIR}/imgui.cpp"
)

include_directories(${CORE_DIR})
include_directories(${COMMON_DIR})

Expand All @@ -23,6 +40,21 @@ add_subdirectory(${GLFW_DIR})
set(GLAD_SOURCES "${GLFW_DIR}/deps/glad_gl.c")
set(GLAD_HEADERS "${GLFW_DIR}/deps/glad/gl.h")

set(IMGUI_SOURCES
"${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp"
"${IMGUI_DIR}/backends/imgui_impl_glfw.cpp"
"${IMGUI_DIR}/imgui_demo.cpp"
"${IMGUI_DIR}/imgui_draw.cpp"
"${IMGUI_DIR}/imgui_tables.cpp"
"${IMGUI_DIR}/imgui_widgets.cpp"
"${IMGUI_DIR}/imgui.cpp"
)
set(IMGUI_HEADERS
"${IMGUI_DIR}/backends/imgui_impl_opengl3.h"
"${IMGUI_DIR}/backends/imgui_impl_glfw.h"
"${IMGUI_DIR}/imgui.h"
)

set(SOURCES
${COMMON_DIR}/error/error_handle.cpp
${COMMON_DIR}/files/file_read.cpp
Expand Down Expand Up @@ -64,6 +96,8 @@ add_library(${PROJECT_NAME} STATIC
${GLAD_SOURCES}
${SOURCES}

${IMGUI_SOURCES}

${GLM_DIR}/glm

${GLAD_HEADERS}
Expand All @@ -80,6 +114,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC
${GLM_DIR}/glm

${STB_DIR}

${IMGUI_DIR}
${IMGUI_DIR}/backends

)

target_link_libraries(${PROJECT_NAME} PUBLIC
Expand Down

0 comments on commit e326cc5

Please sign in to comment.