You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This docker container has been created to allow us to easily crosscompile our c++ tools. The idea comes from [multiarch/crossbuild](https://github.com/multiarch/crossbuild), but that container unfortunately is outdated and the apt sources are no longer available.
Copy file name to clipboardExpand all lines: deps/hidapi-0.12.0/BUILD.cmake.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ To build HIDAPI with CMake, it has to be [installed](#installing-cmake)/availabl
5
5
Make sure you've checked [prerequisites](BUILD.md#prerequisites) and installed all required dependencies.
6
6
7
7
HIDAPI CMake build system allows you to build HIDAPI in two generally different ways:
8
-
1) As a [standalone package/library](#standalone-package-build);
9
-
2) As [part of a larger CMake project](#hidapi-as-a-subdirectory).
8
+
1. As a [standalone package/library](#standalone-package-build);
9
+
1. As [part of a larger CMake project](#hidapi-as-a-subdirectory).
10
10
11
11
**TL;DR**: if you're experienced developer and have been working with CMake projects or have been written some of your own -
12
12
most of this document may not be of interest for you; just check variables names, its default values and the target names.
@@ -107,11 +107,11 @@ _NOTE_: HIDAPI packages built by CMake can be used with `pkg-config`, as if buil
107
107
It is possible to build a CMake project (including HIDAPI) using MSVC compiler and Ninja (for medium and larger projects it is so much faster than msbuild).
- `vcvarsall.bat` is an environment setup script of your MSVC toolchain installation;<br>For MSVC 2019 Community edition it is located at: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\`;
113
113
- `x64` -a target architecture to build;
114
-
3) Follow general build steps, and use `Ninja` as a generator.
114
+
1. Follow general build steps, and use `Ninja` as a generator.
115
115
116
116
### Using HIDAPI in a CMake project
117
117
@@ -187,15 +187,15 @@ add_subdirectory(hidapi)
187
187
188
188
There are several important differences in the behavior of HIDAPI CMake build system when CMake is built as standalone package vs subdirectory build:
189
189
190
-
1) In _standalone build_ a number of standard and HIDAPI-specific variables are marked as _cache variables_ or _options_.
190
+
1. In _standalone build_ a number of standard and HIDAPI-specific variables are marked as _cache variables_ or _options_.
191
191
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.:
192
192
<br>
193
193
E.g.2:<br>
194
194
<br>
195
195
When HIDAPI is built as a _subdirectory_ - **_none of the variables are marked for cache or as options_** by HIDAPI.
196
196
This is done to let the host project's developer decide what is important (what needs to be highlighted) and what's not.
197
197
198
-
2) The default behavior/default value for some of the variables is a bit different:
198
+
1. The default behavior/default value for some of the variables is a bit different:
199
199
- by default, none of HIDAPI targets are [installed](https://cmake.org/cmake/help/latest/command/install.html); if required, HIDAPI targets can be installed by host project _after_ including HIDAPI subdirectory (requires CMake 3.13 or later); **or**, the default installation can be enabled by setting `HIDAPI_INSTALL_TARGETS` variable _before_ including HIDAPI subdirectory.
200
200
HIDAPI uses [GNUInstallDirs](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) to specify install locations. Variables like `CMAKE_INSTALL_LIBDIR` can be used to control HIDAPI's installation locations. E.g.:
201
201
```cmake
@@ -207,7 +207,7 @@ This is done to let the host project's developer decide what is important (what
207
207
```
208
208
- 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;
209
209
210
-
3) In a subdirectory build, HIDAPI _doesn't modify or set any of the CMake variables_ that may change the build behavior.
210
+
1. In a subdirectory build, HIDAPI _doesn't modify or set any of the CMake variables_ that may change the build behavior.
211
211
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.
212
212
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.
0 commit comments