This is an automated email from the ASF dual-hosted git repository.
pengzheng pushed a commit to branch feature/579-automatic-dependency-deduction
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/579-automatic-dependency-deduction by this push:
new 586e7b97 Add missing FindDNSSD.cmake
586e7b97 is described below
commit 586e7b97cd32e00808f60e51465db7f899e8d0d2
Author: PengZheng <[email protected]>
AuthorDate: Sat Jul 15 11:29:24 2023 +0800
Add missing FindDNSSD.cmake
---
cmake/Modules/FindDNSSD.cmake | 49 ++++++++++++++++++++++++++++++++
examples/conan_test_package/conanfile.py | 2 +-
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/cmake/Modules/FindDNSSD.cmake b/cmake/Modules/FindDNSSD.cmake
new file mode 100644
index 00000000..6c7320e4
--- /dev/null
+++ b/cmake/Modules/FindDNSSD.cmake
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# - Try to find DNSSD
+#
+# Once done this will define
+# DNSSD_FOUND - System has dns_sd
+# DNSSD::DNSSD target (if found)
+
+find_library(DNS_SD_LIBRARY NAMES dns_sd dns_services
+ PATHS $ENV{DNS_SD_DIR} ${DNS_SD_DIR} /usr /usr/local /opt/local
+ PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
+ )
+
+find_path(DNS_SD_INCLUDE_DIR dns_sd.h
+ PATHS $ENV{DNS_SD_DIR} ${DNS_SD_DIR} /usr /usr/local /opt/local
+ PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu
x86_64-linux-gnu
+ )
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set libzip_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(DNSSD DEFAULT_MSG
+ DNS_SD_LIBRARY DNS_SD_INCLUDE_DIR)
+
+if(DNSSD_FOUND AND NOT TARGET DNSSD::DNSSD)
+ add_library(DNSSD::DNSSD SHARED IMPORTED)
+ set_target_properties(DNSSD::DNSSD PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${DNS_SD_INCLUDE_DIR}"
+ IMPORTED_LOCATION "${DNS_SD_LIBRARY}"
+ )
+endif()
+
+unset(DNS_SD_LIBRARY)
+unset(DNS_SD_INCLUDE_DIR)
diff --git a/examples/conan_test_package/conanfile.py
b/examples/conan_test_package/conanfile.py
index 3c2e0d02..88c58a8e 100644
--- a/examples/conan_test_package/conanfile.py
+++ b/examples/conan_test_package/conanfile.py
@@ -22,7 +22,7 @@ import os
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake_paths", "cmake_find_package"
- requires = "celix/2.3.0@docker/test"
+ # requires = "celix/2.3.0@docker/test"
def build(self):
cmake = CMake(self)