From 04ff7926e794caa8e0964be2876e86cf572a39ca Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 2 Oct 2018 12:54:56 +0200 Subject: [PATCH] CMake build system: It is now sufficient to set LWIP_DIR for build --- contrib/ports/CMakeCommon.cmake | 2 ++ contrib/ports/unix/check/CMakeLists.txt | 6 ++---- contrib/ports/unix/example_app/CMakeLists.txt | 6 ++---- contrib/ports/unix/lib/CMakeLists.txt | 6 ++---- contrib/ports/win32/example_app/CMakeLists.txt | 6 ++---- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/contrib/ports/CMakeCommon.cmake b/contrib/ports/CMakeCommon.cmake index 38763970..6465e500 100644 --- a/contrib/ports/CMakeCommon.cmake +++ b/contrib/ports/CMakeCommon.cmake @@ -1,3 +1,5 @@ +set(LWIP_CONTRIB_DIR ${LWIP_DIR}/contrib) + # ARM mbedtls support https://tls.mbed.org/ set(MBEDTLSDIR ${LWIP_DIR}/../mbedtls) if(EXISTS ${MBEDTLSDIR}/CMakeLists.txt) diff --git a/contrib/ports/unix/check/CMakeLists.txt b/contrib/ports/unix/check/CMakeLists.txt index 93afd9dc..3ad7016f 100644 --- a/contrib/ports/unix/check/CMakeLists.txt +++ b/contrib/ports/unix/check/CMakeLists.txt @@ -6,11 +6,9 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CMAKE_SYSTEM_NAME STREQUAL Darw message(FATAL_ERROR "Unit test are currently only working on Linux or Darwin") endif() -set(LWIP_CONTRIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) -set(LWIP_DIR ${LWIP_CONTRIB_DIR}/..) - +set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) set(LWIP_USE_SANITIZERS true) -include(${LWIP_CONTRIB_DIR}/ports/CMakeCommon.cmake) +include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) if(CMAKE_C_COMPILER_ID STREQUAL Clang) # check.h causes 'error: token pasting of ',' and __VA_ARGS__ is a GNU extension' with clang 9.0.0 diff --git a/contrib/ports/unix/example_app/CMakeLists.txt b/contrib/ports/unix/example_app/CMakeLists.txt index 3693343d..b756fcf2 100644 --- a/contrib/ports/unix/example_app/CMakeLists.txt +++ b/contrib/ports/unix/example_app/CMakeLists.txt @@ -4,10 +4,8 @@ project(example_app C) set (CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(LWIP_CONTRIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) -set(LWIP_DIR ${LWIP_DIR}/..) - -include(${LWIP_CONTRIB_DIR}/ports/CMakeCommon.cmake) +set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) +include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) set (LWIP_DEFINITIONS -DLWIP_DEBUG) set (LWIP_INCLUDE_DIRS diff --git a/contrib/ports/unix/lib/CMakeLists.txt b/contrib/ports/unix/lib/CMakeLists.txt index 3ea6bdc6..644d3598 100644 --- a/contrib/ports/unix/lib/CMakeLists.txt +++ b/contrib/ports/unix/lib/CMakeLists.txt @@ -8,10 +8,8 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CMAKE_SYSTEM_NAME STREQUAL GNU) message(FATAL_ERROR "Lwip shared library is only working on Linux or the Hurd") endif() -set(LWIP_CONTRIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) -set(LWIP_DIR ${LWIP_CONTRIB_DIR}/..) - -include(${LWIP_CONTRIB_DIR}/ports/CMakeCommon.cmake) +set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) +include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) set (LWIP_DEFINITIONS -DLWIP_DEBUG) set (LWIP_INCLUDE_DIRS diff --git a/contrib/ports/win32/example_app/CMakeLists.txt b/contrib/ports/win32/example_app/CMakeLists.txt index dbdca4a4..7fe5cba3 100644 --- a/contrib/ports/win32/example_app/CMakeLists.txt +++ b/contrib/ports/win32/example_app/CMakeLists.txt @@ -4,10 +4,8 @@ project(example_app C) set (CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(LWIP_CONTRIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) -set(LWIP_DIR ${LWIP_CONTRIB_DIR}/..) - -include(${LWIP_CONTRIB_DIR}/ports/CMakeCommon.cmake) +set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) +include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) set (LWIP_DEFINITIONS -DLWIP_DEBUG) set (LWIP_INCLUDE_DIRS