summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:59:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 18:07:15 +0200
commit9020dc7c04d389d534f36890756d97d2be219e07 (patch)
tree8c6618b9527a96fa1e47d3fba84d766b69d0d7e9
parentb0fddf1ea60fb3c2c8e2cd3d061e0a0ec5c54f93 (diff)
cmake/mrproper: reindent
-rw-r--r--cmake/opentrack-clean-build-directory.cmake14
1 files changed, 6 insertions, 8 deletions
diff --git a/cmake/opentrack-clean-build-directory.cmake b/cmake/opentrack-clean-build-directory.cmake
index a8141344..93c736dd 100644
--- a/cmake/opentrack-clean-build-directory.cmake
+++ b/cmake/opentrack-clean-build-directory.cmake
@@ -1,5 +1,6 @@
function(cleanup_build_dir)
- if(NOT $ENV{USERNAME} STREQUAL "sthalik")
+ set(user "$ENV{USERNAME}")
+ if(NOT user STREQUAL "sthalik")
message(WARNING "you can't run this potentially destructive function")
message(FATAL_ERROR "if you're sure, remove this line")
endif()
@@ -13,18 +14,15 @@ function(cleanup_build_dir)
set(got-cache FALSE)
foreach(i ${files})
- if(i STREQUAL "CMakeCache.txt")
+ if(i STREQUAL "CMakeCache.txt")
set(got-cache TRUE)
- continue()
+ else()
+ list(APPEND files_ "${CMAKE_BINARY_DIR}/${i}")
endif()
-
- list(APPEND files_ "${CMAKE_BINARY_DIR}/${i}")
endforeach()
- unset(files)
-
if(NOT got-cache)
- message(FATAL_ERROR "")
+ message(FATAL_ERROR "sanity check failed")
endif()
# let's hope nothing bad happens