From 53e5e8cb0143736eb69820220a220a72cdd616de Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 19:25:47 +0200 Subject: Fix issure #138: DLL export fails --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6587a48..4d916f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,3 +88,7 @@ if (ENABLE_TESTS) enable_testing() add_subdirectory(test) endif() + +if(MSVC AND BUILD_SHARED_LIBS) + add_definitions(-DTGBOT_DLL) +endif() \ No newline at end of file -- cgit v1.2.3 From b108df643ac3f7cde4e762dcc55483616b2ed2cd Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 19:33:50 +0200 Subject: Fix issue #137: Directory for boost auto linking is missing --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d916f2..b2f5970 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,7 @@ else() find_package(Boost 1.59.0 COMPONENTS system REQUIRED) endif() include_directories(${Boost_INCLUDE_DIR}) +link_directories(${Boost_LIBRARY_DIR_RELEASE}) set(LIB_LIST ${CMAKE_THREAD_LIBS_INIT} -- cgit v1.2.3 From 2e8398bd6f9326651460992e6e3a0121df449e83 Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 19:55:37 +0200 Subject: Add doxygen documentation to CMake --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b2f5970..6358d34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(TgBot) # options option(ENABLE_TESTS "Set to ON to enable building of tests" OFF) option(BUILD_SHARED_LIBS "Build tgbot-cpp shared/static library." OFF) +option(BUILD_DOCUMENTATION "Build doxygen API documentation." OFF) # sources set(CMAKE_CXX_STANDARD 14) @@ -90,6 +91,17 @@ if (ENABLE_TESTS) add_subdirectory(test) endif() +# Documentation +if(BUILD_DOCUMENTATION) + find_package(Doxygen REQUIRED) + add_custom_target(doc_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/ TYPE DOC) +endif() + if(MSVC AND BUILD_SHARED_LIBS) add_definitions(-DTGBOT_DLL) endif() \ No newline at end of file -- cgit v1.2.3 From 68a49a080cb7b9484b0c8330cf15a99084e5f63f Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 20:25:53 +0200 Subject: Indentations and GCC attribute added --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6358d34..f3a7e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,6 @@ if(BUILD_DOCUMENTATION) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/ TYPE DOC) endif() -if(MSVC AND BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_definitions(-DTGBOT_DLL) endif() \ No newline at end of file -- cgit v1.2.3 From 18421d59708479e3d54eba71518f761ee470256d Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 20:56:55 +0200 Subject: Fix to prevent Boost from linking dynamic and static libraries simultaneously when autolink is enabled. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f3a7e94..871e9b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ else() endif() include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIR_RELEASE}) +if(NOT Boost_USE_STATIC_LIBS) + add_definitions(-DBOOST_ALL_DYN_LINK) +endif() set(LIB_LIST ${CMAKE_THREAD_LIBS_INIT} -- cgit v1.2.3