Przeglądaj źródła

Restructure CMake build system a bit

This should be easier to use for application devlopers
Dirk Ziegelmeier 7 lat temu
rodzic
commit
a6dc31433e

+ 2 - 3
CMakeLists.txt

@@ -4,14 +4,13 @@ project(lwIP)
 
 
 # Example lwIP application
 # Example lwIP application
 set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
 
 
 set (LWIP_DEFINITIONS LWIP_DEBUG=1)
 set (LWIP_DEFINITIONS LWIP_DEBUG=1)
 
 
 if (${CMAKE_SYSTEM_NAME} STREQUAL Windows)
 if (${CMAKE_SYSTEM_NAME} STREQUAL Windows)
-  add_subdirectory(${LWIP_CONTRIB_DIR}/ports/win32/example_app)
+  add_subdirectory(${LWIP_DIR}/contrib/ports/win32/example_app)
 else()
 else()
-  add_subdirectory(${LWIP_CONTRIB_DIR}/ports/unix/example_app)
+  add_subdirectory(${LWIP_DIR}/contrib/ports/unix/example_app)
 endif()
 endif()
 
 
 # Source package generation
 # Source package generation

+ 3 - 1
contrib/Filelists.cmake

@@ -5,11 +5,13 @@
 #
 #
 # This file is NOT designed (on purpose) to be used as cmake
 # This file is NOT designed (on purpose) to be used as cmake
 # subdir via add_subdirectory()
 # 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.
 # create their own targets using the *_SRCS variables.
 
 
 include_guard(GLOBAL)
 include_guard(GLOBAL)
 
 
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set(lwipcontribexamples_SRCS
 set(lwipcontribexamples_SRCS
     ${LWIP_CONTRIB_DIR}/examples/httpd/fs_example/fs_example.c
     ${LWIP_CONTRIB_DIR}/examples/httpd/fs_example/fs_example.c
     ${LWIP_CONTRIB_DIR}/examples/httpd/ssi_example/ssi_example.c
     ${LWIP_CONTRIB_DIR}/examples/httpd/ssi_example/ssi_example.c

+ 3 - 1
contrib/ports/unix/Filelists.cmake

@@ -5,11 +5,13 @@
 #
 #
 # This file is NOT designed (on purpose) to be used as cmake
 # This file is NOT designed (on purpose) to be used as cmake
 # subdir via add_subdirectory()
 # 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.
 # create their own targets using the *_SRCS variables.
 
 
 include_guard(GLOBAL)
 include_guard(GLOBAL)
 
 
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set(lwipcontribportunix_SRCS
 set(lwipcontribportunix_SRCS
     ${LWIP_CONTRIB_DIR}/ports/unix/port/sys_arch.c
     ${LWIP_CONTRIB_DIR}/ports/unix/port/sys_arch.c
     ${LWIP_CONTRIB_DIR}/ports/unix/port/perf.c
     ${LWIP_CONTRIB_DIR}/ports/unix/port/perf.c

+ 2 - 0
contrib/ports/unix/example_app/CMakeLists.txt

@@ -1,3 +1,5 @@
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set (LWIP_INCLUDE_DIRS
 set (LWIP_INCLUDE_DIRS
     "${LWIP_DIR}/src/include"
     "${LWIP_DIR}/src/include"
     "${LWIP_CONTRIB_DIR}/"
     "${LWIP_CONTRIB_DIR}/"

+ 3 - 1
contrib/ports/win32/Filelists.cmake

@@ -5,11 +5,13 @@
 #
 #
 # This file is NOT designed (on purpose) to be used as cmake
 # This file is NOT designed (on purpose) to be used as cmake
 # subdir via add_subdirectory()
 # 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.
 # create their own targets using the *_SRCS variables.
 
 
 include_guard(GLOBAL)
 include_guard(GLOBAL)
 
 
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set(lwipcontribportwindows_SRCS
 set(lwipcontribportwindows_SRCS
     ${LWIP_CONTRIB_DIR}/ports/win32/sys_arch.c
     ${LWIP_CONTRIB_DIR}/ports/win32/sys_arch.c
     ${LWIP_CONTRIB_DIR}/ports/win32/sio.c
     ${LWIP_CONTRIB_DIR}/ports/win32/sio.c

+ 2 - 0
contrib/ports/win32/example_app/CMakeLists.txt

@@ -1,3 +1,5 @@
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set (LWIP_INCLUDE_DIRS
 set (LWIP_INCLUDE_DIRS
     "${LWIP_DIR}/src/include"
     "${LWIP_DIR}/src/include"
     "${LWIP_CONTRIB_DIR}/"
     "${LWIP_CONTRIB_DIR}/"

+ 2 - 0
src/Filelists.cmake

@@ -10,6 +10,8 @@
 
 
 include_guard(GLOBAL)
 include_guard(GLOBAL)
 
 
+include(${LWIP_DIR}/contrib/ports/CMakeCommon.cmake)
+
 set(LWIP_VERSION_MAJOR    "2")
 set(LWIP_VERSION_MAJOR    "2")
 set(LWIP_VERSION_MINOR    "2")
 set(LWIP_VERSION_MINOR    "2")
 set(LWIP_VERSION_REVISION "0")
 set(LWIP_VERSION_REVISION "0")