diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt index 916c89483..a6058538f 100644 --- a/test/common/CMakeLists.txt +++ b/test/common/CMakeLists.txt @@ -40,7 +40,8 @@ target_include_directories ( PUBLIC include PRIVATE src ) +target_compile_definitions(vsomeip_utilities PUBLIC SOURCE_DIR="${CMAKE_SOURCE_DIR}") if (MSVC) set_target_properties(vsomeip_utilities PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) -endif () +endif() diff --git a/test/common/src/utility.cpp b/test/common/src/utility.cpp index cdf6db8a9..d28fccc40 100644 --- a/test/common/src/utility.cpp +++ b/test/common/src/utility.cpp @@ -95,10 +95,9 @@ utility::get_all_files_in_dir(const std::string &_dir_path, std::string utility::get_policies_path() { - - return boost::filesystem::canonical( - boost::filesystem::current_path()).string() - + "/../test/common/examples_policies"; + std::string source_dir = SOURCE_DIR; + boost::filesystem::path policies_path(source_dir+"/test/common/examples_policies"); + return policies_path.string(); } vsomeip_sec_client_t