diff options
Diffstat (limited to 'ctrl/libhicnctrl/src/CMakeLists.txt')
-rw-r--r-- | ctrl/libhicnctrl/src/CMakeLists.txt | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/ctrl/libhicnctrl/src/CMakeLists.txt b/ctrl/libhicnctrl/src/CMakeLists.txt index ea63217dd..14c204dda 100644 --- a/ctrl/libhicnctrl/src/CMakeLists.txt +++ b/ctrl/libhicnctrl/src/CMakeLists.txt @@ -26,11 +26,22 @@ set(UTIL_HEADER_FILES ) set(SOURCE_FILES - api.c face.c route.c ) +if(BUILD_CTRL_HICNPLUGIN) + set(SOURCE_FILES + ${SOURCE_FILES} + hicn_plugin_api.c + ) +else () + set(SOURCE_FILES + ${SOURCE_FILES} + api.c + ) +endif() + set(LIBRARIES m ${HICN_LIBRARIES} @@ -42,43 +53,37 @@ set(INCLUDE_DIRS ${HICN_INCLUDE_DIRS} ) +# Android requires static libraries if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - set(HICN_LIBRARIES ${LIBHICN_STATIC} log) - build_library(${LIBHICNCTRL} - STATIC - SOURCES ${SOURCE_FILES} - INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${LIBHICN_STATIC} - COMPONENT ${LIBHICNCTRL_COMPONENT} - DEPENDS ${LIBHICN_STATIC} - INCLUDE_DIRS ${INCLUDE_DIRS} - INSTALL_ROOT_DIR hicn - DEFINITIONS ${COMPILER_DEFINITIONS} - ) + set(LIBRARIES ${LIBRARIES} ${LIBHICN_STATIC}) + set(LINK_TYPE STATIC) else () - build_library(${LIBHICNCTRL} - SHARED STATIC - SOURCES ${SOURCE_FILES} - INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${LIBHICN_SHARED} - COMPONENT ${LIBHICNCTRL_COMPONENT} - DEPENDS ${LIBHICN_SHARED} - INCLUDE_DIRS ${INCLUDE_DIRS} - INSTALL_ROOT_DIR hicn - DEFINITIONS ${COMPILER_DEFINITIONS} - ) + set(LINK_TYPE SHARED STATIC) endif () +build_library(${LIBHICNCTRL} + ${LINK_TYPE} + SOURCES ${SOURCE_FILES} + INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} + LINK_LIBRARIES ${LIBRARIES} + DEPENDS ${DEPENDENCIES} + COMPONENT ${LIBHICNCTRL_COMPONENT} + INCLUDE_DIRS ${INCLUDE_DIRS} + INSTALL_ROOT_DIR hicn + DEFINITIONS ${COMPILER_DEFINITIONS} +) + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android" AND NOT COMPILE_FOR_IOS) + set(LIBRARIES ${LIBRARIES} ${LIBHICN_SHARED} ${LIBHICNCTRL_SHARED}) + list(APPEND DAEMON_SRC cli.c ) + build_executable(${HICNCTRL} SOURCES ${DAEMON_SRC} - LINK_LIBRARIES ${LIBHICNCTRL_SHARED} ${LIBHICN_SHARED} - DEPENDS ${LIBHICNCTRL_SHARED} ${LIBHICN_SHARED} + LINK_LIBRARIES ${LIBRARIES} + DEPENDS ${LIBHICNCTRL_SHARED} COMPONENT ${LIBHICNCTRL_COMPONENT} INCLUDE_DIRS ${INCLUDE_DIRS} DEFINITIONS ${COMPILER_DEFINITIONS} |