Adding new platform: AmigaOS4 (PPC)

Hi all,

I am a developer helping with the effort to port Webkit to the Amiga platform. To support this, we would also extend the support of CMake to the AmigaOS4 platform.

We have already a draft for a CMake Toolchain file at GitHub - 3246251196/CMAKE_AOS4. This toolchain file already works for simple projects.

While testing I encountered some issues trying to build a project with OpenGL; CMake cannot find the GL includes.

The SDK has multiple locations for third-party libraries (like OpenGL). The headers and libraries for the C runtime are in $SDK/local/$CRT, third-party libraries are in $SDK/local/common.

The GL/gl.h header resides in $SDK/local/common/include. We tried to configure this using
SET(CMAKE_FIND_ROOT_PATH ${SDK}local/${C_LIB}/;${SDK}local/common/) in the CMake toolchain file. But somehow CMake is looking in /bin/ for the headers:

find_path called with the following settings:

VAR: OPENGL_INCLUDE_DIR
NAMES: "GL/gl.h"
Documentation: Path to a file.
Framework
  Only Search Frameworks: 0
  Search Frameworks Last: 0
  Search Frameworks First: 0
AppBundle
  Only Search AppBundle: 0
  Search AppBundle Last: 0
  Search AppBundle First: 0
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 1

find_path considered the following locations:

/opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/opt/ppc-amigaos/bin/GL/gl.h
/opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/usr/local/sbin/GL/gl.h


/opt/ppc-amigaos/ppc-amigaos/SDK/local/common/include/opt/graphics/OpenGL/include/GL/gl.h

I am using CMake 3.28.3 on linux aarch64 (Raspberry Pi OS / Debian Bookworm).

Any hints would be greatly appreciated.

Thank you,
Josef

Hi,

I added special handling for the Amiga platform in FindOpenGL.cmake to make it finding the correct headers and libs. This fixed the issue with the strange search path.

So, it is now possible to compile a simple SDL2 + OpenGL project with CMake and the custom toolchain file.

What is the correct process to get the AmigaOS4 platform and the needed changes for OpenGL and maybe other libraries into the official CMake source code?

Thank you and best regards,
Josef

@FlynnTheAvatar thanks for working on this. Please open an issue to propose and track support for the platform. Then see CONTRIBUTING.rst for contribution instructions.