Skip to content

Commit

Permalink
add VSCode and CMake instructions (Azure#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
danewalton committed Jul 1, 2020
1 parent 90c9007 commit d856849
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"cmake.configureEnvironment": {
"VCPKG_ROOT": "",
"VCPKG_DEFAULT_TRIPLET": ""
},
"cmake.configureSettings": {
"WARNINGS_AS_ERRORS" : "ON",
"TRANSPORT_CURL" : "OFF",
"UNIT_TESTING" : "OFF",
"UNIT_TESTING_MOCKS" : "OFF",
"TRANSPORT_PAHO" : "OFF",
"PRECONDITIONS" : "ON",
"LOGGING" : "ON"
},
"cmake.debugConfig": {
"env": {
"AZ_IOT_DEVICE_ID": "",
"AZ_IOT_HUB_HOSTNAME": "",

"AZ_IOT_ID_SCOPE": "",
"AZ_IOT_REGISTRATION_ID": "",

"AZ_IOT_DEVICE_X509_CERT_PEM_FILE": "",
"AZ_IOT_DEVICE_X509_TRUST_PEM_FILE": "",

"AZ_IOT_HUB_DEVICE_SAS_KEY": "",
"AZ_IOT_HUB_DEVICE_SAS_KEY_DURATION": ""
}
}
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ With this in mind, there are many tenets or principles that we follow in order t
- [Getting Started Using the SDK](#getting-started-using-the-sdk)
- [CMake](#cmake)
- [CMake Options](#cmake-options)
- [VSCode](#vscode)
- [Source Files (IDE, command line, etc)](#source-files-ide-command-line-etc)
- [Running Samples](#running-samples)
- [Libcurl Global Init and Global Clean Up](#libcurl-global-init-and-global-clean-up)
Expand Down Expand Up @@ -200,6 +201,14 @@ The following CMake options are available for adding/removing project features.

i.e. cmake -DTRANSPORT_CURL=ON ..

### VSCode

For convenience, you can quickly get started using [VSCode](https://code.visualstudio.com/) and the [CMake Extension by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools&ssr=false#overview). Included in the repo is a `settings.json` file [here](https://github.com/Azure/azure-sdk-for-c/blob/master/.vscode/settings.json) which the extension will use to configure a CMake project. With this, you can run and debug samples and tests. Modify the variables in the file to your liking or as instructed by sample documentation and then select the following button in the extension:

![VSCode CMake Config](./sdk/docs/resources/vscode_cmake_config.png)

From there you can select targets to build and debug.

### Source Files (IDE, command line, etc)

We have set up the repo for easy integration into other projects which don't use CMake. Two main features make this possible:
Expand Down
Binary file added sdk/docs/resources/vscode_cmake_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d856849

Please sign in to comment.