"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "CMakeLists.txt" between
n2n-3.0.tar.gz and n2n-3.1.1.tar.gz

About: n2n is a layer-two peer-to-peer virtual private network (VPN) which allows bypassing intermediate firewalls.
Pre-release.

CMakeLists.txt  (n2n-3.0):CMakeLists.txt  (n2n-3.1.1)
project(n2n) project(n2n)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
include(CheckFunctionExists) include(CheckFunctionExists)
SET(CMAKE_VERBOSE_MAKEFILE ON) SET(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# N2n release information # N2n release information
set(N2N_VERSION "3.0.0")
set(N2N_OSNAME ${CMAKE_SYSTEM_NAME})
execute_process( execute_process(
COMMAND git status COMMAND scripts/version.sh
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_OUTPUT OUTPUT_VARIABLE PACKAGE_VERSION
RESULT_VARIABLE GIT_ERROR_CODE RESULT_VARIABLE GIT_ERROR_CODE
) )
if (GIT_ERROR_CODE EQUAL 0) if (NOT GIT_ERROR_CODE EQUAL 0)
execute_process( # - if we can run version.sh and it exits with an error that is signaling
COMMAND git rev-list --count HEAD # a build failure.
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} # - if we are on windows with no MSYS or Cygwin, we cannot run version.sh
OUTPUT_VARIABLE GIT_REV # which is the fallback case handled below
) # TODO: Distinguish between these two cases
execute_process(
COMMAND git rev-parse --short HEAD # Fallback to just using the non dynamic short version string
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} file(STRINGS VERSION PACKAGE_VERSION)
OUTPUT_VARIABLE GIT_ID endif (NOT GIT_ERROR_CODE EQUAL 0)
)
string(REGEX REPLACE "\n$" "" GIT_REV "${GIT_REV}") string(STRIP "${PACKAGE_VERSION}" PACKAGE_VERSION)
string(REGEX REPLACE "\n$" "" GIT_ID "${GIT_ID}") MESSAGE(STATUS "Build for version: ${PACKAGE_VERSION}")
set(N2N_VERSION "${N2N_VERSION}.r${GIT_REV}.${GIT_ID}")
MESSAGE(STATUS "Build from git rev: ${N2N_VERSION}")
endif (GIT_ERROR_CODE EQUAL 0)
add_definitions(-DCMAKE_BUILD) add_definitions(-DCMAKE_BUILD)
add_definitions(-DGIT_RELEASE="${N2N_VERSION}" -DPACKAGE_VERSION="${N2N_VERSION} add_definitions(-DPACKAGE_OSNAME="${CMAKE_SYSTEM_NAME}")
" -DPACKAGE_OSNAME="${N2N_OSNAME}") add_definitions(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
add_definitions(-DN2N_VERSION="${N2N_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}")
# third-party directory
set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/thirdparty)
# Build information # Build information
OPTION(BUILD_SHARED_LIBS "BUILD Shared Library" OFF) OPTION(BUILD_SHARED_LIBS "BUILD Shared Library" OFF)
# N2n specific params # N2n specific params
OPTION(N2N_OPTION_USE_PTHREAD "USE PTHREAD Library" ON) OPTION(N2N_OPTION_USE_PTHREAD "USE PTHREAD Library" OFF)
OPTION(N2N_OPTION_USE_OPENSSL "USE OPENSSL Library" OFF) OPTION(N2N_OPTION_USE_OPENSSL "USE OPENSSL Library" OFF)
OPTION(N2N_OPTION_USE_CAPLIB "USE CAP Library" OFF)
OPTION(N2N_OPTION_USE_PCAPLIB "USE PCAP Library" OFF) OPTION(N2N_OPTION_USE_PCAPLIB "USE PCAP Library" OFF)
OPTION(N2N_OPTION_USE_ZSTD "USE ZSTD Library" OFF) OPTION(N2N_OPTION_USE_ZSTD "USE ZSTD Library" OFF)
OPTION(N2N_OPTION_USE_PORTMAPPING "USE MINIUPNP and NATPMP Libraries" OFF)
if(N2N_OPTION_USE_PTHREAD) if(N2N_OPTION_USE_PTHREAD)
find_library(PTHREAD_LIB pthread) find_library(PTHREAD_LIB pthread)
if(PTHREAD_LIB) if(NOT PTHREAD_LIB)
ADD_DEFINITIONS("-DHAVE_PTHREAD") MESSAGE(FATAL_ERROR "libpthread not found.")
else() endif(NOT PTHREAD_LIB)
MESSAGE(WARNING "libpthread not found.") MESSAGE(STATUS "Using libpthread.")
set(N2N_OPTION_USE_PTHREAD OFF) ADD_DEFINITIONS("-DHAVE_PTHREAD")
endif(PTHREAD_LIB)
endif(N2N_OPTION_USE_PTHREAD) endif(N2N_OPTION_USE_PTHREAD)
if(NOT DEFINED N2N_OPTION_USE_OPENSSL)
set(N2N_OPTION_USE_OPENSSL OFF)
endif(NOT DEFINED N2N_OPTION_USE_OPENSSL)
if(N2N_OPTION_USE_OPENSSL) if(N2N_OPTION_USE_OPENSSL)
find_package(OpenSSL QUIET) find_package(OpenSSL QUIET)
if(NOT OPENSSL_FOUND) if(NOT OPENSSL_FOUND)
MESSAGE(WARNING "OpenSSL not found, Use built-in AES.") MESSAGE(FATAL_ERROR "OpenSSL not found.")
set(N2N_OPTION_USE_OPENSSL OFF)
else()
MESSAGE(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
string(COMPARE GREATER "${OPENSSL_VERSION}" "1.1" OPENSSL_V11)
if(OPENSSL_V11)
MESSAGE(STATUS "Use OpenSSL With -DHAVE_OPENSSL_1_1")
include_directories(${OPENSSL_INCLUDE_DIR})
add_definitions(-DHAVE_OPENSSL_1_1)
endif()
endif(NOT OPENSSL_FOUND) endif(NOT OPENSSL_FOUND)
MESSAGE(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
string(COMPARE GREATER "${OPENSSL_VERSION}" "1.1" OPENSSL_V11)
if(NOT OPENSSL_V11)
MESSAGE(FATAL_ERROR "OpenSSL too old")
endif()
include_directories(${OPENSSL_INCLUDE_DIR})
add_definitions(-DHAVE_OPENSSL_1_1)
endif(N2N_OPTION_USE_OPENSSL) endif(N2N_OPTION_USE_OPENSSL)
if(N2N_OPTION_USE_ZSTD) if(N2N_OPTION_USE_ZSTD)
add_definitions(-DN2N_HAVE_ZSTD) find_library(LIBZSTD zstd)
if(NOT LIBZSTD)
MESSAGE(FATAL_ERROR "libzstd not found.")
endif(NOT LIBZSTD)
MESSAGE(STATUS "Using libztd.")
add_definitions(-DHAVE_ZSTD)
endif(N2N_OPTION_USE_ZSTD) endif(N2N_OPTION_USE_ZSTD)
if(N2N_OPTION_USE_PCAPLIB)
find_library(PCAP_LIB pcap)
if(NOT PCAP_LIB)
MESSAGE(FATAL_ERROR "libpcap not found.")
endif(NOT PCAP_LIB)
# Set var needed for check_function_exists()
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIB})
# TODO
# - pcap_set_immediate_mode has been available since libpcap 1.5 in 2013
# probably should remove this check
check_function_exists(pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE)
IF(NOT HAVE_PCAP_IMMEDIATE_MODE)
MESSAGE(FATAL_ERROR "libpcap not support pcap_set_immediate_mode()")
ENDIF(NOT HAVE_PCAP_IMMEDIATE_MODE)
MESSAGE(STATUS "Using libpcap.")
ADD_DEFINITIONS("-DHAVE_PCAP_IMMEDIATE_MODE")
add_executable(n2n-decode tools/n2n-decode.c)
target_link_libraries(n2n-decode n2n pcap)
install(TARGETS n2n-decode RUNTIME DESTINATION bin)
endif(N2N_OPTION_USE_PCAPLIB)
if(N2N_OPTION_USE_CAPLIB)
# Linux Capabilities
find_library(CAP_LIB cap)
if(NOT CAP_LIB)
MESSAGE(FATAL_ERROR "libcap not found.")
endif(NOT CAP_LIB)
MESSAGE(STATUS "Using libcap.")
ADD_DEFINITIONS("-DHAVE_LIBCAP")
endif(N2N_OPTION_USE_CAPLIB)
if(N2N_OPTION_USE_PORTMAPPING)
ADD_DEFINITIONS("-DHAVE_MINIUPNP")
include_directories(${THIRD_PARTY_DIR}/miniupnp/miniupnpc/include)
add_subdirectory(${THIRD_PARTY_DIR}/miniupnp/miniupnpc lib_miniupnpc)
link_directories(${PROJECT_BINARY_DIR}/lib_miniupnpc)
ADD_DEFINITIONS("-DHAVE_NATPMP")
include_directories(${THIRD_PARTY_DIR}/libnatpmp)
add_subdirectory(${THIRD_PARTY_DIR}/libnatpmp libnatpmp)
link_directories(${PROJECT_BINARY_DIR}/libnatpmp)
# Turns on the generic code for supporting either of the above
ADD_DEFINITIONS("-DHAVE_PORT_FORWARDING")
# TODO:
# - this is the odd one out, is it needed?
include_directories(${PROJECT_BINARY_DIR}/lib_miniupnpc)
endif(N2N_OPTION_USE_PORTMAPPING)
if(NOT DEFINED CMAKE_BUILD_TYPE) if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE None) set(CMAKE_BUILD_TYPE None)
endif(NOT DEFINED CMAKE_BUILD_TYPE) endif(NOT DEFINED CMAKE_BUILD_TYPE)
#set(CMAKE_BUILD_TYPE Debug) #set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_BUILD_TYPE Release) #set(CMAKE_BUILD_TYPE Release)
if (DEFINED UNIX) if (DEFINED UNIX)
# None # None
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wshadow -Wpointer-arith -Wmissing-dec larations -Wnested-externs") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wshadow -Wpointer-arith -Wmissing-dec larations -Wnested-externs")
set(CMAKE_CXX_FLAGS "-Wall -Wshadow -Wpointer-arith -Wmissing-declarations -Wnes ted-externs") set(CMAKE_CXX_FLAGS "-Wall -Wshadow -Wpointer-arith -Wmissing-declarations -Wnes ted-externs")
skipping to change at line 130 skipping to change at line 184
src/wire.c src/wire.c
src/hexdump.c src/hexdump.c
src/minilzo.c src/minilzo.c
src/tf.c src/tf.c
src/cc20.c src/cc20.c
src/transform_null.c src/transform_null.c
src/transform_tf.c src/transform_tf.c
src/transform_aes.c src/transform_aes.c
src/transform_cc20.c src/transform_cc20.c
src/transform_speck.c src/transform_speck.c
src/transform_lzo.c
src/transform_zstd.c
src/aes.c src/aes.c
src/speck.c src/speck.c
src/random_numbers.c src/random_numbers.c
src/pearson.c src/pearson.c
src/header_encryption.c src/header_encryption.c
src/tuntap_freebsd.c src/tuntap_freebsd.c
src/tuntap_netbsd.c src/tuntap_netbsd.c
src/tuntap_linux.c src/tuntap_linux.c
src/tuntap_osx.c src/tuntap_osx.c
src/n2n_regex.c src/n2n_regex.c
src/network_traffic_filter.c src/network_traffic_filter.c
src/sn_selection.c src/sn_selection.c
src/auth.c src/auth.c
src/curve25519.c) src/curve25519.c
src/n2n_port_mapping.c)
if(N2N_OPTION_USE_PTHREAD)
target_link_libraries(n2n pthread)
endif(N2N_OPTION_USE_PTHREAD)
if(N2N_OPTION_USE_OPENSSL)
# target_link_libraries(n2n crypto)
target_link_libraries(n2n ${OPENSSL_LIBRARIES})
endif(N2N_OPTION_USE_OPENSSL)
if(N2N_OPTION_USE_ZSTD)
target_link_libraries(n2n zstd)
endif(N2N_OPTION_USE_ZSTD)
if(DEFINED WIN32) if(DEFINED WIN32)
add_library(edge_utils_win32 src/edge_utils_win32.c) add_library(edge_utils_win32 src/edge_utils_win32.c)
add_subdirectory(win32) add_subdirectory(win32)
target_link_libraries(n2n edge_utils_win32 n2n_win32 iphlpapi) target_link_libraries(n2n edge_utils_win32 n2n_win32 iphlpapi)
endif(DEFINED WIN32) endif(DEFINED WIN32)
add_executable(edge src/edge.c) add_executable(edge src/edge.c)
target_link_libraries(edge n2n) target_link_libraries(edge n2n)
skipping to change at line 179 skipping to change at line 223
add_executable(example_edge_embed_quick_edge_init src/example_edge_embed_quick_e dge_init.c) add_executable(example_edge_embed_quick_edge_init src/example_edge_embed_quick_e dge_init.c)
target_link_libraries(example_edge_embed_quick_edge_init n2n) target_link_libraries(example_edge_embed_quick_edge_init n2n)
add_executable(example_edge_embed src/example_edge_embed.c) add_executable(example_edge_embed src/example_edge_embed.c)
target_link_libraries(example_edge_embed n2n) target_link_libraries(example_edge_embed n2n)
add_executable(example_sn_embed src/example_sn_embed.c) add_executable(example_sn_embed src/example_sn_embed.c)
target_link_libraries(example_sn_embed n2n) target_link_libraries(example_sn_embed n2n)
if(N2N_OPTION_USE_PCAPLIB AND (NOT DEFINED WIN32)) if(N2N_OPTION_USE_PTHREAD)
# Linux Capabilities target_link_libraries(n2n pthread)
find_library(CAP_LIB cap) endif(N2N_OPTION_USE_PTHREAD)
if(CAP_LIB)
target_link_libraries(edge cap.a) if(N2N_OPTION_USE_OPENSSL)
set(CMAKE_REQUIRED_LIBRARIES ${CAP_LIB}) # target_link_libraries(n2n crypto)
ADD_DEFINITIONS("-DHAVE_LIBCAP") target_link_libraries(n2n ${OPENSSL_LIBRARIES})
endif() endif(N2N_OPTION_USE_OPENSSL)
endif(N2N_OPTION_USE_PCAPLIB AND (NOT DEFINED WIN32))
if(N2N_OPTION_USE_ZSTD)
target_link_libraries(n2n zstd)
endif(N2N_OPTION_USE_ZSTD)
if(N2N_OPTION_USE_CAPLIB)
# TODO: this is a static library, shouldnt we have a generic one?
target_link_libraries(edge cap.a)
endif(N2N_OPTION_USE_CAPLIB)
if(N2N_OPTION_USE_PORTMAPPING)
target_link_libraries(n2n libminiupnpc-static)
target_link_libraries(n2n natpmp)
endif(N2N_OPTION_USE_PORTMAPPING)
install(TARGETS edge supernode install(TARGETS edge supernode
RUNTIME DESTINATION sbin RUNTIME DESTINATION sbin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
) )
# Tools # Tools
add_executable(n2n-benchmark tools/n2n-benchmark.c) add_executable(n2n-benchmark tools/n2n-benchmark.c)
target_link_libraries(n2n-benchmark n2n) target_link_libraries(n2n-benchmark n2n)
add_executable(n2n-keygen tools/n2n-keygen.c) add_executable(n2n-keygen tools/n2n-keygen.c)
target_link_libraries(n2n-keygen n2n) target_link_libraries(n2n-keygen n2n)
add_executable(tests-auth tools/tests-auth.c)
target_link_libraries(tests-auth n2n)
add_executable(tests-compress tools/tests-compress.c) add_executable(tests-compress tools/tests-compress.c)
target_link_libraries(tests-compress n2n) target_link_libraries(tests-compress n2n)
add_executable(tests-elliptic tools/tests-elliptic.c) add_executable(tests-elliptic tools/tests-elliptic.c)
target_link_libraries(tests-elliptic n2n) target_link_libraries(tests-elliptic n2n)
add_executable(tests-hashing tools/tests-hashing.c) add_executable(tests-hashing tools/tests-hashing.c)
target_link_libraries(tests-hashing n2n) target_link_libraries(tests-hashing n2n)
add_executable(tests-transform tools/tests-transform.c) add_executable(tests-transform tools/tests-transform.c)
target_link_libraries(tests-transform n2n) target_link_libraries(tests-transform n2n)
add_executable(tests-wire tools/tests-wire.c) add_executable(tests-wire tools/tests-wire.c)
target_link_libraries(tests-wire n2n) target_link_libraries(tests-wire n2n)
if(N2N_OPTION_USE_PCAPLIB)
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)
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIB})
check_function_exists(pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE)
IF(HAVE_PCAP_IMMEDIATE_MODE)
ADD_DEFINITIONS("-DHAVE_PCAP_IMMEDIATE_MODE")
ENDIF(HAVE_PCAP_IMMEDIATE_MODE)
endif(PCAP_LIB)
endif(N2N_OPTION_USE_PCAPLIB)
install(TARGETS n2n-benchmark RUNTIME DESTINATION bin) install(TARGETS n2n-benchmark RUNTIME DESTINATION bin)
# Documentation # Documentation
if(DEFINED UNIX) if(DEFINED UNIX)
add_dependencies(n2n doc) add_dependencies(n2n doc)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/edge.8.gz add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/edge.8.gz
COMMAND gzip -c ${PROJECT_SOURCE_DIR}/edge.8 > ${PROJECT_BINA RY_DIR}/doc/edge.8.gz COMMAND gzip -c ${PROJECT_SOURCE_DIR}/edge.8 > ${PROJECT_BINA RY_DIR}/doc/edge.8.gz
DEPENDS ${PROJECT_SOURCE_DIR}/edge.8 DEPENDS ${PROJECT_SOURCE_DIR}/edge.8
) )
skipping to change at line 264 skipping to change at line 308
${PROJECT_BINARY_DIR}/doc/supernode.1.gz ${PROJECT_BINARY_DIR}/doc/supernode.1.gz
${PROJECT_BINARY_DIR}/doc/n2n.7.gz ${PROJECT_BINARY_DIR}/doc/n2n.7.gz
PROPERTIES GENERATED 1) PROPERTIES GENERATED 1)
install(FILES ${PROJECT_BINARY_DIR}/doc/edge.8.gz install(FILES ${PROJECT_BINARY_DIR}/doc/edge.8.gz
DESTINATION /usr/share/man/man8) DESTINATION /usr/share/man/man8)
install(FILES ${PROJECT_BINARY_DIR}/doc/supernode.1.gz install(FILES ${PROJECT_BINARY_DIR}/doc/supernode.1.gz
DESTINATION /usr/share/man/man1) DESTINATION /usr/share/man/man1)
install(FILES ${PROJECT_BINARY_DIR}/doc/n2n.7.gz install(FILES ${PROJECT_BINARY_DIR}/doc/n2n.7.gz
DESTINATION /usr/share/man/man7) DESTINATION /usr/share/man/man7)
endif(DEFINED UNIX)
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
# TODO: # TODO:
# - Add the right dependancy so that the tests binaries get built first # - Add the right dependancy so that the tests binaries get built first
enable_testing() enable_testing()
add_test(tests ${PROJECT_SOURCE_DIR}/scripts/test_harness.sh ${PROJECT_BINARY_DI add_test(NAME unit
R} ${PROJECT_SOURCE_DIR}/tests) COMMAND ${CMAKE_COMMAND} -E env
TOPDIR=${PROJECT_SOURCE_DIR} BINDIR=${PROJECT_BINARY_DIR}
endif(DEFINED UNIX) ${PROJECT_SOURCE_DIR}/scripts/test_harness.sh ${PROJECT_SOURCE_DIR}/test
s/tests_units.list
)
add_test(NAME integration
COMMAND ${CMAKE_COMMAND} -E env
TOPDIR=${PROJECT_SOURCE_DIR} BINDIR=${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/scripts/test_harness.sh ${PROJECT_SOURCE_DIR}/test
s/tests_integration.list
)
endif()
 End of changes. 20 change blocks. 
85 lines changed or deleted 131 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)