diff --git a/CMakeLists.txt b/CMakeLists.txt index 10efa13..7c0f546 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,5 +18,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the build type" FORCE) endif() -install(TARGETS ReArchive DESTINATION /usr/lib) -install(TARGETS rsarchive DESTINATION /usr/bin) \ No newline at end of file +include(GNUInstallDirs) +set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install path prefix" FORCE) +install(TARGETS ReArchive DESTINATION ${CMAKE_INSTALL_LIBDIR}) +install(TARGETS rsarchive DESTINATION ${CMAKE_INSTALL_BINDIR}) \ No newline at end of file diff --git a/src/ReArchive.cpp b/src/ReArchive.cpp index e1326e9..e414975 100644 --- a/src/ReArchive.cpp +++ b/src/ReArchive.cpp @@ -216,7 +216,7 @@ bool ReArchive::OverwriteFile(const std::filesystem::path& archive, const std::f file_table = current_file_table; const FileEntry* target = nullptr; - auto file_entries = file_table.GetEntries(); + auto file_entries = file_table->GetEntries(); auto value = file_entries->find(file_path); if (value != file_entries->end())