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

CMake: Use GNUInstallDirs variables instead of hard-coded paths #404

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

topazus
Copy link
Contributor

@topazus topazus commented May 24, 2023

The current CMake practice suggests the variables in GNUInstallDirs to be used for the installation paths. The hard-coded paths should be avoided.

Ref: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
https://cmake.org/cmake/help/latest/command/install.html

CMakeLists.txt Outdated
@@ -78,19 +78,19 @@ enable_language(C) # C needed even for basic platform introspection

# Set install paths ============================================================

set(TILEDARRAY_INSTALL_BINDIR "bin"
set(TILEDARRAY_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}"

Choose a reason for hiding this comment

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

These should come after include(GNUInstallDirs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I moved the set of install paths into the place after include(GNUInstallDirs)

Choose a reason for hiding this comment

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

@evaleev would have to comment on whether TILEDARRAY_INSTALL_XYZ need to be set before include-ing the TA-specific CMake modules.

Copy link
Member

Choose a reason for hiding this comment

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

it appears that currently TILEDARRAY_INSTALL_* vars are not used by files in cmake/modules but were used in the past. So keeping the original location of the definitions of TILEDARRAY_INSTALL_* would be ideal.

Thanks, @topazus !

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.

3 participants