cmake_minimum_required(VERSION 3.12) project(raylib-gpu-particles) # Generate compile_commands.json set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Dependencies set(RAYLIB_VERSION 5.0) find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED if (NOT raylib_FOUND) # If there's none, fetch and build raylib include(FetchContent) FetchContent_Declare( raylib DOWNLOAD_EXTRACT_TIMESTAMP OFF URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz ) FetchContent_GetProperties(raylib) if (NOT raylib_POPULATED) # Have we downloaded raylib yet? set(FETCHCONTENT_QUIET NO) FetchContent_Populate(raylib) set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples set(GRAPHICS GRAPHICS_API_OPENGL_43) add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR}) endif() endif() # Our Project add_executable(${PROJECT_NAME}) file(GLOB SOURCE_FILES CONFIGURE_DEPENDS *.c) target_sources(${PROJECT_NAME} PRIVATE ${SOURCE_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}) add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Shaders $/Shaders DEPENDS ${PROJECT_NAME}) #set(raylib_VERBOSE 1) target_link_libraries(${PROJECT_NAME} raylib)