| 1 |
# Microsoft Azure IoT SDKs - macro utils for C |
| 2 |
|
| 3 |
This repository contains the following: |
| 4 |
* **a generation tool for macro_utils.h** to regenerate the file macro_utils.h. Pressing F5 after opening .sln file will regenerate macro_utils.h |
| 5 |
* **macro_utils.h** a C header file that contains a multitude of very useful C macros |
| 6 |
|
| 7 |
## How to clone the repository |
| 8 |
|
| 9 |
``` |
| 10 |
git clone https://github.com/Azure/azure-macro-utils-c.git |
| 11 |
``` |
| 12 |
|
| 13 |
## How to use the Azure IoT SDKs - macro utils for C |
| 14 |
|
| 15 |
In a C source file: `#include "azure_macro_utils/macro_utils.h"` |
| 16 |
|
| 17 |
### Installation |
| 18 |
|
| 19 |
To install the Azure IoT SDKs - macro utils for C on your machine, we recommend you use cmake 3.0.0 or higher. |
| 20 |
|
| 21 |
- Create a "build" directory and run `cmake ..` from that directory to generate the cmake files. |
| 22 |
- Run `cmake --build . --target install` to install on your machine |
| 23 |
|
| 24 |
#### CMake 3.0.0+ |
| 25 |
In your project, simply: |
| 26 |
- `find_package(azure_macro_utils_c REQUIRED CONFIG)` |
| 27 |
- `target_link_libraries(<your_target> azure_macro_utils_c)` |
| 28 |
|
| 29 |
#### CMake 2.\*.\* |
| 30 |
In your project, simply: |
| 31 |
- `target_include_directories(<your_target> PUBLIC ${MACRO_UTILS_INC_FOLDER})` |
| 32 |
|
| 33 |
## Supported compilers |
| 34 |
|
| 35 |
The following compilers are supported: gcc 4.4 (and onwards), Visual Studio 2015 and others. |
| 36 |
|
| 37 |
## CMake integration |
| 38 |
|
| 39 |
The project will export a global variable MACRO_UTILS_INC_FOLDER that points to the folder needed to be included so that `#include "azure_macro_utils/macro_utils.h"` resolves properly. |