summaryrefslogtreecommitdiffstats
path: root/Tests/MakeClean
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/MakeClean
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/MakeClean')
-rw-r--r--Tests/MakeClean/CMakeLists.txt42
-rw-r--r--Tests/MakeClean/ToClean/CMakeLists.txt24
-rw-r--r--Tests/MakeClean/ToClean/ToCleanFiles.cmake.in2
3 files changed, 34 insertions, 34 deletions
diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt
index 97d3554..7400754 100644
--- a/Tests/MakeClean/CMakeLists.txt
+++ b/Tests/MakeClean/CMakeLists.txt
@@ -1,47 +1,47 @@
cmake_minimum_required (VERSION 2.6)
-PROJECT(MakeClean)
+project(MakeClean)
# Build the to-clean project.
-TRY_COMPILE(TOCLEAN_BUILT
+try_compile(TOCLEAN_BUILT
${MakeClean_BINARY_DIR}/ToClean
${MakeClean_SOURCE_DIR}/ToClean
ToClean
OUTPUT_VARIABLE OUTPUT
)
-IF(TOCLEAN_BUILT)
- MESSAGE(
+if(TOCLEAN_BUILT)
+ message(
"Building ToClean succeeded with the following output:\n"
"[${OUTPUT}]"
)
-ELSE(TOCLEAN_BUILT)
- MESSAGE(FATAL_ERROR
+else(TOCLEAN_BUILT)
+ message(FATAL_ERROR
"Building ToClean failed with the following output:\n"
"[${OUTPUT}]"
)
-ENDIF(TOCLEAN_BUILT)
+endif(TOCLEAN_BUILT)
# Get the set of files to check from the ToClean project.
-INCLUDE(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
+include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake)
# Check for the existence of the files.
-FOREACH(f ${TOCLEAN_FILES})
- IF(EXISTS "${f}")
- ELSE(EXISTS "${f}")
- MESSAGE(FATAL_ERROR "File \"${f}\" does not exist!")
- ENDIF(EXISTS "${f}")
-ENDFOREACH(f)
+foreach(f ${TOCLEAN_FILES})
+ if(EXISTS "${f}")
+ else(EXISTS "${f}")
+ message(FATAL_ERROR "File \"${f}\" does not exist!")
+ endif(EXISTS "${f}")
+endforeach(f)
# Configure an executable to check that all the files are missing.
-SET(CHECK_FILES)
-FOREACH(f ${TOCLEAN_FILES})
- SET(CHECK_FILES "${CHECK_FILES} \"${f}\",\n")
-ENDFOREACH(f)
-CONFIGURE_FILE(${MakeClean_SOURCE_DIR}/check_clean.c.in
+set(CHECK_FILES)
+foreach(f ${TOCLEAN_FILES})
+ set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n")
+endforeach(f)
+configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in
${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE)
-ADD_EXECUTABLE(check_clean ${MakeClean_BINARY_DIR}/check_clean.c)
+add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c)
# After the executable builds, clean the files.
-ADD_CUSTOM_COMMAND(
+add_custom_command(
TARGET check_clean
POST_BUILD
COMMAND ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt
index 50facad..28569dd 100644
--- a/Tests/MakeClean/ToClean/CMakeLists.txt
+++ b/Tests/MakeClean/ToClean/CMakeLists.txt
@@ -1,31 +1,31 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ToClean)
+cmake_minimum_required(VERSION 2.6)
+project(ToClean)
# Build a simple project.
-ADD_EXECUTABLE(toclean toclean.cxx)
+add_executable(toclean toclean.cxx)
# List some build-time-generated files.
-GET_TARGET_PROPERTY(TOCLEAN_FILES toclean LOCATION)
-SET(TOCLEAN_FILES ${TOCLEAN_FILES}
+get_target_property(TOCLEAN_FILES toclean LOCATION)
+set(TOCLEAN_FILES ${TOCLEAN_FILES}
"${ToClean_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}")
# Create a file that must be registered for cleaning.
-FILE(WRITE "${ToClean_BINARY_DIR}/Registered.txt"
+file(WRITE "${ToClean_BINARY_DIR}/Registered.txt"
"File registered for cleaning.\n")
-SET_DIRECTORY_PROPERTIES(PROPERTIES
+set_directory_properties(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${ToClean_BINARY_DIR}/Registered.txt")
-SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt")
+set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt")
# Create a custom command whose output should be cleaned.
-ADD_CUSTOM_COMMAND(OUTPUT ${ToClean_BINARY_DIR}/generated.txt
+add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt
DEPENDS ${ToClean_SOURCE_DIR}/toclean.cxx
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${ToClean_SOURCE_DIR}/toclean.cxx
${ToClean_BINARY_DIR}/generated.txt
)
-ADD_CUSTOM_TARGET(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt)
-SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt")
+add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt)
+set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt")
# Configure a file listing these build-time-generated files.
-CONFIGURE_FILE(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
+configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE)
diff --git a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
index 10d11c3..e7d9947 100644
--- a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
+++ b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
@@ -1 +1 @@
-SET(TOCLEAN_FILES "@TOCLEAN_FILES@")
+set(TOCLEAN_FILES "@TOCLEAN_FILES@")