|
2 | 2 |
|
3 | 3 | ## Building the Example :wrench: |
4 | 4 |
|
5 | | -To build this example, first run CMake to generate the corresponding build |
6 | | -files. We recommend you use a separate directory to store all the generated |
7 | | -files (e.g., ./build). |
| 5 | +In order to build this example, you need to define the variables `CONNEXTDDS_DIR` |
| 6 | +and `CONNEXTDDS_ARCH`. You can do so by exporting them manually, by sourcing |
| 7 | +the `rtisetenv` script for your architecture, or by passing them to the `cmake` |
| 8 | +command as arguments: |
8 | 9 |
|
9 | | -```sh |
| 10 | +```bash |
10 | 11 | mkdir build |
11 | 12 | cd build |
12 | | -cmake .. |
13 | | -``` |
14 | | - |
15 | | -Once you have run CMake, you will find a number of new files in your build |
16 | | -directory (the list of generated files will depend on the specific CMake |
17 | | -Generator). To build the example, run CMake as follows: |
18 | | - |
19 | | -```sh |
| 13 | +cmake -DCONNEXTDDS_DIR=<Connext DDS Directory> \ # If not exported |
| 14 | + -DCONNEXTDDS_ARCH=<Connext DDS Architecture> \ # If not exported |
| 15 | + -DBUILD_SHARED_LIBS=ON|OFF \ |
| 16 | + -DCMAKE_BUILD_TYPE=Debug|Release .. |
20 | 17 | cmake --build . |
21 | 18 | ``` |
22 | 19 |
|
23 | | -**Note**: if you are using a multi-configuration generator, such as Visual |
24 | | -Studio solutions, you can specify the configuration mode to build as follows: |
25 | | - |
26 | | -```sh |
27 | | -cmake --build . --config Release|Debug |
28 | | -``` |
| 20 | +**Note**: You do not need to define `CONNEXTDDS_ARCH` if you only have one |
| 21 | +architecture target installed in your system. |
29 | 22 |
|
30 | | -Alternatively, you can use directly the generated infrastructure (e.g., |
31 | | -Makefiles or Visual Studio Solutions) to build the example. If you generated |
32 | | -Makefiles in the configuration process, run make to build the example. Likewise, |
33 | | -if you generated a Visual Studio solution, open the solution and follow the |
34 | | -regular build process. |
| 23 | +Instead of using `cmake --build`, you can directly use the generated |
| 24 | +infrastructure (e.g., Makefiles or Visual Studio Solutions) to build the example. |
| 25 | +If you generated Makefiles in the configuration process, run make to build the |
| 26 | +example. Likewise, if you generated a Visual Studio solution, open the solution |
| 27 | +and follow the regular build process. |
35 | 28 |
|
36 | 29 | ## Running the Example |
37 | 30 |
|
@@ -104,7 +97,7 @@ Also, if you installed libraries for multiple target architectures on your syste |
104 | 97 | you want to link against. For example: |
105 | 98 |
|
106 | 99 | ```sh |
107 | | -cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 .. |
| 100 | +cmake -DCONNEXTDDS_ARCH=<Connext DDS Architecture>.. |
108 | 101 | ``` |
109 | 102 |
|
110 | 103 | ### CMake Build Infrastructure |
|
0 commit comments