aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-10-07 14:37:42 +0000
committerGerrit Code Review <gerrit@fd.io>2019-10-07 14:37:42 +0000
commit7896701a177d66f376172ab43df4b0c1d5d867a3 (patch)
treea89986dcceb1d5b6faa7ae529b1d4a1e9f4d6d85 /cmake/Modules
parent108c55669102931acc9bd99ca9918379722732b8 (diff)
parent6b84ec54083da9911f5ad4816d0eb4f4745afad4 (diff)
Merge "[HICN-298] Release new hICN app for Android"
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/BuildMacros.cmake18
-rwxr-xr-xcmake/Modules/FindLibhicnctrl.cmake6
2 files changed, 14 insertions, 10 deletions
diff --git a/cmake/Modules/BuildMacros.cmake b/cmake/Modules/BuildMacros.cmake
index 63d54502b..8b591d05b 100644
--- a/cmake/Modules/BuildMacros.cmake
+++ b/cmake/Modules/BuildMacros.cmake
@@ -25,12 +25,13 @@ macro(build_executable exec)
${ARGN}
)
- add_executable(${exec} ${ARG_SOURCES})
+ add_executable(${exec}-bin ${ARG_SOURCES})
set(BUILD_ROOT ${CMAKE_BINARY_DIR}/build-root)
- set_target_properties(${exec}
+ set_target_properties(${exec}-bin
PROPERTIES
+ OUTPUT_NAME ${exec}
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
INSTALL_RPATH_USE_LINK_PATH TRUE
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
@@ -39,19 +40,19 @@ macro(build_executable exec)
)
if(ARG_LINK_LIBRARIES)
- target_link_libraries(${exec} ${ARG_LINK_LIBRARIES})
+ target_link_libraries(${exec}-bin ${ARG_LINK_LIBRARIES})
endif()
if(ARG_DEPENDS)
- add_dependencies(${exec} ${ARG_DEPENDS})
+ add_dependencies(${exec}-bin ${ARG_DEPENDS})
endif()
if(ARG_DEFINITIONS)
- target_compile_definitions(${exec} PRIVATE ${ARG_DEFINITIONS})
+ target_compile_definitions(${exec}-bin PRIVATE ${ARG_DEFINITIONS})
endif()
if(ARG_INCLUDE_DIRS)
- target_include_directories(${exec} BEFORE PUBLIC
+ target_include_directories(${exec}-bin BEFORE PUBLIC
${ARG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
)
@@ -59,7 +60,7 @@ macro(build_executable exec)
if(NOT ARG_NO_INSTALL)
install(
- TARGETS ${exec}
+ TARGETS ${exec}-bin
RUNTIME
DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT ${ARG_COMPONENT}
@@ -178,6 +179,9 @@ macro(build_library lib)
if ("${dir}" STREQUAL includes)
set(dir "")
endif()
+ if ("${dir}" STREQUAL ${ARG_INSTALL_ROOT_DIR})
+ set(dir "")
+ endif()
else()
set(dir "")
endif()
diff --git a/cmake/Modules/FindLibhicnctrl.cmake b/cmake/Modules/FindLibhicnctrl.cmake
index 1399b41bf..7c20420b4 100755
--- a/cmake/Modules/FindLibhicnctrl.cmake
+++ b/cmake/Modules/FindLibhicnctrl.cmake
@@ -31,14 +31,14 @@ find_path(LIBHICNCTRL_INCLUDE_DIR hicn/ctrl.h
DOC "Find the hICN control include"
)
-find_library(LIBHICNCTRL_LIBRARY NAMES hicn-ctrl
+find_library(LIBHICNCTRL_LIBRARY NAMES hicnctrl
HINTS ${HICN_SEARCH_PATH_LIST}
PATH_SUFFIXES lib
DOC "Find the hicn control library"
)
-set(LIBHICNCTRL_LIBRARIES ${HICNCTRL_LIBRARY})
-set(LIBHICNCTRL_INCLUDE_DIRS ${HICNCTRL_INCLUDE_DIR})
+set(LIBHICNCTRL_LIBRARIES ${LIBHICNCTRL_LIBRARY})
+set(LIBHICNCTRL_INCLUDE_DIRS ${LIBHICNCTRL_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(hicnctrl DEFAULT_MSG