diff --git a/CMakeLists.txt b/CMakeLists.txt index f417595..e2f9269 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.19) set(HYPRCURSOR_VERSION "0.1.2") +add_compile_definitions(HYPRCURSOR_VERSION="${HYPRCURSOR_VERSION}") project(hyprcursor VERSION ${HYPRCURSOR_VERSION} diff --git a/hyprcursor-util/CMakeLists.txt b/hyprcursor-util/CMakeLists.txt index 329be9c..81d2847 100644 --- a/hyprcursor-util/CMakeLists.txt +++ b/hyprcursor-util/CMakeLists.txt @@ -7,6 +7,7 @@ project( find_package(PkgConfig REQUIRED) pkg_check_modules(deps REQUIRED IMPORTED_TARGET hyprlang>=0.4.0 libzip) +add_compile_definitions(HYPRCURSOR_VERSION="${HYPRCURSOR_VERSION}") file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp") diff --git a/hyprcursor-util/src/main.cpp b/hyprcursor-util/src/main.cpp index 03518d8..6a622b4 100644 --- a/hyprcursor-util/src/main.cpp +++ b/hyprcursor-util/src/main.cpp @@ -448,6 +448,11 @@ int main(int argc, char** argv, char** envp) { for (size_t i = 1; i < argc; ++i) { std::string arg = argv[i]; + if (arg == "-v" || arg == "--version") { + std::cout << "hyprcursor-util, built from v" << HYPRCURSOR_VERSION << "\n"; + exit(0); + } + if (i == 1) { // mode if (arg == "--create" || arg == "-c") {