Add fmt example and document version from git tag (#100)

* add VERSION_PREFIX argument

* add fmt example

* add VERSION_PREFIX note to readme

* rollback, add info about determining version from git tag

* rollback version
This commit is contained in:
Lars Melchior
2020-03-16 20:00:30 +01:00
committed by GitHub
parent 01b69aad82
commit cea81872cf
5 changed files with 27 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(CPMJSONExample)
# ---- Dependencies ----
include(../../cmake/CPM.cmake)
CPMAddPackage(
NAME fmt
GIT_TAG 6.1.2
GITHUB_REPOSITORY fmtlib/fmt
)
# ---- Executable ----
add_executable(CPMFmtExample "main.cpp")
set_target_properties(CPMFmtExample PROPERTIES CXX_STANDARD 17)
target_link_libraries(CPMFmtExample fmt)

6
examples/fmt/main.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include <fmt/format.h>
int main(){
fmt::print("Hello, {}!\n", "world");
return 0;
}