From 29fb6eabebd3fbc7b548df0e391b5ffcc11ec38b Mon Sep 17 00:00:00 2001 From: Zain Liberty Date: Tue, 30 Jun 2020 18:49:18 +0800 Subject: [PATCH] generate config.h in binary directory so we don't need to recompile the whole project when the build type changed --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e13def5..44735c97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,7 @@ ENDIF(DOXYGEN_FOUND) # Configuration file CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/include/tins/config.h.in" - "${PROJECT_SOURCE_DIR}/include/tins/config.h" + "${PROJECT_BINARY_DIR}/include/tins/config.h" ) IF (NOT CMAKE_INSTALL_LIBDIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e07772e6..12000212 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES(BEFORE ${OPENSSL_INCLUDE_DIR} ${PCAP_INCLUDE_DIR} ${LIBTINS_INCLUDE_DIR} + ${PROJECT_BINARY_DIR}/include ) set(SOURCES @@ -82,7 +83,7 @@ set(HEADERS ${LIBTINS_INCLUDE_DIR}/tins/handshake_capturer.h ${LIBTINS_INCLUDE_DIR}/tins/stp.h ${LIBTINS_INCLUDE_DIR}/tins/pppoe.h - ${LIBTINS_INCLUDE_DIR}/tins/config.h + ${PROJECT_BINARY_DIR}/include/tins/config.h ${LIBTINS_INCLUDE_DIR}/tins/constants.h ${LIBTINS_INCLUDE_DIR}/tins/crypto.h ${LIBTINS_INCLUDE_DIR}/tins/cxxstd.h