diff --git a/CMakeLists.txt b/CMakeLists.txt index 6018ce35..a538d98b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,12 +147,9 @@ if (REFLECTCPP_TOML) src/reflectcpp_toml.cpp ) if(REFLECTCPP_USE_VCPKG) - target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") - if (MSVC) - target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/tomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}") - else () - target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libtomlplusplus${CMAKE_STATIC_LIBRARY_SUFFIX}") - endif () + find_package(PkgConfig REQUIRED) + pkg_check_modules(tomlplusplus REQUIRED IMPORTED_TARGET tomlplusplus) + target_link_libraries(reflectcpp PkgConfig::tomlplusplus) else() find_package(tomlplusplus) target_link_libraries(reflectcpp PUBLIC tomlplusplus::tomlplusplus) diff --git a/tests/toml/CMakeLists.txt b/tests/toml/CMakeLists.txt index 1e138f47..ddf21e26 100644 --- a/tests/toml/CMakeLists.txt +++ b/tests/toml/CMakeLists.txt @@ -8,8 +8,6 @@ add_executable( ) target_precompile_headers(reflect-cpp-toml-tests PRIVATE [["rfl.hpp"]] ) -target_include_directories(reflect-cpp-toml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") - target_link_libraries( reflect-cpp-toml-tests PRIVATE