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

Silence warnings when building with CMake 3.27 #717

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

hjmallon
Copy link

  • I've checked this Git style guide. [Yes]
  • I've checked this CMake style guide. [Yes]
  • My change will work with CMake 3.5 (minimum requirement for Hunter). [Yes]
  • I will try to keep this pull request as small as possible and will try not to mix unrelated features. [Yes]

When I use Hunter with CMake 3.27 I see various CMake warnings

CMP0135 warning

CMake Warning (dev) at /usr/local/Cellar/cmake/3.27.7/share/cmake/Modules/ExternalProject.cmake:3136 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.

CMP0114 warning

CMake Warning (dev) at /usr/local/Cellar/cmake/3.27.7/share/cmake/Modules/ExternalProject.cmake:4099 (message):
  Policy CMP0114 is not set to NEW.  In order to support the Xcode "new build
  system", this project must be updated to set policy CMP0114 to NEW.

  Since CMake is generating for the Xcode "new build system",
  ExternalProject_Add will use policy CMP0114's NEW behavior anyway, but the
  generated build system may not match what the project intends.

This change (which requires this PR in HunterGate cpp-pm/gate#16) fixes both of those warnings in Hunter download and in Hunter project builds.

* CMake policy CMP0114 (introduced CMake 3.19) warns if
  ExternalProject is used with Xcode generator and is
  required to use Xcode 'new build system'
* CMake policy CMP0135 (introduced CMake 3.24) warns if
  DOWNLOAD_EXTRACT_TIMESTAMP is not specified in
  ExternalProject.
* TEMP: Also integrate cpp-pm/gate#16
  applying this to HunterGate
@hjmallon hjmallon marked this pull request as ready for review October 30, 2023 09:28
@hjmallon
Copy link
Author

gate rebased after my PR there was merged, this is ready now

@NeroBurner NeroBurner merged commit 8c3a9ba into cpp-pm:master Oct 30, 2023
17 checks passed
@NeroBurner
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants