Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/LibPngConfiguration.cmake @ 4658:66f6fd77deaf Orthanc-1.9.3
Orthanc-1.9.3
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 07 May 2021 09:22:38 +0200 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
5 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
6 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
7 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
8 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
12 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
14 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
15 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
16 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 |
735 | 21 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG) |
3285
3f7d4b735f95
upgrade to libpng 1.6.36
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
22 SET(LIBPNG_SOURCES_DIR ${CMAKE_BINARY_DIR}/libpng-1.6.36) |
3f7d4b735f95
upgrade to libpng 1.6.36
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
23 SET(LIBPNG_URL "http://orthanc.osimis.io/ThirdPartyDownloads/libpng-1.6.36.tar.gz") |
3f7d4b735f95
upgrade to libpng 1.6.36
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
24 SET(LIBPNG_MD5 "65afdeaa05f5ec14e31d9276143012e9") |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1472
diff
changeset
|
25 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1472
diff
changeset
|
26 DownloadPackage(${LIBPNG_MD5} ${LIBPNG_URL} "${LIBPNG_SOURCES_DIR}") |
735 | 27 |
28 include_directories( | |
29 ${LIBPNG_SOURCES_DIR} | |
30 ) | |
31 | |
32 configure_file( | |
33 ${LIBPNG_SOURCES_DIR}/scripts/pnglibconf.h.prebuilt | |
34 ${LIBPNG_SOURCES_DIR}/pnglibconf.h | |
1544 | 35 ) |
735 | 36 |
37 set(LIBPNG_SOURCES | |
38 #${LIBPNG_SOURCES_DIR}/example.c | |
39 ${LIBPNG_SOURCES_DIR}/png.c | |
40 ${LIBPNG_SOURCES_DIR}/pngerror.c | |
41 ${LIBPNG_SOURCES_DIR}/pngget.c | |
42 ${LIBPNG_SOURCES_DIR}/pngmem.c | |
43 ${LIBPNG_SOURCES_DIR}/pngpread.c | |
44 ${LIBPNG_SOURCES_DIR}/pngread.c | |
45 ${LIBPNG_SOURCES_DIR}/pngrio.c | |
46 ${LIBPNG_SOURCES_DIR}/pngrtran.c | |
47 ${LIBPNG_SOURCES_DIR}/pngrutil.c | |
48 ${LIBPNG_SOURCES_DIR}/pngset.c | |
49 #${LIBPNG_SOURCES_DIR}/pngtest.c | |
50 ${LIBPNG_SOURCES_DIR}/pngtrans.c | |
51 ${LIBPNG_SOURCES_DIR}/pngwio.c | |
52 ${LIBPNG_SOURCES_DIR}/pngwrite.c | |
53 ${LIBPNG_SOURCES_DIR}/pngwtran.c | |
54 ${LIBPNG_SOURCES_DIR}/pngwutil.c | |
55 ) | |
56 | |
57 add_definitions( | |
3285
3f7d4b735f95
upgrade to libpng 1.6.36
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
58 -DPNG_NO_CONFIG_H=1 |
735 | 59 -DPNG_NO_CONSOLE_IO=1 |
60 -DPNG_NO_STDIO=1 | |
1472
237d83694d82
avoid public symbols of libpng
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1414
diff
changeset
|
61 # The following declaration avoids "__declspec(dllexport)" in |
237d83694d82
avoid public symbols of libpng
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1414
diff
changeset
|
62 # 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
|
63 -DPNG_IMPEXP= |
735 | 64 ) |
65 | |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1602
diff
changeset
|
66 source_group(ThirdParty\\libpng REGULAR_EXPRESSION ${LIBPNG_SOURCES_DIR}/.*) |
735 | 67 |
68 else() | |
69 include(FindPNG) | |
70 | |
71 if (NOT ${PNG_FOUND}) | |
1602 | 72 message(FATAL_ERROR "Unable to find libpng") |
735 | 73 endif() |
74 | |
75 include_directories(${PNG_INCLUDE_DIRS}) | |
76 link_libraries(${PNG_LIBRARIES}) | |
77 add_definitions(${PNG_DEFINITIONS}) | |
78 endif() |