mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 22:58:14 -05:00
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:
19
examples/fmt/CMakeLists.txt
Normal file
19
examples/fmt/CMakeLists.txt
Normal 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
6
examples/fmt/main.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <fmt/format.h>
|
||||
|
||||
int main(){
|
||||
fmt::print("Hello, {}!\n", "world");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user