likscan: Prefer pkg-config for libsane detection

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 7 years ago
parent 15c0bc505a
commit f4d9c54240

@ -9,10 +9,13 @@
#
#################################################
if( NOT HAVE_SANE )
message( STATUS "checking for 'sane'..." )
if( NOT SANE_FOUND )
pkg_search_module( SANE sane-backends )
endif( )
if( NOT SANE_FOUND )
message( STATUS "checking for 'sane'..." )
# find sane-config
find_program( SANE_EXECUTABLE NAMES sane-config )
if( NOT SANE_EXECUTABLE )
@ -37,6 +40,8 @@ __run_sane_config( libs SANE_LIBRARIES )
# cleanup
if( SANE_INCLUDE_DIRS )
string( REGEX REPLACE "(^| )-I" ";" SANE_INCLUDE_DIRS "${SANE_INCLUDE_DIRS}" )
else( )
set( SANE_INCLUDE_DIRS "/usr/include" )
endif( )
if( SANE_LIBRARIES )
## remove all spaces and replace whitespace with ';'
@ -48,7 +53,10 @@ if( SANE_LIBRARIES )
## remove '-l'
string( REGEX REPLACE "-l" "" SANE_LIBRARIES "${SANE_LIBRARIES}" )
endif( )
if( NOT HAVE_SANE )
message( STATUS " found 'sane', version ${SANE_VERSION}" )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( SANE DEFAULT_MSG
SANE_LIBRARIES
SANE_INCLUDE_DIRS )
endif( )

Loading…
Cancel
Save