diff --git a/CMakeLists.txt b/CMakeLists.txt index 36be99c..0705426 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,3 +4,5 @@ project(cputild C) set(CMAKE_C_STANDARD 11) add_executable(cputild main.c) + +install(TARGETS cputild CONFIGURATIONS Release CONFIGURATIONS RelWithDebInfo) \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..c576950 --- /dev/null +++ b/install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SRC_DIR="$(realpath $(dirname $0))" +TMP_DIR="$(mktemp -d "cputild-build-XXXXXX" -p "/tmp")" +trap "rm -rf '$TMP_DIR'" EXIT + +cmake -S "$SRC_DIR" -B "$TMP_DIR" -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake --build "$TMP_DIR" +sudo cmake --install "$TMP_DIR" --prefix "/usr/local" diff --git a/install/bin/cputild b/install/bin/cputild new file mode 100755 index 0000000..1fae415 Binary files /dev/null and b/install/bin/cputild differ