Skip to content

Commit 3d9358c

Browse files
committed
Add linux command for cmake
1 parent da4c18a commit 3d9358c

File tree

1 file changed

+34
-27
lines changed

1 file changed

+34
-27
lines changed

articles/iot-dps/quick-create-simulated-device-x509.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -103,47 +103,54 @@ In this section, you prepare a development environment that's used to build the
103103
104104
4. In your Windows command prompt, run the following commands to clone the latest release of the [Azure IoT Device SDK for C](https://github.com/Azure/azure-iot-sdk-c) GitHub repository. Replace `<release-tag>` with the tag you copied in the previous step, for example: `lts_01_2023`.
105105
106-
```cmd
107-
git clone -b <release-tag> https://github.com/Azure/azure-iot-sdk-c.git
108-
cd azure-iot-sdk-c
109-
git submodule update --init
110-
```
106+
```cmd
107+
git clone -b <release-tag> https://github.com/Azure/azure-iot-sdk-c.git
108+
cd azure-iot-sdk-c
109+
git submodule update --init
110+
```
111111

112-
This operation could take several minutes to complete.
112+
This operation could take several minutes to complete.
113113

114114
5. When the operation is complete, run the following commands from the `azure-iot-sdk-c` directory:
115115

116-
```cmd
117-
mkdir cmake
118-
cd cmake
119-
```
116+
```cmd
117+
mkdir cmake
118+
cd cmake
119+
```
120120

121121
6. The code sample uses an X.509 certificate to provide attestation via X.509 authentication. Run the following command to build a version of the SDK specific to your development platform that includes the device provisioning client. A Visual Studio solution for the simulated device is generated in the `cmake` directory.
122122

123-
When specifying the path used with `-Dhsm_custom_lib` in the following command, make sure to use the absolute path to the library in the `cmake` directory you previously created. The path shown assumes that you cloned the C SDK in the root directory of the C drive. If you used another directory, adjust the path accordingly.
123+
When specifying the path used with `-Dhsm_custom_lib` in the following command, make sure to use the absolute path to the library in the `cmake` directory you previously created. The path shown assumes that you cloned the C SDK in the root directory of the C drive. If you used another directory, adjust the path accordingly.
124124

125-
```cmd
126-
cmake -Duse_prov_client:BOOL=ON -Dhsm_custom_lib=c:/azure-iot-sdk-c/cmake/provisioning_client/samples/custom_hsm_example/Debug/custom_hsm_example.lib ..
127-
```
125+
**Windows:**
128126

129-
>[!TIP]
130-
>If `cmake` doesn't find your C++ compiler, you may get build errors while running the above command. If that happens, try running the command in the [Visual Studio command prompt](/dotnet/framework/tools/developer-command-prompt-for-vs).
127+
```cmd
128+
cmake -Duse_prov_client:BOOL=ON -Dhsm_custom_lib=c:/azure-iot-sdk-c/cmake/provisioning_client/samples/custom_hsm_example/Debug/custom_hsm_example.lib ..
129+
```
130+
131+
**Linux:**
132+
133+
```bash
134+
cmake -Duse_prov_client:BOOL=ON -Dhsm_custom_lib=/home/<USER>/azure-iot-sdk-c/cmake/provisioning_client/samples/custom_hsm_example/custom_hsm_example.a ..
135+
```
136+
137+
>[!TIP]
138+
>If `cmake` doesn't find your C++ compiler, you may get build errors while running the above command. If that happens, try running the command in the [Visual Studio command prompt](/dotnet/framework/tools/developer-command-prompt-for-vs).
131139
132140
7. When the build succeeds, the last few output lines look similar to the following output:
133141

134-
```cmd
135-
cmake -Duse_prov_client:BOOL=ON -Dhsm_custom_lib=c:/azure-iot-sdk-c/cmake/provisioning_client/samples/custom_hsm_example/Debug/custom_hsm_example.lib ..
136-
-- Building for: Visual Studio 17 2022
137-
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
138-
-- The C compiler identification is MSVC 19.32.31329.0
139-
-- The CXX compiler identification is MSVC 19.32.31329.0
142+
```output
143+
-- Building for: Visual Studio 17 2022
144+
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
145+
-- The C compiler identification is MSVC 19.32.31329.0
146+
-- The CXX compiler identification is MSVC 19.32.31329.0
140147
141-
...
148+
...
142149
143-
-- Configuring done
144-
-- Generating done
145-
-- Build files have been written to: C:/azure-iot-sdk-c/cmake
146-
```
150+
-- Configuring done
151+
-- Generating done
152+
-- Build files have been written to: C:/azure-iot-sdk-c/cmake
153+
```
147154

148155
::: zone-end
149156

0 commit comments

Comments
 (0)