-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes the SDK installable and a find module in CMake. Builds with -fP…
…IC always.
- Loading branch information
1 parent
63cdf6b
commit 3cce7d1
Showing
9 changed files
with
270 additions
and
91 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,10 @@ | ||
#Copyright (c) Microsoft. All rights reserved. | ||
#Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/azure_iot_sdksTargets.cmake") | ||
|
||
get_target_property(IOTHUB_CLIENT_INCLUDES iothub_client INTERFACE_INCLUDE_DIRECTORIES) | ||
|
||
set(IOTHUB_CLIENT_INCLUDES ${IOTHUB_CLIENT_INCLUDES} CACHE INTERNAL "") | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/azure_iot_sdksFunctions.cmake") |
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,63 @@ | ||
#Copyright (c) Microsoft. All rights reserved. | ||
#Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
function(linkUAMQP whatExecutableIsBuilding) | ||
include_directories(${UAMQP_INC_FOLDER}) | ||
|
||
if(WIN32) | ||
#windows needs this define | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
add_definitions(-DGB_MEASURE_MEMORY_FOR_THIS -DGB_DEBUG_ALLOC) | ||
|
||
target_link_libraries(${whatExecutableIsBuilding} uamqp aziotsharedutil ws2_32 secur32) | ||
|
||
if($<BOOL:${use_openssl}> OR $<BOOL:${use_wsio}>) | ||
target_link_libraries(${whatExecutableIsBuilding} $ENV{OpenSSLDir}/lib/ssleay32.lib $ENV{OpenSSLDir}/lib/libeay32.lib) | ||
|
||
file(COPY $ENV{OpenSSLDir}/bin/libeay32.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Debug) | ||
file(COPY $ENV{OpenSSLDir}/bin/ssleay32.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Debug) | ||
endif() | ||
else() | ||
target_link_libraries(${whatExecutableIsBuilding} uamqp aziotsharedutil ssl crypto) | ||
endif() | ||
|
||
if($<BOOL:${use_wsio}>) | ||
target_link_libraries(${whatExecutableIsBuilding} websockets) | ||
endif() | ||
endfunction(linkUAMQP) | ||
|
||
function(includeMqtt) | ||
include_directories(${MQTT_INC_FOLDER}) | ||
endfunction(includeMqtt) | ||
|
||
function(linkMqttLibrary whatExecutableIsBuilding) | ||
includeMqtt() | ||
target_link_libraries(${whatExecutableIsBuilding} umqtt) | ||
endfunction(linkMqttLibrary) | ||
|
||
function(includeHttp) | ||
endfunction(includeHttp) | ||
|
||
function(linkHttp whatExecutableIsBuilding) | ||
includeHttp() | ||
if(WIN32) | ||
if(WINCE) | ||
target_link_libraries(${whatExecutableIsBuilding} crypt32.lib) | ||
target_link_libraries(${whatExecutableIsBuilding} ws2.lib) | ||
else() | ||
target_link_libraries(${whatExecutableIsBuilding} winhttp.lib) | ||
endif() | ||
else() | ||
target_link_libraries(${whatExecutableIsBuilding} curl) | ||
endif() | ||
endfunction(linkHttp) | ||
|
||
function(linkWebSockets whatExecutableIsBuilding) | ||
if($<BOOL:${use_wsio}>) | ||
target_link_libraries(${whatExecutableIsBuilding} websockets) | ||
endif() | ||
endfunction(linkWebSockets) | ||
|
||
function(linkSharedUtil whatIsBuilding) | ||
target_link_libraries(${whatIsBuilding} aziotsharedutil) | ||
endfunction(linkSharedUtil) |
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,14 @@ | ||
#Copyright (c) Microsoft. All rights reserved. | ||
#Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
if(${use_installed_dependencies}) | ||
#These need to be set for the functions included by c-utility | ||
set(SHARED_UTIL_SRC_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility/src" CACHE INTERNAL "") | ||
set(SHARED_UTIL_ADAPTER_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility/adapters") | ||
set(SHARED_UTIL_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility") | ||
set_platform_files("${CMAKE_CURRENT_LIST_DIR}/c-utility") | ||
if(NOT umock_c_FOUND) | ||
find_package(umock_c REQUIRED CONFIG) | ||
include_directories(${UMOCK_C_INCLUDES}) | ||
endif() | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#Copyright (c) Microsoft. All rights reserved. | ||
#Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
if(${use_installed_dependencies}) | ||
if(NOT azure_c_shared_utility_FOUND) | ||
find_package(azure_c_shared_utility REQUIRED CONFIG) | ||
endif() | ||
if(NOT uamqp_FOUND) | ||
find_package(uamqp REQUIRED CONFIG) | ||
endif() | ||
if(NOT umqtt_FOUND) | ||
find_package(umqtt REQUIRED CONFIG) | ||
endif() | ||
if(${use_wsio}) | ||
if(NOT libwebsockets_FOUND) | ||
find_package(libwebsockets REQUIRED CONFIG) | ||
endif() | ||
endif() | ||
|
||
include_directories(${AZURE_C_SHARED_UTILITY_INCLUDES}/azure_c_shared_utility) | ||
else() | ||
add_subdirectory(c-utility) | ||
add_subdirectory(uamqp) | ||
add_subdirectory(umqtt) | ||
include_directories(${SHARED_UTIL_INC_FOLDER}/azure_c_shared_utility) | ||
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
Oops, something went wrong.