Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake 3.27.1 generates warning when using FetchContent #1557

Closed
titoiride opened this issue Nov 17, 2023 · 0 comments · Fixed by #1558
Closed

CMake 3.27.1 generates warning when using FetchContent #1557

titoiride opened this issue Nov 17, 2023 · 0 comments · Fixed by #1558
Assignees
Labels
Milestone

Comments

@titoiride
Copy link
Contributor

Hi everyone,
I noticed that building a code that uses openPMD on my laptop now generates some cmake warnings.

[cmake] CMake Deprecation Warning at build/_deps/openpmd-src/share/openPMD/thirdParty/json/CMakeLists.txt:1 (cmake_minimum_required):
[cmake]   Compatibility with CMake < 3.5 will be removed from a future version of
[cmake]   CMake.
[cmake] 
[cmake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
[cmake]   CMake that the project does not need compatibility with older versions.
[cmake] 
[cmake] 
[cmake] -- Using the single-header code from /Users/davide/Desktop/Workspace/Codes/RadiationSafety/build/_deps/openpmd-src/share/openPMD/thirdParty/json/single_include/
[cmake] -- nlohmann-json: Using INTERNAL version '3.9.1'
[cmake] CMake Deprecation Warning at build/_deps/openpmd-src/share/openPMD/thirdParty/toml11/CMakeLists.txt:1 (cmake_minimum_required):
[cmake]   Compatibility with CMake < 3.5 will be removed from a future version of
[cmake]   CMake.
[cmake] 
[cmake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
[cmake]   CMake that the project does not need compatibility with older versions.
[cmake] 
[cmake] 
[cmake] -- toml11: Using INTERNAL version '3.7.1'
[cmake] CMake Deprecation Warning at build/_deps/openpmd-src/share/openPMD/cmake/FindADIOS.cmake:91 (cmake_minimum_required):
[cmake]   Compatibility with CMake < 3.5 will be removed from a future version of
[cmake]   CMake.
[cmake] 
[cmake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
[cmake]   CMake that the project does not need compatibility with older versions.
[cmake] Call Stack (most recent call first):
[cmake]   build/_deps/openpmd-src/CMakeLists.txt:378 (find_package)

To me they look like problems with the openPMD dependencies.
I only see this on my personal laptop (MacOS with cmake 3.27.1) and not on NERSC Perlmutter with cmake 3.22.0.

Performed steps
The way I link openPMD to my project is using FetchContent, following the documentation

include(FetchContent)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) 
set(openPMD_BUILD_CLI_TOOLS OFF) 
set(openPMD_BUILD_EXAMPLES OFF) 
set(openPMD_BUILD_TESTING OFF) 
set(openPMD_USE_MPI OFF) 
set(openPMD_BUILD_SHARED_LIBS OFF)# precedence over BUILD_SHARED_LIBS if needed
set(openPMD_INSTALL OFF) 
set(openPMD_USE_PYTHON OFF) 
set(openPMD_USE_ADIOS2 OFF) 
set(openPMD_USE_HDF5 ON) 

FetchContent_Declare(
            openPMD
            GIT_REPOSITORY "https://github.com/openPMD/openPMD-api.git"
            GIT_TAG "0.15.1")
FetchContent_MakeAvailable(openPMD)

I was wondering if you're aware of some flags/policies I could set to avoid the warning or if it's something that needs to be changed in the openPMD dependecies.

System environment

  • operating system: MacOS 14.1
  • machine: Apple MacBook Air M1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants