Skip to content

Commit

Permalink
Add ImPlot
Browse files Browse the repository at this point in the history
  • Loading branch information
doyaGu committed Jul 9, 2024
1 parent 4a9638c commit 35a5a60
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "deps/oniguruma"]
path = deps/oniguruma
url = https://github.com/kkos/oniguruma
[submodule "deps/implot"]
path = deps/implot
url = https://github.com/epezent/implot.git
5 changes: 4 additions & 1 deletion deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ add_library(utf8 INTERFACE)
target_include_directories(utf8 INTERFACE ${CMAKE_CURRENT_LIST_DIR}/utf8.h)

# ImGui
set(IMGUI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imgui PARENT_SCOPE)
set(IMGUI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imgui PARENT_SCOPE)

# ImPlot
set(IMPLOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/implot PARENT_SCOPE)
1 change: 1 addition & 0 deletions deps/implot
Submodule implot added at f15659
14 changes: 14 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,21 @@ set(IMGUI_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/imgui_impl_ck2.cpp
)

set(IMPLOT_HEADERS
${IMPLOT_SOURCE_DIR}/implot.h
${IMPLOT_SOURCE_DIR}/implot_internal.h
)

set(IMPLOT_SOURCES
${IMPLOT_SOURCE_DIR}/implot.cpp
${IMPLOT_SOURCE_DIR}/implot_items.cpp
${IMPLOT_SOURCE_DIR}/implot_demo.cpp
)

add_library(BML SHARED
${BML_SOURCES} ${BML_PUBLIC_HEADERS} ${BML_PRIVATE_HEADERS}
${IMGUI_SOURCES} ${IMGUI_HEADERS}
${IMPLOT_SOURCES} ${IMPLOT_HEADERS}
)

target_include_directories(BML
Expand Down Expand Up @@ -164,6 +176,8 @@ install(FILES
"${IMGUI_SOURCE_DIR}/imgui.h"
"${IMGUI_SOURCE_DIR}/imgui_internal.h"
"${IMGUI_SOURCE_DIR}/imstb_textedit.h"
"${IMPLOT_SOURCE_DIR}/implot.h"
"${IMPLOT_SOURCE_DIR}/implot_internal.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

Expand Down
2 changes: 2 additions & 0 deletions src/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
#ifdef IMGUI_EXPORT
#define IMGUI_API __declspec(dllexport)
#define IMPLOT_API IMGUI_API
#else
#define IMGUI_API __declspec(dllimport)
#define IMPLOT_API IMGUI_API
#endif

//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
Expand Down

0 comments on commit 35a5a60

Please sign in to comment.