Skip to content

CMake does not find installed HIDAPI on macOS #140

@muellermartin

Description

@muellermartin

When HIDAPI is installed externally (e.g. via a package manager like Homebrew: brew install hidapi) and the tarball of libnitrokey is used, the current version of the CMakeLists.txt is not able to find this installation and fails with an error message like this:

CMake Error at CMakeLists.txt:78 (add_library):
  Cannot find source file:

    hidapi/mac/hid.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


CMake Error at CMakeLists.txt:78 (add_library):
  No SOURCES given to target: hidapi-libusb

This is because the CMake script searches for hidapi/mac/hid.c (see CMakeLists.txt line 78) in the current directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions