seemoo-lab / owl

An open Apple Wireless Direct Link (AWDL) implementation written in C

Home Page:https://owlink.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nix: Install fails to find pcap

jackmac92 opened this issue · comments

I've installed the deps from the README but I'm still having some issues related to libpcap-dev.

How could I specify an include path to help cmake find it?

❯ cmake ..
CMake Error at daemon/CMakeLists.txt:19 (find_path):
  Could not find pcap_INCLUDE using the following files: pcap.h


-- Configuring incomplete, errors occurred!
See also "/tmp/tmp.4uTXHt7Ecd/owl/CMakeFiles/CMakeOutput.log".
❯ whereis pcap
pcap: /usr/include/pcap.h /usr/include/pcap /usr/share/man/man3/pcap.3pcap.gz

That's curious as /usr/include should be a CMake default search path. What OS/CMake version are your running?
In any case, you can try to add the path explicitly by changing:

find_path(pcap_INCLUDE pcap.h REQUIRED)

to

find_path(pcap_INCLUDE pcap.h PATHS /usr/include REQUIRED)

Hmm must be because my cmake is installed via nix/home-manager. After ensuring that I use a cmake from apt-get I the build works!

I did try adding PATHS errored on pcap_LIBRARY

CMake Error at daemon/CMakeLists.txt:20 (find_library):
  Could not find pcap_LIBRARY using the following names: pcap

(edit to fix code fence)

If you get that error message now means that CMake was able to find the PCAP include directory. But failed on the next line, possibly again due to a missing search path:

find_library(pcap_LIBRARY pcap REQUIRED)

I don't know why Nix behaves this way, if you find a solution, let me know.