-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Commonize samples/ cmakelists txt
- Loading branch information
Showing
17 changed files
with
96 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
!samples | ||
!src | ||
!test | ||
!CMakeLists.txt | ||
!CMakeLists.txt | ||
!CMake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# FindJsonCpp.cmake | ||
|
||
# Try to locate the jsoncpp package using pkg-config | ||
find_package(PkgConfig QUIET) | ||
|
||
if (PKG_CONFIG_FOUND) | ||
pkg_check_modules(JSONCPP_PKG jsoncpp) | ||
|
||
if (JSONCPP_PKG_FOUND) | ||
# Create the jsoncpp imported target | ||
if (NOT TARGET JsonCpp::JsonCpp) | ||
add_library(JsonCpp::JsonCpp SHARED IMPORTED) | ||
set_target_properties(JsonCpp::JsonCpp PROPERTIES | ||
IMPORTED_LOCATION "${JSONCPP_PKG_LIBRARY_DIRS}/libjsoncpp.so" | ||
INTERFACE_INCLUDE_DIRECTORIES "${JSONCPP_PKG_INCLUDE_DIRS}" | ||
) | ||
|
||
# Optionally, set any additional properties, such as dependencies or version | ||
message(STATUS "Found JsonCpp: ${JSONCPP_PKG_LIBRARY_DIRS}/libjsoncpp.so") | ||
endif() | ||
|
||
else() | ||
message(FATAL_ERROR "Pkg-config found, but JsonCpp not found via pkg-config.") | ||
endif() | ||
else() | ||
message(FATAL_ERROR "Pkg-config not found, cannot locate JsonCpp.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
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(JsonCpp QUIET) | ||
if (NOT TARGET JsonCpp::JsonCPP) | ||
include(/usr/local/lib/cmake/tgbot-cpp/FindJsonCppCustom.cmake) | ||
endif() | ||
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() | ||
set(LINK_LIB_LIST /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES} JsonCpp::JsonCpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(echobot-curl-client) | ||
|
||
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(echobot-curl-client src/main.cpp) | ||
|
||
target_link_libraries(echobot-curl-client /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(echobot-setmycommands) | ||
|
||
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(echobot-setmycommands src/main.cpp) | ||
|
||
target_link_libraries(echobot-setmycommands /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(echobot-submodule) | ||
|
||
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() | ||
|
||
include(../common_defs.cmake) | ||
add_subdirectory(tgbot-cpp) | ||
add_executable(echobot-submodule src/main.cpp) | ||
|
||
target_link_libraries(echobot-submodule TgBot ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
target_link_libraries(echobot-submodule TgBot ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES} JsonCpp::JsonCpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(echobot-webhook-server) | ||
|
||
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(echobot-webhook-server src/main.cpp) | ||
|
||
target_link_libraries(echobot-webhook-server /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(echobot) | ||
|
||
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(echobot src/main.cpp) | ||
|
||
target_link_libraries(echobot /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(echobot ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(inline-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(inline-keyboard src/main.cpp) | ||
|
||
target_link_libraries(inline-keyboard /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(photo) | ||
|
||
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(photo src/main.cpp) | ||
|
||
target_link_libraries(photo /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(receive-file) | ||
|
||
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(receive-file src/main.cpp) | ||
|
||
target_link_libraries(receive-file /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.10.2) | ||
project(received-text-processing) | ||
|
||
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(received-processing-text src/main.cpp) | ||
|
||
target_link_libraries(received-processing-text /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) | ||
include(../common_defs.cmake) | ||
add_executable(${PROJECT_NAME} src/main.cpp) | ||
target_link_libraries(${PROJECT_NAME} ${LINK_LIB_LIST}) |
Oops, something went wrong.