diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:47:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/FindPerl.cmake | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | CMake-77543bde41b0e52c3959016698b529835945d62d.zip CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2 |
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/FindPerl.cmake')
-rw-r--r-- | Modules/FindPerl.cmake | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index bedb839..4f45da6 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -18,31 +18,31 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -INCLUDE(FindCygwin) +include(FindCygwin) -SET(PERL_POSSIBLE_BIN_PATHS +set(PERL_POSSIBLE_BIN_PATHS ${CYGWIN_INSTALL_PATH}/bin ) -IF(WIN32) - GET_FILENAME_COMPONENT( +if(WIN32) + get_filename_component( ActivePerl_CurrentVersion "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl;CurrentVersion]" NAME) - SET(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} + set(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} "C:/Perl/bin" [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin ) -ENDIF(WIN32) +endif(WIN32) -FIND_PROGRAM(PERL_EXECUTABLE +find_program(PERL_EXECUTABLE NAMES perl PATHS ${PERL_POSSIBLE_BIN_PATHS} ) -IF(PERL_EXECUTABLE) +if(PERL_EXECUTABLE) ### PERL_VERSION - EXECUTE_PROCESS( + execute_process( COMMAND ${PERL_EXECUTABLE} -V:version OUTPUT_VARIABLE @@ -52,32 +52,32 @@ IF(PERL_EXECUTABLE) ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'") - STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) - ELSE() - EXECUTE_PROCESS( + if(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'") + string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + else() + execute_process( COMMAND ${PERL_EXECUTABLE} -v OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]") - STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) - ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +") - STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) - ENDIF() - ENDIF() -ENDIF(PERL_EXECUTABLE) + if(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]") + string(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + elseif(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +") + string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + endif() + endif() +endif(PERL_EXECUTABLE) # Deprecated settings for compatibility with CMake1.4 -SET(PERL ${PERL_EXECUTABLE}) +set(PERL ${PERL_EXECUTABLE}) # handle the QUIETLY and REQUIRED arguments and set PERL_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(Perl REQUIRED_VARS PERL_EXECUTABLE VERSION_VAR PERL_VERSION_STRING) -MARK_AS_ADVANCED(PERL_EXECUTABLE) +mark_as_advanced(PERL_EXECUTABLE) |