From 92d5c473f5dde50e76fcd867dcfe28f49eff645d Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 9 May 2025 15:07:25 +0200 Subject: [PATCH] feat(windows): use cmake to configure windows integration DLL version Signed-off-by: Matthieu Gallien --- VERSION.cmake | 2 ++ shell_integration/windows/NCUtil/CMakeLists.txt | 5 ++++- shell_integration/windows/NCUtil/{Version.h => Version.h.in} | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) rename shell_integration/windows/NCUtil/{Version.h => Version.h.in} (81%) diff --git a/VERSION.cmake b/VERSION.cmake index 1623810ab7..e7ff4215f9 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -11,6 +11,8 @@ set(MIRALL_VERSION_PATCH 50) set(MIRALL_VERSION_YEAR 2025) set(MIRALL_SOVERSION 0) set(MIRALL_PREVERSION_HUMAN "3.17.0 alpha") # For preversions where PATCH>=50. Use version + alpha, rc1, rc2, etc. +set(NCEXT_BUILD_NUM 47) +set(NCEXT_VERSION 3,0,0,${NCEXT_BUILD_NUM}) # ------------------------------------ # Minimum supported server versions diff --git a/shell_integration/windows/NCUtil/CMakeLists.txt b/shell_integration/windows/NCUtil/CMakeLists.txt index 234e1e775b..75972307f6 100644 --- a/shell_integration/windows/NCUtil/CMakeLists.txt +++ b/shell_integration/windows/NCUtil/CMakeLists.txt @@ -1,5 +1,7 @@ # SPDX-FileCopyrightText: 2018 ownCloud GmbH # SPDX-License-Identifier: LGPL-2.1-or-later +configure_file(Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/Version.h) + add_library(NCUtil STATIC CommunicationSocket.cpp RemotePathChecker.cpp @@ -9,5 +11,6 @@ add_library(NCUtil STATIC target_include_directories(NCUtil PUBLIC - "${CMAKE_CURRENT_SOURCE_DIR}" + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/shell_integration/windows/NCUtil/Version.h b/shell_integration/windows/NCUtil/Version.h.in similarity index 81% rename from shell_integration/windows/NCUtil/Version.h rename to shell_integration/windows/NCUtil/Version.h.in index 92f6600cc2..30ce150ce4 100644 --- a/shell_integration/windows/NCUtil/Version.h +++ b/shell_integration/windows/NCUtil/Version.h.in @@ -5,10 +5,10 @@ // This is the number that will end up in the version window of the DLLs. // Increment this version before committing a new build if you are today's shell_integration build master. -#define NCEXT_BUILD_NUM 47 +#cmakedefine NCEXT_BUILD_NUM @NCEXT_BUILD_NUM@ #define STRINGIZE2(s) #s #define STRINGIZE(s) STRINGIZE2(s) -#define NCEXT_VERSION 3,0,0,NCEXT_BUILD_NUM +#cmakedefine NCEXT_VERSION @NCEXT_VERSION@ #define NCEXT_VERSION_STRING STRINGIZE(NCEXT_VERSION)