comparison OrthancFramework/Resources/CMake/LibPngConfiguration.cmake @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Resources/CMake/LibPngConfiguration.cmake@3f7d4b735f95
children 304842a0d152
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
1 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBPNG)
2 SET(LIBPNG_SOURCES_DIR ${CMAKE_BINARY_DIR}/libpng-1.6.36)
3 SET(LIBPNG_URL "http://orthanc.osimis.io/ThirdPartyDownloads/libpng-1.6.36.tar.gz")
4 SET(LIBPNG_MD5 "65afdeaa05f5ec14e31d9276143012e9")
5
6 DownloadPackage(${LIBPNG_MD5} ${LIBPNG_URL} "${LIBPNG_SOURCES_DIR}")
7
8 include_directories(
9 ${LIBPNG_SOURCES_DIR}
10 )
11
12 configure_file(
13 ${LIBPNG_SOURCES_DIR}/scripts/pnglibconf.h.prebuilt
14 ${LIBPNG_SOURCES_DIR}/pnglibconf.h
15 )
16
17 set(LIBPNG_SOURCES
18 #${LIBPNG_SOURCES_DIR}/example.c
19 ${LIBPNG_SOURCES_DIR}/png.c
20 ${LIBPNG_SOURCES_DIR}/pngerror.c
21 ${LIBPNG_SOURCES_DIR}/pngget.c
22 ${LIBPNG_SOURCES_DIR}/pngmem.c
23 ${LIBPNG_SOURCES_DIR}/pngpread.c
24 ${LIBPNG_SOURCES_DIR}/pngread.c
25 ${LIBPNG_SOURCES_DIR}/pngrio.c
26 ${LIBPNG_SOURCES_DIR}/pngrtran.c
27 ${LIBPNG_SOURCES_DIR}/pngrutil.c
28 ${LIBPNG_SOURCES_DIR}/pngset.c
29 #${LIBPNG_SOURCES_DIR}/pngtest.c
30 ${LIBPNG_SOURCES_DIR}/pngtrans.c
31 ${LIBPNG_SOURCES_DIR}/pngwio.c
32 ${LIBPNG_SOURCES_DIR}/pngwrite.c
33 ${LIBPNG_SOURCES_DIR}/pngwtran.c
34 ${LIBPNG_SOURCES_DIR}/pngwutil.c
35 )
36
37 add_definitions(
38 -DPNG_NO_CONFIG_H=1
39 -DPNG_NO_CONSOLE_IO=1
40 -DPNG_NO_STDIO=1
41 # The following declaration avoids "__declspec(dllexport)" in
42 # libpng to prevent publicly exposing its symbols by the DLLs
43 -DPNG_IMPEXP=
44 )
45
46 source_group(ThirdParty\\libpng REGULAR_EXPRESSION ${LIBPNG_SOURCES_DIR}/.*)
47
48 else()
49 include(FindPNG)
50
51 if (NOT ${PNG_FOUND})
52 message(FATAL_ERROR "Unable to find libpng")
53 endif()
54
55 include_directories(${PNG_INCLUDE_DIRS})
56 link_libraries(${PNG_LIBRARIES})
57 add_definitions(${PNG_DEFINITIONS})
58 endif()