From 6826130d6faffa447b76cd7f261fee70f2b9b15f Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 12 Oct 2018 22:01:25 +0200 Subject: [PATCH] CMake: Use include_guard only when CMake >= 3.10.0 --- contrib/Filelists.cmake | 4 +++- contrib/ports/CMakeCommon.cmake | 4 +++- contrib/ports/unix/Filelists.cmake | 4 +++- contrib/ports/win32/Filelists.cmake | 4 +++- src/Filelists.cmake | 4 +++- test/unit/Filelists.cmake | 6 ++++-- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/contrib/Filelists.cmake b/contrib/Filelists.cmake index 4e53e924..f2b31f09 100644 --- a/contrib/Filelists.cmake +++ b/contrib/Filelists.cmake @@ -8,7 +8,9 @@ # The intention is to provide greater flexibility to users to # create their own targets using the *_SRCS variables. -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) diff --git a/contrib/ports/CMakeCommon.cmake b/contrib/ports/CMakeCommon.cmake index 57e7d841..90735114 100644 --- a/contrib/ports/CMakeCommon.cmake +++ b/contrib/ports/CMakeCommon.cmake @@ -1,4 +1,6 @@ -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() set(LWIP_CONTRIB_DIR ${LWIP_DIR}/contrib) diff --git a/contrib/ports/unix/Filelists.cmake b/contrib/ports/unix/Filelists.cmake index fb62b678..af68117c 100644 --- a/contrib/ports/unix/Filelists.cmake +++ b/contrib/ports/unix/Filelists.cmake @@ -8,7 +8,9 @@ # The intention is to provide greater flexibility to users to # create their own targets using the *_SRCS variables. -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) diff --git a/contrib/ports/win32/Filelists.cmake b/contrib/ports/win32/Filelists.cmake index 1660feff..48b1e788 100644 --- a/contrib/ports/win32/Filelists.cmake +++ b/contrib/ports/win32/Filelists.cmake @@ -8,7 +8,9 @@ # The intention is to provide greater flexibility to users to # create their own targets using the *_SRCS variables. -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) diff --git a/src/Filelists.cmake b/src/Filelists.cmake index 96a4f8c1..f1bb45f8 100644 --- a/src/Filelists.cmake +++ b/src/Filelists.cmake @@ -8,7 +8,9 @@ # The intention is to provide greater flexibility to users to # create their own targets using the *_SRCS variables. -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake) diff --git a/test/unit/Filelists.cmake b/test/unit/Filelists.cmake index 480c4bdf..7c7d1f13 100644 --- a/test/unit/Filelists.cmake +++ b/test/unit/Filelists.cmake @@ -5,10 +5,12 @@ # # This file is NOT designed (on purpose) to be used as cmake # subdir via add_subdirectory() -# The intention is to provide greater flexibility to users to +# The intention is to provide greater flexibility to users to # create their own targets using the *_SRCS variables. -include_guard(GLOBAL) +if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0") + include_guard(GLOBAL) +endif() set(LWIP_TESTDIR ${LWIP_DIR}/test/unit) set(LWIP_TESTFILES