Skip to content

CMake: use system include dirs if used as sub-project#85

Open
stertingen wants to merge 1 commit intobfgroup:developfrom
stertingen:cmake-system-includes
Open

CMake: use system include dirs if used as sub-project#85
stertingen wants to merge 1 commit intobfgroup:developfrom
stertingen:cmake-system-includes

Conversation

@stertingen
Copy link
Copy Markdown
Contributor

The code should not emit warnings if used as sub-project.
This PR adds CMake logic to detect if Lyra was added using add_subdirectory and declares the include directories as SYSTEM includes.

@jayeshbadwaik
Copy link
Copy Markdown

jayeshbadwaik commented Feb 28, 2025

@stertingen Are you using CMake > 3.25, because since CMake 3.25, add_subdirectory provides an option to add SYSTEM which seems a much more robust way of doing things:

  1. It will annotate all usages with SYSTEM therefore preventing bugs where maintainer forgets to annotate something.
  2. It allows user to decide if they want the add_subdirectory as SYSTEM or not and does not force the decision.

If that solution is working for you, then we don't need this in lyra.

@grafikrobot grafikrobot moved this to 🆕 New in BFG Tasks Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants