-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (27 loc) · 1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 3.15)
include(FetchContent)
set(CMAKE_CXX_STANDARD 17)
if(DEFINED ENV{VCPKG_ROOT})
set(vcpkg_SOURCE_DIR "$ENV{VCPKG_ROOT}")
set(CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
else()
message("vcpkg not detected, now installing it")
FetchContent_Declare(vcpkg GIT_REPOSITORY https://github.com/microsoft/vcpkg)
FetchContent_GetProperties(vcpkg)
if(NOT vcpkg_POPULATED)
FetchContent_Populate(vcpkg)
set(ENV{VCPKG_ROOT} "${vcpkg_SOURCE_DIR}")
execute_process(COMMAND "${vcpkg_SOURCE_DIR}/bootstrap-vcpkg.sh")
set(CMAKE_TOOLCHAIN_FILE
"${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
endif()
endif()
project(CSV_FEED LANGUAGES CXX)
execute_process(COMMAND "$ENV{VCPKG_ROOT}/vcpkg" install fmt date)
find_package(date CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
add_executable(test-1 test-1.cc)
target_link_libraries(test-1 PRIVATE fmt::fmt-header-only date::date)