-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make package relocatable (fixes #101) #107
base: master
Are you sure you want to change the base?
Conversation
Use CONFIGURE_PACKAGE_CONFIG_FILE instead of CONFIGURE_FILE. This avoids hard-coded paths in the generated config file, resulting in a package that is relocatable. See http://www.cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html
When checking for x64 Windows, check OS first, then check for 64-bit. This resolves an issue with some cross compiler toolchains that don't play nice with SMAKE_SIZEOF_VOID_P.
Remove @only (not applicable for CONFIGURE_PACKAGE_CONFIG_FILE) and add PUBLIC keyword to link libraries.
Update the project to use libpcap as an imported target. This eliminates a hard coded path to libpcap, which is a problem when cross compiling.
Use pkg-config's 'pcfiledir' variable to specify paths in the generated libtins.pc file. This allows us to specify paths relative to the .pc file instead of absolute paths - resulting in a .pc file that is fully relocatable.
Looks like the Linux builds fail because we need CMake >= 2.8.8 for I can update |
CMakePackageConfigHelpers was introduced in CMake 2.8.8 (April 2012).
AFAIK travis doesn't provide an easy way to have a newer CMake. But you should be able to download the CMake linux package from cmake.org, install it to a local prefix and adjust the PATH environment variable. |
I just found this. Trusty has cmake There are issues with this PR though, as in, the Windows build failing because some libpcap variable is not set properly. |
I just got this all up and running on a Windows box with VS 2015 community and CMake 3.5.2 and everything built and linked to PCAP just fine.
I see the appveyor.yml should be building for VS 2013 and 2015, but it I look at the failed builds I only see them running with VS 2013. Is anyone able to reproduce these PCAP errors on Windows? |
I re-triggered the build yesterday and apparently it's happening on both vs2013 and 2015. At the time you made the initial PR, it was only building on vs2013 on appveyor. |
These changes remove absolute paths from the package files installed by CMake.