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

move setting of default CMAKE_INSTALL_{BIN,INCLUDE,LIB}DIR before first use #979

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

h-vetinari
Copy link
Contributor

@h-vetinari h-vetinari commented Feb 20, 2024

One of the things I had misdiagnosed in #876 was how I was getting lib64 and other such things into the build, when nothing should have been setting them like that.

Now after rebasing the patches to 0.2.0, I realize that this is simply due to the fact that the default values (in case the various CMAKE_INSTALL_* quantities are not explicitly overriden) are defined after their first use further up in CMakeLists.txt:

if (UNIX)
include(GNUInstallDirs)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
else()

Fix this by moving the setting of the default values up before they're first used.

Also rename CMAKE_INSTALL_INCDIR -> CMAKE_INSTALL_INCLUDEDIR, which corresponds to the GNUInstallDirs default that CMake itself documents.

@taku910 taku910 merged commit 1d91514 into google:master Feb 21, 2024
24 checks passed
@h-vetinari h-vetinari deleted the libdir branch February 21, 2024 05:36
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