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

Modernize cmake #2713

Open
LecrisUT opened this issue Jun 14, 2023 · 2 comments
Open

Modernize cmake #2713

LecrisUT opened this issue Jun 14, 2023 · 2 comments
Assignees
Milestone

Comments

@LecrisUT
Copy link

The cmake project should be modernized in order to make the project accessible via FetchContent:

  • Namespace the options and targets
  • remove various variables that are available built-in, e.g. detecting the OS
  • Add a NETCDF_INSTALL option with defaults if it's top_level or imported so that install is not called when imported
  • export the variables in netCDFConfig.cmake at the new nd of the cmakelists.txt
  • split the cmake file in subfolders
  • deprecate old options (use if(DEFINED))
  • change flags to be linked to a target, not global
  • move nonessential flags (warnings etc.) to CI preset file
  • use presets for the CI
  • DO NOT set cache variables that can have name overlap with other projects
  • separate into more targets and export them depending on options

Nitpicks:

  • move all options near the top to make the options visible to importers
  • move find_package/fetchcontent near the top as well
  • move autotools definitions to an separate file
  • move macros to a separate file and prefer using function
@K20shores
Copy link
Contributor

@WardF you can assign this to me

@LecrisUT
Copy link
Author

LecrisUT commented Jan 5, 2024

I can help with reviewing. Also I have a cmake-template with many of the points there, feel free to copy anything needed from there.

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

No branches or pull requests

3 participants