2021-04-30 20:47:47 +03:00
|
|
|
#
|
|
|
|
# JPEG library CMake configuration for the Fast Light Toolkit (FLTK).
|
|
|
|
#
|
2024-02-07 20:30:11 +03:00
|
|
|
# Copyright 1998-2024 by Bill Spitzak and others.
|
2021-04-30 20:47:47 +03:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
|
|
|
# https://www.fltk.org/COPYING.php
|
|
|
|
#
|
|
|
|
# Please see the following page on how to report bugs and issues:
|
|
|
|
#
|
|
|
|
# https://www.fltk.org/bugs.php
|
|
|
|
#
|
2004-10-19 00:29:58 +04:00
|
|
|
|
|
|
|
# memmgr back ends: compile only one of these into a working library
|
|
|
|
# (For now, let's use the mode that requires the image fit into memory.
|
|
|
|
# This is the recommended mode for Win32 anyway.)
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(systemdependent_SRCS jmemnobs.c)
|
2004-10-19 00:29:58 +04:00
|
|
|
|
|
|
|
# library object files common to compression and decompression
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(common_SRCS
|
|
|
|
jaricom.c jcomapi.c jutils.c jerror.c jmemmgr.c
|
2004-10-19 00:29:58 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
# compression library object files
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(compression_SRCS
|
|
|
|
jcapimin.c jcapistd.c jcarith.c jctrans.c jcparam.c jdatadst.c jcinit.c
|
|
|
|
jcmaster.c jcmarker.c jcmainct.c jcprepct.c jccoefct.c jccolor.c
|
|
|
|
jcsample.c jchuff.c jcdctmgr.c jfdctfst.c jfdctflt.c
|
|
|
|
jfdctint.c
|
2004-10-19 00:29:58 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
# decompression library object files
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(decompression_SRCS
|
|
|
|
jdapimin.c jdapistd.c jdarith.c jdtrans.c jdatasrc.c jdmaster.c
|
|
|
|
jdinput.c jdmarker.c jdhuff.c jdmainct.c jdcoefct.c
|
|
|
|
jdpostct.c jddctmgr.c jidctfst.c jidctflt.c jidctint.c
|
|
|
|
jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c
|
2004-10-19 00:29:58 +04:00
|
|
|
)
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
list(APPEND BUILD_SRCS "${systemdependent_SRCS};${common_SRCS}")
|
|
|
|
list(APPEND BUILD_SRCS "${compression_SRCS};${decompression_SRCS}")
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2010-04-06 02:33:58 +04:00
|
|
|
#######################################################################
|
2024-02-07 20:30:11 +03:00
|
|
|
# Set common variables for static and shared builds
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
set(_include_dirs
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
)
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
# Suppress Visual Studio compiler warnings
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
set(msvc_warnings /wd4267)
|
2010-04-06 02:33:58 +04:00
|
|
|
|
2014-09-27 04:41:06 +04:00
|
|
|
#######################################################################
|
2021-02-21 21:29:13 +03:00
|
|
|
# Build the static library
|
2014-09-27 04:41:06 +04:00
|
|
|
#######################################################################
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
fl_add_library(fltk_jpeg STATIC "${BUILD_SRCS}")
|
|
|
|
set(target fltk_jpeg)
|
|
|
|
|
|
|
|
target_include_directories(${target} PUBLIC ${_include_dirs})
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
target_compile_options(${target} PRIVATE ${msvc_warnings})
|
|
|
|
endif(MSVC)
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
list(APPEND FLTK_IMAGE_LIBRARIES fltk::jpeg)
|
|
|
|
|
|
|
|
# Propagate to parent scope (modified by fl_add_library and here)
|
|
|
|
set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
|
|
|
|
set(FLTK_IMAGE_LIBRARIES ${FLTK_IMAGE_LIBRARIES} PARENT_SCOPE)
|
2010-04-06 02:33:58 +04:00
|
|
|
|
2014-09-27 04:41:06 +04:00
|
|
|
#######################################################################
|
2021-02-21 21:29:13 +03:00
|
|
|
# Build the shared library (optional)
|
2014-09-27 04:41:06 +04:00
|
|
|
#######################################################################
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
if(FLTK_BUILD_SHARED_LIBS)
|
|
|
|
|
|
|
|
# ensure to export all symbols for Windows DLL's
|
|
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
|
|
|
|
|
|
|
fl_add_library(fltk_jpeg SHARED "${BUILD_SRCS}")
|
|
|
|
set(target fltk_jpeg-shared)
|
|
|
|
|
|
|
|
target_include_directories(${target} PUBLIC ${_include_dirs})
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
target_compile_options(${target} PRIVATE ${msvc_warnings})
|
|
|
|
endif(MSVC)
|
2021-04-30 20:47:47 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
list(APPEND FLTK_IMAGE_LIBRARIES_SHARED fltk::jpeg-shared)
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
# Propagate to parent scope (modified by fl_add_library and here)
|
|
|
|
set(FLTK_LIBRARIES_SHARED ${FLTK_LIBRARIES_SHARED} PARENT_SCOPE)
|
|
|
|
set(FLTK_IMAGE_LIBRARIES_SHARED ${FLTK_IMAGE_LIBRARIES_SHARED} PARENT_SCOPE)
|
2021-02-21 21:29:13 +03:00
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
endif(FLTK_BUILD_SHARED_LIBS)
|
2021-02-21 21:29:13 +03:00
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Install the library headers
|
|
|
|
#######################################################################
|
|
|
|
|
2024-02-07 20:30:11 +03:00
|
|
|
install(FILES
|
|
|
|
jconfig.h jerror.h jmorecfg.h jpeglib.h fltk_jpeg_prefix.h
|
|
|
|
DESTINATION
|
|
|
|
${FLTK_INCLUDEDIR}/FL/images
|
2021-02-21 21:29:13 +03:00
|
|
|
)
|