In working with the pack
which currently has a Makefile for building looking to add the ability to build for native Windows using a CMakeLists.txt.
The SWI-Prolog documentation page for Packs with foreign code notes
configure
This preparation step is executed if one of CMakeLists.txt (cmake), configure, configure.in (autoconf), configure.ac or Makefile.am (automake) are found. The program to manage them is in parenthesis.
build
Build the process. When configured using (cmake) this will use (cmake). Otherwise either Makefile or makefile is expected and Unix make is used to build the process.
What I am not sure about is if both a Makefile and CMakeLists.txt exist, will different OSes or SWI -Prolog arch pick the correct means to build the pack, e.g.
will building on
- Windows use CMakeLists.txt
- Ubuntu use Makefile
- MacOS use Makefile
I am currently working on testing the updated pack in a forked repository on Windows using Windows Sandbox and can possibly test Ubuntu using WSL 2, but have no way to test on MacOS.
Additionally should CMakeLists.txt avoid a section like
if(NOT SWIPL_CMAKE_LOADED AND NOT WIN32)
# Unix standalone - try to find swipl and load its cmake module
...
endif()