Skip to content

Commit

Permalink
Cmake warning (#230)
Browse files Browse the repository at this point in the history
* Update CMake FetchContent and bump externals

For modern CMake use the new CMP0135 policy, i.e.,
use timestamps from extraction of tarballs

Bump internal submodules to latest releases:
nlohmman-json: 3.11.2
spdlog: 1.11.0

* Bump CMake version

Now to 3.24, which is where the option to handle
extract time timestamps was introduced

* Use optional policy specifier

Address the timestamp issue differently, using a query for the
policy, which indicates a newer cmake, and only setting the policy
if that test passes

This allows us to be still compaible with much older cmake versions
  • Loading branch information
graeme-a-stewart authored Jun 26, 2023
1 parent 881305c commit d6a97cc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.3)
# From CMake 3, we can set the project version easily in one go
project(prmon VERSION 3.0.2)

# For newer CMakes we ensure correct handling of extracting GTest from tarball
if (POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif (POLICY CMP0135)

#--- Define basic build settings -----------------------------------------------
# - Use GNU-style hierarchy for installing build products
include(GNUInstallDirs)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ to CMake using `Gperftools_ROOT_DIR`.

# Copyright

Copyright (c) 2018-2022 CERN.
Copyright (c) 2018-2023 CERN.
2 changes: 1 addition & 1 deletion package/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set_target_properties(mem-burner PROPERTIES COMPILE_FLAGS "-fno-builtin")
endif()

if (${CMAKE_VERSION} VERSION_GREATER "3.14.0" AND BUILD_GTESTS)
if (BUILD_GTESTS)

include(FetchContent)
FetchContent_Declare(
Expand Down
2 changes: 1 addition & 1 deletion submodules/nlohmann_json
Submodule nlohmann_json updated 1123 files
2 changes: 1 addition & 1 deletion submodules/spdlog
Submodule spdlog updated 103 files

0 comments on commit d6a97cc

Please sign in to comment.