diff --git a/.gitignore b/.gitignore index 7863552..2e791b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,4 @@ build tmp .vscode/ -.idea/ - -### CMake ### -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps -CMakeUserPresets.json - -### CMake Patch ### -# External projects -*-prefix/ +.idea/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index b7c6b02..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -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 - ) - list(APPEND all_tools ${TOOL}) -endforeach () - -add_custom_target( - update_all ALL - COMMENT "Update all tools" - DEPENDS ${all_tools} - VERBATIM -) \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..60c26e6 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all : cmake conan sccache + +cmake: + cmake -DTOOL=cmake -DREPO=kitware -P update.cmake + +conan: + cmake -DTOOL=conan -DREPO=conan-io -P update.cmake + +sccache: + cmake -DTOOL=sccache -DREPO=mozilla -P update.cmake diff --git a/install-cmake.sh b/install-cmake.sh index f499330..86d620b 100644 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -1,5 +1,5 @@ #!/bin/bash set -eu -wget "https://github.com/Kitware/CMake/releases/download/v3.20.03/cmake-3.20.03-Linux-x86_64.sh" -nv -O /tmp/cmake.sh +wget "https://github.com/Kitware/CMake/releases/download/v3.20.04/cmake-3.20.04-Linux-x86_64.sh" -nv -O /tmp/cmake.sh sh /tmp/cmake.sh --exclude-subdir --prefix=/usr/local diff --git a/update.cmake b/update.cmake index 930050b..8713ddc 100644 --- a/update.cmake +++ b/update.cmake @@ -1,6 +1,6 @@ message("TOOL \"${TOOL}\" REPO \"${REPO}\"") -SET(URL "https://api.github.com/repos/${REPO}/releases/latest") +SET(URL "https://api.github.com/repos/${REPO}/${TOOL}/releases/latest") execute_process(COMMAND curl -s -L ${URL} OUTPUT_VARIABLE VERSION_JSON) string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)