1 From 38f50c7d9ad3ba06b64583045665203afb53cbd9 Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Sun, 6 Nov 2016 16:29:08 +0100
4 Subject: [PATCH] thirdparty: tiff: append flags found by pkg-config if
7 This change allows to get all required CFLAGS/LDFLAGS in case of static only
10 This build issue [1] was triggered by the Buildroot farms.
12 [1] http://autobuild.buildroot.net/results/d0d/d0d22727311d6300e0e400728126170407bfd699/build-end.log
14 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
16 thirdparty/CMakeLists.txt | 23 +++++++++++++++++++++--
17 1 file changed, 21 insertions(+), 2 deletions(-)
19 diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
20 index cb24b43b58e2..cd6a5e1391b0 100644
21 --- a/thirdparty/CMakeLists.txt
22 +++ b/thirdparty/CMakeLists.txt
26 +if(NOT BUILD_THIRDPARTY)
27 + include(FindPkgConfig)
28 +endif(NOT BUILD_THIRDPARTY)
33 @@ -36,6 +40,9 @@ if(BUILD_THIRDPARTY)
34 else(BUILD_THIRDPARTY)
37 + # Static only build:
38 + # it is not necessary to invoke pkg_check_module on libpng, because libpng
39 + # only depends on zlib, which is already checked.
41 message(STATUS "Your system seems to have a PNG lib available, we will use it")
42 set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
43 @@ -66,12 +73,24 @@ if(BUILD_THIRDPARTY)
44 set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
45 else(BUILD_THIRDPARTY)
47 + # Static only build:
48 + # it is necessary to invoke pkg_check_module on libtiff since it may have
49 + # several other dependencies not declared by its cmake module, but they are
50 + # in the its pkgconfig module.
51 + if(PKG_CONFIG_FOUND)
52 + foreach(pc_tiff_module tiff tiff3 tiff4 tiff-3 tiff-4 libtiff libtiff3 libtiff4 libtiff-3 libtiff-4)
53 + pkg_check_modules(PC_TIFF QUIET ${pc_tiff_module})
56 + endif(PC_TIFF_FOUND)
58 + endif(PKG_CONFIG_FOUND)
60 message(STATUS "Your system seems to have a TIFF lib available, we will use it")
61 set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
62 set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
63 - set(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
64 - set(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
65 + set(TIFF_LIBNAME ${TIFF_LIBRARIES} ${PC_TIFF_STATIC_LIBRARIES} PARENT_SCOPE)
66 + set(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} ${PC_TIFF_STATIC_INCLUDE_DIRS} PARENT_SCOPE)
67 else(TIFF_FOUND) # not found
68 set(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
69 set(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)