joycond
joycond copied to clipboard
CMake issues
I don't really have time to send PR myself right now, so I'll leave this as an issue:
- Is there really some reason to generate
compile_commands.jsonon every build? - Please use GNUInstallDirs instead of hardcoding paths where you install stuff. This allows end users to change destination prefix.
- Preppend what you're installing with either
${CMAKE_CURRENT_BINARY_DIR}or${CMAKE_CURRENT_SOURCE_DIR}, as not doing this breaks not in-tree builds (mkdir build && cd build && sudo make installfails):
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/joycond" ...
)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/udev/89-joycond.rules" "${CMAKE_CURRENT_SOURCE_DIR}/udev/72-joycond.rules" ...
)
@v1993 I too encountered this issue.
I've opened #46 to address the problem when installing the joycond daemon from a separate build directory.
On the other hand, install(FILES ...) defaults to the current source directory, so, specifying ${CMAKE_CURRENT_SOURCE_DIR} for the other project files would be redundant.
https://cmake.org/cmake/help/latest/command/install.html#files
... File names given as relative paths are interpreted with respect to the current source directory. ...