2020-03-27 23:13:58 +01:00
|
|
|
# FindTurboJPEG.cmake
|
|
|
|
# TURBOJPEG_FOUND
|
|
|
|
# TurboJPEG_INCLUDE_DIRS
|
|
|
|
# TurboJPEG_LIBRARY
|
|
|
|
|
2020-12-18 17:38:21 +01:00
|
|
|
if (ENABLE_MF)
|
|
|
|
find_path(TurboJPEG_INCLUDE_DIRS
|
|
|
|
NAMES turbojpeg.h
|
|
|
|
PATHS
|
|
|
|
"C:/libjpeg-turbo64"
|
|
|
|
PATH_SUFFIXES include
|
|
|
|
)
|
2020-03-27 23:13:58 +01:00
|
|
|
|
2020-12-18 17:38:21 +01:00
|
|
|
find_library(TurboJPEG_LIBRARY
|
|
|
|
NAMES turbojpeg turbojpeg-static
|
|
|
|
PATHS
|
|
|
|
"C:/libjpeg-turbo64"
|
|
|
|
PATH_SUFFIXES bin lib
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
find_path(TurboJPEG_INCLUDE_DIRS
|
|
|
|
NAMES turbojpeg.h
|
|
|
|
PATH_SUFFIXES include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(TurboJPEG_LIBRARY
|
|
|
|
NAMES turbojpeg turbojpeg-static
|
|
|
|
PATH_SUFFIXES bin lib
|
|
|
|
)
|
|
|
|
endif()
|
2020-03-27 23:13:58 +01:00
|
|
|
|
|
|
|
if(TurboJPEG_INCLUDE_DIRS AND TurboJPEG_LIBRARY)
|
|
|
|
include(CheckCSourceCompiles)
|
|
|
|
include(CMakePushCheckState)
|
|
|
|
|
|
|
|
cmake_push_check_state(RESET)
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${TurboJPEG_INCLUDE_DIRS})
|
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES ${TurboJPEG_LIBRARY})
|
|
|
|
|
|
|
|
check_c_source_compiles("#include <turbojpeg.h>\nint main(void) { tjhandle h=tjInitCompress(); return 0; }" TURBOJPEG_WORKS)
|
|
|
|
cmake_pop_check_state()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-12-18 17:38:21 +01:00
|
|
|
find_package_handle_standard_args(TurboJPEG
|
2020-03-27 23:13:58 +01:00
|
|
|
FOUND_VAR TURBOJPEG_FOUND
|
|
|
|
REQUIRED_VARS TurboJPEG_LIBRARY TurboJPEG_INCLUDE_DIRS TURBOJPEG_WORKS
|
|
|
|
TurboJPEG_INCLUDE_DIRS TurboJPEG_LIBRARY
|
|
|
|
)
|