diff options
Diffstat (limited to 'lib/src/CMakeLists.txt')
-rw-r--r-- | lib/src/CMakeLists.txt | 63 |
1 files changed, 10 insertions, 53 deletions
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt index 65eae8d77..d8c7b11e0 100644 --- a/lib/src/CMakeLists.txt +++ b/lib/src/CMakeLists.txt @@ -13,41 +13,20 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -list(APPEND LIBHICN_HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/hicn.h - ${CMAKE_CURRENT_SOURCE_DIR}/base.h - ${CMAKE_CURRENT_SOURCE_DIR}/common.h - ${CMAKE_CURRENT_SOURCE_DIR}/compat.h - ${CMAKE_CURRENT_SOURCE_DIR}/error.h - ${CMAKE_CURRENT_SOURCE_DIR}/header.h - ${CMAKE_CURRENT_SOURCE_DIR}/mapme.h - ${CMAKE_CURRENT_SOURCE_DIR}/name.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol.h - ${CMAKE_CURRENT_SOURCE_DIR}/ops.h -) - -list(APPEND LIBHICN_HEADER_FILES_PROTOCOL - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ah.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/icmp.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/icmprd.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ipv4.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ipv6.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/tcp.h - ${CMAKE_CURRENT_SOURCE_DIR}/protocol/udp.h -) - list(APPEND LIBHICN_SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/common.c ${CMAKE_CURRENT_SOURCE_DIR}/compat.c ${CMAKE_CURRENT_SOURCE_DIR}/error.c ${CMAKE_CURRENT_SOURCE_DIR}/mapme.c ${CMAKE_CURRENT_SOURCE_DIR}/name.c ${CMAKE_CURRENT_SOURCE_DIR}/ops.c - ${CMAKE_CURRENT_SOURCE_DIR}/common.c + ${CMAKE_CURRENT_SOURCE_DIR}/policy.c ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ah.c ${CMAKE_CURRENT_SOURCE_DIR}/protocol/icmp.c ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ipv4.c ${CMAKE_CURRENT_SOURCE_DIR}/protocol/ipv6.c ${CMAKE_CURRENT_SOURCE_DIR}/protocol/tcp.c + ${CMAKE_CURRENT_SOURCE_DIR}/util/ip_address.c ) set (COMPILER_DEFINITIONS "-DWITH_MAPME") @@ -55,48 +34,26 @@ set (COMPILER_DEFINITIONS "-DWITH_MAPME") include(BuildMacros) include(WindowsMacros) -if (ANDROID_API) +if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") build_library(${LIBHICN} STATIC - SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} + SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL} COMPONENT lib${LIBHICN} - INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. + INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../includes DEFINITIONS ${COMPILER_DEFINITIONS} INSTALL_ROOT_DIR hicn - INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} + INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL} LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY} ) else () build_library(${LIBHICN} SHARED STATIC - SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} + SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL} COMPONENT lib${LIBHICN} - INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. + INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../includes DEFINITIONS ${COMPILER_DEFINITIONS} INSTALL_ROOT_DIR hicn - INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} + INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL} LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY} ) endif () -add_custom_command(TARGET ${LIBHICN_STATIC} PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/hicn -) - -add_custom_command(TARGET ${LIBHICN_STATIC} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/hicn/ - COMMAND ${CMAKE_COMMAND} -E copy ${LIBHICN_HEADER_FILES} ${CMAKE_BINARY_DIR}/hicn/ -) - -add_custom_command(TARGET ${LIBHICN_STATIC} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/hicn/protocol - COMMAND ${CMAKE_COMMAND} -E copy ${LIBHICN_HEADER_FILES_PROTOCOL} ${CMAKE_BINARY_DIR}/hicn/protocol -) - -set(HICN_INCLUDE_DIRS - ${CMAKE_BINARY_DIR} "" - CACHE INTERNAL - "" FORCE -) - -# install(FILES ${LIBHICN_HEADER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/hicn COMPONENT libhicn) -# install(FILES ${LIBHICN_HEADER_FILES_PROTOCOL} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/hicn/protocol COMPONENT libhicn) |