Skip to content

scandyna/MdtPlainText

Topic Status
Build / test (CI) pipeline status
Coverity Coverity
OpenHub View on OpenHub

MdtPlainText

Provides some libraries to read and write simple plain text using the boost Spirit library.

The main use case is a CSV parser, that should read files conform to CSV-1203 and RFC 4180

Usage

For the available classes, functions, and their usage, see the API documentation

Required tools and libraries

Some tools and libraries are required to use MdtPlainText:

  • Git
  • CMake
  • Conan (optional)
  • A compiler (Gcc or Clang or MSVC)
  • Make (optional)
  • Qt5 (optional: for libraries with Qt support or for the tests)

For a overview how to install them, see https://gitlab.com/scandyna/build-and-install-cpp

CMake project description

Update your CMakeLists.txt to use the required libraries:

cmake_minimum_required(VERSION 3.15)
project(MyApp)

find_package(Mdt0 REQUIRED COMPONENTS PlainText)

add_executable(myApp myApp.cpp)
target_link_libraries(myApp Mdt0::PlainText)

If you use Qt, you can use PlainText_QtCore:

cmake_minimum_required(VERSION 3.15)
project(MyApp)

find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(Mdt0 REQUIRED COMPONENTS PlainText_QtCore)

add_executable(myApp myApp.cpp)
target_link_libraries(myApp Mdt0::PlainText_QtCore)

Project using Conan

If you use Conan, add MdtPlainText as requirement in your conanfile.txt:

[requires]
mdtplaintext/x.y.z@scandyna/testing

[generators]
CMakeDeps
CMakeToolchain
VirtualBuildEnv

If you need better unicode support, you may choose the Qt based one:

[requires]
mdtplaintext_qtcore/x.y.z@scandyna/testing

[generators]
CMakeDeps
CMakeToolchain
VirtualBuildEnv

Build and install MdtPlainText

This chapter covers only the installation of the library. To run the unit tests, see the next chapter.

Get MdtPlainText:

git clone git@gitlab.com:scandyna/mdtplaintext.git

Create a build directory and cd to it:

mkdir build
cd build

Note about install prefix

Some note on the CMAKE_INSTALL_PREFIX:

  • To target a system wide installation on Linux, set it to /usr (-DCMAKE_INSTALL_PREFIX=/usr) .
  • For other locations, spcecify also the <package-name>, (for example -DCMAKE_INSTALL_PREFIX=~/opt/MdtPlainText).

For details about that, see:

Build and install MdtPlainText using Conan

This is the recommended way.

Project configuration using Conan

MdtPlainText has those dependencies:

Here are the available options:

Option Default Possible Values Explanations
shared True [True, False] Build as shared library

Using Conan profiles

When using Conan for dependency management, it is recommended to use Conan profiles. This permits to have personal binary repository, avoiding to recompile everything everytime. This becomes more important if Qt is managed by Conan.

This requires modifications in the settings_user.yml Conan configuration, and also some profile files. See my conan-config repository for more informations.

Some following sections will rely on Conan profiles.

Build and install on Linux with the native compiler

Install the dependencies:

conan install -s build_type=Release --build=missing ..

Configure MdtPlainText:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/opt/MdtPlainText ..
cmake-gui .

To build and install, run:

cmake --build . --target INSTALL

Build and install on Windows MinGW

Open a terminal that has gcc and mingw32-make in the PATH.

Create a build directory and go to it:

mkdir build
cd build

Install the required dependencies:

conan install --profile windows_gcc7_x86_64 -s build_type=Release --build=missing ..

Configure the project:

cmake -G"MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\some\path -DCMAKE_BUILD_TYPE=Release ..
cmake-gui .

If QT_PREFIX_PATH was not specified, and no Qt5 installation is in the PATH, a error will probably occur, telling that Qt was not found. Set the QT_PREFIX_PATH by choosing the path to the Qt5 installation, then run "Configure".

Also choose different options, like the components to build. Once done, run "Generate", then quit cmake-gui.

To build and install, run:

cmake --build . --target INSTALL

Work on MdtPlainText

Build

See BUILD.

Create Conan package

See README in the conan packaging folder.

About

Provides some libraries to read and write simple plain text using the boost Spirit library. The main use case is a CSV parser that should read files conforming to CSV-1203 and RFC-4180 standards.

Topics

Resources

License

BSL-1.0 and 2 other licenses found

Licenses found

BSL-1.0
LICENSE.txt
GPL-3.0
COPYING
LGPL-3.0
COPYING.LESSER

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors