Minor updates of bundled libraries and README.CMake.txt

Update Makefiles, CMakeLists.txt, improve formatting.
This commit is contained in:
Albrecht Schlosser
2023-12-04 17:31:18 +01:00
parent a73a14347d
commit cf07fa09dc
8 changed files with 43 additions and 46 deletions
+11 -3
View File
@@ -2,7 +2,7 @@
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org) # Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
# Originally written by Michael Surette # Originally written by Michael Surette
# #
# Copyright 1998-2022 by Bill Spitzak and others. # Copyright 1998-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
@@ -125,12 +125,12 @@ endif ()
# If either of them is not available, we fall back to using both local libraries # If either of them is not available, we fall back to using both local libraries
if (OPTION_USE_SYSTEM_LIBPNG AND NOT (OPTION_USE_SYSTEM_ZLIB AND ZLIB_FOUND)) if (OPTION_USE_SYSTEM_LIBPNG AND NOT (OPTION_USE_SYSTEM_ZLIB AND ZLIB_FOUND))
set (PNG_FOUND FALSE) set (PNG_FOUND FALSE)
set (OPTION_USE_SYSTEM_LIBPNG FALSE) set (OPTION_USE_SYSTEM_LIBPNG OFF)
message (STATUS "Local z lib selected: overriding png lib to local for compatibility.\n") message (STATUS "Local z lib selected: overriding png lib to local for compatibility.\n")
endif () endif ()
if (OPTION_USE_SYSTEM_ZLIB AND NOT (OPTION_USE_SYSTEM_LIBPNG AND PNG_FOUND)) if (OPTION_USE_SYSTEM_ZLIB AND NOT (OPTION_USE_SYSTEM_LIBPNG AND PNG_FOUND))
set (ZLIB_FOUND FALSE) set (ZLIB_FOUND FALSE)
set (OPTION_USE_SYSTEM_ZLIB FALSE) set (OPTION_USE_SYSTEM_ZLIB OFF)
message (STATUS "Local png lib selected: overriding z lib to local for compatibility.\n") message (STATUS "Local png lib selected: overriding z lib to local for compatibility.\n")
endif () endif ()
@@ -951,6 +951,14 @@ if (DEBUG_OPTIONS_CMAKE)
fl_debug_var (OPENGL_FOUND) fl_debug_var (OPENGL_FOUND)
fl_debug_var (OPENGL_INCLUDE_DIR) fl_debug_var (OPENGL_INCLUDE_DIR)
fl_debug_var (OPENGL_LIBRARIES) fl_debug_var (OPENGL_LIBRARIES)
fl_debug_var (CMAKE_MSVC_RUNTIME_LIBRARY)
message ("--- bundled libraries ---")
fl_debug_var (OPTION_USE_SYSTEM_LIBJPEG)
fl_debug_var (OPTION_USE_SYSTEM_LIBPNG)
fl_debug_var (OPTION_USE_SYSTEM_ZLIB)
fl_debug_var (FLTK_USE_BUILTIN_JPEG)
fl_debug_var (FLTK_USE_BUILTIN_PNG)
fl_debug_var (FLTK_USE_BUILTIN_ZLIB)
message ("--- X11 ---") message ("--- X11 ---")
fl_debug_var (X11_FOUND) fl_debug_var (X11_FOUND)
fl_debug_var (X11_INCLUDE_DIR) fl_debug_var (X11_INCLUDE_DIR)
+1 -1
View File
@@ -1,7 +1,7 @@
# #
# JPEG library CMake configuration for the Fast Light Toolkit (FLTK). # JPEG library CMake configuration for the Fast Light Toolkit (FLTK).
# #
# Copyright 1998-2021 by Bill Spitzak and others. # Copyright 1998-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
+1 -8
View File
@@ -4,7 +4,7 @@
# #
# JPEG library makefile for the Fast Light Toolkit (FLTK). # JPEG library makefile for the Fast Light Toolkit (FLTK).
# #
# Copyright 1997-2011 by Bill Spitzak and others. # Copyright 1997-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
@@ -19,7 +19,6 @@
include ../makeinclude include ../makeinclude
# #
# Object files... # Object files...
# #
@@ -74,14 +73,12 @@ OBJS = \
LIBJPEG = ../lib/libfltk_jpeg$(LIBEXT) LIBJPEG = ../lib/libfltk_jpeg$(LIBEXT)
# #
# Make all targets... # Make all targets...
# #
all: $(LIBJPEG) all: $(LIBJPEG)
# #
# Clean all targets and object files... # Clean all targets and object files...
# #
@@ -90,7 +87,6 @@ clean:
$(RM) $(OBJS) $(RM) $(OBJS)
$(RM) $(LIBJPEG) $(RM) $(LIBJPEG)
# #
# Install everything... # Install everything...
# #
@@ -108,7 +104,6 @@ install: $(LIBJPEG)
$(INSTALL_DATA) jpeglib.h $(DESTDIR)$(includedir)/FL/images $(INSTALL_DATA) jpeglib.h $(DESTDIR)$(includedir)/FL/images
$(INSTALL_DATA) fltk_jpeg_prefix.h $(DESTDIR)$(includedir)/FL/images $(INSTALL_DATA) fltk_jpeg_prefix.h $(DESTDIR)$(includedir)/FL/images
# #
# Uninstall everything... # Uninstall everything...
# #
@@ -123,7 +118,6 @@ uninstall:
$(RM) $(includedir)/FL/images/jpeglib.h $(RM) $(includedir)/FL/images/jpeglib.h
$(RM) $(includedir)/FL/images/fltk_jpeg_prefix.h $(RM) $(includedir)/FL/images/fltk_jpeg_prefix.h
# #
# libfltk_jpeg.a # libfltk_jpeg.a
# #
@@ -134,7 +128,6 @@ $(LIBJPEG): $(OBJS)
$(LIBCOMMAND) $@ $(OBJS) $(LIBCOMMAND) $@ $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
# #
# Make dependencies... # Make dependencies...
# #
+10 -8
View File
@@ -1,7 +1,7 @@
# #
# PNG library CMake configuration for the Fast Light Toolkit (FLTK). # PNG library CMake configuration for the Fast Light Toolkit (FLTK).
# #
# Copyright 1998-2022 by Bill Spitzak and others. # Copyright 1998-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
@@ -33,6 +33,13 @@ set(PNG_SRCS
pngwutil.c pngwutil.c
) )
#######################################################################
# Note: This file is used only if we build the bundled PNG library,
# and if we do this we MUST also build and use the *bundled* ZLIB,
# hence we MUST also link against the bundled ZLIB (see below).
# There's no need to check which ZLIB version to use in this context.
#######################################################################
####################################################################### #######################################################################
# Build some files on ARM (e.g. Apple M1 systems) # Build some files on ARM (e.g. Apple M1 systems)
####################################################################### #######################################################################
@@ -74,7 +81,7 @@ LIST (APPEND PNG_SRCS
####################################################################### #######################################################################
FL_ADD_LIBRARY (fltk_png STATIC "${PNG_SRCS}") FL_ADD_LIBRARY (fltk_png STATIC "${PNG_SRCS}")
target_link_libraries (fltk_png ${FLTK_ZLIB_LIBRARIES}) target_link_libraries (fltk_png PUBLIC fltk_z)
####################################################################### #######################################################################
# Build the shared library (optional) # Build the shared library (optional)
@@ -83,12 +90,7 @@ target_link_libraries (fltk_png ${FLTK_ZLIB_LIBRARIES})
if (OPTION_BUILD_SHARED_LIBS) if (OPTION_BUILD_SHARED_LIBS)
FL_ADD_LIBRARY (fltk_png SHARED "${PNG_SRCS}") FL_ADD_LIBRARY (fltk_png SHARED "${PNG_SRCS}")
target_link_libraries (fltk_png_SHARED PUBLIC fltk_z_SHARED)
if (FLTK_USE_BUILTIN_ZLIB)
target_link_libraries (fltk_png_SHARED fltk_z)
else()
target_link_libraries (fltk_png_SHARED ${FLTK_ZLIB_LIBRARIES})
endif ()
endif () endif ()
+1 -1
View File
@@ -2,7 +2,7 @@
# PNG library Makefile for the Fast Light Toolkit (FLTK). # PNG library Makefile for the Fast Light Toolkit (FLTK).
# #
# Copyright 1997-2011 by Easy Software Products. # Copyright 1997-2011 by Easy Software Products.
# Copyright 2012-2020 by Bill Spitzak and others. # Copyright 2012-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
+1 -1
View File
@@ -1,7 +1,7 @@
# #
# ZLIB library CMake configuration for the Fast Light Toolkit (FLTK). # ZLIB library CMake configuration for the Fast Light Toolkit (FLTK).
# #
# Copyright 1998-2021 by Bill Spitzak and others. # Copyright 1998-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
+2 -8
View File
@@ -1,7 +1,7 @@
# #
# GNU ZIP library makefile for the Fast Light Toolkit (FLTK). # ZIP library makefile for the Fast Light Toolkit (FLTK).
# #
# Copyright 1998-2021 by Bill Spitzak and others. # Copyright 1998-2023 by Bill Spitzak and others.
# #
# This library is free software. Distribution and use rights are outlined in # This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this # the file "COPYING" which should have been included with this file. If this
@@ -16,7 +16,6 @@
include ../makeinclude include ../makeinclude
# #
# Object files... # Object files...
# #
@@ -27,14 +26,12 @@ OBJS = adler32.o compress.o crc32.o uncompr.o deflate.o \
LIBZ = ../lib/libfltk_z$(LIBEXT) LIBZ = ../lib/libfltk_z$(LIBEXT)
# #
# Make all targets... # Make all targets...
# #
all: $(LIBZ) all: $(LIBZ)
# #
# Clean all targets and object files... # Clean all targets and object files...
# #
@@ -43,7 +40,6 @@ clean:
$(RM) $(OBJS) $(RM) $(OBJS)
$(RM) $(LIBZ) $(RM) $(LIBZ)
# #
# Install everything... # Install everything...
# #
@@ -59,7 +55,6 @@ install: $(LIBZ)
$(INSTALL_DATA) zlib.h $(DESTDIR)$(includedir)/FL/images $(INSTALL_DATA) zlib.h $(DESTDIR)$(includedir)/FL/images
$(INSTALL_DATA) zutil.h $(DESTDIR)$(includedir)/FL/images $(INSTALL_DATA) zutil.h $(DESTDIR)$(includedir)/FL/images
# #
# Uninstall everything... # Uninstall everything...
# #
@@ -72,7 +67,6 @@ uninstall:
$(RM) $(includedir)/FL/images/zlib.h $(RM) $(includedir)/FL/images/zlib.h
$(RM) $(includedir)/FL/images/zutil.h $(RM) $(includedir)/FL/images/zutil.h
# #
# libfltk_z.a # libfltk_z.a
# #