summaryrefslogtreecommitdiffstats
path: root/Modules/FindFLTK2.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-04-06 19:30:00 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2014-04-14 16:16:58 (GMT)
commit2622bc3f65162bf6d6cb5838da6999f8b5ca75cf (patch)
treed90da340e1dd6e104f8b6c7344f6b38e4d1f03c8 /Modules/FindFLTK2.cmake
parent11a6b3d59ad2f75890fcdc42ec13c7a9ee1463f0 (diff)
downloadCMake-2622bc3f65162bf6d6cb5838da6999f8b5ca75cf.zip
CMake-2622bc3f65162bf6d6cb5838da6999f8b5ca75cf.tar.gz
CMake-2622bc3f65162bf6d6cb5838da6999f8b5ca75cf.tar.bz2
Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very similar regular expressions.
Diffstat (limited to 'Modules/FindFLTK2.cmake')
-rw-r--r--Modules/FindFLTK2.cmake4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 4deffda..930acca 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -226,9 +226,7 @@ if(FLTK2_DIR)
OUTPUT_VARIABLE FLTK2_IMAGES_LDFLAGS)
set(FLTK2_LIBS_EXTRACT_REGEX ".*-lfltk2_images (.*) -lfltk2.*")
if("${FLTK2_IMAGES_LDFLAGS}" MATCHES "${FLTK2_LIBS_EXTRACT_REGEX}")
- string(REGEX REPLACE "${FLTK2_LIBS_EXTRACT_REGEX}" "\\1"
- FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LDFLAGS}")
- string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}")
+ string(REGEX REPLACE " +" ";" FLTK2_IMAGES_LIBS "${CMAKE_MATCH_1}")
# The EXEC_PROGRAM will not be inherited into subdirectories from
# the file that originally included this module. Save the answer.
set(FLTK2_IMAGES_LIBS "${FLTK2_IMAGES_LIBS}" CACHE INTERNAL