From 4ad6dacede10ce369c0e7bd0d4c8fe89d48cf4de Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 24 May 2014 21:34:01 -0700 Subject: FindFreetype: Add newlines to reduce code width This also makes argument lists easier to update. --- Modules/FindFreetype.cmake | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 1779b78..94f4f53 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -51,7 +51,9 @@ # wants explicit full paths and this trickery doesn't work too well. # I'm going to attempt to cut out the middleman and hope # everything still works. -find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h +find_path( + FREETYPE_INCLUDE_DIR_ft2build + ft2build.h HINTS ENV FREETYPE_DIR PATHS @@ -62,10 +64,14 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include freetype2 + PATH_SUFFIXES + include/freetype2 + include + freetype2 ) -find_path(FREETYPE_INCLUDE_DIR_freetype2 +find_path( + FREETYPE_INCLUDE_DIR_freetype2 NAMES freetype/config/ftheader.h config/ftheader.h @@ -79,11 +85,17 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2 ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include freetype2 + PATH_SUFFIXES + include/freetype2 + include + freetype2 ) find_library(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 + NAMES + freetype + libfreetype + freetype219 HINTS ENV FREETYPE_DIR PATH_SUFFIXES lib @@ -134,8 +146,17 @@ endif() # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype - REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS - VERSION_VAR FREETYPE_VERSION_STRING) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + Freetype + REQUIRED_VARS + FREETYPE_LIBRARY + FREETYPE_INCLUDE_DIRS + VERSION_VAR + FREETYPE_VERSION_STRING +) -mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) +mark_as_advanced( + FREETYPE_LIBRARY + FREETYPE_INCLUDE_DIR_freetype2 + FREETYPE_INCLUDE_DIR_ft2build +) -- cgit v0.12 From 836a28d5376cadd8da2febc8b0757283d7ecb182 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 24 May 2014 21:35:39 -0700 Subject: FindFreetype: Move PATH_SUFFIXES argument for more consistency --- Modules/FindFreetype.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 94f4f53..95ecaf9 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -98,7 +98,6 @@ find_library(FREETYPE_LIBRARY freetype219 HINTS ENV FREETYPE_DIR - PATH_SUFFIXES lib PATHS /usr/X11R6 /usr/local/X11R6 @@ -107,6 +106,8 @@ find_library(FREETYPE_LIBRARY ENV GTKMM_BASEPATH [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + PATH_SUFFIXES + lib ) # set the user variables -- cgit v0.12 From 444f88014624b369f356d27c228a4ad98656e7f4 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 24 May 2014 21:37:28 -0700 Subject: FindFreetype: Use lower-case name in call to FPHSA Use 'find_package_handle_standard_args' because lower-case style is now preferred. --- Modules/FindFreetype.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 95ecaf9..8e48b65 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -147,7 +147,8 @@ endif() # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( + +find_package_handle_standard_args( Freetype REQUIRED_VARS FREETYPE_LIBRARY -- cgit v0.12 From 58f7baab146cda9e11976d8362b8476d8ee5f264 Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 24 May 2014 21:38:43 -0700 Subject: FindFreetype: Indent with 2 spaces instead of 4 This is more consistent with style elsewhere. --- Modules/FindFreetype.cmake | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index 8e48b65..7d46d15 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -124,23 +124,23 @@ elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h") endif() if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H) - file(STRINGS "${FREETYPE_H}" freetype_version_str - REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + file(STRINGS "${FREETYPE_H}" freetype_version_str + REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") - unset(FREETYPE_VERSION_STRING) - foreach(VPART MAJOR MINOR PATCH) - foreach(VLINE ${freetype_version_str}) - if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$") - set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}") - if(FREETYPE_VERSION_STRING) - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") - else() - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") - endif() - unset(FREETYPE_VERSION_PART) - endif() - endforeach() + unset(FREETYPE_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${freetype_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$") + set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}") + if(FREETYPE_VERSION_STRING) + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") + else() + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") + endif() + unset(FREETYPE_VERSION_PART) + endif() endforeach() + endforeach() endif() -- cgit v0.12