diff --git a/apps/openmw_test_suite/CMakeLists.txt b/apps/openmw_test_suite/CMakeLists.txt index 34892905c1..7af6520f35 100644 --- a/apps/openmw_test_suite/CMakeLists.txt +++ b/apps/openmw_test_suite/CMakeLists.txt @@ -115,7 +115,7 @@ file(DOWNLOAD target_compile_definitions(openmw_test_suite PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data" - OPENMW_TEST_SUITE_SOURCE_DIR=u8"${CMAKE_CURRENT_SOURCE_DIR}") + OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}") if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC) target_precompile_headers(openmw_test_suite PRIVATE diff --git a/apps/openmw_test_suite/toutf8/toutf8.cpp b/apps/openmw_test_suite/toutf8/toutf8.cpp index 202c0e4890..f189294cf2 100644 --- a/apps/openmw_test_suite/toutf8/toutf8.cpp +++ b/apps/openmw_test_suite/toutf8/toutf8.cpp @@ -6,8 +6,8 @@ #include #include -#ifndef OPENMW_TEST_SUITE_SOURCE_DIR -#define OPENMW_TEST_SUITE_SOURCE_DIR "" +#ifndef OPENMW_PROJECT_SOURCE_DIR +#define OPENMW_PROJECT_SOURCE_DIR "." #endif namespace @@ -26,7 +26,7 @@ namespace { std::ifstream file; file.exceptions(std::ios::failbit | std::ios::badbit); - file.open(std::filesystem::path{ OPENMW_TEST_SUITE_SOURCE_DIR } / "toutf8" / "data" + file.open(std::filesystem::path{ OPENMW_PROJECT_SOURCE_DIR } / "apps" / "openmw_test_suite" / "toutf8" / "data" / Misc::StringUtils::stringToU8String(fileName)); std::stringstream buffer; buffer << file.rdbuf();