### Initializing CMake Project and Output Directory - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet sets the minimum required CMake version, defines the project name, and configures the output directory for runtime executables to be within the binary directory's 'bin' subdirectory. ```CMake cmake_minimum_required(VERSION 3.30) project(CodotakuGameEngine) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) ``` -------------------------------- ### Including Assimp Dependency - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet includes the Assimp (Open Asset Import Library) from its GitHub repository at a specified version. The Assimp target is then appended to the `LIBS` list for linking with the project. ```CMake # assimp include_dependency(assimp https://github.com/assimp/assimp v5.4.3) list(APPEND LIBS assimp::assimp) ``` -------------------------------- ### Including SDL_image Dependency - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet includes the SDL3_image library, first disabling AVIF support due to external tool chain requirements. It fetches the library from GitHub and appends its target to the `LIBS` list. ```CMake # SDL_image set(SDLIMAGE_AVIF OFF CACHE BOOL "" FORCE) # Requires Perl and Nasm for libaom (AVIF image format) include_dependency(SDL3_image https://github.com/libsdl-org/SDL_image release-3.2.4) list(APPEND LIBS SDL3_image::SDL3_image) ``` -------------------------------- ### Defining FetchContent Dependency Inclusion Function - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This function, `include_dependency`, simplifies the process of adding external Git repositories using CMake's `FetchContent` module. It declares and makes available a library by its name, Git URL, and tag, enabling shallow cloning and progress reporting. ```CMake include(FetchContent) function(include_dependency libName gitURL gitTAG) FetchContent_Declare(${libName} GIT_REPOSITORY ${gitURL} GIT_TAG ${gitTAG} GIT_SHALLOW TRUE GIT_PROGRESS TRUE ) FetchContent_MakeAvailable(${libName}) endfunction() ``` -------------------------------- ### Configuring Executable and Linking Libraries - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet defines the main executable for the project, sets its C++ standard to C++23, and links all previously collected dependencies from the `LIBS` list. This ensures the executable can use the functionality provided by the external libraries. ```CMake add_executable(${PROJECT_NAME} src/main.cpp) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS}) ``` -------------------------------- ### Including GLM Dependency - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet fetches the GLM (OpenGL Mathematics) header-only library from its GitHub repository at a specific version. Its header-only target is then added to the `LIBS` list for inclusion. ```CMake # glm include_dependency(glm https://github.com/g-truc/glm 1.0.1) list(APPEND LIBS glm::glm-header-only) ``` -------------------------------- ### Initializing and Appending to Dependencies List - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet initializes an empty list variable `LIBS` which will be used to accumulate all linked libraries. Subsequent dependency inclusions will append their target names to this list for later linking. ```CMake set(LIBS) ``` -------------------------------- ### Including SDL3 Dependency - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This section uses the `include_dependency` function to fetch and make available the SDL3 library from its GitHub repository at a specific release tag. The SDL3 target is then appended to the `LIBS` list for linking. ```CMake # SDL include_dependency(SDL3 https://github.com/libsdl-org/SDL release-3.2.8) list(APPEND LIBS SDL3::SDL3) ``` -------------------------------- ### Copying Project Assets - CMake Source: https://github.com/ilyas-taouaou/codotakugameengine/blob/master/CMakeLists.txt This snippet copies the `Content` directory, which presumably contains game assets, to the runtime output directory of the compiled executable. This ensures that assets are available alongside the executable when it runs. ```CMake # Copy assets file(COPY Content DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.