Skip to content

Commit

Permalink
CMake: optionally install pkgconfig (#639)
Browse files Browse the repository at this point in the history
If HIDAPI_INSTALL_TARGETS is set to off, pkgconfig is still installed.
This a problem when statically linking against hidapi and then using
CMake's install-feature.
  • Loading branch information
cmorty committed Nov 16, 2023
1 parent eea8cac commit 9b507ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ function(hidapi_configure_pc PC_IN_FILE)
get_filename_component(PC_IN_FILENAME "${PC_IN_FILE}" NAME_WE)
set(PC_FILE "${CMAKE_CURRENT_BINARY_DIR}/pc/${PC_IN_FILENAME}.pc")
configure_file("${PC_IN_FILE}" "${PC_FILE}" @ONLY)

install(FILES "${PC_FILE}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
if(HIDAPI_INSTALL_TARGETS)
install(FILES "${PC_FILE}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
endif()
endfunction()

# The library
Expand Down

0 comments on commit 9b507ed

Please sign in to comment.