thgeorgiou / Serial-TUN

A program to create network connections through serial ports using the TUN driver
MIT License
17 stars 10 forks source link

"cmake ." encounter error #1

Open luckypoem opened 5 years ago

luckypoem commented 5 years ago

hi.

git clone https://github.com/sakisds/Serial-TUN cd Serial-TUN cmake .

it shows: ... CMake Error at CMakeLists.txt:10 (add_executable): Cannot find source file:

/usr/include/libserialport.h

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:10 (add_executable): No SOURCES given to target: serial_tun

CMake Generate step failed. Build files cannot be regenerated correctly. yudeMacBook-Air:Serial-TUN brite$

how to fix it? tks.

thgeorgiou commented 5 years ago

You don't have libserialport available!

luckypoem commented 5 years ago

hello.

as per https://sigrok.org/wiki/Libserialport ,i compiled libserialport:

yudeMacBook-Air:libserialport brite$ sudo make install Password: /usr/local/bin/gmkdir -p '/usr/local/lib' /bin/sh ./libtool --silent --mode=install /usr/local/bin/ginstall -c libserialport.la '/usr/local/lib' /usr/local/bin/gmkdir -p '/usr/local/include' /usr/local/bin/ginstall -c -m 644 libserialport.h '/usr/local/include' /usr/local/bin/gmkdir -p '/usr/local/lib/pkgconfig' /usr/local/bin/ginstall -c -m 644 libserialport.pc '/usr/local/lib/pkgconfig' yudeMacBook-Air:libserialport brite$

but the file libserialport.h is copied to '/usr/local/include',not to /usr/include/ .

yudeMacBook-Air:serial-tun brite$ sudo ln -s /usr/local/include/libserialport.h /usr/include/libserialport.h ln: /usr/include/libserialport.h: Operation not permitted yudeMacBook-Air:serial-tun brite$

what to do about the libserialport.h?

thgeorgiou commented 5 years ago

When you install a library from source, it's good practice to put it in /usr/local instad of /usr, like you did. You will have to change line 9 of CMakeLists.txt to point to /usr/local/include/libserialport.h instead of /usr/include/libserialport.h.