Skip to content

CMakeLists Changes#34

Open
Float314 wants to merge 2 commits into
cppdiscord:mainfrom
Float314:main
Open

CMakeLists Changes#34
Float314 wants to merge 2 commits into
cppdiscord:mainfrom
Float314:main

Conversation

@Float314

Copy link
Copy Markdown

Better error handling...

Changes -
In CMakeLists.txt, line 12-26 -

if (NOT dpp_FOUND)
    message(STATUS "DPP not found, fetching from GitHub...")
    FetchContent_Declare(
        dpp
        GIT_REPOSITORY https://github.com/brainboxdotcc/DPP.git
        GIT_TAG v10.1.4
    )
    FetchContent_MakeAvailable(dpp)

	if (NOT TARGET dpp::dpp AND TARGET dpp)
        add_library(dpp::dpp ALIAS dpp)
    endif()
else()
    message(STATUS "DPP is already there in ${dpp_DIR}. Skipping this step...") # changed this line
endif()

And in line 28-33 -

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/config.json)
	file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/config.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
else()
	message(FATAL_ERROR "src/config.json NOT FOUND! Please place the folder in the src/ folder.") # Changed this line
endif()
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/res DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

Thanks for reviewing! (I Like clean CMake...)

Float314 added 2 commits July 13, 2026 16:24
1. If config.json is not found, it will give error
2. Instead of saying 'system installed dpp' say 'DPP is already there in {source location}
Forgot to save the file lol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant