This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch feature/conan_find_module_unification in repository https://gitbox.apache.org/repos/asf/celix.git
commit d608c59ae999900216825772c77d78973f745f8d Author: PengZheng <[email protected]> AuthorDate: Thu Apr 7 18:25:58 2022 +0800 Unify conan autogenerated find modules with Celix's own find modules. --- CMakeLists.txt | 6 ++-- bundles/deployment_admin/CMakeLists.txt | 4 +-- .../example/refining_driver/src/refining_driver.c | 6 ++-- bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt | 4 +-- .../pubsub/pubsub_admin_websocket/CMakeLists.txt | 2 +- bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt | 2 +- bundles/pubsub/pubsub_spi/CMakeLists.txt | 2 +- .../pubsub/pubsub_topology_manager/CMakeLists.txt | 4 +-- .../remote_service_admin_dfi/CMakeLists.txt | 2 +- .../remote_service_admin_shm/CMakeLists.txt | 2 +- cmake/CelixConfig.cmake | 12 +++---- cmake/Modules/FindCppUTest.cmake | 23 ++++++------- cmake/Modules/FindSyslog.cmake | 39 ---------------------- cmake/Modules/FindZeroMQ.cmake | 6 ++-- cmake/Modules/Findczmq.cmake | 6 ++-- cmake/Modules/Findjansson.cmake | 6 ++-- cmake/Modules/{FindFFI.cmake => Findlibffi.cmake} | 14 ++++---- .../Modules/{FindUUID.cmake => Findlibuuid.cmake} | 18 +++++----- .../Modules/{FindLIBZIP.cmake => Findlibzip.cmake} | 8 ++--- libs/dfi/CMakeLists.txt | 4 +-- libs/dfi/gtest/CMakeLists.txt | 2 +- libs/etcdlib/cmake/Findjansson.cmake | 16 ++++----- libs/framework/CMakeLists.txt | 4 +-- libs/utils/CMakeLists.txt | 2 +- 24 files changed, 78 insertions(+), 116 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a29c94..3996dfc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,11 +29,11 @@ include(cmake/cmake_celix/UseCelix.cmake) #find required packages find_package(ZLIB REQUIRED) #framework -find_package(UUID REQUIRED) #framework +find_package(libuuid REQUIRED) #framework find_package(CURL REQUIRED) #framework, etcdlib -find_package(LIBZIP REQUIRED) #framework, etcdlib +find_package(libzip REQUIRED) #framework, etcdlib find_package(jansson REQUIRED) #etcdlib, dfi -find_package(FFI REQUIRED) #dfi +find_package(libffi REQUIRED) #dfi set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) diff --git a/bundles/deployment_admin/CMakeLists.txt b/bundles/deployment_admin/CMakeLists.txt index fde8f2b5..611c69cb 100644 --- a/bundles/deployment_admin/CMakeLists.txt +++ b/bundles/deployment_admin/CMakeLists.txt @@ -20,7 +20,7 @@ if (DEPLOYMENT_ADMIN) message(WARNING "Celix::deployment_admin is considered unstable, because develop of this bundle has been dormant for a while") find_package(CURL REQUIRED) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) find_package(ZLIB REQUIRED) add_library(deployment_admin_api INTERFACE) @@ -46,7 +46,7 @@ if (DEPLOYMENT_ADMIN) ) target_compile_definitions(deployment_admin PRIVATE -DUSE_FILE32API) - target_link_libraries(deployment_admin PRIVATE CURL::libcurl UUID::lib ZLIB::ZLIB deployment_admin_api) + target_link_libraries(deployment_admin PRIVATE CURL::libcurl libuuid::libuuid ZLIB::ZLIB deployment_admin_api) install(TARGETS deployment_admin_api EXPORT celix COMPONENT deployment_admin INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/deployment_admin) diff --git a/bundles/device_access/example/refining_driver/src/refining_driver.c b/bundles/device_access/example/refining_driver/src/refining_driver.c index 0af416d1..25c2187a 100644 --- a/bundles/device_access/example/refining_driver/src/refining_driver.c +++ b/bundles/device_access/example/refining_driver/src/refining_driver.c @@ -24,6 +24,7 @@ * \copyright Apache License, Version 2.0 */ +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -198,9 +199,10 @@ celix_status_t refiningDriver_attach(void * driverHandler, service_reference_pt status = refiningDriver_createDevice(driver, reference, device_service, &refiningDevice); if (status == CELIX_SUCCESS) { driver->deviceCount+=1; - char serial[5]; - sprintf(serial, "%4i", driver->deviceCount); + char *serial; + asprintf(&serial, "%4i", driver->deviceCount); status = refiningDriver_registerDevice(driver, refiningDevice, serial); + free(serial); } } return status; diff --git a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt index 9acfbbc5..8155adf9 100644 --- a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt @@ -17,7 +17,7 @@ celix_subproject(PUBSUB_PSA_TCP "Build TCP PubSub Admin" ON) if (PUBSUB_PSA_TCP) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) add_celix_bundle(celix_pubsub_admin_tcp BUNDLE_SYMBOLICNAME "apache_celix_pubsub_admin_tcp" @@ -38,7 +38,7 @@ if (PUBSUB_PSA_TCP) target_include_directories(celix_pubsub_admin_tcp PRIVATE src) # cmake find package UUID set the wrong include dir for OSX, does Conan solve this? if (NOT APPLE) - target_link_libraries(celix_pubsub_admin_tcp PRIVATE UUID::lib) + target_link_libraries(celix_pubsub_admin_tcp PRIVATE libuuid::libuuid) endif() install_celix_bundle(celix_pubsub_admin_tcp EXPORT celix COMPONENT pubsub) diff --git a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt index 8a59ffa7..8786111f 100644 --- a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt @@ -18,7 +18,7 @@ celix_subproject(PUBSUB_PSA_WS "Build WebSocket PubSub Admin" ON DEPS HTTP_ADMIN) if (PUBSUB_PSA_WS) find_package(jansson REQUIRED) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) add_celix_bundle(celix_pubsub_admin_websocket BUNDLE_SYMBOLICNAME "apache_celix_pubsub_admin_websocket" diff --git a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt index a76ccd0d..0c33f21d 100644 --- a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt @@ -19,7 +19,7 @@ celix_subproject(PUBSUB_PSA_ZMQ "Build ZeroMQ PubSub Admin (LGPL License)" ON) if (PUBSUB_PSA_ZMQ) find_package(ZeroMQ REQUIRED) find_package(czmq REQUIRED) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) set(OPTIONAL_OPENSSL_LIB ) # FIXME: ZMQ_SECURITY doesn't compile now diff --git a/bundles/pubsub/pubsub_spi/CMakeLists.txt b/bundles/pubsub/pubsub_spi/CMakeLists.txt index 465fea8d..7cb2e0ea 100644 --- a/bundles/pubsub/pubsub_spi/CMakeLists.txt +++ b/bundles/pubsub/pubsub_spi/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -find_package(UUID REQUIRED) +find_package(libuuid REQUIRED) add_library(pubsub_spi STATIC src/pubsub_endpoint.c diff --git a/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt b/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt index 98a4de0d..ab229f46 100644 --- a/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt +++ b/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -find_package(UUID REQUIRED) +find_package(libuuid REQUIRED) add_celix_bundle(celix_pubsub_topology_manager BUNDLE_SYMBOLICNAME "apache_celix_pubsub_topology_manager" @@ -28,7 +28,7 @@ add_celix_bundle(celix_pubsub_topology_manager ) target_link_libraries(celix_pubsub_topology_manager PRIVATE Celix::framework Celix::log_helper Celix::shell_api) target_link_libraries(celix_pubsub_topology_manager PRIVATE Celix::pubsub_spi Celix::pubsub_utils ) -target_link_libraries(celix_pubsub_topology_manager PRIVATE UUID::lib) +target_link_libraries(celix_pubsub_topology_manager PRIVATE libuuid::libuuid) install_celix_bundle(celix_pubsub_topology_manager EXPORT celix COMPONENT pubsub) diff --git a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt index 5744e554..5a4a8285 100644 --- a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt @@ -19,7 +19,7 @@ celix_subproject(RSA_REMOTE_SERVICE_ADMIN_DFI "Option to enable building the Rem if (RSA_REMOTE_SERVICE_ADMIN_DFI) find_package(CURL REQUIRED) find_package(jansson REQUIRED) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) add_celix_bundle(rsa_dfi VERSION 0.9.0 diff --git a/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt index 75f06082..af430e6b 100644 --- a/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt @@ -17,7 +17,7 @@ celix_subproject(RSA_REMOTE_SERVICE_ADMIN_SHM "Option to enable building the Remote Service Admin Service SHM bundle" OFF) if (RSA_REMOTE_SERVICE_ADMIN_SHM) - find_package(UUID REQUIRED) + find_package(libuuid REQUIRED) link_directories("/opt/local/lib") diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake index 06ed9e98..417fe4e2 100644 --- a/cmake/CelixConfig.cmake +++ b/cmake/CelixConfig.cmake @@ -77,11 +77,11 @@ set(CELIX_SHELL_TUI_BUNDLE ${CELIX_BUNDLES_DIR}/shell_tui.zip) include(CMakeFindDependencyMacro) find_dependency(ZLIB) #Needed by framework -find_dependency(UUID) #Needed by framework +find_dependency(libuuid) #Needed by framework find_dependency(CURL) #Needed by framework (used for curl initialization) -find_dependency(LIBZIP) #Needed by utils -find_dependency(Jansson) #Needed by dfi, etcdlib, remote services, pubsub -find_dependency(FFI) #Needed by dfi +find_dependency(libzip) #Needed by utils +find_dependency(jansson) #Needed by dfi, etcdlib, remote services, pubsub +find_dependency(libffi) #Needed by dfi set(THREADS_PREFER_PTHREAD_FLAG ON) find_dependency(Threads) @@ -112,8 +112,8 @@ if (TARGET Celix::rsa_discovery_common OR TARGET Celix::bonjour_shell) find_dependency(LibXml2) endif () if (TARGET Celix::celix_pubsub_admin_zmq OR TARGET Celix::celix_pubsub_admin_zmq_v2) - find_dependency(ZMQ) - find_dependency(CZMQ) + find_dependency(ZeroMQ) + find_dependency(czmq) endif () if (TARGET Celix::pubsub_admin_nanomsg) find_dependency(NanoMsg) diff --git a/cmake/Modules/FindCppUTest.cmake b/cmake/Modules/FindCppUTest.cmake index 5ab84437..26d14514 100644 --- a/cmake/Modules/FindCppUTest.cmake +++ b/cmake/Modules/FindCppUTest.cmake @@ -41,7 +41,7 @@ INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUTest DEFAULT_MSG CppUTest_LIBRARY CppUTest_INCLUDE_DIR) -IF(CPPUTEST_FOUND) +IF(CppUTest_FOUND) SET(CppUTest_LIBRARIES ${CppUTest_LIBRARY}) SET(CppUTest_INCLUDE_DIRS ${CppUTest_INCLUDE_DIR}) if(NOT TARGET CppUTest::CppUTest) @@ -51,14 +51,13 @@ IF(CPPUTEST_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${CppUTest_INCLUDE_DIR}" ) endif() -ENDIF(CPPUTEST_FOUND) - -SET(CppUTest_EXT_LIBRARIES ${CppUTest_EXT_LIBRARY}) -SET(CppUTest_EXT_INCLUDE_DIRS ${CppUTest_EXT_INCLUDE_DIR}) -if(NOT TARGET CppUTest::CppUTestExt) - add_library(CppUTest::CppUTestExt STATIC IMPORTED) - set_target_properties(CppUTest::CppUTestExt PROPERTIES - IMPORTED_LOCATION "${CppUTest_EXT_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${CppUTest_EXT_INCLUDE_DIR}" - ) -endif() \ No newline at end of file + SET(CppUTest_EXT_LIBRARIES ${CppUTest_EXT_LIBRARY}) + SET(CppUTest_EXT_INCLUDE_DIRS ${CppUTest_EXT_INCLUDE_DIR}) + if(NOT TARGET CppUTest::CppUTestExt) + add_library(CppUTest::CppUTestExt STATIC IMPORTED) + set_target_properties(CppUTest::CppUTestExt PROPERTIES + IMPORTED_LOCATION "${CppUTest_EXT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CppUTest_EXT_INCLUDE_DIR}" + ) + endif() +ENDIF(CppUTest_FOUND) diff --git a/cmake/Modules/FindSyslog.cmake b/cmake/Modules/FindSyslog.cmake deleted file mode 100644 index f2385386..00000000 --- a/cmake/Modules/FindSyslog.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# 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 Syslog -# Once done this will define -# SYSLOG_FOUND - System has Syslog -# JANSSON_INCLUDE_DIRS - The Syslog include directories -# SYSLOG::lib - Imported target for Syslog - -find_path(SYSLOG_INCLUDE_DIR syslog.h /usr/include) - -include(FindPackageHandleStandardArgs) - -find_package_handle_standard_args(SYSLOG DEFAULT_MSG - SYSLOG_INCLUDE_DIR) - -set(Syslog_INCLUDE_DIRS ${SYSLOG_INCLUDE_DIR}) -mark_as_advanced(SYSLOG_INCLUDE_DIR) - -if (SYSLOG_FOUND AND NOT TARGET SYSLOG::lib) - add_library(SYSLOG::lib SHARED IMPORTED) - set_target_properties(SYSLOG::lib PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SYSLOG_INCLUDE_DIR}" - ) -endif () diff --git a/cmake/Modules/FindZeroMQ.cmake b/cmake/Modules/FindZeroMQ.cmake index 489516a0..ca0f5d52 100644 --- a/cmake/Modules/FindZeroMQ.cmake +++ b/cmake/Modules/FindZeroMQ.cmake @@ -18,7 +18,7 @@ # - Try to find ZMQ # Once done this will define -# ZEROMQ_FOUND - System has Zmq +# ZeroMQ_FOUND - System has Zmq # ZEROMQ_INCLUDE_DIRS - The Zmq include directories # ZEROMQ_LIBRARIES - The libraries needed to use Zmq # ZEROMQ_DEFINITIONS - Compiler switches required for using Zmq @@ -35,14 +35,14 @@ set(ZEROMQ_LIBRARIES ${ZEROMQ_LIBRARY} ) set(ZEROMQ_INCLUDE_DIRS ${ZEROMQ_INCLUDE_DIR} ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set ZEROMQ_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set ZeroMQ_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(ZeroMQ DEFAULT_MSG ZEROMQ_LIBRARY ZEROMQ_INCLUDE_DIR) mark_as_advanced(ZEROMQ_INCLUDE_DIR ZEROMQ_LIBRARY ) -if (ZEROMQ_FOUND AND NOT TARGET ZeroMQ::ZeroMQ) +if (ZeroMQ_FOUND AND NOT TARGET ZeroMQ::ZeroMQ) add_library(ZeroMQ::ZeroMQ SHARED IMPORTED) set_target_properties(ZeroMQ::ZeroMQ PROPERTIES IMPORTED_LOCATION "${ZEROMQ_LIBRARY}" diff --git a/cmake/Modules/Findczmq.cmake b/cmake/Modules/Findczmq.cmake index eb021d2f..2cc5a05a 100644 --- a/cmake/Modules/Findczmq.cmake +++ b/cmake/Modules/Findczmq.cmake @@ -18,7 +18,7 @@ # - Try to find CZMQ # Once done this will define -# CZMQ_FOUND - System has czmq +# czmq_FOUND - System has czmq # CZMQ_INCLUDE_DIRS - The czmq include directories # CZMQ_LIBRARIES - The libraries needed to use czmq # CZMQ_DEFINITIONS - Compiler switches required for using czmq @@ -35,14 +35,14 @@ set(CZMQ_LIBRARIES ${CZMQ_LIBRARY} ) set(CZMQ_INCLUDE_DIRS ${CZMQ_INCLUDE_DIR} ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set CZMQ_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set czmq_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(czmq DEFAULT_MSG CZMQ_LIBRARY CZMQ_INCLUDE_DIR) mark_as_advanced(CZMQ_INCLUDE_DIR CZMQ_LIBRARY) -if (CZMQ_FOUND AND NOT TARGET czmq::czmq) +if (czmq_FOUND AND NOT TARGET czmq::czmq) add_library(czmq::czmq SHARED IMPORTED) set_target_properties(czmq::czmq PROPERTIES IMPORTED_LOCATION "${CZMQ_LIBRARY}" diff --git a/cmake/Modules/Findjansson.cmake b/cmake/Modules/Findjansson.cmake index 29e84fb1..93efcce4 100644 --- a/cmake/Modules/Findjansson.cmake +++ b/cmake/Modules/Findjansson.cmake @@ -18,7 +18,7 @@ # - Try to find Jansson # Once done this will define -# JANSSON_FOUND - System has Jansson +# jansson_FOUND - System has Jansson # JANSSON_INCLUDE_DIRS - The Jansson include directories # JANSSON_LIBRARIES - The libraries needed to use Jansson # jansson::jansson - Imported target for Jansson @@ -34,14 +34,14 @@ set(JANSSON_LIBRARIES ${JANSSON_LIBRARY} ) set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set jansson_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(jansson DEFAULT_MSG JANSSON_LIBRARY JANSSON_INCLUDE_DIR) mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY) -if (JANSSON_FOUND AND NOT TARGET jansson::jansson) +if (jansson_FOUND AND NOT TARGET jansson::jansson) add_library(jansson::jansson SHARED IMPORTED) set_target_properties(jansson::jansson PROPERTIES IMPORTED_LOCATION "${JANSSON_LIBRARY}" diff --git a/cmake/Modules/FindFFI.cmake b/cmake/Modules/Findlibffi.cmake similarity index 83% rename from cmake/Modules/FindFFI.cmake rename to cmake/Modules/Findlibffi.cmake index c5152440..a0963b91 100644 --- a/cmake/Modules/FindFFI.cmake +++ b/cmake/Modules/Findlibffi.cmake @@ -18,8 +18,8 @@ # - Try to find libffi define the variables for the binaries/headers and include # # Once done this will define -# FFI_FOUND - System has libffi -# FFI::lib - Imported target for the libffi +# libffi_FOUND - System has libffi +# libffi::libffi - Imported target for the libffi find_library(FFI_LIBRARY NAMES ffi libffi PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local/opt/libffi /opt/local /usr /usr/local @@ -34,9 +34,9 @@ find_path(FFI_INCLUDE_DIR ffi.h ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set libffi_FOUND to TRUE # if all listed variables are TRUE -find_package_handle_standard_args(FFI DEFAULT_MSG +find_package_handle_standard_args(libffi DEFAULT_MSG FFI_LIBRARY FFI_INCLUDE_DIR) mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY) @@ -44,9 +44,9 @@ set(FFI_LIBRARIES ${FFI_LIBRARY}) set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR}) -if(FFI_FOUND AND NOT TARGET FFI::lib) - add_library(FFI::lib SHARED IMPORTED) - set_target_properties(FFI::lib PROPERTIES +if(libffi_FOUND AND NOT TARGET libffi::libffi) + add_library(libffi::libffi SHARED IMPORTED) + set_target_properties(libffi::libffi PROPERTIES IMPORTED_LOCATION "${FFI_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIR}" ) diff --git a/cmake/Modules/FindUUID.cmake b/cmake/Modules/Findlibuuid.cmake similarity index 78% rename from cmake/Modules/FindUUID.cmake rename to cmake/Modules/Findlibuuid.cmake index 4ce72b4f..cc6e3444 100644 --- a/cmake/Modules/FindUUID.cmake +++ b/cmake/Modules/Findlibuuid.cmake @@ -17,19 +17,19 @@ # - Try to find UUID # Once done this will define -# UUID_FOUND - System has UUID +# libuuid_FOUND - System has UUID # UUID_INCLUDE_DIRS - The UUID include directories # UUID_LIBRARIES - The libraries needed to use UUID -# UUID::lib - Imported target for UUID +# libuuid::libuuid - Imported target for UUID if (APPLE) set(UUID_INCLUDE_DIRS ) set(UUID_LIBRARIES ) - find_package_handle_standard_args(UUID DEFAULT_MSG) + find_package_handle_standard_args(libuuid DEFAULT_MSG) - if (NOT TARGET UUID::lib) - add_library(UUID::lib INTERFACE IMPORTED) + if (NOT TARGET libuuid::libuuid) + add_library(libuuid::libuuid INTERFACE IMPORTED) endif () else () @@ -41,15 +41,15 @@ else () PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 /lib/i386-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu) include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(UUID DEFAULT_MSG + find_package_handle_standard_args(libuuid DEFAULT_MSG UUID_LIBRARY UUID_INCLUDE_DIR) mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) set(UUID_LIBRARIES ${UUID_LIBRARY}) - if (UUID_FOUND AND NOT TARGET UUID::lib) - add_library(UUID::lib SHARED IMPORTED) - set_target_properties(UUID::lib PROPERTIES + if (libuuid_FOUND AND NOT TARGET libuuid::libuuid) + add_library(libuuid::libuuid SHARED IMPORTED) + set_target_properties(libuuid::libuuid PROPERTIES IMPORTED_LOCATION "${UUID_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}" ) diff --git a/cmake/Modules/FindLIBZIP.cmake b/cmake/Modules/Findlibzip.cmake similarity index 87% rename from cmake/Modules/FindLIBZIP.cmake rename to cmake/Modules/Findlibzip.cmake index 34710ddd..0d67aee4 100644 --- a/cmake/Modules/FindLIBZIP.cmake +++ b/cmake/Modules/Findlibzip.cmake @@ -18,7 +18,7 @@ # - Try to find libzip # # Once done this will define -# LIBZIP_FOUND - System has libffi +# libzip_FOUND - System has libffi # libzip::libzip target (if found) find_library(LIBZIP_LIBRARY NAMES zip @@ -32,12 +32,12 @@ find_path(LIBZIP_INCLUDE_DIR zip.h ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set LIBZIP_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set libzip_FOUND to TRUE # if all listed variables are TRUE -find_package_handle_standard_args(LIBZIP DEFAULT_MSG +find_package_handle_standard_args(libzip DEFAULT_MSG LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR) -if(LIBZIP_FOUND AND NOT TARGET libzip::libzip) +if(libzip_FOUND AND NOT TARGET libzip::libzip) add_library(libzip::libzip IMPORTED STATIC GLOBAL) set_target_properties(libzip::libzip PROPERTIES IMPORTED_LOCATION "${LIBZIP_LIBRARY}" diff --git a/libs/dfi/CMakeLists.txt b/libs/dfi/CMakeLists.txt index fa59d014..69363420 100644 --- a/libs/dfi/CMakeLists.txt +++ b/libs/dfi/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -find_package(FFI REQUIRED) +find_package(libffi REQUIRED) find_package(jansson REQUIRED) set(SOURCES @@ -40,7 +40,7 @@ target_include_directories(dfi PUBLIC $<INSTALL_INTERFACE:include/celix/dfi> ) -target_link_libraries(dfi PRIVATE FFI::lib) +target_link_libraries(dfi PRIVATE libffi::libffi) target_link_libraries(dfi PUBLIC jansson::jansson) target_link_libraries(dfi PRIVATE Celix::utils) set_target_properties(dfi PROPERTIES "SOVERSION" 1) diff --git a/libs/dfi/gtest/CMakeLists.txt b/libs/dfi/gtest/CMakeLists.txt index c16968d5..8f3ed910 100644 --- a/libs/dfi/gtest/CMakeLists.txt +++ b/libs/dfi/gtest/CMakeLists.txt @@ -32,7 +32,7 @@ add_executable(test_dfi src/avrobin_serialization_tests.cpp ) -target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils FFI::lib jansson::jansson GTest::gtest GTest::gtest_main) +target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils libffi::libffi jansson::jansson GTest::gtest GTest::gtest_main) file(COPY ${CMAKE_CURRENT_LIST_DIR}/schemas DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/descriptors DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/libs/etcdlib/cmake/Findjansson.cmake b/libs/etcdlib/cmake/Findjansson.cmake index 5ab2ea68..93efcce4 100644 --- a/libs/etcdlib/cmake/Findjansson.cmake +++ b/libs/etcdlib/cmake/Findjansson.cmake @@ -18,35 +18,35 @@ # - Try to find Jansson # Once done this will define -# JANSSON_FOUND - System has Jansson +# jansson_FOUND - System has Jansson # JANSSON_INCLUDE_DIRS - The Jansson include directories # JANSSON_LIBRARIES - The libraries needed to use Jansson # jansson::jansson - Imported target for Jansson find_path(JANSSON_INCLUDE_DIR jansson.h - /usr/include - /usr/local/include ) + /usr/include + /usr/local/include ) find_library(JANSSON_LIBRARY NAMES jansson - PATHS /usr/lib /usr/local/lib ) + PATHS /usr/lib /usr/local/lib ) set(JANSSON_LIBRARIES ${JANSSON_LIBRARY} ) set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} ) include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE +# handle the QUIETLY and REQUIRED arguments and set jansson_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(jansson DEFAULT_MSG - JANSSON_LIBRARY JANSSON_INCLUDE_DIR) + JANSSON_LIBRARY JANSSON_INCLUDE_DIR) mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY) -if (JANSSON_FOUND AND NOT TARGET jansson::jansson) +if (jansson_FOUND AND NOT TARGET jansson::jansson) add_library(jansson::jansson SHARED IMPORTED) set_target_properties(jansson::jansson PROPERTIES IMPORTED_LOCATION "${JANSSON_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${JANSSON_INCLUDE_DIR}" - ) + ) endif () diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt index 607fc205..a6384634 100644 --- a/libs/framework/CMakeLists.txt +++ b/libs/framework/CMakeLists.txt @@ -16,7 +16,7 @@ # under the License. find_package(ZLIB REQUIRED) -find_package(UUID REQUIRED) +find_package(libuuid REQUIRED) find_package(CURL REQUIRED) set(SOURCES @@ -44,7 +44,7 @@ target_compile_options(framework PRIVATE -Wno-deprecated-declarations) #note par set_target_properties(framework PROPERTIES "SOVERSION" ${CELIX_MAJOR}) target_link_libraries(framework PUBLIC Celix::utils Celix::dfi ${CELIX_OPTIONAL_EXTRA_LIBS}) -target_link_libraries(framework PUBLIC UUID::lib CURL::libcurl ZLIB::ZLIB) +target_link_libraries(framework PUBLIC libuuid::libuuid CURL::libcurl ZLIB::ZLIB) target_link_libraries(framework PRIVATE ${CMAKE_DL_LIBS}) install(TARGETS framework EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index bb7b82c6..b33781a8 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -find_package(LIBZIP REQUIRED) +find_package(libzip REQUIRED) set(MEMSTREAM_SOURCES ) set(MEMSTREAM_INCLUDES )
