Skip to content

FetchContent unable to fetch anything #4

Description

@ksdhans

The FetchContent is supposed to be able to fetch code from the internet via HTTP(S), git, etc. Cmake-amiga currently fails with a SIGHUP error signal. If an HTTPS URL is specified, then we also get an "insert drive/volume HTTPS:" requester (should really suppress those requesters, let me know if you need code to do that).

I'm guessing that the code to fetch via Git and HTTP(S) hasn't been implemented for AmigaOS. Git should use simplegit. HTTP(S) could use curl or wget, but will also need an unarchiver to unarchive .zip, .tar.gz, etc.

Here's an example script that uses HTTPS:

cmake_minimum_required(VERSION 3.24)
project(hello_window)

# Workaround for CLang and RayLib's compound literals
# See: https://github.com/raysan5/raylib/issues/1343
set(CMAKE_CXX_STANDARD 11)

# Dependencies
include(FetchContent)

set(RAYLIB_VERSION 4.5.0)
FetchContent_Declare(
    raylib
    URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz
    FIND_PACKAGE_ARGS ${RAYLIB_VERSION} EXACT
)
set(BUILD_EXAMPLES OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(raylib)

# Our Project
set(SOURCE_FILES
	Main.cpp)

add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} raylib)


# 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()

NOTE: This won't build on AmigaOS4, but is enough to test FetchContent.

For Git, replace the URL parameter with: GIT_REPOSITORY https://github.com/raysan5/raylib.git
and add a GIT_TAG that refers to a specific commit (this one should work; 4bc8d3761c48f4dcf56f126640da8f3567dc516b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions