File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,29 @@ if (MFC_FFTW)
3232 add_custom_target (fftw)
3333 else ()
3434 if (NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" )
35+ message (STATUS "FFTW: Preparing to configure with CMake 4.0 compatibility fix" )
36+
37+ # Patch FFTW CMakeLists.txt
38+ file (WRITE "${CMAKE_BINARY_DIR} /patch_fftw.cmake"
39+ "file(READ \"\$ {SOURCE_DIR}/CMakeLists.txt\" content)
40+ string(REPLACE \" cmake_minimum_required(VERSION 2.8\" \" cmake_minimum_required(VERSION 3.5\" content \"\$ {content}\" )
41+ file(WRITE \"\$ {SOURCE_DIR}/CMakeLists.txt\" \"\$ {content}\" )
42+ message(STATUS \" FFTW: CMakeLists.txt patched to require CMake 3.5+\" )" )
43+
3544 ExternalProject_Add(fftw
3645 URL "http://www.fftw.org/fftw-3.3.10.tar.gz"
46+ # More debugging info
47+ LOG_DOWNLOAD ON
48+ LOG_UPDATE ON
49+ LOG_CONFIGURE ON
50+ LOG_BUILD ON
51+ LOG_INSTALL ON
52+ LOG_PATCH ON
53+ # Add this to patch the CMakeLists file before configure
54+ PATCH_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=<SOURCE_DIR> -P ${CMAKE_BINARY_DIR} /patch_fftw.cmake
3755 CMAKE_ARGS -DBUILD_TESTS=OFF
3856 -DBUILD_SHARED_LIBS=OFF
57+ # Not enough to fix the issue, but we'll keep it
3958 -DCMAKE_POLICY_VERSION_MINIMUM=3.5
4059 "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} "
4160 )
Original file line number Diff line number Diff line change 1+ --- CMakeLists.txt.orig
2+ +++ CMakeLists.txt
3+ @@ -1,4 +1,4 @@
4+ - cmake_minimum_required(VERSION 2.8.0)
5+ + cmake_minimum_required(VERSION 3.5)
6+
7+ project(fftw)
You can’t perform that action at this time.
0 commit comments