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
{{ message }}
Repository navigation
Linux/CMake: find_package(hidapi) cannot find specific version (v0.12.0) #482
I have built hidapi (0.12.0) from source (using git clone from git tag hidapi-0.12.0) and installed it into a local directory (/home/xxxx/.lib/hidapi-0.12.0/x86_64-linux-gnu).
When I now try to import it into my CMake build system using find_package(hidapi 0.12.0 CONFIG REQUIRED), CMake rejects the installation.
CMake Output:
CMake Error at xxxx (find_package):
Could not find a configuration file for package "hidapi" that exactly
matches requested version "0.12.0".
The following configuration files were considered but not accepted:
/home/xxxx/.lib/hidapi-0.12.0/x86_64-linux-gnu/lib/cmake/hidapi/hidapi-config.cmake, version: unknown
Note that it is accepted when I remove the package version requirement from find_package().
This is strange, because all required files seem to be correctly installed:
Ok, renaming the file libhidapi-version.cmake to hidapi-config-version.cmakesolves the problem, but I don't know enough about CMake to decide whether that is the correct solution.
In addition, still the question remains whether the other files libhidapi*.cmake are named correctly.
changed the title [-]Linux/CMake: find_package(hidapi) cannot find specific version[/-][+]Linux/CMake: find_package(hidapi) cannot find specific version (v0.12.0)[/+]on Nov 16, 2022
Activity
stsichler commentedon Nov 16, 2022
Ok, renaming the file
libhidapi-version.cmaketohidapi-config-version.cmakesolves the problem, but I don't know enough about CMake to decide whether that is the correct solution.In addition, still the question remains whether the other files
libhidapi*.cmakeare named correctly.[-]Linux/CMake: find_package(hidapi) cannot find specific version[/-][+]Linux/CMake: find_package(hidapi) cannot find specific version (v0.12.0)[/+]Youw commentedon Nov 16, 2022
Those are correct, otherwise you wouldn't get CMake targets for HIDAPI working.
Fix CMake export files (#484)