2022-11-29 17:32:27 +08:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(PC_JPEG libjpeg)
|
|
|
|
|
|
|
|
find_path(JPEG_INCLUDE_DIRS
|
2023-03-16 15:58:34 +08:00
|
|
|
NAMES jpeglib.h
|
2022-11-29 17:32:27 +08:00
|
|
|
HINTS ${PC_JPEG_INCLUDEDIR}
|
|
|
|
${PC_JPEG_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(JPEG_LIBRARIES
|
|
|
|
NAMES jpeg
|
|
|
|
HINTS ${PC_JPEG_LIBDIR}
|
|
|
|
${PC_JPEG_LIBRARY_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(JPEG_INCLUDE_DIRS AND JPEG_LIBRARIES)
|
|
|
|
set(JPEG_FOUND TRUE)
|
|
|
|
set(JPEG_LIBRARY ${JPEG_LIBRARIES})
|
|
|
|
set(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIRS})
|
|
|
|
set(JPEG_VERSION ${PC_JPEG_VERSION})
|
|
|
|
endif()
|
|
|
|
|
2023-03-16 15:58:34 +08:00
|
|
|
#message("JPEG_LIBRARIES=${JPEG_LIBRARIES} JPEG_FOUND=${JPEG_FOUND}")
|
2022-11-29 17:32:27 +08:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(zlib REQUIRED_VARS JPEG_INCLUDE_DIRS JPEG_LIBRARIES
|
|
|
|
# FOUND_VAR JPEG_FOUND VERSION_VAR JPEG_VERSION)
|
|
|
|
|
|
|
|
mark_as_advanced(JPEG_LIBRARIES JPEG_LIBRARY JPEG_INCLUDE_DIRS JPEG_INCLUDE_DIR JPEG_FOUND)
|
|
|
|
|