diff --git a/CMakeLists.txt b/CMakeLists.txt index 8729bf5..649b031 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,22 +19,9 @@ include(FetchContent) ## - Raylib ## - rlImGui #### - ImGui +## - cJSON # 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 @@ -61,7 +48,7 @@ add_library(ImGui STATIC ) target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR}) -# configure rlImGui (raylib backend for ImGui) +# rlImGui FetchContent_Declare( rlimgui GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git @@ -70,6 +57,15 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(rlimgui) +# cJSON +FetchContent_Declare( + cjson + GIT_REPOSITORY https://github.com/DaveGamble/cJSON.git + GIT_SHALLOW TRUE + GIT_TAG master +) +FetchContent_MakeAvailable(cjson) + # Add source files file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp") set(PROJECT_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/src") @@ -79,6 +75,14 @@ add_executable(${PROJECT_NAME}) target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCES}) target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_INCLUDE}) +# Include directories for deps +target_include_directories(${PROJECT_NAME} PRIVATE + ${raylib_SOURCE_DIR} + ${imgui_SOURCE_DIR} + ${rlimgui_SOURCE_DIR} + ${cjson_SOURCE_DIR} +) + # Link with Raylib target_link_libraries(${PROJECT_NAME} PRIVATE raylib) @@ -88,4 +92,4 @@ target_include_directories(rlImGui PUBLIC ${rlimgui_SOURCE_DIR} ${imgui_SOURCE_D target_link_libraries(rlImGui PRIVATE raylib ImGui) # Link ImGui and rlImGui with the executable -target_link_libraries(${PROJECT_NAME} PRIVATE ImGui rlImGui) +target_link_libraries(${PROJECT_NAME} PRIVATE ImGui rlImGui cjson)