diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-30 17:46:58 +0200 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-30 17:46:58 +0200 |
commit | 70b02c460b55f6a6722a852704ee7d916c48ed47 (patch) | |
tree | 6b9134d703edcc2e173ad3218daac1b3ecd4e6a1 | |
parent | d9dfa73edda127580e0961c89d8fafa56735f672 (diff) |
Update docker files and CMakeLists
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | Dockerfile_test | 13 | ||||
-rw-r--r-- | samples/echobot-curl-client/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/echobot-curl-client/Dockerfile | 4 | ||||
-rw-r--r-- | samples/echobot-setmycommands/CMakeLists.txt | 12 | ||||
-rw-r--r-- | samples/echobot-setmycommands/Dockerfile | 4 | ||||
-rw-r--r-- | samples/echobot-submodule/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/echobot-submodule/Dockerfile | 4 | ||||
-rw-r--r-- | samples/echobot-webhook-server/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/echobot-webhook-server/Dockerfile | 4 | ||||
-rw-r--r-- | samples/echobot/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/inline-keyboard/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/inline-keyboard/Dockerfile | 2 | ||||
-rw-r--r-- | samples/photo/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/received-text-processing/CMakeLists.txt | 6 | ||||
-rw-r--r-- | samples/received-text-processing/Dockerfile | 8 | ||||
-rw-r--r-- | samples/reply-keyboard/CMakeLists.txt | 21 | ||||
-rw-r--r-- | samples/reply-keyboard/Dockerfile | 8 |
20 files changed, 99 insertions, 34 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcadb2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/CMakeLists.txt b/CMakeLists.txt index 664bf67..b2a2b09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.13.4) project(TgBot) # options @@ -51,7 +51,7 @@ find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) ## curl -find_package(CURL 7.56.0) +find_package(CURL 7.64.0) if (CURL_FOUND) include_directories(${CURL_INCLUDE_DIRS}) add_definitions(-DHAVE_CURL) @@ -60,9 +60,9 @@ endif() ## boost set(Boost_USE_MULTITHREADED ON) if (ENABLE_TESTS) - find_package(Boost 1.59.0 COMPONENTS system unit_test_framework REQUIRED) + find_package(Boost 1.67.0 COMPONENTS system unit_test_framework REQUIRED) else() - find_package(Boost 1.59.0 COMPONENTS system REQUIRED) + find_package(Boost 1.67.0 COMPONENTS system REQUIRED) endif() include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIR_RELEASE}) @@ -1,4 +1,4 @@ -FROM debian:stretch +FROM debian:buster MAINTAINER Oleg Morozenkov <m@oleg.rocks> RUN apt-get -qq update && \ diff --git a/Dockerfile_test b/Dockerfile_test index ad52a88..a209609 100644 --- a/Dockerfile_test +++ b/Dockerfile_test @@ -40,6 +40,14 @@ WORKDIR /usr/src/tgbot-cpp/samples/echobot-curl-client RUN rm -rf CMakeCache.txt CMakeFiles/ && \ cmake . && make -j$(nproc) +WORKDIR /usr/src/tgbot-cpp/samples/echobot-setmycommands +RUN rm -rf CMakeCache.txt CMakeFiles/ && \ + cmake . && make -j$(nproc) + +WORKDIR /usr/src/tgbot-cpp/samples/echobot-submodule +RUN rm -rf CMakeCache.txt CMakeFiles/ && \ + cmake . && make -j$(nproc) + WORKDIR /usr/src/tgbot-cpp/samples/echobot-webhook-server RUN rm -rf CMakeCache.txt CMakeFiles/ && \ cmake . && make -j$(nproc) @@ -56,7 +64,10 @@ WORKDIR /usr/src/tgbot-cpp/samples/received-text-processing RUN rm -rf CMakeCache.txt CMakeFiles/ && \ cmake . && make -j$(nproc) +WORKDIR /usr/src/tgbot-cpp/samples/reply-keyboard +RUN rm -rf CMakeCache.txt CMakeFiles/ && \ + cmake . && make -j$(nproc) + WORKDIR /usr/src/tgbot-cpp ENV CTEST_OUTPUT_ON_FAILURE=1 CMD make test - diff --git a/samples/echobot-curl-client/CMakeLists.txt b/samples/echobot-curl-client/CMakeLists.txt index 75d9c58..d9347a5 100644 --- a/samples/echobot-curl-client/CMakeLists.txt +++ b/samples/echobot-curl-client/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(echobot-curl-client) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/echobot-curl-client/Dockerfile b/samples/echobot-curl-client/Dockerfile index a7aa61a..2954ceb 100644 --- a/samples/echobot-curl-client/Dockerfile +++ b/samples/echobot-curl-client/Dockerfile @@ -1,8 +1,8 @@ FROM reo7sp/tgbot-cpp MAINTAINER Oleg Morozenkov <a@reo7sp.ru> -WORKDIR /usr/src/echobot +WORKDIR /usr/src/echobot-curl-client COPY . . RUN cmake . RUN make -j4 -CMD ./echobot +CMD ./echobot-curl-client diff --git a/samples/echobot-setmycommands/CMakeLists.txt b/samples/echobot-setmycommands/CMakeLists.txt index 7019e8f..e6c63eb 100644 --- a/samples/echobot-setmycommands/CMakeLists.txt +++ b/samples/echobot-setmycommands/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) -project(echobot) +cmake_minimum_required(VERSION 3.13.4) +project(echobot-setmycommands) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) @@ -14,6 +16,6 @@ if (CURL_FOUND) add_definitions(-DHAVE_CURL) endif() -add_executable(echobot src/main.cpp) +add_executable(echobot-setmycommands src/main.cpp) -target_link_libraries(echobot /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) +target_link_libraries(echobot-setmycommands /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) diff --git a/samples/echobot-setmycommands/Dockerfile b/samples/echobot-setmycommands/Dockerfile index a7aa61a..c103a7d 100644 --- a/samples/echobot-setmycommands/Dockerfile +++ b/samples/echobot-setmycommands/Dockerfile @@ -1,8 +1,8 @@ FROM reo7sp/tgbot-cpp MAINTAINER Oleg Morozenkov <a@reo7sp.ru> -WORKDIR /usr/src/echobot +WORKDIR /usr/src/echobot-setmycommands COPY . . RUN cmake . RUN make -j4 -CMD ./echobot +CMD ./echobot-setmycommands diff --git a/samples/echobot-submodule/CMakeLists.txt b/samples/echobot-submodule/CMakeLists.txt index fbb9087..8561602 100644 --- a/samples/echobot-submodule/CMakeLists.txt +++ b/samples/echobot-submodule/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(echobot-submodule) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/echobot-submodule/Dockerfile b/samples/echobot-submodule/Dockerfile index a7aa61a..5e5191a 100644 --- a/samples/echobot-submodule/Dockerfile +++ b/samples/echobot-submodule/Dockerfile @@ -1,8 +1,8 @@ FROM reo7sp/tgbot-cpp MAINTAINER Oleg Morozenkov <a@reo7sp.ru> -WORKDIR /usr/src/echobot +WORKDIR /usr/src/echobot-submodule COPY . . RUN cmake . RUN make -j4 -CMD ./echobot +CMD ./echobot-submodule diff --git a/samples/echobot-webhook-server/CMakeLists.txt b/samples/echobot-webhook-server/CMakeLists.txt index 49bcef1..ca56c53 100644 --- a/samples/echobot-webhook-server/CMakeLists.txt +++ b/samples/echobot-webhook-server/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(echobot-webhook-server) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/echobot-webhook-server/Dockerfile b/samples/echobot-webhook-server/Dockerfile index a7aa61a..2aa4048 100644 --- a/samples/echobot-webhook-server/Dockerfile +++ b/samples/echobot-webhook-server/Dockerfile @@ -1,8 +1,8 @@ FROM reo7sp/tgbot-cpp MAINTAINER Oleg Morozenkov <a@reo7sp.ru> -WORKDIR /usr/src/echobot +WORKDIR /usr/src/echobot-webhook-server COPY . . RUN cmake . RUN make -j4 -CMD ./echobot +CMD ./echobot-webhook-server diff --git a/samples/echobot/CMakeLists.txt b/samples/echobot/CMakeLists.txt index 7019e8f..26897b6 100644 --- a/samples/echobot/CMakeLists.txt +++ b/samples/echobot/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(echobot) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/inline-keyboard/CMakeLists.txt b/samples/inline-keyboard/CMakeLists.txt index fe7c9bd..76ea949 100644 --- a/samples/inline-keyboard/CMakeLists.txt +++ b/samples/inline-keyboard/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(inline-keyboard) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/inline-keyboard/Dockerfile b/samples/inline-keyboard/Dockerfile index a65d5a1..7e8e97a 100644 --- a/samples/inline-keyboard/Dockerfile +++ b/samples/inline-keyboard/Dockerfile @@ -4,5 +4,5 @@ MAINTAINER Oleg Morozenkov <a@reo7sp.ru> WORKDIR /usr/src/inline-keyboard COPY . . RUN cmake . -RUN make +RUN make -j4 CMD ./inline-keyboard diff --git a/samples/photo/CMakeLists.txt b/samples/photo/CMakeLists.txt index ae4b2eb..6885bf7 100644 --- a/samples/photo/CMakeLists.txt +++ b/samples/photo/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(photo) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/received-text-processing/CMakeLists.txt b/samples/received-text-processing/CMakeLists.txt index 2e351d1..d1f08d3 100644 --- a/samples/received-text-processing/CMakeLists.txt +++ b/samples/received-text-processing/CMakeLists.txt @@ -1,7 +1,9 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.13.4) project(received-text-processing) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(Boost_USE_MULTITHREADED ON) find_package(Threads REQUIRED) diff --git a/samples/received-text-processing/Dockerfile b/samples/received-text-processing/Dockerfile new file mode 100644 index 0000000..004c09f --- /dev/null +++ b/samples/received-text-processing/Dockerfile @@ -0,0 +1,8 @@ +FROM reo7sp/tgbot-cpp +MAINTAINER Oleg Morozenkov <a@reo7sp.ru> + +WORKDIR /usr/src/received-text-processing +COPY . . +RUN cmake . +RUN make -j4 +CMD ./received-text-processing diff --git a/samples/reply-keyboard/CMakeLists.txt b/samples/reply-keyboard/CMakeLists.txt new file mode 100644 index 0000000..845b038 --- /dev/null +++ b/samples/reply-keyboard/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.13.4) +project(reply-keyboard) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +set(Boost_USE_MULTITHREADED ON) + +find_package(Threads REQUIRED) +find_package(OpenSSL REQUIRED) +find_package(Boost COMPONENTS system REQUIRED) +find_package(CURL) +include_directories(/usr/local/include ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) +if (CURL_FOUND) + include_directories(${CURL_INCLUDE_DIRS}) + add_definitions(-DHAVE_CURL) +endif() + +add_executable(reply-keyboard src/main.cpp) + +target_link_libraries(reply-keyboard /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) diff --git a/samples/reply-keyboard/Dockerfile b/samples/reply-keyboard/Dockerfile new file mode 100644 index 0000000..712e200 --- /dev/null +++ b/samples/reply-keyboard/Dockerfile @@ -0,0 +1,8 @@ +FROM reo7sp/tgbot-cpp +MAINTAINER Oleg Morozenkov <a@reo7sp.ru> + +WORKDIR /usr/src/reply-keyboard +COPY . . +RUN cmake . +RUN make -j4 +CMD ./reply-keyboard |