Skip to content

Commit 703855b

Browse files
varjolintudroidmonkey
authored andcommitted
Fix CMakeFiles for BSDs
1 parent 89e4b14 commit 703855b

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,14 @@ find_package(PCSC REQUIRED)
499499
include_directories(SYSTEM ${PCSC_INCLUDE_DIRS})
500500

501501
if(UNIX AND NOT APPLE)
502-
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 REQUIRED)
502+
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb REQUIRED)
503503
find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES "libusb-1.0" "libusb" REQUIRED)
504504
include_directories(SYSTEM ${LIBUSB_INCLUDE_DIR})
505505

506506
# For PolKit QuickUnlock
507-
find_library(KEYUTILS_LIBRARIES NAMES keyutils REQUIRED)
507+
if("${CMAKE_SYSTEM}" MATCHES "Linux")
508+
find_library(KEYUTILS_LIBRARIES NAMES keyutils REQUIRED)
509+
endif()
508510
endif()
509511

510512
# Find zxcvbn or use the bundled version

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ target_link_libraries(keepassxc_core
336336
${ZLIB_LIBRARIES}
337337
${MINIZIP_LIBRARIES}
338338
${ARGON2_LIBRARIES}
339-
${KEYUTILS_LIBRARIES}
340339
${thirdparty_LIBRARIES})
341340

342341
# GUI Library Definition
@@ -363,6 +362,9 @@ if(HAIKU)
363362
endif()
364363
if(UNIX AND NOT APPLE)
365364
target_link_libraries(keepassxc_core Qt5::DBus ${LIBUSB_LIBRARIES})
365+
if("${CMAKE_SYSTEM}" MATCHES "Linux")
366+
target_link_libraries(keepassxc_core ${KEYUTILS_LIBRARIES})
367+
endif()
366368
if(WITH_X11)
367369
target_link_libraries(keepassxc_gui Qt5::X11Extras X11)
368370
endif()

src/thirdparty/ykcore/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2021 KeePassXC Team <team@keepassxc.org>
1+
# Copyright (C) 2026 KeePassXC Team <team@keepassxc.org>
22
#
33
# This program is free software: you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ elseif(UNIX AND NOT APPLE)
2929

3030
find_package(Threads REQUIRED)
3131

32-
find_library(LIBUSB_LIBRARY NAMES usb-1.0)
32+
find_library(LIBUSB_LIBRARY NAMES usb-1.0 usb)
3333
find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES "libusb-1.0" "libusb")
3434
if(NOT LIBUSB_LIBRARY OR NOT LIBUSB_INCLUDE_DIR)
3535
message(FATAL_ERROR "libusb-1.0 dev package required, but not found")

0 commit comments

Comments
 (0)