-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (32 loc) · 1.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.10)
project(AzureIoT C)
azsphere_configure_tools(TOOLS_REVISION "20.04")
azsphere_configure_api(TARGET_API_SET "5")
add_executable(${PROJECT_NAME} main.c eventloop_timer_utilities.c parson.c AS5600/AS5600.c wire/wire.c vl53l0x/vl53l0x.c)
target_include_directories(${PROJECT_NAME} PUBLIC ${AZURE_SPHERE_API_SET_DIR}/usr/include/azureiot
${PROJECT_NAME}/include
${PROJECT_NAME}/AS5600
${PROJECT_NAME}/vl53l0x
${PROJECT_NAME}/wire
C:/Users/rlisiecki/.platformio/packages/framework-azure/arduino/core
C:/Users/rlisiecki/.platformio/packages/framework-azure/arduino/variants/avnet_aesms_mt3620
C:/Users/rlisiecki/.platformio/packages/framework-azure/arduino/arduino)
target_compile_definitions(${PROJECT_NAME} PUBLIC AZURE_IOT_HUB_CONFIGURED)
target_link_libraries(${PROJECT_NAME} m azureiot applibs pthread gcc_s c)
azsphere_target_hardware_definition(${PROJECT_NAME} TARGET_DIRECTORY "Hardware/avnet_aesms_mt3620" TARGET_DEFINITION "avnet_aesms_mt3620.json")
find_program(POWERSHELL powershell.exe)
if (POWERSHELL)
# Run validate_manifest script during build
add_custom_target(ValidateManifest ALL
COMMAND ${POWERSHELL} -ExecutionPolicy Bypass -NoProfile -NonInteractive -File ${CMAKE_SOURCE_DIR}/script/validate_manifest.ps1
DEPENDS ${CMAKE_SOURCE_DIR}/app_manifest.json)
else()
# Warn users without PowerShell to update their manifest
add_custom_target(ValidateManifest ALL
COMMAND echo "Please ensure that you have updated app_manifest.json as described in IoTCentral.md or IoTHub.md, as appropriate."
DEPENDS ${CMAKE_SOURCE_DIR}/app_manifest.json)
endif()
add_dependencies(ValidateManifest ${PROJECT_NAME})
azsphere_target_add_image_package(${PROJECT_NAME})