annotate Framework/Orthanc/Resources/CMake/LibPngConfiguration.cmake @ 12:9220cf4a63d5

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 14:14:34 +0100
parents 2dbe613f6c93
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG)
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 SET(LIBPNG_SOURCES_DIR ${CMAKE_BINARY_DIR}/libpng-1.5.12)
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 SET(LIBPNG_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/libpng-1.5.12.tar.gz")
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 SET(LIBPNG_MD5 "8ea7f60347a306c5faf70b977fa80e28")
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 DownloadPackage(${LIBPNG_MD5} ${LIBPNG_URL} "${LIBPNG_SOURCES_DIR}")
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 include_directories(
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 ${LIBPNG_SOURCES_DIR}
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 )
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 configure_file(
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 ${LIBPNG_SOURCES_DIR}/scripts/pnglibconf.h.prebuilt
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 ${LIBPNG_SOURCES_DIR}/pnglibconf.h
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 )
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 set(LIBPNG_SOURCES
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 #${LIBPNG_SOURCES_DIR}/example.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 ${LIBPNG_SOURCES_DIR}/png.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 ${LIBPNG_SOURCES_DIR}/pngerror.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 ${LIBPNG_SOURCES_DIR}/pngget.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ${LIBPNG_SOURCES_DIR}/pngmem.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 ${LIBPNG_SOURCES_DIR}/pngpread.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 ${LIBPNG_SOURCES_DIR}/pngread.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 ${LIBPNG_SOURCES_DIR}/pngrio.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 ${LIBPNG_SOURCES_DIR}/pngrtran.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 ${LIBPNG_SOURCES_DIR}/pngrutil.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 ${LIBPNG_SOURCES_DIR}/pngset.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #${LIBPNG_SOURCES_DIR}/pngtest.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 ${LIBPNG_SOURCES_DIR}/pngtrans.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 ${LIBPNG_SOURCES_DIR}/pngwio.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 ${LIBPNG_SOURCES_DIR}/pngwrite.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 ${LIBPNG_SOURCES_DIR}/pngwtran.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ${LIBPNG_SOURCES_DIR}/pngwutil.c
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 )
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #set_property(
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 # SOURCE ${LIBPNG_SOURCES}
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 # PROPERTY COMPILE_FLAGS -UHAVE_CONFIG_H)
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 add_definitions(
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 -DPNG_NO_CONSOLE_IO=1
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 -DPNG_NO_STDIO=1
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 # The following declaration avoids "__declspec(dllexport)" in
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 # libpng to prevent publicly exposing its symbols by the DLLs
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 -DPNG_IMPEXP=
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 )
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
12
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
49 source_group(ThirdParty\\libpng REGULAR_EXPRESSION ${LIBPNG_SOURCES_DIR}/.*)
1
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 else()
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 include(FindPNG)
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 if (NOT ${PNG_FOUND})
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 message(FATAL_ERROR "Unable to find libpng")
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 endif()
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 include_directories(${PNG_INCLUDE_DIRS})
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 link_libraries(${PNG_LIBRARIES})
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 add_definitions(${PNG_DEFINITIONS})
2dbe613f6c93 add orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 endif()