diff --git a/config/Libraries.cmake b/config/Libraries.cmake index cebc153338d9ed1a39cdb4c9e19c6da036b371e5..e04aa3575a34632eb75c929bf4640305cd93e298 100644 --- a/config/Libraries.cmake +++ b/config/Libraries.cmake @@ -17,7 +17,6 @@ set(vkcv_config_msg " - Library: ") include(${vkcv_config_lib}/GLFW.cmake) # glfw-x11 / glfw-wayland # libglfw3-dev include(${vkcv_config_lib}/Vulkan.cmake) # vulkan-intel / vulkan-radeon / nvidia # libvulkan-dev include(${vkcv_config_lib}/SPIRV_Cross.cmake) # SPIRV-Cross # libspirv_cross_c_shared -include(${vkcv_config_lib}/Boost.cmake) # Boost # cleanup of compiler flags if (vkcv_flags) diff --git a/config/lib/Boost.cmake b/config/lib/Boost.cmake deleted file mode 100644 index ab7ef9a8d77ee05968610bd6d64ea317aa0583c3..0000000000000000000000000000000000000000 --- a/config/lib/Boost.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set( BOOST_ROOT "C:/Tools/Boost/" CACHE PATH "Boost library path" ) - -set(Boost_USE_STATIC_LIBS ON) -set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME OFF) - -find_package(Boost REQUIRED COMPONENTS filesystem) - -if (Boost_FOUND) - list(APPEND vkcv_includes ${Boost_INCLUDE_DIR}) - list(APPEND vkcv_libraries ${Boost_LIBRARIES}) - - message(${vkcv_config_msg} " Boost - ") -endif () diff --git a/include/vkcv/Utils.hpp b/include/vkcv/Utils.hpp index 4158a70a661942be167ea630168ebfd47dedf694..6a323bcc53e69d539d1b46ca38a0d98867d7cf10 100644 --- a/include/vkcv/Utils.hpp +++ b/include/vkcv/Utils.hpp @@ -2,12 +2,21 @@ #include <string> namespace utils { + + extern std::string g_binaryDir; /** - * @brief Given a relative path to the executable, the absolute path is returned + * @brief * * @param path The relative path * @return std::string The absolute path */ std::string absolutePath(std::string path); + + /** + * @brief Set the Binary Dir object + * + * @param argv0 + */ + void setBinaryDir(const char* argv0); } diff --git a/projects/first_mesh/src/main.cpp b/projects/first_mesh/src/main.cpp index 3d7d820927a5430b157b0b291ac020ff776b6e60..7f4d6b69cf26c3a5abbbaccd65838711d2f95fff 100644 --- a/projects/first_mesh/src/main.cpp +++ b/projects/first_mesh/src/main.cpp @@ -10,6 +10,8 @@ int main(int argc, const char** argv) { const char* applicationName = "First Mesh"; + utils::setBinaryDir(argv[0]); + uint32_t windowWidth = 800; uint32_t windowHeight = 600; diff --git a/src/vkcv/Utils.cpp b/src/vkcv/Utils.cpp index 301cd1f023155a27137be4efb6b99348ba06b7b8..5a41bff063ee1c1e660e1387886609cefadb3897 100644 --- a/src/vkcv/Utils.cpp +++ b/src/vkcv/Utils.cpp @@ -1,12 +1,19 @@ #include <vkcv/Utils.hpp> -#include <boost/dll.hpp> +#include <filesystem> namespace utils { - + + std::string g_binaryDir; + std::string absolutePath(std::string path) { - boost::filesystem::path root = boost::dll::program_location().parent_path(); - boost::filesystem::path relative(path); - boost::filesystem::path fullpath = root / relative; + std::filesystem::path relative(path); + std::filesystem::path fullpath = g_binaryDir / relative; return fullpath.string(); } + + void setBinaryDir(const char* argv0) { + std::filesystem::path binaryPath(argv0); + std::filesystem::path binaryDir = binaryPath.parent_path(); + utils::g_binaryDir = binaryDir.string(); + } } \ No newline at end of file