Skip to content

Commit

Permalink
build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed Jan 20, 2025
1 parent 6435478 commit ef3263e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ mkdir build
cd build
# (vs 2022)
cmake -DCMAKE_TOOLCHAIN_FILE=D:\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 17 2022" -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows ..
# or, example: ninja in separate build dir!
cmake -DCMAKE_TOOLCHAIN_FILE=C:\Users\dmt\source\repos\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows C:\Users\dmt\source\repos\allen-cell-animated\agave
cmake --build .
```

Expand Down
1 change: 0 additions & 1 deletion renderlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ target_link_libraries(renderlib

IF(WIN32)
target_link_libraries(renderlib glm::glm)
target_link_libraries(renderlib comsuppw.lib optimized comsuppw.lib debug comsuppwd.lib)
ENDIF(WIN32)
11 changes: 9 additions & 2 deletions renderlib/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>

#include <codecvt>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <locale>
#include <ostream>
#if defined(__APPLE__) || defined(__linux__)
#include <pwd.h>
#include <unistd.h>
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) // WIN32
#include <ShlObj.h>
#include <comutil.h>
#endif

// the logs are written to LOGFILE
Expand All @@ -34,10 +35,16 @@ getLogPath()
PWSTR path = nullptr;
HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &path);
if (SUCCEEDED(hr)) {
char* rootdir = _com_util::ConvertBSTRToString(path);
// Create a wstring_convert object with the appropriate codecvt facet
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;

// Convert the wide string to a string
std::string rootdir = converter.to_bytes(path);

CoTaskMemFree(path);
return std::filesystem::path(rootdir) / "AllenInstitute" / "agave";
} else {
CoTaskMemFree(path);
std::cout << "Failed to get local app data directory." << std::endl;
std::cout << "Falling back to user home directory." << std::endl;
// use user home directory instead
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ target_sources(agave_test PRIVATE

target_link_libraries(agave_test PRIVATE
renderlib
Qt::Widgets Qt::Core Qt::Gui Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::WebSockets Qt::Xml
Qt6::Core Qt6::Gui
Catch2WithMain
)

Expand Down

0 comments on commit ef3263e

Please sign in to comment.