windows: copy libusb.dll to bin install dir (windows needs it to be alongside the exe or in the path) (Thanks to Gleen Ergeerts)
This commit is contained in:
parent
ef92fc6a7b
commit
494e0f4474
2 changed files with 6 additions and 15 deletions
|
@ -4,8 +4,8 @@
|
||||||
# Operating Systems Supported:
|
# Operating Systems Supported:
|
||||||
# - Unix (requires pkg-config)
|
# - Unix (requires pkg-config)
|
||||||
# Tested with Ubuntu 9.04 and Fedora 11
|
# Tested with Ubuntu 9.04 and Fedora 11
|
||||||
# - Windows (requires MSVC)
|
# - Windows (requires MinGW)
|
||||||
# Tested with Windows XP
|
# Tested with Windows XP/Windows 7
|
||||||
#
|
#
|
||||||
# This should work for both 32 bit and 64 bit systems.
|
# This should work for both 32 bit and 64 bit systems.
|
||||||
#
|
#
|
||||||
|
@ -26,20 +26,9 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
||||||
|
|
||||||
IF(NOT LIBUSB_FOUND)
|
IF(NOT LIBUSB_FOUND)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
# Windows with Microsoft Visual C++
|
|
||||||
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH)
|
FIND_PATH(LIBUSB_INCLUDE_DIRS usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH)
|
||||||
IF(MSVC)
|
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/gcc")
|
||||||
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
SET(LIBUSB_DLL "$ENV{ProgramFiles}/LibUSB-Win32/bin/x86/libusb0_x86.dll")
|
||||||
# on x64 (win64)
|
|
||||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/msvc_x64")
|
|
||||||
ELSE(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
|
||||||
# on x86 (win32)
|
|
||||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/msvc")
|
|
||||||
ENDIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x64")
|
|
||||||
ENDIF(MSVC)
|
|
||||||
IF(MINGW)
|
|
||||||
FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/gcc")
|
|
||||||
ENDIF(MINGW)
|
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
# If not under Windows we use PkgConfig
|
# If not under Windows we use PkgConfig
|
||||||
FIND_PACKAGE (PkgConfig)
|
FIND_PACKAGE (PkgConfig)
|
||||||
|
|
|
@ -34,6 +34,8 @@ IF(WIN32)
|
||||||
|
|
||||||
# At compile time we need the .LIB file, we place it in the lib directory
|
# At compile time we need the .LIB file, we place it in the lib directory
|
||||||
INSTALL(TARGETS nfc ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT headers)
|
INSTALL(TARGETS nfc ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT headers)
|
||||||
|
|
||||||
|
INSTALL(FILES ${LIBUSB_DLL} DESTINATION bin COMPONENT examples RENAME "libusb0.dll")
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
Loading…
Reference in a new issue