Windows: install libusb into examples directory using "Bundle" feature from CMake (Thanks to Glenn Ergeerts)
This commit is contained in:
parent
d86438db4e
commit
762f6fb1f3
4 changed files with 19 additions and 3 deletions
11
cmake/FixBundle.cmake.in
Normal file
11
cmake/FixBundle.cmake.in
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
INCLUDE(BundleUtilities)
|
||||
|
||||
# set bundle to the full path of the executable already existing in the install tree
|
||||
SET(bundle "${CMAKE_INSTALL_PREFIX}/bin/nfc-list@CMAKE_EXECUTABLE_SUFFIX@")
|
||||
|
||||
# set other_libs to a list of additional libs that cannot be reached by dependency analysis
|
||||
SET(other_libs "")
|
||||
|
||||
SET(dirs "@LIBUSB_LIBRARY_DIR@")
|
||||
|
||||
fixup_bundle("${bundle}" "${other_libs}" "${dirs}")
|
||||
|
|
@ -28,7 +28,7 @@ IF(NOT LIBUSB_FOUND)
|
|||
IF(WIN32)
|
||||
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH)
|
||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/gcc")
|
||||
SET(LIBUSB_DLL "$ENV{ProgramFiles}/LibUSB-Win32/bin/x86/libusb0_x86.dll")
|
||||
SET(LIBUSB_LIBRARY_DIR "$ENV{ProgramFiles}/LibUSB-Win32/bin/x86/")
|
||||
ELSE(WIN32)
|
||||
# If not under Windows we use PkgConfig
|
||||
FIND_PACKAGE (PkgConfig)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue