From 9d64ca008878bb82e9ace4cacc4108ffc004e7b8 Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Sat, 21 Sep 2019 16:26:18 +0200 Subject: [PATCH] Fix install targets --- CMakeLists.txt | 13 ++++++++----- tools/Makefile.in | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c8bd7e..deb6a3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,12 @@ target_link_libraries(edge n2n) add_executable(supernode sn.c) target_link_libraries(supernode n2n) +install(TARGETS edge supernode + RUNTIME DESTINATION sbin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + # Tools include_directories(.) @@ -91,13 +97,10 @@ find_library(PCAP_LIB pcap) if(PCAP_LIB) add_executable(n2n-decode tools/n2n_decode.c) target_link_libraries(n2n-decode n2n pcap) + install(TARGETS n2n-decode RUNTIME DESTINATION bin) endif() -install(TARGETS edge supernode - RUNTIME DESTINATION sbin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ) +install(TARGETS n2n-benchmark RUNTIME DESTINATION bin) # Documentation if(DEFINED UNIX) diff --git a/tools/Makefile.in b/tools/Makefile.in index 82f3887..bcb3e02 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -7,6 +7,13 @@ INSTALL=install INSTALL_PROG=$(INSTALL) -m755 MKDIR=mkdir -p +PREFIX?=$(DESTDIR)/usr +ifeq ($(OS),Darwin) +SBINDIR=$(PREFIX)/local/sbin +else +SBINDIR=$(PREFIX)/sbin +endif + LIBS_EDGE_OPT=@N2N_LIBS@ LIBS_EDGE+=$(LIBS_EDGE_OPT) HEADERS=../n2n_wire.h ../n2n.h ../twofish.h ../n2n_transforms.h