Ok, first here are the details from my OpenBSD system.
I installed FLTK 1.3.9 with the package manager, and it is installed under "/usr/local/".
cmake is installed under /usr/loca/bin, also this is installed with the package manager.
=== version ===========
$ cmake -version
cmake version 3.31.8
=====cmake module path=====
/usr/local/share/cmake/Modules/Platform/UnixPaths.cmake
========= PATH ======
$ echo $PATH
/home/iantal/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
===================CMake configuration=======================================
here is the cmake configuration process with an empty build folder:
$ cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.4.3")
-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Found ZLIB: /usr/lib/libz.so.7.1 (found version "1.3.1.1")
-- Found PNG: /usr/local/lib/libpng.so.18.2 (found version "1.6.52")
-- Looking for png.h
-- Looking for png.h - found
-- Found JPEG: /usr/local/lib/libjpeg.so.71.0 (found version "62")
-- Checking for module 'wayland-client>=1.18'
-- Found wayland-client, version 1.24.0
-- Checking for module 'wayland-cursor'
-- Found wayland-cursor, version 1.24.0
-- Checking for module 'wayland-protocols>=1.15'
-- Package 'wayland-protocols' not found
-- Checking for module 'xkbcommon'
-- Found xkbcommon, version 1.13.1
-- Not all software modules 'wayland-client>=1.18 wayland-cursor wayland-protocols>=1.15 xkbcommon' are present
-- Consequently, FLTK_BACKEND_WAYLAND is turned off.
-- Found X11: /usr/X11R6/include
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.so.19.0;/usr/X11R6/lib/libXext.so.13.0
-- Looking for XOpenDisplay in /usr/X11R6/lib/libX11.so.19.0;/usr/X11R6/lib/libXext.so.13.0 - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Looking for glXGetProcAddressARB
-- Looking for glXGetProcAddressARB - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuration Summary for FLTK 1.4.4 generated by CMake 3.31.8 --
-- The following OPTIONAL packages have been found:
* ZLIB
* PNG
* JPEG
-- The following OPTIONAL packages have not been found:
* Doxygen
-- Static libraries will be built in: /home/iantal/programming/fltk/build/debug/lib
-- Shared libraries will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)
-- The forms library will be built in: /home/iantal/programming/fltk/build/debug/lib
-- The OpenGL library will be built in: /home/iantal/programming/fltk/build/debug/lib
-- fluid will be built in: /home/iantal/programming/fltk/build/debug/bin
-- fltk-options will be built in: /home/iantal/programming/fltk/build/debug/bin
-- Test programs will be built in: /home/iantal/programming/fltk/build/debug/bin/test
-- Example programs will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
--
-- Build configuration Debug
-- Installation prefix /usr/local
-- Bundled Libraries JPEG = System: /usr/local/lib/libjpeg.so.71.0
-- PNG = System: /usr/local/lib/libpng.so.18.2
-- ZLIB = System: /usr/lib/libz.so.7.1
-- Use Wayland No (X11 is used)
-- All drawing uses Cairo No
-- Use Pango No
-- Use Xft Yes
-- Fl_Cairo_Window support No
-- Use std:: No
-- End of Configuration Summary --
-- Configuring done (12.9s)
-- Generating done (1.2s)
-- Build files have been written to: /home/iantal/programming/fltk/build/debug
======= CMAKE_SYSTEM_INCLUDE_PATH======
I executed cmake -LAH | grep ... in build/debug and I found that CMAKE_SYSTEM_INCLUDE_PATH is not found. Not in CMakeCache.txt as well.
I may have been off track with CMAKE_SYSTEM_INCLUDE_PATH, maybe this is not the key, but I saw this in the trace while configuring the build with cmake
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(32): if($ENV{LOCALBASE} )
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(34): else()
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(35): set(OPENBSD_LOCALBASE /usr/local )
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(37): if($ENV{X11BASE} )
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(39): else()
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(40): set(OPENBSD_X11BASE /usr/X11R6 )
/usr/local/share/cmake/Modules/Platform/OpenBSD.cmake(43): list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${OPENBSD_LOCALBASE} )
=========== cmake build Step 1=============
=== std out ===
[ 0%] Building CXX object src/CMakeFiles/fltk.dir/Fl.cxx.o
=== std err ===
*** Error 2 in . (CMakeFiles/Makefile2:524 'src/CMakeFiles/fltk.dir/all': /usr/bin/make -s -f src/CMakeFiles/fltk.dir/build.make src/CMakeFi...)
*** Error 2 in /home/iantal/programming/fltk/build/debug (Makefile:136 'all': /usr/bin/make -s -f CMakeFiles/Makefile2 all)
==== cmake build Step 2 ====
=== std out ===
[ 0%] Building CXX object src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o
=== std err ===
In file included from /home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:21:
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H:92:7: error: redefinition of 'Fl_PostScript_Graphics_Driver'
92 | class Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
| ^
/usr/local/include/FL/Fl_PostScript.H:61:17: note: previous definition is here
61 | class FL_EXPORT Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:693:37: error: out-of-line definition of 'draw_pixmap' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
693 | void Fl_PostScript_Graphics_Driver::draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy){
| ^~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:694:7: error: use of undeclared identifier 'scale_for_image_'
694 | if (scale_for_image_(pxm, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:708:37: error: out-of-line definition of 'draw_rgb' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
708 | void Fl_PostScript_Graphics_Driver::draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy)
| ^~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:710:7: error: use of undeclared identifier 'scale_for_image_'
710 | if (scale_for_image_(rgb, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:712:16: error: no member named 'data_w' in 'Fl_RGB_Image'
712 | int w = rgb->data_w();
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:713:16: error: no member named 'data_h' in 'Fl_RGB_Image'
713 | int h = rgb->data_h();
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:724:37: error: out-of-line definition of 'draw_bitmap' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
724 | void Fl_PostScript_Graphics_Driver::draw_bitmap(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy) {
| ^~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:725:7: error: use of undeclared identifier 'scale_for_image_'
725 | if (scale_for_image_(bitmap, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:726:16: error: no member named 'data_w' in 'Fl_Bitmap'
726 | WP = bitmap->data_w(), HP = bitmap->data_h();
| ~~~~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:726:39: error: no member named 'data_h' in 'Fl_Bitmap'
726 | WP = bitmap->data_w(), HP = bitmap->data_h();
| ~~~~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:742:36: error: out-of-line definition of 'scale_for_image_' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
742 | int Fl_PostScript_Graphics_Driver::scale_for_image_(Fl_Image *img, int XP, int YP, int WP, int HP, int cx,int cy) {
| ^~~~~~~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:744:27: error: no member named 'start_image' in 'Fl_Graphics_Driver'
744 | if (Fl_Graphics_Driver::start_image(img, XP, YP, WP, HP, cx, cy, X, Y, W, H)) {
| ~~~~~~~~~~~~~~~~~~~~^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:749:81: error: no member named 'data_w' in 'Fl_Image'
749 | clocale_printf("GS %d %d TR %f %f SC GS\n", X-cx, Y-cy, float(img->w())/img->data_w(), float(img->h())/img->data_h());
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:749:112: error: no member named 'data_h' in 'Fl_Image'
749 | clocale_printf("GS %d %d TR %f %f SC GS\n", X-cx, Y-cy, float(img->w())/img->data_w(), float(img->h())/img->data_h());
| ~~~ ^
15 errors generated.
*** Error 1 in . (src/CMakeFiles/fltk.dir/build.make:2725 'src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o': cd /home/i...)
*** Error 2 in . (CMakeFiles/Makefile2:524 'src/CMakeFiles/fltk.dir/all': /usr/bin/make -s -f src/CMakeFiles/fltk.dir/build.make src/CMakeFi...)
*** Error 2 in /home/iantal/programming/fltk/build/debug (Makefile:136 'all': /usr/bin/make -s -f CMakeFiles/Makefile2 all)
=== cmake build Step 3 ===
=== std out===
Change Dir: '/home/iantal/programming/fltk/build/debug'
Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile -j1
/usr/local/bin/cmake -S/home/iantal/programming/fltk -B/home/iantal/programming/fltk/build/debug --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/iantal/programming/fltk/build/debug/CMakeFiles /home/iantal/programming/fltk/build/debug//CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
/usr/bin/make -f src/CMakeFiles/fltk.dir/build.make src/CMakeFiles/fltk.dir/depend
cd /home/iantal/programming/fltk/build/debug && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/iantal/programming/fltk /home/iantal/programming/fltk/src /home/iantal/programming/fltk/build/debug /home/iantal/programming/fltk/build/debug/src /home/iantal/programming/fltk/build/debug/src/CMakeFiles/fltk.dir/DependInfo.cmake "--color="
Dependencies file "src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o.d" is newer than depends file "/home/iantal/programming/fltk/build/debug/src/CMakeFiles/fltk.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target fltk
/usr/bin/make -f src/CMakeFiles/fltk.dir/build.make src/CMakeFiles/fltk.dir/build
[ 0%] Building CXX object src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o
cd /home/iantal/programming/fltk/build/debug/src && /usr/bin/c++ -DFL_LIBRARY -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/usr/local/include -I/home/iantal/programming/fltk/build/debug/src/.. -I/home/iantal/programming/fltk/src/.. -I/usr/X11R6/include/freetype2 -I/usr/X11R6/include -g -D_THREAD_SAFE -D_REENTRANT -MD -MT src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o -MF CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o.d -o CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o -c /home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx
===std err===
In file included from /home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:21:
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_Graphics_Driver.H:92:7: error: redefinition of 'Fl_PostScript_Graphics_Driver'
92 | class Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
| ^
/usr/local/include/FL/Fl_PostScript.H:61:17: note: previous definition is here
61 | class FL_EXPORT Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:693:37: error: out-of-line definition of 'draw_pixmap' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
693 | void Fl_PostScript_Graphics_Driver::draw_pixmap(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy){
| ^~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:694:7: error: use of undeclared identifier 'scale_for_image_'
694 | if (scale_for_image_(pxm, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:708:37: error: out-of-line definition of 'draw_rgb' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
708 | void Fl_PostScript_Graphics_Driver::draw_rgb(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy)
| ^~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:710:7: error: use of undeclared identifier 'scale_for_image_'
710 | if (scale_for_image_(rgb, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:712:16: error: no member named 'data_w' in 'Fl_RGB_Image'
712 | int w = rgb->data_w();
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:713:16: error: no member named 'data_h' in 'Fl_RGB_Image'
713 | int h = rgb->data_h();
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:724:37: error: out-of-line definition of 'draw_bitmap' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
724 | void Fl_PostScript_Graphics_Driver::draw_bitmap(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy) {
| ^~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:725:7: error: use of undeclared identifier 'scale_for_image_'
725 | if (scale_for_image_(bitmap, XP, YP, WP, HP, cx, cy)) return;
| ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:726:16: error: no member named 'data_w' in 'Fl_Bitmap'
726 | WP = bitmap->data_w(), HP = bitmap->data_h();
| ~~~~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:726:39: error: no member named 'data_h' in 'Fl_Bitmap'
726 | WP = bitmap->data_w(), HP = bitmap->data_h();
| ~~~~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:742:36: error: out-of-line definition of 'scale_for_image_' does not match any declaration in 'Fl_PostScript_Graphics_Driver'
742 | int Fl_PostScript_Graphics_Driver::scale_for_image_(Fl_Image *img, int XP, int YP, int WP, int HP, int cx,int cy) {
| ^~~~~~~~~~~~~~~~
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:744:27: error: no member named 'start_image' in 'Fl_Graphics_Driver'
744 | if (Fl_Graphics_Driver::start_image(img, XP, YP, WP, HP, cx, cy, X, Y, W, H)) {
| ~~~~~~~~~~~~~~~~~~~~^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:749:81: error: no member named 'data_w' in 'Fl_Image'
749 | clocale_printf("GS %d %d TR %f %f SC GS\n", X-cx, Y-cy, float(img->w())/img->data_w(), float(img->h())/img->data_h());
| ~~~ ^
/home/iantal/programming/fltk/src/drivers/PostScript/Fl_PostScript_image.cxx:749:112: error: no member named 'data_h' in 'Fl_Image'
749 | clocale_printf("GS %d %d TR %f %f SC GS\n", X-cx, Y-cy, float(img->w())/img->data_w(), float(img->h())/img->data_h());
| ~~~ ^
15 errors generated.
*** Error 1 in . (src/CMakeFiles/fltk.dir/build.make:2725 'src/CMakeFiles/fltk.dir/drivers/PostScript/Fl_PostScript_image.cxx.o')
*** Error 2 in . (CMakeFiles/Makefile2:524 'src/CMakeFiles/fltk.dir/all')
*** Error 2 in /home/iantal/programming/fltk/build/debug (Makefile:136 'all')