Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ project(tabulate VERSION 1.3.0 LANGUAGES CXX)
option(tabulate_BUILD_TESTS OFF)
option(SAMPLES "Build Samples" OFF)

set(TABULATE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

# Versionning
# ===========

# Project version
file(STRINGS "${TABULATE_INCLUDE_DIR}/tabulate/tabulate.hpp" tabulate_version_defines
REGEX "#define TABULATE_VERSION_(MAJOR|MINOR|PATCH)")
foreach(ver ${tabulate_version_defines})
if(ver MATCHES "#define TABULATE_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$")
set(TABULATE_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "")
endif()
endforeach()
set(TABULATE_VERSION
${TABULATE_VERSION_MAJOR}.${TABULATE_VERSION_MINOR}.${TABULATE_VERSION_PATCH})
message(STATUS "tabulate version: v${TABULATE_VERSION}")

if(MSVC)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
Expand Down Expand Up @@ -39,12 +56,17 @@ configure_package_config_file(tabulateConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tabulateConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tabulate)

write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${TABULATE_VERSION}
COMPATIBILITY AnyNewerVersion)

install(TARGETS tabulate EXPORT tabulateTargets)
install(EXPORT tabulateTargets
FILE tabulateTargets.cmake
NAMESPACE tabulate::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tabulate)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tabulateConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tabulate)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/tabulate
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
Expand Down
63 changes: 63 additions & 0 deletions include/tabulate/tabulate.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

/*
__ ___. .__ __
_/ |______ \_ |__ __ __| | _____ _/ |_ ____
\ __\__ \ | __ \| | \ | \__ \\ __\/ __ \
| | / __ \| \_\ \ | / |__/ __ \| | \ ___/
|__| (____ /___ /____/|____(____ /__| \___ >
\/ \/ \/ \/
Table Maker for Modern C++
https://github.com/p-ranav/tabulate

Licensed under the MIT License <http://opensource.org/licenses/MIT>.
SPDX-License-Identifier: MIT
Copyright (c) 2019 Pranav Srinivas Kumar <[email protected]>.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#ifndef TABULATE_EXPORT_HPP
#define TABULATE_EXPORT_HPP

// #ifdef _WIN32
// #ifdef TABULATE_STATIC_LIB
// #define TABULATE_API
// #else
// #ifdef TABULATE_EXPORTS
// #define TABULATE_API __declspec(dllexport)
// #else
// #define TABULATE_API __declspec(dllimport)
// #endif
// #endif
// #else
// #define TABULATE_API
// #endif

// Project version
#define TABULATE_VERSION_MAJOR 1
#define TABULATE_VERSION_MINOR 3
#define TABULATE_VERSION_PATCH 0

// Composing the protocol version string from major, and minor
#define TABULATE_CONCATENATE(A, B) TABULATE_CONCATENATE_IMPL(A, B)
#define TABULATE_CONCATENATE_IMPL(A, B) A##B
#define TABULATE_STRINGIFY(a) TABULATE_STRINGIFY_IMPL(a)
#define TABULATE_STRINGIFY_IMPL(a) #a

#endif
3 changes: 2 additions & 1 deletion single_include.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"include/tabulate/exporter.hpp",
"include/tabulate/markdown_exporter.hpp",
"include/tabulate/latex_exporter.hpp",
"include/tabulate/asciidoc_exporter.hpp"
"include/tabulate/asciidoc_exporter.hpp",
"include/tabulate/tabulate.hpp"
],
"include_paths": ["include"]
}