annotate Resources/CMake/LibPngConfiguration.cmake @ 2538:c53f1d015b06

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 14:50:34 +0200
parents 74d0953a3681
children 0c2a8d5e0097
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
2 SET(LIBPNG_SOURCES_DIR ${CMAKE_BINARY_DIR}/libpng-1.5.12)
2384
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2383
diff changeset
3 SET(LIBPNG_URL "http://www.orthanc-server.com/downloads/third-party/libpng-1.5.12.tar.gz")
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
4 SET(LIBPNG_MD5 "8ea7f60347a306c5faf70b977fa80e28")
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
5
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1472
diff changeset
6 DownloadPackage(${LIBPNG_MD5} ${LIBPNG_URL} "${LIBPNG_SOURCES_DIR}")
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
7
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
8 include_directories(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
9 ${LIBPNG_SOURCES_DIR}
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
10 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
11
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
12 configure_file(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
13 ${LIBPNG_SOURCES_DIR}/scripts/pnglibconf.h.prebuilt
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
14 ${LIBPNG_SOURCES_DIR}/pnglibconf.h
1544
4d0e2c38d15b fix msvc build
jodogne
parents: 1537
diff changeset
15 )
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
16
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
17 set(LIBPNG_SOURCES
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
18 #${LIBPNG_SOURCES_DIR}/example.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
19 ${LIBPNG_SOURCES_DIR}/png.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
20 ${LIBPNG_SOURCES_DIR}/pngerror.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
21 ${LIBPNG_SOURCES_DIR}/pngget.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
22 ${LIBPNG_SOURCES_DIR}/pngmem.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
23 ${LIBPNG_SOURCES_DIR}/pngpread.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
24 ${LIBPNG_SOURCES_DIR}/pngread.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
25 ${LIBPNG_SOURCES_DIR}/pngrio.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
26 ${LIBPNG_SOURCES_DIR}/pngrtran.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
27 ${LIBPNG_SOURCES_DIR}/pngrutil.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
28 ${LIBPNG_SOURCES_DIR}/pngset.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
29 #${LIBPNG_SOURCES_DIR}/pngtest.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
30 ${LIBPNG_SOURCES_DIR}/pngtrans.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
31 ${LIBPNG_SOURCES_DIR}/pngwio.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
32 ${LIBPNG_SOURCES_DIR}/pngwrite.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
33 ${LIBPNG_SOURCES_DIR}/pngwtran.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
34 ${LIBPNG_SOURCES_DIR}/pngwutil.c
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
35 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
36
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
37 #set_property(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
38 # SOURCE ${LIBPNG_SOURCES}
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
39 # PROPERTY COMPILE_FLAGS -UHAVE_CONFIG_H)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
40
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
41 add_definitions(
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
42 -DPNG_NO_CONSOLE_IO=1
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
43 -DPNG_NO_STDIO=1
1472
237d83694d82 avoid public symbols of libpng
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1414
diff changeset
44 # The following declaration avoids "__declspec(dllexport)" in
237d83694d82 avoid public symbols of libpng
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1414
diff changeset
45 # libpng to prevent publicly exposing its symbols by the DLLs
237d83694d82 avoid public symbols of libpng
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1414
diff changeset
46 -DPNG_IMPEXP=
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
47 )
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
48
2113
0108ac01fc8e added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
49 source_group(ThirdParty\\libpng REGULAR_EXPRESSION ${LIBPNG_SOURCES_DIR}/.*)
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
50
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
51 else()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
52 include(FindPNG)
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
53
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
54 if (NOT ${PNG_FOUND})
1602
292bce3f54ed JpegWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1544
diff changeset
55 message(FATAL_ERROR "Unable to find libpng")
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
56 endif()
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
57
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
58 include_directories(${PNG_INCLUDE_DIRS})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
59 link_libraries(${PNG_LIBRARIES})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
60 add_definitions(${PNG_DEFINITIONS})
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 634
diff changeset
61 endif()