Skip to content

Commit a47ddbb

Browse files
committed
Add new free function system_library_directory
Signed-off-by: yamacir-kit <httperror@404-notfound.jp>
1 parent 34556a6 commit a47ddbb

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ Then, select one of the following targets and `make` it according to your purpos
102102

103103
| Target | Description
104104
|-------------|-------------
105-
| `all` | Build shared-library `libmeevax.0.5.443.so` and executable `meevax`.
105+
| `all` | Build shared-library `libmeevax.0.5.444.so` and executable `meevax`.
106106
| `install` | Copy files into `/usr/local` directly.
107-
| `package` | Generate debian package `meevax_0.5.443_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.443_amd64.deb`.
107+
| `package` | Generate debian package `meevax_0.5.444_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.444_amd64.deb`.
108108
| `test` | Test executable `meevax`. This target requires Valgrind to be installed.
109109
| `uninstall` | Remove files copied to `/usr/local` directly by target `install`.
110110

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.443
1+
0.5.444

configure/version.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
namespace meevax::inline kernel
2323
{
24-
auto help() noexcept -> std::string_view
25-
{
26-
return R"(${${PROJECT_NAME}_HELP})";
27-
}
28-
2924
auto features() -> object &
3025
{
3126
let static features = list(
@@ -55,6 +50,11 @@ namespace meevax::inline kernel
5550
return features;
5651
}
5752

53+
auto help() noexcept -> std::string_view
54+
{
55+
return R"(${${PROJECT_NAME}_HELP})";
56+
}
57+
5858
auto home_directory() -> std::filesystem::path
5959
{
6060
if (auto home = std::getenv("HOME"))
@@ -71,15 +71,20 @@ namespace meevax::inline kernel
7171
}
7272
}
7373

74+
auto system_library_directory() -> std::filesystem::path
75+
{
76+
return "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}";
77+
}
78+
7479
auto user_library_directory() -> std::filesystem::path
7580
{
7681
if (auto xdg_data_home = std::getenv("XDG_DATA_HOME"))
7782
{
78-
return xdg_data_home;
83+
return std::filesystem::path(xdg_data_home) / "${PROJECT_NAME}";
7984
}
8085
else
8186
{
82-
return home_directory() / ".local/share";
87+
return home_directory() / ".local/share/${PROJECT_NAME}";
8388
}
8489
}
8590

include/meevax/kernel/configurator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace meevax::inline kernel
4545

4646
auto static inline command_line = std::vector<std::string>();
4747

48-
auto static inline directories = std::list<std::filesystem::path> { user_library_directory() };
48+
auto static inline directories = std::list<std::filesystem::path> { user_library_directory(), system_library_directory() };
4949

5050
auto static configure(int const, char const* const* const) -> void;
5151

include/meevax/kernel/version.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424

2525
namespace meevax::inline kernel
2626
{
27-
auto help() noexcept -> std::string_view;
28-
2927
auto features() -> object &;
3028

29+
auto help() noexcept -> std::string_view;
30+
3131
auto home_directory() -> std::filesystem::path;
3232

33+
auto system_library_directory() -> std::filesystem::path;
34+
3335
auto user_library_directory() -> std::filesystem::path;
3436

3537
auto version() -> object const&;

0 commit comments

Comments
 (0)