diff --git a/CMakeLists.txt b/CMakeLists.txt index 24e3438..00c65f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ set(GGWAVE_VERSION_PYTHON 0.2.1) set(CMAKE_EXPORT_COMPILE_COMMANDS "on") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(GGWAVE_STANDALONE ON) @@ -97,3 +98,17 @@ endif() if (GGWAVE_BUILD_EXAMPLES) add_subdirectory(examples) endif() + +install(TARGETS ggwave RUNTIME) +install(TARGETS ggwave-common RUNTIME) +install(TARGETS ggsock RUNTIME) + +if (GGWAVE_SUPPORT_SDL2) + install(TARGETS ggwave-common-sdl2 RUNTIME) + install(TARGETS imgui RUNTIME) + install(TARGETS imgui-sdl2 RUNTIME) + install(TARGETS waver RUNTIME) + + install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/DroidSans.ttf DESTINATION bin) + install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/fontawesome-webfont.ttf DESTINATION bin) +endif() diff --git a/examples/waver/CMakeLists.txt b/examples/waver/CMakeLists.txt index 68eb365..e01cdbc 100644 --- a/examples/waver/CMakeLists.txt +++ b/examples/waver/CMakeLists.txt @@ -43,8 +43,4 @@ else() imgui-sdl2 ${CMAKE_THREAD_LIBS_INIT} ) - - install(TARGETS ${TARGET} RUNTIME DESTINATION bin) - install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/DroidSans.ttf DESTINATION bin) - install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/fontawesome-webfont.ttf DESTINATION bin) endif() diff --git a/examples/waver/README.md b/examples/waver/README.md index 1cc5537..4a32e80 100644 --- a/examples/waver/README.md +++ b/examples/waver/README.md @@ -20,7 +20,7 @@ The main purpose of this app is to showcase the capabilities of the [ggwave](htt sudo snap install waver sudo snap connect waver:audio-record :audio-record ``` - + #### Mac OS ```bash diff --git a/examples/waver/main.cpp b/examples/waver/main.cpp index 2af3470..b946895 100644 --- a/examples/waver/main.cpp +++ b/examples/waver/main.cpp @@ -23,10 +23,13 @@ const float kGlobalImGuiScale = 1.25f; // ImGui helpers bool ImGui_tryLoadFont(const std::string & filename, float size = 14.0f, bool merge = false) { + printf("Trying to load font from '%s' ..\n", filename.c_str()); std::ifstream f(filename); if (f.good() == false) { + printf(" - failed\n"); return false; } + printf(" - success\n"); if (merge) { // todo : ugly static !!! static ImWchar ranges[] = { 0xf000, 0xf3ff, 0 }; @@ -227,10 +230,12 @@ int main(int argc, char** argv) { ImGui::GetIO().IniFilename = nullptr; ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false); + ImGui_tryLoadFont(getBinaryPath() + "../bin/DroidSans.ttf", kGlobalImGuiScale*14.0f, false); ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false); ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false); ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true); + ImGui_tryLoadFont(getBinaryPath() + "../bin/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true); ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true); ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);