prevent tons of untracked files from appearing in mtcp submodule directory.
@@ -6,11 +6,11 @@ include(ExternalProject)
set(DPDK_TARGET x86_64-native-linuxapp-gcc CACHE STRING "The DPDK Target")
set(DPDK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/mtcp/dpdk-17.08)
set(DPDK_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/submodules/dpdk)
-set(DPDK_INSTALL_DIR ${DPDK_SOURCE_DIR}/${DPDK_TARGET})
-set(DPDK_INCLUDE_DIR ${DPDK_INSTALL_DIR}/include)
+set(DPDK_INSTALL_DIR ${DPDK_BINARY_DIR})
+set(DPDK_INCLUDE_DIR ${DPDK_INSTALL_DIR}/include/dpdk)
set(DPDK_LIB_DIR ${DPDK_INSTALL_DIR}/lib)
-file(MAKE_DIRECTORY ${DPDK_INCLUDE_DIR})
-file(MAKE_DIRECTORY ${DPDK_LIB_DIR})
+file(MAKE_DIRECTORY ${DPDK_SOURCE_DIR}/${DPDK_TARGET}/include)
+file(MAKE_DIRECTORY ${DPDK_SOURCE_DIR}/${DPDK_TARGET}/lib)
set(DPDK_LIBS
${DPDK_LIB_DIR}/libdpdk.a
${DPDK_LIB_DIR}/librte_acl.a
@@ -79,19 +79,12 @@ set(DPDK_LIBS
${DPDK_LIB_DIR}/librte_timer.a
${DPDK_LIB_DIR}/librte_vhost.a
)
-# ExternalProject_Add(dpdk
-# PREFIX ${DPDK_BINARY_DIR}/ExternalProject
-# SOURCE_DIR ${DPDK_SOURCE_DIR}
-# CONFIGURE_COMMAND make -C ${DPDK_SOURCE_DIR} config T=${DPDK_TARGET} DESTDIR=${DPDK_BINARY_DIR}
-# BUILD_COMMAND make -C ${DPDK_SOURCE_DIR} T=${DPDK_TARGET}
-# INSTALL_COMMAND make -C ${DPDK_SOURCE_DIR} install T=${DPDK_TARGET} DESTDIR=${DPDK_BINARY_DIR}
-# )
ExternalProject_Add(dpdk
PREFIX ${DPDK_BINARY_DIR}/ExternalProject
SOURCE_DIR ${DPDK_SOURCE_DIR}
- CONFIGURE_COMMAND make -C ${DPDK_SOURCE_DIR} config T=${DPDK_TARGET} DESTDIR=${DPDK_SOURCE_DIR}
+ CONFIGURE_COMMAND make -C ${DPDK_SOURCE_DIR} config T=${DPDK_TARGET}
BUILD_COMMAND make -C ${DPDK_SOURCE_DIR} T=${DPDK_TARGET}
- INSTALL_COMMAND make -C ${DPDK_SOURCE_DIR} install T=${DPDK_TARGET} DESTDIR=${DPDK_SOURCE_DIR}
+ INSTALL_COMMAND make -C ${DPDK_SOURCE_DIR} install T=${DPDK_TARGET} DESTDIR=${DPDK_INSTALL_DIR}
)
function(target_add_dpdk TARGET)
target_link_libraries(${TARGET} ${DPDK_LIBS})
@@ -111,7 +104,7 @@ ExternalProject_Add(mtcp
PREFIX ${MTCP_BINARY_DIR}/ExternalProject
DEPENDS dpdk
SOURCE_DIR ${MTCP_SOURCE_DIR}
- CONFIGURE_COMMAND cd ${MTCP_SOURCE_DIR} && ./configure --with-dpdk-lib=${DPDK_INSTALL_DIR} CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}
+ CONFIGURE_COMMAND cd ${MTCP_SOURCE_DIR} && ./configure --with-dpdk-lib=${DPDK_SOURCE_DIR}/${DPDK_TARGET} CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}
BUILD_COMMAND make -C ${MTCP_SOURCE_DIR}
INSTALL_COMMAND echo 'MTCP doesn't support an install step'
)
