cmake: use the jpeg module of cmake to find the library
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Wed, 1 Feb 2017 11:18:33 +0000 (12:18 +0100)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Wed, 1 Feb 2017 11:18:33 +0000 (12:18 +0100)
finding libjpeg can be a bit more complex, there are systems that are
not delivering a .pc for it. So we should just use the cmake module to
find it.

cmake/config/common.cmake
src/lib/emile/CMakeLists.txt

index d95d0ec..96b105c 100644 (file)
@@ -2,6 +2,7 @@ include(CheckSymbolExists)
 include(CheckIncludeFile)
 include(CheckTypeSize)
 include(FindPkgConfig)
+include(FindJPEG)
 include(CTest)
 find_package(Threads REQUIRED)
 
@@ -10,7 +11,9 @@ pkg_check_modules(LIBSYSTEMD libsystemd)
 pkg_check_modules(VALGRIND valgrind)
 pkg_check_modules(OPENSSL openssl>=1.0)
 pkg_check_modules(GNUTLS gnutls>=2.12.16)
-pkg_check_modules(LIBJPEG libjpeg REQUIRED)
+if (NOT JPEG_FOUND)
+  error("a jpeg library is needed.")
+endif()
 
 set(SUGGEST_VALGRIND OFF)
 if("${BUILD_PROFILE}" STREQUAL "dev")
index d6c3155..899013c 100644 (file)
@@ -2,7 +2,8 @@ set(DESCRIPTION "Library for simplified serialization, compression and ciphering
 
 set(PKG_CONFIG_REQUIRES_PRIVATE
   zlib>=1.2.3
-  libjpeg
+  #libjpeg is hard to find. there is a cmake module that does find it. and thats checked in common.cmake
+  #libjpeg
 )
 
 set(LIBRARIES