2024-10-29 16:48:53 +08:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2019-06-05 07:01:27 +08:00
|
|
|
project(asio)
|
|
|
|
|
|
|
|
add_library(asio INTERFACE)
|
|
|
|
|
2024-10-29 16:48:53 +08:00
|
|
|
find_package(Threads)
|
|
|
|
if(Threads_FOUND)
|
|
|
|
target_link_libraries(asio INTERFACE Threads::Threads)
|
|
|
|
endif()
|
|
|
|
|
2019-06-05 07:01:27 +08:00
|
|
|
# Export target
|
|
|
|
install(TARGETS asio
|
|
|
|
EXPORT asio
|
|
|
|
INCLUDES DESTINATION include/
|
|
|
|
)
|
|
|
|
|
|
|
|
install(EXPORT asio
|
|
|
|
DESTINATION "share/asio"
|
|
|
|
FILE asio-targets.cmake
|
2024-10-29 16:48:53 +08:00
|
|
|
NAMESPACE asio::
|
2019-06-05 07:01:27 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
install(DIRECTORY
|
|
|
|
asio/include/asio
|
|
|
|
DESTINATION include/
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.hpp"
|
|
|
|
PATTERN "*.ipp"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES
|
|
|
|
asio/include/asio.hpp
|
|
|
|
DESTINATION include/
|
|
|
|
)
|
2024-10-29 16:48:53 +08:00
|
|
|
|
|
|
|
set(exec_prefix [[${prefix}]])
|
|
|
|
set(package_name [[asio]])
|
|
|
|
configure_file(asio/asio.pc.in "${PROJECT_BINARY_DIR}/asio.pc" @ONLY)
|
|
|
|
install(FILES "${PROJECT_BINARY_DIR}/asio.pc" DESTINATION share/pkgconfig)
|