Skip to content

build: fix location of installed c++ headers#4925

Open
pstieber wants to merge 1 commit into
antlr:devfrom
pstieber:fix-cpp-include-install-location
Open

build: fix location of installed c++ headers#4925
pstieber wants to merge 1 commit into
antlr:devfrom
pstieber:fix-cpp-include-install-location

Conversation

@pstieber
Copy link
Copy Markdown

@pstieber pstieber commented Mar 7, 2026

Prior to this fix, include files would be installed in the wrong location. For example, if the install prefix was /usr/local, the headers would be installed in /usr/local/antlr4-runtime instead of /usr/local/include/antlr4-runtime.

This resolves issue #4924

Prior to this fix, include files would be installed in the wrong
location.  For example, if the install prefix was /usr/local, the
headers would be installed in /usr/local/antlr4-runtime instead of
/usr/local/include/antlr4-runtime.

Signed-off-by: Peter J. Stieber <pstieber@gmail.com>
endif()

set(libantlrcpp_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/antlr4-runtime")
set(libantlrcpp_INCLUDE_INSTALL_DIR "include/antlr4-runtime")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This fix is wrong. There are systems which don't use "include" as the include path, e.g. Haiku, which uses "develop/headers". I think the correct fix would be to move the include(GNUInstallDirs) in the parent CMakeLists.txt further up before this subdirectory is added. I missed this apparently in #4109. Sorry for that.

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