dvd0101 / conan-fmt

Conan (https://conan.io) package for C++ fmt format library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

conan-fmt

Conan (https://conan.io) package for C++ fmt format library

badge

Using the header-only approach. Tested and working in 94 different configurations in Windows, Linux and Mac:

Build status Build Status

Example

Add it to your requirements in conanfile.txt or conanfile.py:

[requires]
fmt/3.0.0@memsharded/testing

[generators]
cmake

If you are not using cmake in your project, check other conan generators.

Your example.cpp:

#include <iostream>
#include "fmt/format.h"

int main() {
    std::string message = fmt::format("The answer is {}", 42);
    std::cout<<message<<"\n";
}
project(YourProject)
cmake_minimum_required(VERSION 2.8.12)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})

Then you can use it as:

$ mkdir build && cd build
$ conan install .. --build=missing (this will use your default conan settings)
$ cmake .. -G "Visual Studio 14 Win64"
$ cmake --build . --config Release
$ bin/example

Note that I am using --build=missing. I haven't uploaded binary packages yet, just the recipe, so the package has to be built from sources.

About

Conan (https://conan.io) package for C++ fmt format library

License:MIT License


Languages

Language:Python 61.6%Language:Shell 24.5%Language:CMake 8.1%Language:C++ 5.8%