summaryrefslogtreecommitdiff
path: root/png/CMakeLists.txt
blob: b9988695b6665c54b783f2edd3283183dd6223f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# PNG library CMake configuration for the Fast Light Toolkit (FLTK).
#
# Copyright 1998-2020 by Bill Spitzak and others.
#
# 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 report all bugs and problems on the following page:
#
#     https://www.fltk.org/str.php
#

# source files for png
set(PNG_SRCS
  png.c
  pngerror.c
  pngget.c
  pngmem.c
  pngpread.c
  pngread.c
  pngrio.c
  pngrtran.c
  pngrutil.c
  pngset.c
  pngtrans.c
  pngwio.c
  pngwrite.c
  pngwtran.c
  pngwutil.c
  arm/arm_init.c
  arm/filter_neon_intrinsics.c
  arm/palette_neon_intrinsics.c
)

#######################################################################
FL_ADD_LIBRARY(fltk_png STATIC "${PNG_SRCS}")
# install the png headers
install(FILES png.h;pngconf.h;pnglibconf.h
    DESTINATION ${FLTK_INCLUDEDIR}/FL/images
)

if(OPTION_USE_SYSTEM_ZLIB)
    target_link_libraries(fltk_png ${FLTK_ZLIB_LIBRARIES})
else()
    target_link_libraries(fltk_png fltk_z)
endif(OPTION_USE_SYSTEM_ZLIB)

#######################################################################
if(OPTION_BUILD_SHARED_LIBS)
#######################################################################
FL_ADD_LIBRARY(fltk_png SHARED "${PNG_SRCS}")

if(OPTION_USE_SYSTEM_ZLIB)
    target_link_libraries(fltk_png_SHARED ${FLTK_ZLIB_LIBRARIES})
else()
    target_link_libraries(fltk_png_SHARED fltk_z_SHARED)
endif(OPTION_USE_SYSTEM_ZLIB)

#######################################################################
endif(OPTION_BUILD_SHARED_LIBS)
#######################################################################