Fix libkscan/cmake build failure caused by cmake policy CMP0004.

This resolves bug report 901.
Thanks to David C. Rankin.
pull/1/head
Darrell Anderson 13 years ago
parent 7a88718f7b
commit cd3c62a5cf

@ -39,8 +39,14 @@ if( SANE_INCLUDE_DIRS )
string( REGEX REPLACE "(^| )-I" ";" SANE_INCLUDE_DIRS "${SANE_INCLUDE_DIRS}" )
endif( )
if( SANE_LIBRARIES )
string( REGEX REPLACE "(^| )-l" ";" SANE_LIBRARIES "${SANE_LIBRARIES}" )
string( REPLACE " " "" SANE_LIBRARIES "${SANE_LIBRARIES}" )
## remove all spaces and replace whitespace with ';'
string( REGEX REPLACE "[ ]+" ";" SANE_LIBRARIES "${SANE_LIBRARIES}" )
## remove all non-library information
string( REGEX REPLACE ";[-][^l]([^ ;])+" "" SANE_LIBRARIES "${SANE_LIBRARIES}" )
## remove multiple ';'
string( REGEX REPLACE "[;]+" ";" SANE_LIBRARIES "${SANE_LIBRARIES}" )
## remove '-l'
string( REGEX REPLACE "-l" "" SANE_LIBRARIES "${SANE_LIBRARIES}" )
endif( )
if( NOT HAVE_SANE )

Loading…
Cancel
Save