Просмотр исходного кода

CMake: Use include_guard only when CMake >= 3.10.0

Dirk Ziegelmeier 7 лет назад
Родитель
Сommit
6826130d6f

+ 3 - 1
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)
 

+ 3 - 1
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)
 

+ 3 - 1
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)
 

+ 3 - 1
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)
 

+ 3 - 1
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)
 

+ 4 - 2
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