Open zmb3 opened 9 years ago
I've never used the package file generated by CMake so I never came across this issues. But I guess it makes sense not to use hardcoded paths. If you find a way around that, I'll appreciate it :D.
BTW: I think you probably saw it, but it seems like travis.ci build for OSX failed when using CONFIGURE_PACKAGE_CONFIG_FILE
on the PR you created yesterday.
Yes, I have a few fixes to make to the PR. I'm not sure exactly how to fix the hardcoded paths in the targets file. Was hoping you knew more CMake than I do :)
Oh no, I just know enough CMake to be able to do some simple stuff.
The installed package for libtins is not relocatable (it contains a bunch of absolute paths valid only on the machine in which is was built).
There are several sub-issues here:
CONFIGURE_PACKAGE_CONFIG_FILE()
should be used instead ofCONFIGURE_FILE()
(see https://github.com/mfontanini/libtins/pull/100)dependencies like libpcap.
I'm working on a PR for 1 (not quite there yet). This will remove hard coded paths from libtinsConfig.cmake.
For 2, I believe libtins needs to IMPORT pcap instead of doing
target_link_libraries
. See http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages.I can't quite figure out how to fix this. I believe instead of
target_link_libraries(tgt PCAP)
there should be afind_dependency(PCAP)
in libtinsConfig.cmake.I think 3 should be resolved with the same type of solution as 1.