toml11 icon indicating copy to clipboard operation
toml11 copied to clipboard

Hard to use in vcpkg

Open ncihnegn opened this issue 4 years ago • 3 comments

vcpkg_fixup_cmake_targets(CONFIG_PATH share/toml11) is not enough. toml11config.cmake still looks for lib/cmake/toml11. Perhaps we can avoid hard-coded paths in CMakeLists.txt.

ncihnegn avatar Mar 29 '20 05:03 ncihnegn

Unfortunately, I don't have any experience or knowledge in vcpkg. Therefore I have no idea about the usage of it in your situation. So I want to ask for more details about the problem.

I thought that vcpkg is for Windows only, but I just found out that it works also for linux and OS X. Since I have just installed it on VM, I can reproduce your problem if you provide the way to do that.

Perhaps we can avoid hard-coded paths in CMakeLists.txt.

Do you have any idea about which one should be changed?

FYI, the location where toml11 will be installed can be changed via CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_PREFIX.

ToruNiina avatar Mar 29 '20 14:03 ToruNiina

I will take a shot at this. I was thinking of a github action to test vcpkg integration, but it seems out of the scope for this project.

ncihnegn avatar Mar 30 '20 04:03 ncihnegn

The problem is: https://github.com/ToruNiina/toml11/blob/fda0a2b9abd16e356f777c40a675131821c71b00/cmake/toml11Config.cmake.in#L2 It should just state include("${CMAKE_CURRENT_LIST_DIR}/toml11Targets.cmake") since targets and configs should reside in the same directory.

Neumann-A avatar Sep 11 '21 22:09 Neumann-A