LumaShow/CMakeLists.txt

83 lines
2.2 KiB
CMake
Raw Normal View History

2024-08-15 20:44:16 -06:00
cmake_minimum_required(VERSION 3.24)
project(RaylibDmx)
2024-08-15 20:44:16 -06:00
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2024-08-15 20:44:16 -06:00
# nvim/fleet users (ONLY WORKS WITH MINGW/NINJA BUILDERS)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(FetchContent)
2024-08-15 20:44:16 -06:00
# Dependencies
## - Raylib
## - rlImGui
#### - ImGui
# Use FetchContent to download and build raylib
# This is a faster alternative to using a git repo, since this just downloads the source
# while the git repo pull takes a lot longer. Not sure why, other repos don't seem to have this issue
# If you would like to use git instead, use this:
# - - - - - - - - - - - - - - - - - - - - - - - -
#FetchContent_Declare(
# raylib
# GIT_REPOSITORY "https://github.com/raysan5/raylib.git"
# GIT_TAG "master"
# GIT_SHALLOW TRUE
# GIT_PROGRESS TRUE
#)
# - - - - - - - - - - - - - - - - - - - - - - - -
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
2024-08-15 20:44:16 -06:00
GIT_SHALLOW TRUE
GIT_TAG 4.5.0
)
FetchContent_MakeAvailable(raylib)
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
2024-08-15 20:44:16 -06:00
GIT_SHALLOW TRUE
GIT_TAG v1.91.0
)
FetchContent_MakeAvailable(imgui)
# Build ImGui as a static library
add_library(ImGui STATIC
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
)
target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR})
2024-08-15 20:44:16 -06:00
# configure rlImGui (raylib backend for ImGui)
FetchContent_Declare(
rlimgui
GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git
2024-08-15 20:44:16 -06:00
GIT_SHALLOW TRUE
GIT_TAG main
)
FetchContent_MakeAvailable(rlimgui)
file(GLOB_RECURSE SOURCES "src/*.cpp")
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} raylib)
set(RLIMGUI_SOURCES
${rlimgui_SOURCE_DIR}/rlImGui.cpp
)
2024-08-15 20:44:16 -06:00
# Create rlImGui lib
add_library(rlImGui STATIC ${RLIMGUI_SOURCES})
target_include_directories(rlImGui PUBLIC ${rlimgui_SOURCE_DIR} ${imgui_SOURCE_DIR})
target_link_libraries(rlImGui raylib ImGui)
2024-08-15 20:44:16 -06:00
# Link ImGui and rlImGui
target_link_libraries(${PROJECT_NAME} ImGui rlImGui)