From b66d7c2c889d39cdce8eedc50692c318911b04a9 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Fri, 12 Nov 2021 01:17:06 +0200 Subject: [PATCH] Explicit remark about BUILD_SHARED_LIBS (#349) - a remark about using BUILD_SHARED_LIBS as a CACHE variable and CMP0077. --- BUILD.cmake.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BUILD.cmake.md b/BUILD.cmake.md index c40f893..364c815 100644 --- a/BUILD.cmake.md +++ b/BUILD.cmake.md @@ -179,6 +179,12 @@ set(BUILD_SHARED_LIBS FALSE) # HIDAPI as static library on all platforms add_subdirectory(hidapi) ``` +
+ NOTE + + 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. +

+ 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_.