likscan: Prefer pkg-config for libsane detection

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

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

Loading…
Cancel
Save