Skip to content

Comments

[Cpp] CMake: use variables for specifying install paths consistently#4109

Merged
parrt merged 2 commits intoantlr:devfrom
jmairboeck:fix-install-dirs
Sep 2, 2025
Merged

[Cpp] CMake: use variables for specifying install paths consistently#4109
parrt merged 2 commits intoantlr:devfrom
jmairboeck:fix-install-dirs

Conversation

@jmairboeck
Copy link
Contributor

This allows overriding them if needed when the system uses different paths than usual (e.g. Haiku, which uses "develop/headers" for includes instead of "include").

Signed-off-by: Joachim Mairböck j.mairboeck@gmail.com

if(EXISTS LICENSE.txt)
install(FILES LICENSE.txt
DESTINATION "share/doc/libantlr4")
DESTINATION ${CMAKE_INSTALL_DOCDIR})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this use an ANTLR-specific sub-directory? 🤔

Copy link
Contributor Author

@jmairboeck jmairboeck Feb 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMAKE_INSTALL_DOCDIR contains a project specific sub-directory by default, see https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#result-variables. It defaults to DATAROOTDIR/doc/PROJECT_NAME.

Edit: Maybe the project name should be changed to lower-case so that this matches the old value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. Didn't know that.

I wonder whether changing the casing of the project name has other side effects though 🤔

This allows overriding them if needed when the system uses different paths than
usual (e.g. Haiku, which uses "develop/headers" for includes instead of
"include").

Use the standard variable ${CMAKE_INSTALL_INCLUDEDIR} as the base path for the
include directory.

Signed-off-by: Joachim Mairböck <j.mairboeck@gmail.com>
…TALL_DOCDIR available

Signed-off-by: Joachim Mairböck <j.mairboeck@gmail.com>
@jmairboeck
Copy link
Contributor Author

I rebased this on top of the changes from #4661.

@hzeller
Copy link
Contributor

hzeller commented Sep 2, 2025

@parrt this is sitting here for a while, should it be merged ?

@parrt parrt merged commit bd8f993 into antlr:dev Sep 2, 2025
@parrt
Copy link
Member

parrt commented Sep 2, 2025

I closed my eyes and hit merge :)

@jmairboeck jmairboeck deleted the fix-install-dirs branch September 3, 2025 06:59
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.

4 participants