diff options
author | Oleg Morozenkov <omorozenkov@gmail.com> | 2015-08-12 19:59:52 +0300 |
---|---|---|
committer | Oleg Morozenkov <omorozenkov@gmail.com> | 2015-08-12 20:00:20 +0300 |
commit | 88b945b907eee025e33b259c95a61c7fe5d213c0 (patch) | |
tree | 9d9a928155da4d5351fb143bc8b6489f9bfca0bd | |
parent | f94a2dd6c2832c6ba0379d4c8eec367b25a4a2e2 (diff) |
Make the samples independent of the library's CMakeLists
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | samples/CMakeLists.txt | 1 | ||||
-rw-r--r-- | samples/echobot/CMakeLists.txt | 14 | ||||
-rw-r--r-- | samples/echobot/Dockerfile | 9 |
4 files changed, 19 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d48f810..a31acc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project(TgBot) ### options option(ENABLE_TESTS "Set to ON to enable building of tests" OFF) -option(ENABLE_SAMPLES "Set to ON to enable building of samples" OFF) ### sources set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") @@ -50,9 +49,3 @@ if (ENABLE_TESTS) enable_testing() add_subdirectory(test) endif() - -### samples -if (ENABLE_SAMPLES) - message(STATUS "Building of sambles is enabled") - add_subdirectory(samples) -endif() diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt deleted file mode 100644 index 35c00f2..0000000 --- a/samples/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(echobot) diff --git a/samples/echobot/CMakeLists.txt b/samples/echobot/CMakeLists.txt index c8c02ea..c54109c 100644 --- a/samples/echobot/CMakeLists.txt +++ b/samples/echobot/CMakeLists.txt @@ -1,4 +1,10 @@ -set(SAMPLE_NAME echobot) - -add_executable(${SAMPLE_NAME} src/main.cpp) -target_link_libraries(${SAMPLE_NAME} TgBot)
\ No newline at end of file +cmake_minimum_required(VERSION 2.8.4) +project(echobot) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(Boost_USE_MULTITHREADED ON) +find_package(Threads REQUIRED) +find_package(OpenSSL REQUIRED) +find_package(Boost COMPONENTS system iostreams unit_test_framework REQUIRED) +include_directories(/usr/local/include ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) +add_executable(echobot src/main.cpp) +target_link_libraries(echobot /usr/local/lib/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES}) diff --git a/samples/echobot/Dockerfile b/samples/echobot/Dockerfile new file mode 100644 index 0000000..8d8bca5 --- /dev/null +++ b/samples/echobot/Dockerfile @@ -0,0 +1,9 @@ +FROM reo7sp/tgbot-cpp +MAINTAINER Oleg Morozenkov +ENV REFRESHED_AT 2015-08-12 + +WORKDIR /tmp/echobot +COPY . . +RUN cmake . +RUN make -j4 +CMD ./echobot |