mirror of
https://github.com/yoboujon/yoyo_card.git
synced 2025-06-08 09:40:48 +02:00
Added DirImgui support as well as rlImGui.
This commit is contained in:
parent
65552b7301
commit
cc21e12738
2 changed files with 55 additions and 2 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,2 +1,5 @@
|
|||
# Build folder
|
||||
build/**
|
||||
build/**
|
||||
|
||||
# VSCode
|
||||
.vscode/**
|
|
@ -15,4 +15,54 @@ if (NOT raylib_FOUND) # If there's none, fetch and build raylib
|
|||
FetchContent_MakeAvailable(raylib)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# dear imgui
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
imgui_content
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP OFF
|
||||
URL https://github.com/ocornut/imgui/archive/refs/tags/v1.91.8.tar.gz
|
||||
)
|
||||
FetchContent_Populate(imgui_content)
|
||||
FetchContent_GetProperties(imgui_content)
|
||||
project(imgui_library)
|
||||
set(imgui_SOURCE_FILES
|
||||
"${imgui_content_SOURCE_DIR}/imgui.cpp"
|
||||
"${imgui_content_SOURCE_DIR}/imgui_demo.cpp"
|
||||
"${imgui_content_SOURCE_DIR}/imgui_draw.cpp"
|
||||
"${imgui_content_SOURCE_DIR}/imgui_tables.cpp"
|
||||
"${imgui_content_SOURCE_DIR}/imgui_widgets.cpp"
|
||||
"${imgui_content_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp"
|
||||
)
|
||||
add_library(imgui STATIC "${imgui_SOURCE_FILES}")
|
||||
target_include_directories(imgui PRIVATE "${imgui_content_SOURCE_DIR}")
|
||||
SET(imgui_INCLUDE_DIRS
|
||||
"${imgui_content_SOURCE_DIR}"
|
||||
"${imgui_content_SOURCE_DIR}/misc/cpp"
|
||||
CACHE INTERNAL "ImGUI Header folder")
|
||||
set_target_properties(${imgui}
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
)
|
||||
|
||||
# rlImGui
|
||||
FetchContent_Declare(
|
||||
rlimgui_content
|
||||
GIT_REPOSITORY https://github.com/raylib-extras/rlImGui
|
||||
GIT_TAG 8d3a31402f6b99ba52925acc96441c2410f6b500
|
||||
)
|
||||
FetchContent_Populate(rlimgui_content)
|
||||
FetchContent_GetProperties(rlimgui_content)
|
||||
project(rlimgui)
|
||||
add_library(rlimgui STATIC "${rlimgui_content_SOURCE_DIR}/rlImGui.cpp")
|
||||
target_include_directories(rlimgui PRIVATE "${rlimgui_content_SOURCE_DIR}")
|
||||
target_include_directories(rlimgui PRIVATE "${imgui_INCLUDE_DIRS}")
|
||||
target_link_libraries(rlimgui raylib imgui)
|
||||
SET(rlImGui_INCLUDE_DIRS "${rlimgui_content_SOURCE_DIR}" CACHE INTERNAL "rlImGui Header folder")
|
||||
set_target_properties(${rlimgui}
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue