aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-05-07 16:49:45 +0200
committerFlorin Coras <florin.coras@gmail.com>2020-05-08 17:01:32 +0000
commit599efc67e87e89666d44efd34b5d3db7ccf1f4ca (patch)
tree5ced205cb5ff5247e8e9b596295d4ab4d60319c5 /src/cmake
parent13f64ce2272539d97b8c499e8e298a053fb3c9e2 (diff)
build: various improvements
- add option to install only host tools - add option to specify lib and runtime dir Type: improvement Change-Id: I6356b52df459120fc9b0127948bae7679fb10e52 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/VPPConfig.cmake4
-rw-r--r--src/cmake/exec.cmake2
-rw-r--r--src/cmake/library.cmake2
-rw-r--r--src/cmake/plugin.cmake4
4 files changed, 7 insertions, 5 deletions
diff --git a/src/cmake/VPPConfig.cmake b/src/cmake/VPPConfig.cmake
index 870c2a5b182..21da59d68ba 100644
--- a/src/cmake/VPPConfig.cmake
+++ b/src/cmake/VPPConfig.cmake
@@ -33,7 +33,9 @@ if (compiler_flag_no_address_of_packed_member)
add_definitions(-Wno-address-of-packed-member)
endif()
-include(CheckCCompilerFlag)
+set(VPP_RUNTIME_DIR "bin" CACHE STRING "Relative runtime directory path")
+set(VPP_LIBRARY_DIR "lib" CACHE STRING "Relative library directory path")
+
include(${CMAKE_CURRENT_LIST_DIR}/cpu.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/api.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/library.cmake)
diff --git a/src/cmake/exec.cmake b/src/cmake/exec.cmake
index d5e837084e9..7bfd5751c83 100644
--- a/src/cmake/exec.cmake
+++ b/src/cmake/exec.cmake
@@ -30,7 +30,7 @@ macro(add_vpp_executable exec)
add_dependencies(${exec} ${ARG_DEPENDS})
endif()
if(NOT ARG_NO_INSTALL)
- install(TARGETS ${exec} DESTINATION bin)
+ install(TARGETS ${exec} DESTINATION ${VPP_RUNTIME_DIR})
endif()
endmacro()
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index dc14ae59e46..d6a63d325e9 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -34,7 +34,7 @@ macro(add_vpp_library lib)
endif()
install(
TARGETS ${lib}
- DESTINATION lib
+ DESTINATION ${VPP_LIBRARY_DIR}
COMPONENT ${ARG_COMPONENT}
)
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index 2e2749a440e..bf40aa504a7 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -86,13 +86,13 @@ macro(add_vpp_plugin name)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_api_test_plugins)
install(
TARGETS ${test_plugin_name}
- DESTINATION lib/vpp_api_test_plugins
+ DESTINATION ${VPP_LIBRARY_DIR}/vpp_api_test_plugins
COMPONENT ${PLUGIN_COMPONENT}
)
endif()
install(
TARGETS ${plugin_name}
- DESTINATION lib/vpp_plugins
+ DESTINATION ${VPP_LIBRARY_DIR}/vpp_plugins
COMPONENT ${PLUGIN_COMPONENT}
)
endmacro()