-
Notifications
You must be signed in to change notification settings - Fork 448
Closed
Labels
CMakeRelated to CMake build systemRelated to CMake build systembugSomething isn't workingSomething isn't working
Description
I have built hidapi (0.12.0) from source and installed it into a local directory (/home/xxxx/.lib/hidapi-0.12.0/x86_64-linux-gnu) using following commands:
git clone https://github.com/libusb/hidapi.git --branch hidapi-0.12.0 --depth 1 -c advice.detachedHead=false .lib/hidapi-0.12.0/src
cmake -S .lib/hidapi-0.12.0/src -B .lib/hidapi-0.12.0/x86_64-linux-gnu/.build -DCMAKE_INSTALL_PREFIX=.lib/hidapi-0.12.0/x86_64-linux-gnu -DBUILD_SHARED_LIBS=OFF
cmake --build .lib/hidapi-0.12.0/x86_64-linux-gnu/.build --config Release
cmake --install .lib/hidapi-0.12.0/x86_64-linux-gnu/.build
hidapi properly installes into the correct location, but the resulting contents of the generated libhidapi.cmake file includes these lines:
set_target_properties(hidapi::include PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "/hidapi"
)
Note that installation prefix is missing here from the INTERFACE_INCLUDE_DIRECTORIES path.
In consequence, CMake outputs the following error when I try to consume the hidapi::hidapi target from another project:
CMake Error in CMakeLists.txt:
Imported target "hidapi::hidapi" includes non-existent path
"/hidapi"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
Metadata
Metadata
Assignees
Labels
CMakeRelated to CMake build systemRelated to CMake build systembugSomething isn't workingSomething isn't working