2 # Eventually replace with Jasper's actual config if using that
3 # Once found this file will define:
4 # Jasper_FOUND - System has Jasper
5 # Jasper_INCLUDE_DIRS - The Jasper include directories
6 # Jasper_LIBRARIES - The libraries needed to use Jasper
8 find_package( PkgConfig )
9 pkg_check_modules( PC_Jasper QUIET Jasper )
10 # set(CMAKE_FIND_DEBUG_MODE TRUE)
13 NAMES jasper/jasper.h # Make it so we go up one dir
15 HINTS ${Jasper_ROOT} ${JASPERINC} ${JASPER_PATH} ENV Jasper_ROOT ENV JASPERINC ENV JASPER_PATH
16 PATHS ${PC_Jasper_INCLUDE_DIRS}
17 PATH_SUFFIXES Jasper jasper include #include/jasper
23 HINTS ${Jasper_ROOT} ${JASPERLIB} ${JASPER_PATH} ENV Jasper_ROOT ENV JASPERLIB ENV JASPER_PATH
24 PATHS ${PC_Jasper_LIBRARY_DIRS}
28 # set(CMAKE_FIND_DEBUG_MODE FALSE)
30 include(FindPackageHandleStandardArgs)
31 find_package_handle_standard_args(
33 FOUND_VAR Jasper_FOUND
37 # VERSION_VAR Jasper_VERSION
40 if ( Jasper_FOUND AND NOT TARGET Jasper::Jasper )
41 add_library( Jasper::Jasper UNKNOWN IMPORTED )
42 set_target_properties(
45 IMPORTED_LOCATION "${Jasper_LIBRARY}"
46 INTERFACE_COMPILE_OPTIONS "${PC_Jasper_CFLAGS_OTHER}"
47 INTERFACE_INCLUDE_DIRECTORIES "${Jasper_INCLUDE_DIR}"
50 # Allow traditional/legacy style usage
51 set( Jasper_LIBRARIES ${Jasper_LIBRARY} )
52 set( Jasper_INCLUDE_DIRS ${Jasper_INCLUDE_DIR} )
53 set( Jasper_DEFINITIONS ${PC_Jasper_CFLAGS_OTHER} )