diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 13:47:32 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 14:19:16 -0400 |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/FindFreetype.cmake | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | cmake-77543bde41b0e52c3959016698b529835945d62d.tar.gz |
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Modules/FindFreetype.cmake')
-rw-r--r-- | Modules/FindFreetype.cmake | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake index e6f670256d..d89683371a 100644 --- a/Modules/FindFreetype.cmake +++ b/Modules/FindFreetype.cmake @@ -38,11 +38,11 @@ # Then from there, they need to set a bunch of #define's # so you can do something like: # #include FT_FREETYPE_H -# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES() +# Unfortunately, using CMake's mechanisms like include_directories() # 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 @@ -51,7 +51,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h /usr/freeware/include ) -FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h +find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h HINTS $ENV{FREETYPE_DIR}/include/freetype2 PATHS @@ -61,7 +61,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h PATH_SUFFIXES freetype2 ) -FIND_LIBRARY(FREETYPE_LIBRARY +find_library(FREETYPE_LIBRARY NAMES freetype libfreetype freetype219 HINTS $ENV{FREETYPE_DIR} @@ -73,38 +73,38 @@ FIND_LIBRARY(FREETYPE_LIBRARY ) # set the user variables -IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) - SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") -ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) -SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") +if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) + set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") +endif(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) +set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") -IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") - FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str +if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/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}") - STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" + unset(FREETYPE_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${freetype_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}") + string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" FREETYPE_VERSION_PART "${VLINE}") - IF(FREETYPE_VERSION_STRING) - SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") - ELSE(FREETYPE_VERSION_STRING) - SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") - ENDIF(FREETYPE_VERSION_STRING) - UNSET(FREETYPE_VERSION_PART) - ENDIF() - ENDFOREACH(VLINE) - ENDFOREACH(VPART) -ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + if(FREETYPE_VERSION_STRING) + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") + else(FREETYPE_VERSION_STRING) + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") + endif(FREETYPE_VERSION_STRING) + unset(FREETYPE_VERSION_PART) + endif() + endforeach(VLINE) + endforeach(VPART) +endif(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") # 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) +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) -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) |