Skip to content

Commit

Permalink
Adds logic in CMake files for pulling parson submodule.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-buckley committed Nov 12, 2016
1 parent fc100c1 commit 7afe160
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/tests/gateway_e2e/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps
###############################################################################
#The azure_iot_sdks repo requires special treatment. Parson submodule must be initialized.
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c/parson/README.md)
execute_process(
COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/iot-sdk
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE res

)
if(${res})
message(FATAL_ERROR "Error pulling iot-sdk submodule: ${res}")
endif()
execute_process(
COMMAND git submodule update --init c/parson
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk
Expand Down
14 changes: 14 additions & 0 deletions dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,18 @@ else()
INTERFACE_COMPILE_OPTIONS "${NANOMSG_LDFLAGS}"
IMPORTED_LOCATION "${NANOMSG_LIBRARY_DIRS}/lib${NANOMSG_LIBRARIES}.so"
)
endif()

###############################################################################
#############################Init Parson Submodule#############################
###############################################################################
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/parson/parson.c)
execute_process(
COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/parson
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE res
)
if(${res})
message(FATAL_ERROR "Error pulling parson submodule: ${res}")
endif()
endif()
9 changes: 9 additions & 0 deletions modules/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ findAndInstall(umqtt ${PROJECT_SOURCE_DIR}/deps/umqtt ${PROJECT_SOURCE_DIR}/deps
###############################################################################
#The azure_iot_sdks repo requires special treatment. Parson submodule must be initialized.
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/deps/iot-sdk/c/parson/README.md)
execute_process(
COMMAND git submodule update --init ${PROJECT_SOURCE_DIR}/deps/iot-sdk
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE res

)
if(${res})
message(FATAL_ERROR "Error pulling iot-sdk submodule: ${res}")
endif()
execute_process(
COMMAND git submodule update --init c/parson
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/deps/iot-sdk
Expand Down

0 comments on commit 7afe160

Please sign in to comment.