mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-10-15 20:52:04 -04:00
Current cmake module assumes the headers are installed in $(INCLUDEDIR)/jxrlib, which is only true if using a custom CMakeLists (as provided by eg. Fedora) Fix detection of jxrlib compiled with the upstream Makefile by checking the pc file first, and fallback to manual detection as before.
32 lines
928 B
CMake
32 lines
928 B
CMake
# - Find LibJXR
|
|
# Find the JXR library
|
|
# This module defines
|
|
# LIBJXR_INCLUDE_DIRS, where to find jxrlib/JXRGlue.h
|
|
# LIBJXR_LIBRARIES, the libraries needed to use JXR
|
|
#
|
|
# Based on cmake code found at https://github.com/microsoft/vcpkg/blob/master/ports/jxrlib/FindJXR.cmake
|
|
|
|
find_package(PkgConfig QUIET)
|
|
if(PKG_CONFIG_FOUND)
|
|
pkg_check_modules(LIBJXR QUIET libjxr)
|
|
endif()
|
|
|
|
if(NOT LIBJXR_FOUND)
|
|
find_path(LIBJXR_INCLUDE_DIRS
|
|
NAMES JXRGlue.h
|
|
PATH_SUFFIXES jxrlib
|
|
)
|
|
mark_as_advanced(LIBJXR_INCLUDE_DIRS)
|
|
|
|
include(SelectLibraryConfigurations)
|
|
|
|
find_library(LIBJPEGXR_LIBRARY NAMES jpegxr)
|
|
find_library(LIBJXRGLUE_LIBRARY NAMES jxrglue)
|
|
|
|
set(LIBJXR_LIBRARIES ${LIBJPEGXR_LIBRARY} ${LIBJXRGLUE_LIBRARY})
|
|
mark_as_advanced(LIBJXR_LIBRARIES)
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibJXR DEFAULT_MSG LIBJXR_INCLUDE_DIRS LIBJXR_LIBRARIES)
|