Skip to content

Commit 5699e35

Browse files
author
Christian Beier
committed
CMake: improve libjpeg-turbo fallback check
1 parent 122e6b3 commit 5699e35

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ if(WITH_JPEG)
107107

108108
if(NOT FOUND_LIBJPEG_TURBO)
109109
# last-resort grep check (when using LibVNCServer as a CMake subdir together with turbojpeg CMake subdir, the build check above fails since turbojpeg is not yet built when LibVNCServer is configured)
110-
if(JPEG_INCLUDE_DIR MATCHES "^\\.\\..*$") # is relative?
111-
set(JPEGLIB_H_PATH "${CMAKE_SOURCE_DIR}/${JPEG_INCLUDE_DIR}/jpeglib.h")
112-
else()
113-
set(JPEGLIB_H_PATH "${JPEG_INCLUDE_DIR}/jpeglib.h")
114-
endif()
110+
get_filename_component(JPEGLIB_H_PATH "${JPEG_INCLUDE_DIR}/jpeglib.h" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
111+
message(STATUS "Runtime check for libjpeg-turbo failed, inspecting ${JPEGLIB_H_PATH}")
115112
file(STRINGS ${JPEGLIB_H_PATH} FOUND_LIBJPEG_TURBO REGEX "JCS_EXT_RGB")
116113
if(NOT FOUND_LIBJPEG_TURBO)
117114
message(WARNING "*** The libjpeg library you are building against is not libjpeg-turbo. Performance will be reduced. You can obtain libjpeg-turbo from: https://sourceforge.net/projects/libjpeg-turbo/files/ ***")

0 commit comments

Comments
 (0)