From 57672d5add3ce3865cd6ef439cd7c5ea7f92da59 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 11 Sep 2018 09:44:12 +0800 Subject: [PATCH] cmake: make main a component again * Original commit: espressif/esp-idf@d9939cedd9b44d63dc148354c3a0a139b9c7113d --- components/asio/CMakeLists.txt | 4 +--- examples/protocols/asio/chat_client/CMakeLists.txt | 4 +--- examples/protocols/asio/chat_client/components/CMakeLists.txt | 2 +- examples/protocols/asio/chat_client/main/CMakeLists.txt | 4 ++++ examples/protocols/asio/chat_server/CMakeLists.txt | 4 +--- examples/protocols/asio/chat_server/components/CMakeLists.txt | 2 +- examples/protocols/asio/chat_server/main/CMakeLists.txt | 4 ++++ examples/protocols/asio/tcp_echo_server/CMakeLists.txt | 4 +--- .../protocols/asio/tcp_echo_server/components/CMakeLists.txt | 2 +- examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt | 4 ++++ examples/protocols/asio/udp_echo_server/CMakeLists.txt | 4 +--- .../protocols/asio/udp_echo_server/components/CMakeLists.txt | 2 +- examples/protocols/asio/udp_echo_server/main/CMakeLists.txt | 4 ++++ 13 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 examples/protocols/asio/chat_client/main/CMakeLists.txt create mode 100644 examples/protocols/asio/chat_server/main/CMakeLists.txt create mode 100644 examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt create mode 100644 examples/protocols/asio/udp_echo_server/main/CMakeLists.txt diff --git a/components/asio/CMakeLists.txt b/components/asio/CMakeLists.txt index 9be66380e..43d428f8d 100644 --- a/components/asio/CMakeLists.txt +++ b/components/asio/CMakeLists.txt @@ -1,7 +1,5 @@ set(COMPONENT_ADD_INCLUDEDIRS asio/asio/include port/include) -set(COMPONENT_SRCDIRS asio/asio/src) - -set(COMPONENT_SRCEXCLUDE asio/asio/src/asio_ssl.cpp) +set(COMPONENT_SRCS "asio/asio/src/asio.cpp") set(COMPONENT_REQUIRES lwip) diff --git a/examples/protocols/asio/chat_client/CMakeLists.txt b/examples/protocols/asio/chat_client/CMakeLists.txt index 78d29f0bd..e0480c277 100644 --- a/examples/protocols/asio/chat_client/CMakeLists.txt +++ b/examples/protocols/asio/chat_client/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/chat_client.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_chat_client) diff --git a/examples/protocols/asio/chat_client/components/CMakeLists.txt b/examples/protocols/asio/chat_client/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/chat_client/components/CMakeLists.txt +++ b/examples/protocols/asio/chat_client/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/chat_client/main/CMakeLists.txt b/examples/protocols/asio/chat_client/main/CMakeLists.txt new file mode 100644 index 000000000..25419de4a --- /dev/null +++ b/examples/protocols/asio/chat_client/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "chat_client.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/chat_server/CMakeLists.txt b/examples/protocols/asio/chat_server/CMakeLists.txt index 91331df14..c8c629856 100644 --- a/examples/protocols/asio/chat_server/CMakeLists.txt +++ b/examples/protocols/asio/chat_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/chat_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_chat_server) diff --git a/examples/protocols/asio/chat_server/components/CMakeLists.txt b/examples/protocols/asio/chat_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/chat_server/components/CMakeLists.txt +++ b/examples/protocols/asio/chat_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/chat_server/main/CMakeLists.txt b/examples/protocols/asio/chat_server/main/CMakeLists.txt new file mode 100644 index 000000000..7e44a9039 --- /dev/null +++ b/examples/protocols/asio/chat_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "chat_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/tcp_echo_server/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/CMakeLists.txt index 76bf9bcb6..b8d5638f7 100644 --- a/examples/protocols/asio/tcp_echo_server/CMakeLists.txt +++ b/examples/protocols/asio/tcp_echo_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/echo_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_tcp_echo_server) diff --git a/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt +++ b/examples/protocols/asio/tcp_echo_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt new file mode 100644 index 000000000..04c3c94d9 --- /dev/null +++ b/examples/protocols/asio/tcp_echo_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "echo_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component() diff --git a/examples/protocols/asio/udp_echo_server/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/CMakeLists.txt index 143a364e4..8d5c3a692 100644 --- a/examples/protocols/asio/udp_echo_server/CMakeLists.txt +++ b/examples/protocols/asio/udp_echo_server/CMakeLists.txt @@ -1,8 +1,6 @@ -# The following four lines of boilerplate have to be in your project's CMakeLists +# The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(MAIN_SRCS main/udp_echo_server.cpp) - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(asio_udp_echo_server) diff --git a/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt index 4bb51e6a5..e51766724 100644 --- a/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt +++ b/examples/protocols/asio/udp_echo_server/components/CMakeLists.txt @@ -1,4 +1,4 @@ -set(COMPONENT_SRCDIRS ".") +set(COMPONENT_SRCS "wifi_asio.cpp") set(COMPONENT_PRIV_REQUIRES asio nvs_flash console) diff --git a/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt new file mode 100644 index 000000000..cd24937be --- /dev/null +++ b/examples/protocols/asio/udp_echo_server/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "udp_echo_server.cpp") +set(COMPONENT_ADD_INCLUDEDIRS ".") + +register_component()