Skip to content

CMake: define target_compile_features with C/C++ standards - #4847

Merged
kbevers merged 1 commit into
OSGeo:masterfrom
mwtoews:cmake-target-compile-features
Sep 8, 2026
Merged

CMake: define target_compile_features with C/C++ standards#4847
kbevers merged 1 commit into
OSGeo:masterfrom
mwtoews:cmake-target-compile-features

Conversation

@mwtoews

@mwtoews mwtoews commented Sep 8, 2026

Copy link
Copy Markdown
Member

This defines the high level meta features for C/C++ support based on their standard, and set using target_compile_features to the main proj target. It is PUBLIC, meaning that the C/C++ standard applies to compile this library, and anything that links to it. The exported target would look like this:

Properties for TARGET PROJ::proj:
  PROJ::proj.LOCATION = "/tmp/proj_shared_install_from_dist/lib/libproj.so.25.9.9.0"
  PROJ::proj.INTERFACE_INCLUDE_DIRECTORIES = "/tmp/proj_shared_install_from_dist/include"
  PROJ::proj.INTERFACE_LINK_LIBRARIES = <NOTFOUND>
  PROJ::proj.INTERFACE_COMPILE_FEATURES = "c_std_99;cxx_std_17"

Also tidy-up some of the messages while setting the CMake standard variables. These never fail, so message(CHECK_FAIL ...) is not needed (the failure, e.g. non-existing standard, happens before in project()).

Background information here.

Xref #1924

@mwtoews
mwtoews marked this pull request as ready for review September 8, 2026 08:27
@kbevers

kbevers commented Sep 8, 2026

Copy link
Copy Markdown
Member

@mwtoews do you want this included in 9.9.0?

@mwtoews

mwtoews commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@kbevers yes, and nothing else queued up.

@kbevers

kbevers commented Sep 8, 2026

Copy link
Copy Markdown
Member

@kbevers yes, and nothing else queued up.

Perfect. It looks good to me so merging and including in release notes

@kbevers
kbevers merged commit be1d371 into OSGeo:master Sep 8, 2026
30 checks passed
@kbevers kbevers added this to the 9.9.0 milestone Sep 8, 2026
@mwtoews
mwtoews deleted the cmake-target-compile-features branch September 8, 2026 09:46
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.

2 participants