aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/FindIDN.cmake
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 15:30:12 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 15:30:12 +0300
commit0a35af177414ff232a34dba196112ffaeb7dfb6d (patch)
tree64945cac14f42a4a955a28f87033723c58e76943 /cmake/FindIDN.cmake
parent7242975d1ea33c33921a365827be7ed0fc1a1ef5 (diff)
downloadydb-0a35af177414ff232a34dba196112ffaeb7dfb6d.tar.gz
intermediate changes
ref:476cbe460057ff515d26b92b4b16691169b2876b
Diffstat (limited to 'cmake/FindIDN.cmake')
-rw-r--r--cmake/FindIDN.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/FindIDN.cmake b/cmake/FindIDN.cmake
new file mode 100644
index 0000000000..7342fb6d7a
--- /dev/null
+++ b/cmake/FindIDN.cmake
@@ -0,0 +1,26 @@
+# - Find IDN
+#
+# IDN_INCLUDE - Where to find LibIDN public headers
+# IDN_LIBS - List of libraries when using LibIDN.
+# IDN_FOUND - True if LibIDN found.
+
+find_path(IDN_INCLUDE_DIR
+ idna.h
+ HINTS $ENV{IDN_ROOT}/include)
+
+find_library(IDN_LIBRARIES
+ idn
+ HINTS $ENV{IDN_ROOT}/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(IDN DEFAULT_MSG IDN_LIBRARIES IDN_INCLUDE_DIR)
+
+mark_as_advanced(IDN_INCLUDE_DIR IDN_LIBRARIES)
+
+if (IDN_FOUND AND NOT TARGET IDN::IDN)
+ add_library(IDN::IDN UNKNOWN IMPORTED)
+ set_target_properties(IDN::IDN PROPERTIES
+ IMPORTED_LOCATION ${IDN_LIBRARIES}
+ INTERFACE_INCLUDE_DIRECTORIES ${IDN_INCLUDE_DIR}
+ )
+endif()