aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-07-26 17:32:48 +0200
committerMauro Sardara <msardara@cisco.com>2019-07-26 18:08:58 +0200
commit05ca0aa8f612ee48fb66d4dbebe596b7f1e03181 (patch)
tree613d0c2362fdb62df42ce54aae12362ff0d7d2ec /lib
parent7ceadff88f62665194deb12ca0926f5dcd6d3f48 (diff)
[HICN-253] Mark cmake target for library as static or shared.
Change-Id: I1e8a14f9255f04bddbb87f74a6d6163a02dedb22 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt3
-rw-r--r--lib/src/CMakeLists.txt6
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 512bcb619..51aeccb2a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -27,7 +27,8 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
- set(LIBHICN hicn)
+ set(LIBHICN hicn)
+ set(LIBHICN_STATIC ${LIBHICN}.static)
endif()
include (Packaging)
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt
index 29fc5d865..d62ac7e8f 100644
--- a/lib/src/CMakeLists.txt
+++ b/lib/src/CMakeLists.txt
@@ -78,16 +78,16 @@ else ()
LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY}
)
endif ()
-add_custom_command(TARGET hicn PRE_BUILD
+add_custom_command(TARGET ${LIBHICN_STATIC} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_BINARY_DIR}/hicn
)
-add_custom_command(TARGET hicn POST_BUILD
+add_custom_command(TARGET ${LIBHICN_STATIC} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/hicn/
COMMAND ${CMAKE_COMMAND} -E copy ${LIBHICN_HEADER_FILES} ${PROJECT_BINARY_DIR}/hicn/
)
-add_custom_command(TARGET hicn POST_BUILD
+add_custom_command(TARGET ${LIBHICN_STATIC} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/hicn/protocol
COMMAND ${CMAKE_COMMAND} -E copy ${LIBHICN_HEADER_FILES_PROTOCOL} ${PROJECT_BINARY_DIR}/hicn/protocol
)