Skip to content

Commit 3ebfaa8

Browse files
committed
More details for CMake documentation
1 parent b705311 commit 3ebfaa8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

BUILD.cmake.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ set(BUILD_SHARED_LIBS FALSE) # HIDAPI as static library on all platforms
179179
add_subdirectory(hidapi)
180180
```
181181

182-
There is two important differences in the behavior of HIDAPI CMake build system when CMake is built as standalone package vs subdirectory build:
182+
There are several important differences in the behavior of HIDAPI CMake build system when CMake is built as standalone package vs subdirectory build:
183183

184184
1) In _standalone build_ a number of standard and HIDAPI-specific variables are marked as _cache variables_ or _options_.
185185
This is done for convenience: when you're building HIDAPI as a standalone package and using tools like `cmake-gui` - those are highlighted as variables that can be changed and has some short description/documentation. E.g.:
@@ -201,6 +201,10 @@ This is done to let the host project's developer decide what is important (what
201201
```
202202
- HIDAPI prints its version during the configuration when built as a standalone package; to enable this for subdirectory builds - set `HIDAPI_PRINT_VERSION` to TRUE before including HIDAPI;
203203

204+
3) In a subdirectory build, HIDAPI _doesn't modify or set any of the CMake variables_ that may change the build behavior.
205+
For instance, in a _standalone build_, if CMAKE_BUILD_TYPE or BUILD_SHARED_LIBS variables are not set, those are defaulted to "Release" and "TRUE" explicitly.
206+
In a _subdirectory build_, even if not set, those variables remain unchanged, so a host project's developer has a full control over the HIDAPI build configuration.
207+
204208
Available CMake targets after `add_subdirectory(hidapi)` _are the same as in case of [standalone build](#standalone-package-build)_, and a few additional ones:
205209
- `hidapi_include` - the interface library; `hidapi::hidapi` is an alias of it;
206210
- `hidapi_winapi` - library target on Windows; `hidapi::winapi` is an alias of it;

0 commit comments

Comments
 (0)