aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/CMakeLists.txt
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-05-14 16:05:53 +0200
committerAngelo Mantellini <manangel@cisco.com>2019-05-16 13:48:23 +0200
commit5c9b2cd16e76b7d731bd31422b4a555dbeff1541 (patch)
tree1ab57c1e0eb10374879803ef9aee36724ad875ef /hicn-light/src/hicn/CMakeLists.txt
parent8a4273ffe83b46bc018da58135427d40012282b8 (diff)
[HICN-195] Generate static libs for android
Change-Id: Ib78e0ba5108713c6fac0e422eb7bb6f7ba10abc7 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/CMakeLists.txt')
-rw-r--r--hicn-light/src/hicn/CMakeLists.txt43
1 files changed, 31 insertions, 12 deletions
diff --git a/hicn-light/src/hicn/CMakeLists.txt b/hicn-light/src/hicn/CMakeLists.txt
index 1b63f7535..bcef7c9dd 100644
--- a/hicn-light/src/hicn/CMakeLists.txt
+++ b/hicn-light/src/hicn/CMakeLists.txt
@@ -1,7 +1,7 @@
# Define a few configuration variables that we want accessible in the software
include(BuildMacros)
-configure_file(config.h.in config.h @ONLY)
+configure_file(config.h.in hicn-light/config.h @ONLY)
if(NOT ANDROID_API AND NOT COMPILE_FOR_IOS)
add_subdirectory(command_line)
@@ -20,7 +20,7 @@ add_subdirectory(strategies)
add_subdirectory(utils)
list(APPEND HEADER_FILES
- ${CMAKE_CURRENT_BINARY_DIR}/config.h
+ ${CMAKE_CURRENT_BINARY_DIR}/hicn-light/config.h
)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ENABLE_PUNTING)
@@ -35,17 +35,36 @@ list(APPEND COMPILER_DEFINITIONS
list(INSERT HICN_LIGHT_INCLUDE_DIRS 0
${CMAKE_CURRENT_SOURCE_DIR}/..
+ ${CMAKE_CURRENT_BINARY_DIR}/..
)
-build_library(${LIBHICN_LIGHT}
- STATIC NO_DEV
- SOURCES ${SOURCE_FILES}
- INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES}
- LINK_LIBRARIES ${LIBRARIES}
- DEPENDS ${DEPENDENCIES}
- COMPONENT ${LIBHICN_LIGHT}
- INCLUDE_DIRS ${HICN_LIGHT_INCLUDE_DIRS}
- INSTALL_ROOT_DIR hicn
- DEFINITIONS ${COMPILER_DEFINITIONS}
+list(APPEND TO_INSTALL_HEADER_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/hicn-light/config.h
)
+if (ANDROID_API)
+ build_library(${LIBHICN_LIGHT}
+ STATIC
+ SOURCES ${SOURCE_FILES}
+ INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES}
+ LINK_LIBRARIES ${LIBRARIES}
+ DEPENDS ${DEPENDENCIES}
+ COMPONENT ${LIBHICN_LIGHT}
+ INCLUDE_DIRS ${HICN_LIGHT_INCLUDE_DIRS}
+ INSTALL_ROOT_DIR hicn
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ )
+else ()
+ build_library(${LIBHICN_LIGHT}
+ STATIC NO_DEV
+ SOURCES ${SOURCE_FILES}
+ INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES}
+ LINK_LIBRARIES ${LIBRARIES}
+ DEPENDS ${DEPENDENCIES}
+ COMPONENT ${LIBHICN_LIGHT}
+ INCLUDE_DIRS ${HICN_LIGHT_INCLUDE_DIRS}
+ INSTALL_ROOT_DIR hicn
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ )
+endif ()
+