summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-clean-build-directory.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-16 12:47:21 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-16 12:47:21 +0100
commit8cb5e8effdd7981449c9f00891748afd1237c175 (patch)
treec21bb8cd28a84471ddf0565f984ab040cb22199b /cmake/opentrack-clean-build-directory.cmake
parente4a7580a68990d8bc3712b0bf3082939156d6329 (diff)
cmake: move mrproper code to indexed project file
Also remove the username guard.
Diffstat (limited to 'cmake/opentrack-clean-build-directory.cmake')
-rw-r--r--cmake/opentrack-clean-build-directory.cmake44
1 files changed, 2 insertions, 42 deletions
diff --git a/cmake/opentrack-clean-build-directory.cmake b/cmake/opentrack-clean-build-directory.cmake
index ab9fffaf..c0934af1 100644
--- a/cmake/opentrack-clean-build-directory.cmake
+++ b/cmake/opentrack-clean-build-directory.cmake
@@ -1,44 +1,4 @@
-# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
-# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
-# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
-# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-function(cleanup_build_dir)
- 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 and submit a pull request")
- endif()
-
- file(GLOB_RECURSE files LIST_DIRECTORIES TRUE RELATIVE "${CMAKE_BINARY_DIR}" "*")
-
- set(files_ "")
-
- set(got-install FALSE)
- set(got-install-file FALSE)
- set(got-cache FALSE)
-
- foreach(i ${files})
- if(i STREQUAL "CMakeCache.txt")
- set(got-cache TRUE)
- else()
- list(APPEND files_ "${CMAKE_BINARY_DIR}/${i}")
- endif()
- endforeach()
-
- if(NOT got-cache)
- message(FATAL_ERROR "sanity check failed")
- endif()
-
- # let's hope nothing bad happens
- file(REMOVE_RECURSE ${files_})
-
- #execute_process(COMMAND cmake . WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" OUTPUT_QUIET)
-endfunction()
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
+include(opentrack-build)
cleanup_build_dir()
-