From c91bc60cb9ba8a7c333d0243178f1e70d0de9d00 Mon Sep 17 00:00:00 2001 From: illyum <90023277+itzilly@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:44:16 -0600 Subject: [PATCH] (Fix): Working cmake!!!! --- CMakeLists.txt | 51 +++++++++++++++++++++++++++++--------------- src/dmx.cpp | 3 +++ src/dmx.h | 8 +++++++ src/winapi_wrapper.h | 8 +++++++ 4 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 src/dmx.cpp create mode 100644 src/dmx.h create mode 100644 src/winapi_wrapper.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 031171a..16f7371 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,28 +1,47 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.24) -# Set the project name project(RaylibDmx) -# Set the C++ standard -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 26) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Include FetchContent module -include(FetchContent) +# nvim/fleet users (ONLY WORKS WITH MINGW/NINJA BUILDERS) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +include(FetchContent) +# 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 +#) +# - - - - - - - - - - - - - - - - - - - - - - - - -# Download and configure raylib FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 4.5.0 # or the latest version you want to use + GIT_SHALLOW TRUE + GIT_TAG 4.5.0 ) FetchContent_MakeAvailable(raylib) -# Download and configure ImGui FetchContent_Declare( imgui GIT_REPOSITORY https://github.com/ocornut/imgui.git - GIT_TAG v1.89.2 # or the latest version you want to use + GIT_SHALLOW TRUE + GIT_TAG v1.91.0 ) FetchContent_MakeAvailable(imgui) @@ -36,30 +55,28 @@ add_library(ImGui STATIC ) target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR}) -# Download and configure rlImGui (raylib backend for ImGui) +# configure rlImGui (raylib backend for ImGui) FetchContent_Declare( rlimgui GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git - GIT_TAG main # Use the correct branch name + GIT_SHALLOW TRUE + GIT_TAG main ) FetchContent_MakeAvailable(rlimgui) -# Add executable target with the source files file(GLOB_RECURSE SOURCES "src/*.cpp") add_executable(${PROJECT_NAME} ${SOURCES}) -# Link raylib to your project target_link_libraries(${PROJECT_NAME} raylib) -# Add rlImGui to the project set(RLIMGUI_SOURCES ${rlimgui_SOURCE_DIR}/rlImGui.cpp ) -# Create the rlImGui library +# 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) -# Link ImGui and rlImGui to your project +# Link ImGui and rlImGui target_link_libraries(${PROJECT_NAME} ImGui rlImGui) diff --git a/src/dmx.cpp b/src/dmx.cpp new file mode 100644 index 0000000..bb545f6 --- /dev/null +++ b/src/dmx.cpp @@ -0,0 +1,3 @@ +// +// Created by illyum on 8/15/2024. +// diff --git a/src/dmx.h b/src/dmx.h new file mode 100644 index 0000000..7e4d23b --- /dev/null +++ b/src/dmx.h @@ -0,0 +1,8 @@ +// +// Created by illyum on 8/15/2024. +// + +#ifndef RAYLIBDMX_DMX_H +#define RAYLIBDMX_DMX_H + +#endif //RAYLIBDMX_DMX_H diff --git a/src/winapi_wrapper.h b/src/winapi_wrapper.h new file mode 100644 index 0000000..e383dcf --- /dev/null +++ b/src/winapi_wrapper.h @@ -0,0 +1,8 @@ +// +// Created by illyum on 8/15/2024. +// + +#ifndef RAYLIBDMX_WINAPI_WRAPPER_H +#define RAYLIBDMX_WINAPI_WRAPPER_H + +#endif //RAYLIBDMX_WINAPI_WRAPPER_H