FindLibRaw: fix include dir, should not contain prefix libraw/

See also the examples at https://www.libraw.org/docs/API-CXX.html

BUG: 460105
This commit is contained in:
Friedrich W. H. Kossebau 2022-10-08 01:59:18 +02:00
parent 54129819d5
commit 20f74ce5e6
2 changed files with 4 additions and 9 deletions

View File

@ -2,7 +2,7 @@
# Find the LibRaw library <https://www.libraw.org>
# This module defines
# LibRaw_VERSION, the version string of LibRaw
# LibRaw_INCLUDE_DIR, where to find libraw.h
# LibRaw_INCLUDE_DIR, where to find libraw/libraw.h
# LibRaw_LIBRARIES, the libraries needed to use LibRaw (non-thread-safe)
# LibRaw_r_LIBRARIES, the libraries needed to use LibRaw (thread-safe)
# LibRaw_DEFINITIONS, the definitions needed to use LibRaw (non-thread-safe)
@ -23,11 +23,10 @@ IF(PKG_CONFIG_FOUND)
SET(LibRaw_r_DEFINITIONS ${PC_LIBRAW_R_CFLAGS_OTHER})
ENDIF()
FIND_PATH(LibRaw_INCLUDE_DIR libraw.h
FIND_PATH(LibRaw_INCLUDE_DIR libraw/libraw.h
HINTS
${PC_LIBRAW_INCLUDEDIR}
${PC_LibRaw_INCLUDE_DIRS}
PATH_SUFFIXES libraw
)
FIND_LIBRARY(LibRaw_LIBRARIES NAMES raw
@ -43,7 +42,7 @@ FIND_LIBRARY(LibRaw_r_LIBRARIES NAMES raw_r
)
IF(LibRaw_INCLUDE_DIR)
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw_version.h _libraw_version_content)
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw/libraw_version.h _libraw_version_content)
STRING(REGEX MATCH "#define LIBRAW_MAJOR_VERSION[ \t]*([0-9]*)\n" _version_major_match ${_libraw_version_content})
SET(_libraw_version_major "${CMAKE_MATCH_1}")
@ -58,7 +57,7 @@ IF(LibRaw_INCLUDE_DIR)
SET(LibRaw_VERSION "${_libraw_version_major}.${_libraw_version_minor}.${_libraw_version_patch}")
ELSE()
IF(NOT LibRaw_FIND_QUIETLY)
MESSAGE(STATUS "Failed to get version information from ${LibRaw_INCLUDE_DIR}/libraw_version.h")
MESSAGE(STATUS "Failed to get version information from ${LibRaw_INCLUDE_DIR}/libraw/libraw_version.h")
ENDIF()
ENDIF()
ENDIF()

View File

@ -19,11 +19,7 @@
#define NOMINMAX
#endif
#if defined(Q_OS_WINDOWS)
#include <libraw.h>
#else
#include <libraw/libraw.h>
#endif
#ifdef QT_DEBUG
// This should be used to exclude the local QIODevice wrapper of the LibRaw_abstract_datastream interface.