From cdda4c4182c9ee068567529715e4a5c68a8efb58 Mon Sep 17 00:00:00 2001 From: bonmas14 Date: Sat, 20 Sep 2025 22:28:15 +0300 Subject: Init commit v1.0 --- deps/raylib/projects/CMake/CMakeLists.txt | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 deps/raylib/projects/CMake/CMakeLists.txt (limited to 'deps/raylib/projects/CMake/CMakeLists.txt') diff --git a/deps/raylib/projects/CMake/CMakeLists.txt b/deps/raylib/projects/CMake/CMakeLists.txt new file mode 100644 index 0000000..96e33f3 --- /dev/null +++ b/deps/raylib/projects/CMake/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.11) # FetchContent is available in 3.11+ +project(example) + +# Generate compile_commands.json +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Dependencies +set(RAYLIB_VERSION 5.5) +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_MakeAvailable(raylib) + set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples + endif() +endif() + +# Our Project + +add_executable(${PROJECT_NAME} core_basic_window.c) +#set(raylib_VERBOSE 1) +target_link_libraries(${PROJECT_NAME} raylib) + +# Web Configurations +if (${PLATFORM} STREQUAL "Web") + set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".html") # Tell Emscripten to build an example.html file. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s ASYNCIFY -s GL_ENABLE_GET_PROC_ADDRESS=1") +endif() + +# Checks if OSX and links appropriate frameworks (Only required on MacOS) +if (APPLE) + target_link_libraries(${PROJECT_NAME} "-framework IOKit") + target_link_libraries(${PROJECT_NAME} "-framework Cocoa") + target_link_libraries(${PROJECT_NAME} "-framework OpenGL") +endif() -- cgit v1.2.3-70-g09d2