diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /cmake/modules/Buildc-ares.cmake | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/Buildc-ares.cmake')
-rw-r--r-- | cmake/modules/Buildc-ares.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/modules/Buildc-ares.cmake b/cmake/modules/Buildc-ares.cmake new file mode 100644 index 00000000..83cac92f --- /dev/null +++ b/cmake/modules/Buildc-ares.cmake @@ -0,0 +1,22 @@ +function(build_c_ares) + include(ExternalProject) + set(C-ARES_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/c-ares") + set(C-ARES_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/c-ares") + ExternalProject_Add(c-ares_ext + SOURCE_DIR "${C-ARES_SOURCE_DIR}" + CMAKE_ARGS + -DCARES_STATIC=ON + -DCARES_SHARED=OFF + -DCARES_INSTALL=OFF + BINARY_DIR "${C-ARES_BINARY_DIR}" + BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> + INSTALL_COMMAND "") + add_library(c-ares::c-ares STATIC IMPORTED) + add_dependencies(c-ares::c-ares c-ares_ext) + set_target_properties(c-ares::c-ares PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${C-ARES_SOURCE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${C-ARES_BINARY_DIR}/lib/libcares.a") + # to appease find_package() + add_custom_target(c-ares DEPENDS c-ares::c-ares) +endfunction() |