aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2017-03-20 11:31:18 +0100
committerGitHub <noreply@github.com>2017-03-20 11:31:18 +0100
commitfa95ea4e943c1e17097865c5d43dd04671529588 (patch)
tree80cae0b568ab6a0d15dd2def07b291a471636175
parentfb85fb52a8e1819fcede8d141a2e324293322c59 (diff)
parent59f008c0684f2d539459967c385dbee1e2cc8369 (diff)
Merge pull request #11846 from hudokkow/krypton_cmake_find_lcms2
[cmake][PR11072 backport] Add support for LCMS2
-rw-r--r--.travis.yml2
-rw-r--r--project/cmake/CMakeLists.txt2
-rw-r--r--project/cmake/modules/FindLCMS2.cmake48
3 files changed, 50 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 21b6c3e537..e5097f85af 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -71,7 +71,7 @@ install:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
sudo apt-get install -qq automake autopoint build-essential cmake curl default-jre gawk gdb gdc
gettext git-core gperf libasound2-dev libass-dev libbz2-dev libcap-dev libcdio-dev libcec4-dev libcrossguid-dev libcurl3
- libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev
+ libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev liblcms2-dev libgif-dev
libiso9660-dev libjpeg-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev
libpcre3-dev libplist-dev libpng-dev libpulse-dev libsdl2-dev libsmbclient-dev libsqlite3-dev libssh-dev
libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev
diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt
index cebc751de6..aeb1ff47c2 100644
--- a/project/cmake/CMakeLists.txt
+++ b/project/cmake/CMakeLists.txt
@@ -115,7 +115,7 @@ if(CORE_SYSTEM_NAME STREQUAL android)
endif()
# Optional dependencies
-set(optional_deps MicroHttpd MySqlClient SSH XSLT
+set(optional_deps LCMS2 MicroHttpd MySqlClient SSH XSLT
Alsa UDEV DBus Avahi SmbClient CCache
PulseAudio VDPAU VAAPI Bluetooth CAP)
diff --git a/project/cmake/modules/FindLCMS2.cmake b/project/cmake/modules/FindLCMS2.cmake
new file mode 100644
index 0000000000..5ec7a77ba3
--- /dev/null
+++ b/project/cmake/modules/FindLCMS2.cmake
@@ -0,0 +1,48 @@
+#.rst:
+# FindLCMS2
+# -----------
+# Finds the LCMS Color Management library
+#
+# This will will define the following variables::
+#
+# LCMS2_FOUND - system has LCMS Color Management
+# LCMS2_INCLUDE_DIRS - the LCMS Color Management include directory
+# LCMS2_LIBRARIES - the LCMS Color Management libraries
+# LCMS2_DEFINITIONS - the LCMS Color Management definitions
+#
+# and the following imported targets::
+#
+# LCMS2::LCMS2 - The LCMS Color Management library
+
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_LCMS2 lcms2 QUIET)
+endif()
+
+find_path(LCMS2_INCLUDE_DIR NAMES lcms2.h
+ PATHS ${PC_LCMS2_INCLUDEDIR})
+find_library(LCMS2_LIBRARY NAMES lcms2 liblcms2
+ PATHS ${PC_LCMS2_LIBDIR})
+
+set(LCMS2_VERSION ${PC_LCMS2_VERSION})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LCMS2
+ REQUIRED_VARS LCMS2_LIBRARY LCMS2_INCLUDE_DIR
+ VERSION_VAR LCMS2_VERSION)
+
+if(LCMS2_FOUND)
+ set(LCMS2_LIBRARIES ${LCMS2_LIBRARY})
+ set(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
+ set(LCMS2_DEFINITIONS -DHAVE_LCMS2=1)
+
+ if(NOT TARGET LCMS2::LCMS2)
+ add_library(LCMS2::LCMS2 UNKNOWN IMPORTED)
+ set_target_properties(LCMS2::LCMS2 PROPERTIES
+ IMPORTED_LOCATION "${LCMS2_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}"
+ INTERFACE_COMPILE_DEFINITIONS HAVE_LCMS2=1)
+ endif()
+endif()
+
+mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
+