File tree 4 files changed +50
-2
lines changed
4 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ set(XCPP_TAGCONFS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/etc/xeus-cpp/tags.d)
33
33
configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /include/xeus-cpp/xeus_cpp_config.hpp.in"
34
34
"${CMAKE_CURRENT_SOURCE_DIR} /include/xeus-cpp/xeus_cpp_config.hpp" )
35
35
36
+ file (COPY "${XCPP_TAGFILES_DIR} " DESTINATION "${CMAKE_CURRENT_BINARY_DIR} /share/xeus-cpp" )
37
+ file (COPY "${XCPP_TAGCONFS_DIR} " DESTINATION "${CMAKE_CURRENT_BINARY_DIR} /etc/xeus-cpp" )
38
+
36
39
# Versionning
37
40
# ===========
38
41
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ namespace xcpp
32
32
33
33
XEUS_CPP_API
34
34
interpreter_ptr build_interpreter (int argc, char ** argv);
35
+
36
+ XEUS_CPP_API
37
+ std::string retrieve_tagconf_dir ();
38
+
39
+ XEUS_CPP_API
40
+ std::string retrieve_tagfile_dir ();
35
41
}
36
42
37
43
#endif
Original file line number Diff line number Diff line change 17
17
18
18
#include " xeus-cpp/xbuffer.hpp"
19
19
#include " xeus-cpp/xpreamble.hpp"
20
+ #include " xeus-cpp/xutils.hpp"
20
21
21
22
#include " xdemangle.hpp"
22
23
#include " xparser.hpp"
@@ -122,8 +123,8 @@ namespace xcpp
122
123
123
124
void inspect (const std::string& code, nl::json& kernel_res)
124
125
{
125
- std::string tagconf_dir = XCPP_TAGCONFS_DIR ;
126
- std::string tagfiles_dir = XCPP_TAGFILES_DIR ;
126
+ std::string tagconf_dir = retrieve_tagconf_dir () ;
127
+ std::string tagfiles_dir = retrieve_tagfile_dir () ;
127
128
128
129
nl::json tagconfs = read_tagconfs (tagconf_dir.c_str ());
129
130
Original file line number Diff line number Diff line change 22
22
#include < unistd.h>
23
23
#endif
24
24
25
+ #include " xeus/xsystem.hpp"
25
26
26
27
#include " xeus-cpp/xutils.hpp"
27
28
#include " xeus-cpp/xinterpreter.hpp"
@@ -95,4 +96,41 @@ namespace xcpp
95
96
return interp_ptr;
96
97
}
97
98
99
+ std::string retrieve_tagconf_dir ()
100
+ {
101
+ const char * tagconf_dir_env = std::getenv (" XCPP_TAGCONFS_DIR" );
102
+ if (tagconf_dir_env != nullptr )
103
+ {
104
+ return tagconf_dir_env;
105
+ }
106
+
107
+ std::string prefix = xeus::prefix_path ();
108
+
109
+ #if defined(_WIN32)
110
+ const char separator = ' \\ ' ;
111
+ #else
112
+ const char separator = ' /' ;
113
+ #endif
114
+
115
+ return prefix + separator + " etc" + separator + " xeus-cpp" + separator + " tags.d" ;
116
+ }
117
+
118
+ std::string retrieve_tagfile_dir ()
119
+ {
120
+ const char * tagfile_dir_env = std::getenv (" XCPP_TAGFILES_DIR" );
121
+ if (tagfile_dir_env != nullptr )
122
+ {
123
+ return tagfile_dir_env;
124
+ }
125
+
126
+ std::string prefix = xeus::prefix_path ();
127
+
128
+ #if defined(_WIN32)
129
+ const char separator = ' \\ ' ;
130
+ #else
131
+ const char separator = ' /' ;
132
+ #endif
133
+
134
+ return prefix + separator + " share" + separator + " xeus-cpp" + separator + " tagfiles" ;
135
+ }
98
136
}
You can’t perform that action at this time.
0 commit comments