This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new ffdcd3e5a MINIFICPP-2832 Fix CMake 3.25 issues and make it the 
required version (#2188)
ffdcd3e5a is described below

commit ffdcd3e5a8fe2a0229c77254ad153d912b9cd1ed
Author: Gabor Gyimesi <[email protected]>
AuthorDate: Fri May 29 10:56:22 2026 +0200

    MINIFICPP-2832 Fix CMake 3.25 issues and make it the required version 
(#2188)
---
 CMakeLists.txt                     |  2 +-
 README.md                          |  2 +-
 cmake/AzureSdkCpp.cmake            | 10 ++++++++++
 cmake/ExpressionLanguage.cmake     | 10 ++++------
 controller/CMakeLists.txt          |  2 +-
 extensions/ExtensionHeader.txt     |  2 +-
 libminifi/CMakeLists.txt           |  2 +-
 minifi_main/CMakeLists.txt         |  2 +-
 thirdparty/wil/cmake_version.patch | 10 ++++++++++
 9 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98b176bb5..fac77f326 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.25)
 cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in 
PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
 cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted 
contents to the time of extraction
 
diff --git a/README.md b/README.md
index dc25e3890..f70e0c2e4 100644
--- a/README.md
+++ b/README.md
@@ -120,7 +120,7 @@ Communicating with Apache NiFi can be done using the 
Site-to-Site protocol. More
 ### To build
 
 #### Utilities
-* CMake 3.24 or greater
+* CMake 3.25 or greater
 * Compiler
   * g++ 13 or greater
   * clang 18 or greater
diff --git a/cmake/AzureSdkCpp.cmake b/cmake/AzureSdkCpp.cmake
index c91026148..f29855665 100644
--- a/cmake/AzureSdkCpp.cmake
+++ b/cmake/AzureSdkCpp.cmake
@@ -20,10 +20,15 @@ if (WIN32)
     set(WIL_BUILD_TESTS OFF CACHE INTERNAL "")
     set(WIL_BUILD_PACKAGING OFF CACHE INTERNAL "")
 
+    set(WIL_PATCH_FILE_1 
"${CMAKE_SOURCE_DIR}/thirdparty/wil/cmake_version.patch")
+    set(WIL_PC ${Bash_EXECUTABLE}  -c "set -x &&\
+        (\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i 
\\\"${WIL_PATCH_FILE_1}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i 
\\\"${WIL_PATCH_FILE_1}\\\")")
+
     FetchContent_Declare(
             wil
             URL      
https://github.com/microsoft/wil/archive/refs/tags/v1.0.260126.7.tar.gz
             URL_HASH 
SHA256=de9e03b38ff0ff8d22048f00b111cb631d21c550328f12530ccba71c05c9e361
+            PATCH_COMMAND "${WIL_PC}"
             SYSTEM
     )
     FetchContent_MakeAvailable(wil)
@@ -62,6 +67,11 @@ FetchContent_Declare(asdkext
 
 FetchContent_MakeAvailable(asdkext)
 
+if (WIN32)
+    # Azure SDK changes C++ standard to C++14 which needs to be overridden 
back to C++17 required by the WIL library on Windows
+    set_target_properties(azure-identity PROPERTIES CXX_STANDARD 17 
CXX_STANDARD_REQUIRED ON)
+endif()
+
 if (NOT WIN32)
     add_dependencies(azure-storage-common LibXml2::LibXml2)
     add_dependencies(azure-data-tables LibXml2::LibXml2)
diff --git a/cmake/ExpressionLanguage.cmake b/cmake/ExpressionLanguage.cmake
index 7e403f273..27a331c3e 100644
--- a/cmake/ExpressionLanguage.cmake
+++ b/cmake/ExpressionLanguage.cmake
@@ -37,22 +37,20 @@ if(WIN32)
     if(NOT winflexbison_POPULATED)
         FetchContent_Populate("winflexbison")
         execute_process(
-            COMMAND ${CMAKE_COMMAND} .
+            COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release .
             WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
             COMMAND_ERROR_IS_FATAL ANY
         )
 
         execute_process(
-            COMMAND ${CMAKE_COMMAND} --build . --config RelWithDebInfo
+            COMMAND ${CMAKE_COMMAND} --build . --config Release
             WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
             COMMAND_ERROR_IS_FATAL ANY
         )
-
-        file(COPY ${winflexbison_SOURCE_DIR}/bison/Data DESTINATION 
${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/)
     endif()
 
-    set(BISON_EXECUTABLE 
"${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/win_bison.exe" CACHE PATH 
"bison executable")
-    set(FLEX_EXECUTABLE 
"${winflexbison_SOURCE_DIR}/flex/RelWithDebInfo/win_flex.exe" CACHE PATH "flex 
executable")
+    set(BISON_EXECUTABLE 
"${winflexbison_SOURCE_DIR}/bin/Release/win_bison.exe" CACHE PATH "bison 
executable")
+    set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/bin/Release/win_flex.exe" 
CACHE PATH "flex executable")
 
     include_directories(${winflexbison_SOURCE_DIR}/flex/src/)
 
diff --git a/controller/CMakeLists.txt b/controller/CMakeLists.txt
index 89bec2e70..8b72fa974 100644
--- a/controller/CMakeLists.txt
+++ b/controller/CMakeLists.txt
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.25)
 cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted 
contents to the time of extraction
 
 include_directories(../minifi_main/ ../libminifi/include  
../libminifi/include/c2  ../libminifi/include/c2/protocols/  
../libminifi/include/core/state 
./libminifi/include/core/statemanagement/metrics  
../libminifi/include/core/yaml  ../libminifi/include/core)
diff --git a/extensions/ExtensionHeader.txt b/extensions/ExtensionHeader.txt
index 070837478..216a4aeec 100644
--- a/extensions/ExtensionHeader.txt
+++ b/extensions/ExtensionHeader.txt
@@ -17,5 +17,5 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.25)
 
diff --git a/libminifi/CMakeLists.txt b/libminifi/CMakeLists.txt
index 85a7da3f8..3a0e74d2a 100644
--- a/libminifi/CMakeLists.txt
+++ b/libminifi/CMakeLists.txt
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-cmake_minimum_required (VERSION 3.24)
+cmake_minimum_required (VERSION 3.25)
 cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in 
PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
 cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted 
contents to the time of extraction
 project(nifi-libcore-minifi VERSION 1.0.0)
diff --git a/minifi_main/CMakeLists.txt b/minifi_main/CMakeLists.txt
index b8ba7ad9f..77413e108 100644
--- a/minifi_main/CMakeLists.txt
+++ b/minifi_main/CMakeLists.txt
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.25)
 cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted 
contents to the time of extraction
 
 include_directories(../libminifi/include)
diff --git a/thirdparty/wil/cmake_version.patch 
b/thirdparty/wil/cmake_version.patch
new file mode 100644
index 000000000..970b2b58d
--- /dev/null
+++ b/thirdparty/wil/cmake_version.patch
@@ -0,0 +1,10 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eb1f874..6f0a539 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.29)
++cmake_minimum_required(VERSION 3.25)
+ project(WIL)
+ 
+ include(GNUInstallDirs)

Reply via email to