summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-04-29 18:47:25 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2021-04-30 17:02:32 +0000
commit88b2e3682be6303973fc59c3c62141d64a9e10d7 (patch)
tree80337f9ba278dd3ebad7badb94f1ee9fd13a3bae /src/CMakeLists.txt
parent10796899cf3005df2575fb55be4956792db2c5d8 (diff)
misc: experimental configure script
Type: make Change-Id: Iaeb9d22eec9a7a763b63899814a44e78c8050f1f Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7dfd76a960d..96d373a7066 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -64,6 +64,7 @@ set(VPP_LIBRARY_DIR "lib" CACHE STRING "Relative library directory path")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${VPP_RUNTIME_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${VPP_LIBRARY_DIR})
+set(VPP_BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles)
if (CMAKE_BUILD_TYPE)
set(CMAKE_C_FLAGS "-g -fPIC -Werror -Wall ${CMAKE_C_FLAGS}")
@@ -151,8 +152,7 @@ set(CMAKE_INSTALL_MESSAGE NEVER)
include_directories (
${CMAKE_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}/include
+ ${VPP_BINARY_DIR}
)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "vpp")
@@ -185,7 +185,7 @@ else()
endif()
foreach(DIR ${SUBDIRS})
- add_subdirectory(${DIR})
+ add_subdirectory(${DIR} ${VPP_BINARY_DIR}/${DIR})
endforeach()
##############################################################################
@@ -207,6 +207,36 @@ if (VPP_GIT_TOPLEVEL_DIR)
endif()
##############################################################################
+# custom targets
+##############################################################################
+
+add_custom_target(run
+ COMMAND ./${VPP_RUNTIME_DIR}/vpp -c startup.conf
+ COMMENT "Starting VPP..."
+ USES_TERMINAL
+)
+
+add_custom_target(debug
+ COMMAND gdb --args ./${VPP_RUNTIME_DIR}/vpp -c startup.conf
+ COMMENT "Starting VPP in the debugger..."
+ USES_TERMINAL
+)
+
+add_custom_target(menu
+ COMMAND ccmake ${CMAKE_BINARY_DIR}
+ COMMENT "Starting Configuration TUI..."
+ USES_TERMINAL
+)
+
+add_custom_target(compdb
+ COMMAND ninja -C ${CMAKE_BINARY_DIR} -t compdb |
+ ${CMAKE_SOURCE_DIR}/scripts/compdb_cleanup.py >
+ ${CMAKE_BINARY_DIR}/compile_commands.json
+ COMMENT "Generating compile_commands.json"
+ USES_TERMINAL
+)
+
+##############################################################################
# print configuration
##############################################################################
message(STATUS "Configuration:")