yail/CMakeLists.txt

48 lines
1.2 KiB
Text
Raw Normal View History

2024-10-22 18:23:46 +00:00
project(yail LANGUAGES CXX)
cmake_minimum_required(VERSION 3.28)
2024-10-22 18:26:12 +00:00
set(BOOST_INCLUDE_LIBRARIES "pfr;asio")
2024-10-22 18:23:46 +00:00
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)
2024-10-22 18:26:12 +00:00
CPMAddPackage(
NAME Boost
VERSION 1.85.0
URL "https://github.com/boostorg/boost/releases/download/boost-1.85.0/boost-1.85.0-cmake.tar.xz"
EXCLUDE_FROM_ALL ON
OPTIONS "BOOST_SKIP_INSTALL_RULES OFF"
)
2024-10-22 18:23:46 +00:00
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)
2024-10-22 18:26:12 +00:00
target_link_libraries(yail INTERFACE utempl::utempl Boost::asio)
2024-10-22 18:23:46 +00:00
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)