Fix libjpeg-turbo linking on systems that only have shared libjpeg installed
This commit is contained in:
9
3rdParty/libjpeg-turbo/CMakeLists.txt
vendored
9
3rdParty/libjpeg-turbo/CMakeLists.txt
vendored
@@ -26,5 +26,14 @@ function(LinkLibJpegTurbo TARGET)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/deps_ljt/INSTALL/lib/cmake)
|
||||
endif()
|
||||
find_package(libjpeg-turbo REQUIRED)
|
||||
message("${libjpeg-turbo_LIBRARIES}")
|
||||
if (TARGET libjpeg-turbo::turbojpeg-static)
|
||||
target_link_libraries(${TARGET} PUBLIC libjpeg-turbo::turbojpeg-static)
|
||||
message("Linking static libjpeg-turbo")
|
||||
elseif (TARGET libjpeg-turbo::turbojpeg)
|
||||
target_link_libraries(${TARGET} PUBLIC libjpeg-turbo::turbojpeg)
|
||||
message("Linking shared libjpeg-turbo")
|
||||
else ()
|
||||
message(FATAL_ERROR "Neither static nor shared libjpeg-turbo exists")
|
||||
endif ()
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user