From f79af11e7603657dff88a4b2341331a3030440ef Mon Sep 17 00:00:00 2001 From: Edgar Date: Mon, 19 Oct 2020 15:51:06 +0200 Subject: [PATCH] :wrench: Replaced makefile with cmake --- .gitignore | 1 + CMakeLists.txt | 15 +++++++++++++++ makefile | 11 ----------- update.cmake | 3 +-- 4 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 makefile diff --git a/.gitignore b/.gitignore index a9a5aec..d59a62b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +build tmp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a6d9599 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.16) + +project(ci-scripts LANGUAGES NONE) + +set(TOOLS "kitware/cmake" "conan-io/conan" "mozilla/sccache") + +foreach (item IN ITEMS ${TOOLS}) + string(REPLACE "/" ";" RLIST ${item}) + list(GET RLIST 1 TOOL) + add_custom_target( + ${TOOL} + COMMAND ${CMAKE_COMMAND} -DTOOL=${TOOL} -DREPO=${item} -P ${CMAKE_SOURCE_DIR}/update.cmake + VERBATIM + ) +endforeach () \ No newline at end of file diff --git a/makefile b/makefile deleted file mode 100644 index b917b8c..0000000 --- a/makefile +++ /dev/null @@ -1,11 +0,0 @@ -CMD := cmake -SCRIPT := -P update.cmake - -cmake: - $(CMD) -DTOOL=cmake -DREPO="Kitware/CMake" $(SCRIPT) - -conan: - $(CMD) -DTOOL=conan -DREPO="conan-io/conan" $(SCRIPT) - -sccache: - $(CMD) -DTOOL=sccache -DREPO="mozilla/sccache" $(SCRIPT) \ No newline at end of file diff --git a/update.cmake b/update.cmake index aa52986..8c7596d 100644 --- a/update.cmake +++ b/update.cmake @@ -7,5 +7,4 @@ string(REGEX REPLACE /[^0-9\\.]/ "" VERSION ${VERSION_DIRTY}) string(REPLACE "." "_" VERSION_UNDERSCORE ${VERSION}) message("Latest VERSION ${VERSION}") - -configure_file("templates/install-${TOOL}.sh.in" install-${TOOL}.sh @ONLY) \ No newline at end of file +configure_file("${CMAKE_CURRENT_LIST_DIR}/templates/install-${TOOL}.sh.in" "${CMAKE_CURRENT_LIST_DIR}/install-${TOOL}.sh" @ONLY) \ No newline at end of file