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/FindVTK.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/FindVTK.cmake')
-rw-r--r-- | Modules/FindVTK.cmake | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index fbdac7f..a6257f5 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -41,53 +41,53 @@ # License text for the above reference.) # Assume not found. -SET(VTK_FOUND 0) +set(VTK_FOUND 0) # VTK 4.0 did not provide VTKConfig.cmake. -IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1) - SET(_VTK_40_ALLOW 1) - IF(VTK_FIND_VERSION) - SET(_VTK_40_ONLY 1) - ENDIF() -ENDIF() +if("${VTK_FIND_VERSION}" VERSION_LESS 4.1) + set(_VTK_40_ALLOW 1) + if(VTK_FIND_VERSION) + set(_VTK_40_ONLY 1) + endif() +endif() # Construct consitent error messages for use below. -SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.") -IF(_VTK_40_ALLOW) - SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.") -ENDIF() -SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}") +set(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.") +if(_VTK_40_ALLOW) + set(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.") +endif() +set(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}") # Check whether VTK 4.0 has already been found. -IF(_VTK_40_ALLOW AND VTK_DIR) - IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) - SET(VTK_FOUND 1) - INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. - ENDIF() -ENDIF() +if(_VTK_40_ALLOW AND VTK_DIR) + if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + set(VTK_FOUND 1) + include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + endif() +endif() # Use the Config mode of the find_package() command to find VTKConfig. # If this succeeds (possibly because VTK_DIR is already set), the # command will have already loaded VTKConfig.cmake and set VTK_FOUND. -IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND) - FIND_PACKAGE(VTK QUIET NO_MODULE) -ENDIF() +if(NOT _VTK_40_ONLY AND NOT VTK_FOUND) + find_package(VTK QUIET NO_MODULE) +endif() # Special search for VTK 4.0. -IF(_VTK_40_ALLOW AND NOT VTK_DIR) +if(_VTK_40_ALLOW AND NOT VTK_DIR) # Old scripts may set these directories in the CMakeCache.txt file. # They can tell us where to find VTKConfig.cmake. - SET(VTK_DIR_SEARCH_LEGACY "") - IF(VTK_BINARY_PATH AND USE_BUILT_VTK) - SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH}) - ENDIF(VTK_BINARY_PATH AND USE_BUILT_VTK) - IF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) - SET(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} + set(VTK_DIR_SEARCH_LEGACY "") + if(VTK_BINARY_PATH AND USE_BUILT_VTK) + set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_BINARY_PATH}) + endif(VTK_BINARY_PATH AND USE_BUILT_VTK) + if(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + set(VTK_DIR_SEARCH_LEGACY ${VTK_DIR_SEARCH_LEGACY} ${VTK_INSTALL_PATH}/lib/vtk) - ENDIF(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) + endif(VTK_INSTALL_PATH AND USE_INSTALLED_VTK) # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk. - FIND_PATH(VTK_DIR + find_path(VTK_DIR NAMES UseVTK.cmake PATH_SUFFIXES vtk-4.0 vtk HINTS $ENV{VTK_DIR} @@ -114,28 +114,28 @@ IF(_VTK_40_ALLOW AND NOT VTK_DIR) DOC "The ${VTK_DIR_DESCRIPTION}" ) - IF(VTK_DIR) - IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) - SET(VTK_FOUND 1) - INCLUDE(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. - ELSE() + if(VTK_DIR) + if(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake) + set(VTK_FOUND 1) + include(UseVTKConfig40) # No VTKConfig; load VTK 4.0 settings. + else() # We found the wrong version. Pretend we did not find it. - SET(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE) - ENDIF() - ENDIF() -ENDIF() + set(VTK_DIR "VTK_DIR-NOTFOUND" CACHE PATH "The ${VTK_DIR_DESCRIPTION}" FORCE) + endif() + endif() +endif() #----------------------------------------------------------------------------- -IF(VTK_FOUND) +if(VTK_FOUND) # Set USE_VTK_FILE for backward-compatability. - SET(USE_VTK_FILE ${VTK_USE_FILE}) -ELSE(VTK_FOUND) + set(USE_VTK_FILE ${VTK_USE_FILE}) +else(VTK_FOUND) # VTK not found, explain to the user how to specify its location. - IF(VTK_FIND_REQUIRED) - MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) - ELSE(VTK_FIND_REQUIRED) - IF(NOT VTK_FIND_QUIETLY) - MESSAGE(STATUS ${VTK_DIR_MESSAGE}) - ENDIF(NOT VTK_FIND_QUIETLY) - ENDIF(VTK_FIND_REQUIRED) -ENDIF(VTK_FOUND) + if(VTK_FIND_REQUIRED) + message(FATAL_ERROR ${VTK_DIR_MESSAGE}) + else(VTK_FIND_REQUIRED) + if(NOT VTK_FIND_QUIETLY) + message(STATUS ${VTK_DIR_MESSAGE}) + endif(NOT VTK_FIND_QUIETLY) + endif(VTK_FIND_REQUIRED) +endif(VTK_FOUND) |