aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-03-24 17:34:14 +0000
committerMauro Sardara <msardara@cisco.com>2020-09-14 17:31:15 +0000
commit88509fe353767cbde707c3e3b1f29392957819f3 (patch)
treecccd51bac7966cd3138c525e8075d90341184a66 /cmake
parentd875ae92a7fa1eaab3bc2616aeeedfc64a81fea4 (diff)
[HICN-574] Host stack plugin for VPP.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I8d8fdffef31a7013265d6529c5f52f3d5ec70d18 Signed-off-by: Mauro Sardara <msardara@cisco.com> Signed-off-by: Mauro <you@example.com> Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/BuildMacros.cmake25
1 files changed, 18 insertions, 7 deletions
diff --git a/cmake/Modules/BuildMacros.cmake b/cmake/Modules/BuildMacros.cmake
index d360d26af..c84ea1b33 100644
--- a/cmake/Modules/BuildMacros.cmake
+++ b/cmake/Modules/BuildMacros.cmake
@@ -21,7 +21,7 @@ macro(build_executable exec)
cmake_parse_arguments(ARG
"NO_INSTALL"
"COMPONENT"
- "SOURCES;LINK_LIBRARIES;DEPENDS;INCLUDE_DIRS;DEFINITIONS;LINK_FLAGS"
+ "SOURCES;LINK_LIBRARIES;DEPENDS;INCLUDE_DIRS;DEFINITIONS;LINK_FLAGS;COMPILE_FLAGS"
${ARGN}
)
@@ -38,6 +38,7 @@ macro(build_executable exec)
LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin"
LINK_FLAGS "${ARG_LINK_FLAGS}"
+ COMPILE_FLAGS "${ARG_COMPILE_FLAGS}"
)
if(ARG_LINK_LIBRARIES)
@@ -73,10 +74,14 @@ macro(build_library lib)
cmake_parse_arguments(ARG
"SHARED;STATIC;NO_DEV"
"COMPONENT;"
- "SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;DEPENDS;INCLUDE_DIRS;DEFINITIONS;INSTALL_ROOT_DIR;INSTALL_FULL_PATH_DIR;EMPTY_PREFIX;"
+ "SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;DEPENDS;INCLUDE_DIRS;DEFINITIONS;HEADER_ROOT_DIR;LIBRARY_ROOT_DIR;INSTALL_FULL_PATH_DIR;EMPTY_PREFIX;LINK_FLAGS;COMPILE_FLAGS"
${ARGN}
)
+ message("Building library ${lib}")
+
+ unset(TARGET_LIBS)
+
if (ARG_SHARED)
list(APPEND TARGET_LIBS
${lib}.shared
@@ -115,6 +120,8 @@ macro(build_library lib)
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin"
+ LINK_FLAGS "${ARG_LINK_FLAGS}"
+ COMPILE_FLAGS "${ARG_COMPILE_FLAGS}"
)
else ()
set_target_properties(${library}
@@ -124,6 +131,8 @@ macro(build_library lib)
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_ROOT}/lib"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_ROOT}/bin"
+ LINK_FLAGS "${ARG_LINK_FLAGS}"
+ COMPILE_FLAGS "${ARG_COMPILE_FLAGS}"
)
endif()
@@ -139,6 +148,7 @@ macro(build_library lib)
PROPERTIES
OUTPUT_NAME ${lib}
)
+ message(STATUS "Output name will be ${lib}")
endif ()
# library deps
@@ -157,7 +167,7 @@ macro(build_library lib)
)
endif()
- set(INSTALL_LIB_PATH ${CMAKE_INSTALL_LIBDIR})
+ set(INSTALL_LIB_PATH "${CMAKE_INSTALL_LIBDIR}/${ARG_LIBRARY_ROOT_DIR}")
if (ARG_INSTALL_FULL_PATH_DIR)
set(INSTALL_LIB_PATH ${ARG_INSTALL_FULL_PATH_DIR})
@@ -178,8 +188,8 @@ macro(build_library lib)
# install headers
if(ARG_INSTALL_HEADERS)
- if (NOT ARG_INSTALL_ROOT_DIR)
- set(ARG_INSTALL_ROOT_DIR "hicn")
+ if (NOT ARG_HEADER_ROOT_DIR)
+ set(ARG_HEADER_ROOT_DIR "hicn")
endif()
list(APPEND local_comps
@@ -197,7 +207,7 @@ macro(build_library lib)
if ("${dir}" STREQUAL includes)
set(dir "")
endif()
- if ("${dir}" STREQUAL ${ARG_INSTALL_ROOT_DIR})
+ if ("${dir}" STREQUAL ${ARG_HEADER_ROOT_DIR})
set(dir "")
endif()
else()
@@ -210,7 +220,7 @@ macro(build_library lib)
endif()
install(
FILES ${file}
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${ARG_INSTALL_ROOT_DIR}/${dir}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${ARG_HEADER_ROOT_DIR}/${dir}
COMPONENT ${COMPONENT}
)
endforeach()
@@ -233,3 +243,4 @@ endmacro(AddTest)
include(IosMacros)
include(WindowsMacros)
+