libpcap icon indicating copy to clipboard operation
libpcap copied to clipboard

CMake configuration with BUILD_SHARED_LIBS=OFF creates a malformed pkg-config file

Open traversaro opened this issue 5 years ago • 3 comments

In particular, the libpcap.pc contains the following malformed line:

Libs: -L${libdir} -l

To reproduce the issue:

git clone https://github.com/the-tcpdump-group/libpcap
cd libpcap
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS:BOOL=OFF ..
cat libpcap.pc

traversaro avatar May 08 '20 13:05 traversaro

The problem seems to be due to https://github.com/the-tcpdump-group/libpcap/blob/libpcap-1.9.1/CMakeLists.txt#L2309 .

traversaro avatar May 08 '20 13:05 traversaro

Not Linux-specific - I reproduced it on macOS.

guyharris avatar May 08 '20 17:05 guyharris

Removing the unset() gives

CMake Error at CMakeLists.txt:2608 (install):
  install TARGETS given target "pcap" which does not exist in this directory.

so more work is needed.

guyharris avatar May 08 '20 17:05 guyharris

Doesn't seem to happen on 1.10.

guyharris avatar Sep 28 '22 03:09 guyharris

Duplicate of #1009

guyharris avatar Sep 28 '22 04:09 guyharris