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

Improve ExternalProject cmake file #3697

Merged
merged 2 commits into from
May 7, 2022

Conversation

Krzmbrzl
Copy link
Contributor

@Krzmbrzl Krzmbrzl commented May 6, 2022

Two small improvements to the CMake file used to setup the cpp runtime
as an externa project in cmake.

The first commit just silences a warning in newer cmake versions, whereas the latter
ensures that a user does not have to take care of setting up the correct include directories
themselves. Linking to either antl4_static or antlr4_shared will now automatically
populate the include directories of the target these are linked to.

Signed-off-by: Robert Adam <dev@robert-adam.de>
@Krzmbrzl
Copy link
Contributor Author

Krzmbrzl commented May 6, 2022

Ah whoops - on a fresh run, this will now error because the include dir does not exist yet during configure time.

See also https://stackoverflow.com/questions/45516209/cmake-how-to-use-interface-include-directories-with-externalproject

I'll fix this and force-push the last commit to include the fix.

@Krzmbrzl Krzmbrzl force-pushed the improve-external-project-cmake-file branch from 0e14115 to 0a2e02b Compare May 6, 2022 09:43
By directly associating the defined antlr_* targets with the respective
include directories, we make sure that any user that links against one
of these targets, automatically has the necessary directories in their
include path as well (without the need to explicitly specify them) as
cmake will transitively propagate the interface include dirs to the
linked-to target.

Signed-off-by: Robert Adam <dev@robert-adam.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants