2018-10-18 08:17:19 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2018-07-03 10:54:17 +00:00
|
|
|
|
2018-11-26 08:26:37 +00:00
|
|
|
set (CMAKE_CONFIGURATION_TYPES "Debug;Release")
|
|
|
|
|
2018-07-03 10:54:17 +00:00
|
|
|
project(lwIP)
|
|
|
|
|
2018-10-08 18:57:06 +00:00
|
|
|
# Example lwIP application
|
2018-07-03 10:54:17 +00:00
|
|
|
set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2018-10-08 18:57:06 +00:00
|
|
|
set (LWIP_DEFINITIONS LWIP_DEBUG=1)
|
|
|
|
|
2024-03-07 03:28:14 +00:00
|
|
|
option(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/unix/darwin" ON)
|
2024-03-07 03:21:14 +00:00
|
|
|
|
|
|
|
if (LWIP_OPTION_ENABLE_EXAMPLE_APPS)
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
|
|
add_subdirectory(${LWIP_DIR}/contrib/ports/win32/example_app)
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
add_subdirectory(${LWIP_DIR}/contrib/ports/unix/example_app)
|
|
|
|
else()
|
|
|
|
message(WARNING "Host ${CMAKE_SYSTEM_NAME} is not supported to build example_app")
|
|
|
|
endif()
|
2018-10-08 20:17:03 +00:00
|
|
|
else()
|
2024-03-07 03:21:14 +00:00
|
|
|
message(STATUS "example_app build disabled")
|
2018-10-13 08:54:54 +00:00
|
|
|
endif()
|
2018-10-08 18:57:06 +00:00
|
|
|
|
|
|
|
# Source package generation
|
2018-07-03 10:54:17 +00:00
|
|
|
set(CPACK_SOURCE_GENERATOR "ZIP")
|
|
|
|
set(CPACK_SOURCE_PACKAGE_DESCRIPTION_SUMMARY "lwIP lightweight IP stack")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR "${LWIP_VERSION_MAJOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR "${LWIP_VERSION_MINOR}")
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH "${LWIP_VERSION_REVISION}")
|
|
|
|
set(CPACK_SOURCE_IGNORE_FILES "/build/;${CPACK_SOURCE_IGNORE_FILES};.git")
|
2018-09-13 19:54:58 +00:00
|
|
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "lwip-${LWIP_VERSION_MAJOR}.${LWIP_VERSION_MINOR}.${LWIP_VERSION_REVISION}")
|
2018-07-03 10:54:17 +00:00
|
|
|
include(CPack)
|
|
|
|
|
2018-10-18 08:17:19 +00:00
|
|
|
# Generate docs before creating source package
|
|
|
|
include(src/Filelists.cmake)
|
2018-10-18 08:47:51 +00:00
|
|
|
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
|
2018-10-18 08:58:29 +00:00
|
|
|
if (TARGET lwipdocs)
|
|
|
|
add_dependencies(dist lwipdocs)
|
|
|
|
endif()
|