summaryrefslogtreecommitdiffstats
path: root/Tests/TarTest
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:47:32 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit77543bde41b0e52c3959016698b529835945d62d (patch)
treeff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Tests/TarTest
parent7bbaa4283de26864b2e55e819db0884771585467 (diff)
downloadCMake-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 'Tests/TarTest')
-rw-r--r--Tests/TarTest/CMakeLists.txt74
1 files changed, 37 insertions, 37 deletions
diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt
index a3c5b31..b1f1c6d 100644
--- a/Tests/TarTest/CMakeLists.txt
+++ b/Tests/TarTest/CMakeLists.txt
@@ -1,20 +1,20 @@
cmake_minimum_required (VERSION 2.6)
-PROJECT(TarTest)
+project(TarTest)
# this is macro that we will be running
-MACRO(EXEC_TAR_COMMAND DIR ARGS)
- EXEC_PROGRAM("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET)
- IF(${RET})
- MESSAGE(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"")
- ENDIF(${RET})
-ENDMACRO(EXEC_TAR_COMMAND)
+macro(EXEC_TAR_COMMAND DIR ARGS)
+ exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET)
+ if(${RET})
+ message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"")
+ endif(${RET})
+endmacro(EXEC_TAR_COMMAND)
# Create a directory structure
-SET(CHECK_FILES)
-MACRO(COPY F1 F2)
- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY)
- SET(CHECK_FILES ${CHECK_FILES} "${F2}")
-ENDMACRO(COPY)
+set(CHECK_FILES)
+macro(COPY F1 F2)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY)
+ set(CHECK_FILES ${CHECK_FILES} "${F2}")
+endmacro(COPY)
COPY("CMakeLists.txt" "f1.txt")
COPY("CMakeLists.txt" "d1/f1.txt")
COPY("CMakeLists.txt" "d 2/f1.txt")
@@ -23,22 +23,22 @@ COPY("CMakeLists.txt" "d_4/f1.txt")
COPY("CMakeLists.txt" "d-4/f1.txt")
COPY("CMakeLists.txt" "My Special Directory/f1.txt")
-IF(UNIX)
- EXEC_PROGRAM("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"")
- SET(CHECK_FILES ${CHECK_FILES} "d1/f2.txt")
-ENDIF(UNIX)
+if(UNIX)
+ exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"")
+ set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt")
+endif(UNIX)
# cleanup first in case there are files left from previous runs
# if the umask is odd on the machine it might create files that
# are not automatically over written. These tests are run
# each time the configure step is run.
-FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar")
-FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz")
-FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
-FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar")
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz")
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
-MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
-MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
+make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar")
+make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz")
# Run tests
@@ -48,22 +48,22 @@ EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DI
EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"")
EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"")
-MACRO(CHECK_DIR_STRUCTURE DIR)
- FOREACH(file ${CHECK_FILES})
- SET(sfile "${DIR}/${file}")
- SET(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}")
- IF(NOT EXISTS "${sfile}")
- MESSAGE(SEND_ERROR "Cannot find file ${sfile}")
- ELSE(NOT EXISTS "${sfile}")
- EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret)
- IF(${ret})
- MESSAGE(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different")
- ENDIF(${ret})
- ENDIF(NOT EXISTS "${sfile}")
- ENDFOREACH(file)
-ENDMACRO(CHECK_DIR_STRUCTURE)
+macro(CHECK_DIR_STRUCTURE DIR)
+ foreach(file ${CHECK_FILES})
+ set(sfile "${DIR}/${file}")
+ set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}")
+ if(NOT EXISTS "${sfile}")
+ message(SEND_ERROR "Cannot find file ${sfile}")
+ else(NOT EXISTS "${sfile}")
+ exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret)
+ if(${ret})
+ message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different")
+ endif(${ret})
+ endif(NOT EXISTS "${sfile}")
+ endforeach(file)
+endmacro(CHECK_DIR_STRUCTURE)
CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir")
-ADD_EXECUTABLE(TarTest TestTarExec.cxx)
+add_executable(TarTest TestTarExec.cxx)