Repository navigation
feat: use CMake's GNUInstallDir #518
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
Open
wdconinc
wants to merge
6
commits into
JeffersonLab:master
Choose a base branch
from
wdconinc:gnu-install-dirs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
11b8d03
feat: use CMake's GnuInstallDir
wdconinc 6d2b413
fix: use correct include directive for GNUInstallDirs
wdconinc 0bdfcbd
fix: include GNUInstallDirs in modules installed for users
wdconinc 11af52f
fix: INSTALL_RPATH also needs to use GNU install dirs
wdconinc 43b80f4
fix: replace JANA_INSTALL_DIR/lib with CMAKE_INSTALL_LIBDIR etc.
wdconinc b84db9a
fix: include GNUInstallDirs in each generated CMakeLists for standalo…
wdconinc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,6 +327,8 @@ class {name} : public JEventSource {{ | |
| cmake_minimum_required(VERSION 3.9) | ||
| project({name}_project) | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| if(NOT "${{CMAKE_CXX_STANDARD}}") | ||
| set(CMAKE_CXX_STANDARD 17) | ||
| endif() | ||
|
|
@@ -354,6 +356,8 @@ class {name} : public JEventSource {{ | |
| plugin_cmakelists_txt = """ | ||
| {extra_find_packages} | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| # According to the internet, CMake authors discourage the use | ||
| # of GLOB for identifying source files. IMHO, this is due to | ||
| # the flawed use of cache files in CMake itself. Here, GLOB | ||
|
|
@@ -384,7 +388,7 @@ class {name} : public JEventSource {{ | |
| install(TARGETS {name}_plugin DESTINATION plugins) | ||
|
|
||
| file(GLOB my_headers "*.h*") | ||
| install(FILES ${{my_headers}} DESTINATION include/{name}) | ||
| install(FILES ${{my_headers}} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/{name}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if |
||
|
|
||
| # For root dictionaries | ||
| file(GLOB my_pcms "${{CMAKE_CURRENT_BINARY_DIR}}/*.pcm") | ||
|
|
@@ -396,6 +400,8 @@ class {name} : public JEventSource {{ | |
| mini_plugin_cmakelists_txt = """ | ||
| {extra_find_packages} | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| # According to the internet, CMake authors discourage the use | ||
| # of GLOB for identifying source files. IMHO, this is due to | ||
| # the flawed use of cache files in CMake itself. Here, GLOB | ||
|
|
@@ -424,7 +430,7 @@ class {name} : public JEventSource {{ | |
| install(TARGETS {name}_plugin DESTINATION plugins) | ||
|
|
||
| file(GLOB my_headers "*.h*") | ||
| install(FILES ${{my_headers}} DESTINATION include/{name}) | ||
| install(FILES ${{my_headers}} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/{name}) | ||
|
|
||
| # For root dictionaries | ||
| file(GLOB my_pcms "${{CMAKE_CURRENT_BINARY_DIR}}/*.pcm") | ||
|
|
@@ -435,6 +441,8 @@ class {name} : public JEventSource {{ | |
|
|
||
| plugin_tests_cmakelists_txt = """ | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| set ({name}_PLUGIN_TESTS_SOURCES | ||
| catch.hpp | ||
| TestsMain.cc | ||
|
|
@@ -452,7 +460,7 @@ class {name} : public JEventSource {{ | |
| target_link_libraries({name}_plugin_tests {name}_plugin) | ||
| target_link_libraries({name}_plugin_tests ${{JANA_LIBRARY}}) | ||
|
|
||
| install(TARGETS {name}_plugin_tests DESTINATION bin) | ||
| install(TARGETS {name}_plugin_tests DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
|
||
| """ | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.