Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea/
/build/
/CMakeUserPresets.json
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand All @@ -9,6 +9,8 @@ string(STRIP ${VERSION} VERSION)

message("PROJECT_VERSION = ${VERSION}")

find_package(fmt CONFIG REQUIRED)

project(Hello LANGUAGES CXX VERSION ${VERSION})

set (SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
Expand All @@ -28,6 +30,7 @@ set(APP_SOURCE_FILES

add_library(hello ${LIB_SOURCE_FILES})
target_include_directories(hello PUBLIC "${INCLUDE_DIR}")
target_link_libraries(hello PRIVATE fmt::fmt)

add_executable(Hi ${APP_SOURCE_FILES})
target_link_libraries(Hi PRIVATE hello)
Expand Down
13 changes: 13 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 2,
"configurePresets": [
{
"name": "default",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
}
5 changes: 5 additions & 0 deletions src/hello.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#include <iostream>
#include <fmt/core.h>

#include "hello.h"

void hello() {
std::cout << "Hello" <<std::endl;
}

void hola() {
fmt::print("Hola!\n");
}
14 changes: 14 additions & 0 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default-registry": {
"kind": "git",
"baseline": "8d1bb02da069dcafdf92487e923e0a169b6df998",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}
5 changes: 5 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"fmt"
]
}