mirror of
https://github.com/UltraCoderRU/telebotxx.git
synced 2026-01-27 19:55:14 +00:00
Removed hardcoded build paths.
Type of libraries changed to static.
This commit is contained in:
parent
b80facba72
commit
f635883351
8 changed files with 167 additions and 36 deletions
|
|
@ -1,6 +1,8 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
||||
if (NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build (Release, Debug, RelWithDebInfo, MinSizeRel)")
|
||||
endif()
|
||||
|
||||
project(telebotxx CXX)
|
||||
|
||||
|
|
@ -30,10 +32,16 @@ endif()
|
|||
option (TELEBOTXX_BUILD_TESTS "Build unit tests using Boost.Test" ON)
|
||||
option (TELEBOTXX_GENERATE_DOC "Generate API documentation with Doxygen" ON)
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
|
||||
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
# Build and include Curl for People
|
||||
set(BUILD_CPR_TESTS OFF CACHE BOOL "Do not build cpr tests")
|
||||
set(USE_SYSTEM_CURL ON CACHE BOOL "Use system libcurl")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
find_package(CURL)
|
||||
if(CURL_FOUND)
|
||||
set(USE_SYSTEM_CURL ON CACHE BOOL "Use the system curl for faster builds")
|
||||
endif()
|
||||
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/ext/cpr)
|
||||
include_directories(${CPR_INCLUDE_DIRS})
|
||||
|
||||
|
|
@ -42,19 +50,25 @@ include_directories(${PROJECT_SOURCE_DIR}/ext/rapidjson/include)
|
|||
|
||||
# Build library
|
||||
include_directories(include)
|
||||
add_subdirectory(src build)
|
||||
add_subdirectory(src)
|
||||
|
||||
# Build tests
|
||||
if(TELEBOTXX_BUILD_TESTS)
|
||||
add_subdirectory(tests build-tests)
|
||||
add_subdirectory(tests)
|
||||
endif(TELEBOTXX_BUILD_TESTS)
|
||||
|
||||
# Generate docs
|
||||
if(TELEBOTXX_GENERATE_DOC)
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
add_custom_target(telebotxx-doc ALL COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Doxyfile COMMENT "Generating API documentation with Doxygen")
|
||||
else(DOXYGEN_FOUND)
|
||||
message(STATUS "WARNING: Doxygen not found - Reference manual will not be created")
|
||||
endif(DOXYGEN_FOUND)
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/Doxyfile.in Doxyfile)
|
||||
# Bootstrap theme for Doxygen
|
||||
file(COPY ${PROJECT_SOURCE_DIR}/doc/bootstrap.min.js
|
||||
${PROJECT_SOURCE_DIR}/doc/bootstrap.min.css
|
||||
${PROJECT_SOURCE_DIR}/doc/doxy-boot.js
|
||||
DESTINATION doc/html)
|
||||
add_custom_target(telebotxx-doc ALL COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile COMMENT "Generating API documentation with Doxygen")
|
||||
else(DOXYGEN_FOUND)
|
||||
message(STATUS "WARNING: Doxygen not found - Reference manual will not be created")
|
||||
endif(DOXYGEN_FOUND)
|
||||
endif(TELEBOTXX_GENERATE_DOC)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
|
|||
# identify the project. Note that if you do not use Doxywizard you need
|
||||
# to put quotes around the project name if it contains spaces.
|
||||
|
||||
PROJECT_NAME = "telebotxx"
|
||||
PROJECT_NAME = "${CMAKE_PROJECT_NAME}"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
|
|
@ -654,7 +654,7 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = include
|
||||
INPUT = ${CMAKE_SOURCE_DIR}/include
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
|
|
@ -892,13 +892,13 @@ HTML_FILE_EXTENSION = .html
|
|||
# have to redo this when upgrading to a newer version of doxygen or when
|
||||
# changing the value of configuration settings such as GENERATE_TREEVIEW!
|
||||
|
||||
HTML_HEADER = doc/header.html
|
||||
HTML_HEADER = ${CMAKE_SOURCE_DIR}/doc/header.html
|
||||
|
||||
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
||||
# each generated HTML page. If it is left blank doxygen will generate a
|
||||
# standard footer.
|
||||
|
||||
HTML_FOOTER = doc/footer.html
|
||||
HTML_FOOTER = ${CMAKE_SOURCE_DIR}/doc/footer.html
|
||||
|
||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
||||
# style sheet that is used by each HTML page. It can be used to
|
||||
|
|
@ -917,7 +917,7 @@ HTML_STYLESHEET =
|
|||
# robust against future updates. Doxygen will copy the style sheet file to
|
||||
# the output directory.
|
||||
|
||||
HTML_EXTRA_STYLESHEET = doc/customdoxygen.css
|
||||
HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_DIR}/doc/customdoxygen.css
|
||||
|
||||
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
||||
# other source files which should be copied to the HTML output directory. Note
|
||||
8
configure
vendored
8
configure
vendored
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf CMakeFiles
|
||||
rm -f CMakeCache.txt
|
||||
rm -f Makefile
|
||||
rm -f cmake_install.cmake
|
||||
|
||||
cmake .
|
||||
8
doc/bootstrap.min.css
vendored
Normal file
8
doc/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
7
doc/bootstrap.min.js
vendored
Normal file
7
doc/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
120
doc/doxy-boot.js
Normal file
120
doc/doxy-boot.js
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
$( document ).ready(function() {
|
||||
|
||||
$("div.headertitle").addClass("page-header");
|
||||
$("div.title").addClass("h1");
|
||||
|
||||
$('li > a[href="index.html"] > span').before("<i class='fa fa-cog'></i> ");
|
||||
$('li > a[href="modules.html"] > span').before("<i class='fa fa-square'></i> ");
|
||||
$('li > a[href="namespaces.html"] > span').before("<i class='fa fa-bars'></i> ");
|
||||
$('li > a[href="annotated.html"] > span').before("<i class='fa fa-list-ul'></i> ");
|
||||
$('li > a[href="classes.html"] > span').before("<i class='fa fa-book'></i> ");
|
||||
$('li > a[href="inherits.html"] > span').before("<i class='fa fa-sitemap'></i> ");
|
||||
$('li > a[href="functions.html"] > span').before("<i class='fa fa-list'></i> ");
|
||||
$('li > a[href="functions_func.html"] > span').before("<i class='fa fa-list'></i> ");
|
||||
$('li > a[href="functions_vars.html"] > span').before("<i class='fa fa-list'></i> ");
|
||||
$('li > a[href="functions_enum.html"] > span').before("<i class='fa fa-list'></i> ");
|
||||
$('li > a[href="functions_eval.html"] > span').before("<i class='fa fa-list'></i> ");
|
||||
$('img[src="ftv2ns.png"]').replaceWith('<span class="label label-danger">N</span> ');
|
||||
$('img[src="ftv2cl.png"]').replaceWith('<span class="label label-danger">C</span> ');
|
||||
|
||||
$("ul.tablist").addClass("nav nav-pills nav-justified");
|
||||
$("ul.tablist").css("margin-top", "0.5em");
|
||||
$("ul.tablist").css("margin-bottom", "0.5em");
|
||||
$("li.current").addClass("active");
|
||||
$("iframe").attr("scrolling", "yes");
|
||||
|
||||
$("#nav-path > ul").addClass("breadcrumb");
|
||||
|
||||
$("table.params").addClass("table");
|
||||
$("div.ingroups").wrapInner("<small></small>");
|
||||
$("div.levels").css("margin", "0.5em");
|
||||
$("div.levels > span").addClass("btn btn-default btn-xs");
|
||||
$("div.levels > span").css("margin-right", "0.25em");
|
||||
|
||||
$("table.directory").addClass("table table-striped");
|
||||
$("div.summary > a").addClass("btn btn-default btn-xs");
|
||||
$("table.fieldtable").addClass("table");
|
||||
$(".fragment").addClass("well");
|
||||
$(".memitem").addClass("panel panel-default");
|
||||
$(".memproto").addClass("panel-heading");
|
||||
$(".memdoc").addClass("panel-body");
|
||||
$("span.mlabel").addClass("label label-info");
|
||||
|
||||
$("table.memberdecls").addClass("table");
|
||||
$("[class^=memitem]").addClass("active");
|
||||
|
||||
$("div.ah").addClass("btn btn-default");
|
||||
$("span.mlabels").addClass("pull-right");
|
||||
$("table.mlabels").css("width", "100%")
|
||||
$("td.mlabels-right").addClass("pull-right");
|
||||
|
||||
$("div.ttc").addClass("panel panel-primary");
|
||||
$("div.ttname").addClass("panel-heading");
|
||||
$("div.ttname a").css("color", 'white');
|
||||
$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
|
||||
|
||||
$('#MSearchBox').parent().remove();
|
||||
|
||||
$('div.fragment.well div.line:first').css('margin-top', '15px');
|
||||
$('div.fragment.well div.line:last').css('margin-bottom', '15px');
|
||||
|
||||
$('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
|
||||
$(this).prepend('<thead></thead>');
|
||||
$(this).find('tbody > tr:first').prependTo($(this).find('thead'));
|
||||
|
||||
$(this).find('td > span.success').parent().addClass('success');
|
||||
$(this).find('td > span.warning').parent().addClass('warning');
|
||||
$(this).find('td > span.danger').parent().addClass('danger');
|
||||
});
|
||||
|
||||
|
||||
|
||||
if($('div.fragment.well div.ttc').length > 0)
|
||||
{
|
||||
$('div.fragment.well div.line:first').parent().removeClass('fragment well');
|
||||
}
|
||||
|
||||
$('table.memberdecls').find('.memItemRight').each(function(){
|
||||
$(this).contents().appendTo($(this).siblings('.memItemLeft'));
|
||||
$(this).siblings('.memItemLeft').attr('align', 'left');
|
||||
});
|
||||
|
||||
function getOriginalWidthOfImg(img_element) {
|
||||
var t = new Image();
|
||||
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
|
||||
return t.width;
|
||||
}
|
||||
|
||||
$('div.dyncontent').find('img').each(function(){
|
||||
if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width())
|
||||
$(this).css('width', '100%');
|
||||
});
|
||||
|
||||
$(".memitem").removeClass('memitem');
|
||||
$(".memproto").removeClass('memproto');
|
||||
$(".memdoc").removeClass('memdoc');
|
||||
$("span.mlabel").removeClass('mlabel');
|
||||
$("table.memberdecls").removeClass('memberdecls');
|
||||
$("[class^=memitem]").removeClass('memitem');
|
||||
$("span.mlabels").removeClass('mlabels');
|
||||
$("table.mlabels").removeClass('mlabels');
|
||||
$("td.mlabels-right").removeClass('mlabels-right');
|
||||
$(".navpath").removeClass('navpath');
|
||||
$("li.navelem").removeClass('navelem');
|
||||
$("a.el").removeClass('el');
|
||||
$("div.ah").removeClass('ah');
|
||||
$("div.header").removeClass("header");
|
||||
|
||||
$('.mdescLeft').each(function(){
|
||||
if($(this).html()==" ") {
|
||||
$(this).siblings('.mdescRight').attr('colspan', 2);
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
$('td.memItemLeft').each(function(){
|
||||
if($(this).siblings('.memItemRight').html()=="") {
|
||||
$(this).attr('colspan', 2);
|
||||
$(this).siblings('.memItemRight').remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -8,9 +8,6 @@ include_directories(${Boost_INCLUDE_DIRS})
|
|||
# Add required compiler flags
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
|
||||
# Put compiled library to 'lib' directory
|
||||
set(LIBRARY_OUTPUT_PATH "../lib")
|
||||
|
||||
set(SOURCE_FILES Attachment.cpp
|
||||
BotApi.cpp
|
||||
Chat.cpp
|
||||
|
|
@ -24,7 +21,7 @@ set(SOURCE_FILES Attachment.cpp
|
|||
SendPhotoRequest.cpp
|
||||
)
|
||||
|
||||
add_library(telebotxx SHARED ${SOURCE_FILES})
|
||||
add_library(telebotxx ${SOURCE_FILES})
|
||||
target_link_libraries(telebotxx ${CPR_LIBRARIES})
|
||||
|
||||
message(STATUS "Configuring telebotxx - done")
|
||||
|
|
|
|||
|
|
@ -10,14 +10,7 @@ find_package(Boost REQUIRED COMPONENTS unit_test_framework system)
|
|||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
|
||||
# Add required compiler flags
|
||||
# For Windows we suppress all warnings because of Boost garbage :(
|
||||
if(NOT WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
else(NOT WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
|
||||
endif(NOT WIN32)
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/tests")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
|
||||
set(SOURCE_FILES Dummy.cpp TestTypes.cpp TestApi.cpp)
|
||||
add_executable(telebotxx-test ${SOURCE_FILES})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue