Skip to content

Commit

Permalink
Explicit remark about BUILD_SHARED_LIBS (libusb#349)
Browse files Browse the repository at this point in the history
- a remark about using BUILD_SHARED_LIBS as a CACHE variable and CMP0077.
  • Loading branch information
Youw authored Nov 11, 2021
1 parent 20a16a1 commit b66d7c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BUILD.cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ set(BUILD_SHARED_LIBS FALSE) # HIDAPI as static library on all platforms
add_subdirectory(hidapi)
```

<details>
<summary>NOTE</summary>

If you project happen to use `BUILD_SHARED_LIBS` as a `CACHE` variable globally for you project, setting it as simple variable, as showed above _will have not affect_ up until _CMake 3.13_. See [CMP0077](https://cmake.org/cmake/help/latest/policy/CMP0077.html) for details.
</details><br>

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

1) In _standalone build_ a number of standard and HIDAPI-specific variables are marked as _cache variables_ or _options_.
Expand Down

0 comments on commit b66d7c2

Please sign in to comment.