mirror of
https://github.com/hyprwm/hyprcursor.git
synced 2024-12-22 10:19:48 +01:00
cmake: add version define
This commit is contained in:
parent
09b2a50fe7
commit
f1547443a0
3 changed files with 7 additions and 0 deletions
|
@ -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}
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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") {
|
||||
|
|
Loading…
Reference in a new issue