diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2012-04-15 21:07:18 -0500 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-03 19:30:06 +0200 |
commit | ea5f96c3ff10b424e74bddc821717c36ebcbdeb9 (patch) | |
tree | 4bd7d5a33999a6ff447dd6759e61abe6f52e613f /libkscan/ConfigureChecks.cmake | |
parent | e842e1de9df9b2d1ec2bea9c6a12f6371cd82ffa (diff) | |
download | tdegraphics-ea5f96c3ff10b424e74bddc821717c36ebcbdeb9.tar.gz tdegraphics-ea5f96c3ff10b424e74bddc821717c36ebcbdeb9.zip |
Fix libkscan/cmake build failure caused by cmake policy CMP0004.
This resolves bug report 901.
Thanks to David C. Rankin.
(cherry picked from commit cd3c62a5cfa6fbcbd150e86deb14eed15f4d1e02)
Diffstat (limited to 'libkscan/ConfigureChecks.cmake')
-rw-r--r-- | libkscan/ConfigureChecks.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libkscan/ConfigureChecks.cmake b/libkscan/ConfigureChecks.cmake index 203bf375..a26c495d 100644 --- a/libkscan/ConfigureChecks.cmake +++ b/libkscan/ConfigureChecks.cmake @@ -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 ) |