File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 36
36
```
37
37
conan install . --output-folder=build --build=missing
38
38
cd build
39
- cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
39
+ cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out
40
40
make -j9
41
41
```
42
42
Original file line number Diff line number Diff line change 1
1
add_executable (radiopi player.cc main.cc)
2
2
target_link_libraries (radiopi PRIVATE ${LIBVLC_LIBRARY} Crow::Crow)
3
3
4
- file (MAKE_DIRECTORY static )
5
- file (COPY static /index.html DESTINATION static )
6
- file (COPY static /index.html DESTINATION ../static )
4
+ install (TARGETS radiopi RUNTIME DESTINATION usr/bin)
5
+ install (FILES static /index.html DESTINATION usr/bin/static )
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ int main(int /*ac*/, char ** /*av*/) {
55
55
CROW_ROUTE (app, " /" )
56
56
([]() {
57
57
crow::response resp;
58
- resp.set_static_file_info (" static/index.html" );
58
+
59
+ // https://stackoverflow.com/a/63229171
60
+ auto index_html_path = std::filesystem::canonical (" /proc/self/exe" ).parent_path () / " static/index.html" ;
61
+ resp.set_static_file_info_unsafe (index_html_path);
59
62
return resp;
60
63
});
61
64
@@ -169,5 +172,5 @@ int main(int /*ac*/, char ** /*av*/) {
169
172
});
170
173
171
174
app.loglevel (crow::LogLevel::Info);
172
- app.port (8000 ).multithreaded ().run ();
175
+ app.port (8001 ).multithreaded ().run ();
173
176
}
You can’t perform that action at this time.
0 commit comments