forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[azure-iot-sdk-c, azure-c-shared-utility] Fix linking of parson, uhtt…
…p, CURL, OpenSSL; modernize (microsoft#22869) * [azure-c-shared-utility] Use targets for OpenSSL and CURL * [azure-c-shared-utility] Modernize portfile * [azure-iot-sdk-c] Fix parson dependency * [azure-iot-sdk-c] Modernize portfile * [azure-iot-sdk-c] Fix iothubclient include dirs * [azure-iot-sdk-c] Fix uhttp dependency * Update versions
- Loading branch information
Showing
12 changed files
with
143 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 46334c1..aaeea20 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -115,7 +115,6 @@ if(${use_openssl}) | ||
if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto OR NOT ${OPENSSL_INCLUDE_DIR}) | ||
find_package(OpenSSL REQUIRED) | ||
endif() | ||
- include_directories(${OPENSSL_INCLUDE_DIR}) | ||
endif() | ||
|
||
if(${use_applessl}) | ||
@@ -521,8 +520,7 @@ if(${use_http}) | ||
set(CURL_FIND_REQUIRED 1) | ||
find_package_handle_standard_args(CURL DEFAULT_MSG CURL_LIBRARIES) | ||
|
||
- include_directories(${CURL_INCLUDE_DIRS}) | ||
- set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${CURL_LIBRARIES}) | ||
+ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} CURL::libcurl) | ||
endif(NOT use_builtin_httpapi) | ||
endif() | ||
endif(${use_http}) | ||
@@ -561,7 +559,7 @@ if(${use_bearssl}) | ||
endif() | ||
|
||
if(${use_openssl}) | ||
- set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${OPENSSL_LIBRARIES}) | ||
+ set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} OpenSSL::SSL) | ||
if (WIN32) | ||
set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2_32 secur32) | ||
endif() | ||
@@ -703,7 +701,7 @@ write_basic_package_version_file( | ||
|
||
configure_file("configs/${PROJECT_NAME}Config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" | ||
- COPYONLY | ||
+ @ONLY | ||
) | ||
|
||
install(EXPORT aziotsharedutilTargets | ||
@@ -715,7 +713,7 @@ install(EXPORT aziotsharedutilTargets | ||
|
||
install( | ||
FILES | ||
- "configs/${PROJECT_NAME}Config.cmake" | ||
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" | ||
"configs/${PROJECT_NAME}Functions.cmake" | ||
"configs/azure_iot_build_rules.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" | ||
diff --git a/configs/azure_c_shared_utilityConfig.cmake b/configs/azure_c_shared_utilityConfig.cmake | ||
index 416dd1c..0e1e4d4 100644 | ||
--- a/configs/azure_c_shared_utilityConfig.cmake | ||
+++ b/configs/azure_c_shared_utilityConfig.cmake | ||
@@ -1,8 +1,11 @@ | ||
#Copyright (c) Microsoft. All rights reserved. | ||
#Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
-if(UNIX) | ||
- include(CMakeFindDependencyMacro) | ||
+include(CMakeFindDependencyMacro) | ||
+if("@use_openssl@") | ||
+ find_dependency(OpenSSL) | ||
+endif() | ||
+if(UNIX AND NOT "@use_builtin_httpapi@") | ||
find_dependency(CURL) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/iothub_client/CMakeLists.txt b/iothub_client/CMakeLists.txt | ||
index 07ab3b7..9769a08 100644 | ||
--- a/iothub_client/CMakeLists.txt | ||
+++ b/iothub_client/CMakeLists.txt | ||
@@ -441,7 +441,7 @@ add_library(iothub_client | ||
target_include_directories(iothub_client | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> | ||
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/azureiot/include> | ||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/azureiot> | ||
) | ||
applyXcodeBuildFlagsIfNeeded(iothub_client) | ||
target_link_libraries(iothub_client ${iothub_client_libs}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters