diff options
Diffstat (limited to 'cmake/modules/FindLCMS2.cmake')
| -rw-r--r-- | cmake/modules/FindLCMS2.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cmake/modules/FindLCMS2.cmake b/cmake/modules/FindLCMS2.cmake new file mode 100644 index 0000000..5ec7a77 --- /dev/null +++ b/cmake/modules/FindLCMS2.cmake | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindLCMS2 | ||
| 3 | # ----------- | ||
| 4 | # Finds the LCMS Color Management library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # LCMS2_FOUND - system has LCMS Color Management | ||
| 9 | # LCMS2_INCLUDE_DIRS - the LCMS Color Management include directory | ||
| 10 | # LCMS2_LIBRARIES - the LCMS Color Management libraries | ||
| 11 | # LCMS2_DEFINITIONS - the LCMS Color Management definitions | ||
| 12 | # | ||
| 13 | # and the following imported targets:: | ||
| 14 | # | ||
| 15 | # LCMS2::LCMS2 - The LCMS Color Management library | ||
| 16 | |||
| 17 | if(PKG_CONFIG_FOUND) | ||
| 18 | pkg_check_modules(PC_LCMS2 lcms2 QUIET) | ||
| 19 | endif() | ||
| 20 | |||
| 21 | find_path(LCMS2_INCLUDE_DIR NAMES lcms2.h | ||
| 22 | PATHS ${PC_LCMS2_INCLUDEDIR}) | ||
| 23 | find_library(LCMS2_LIBRARY NAMES lcms2 liblcms2 | ||
| 24 | PATHS ${PC_LCMS2_LIBDIR}) | ||
| 25 | |||
| 26 | set(LCMS2_VERSION ${PC_LCMS2_VERSION}) | ||
| 27 | |||
| 28 | include(FindPackageHandleStandardArgs) | ||
| 29 | find_package_handle_standard_args(LCMS2 | ||
| 30 | REQUIRED_VARS LCMS2_LIBRARY LCMS2_INCLUDE_DIR | ||
| 31 | VERSION_VAR LCMS2_VERSION) | ||
| 32 | |||
| 33 | if(LCMS2_FOUND) | ||
| 34 | set(LCMS2_LIBRARIES ${LCMS2_LIBRARY}) | ||
| 35 | set(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) | ||
| 36 | set(LCMS2_DEFINITIONS -DHAVE_LCMS2=1) | ||
| 37 | |||
| 38 | if(NOT TARGET LCMS2::LCMS2) | ||
| 39 | add_library(LCMS2::LCMS2 UNKNOWN IMPORTED) | ||
| 40 | set_target_properties(LCMS2::LCMS2 PROPERTIES | ||
| 41 | IMPORTED_LOCATION "${LCMS2_LIBRARY}" | ||
| 42 | INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}" | ||
| 43 | INTERFACE_COMPILE_DEFINITIONS HAVE_LCMS2=1) | ||
| 44 | endif() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) | ||
| 48 | |||
