summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-clean-build-directory.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-14 15:26:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:53:40 +0200
commit9688f7937f2f1f139f6cb1fa6578b72b259b9f31 (patch)
treed2a5aa88e811fd8813044d5ccbb634eda77d5a36 /cmake/opentrack-clean-build-directory.cmake
parent9ca593d3ed203df4404f051dad426b04e6624512 (diff)
cmake: allow for "mrproper" to delete install directory
This doesn't yet support mingw-w64 builds. Isn't hard to implement. The build script automatically copies Qt libraries in the right place. Now we have no more stale stuff in the install directory. In fact, everything but CMakeCache.txt is deleted.
Diffstat (limited to 'cmake/opentrack-clean-build-directory.cmake')
-rw-r--r--cmake/opentrack-clean-build-directory.cmake21
1 files changed, 5 insertions, 16 deletions
diff --git a/cmake/opentrack-clean-build-directory.cmake b/cmake/opentrack-clean-build-directory.cmake
index 13c3c282..a8141344 100644
--- a/cmake/opentrack-clean-build-directory.cmake
+++ b/cmake/opentrack-clean-build-directory.cmake
@@ -1,4 +1,4 @@
-function(cleanup_install_dir)
+function(cleanup_build_dir)
if(NOT $ENV{USERNAME} STREQUAL "sthalik")
message(WARNING "you can't run this potentially destructive function")
message(FATAL_ERROR "if you're sure, remove this line")
@@ -13,19 +13,7 @@ function(cleanup_install_dir)
set(got-cache FALSE)
foreach(i ${files})
- if (i STREQUAL "install")
- set(got-install TRUE)
- continue()
- endif()
-
- string(FIND "${i}" "install/" pos)
-
- if(pos GREATER -1)
- set(got-install-file TRUE)
- continue()
- endif()
-
- if(i STREQUAL "CMakeCache.txt")
+ if(i STREQUAL "CMakeCache.txt")
set(got-cache TRUE)
continue()
endif()
@@ -35,7 +23,7 @@ function(cleanup_install_dir)
unset(files)
- if(NOT got-cache OR NOT got-install OR NOT got-install-file)
+ if(NOT got-cache)
message(FATAL_ERROR "")
endif()
@@ -45,4 +33,5 @@ function(cleanup_install_dir)
execute_process(COMMAND cmake . WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" OUTPUT_QUIET)
endfunction()
-cleanup_install_dir()
+cleanup_build_dir()
+