36 lines
917 B
Text
36 lines
917 B
Text
|
project(yail LANGUAGES CXX)
|
||
|
cmake_minimum_required(VERSION 3.28)
|
||
|
|
||
|
|
||
|
set(UTEMPL_URL
|
||
|
"https://helicopter.myftp.org/git/sha512sum/utempl"
|
||
|
CACHE STRING "utempl repository URL")
|
||
|
|
||
|
file(
|
||
|
DOWNLOAD
|
||
|
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.0/CPM.cmake
|
||
|
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
|
||
|
EXPECTED_HASH
|
||
|
SHA256=7b354f3a5976c4626c876850c93944e52c83ec59a159ae5de5be7983f0e17a2a
|
||
|
)
|
||
|
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)
|
||
|
|
||
|
CPMAddPackage(
|
||
|
NAME utempl
|
||
|
URL "${UTEMPL_URL}/archive/refs/heads/main.zip"
|
||
|
EXCLUDE_FROM_ALL ON
|
||
|
OPTIONS "ENABLE_TESTS OFF" "ENABLE_EXAMPLES OFF"
|
||
|
)
|
||
|
|
||
|
add_library(yail INTERFACE)
|
||
|
|
||
|
target_link_libraries(yail INTERFACE utempl::utempl)
|
||
|
|
||
|
target_include_directories(yail INTERFACE
|
||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||
|
|
||
|
add_executable(main main.cpp)
|
||
|
|
||
|
target_link_libraries(main yail)
|