mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.92k stars 380 forks source link

cmake install not copying tins.dll from windows shared builds #325

Open solvingj opened 5 years ago

solvingj commented 5 years ago

The log shows it's building a shared library:

-- Build will generate a shared library. Use LIBTINS_BUILD_SHARED=0 to perform a static build

Here you can see it does not install the DLL.

         -- Installing: C:/<my_custom_path>/CMake/libtinsConfigVersion.cmake
         -- Installing: C:/<my_custom_path>/CMake/libtinsTargets.cmake
         -- Installing: C:/<my_custom_path>/CMake/libtinsTargets-release.cmake
         -- Installing: C:/<my_custom_path>/lib/tins.lib
         -- Installing: C:/<my_custom_path>/include/tins/address_range.h
         -- Installing: C:/<my_custom_path>/include/tins/arp.h
         -- Installing: C:/<my_custom_path>/include/tins/bootp.h

I believe the problem is that you don't define a RUNTIME destination here: https://github.com/mfontanini/libtins/blob/master/src/CMakeLists.txt#L222

https://cmake.org/cmake/help/v3.13/command/install.html#installing-targets

I have a PR incoming which does fix the issue.

solvingj commented 5 years ago

No, but you are close. The import lib does go to lib dir, but .dll‘s are considered runtime binarys and thus go to bin dir .

walidfaour commented 5 years ago

So what's the problem? You're building with cmake with LIBTINS_SHARED=1 so it should be a a tins.dll file but its not being generated?

No, but you are close. The import lib does go to lib dir, but .dll‘s are considered runtime binarys and thus go to bin dir . So what's the problem? You're building with cmake with LIBTINS_SHARED=1 so it should be a a tins.dll file but its not being generated?

solvingj commented 5 years ago

It’s built, but not installed.