On Fri, Jan 10, 2025 at 8:30 PM Daniel Sahlberg <daniel.l.sahlb...@gmail.com> wrote:
> fre 10 jan. 2025 kl. 20:18 skrev Timofei Zhakov <t...@chemodax.net>: > >> Hi all, >> >> I’ve recently noticed that Serf is currently using an old version of >> CMake. >> The policy is currently requiring the version 3.0. >> >> I think that this would be a great to bump the required CMake version to a >> newer one. This will firstly prevent a weird warning about unsupported >> version, when the newest executable is being utilized for configuration. >> They don’t support versions less than 3.6, as I remember that. >> >> Secondly, we will get an access to new features of CMake. There were a >> bunch of stuff added, which may make the CMake script better and simpler. >> Actually, I run into this issue when wanted to use the >> add_compile_definitions() command for initializing the compile >> definitions, >> instead of changing the flags directly. This command was introduced >> exactly >> in the version 3.12 (check their docs out for more info: >> https://cmake.org/cmake/help/latest/command/add_compile_definitions.html >> ). >> I’m gonna make this patch soon ;)) >> >> Based on my experience of introducing CMake build to Subversion, I figured >> out that the version 3.12 is the best choose for such projects. This >> version has the most of the important and helpful CMake features, which >> 3.0 >> doesn’t. It is available on the most of the platforms and distributions >> (actually I can say that all supported distributions provides this >> version, >> or the later one). >> >> In order to update the version, it has to be changed in the CMakeLists.txt >> file, where we request minimal CMake version using the >> cmake_minimum_required command. Also the block bellow, with the CMP0074 >> policy manipulation can be simply removed, since the version 3.12 enables >> it automatically. >> >> What do you think? > > > Hi > > Since we didn’t even release any version of Serf with CMake support (the > support is in trunk and in the still-to-be-released 1.4.x) and considering > that CMake 3.12 was released in 2018 (6+ years ago), I can’t see any > problems with moving to 3.12. Anyone building experimental versions should > be on at least 3.12 already. > > Cheers > Daniel > Hi, Thanks for reviewing the idea. As we're agreed, I've made the patch for this and attached it to the email as 'serf-cmake-update-version.patch.txt'. Actually, it required making similar modifications in the other files, so APR and APRUtil modules will use the same version. The logmessage is also provided below. [[[ Require CMake of the version 3.12 or later instead of 3.0. * CMakeLists.txt (cmake_minimum_required): Change the version. (CMP0074): Don't set this policy, since this is set by default in the new minimum required version. * build/FindAPR.cmake, build/FindAPRUtil.cmake (cmake_minimum_required): Change the version. Patch by: rinrab ]]] -- Timofei Zhakov
Require CMake of the version 3.12 or later instead of 3.0. * CMakeLists.txt (cmake_minimum_required): Change the version. (CMP0074): Don't set this policy, since this is set by default in the new minimum required version. * build/FindAPR.cmake, build/FindAPRUtil.cmake (cmake_minimum_required): Change the version. Patch by: rinrab Index: build/FindAPR.cmake =================================================================== --- build/FindAPR.cmake (revision 1923038) +++ build/FindAPR.cmake (working copy) @@ -17,7 +17,7 @@ # under the License. # =================================================================== -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.12) #.rst: # FindAPR Index: build/FindAPRUtil.cmake =================================================================== --- build/FindAPRUtil.cmake (revision 1923038) +++ build/FindAPRUtil.cmake (working copy) @@ -17,7 +17,7 @@ # under the License. # =================================================================== -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.12) #.rst: # FindAPRUtil Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 1923038) +++ CMakeLists.txt (working copy) @@ -28,13 +28,8 @@ # ZLIB_ROOT - Path to zlib's install area # =================================================================== -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.12) -# Silence warnings about ${<PackageName>_ROOT} in CMake 3.12+ -if((${CMAKE_MAJOR_VERSION} GREATER 3) OR (${CMAKE_MINOR_VERSION} GREATER 11)) - cmake_policy(SET CMP0074 NEW) -endif() - # Enable CMP0092 if supported: MSVC warning flags are not in # CMAKE_<LANG>_FLAGS by default. if(POLICY CMP0092)