On Wed, Feb 1, 2017 at 9:20 AM, Marcel Hollerbach <marcel-hollerb...@t-online.de> wrote: > > bu5hm4n pushed a commit to branch master. > > http://git.enlightenment.org/core/efl.git/commit/?id=8dc1166eaa15c3e288e1126e281d318ab96c4c89 > > commit 8dc1166eaa15c3e288e1126e281d318ab96c4c89 > Author: Marcel Hollerbach <marcel-hollerb...@t-online.de> > Date: Wed Feb 1 12:18:33 2017 +0100 > > cmake: use the jpeg module of cmake to find the library > > 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 | 5 ++++- > src/lib/emile/CMakeLists.txt | 3 ++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/cmake/config/common.cmake b/cmake/config/common.cmake > index d95d0ec..96b105c 100644 > --- a/cmake/config/common.cmake > +++ b/cmake/config/common.cmake > @@ -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()
I believe you can use some 'REQUIRED' keyword in FindXXX macros, no? > set(SUGGEST_VALGRIND OFF) > if("${BUILD_PROFILE}" STREQUAL "dev") > diff --git a/src/lib/emile/CMakeLists.txt b/src/lib/emile/CMakeLists.txt > index d6c3155..899013c 100644 > --- a/src/lib/emile/CMakeLists.txt > +++ b/src/lib/emile/CMakeLists.txt > @@ -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 well, I avoided using FindJPEG because of extra complexities... but if people will need that, then we need here to set(LIBRARIES ${JPEG_LIBRARIES}) and also ${JPEG_INCLUDE_DIRS} in SYSTEM_INCLUDE_DIRS... As this will happen possibly many times (lots of FindXXXX.cmake), we may consider just using some extra processing in LIBRARIES, like set(_libs "") foreach(l in ${LIBRARIES}) if(DEFINED ${l}_FOUND AND ${l}_FOUND AND ${l}_LIBRARIES) list(APPEND _libs ${${l}_LIBRARIES}) list(APPEND _sys_inc_dirs ${${l}_INCLUDE_DIR}) else() list(APPEND _libs ${l}) endif() endif() Then we'd use: set(LIBRARIES eina m support-rg_etc JPEG) then it would filter out JPEG, replacing it with JPEG_LIBRARIES and JPEG_INCLUDE_DIR whether appropriate. -- Gustavo Sverzut Barbieri -------------------------------------- Mobile: +55 (16) 99354-9890 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel