From 166f9ed947b3bf29902d4ef659df46fc1d1746eb Mon Sep 17 00:00:00 2001 From: Edgar Date: Mon, 23 Aug 2021 13:36:13 +0200 Subject: [PATCH] :memo: Update readme with cmake --- .gitignore | 2 ++ CMakeLists.txt | 41 ++++++++++++++++++++++++++++++++++++++--- README.md | 39 ++++++++++++++++++++++++++++++++++++++- update.cmake | 5 ----- 4 files changed, 78 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 159f7e3..305c9ad 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ _deps build.ninja .ninja_log + +.ninja_deps diff --git a/CMakeLists.txt b/CMakeLists.txt index 196a479..dee7084 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,18 +6,44 @@ set(TOOLS "kitware/cmake" "mozilla/sccache" "muesli/duf" + "jesseduffield/lazygit" ) +set(EXTRA_TOOLS + "itchio/butler" + "conan-io/conan" + ) + +set(TOOL_TMP [==[ +### @TOOL@ + +Repo: https://github.com/@item@ + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-@TOOL@.sh" | sudo bash` +]==]) + +set(README [==[ +# ci-scripts + +Some bashscripts for installing devtools on Ubuntu + +Available tools: +@TOOL_LIST@ +]==]) + foreach (item IN ITEMS ${TOOLS}) - string(REPLACE "/" ";" RLIST ${item}) + string(REPLACE "/" ";" RLIST "${item}") + list(GET RLIST 0 OWNER) list(GET RLIST 1 TOOL) add_custom_target( ${TOOL} - COMMAND ${CMAKE_COMMAND} -DGH_REPO=${item} -P ${CMAKE_SOURCE_DIR}/update.cmake + COMMAND ${CMAKE_COMMAND} -DOWNER=${OWNER} -DTOOL=${TOOL} -P ${CMAKE_SOURCE_DIR}/update.cmake WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} VERBATIM ) list(APPEND all_tools ${TOOL}) + string(CONFIGURE ${TOOL_TMP} README_LINE) + set(TOOL_LIST "${TOOL_LIST}\n${README_LINE}") endforeach () add_custom_target( @@ -25,4 +51,13 @@ add_custom_target( COMMENT "Update all tools" DEPENDS ${all_tools} VERBATIM -) \ No newline at end of file +) + +foreach (item IN ITEMS ${EXTRA_TOOLS}) + string(REPLACE "/" ";" RLIST ${item}) + list(GET RLIST 1 TOOL) + string(CONFIGURE ${TOOL_TMP} README_LINE) + set(TOOL_LIST "${TOOL_LIST}\n${README_LINE}") +endforeach () + +file(CONFIGURE OUTPUT ${CMAKE_SOURCE_DIR}/README.md CONTENT ${README}) \ No newline at end of file diff --git a/README.md b/README.md index 34452f5..6f49cf8 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,41 @@ Some bashscripts for installing devtools on Ubuntu -`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash` \ No newline at end of file +Available tools: + +### cmake + +Repo: https://github.com/kitware/cmake + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-cmake.sh" | sudo bash` + +### sccache + +Repo: https://github.com/mozilla/sccache + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-sccache.sh" | sudo bash` + +### duf + +Repo: https://github.com/muesli/duf + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-duf.sh" | sudo bash` + +### lazygit + +Repo: https://github.com/jesseduffield/lazygit + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-lazygit.sh" | sudo bash` + +### butler + +Repo: https://github.com/itchio/butler + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-butler.sh" | sudo bash` + +### conan + +Repo: https://github.com/conan-io/conan + +`curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash` + diff --git a/update.cmake b/update.cmake index 746c5b9..9e636e1 100644 --- a/update.cmake +++ b/update.cmake @@ -2,11 +2,6 @@ macro(mgs text) execute_process(COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green --bold ${text}) endmacro() - -string(REPLACE "/" ";" RLIST "${GH_REPO}") -list(GET RLIST 0 OWNER) -list(GET RLIST 1 TOOL) - mgs("TOOL \"${TOOL}\" OWNER \"${OWNER}\"") SET(URL "https://api.github.com/repos/${OWNER}/${TOOL}/releases/latest")