Skip to content

Commit 11f7c54

Browse files
committed
MINIFICPP-2832 Fix CMake 3.25 issues and make it the required version
1 parent c4c9358 commit 11f7c54

9 files changed

Lines changed: 30 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
cmake_minimum_required(VERSION 3.24)
20+
cmake_minimum_required(VERSION 3.25)
2121
cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
2222
cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted contents to the time of extraction
2323

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Communicating with Apache NiFi can be done using the Site-to-Site protocol. More
120120
### To build
121121

122122
#### Utilities
123-
* CMake 3.24 or greater
123+
* CMake 3.25 or greater
124124
* Compiler
125125
* g++ 13 or greater
126126
* clang 18 or greater

cmake/AzureSdkCpp.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ if (WIN32)
2020
set(WIL_BUILD_TESTS OFF CACHE INTERNAL "")
2121
set(WIL_BUILD_PACKAGING OFF CACHE INTERNAL "")
2222

23+
set(WIL_PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/wil/cmake_version.patch")
24+
set(WIL_PC ${Bash_EXECUTABLE} -c "set -x &&\
25+
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${WIL_PATCH_FILE_1}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${WIL_PATCH_FILE_1}\\\")")
26+
2327
FetchContent_Declare(
2428
wil
2529
URL https://github.com/microsoft/wil/archive/refs/tags/v1.0.260126.7.tar.gz
2630
URL_HASH SHA256=de9e03b38ff0ff8d22048f00b111cb631d21c550328f12530ccba71c05c9e361
31+
PATCH_COMMAND "${WIL_PC}"
2732
SYSTEM
2833
)
2934
FetchContent_MakeAvailable(wil)
@@ -62,6 +67,11 @@ FetchContent_Declare(asdkext
6267

6368
FetchContent_MakeAvailable(asdkext)
6469

70+
if (WIN32)
71+
# Azure SDK changes C++ standard to C++14 which needs to be overridden back to C++17 required by the WIL library on Windows
72+
set_target_properties(azure-identity PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
73+
endif()
74+
6575
if (NOT WIN32)
6676
add_dependencies(azure-storage-common LibXml2::LibXml2)
6777
add_dependencies(azure-data-tables LibXml2::LibXml2)

cmake/ExpressionLanguage.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,20 @@ if(WIN32)
3737
if(NOT winflexbison_POPULATED)
3838
FetchContent_Populate("winflexbison")
3939
execute_process(
40-
COMMAND ${CMAKE_COMMAND} .
40+
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release .
4141
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
4242
COMMAND_ERROR_IS_FATAL ANY
4343
)
4444

4545
execute_process(
46-
COMMAND ${CMAKE_COMMAND} --build . --config RelWithDebInfo
46+
COMMAND ${CMAKE_COMMAND} --build . --config Release
4747
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
4848
COMMAND_ERROR_IS_FATAL ANY
4949
)
50-
51-
file(COPY ${winflexbison_SOURCE_DIR}/bison/Data DESTINATION ${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/)
5250
endif()
5351

54-
set(BISON_EXECUTABLE "${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/win_bison.exe" CACHE PATH "bison executable")
55-
set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/flex/RelWithDebInfo/win_flex.exe" CACHE PATH "flex executable")
52+
set(BISON_EXECUTABLE "${winflexbison_SOURCE_DIR}/bin/Release/win_bison.exe" CACHE PATH "bison executable")
53+
set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/bin/Release/win_flex.exe" CACHE PATH "flex executable")
5654

5755
include_directories(${winflexbison_SOURCE_DIR}/flex/src/)
5856

controller/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
cmake_minimum_required(VERSION 3.24)
20+
cmake_minimum_required(VERSION 3.25)
2121
cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted contents to the time of extraction
2222

2323
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)

extensions/ExtensionHeader.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
# under the License.
1818
#
1919

20-
cmake_minimum_required(VERSION 3.24)
20+
cmake_minimum_required(VERSION 3.25)
2121

libminifi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
cmake_minimum_required (VERSION 3.24)
20+
cmake_minimum_required (VERSION 3.25)
2121
cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
2222
cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted contents to the time of extraction
2323
project(nifi-libcore-minifi VERSION 1.0.0)

minifi_main/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
cmake_minimum_required(VERSION 3.24)
20+
cmake_minimum_required(VERSION 3.2)
2121
cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted contents to the time of extraction
2222

2323
include_directories(../libminifi/include)

thirdparty/wil/cmake_version.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index eb1f874..6f0a539 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -1,4 +1,4 @@
6+
-cmake_minimum_required(VERSION 3.29)
7+
+cmake_minimum_required(VERSION 3.25)
8+
project(WIL)
9+
10+
include(GNUInstallDirs)

0 commit comments

Comments
 (0)