-
Notifications
You must be signed in to change notification settings - Fork 471
Fix CMake issues #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ikspress
wants to merge
3
commits into
nfc-tools:master
Choose a base branch
from
ikspress:packaging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix CMake issues #737
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,29 @@ | ||
| # This CMake script wants to use libusb functionality, therefore it looks | ||
| # for libusb include files and libraries. | ||
| # - Try to find libusb or libusb-win32 | ||
| # Once done this will define | ||
| # | ||
| # Operating Systems Supported: | ||
| # - Unix (requires pkg-config) | ||
| # Tested with Ubuntu 9.04 and Fedora 11 | ||
| # - Windows (requires MinGW) | ||
| # Tested with Windows XP/Windows 7 | ||
| # | ||
| # This should work for both 32 bit and 64 bit systems. | ||
| # | ||
| # Author: F. Kooman <fkooman@tuxed.net> | ||
| # LIBUSB_FOUND - True if libusb found | ||
| # LIBUSB_INCLUDE_DIRS - The path to the libusb headers | ||
| # LIBUSB_LIBRARY_DIRS - The path to the libusb library | ||
| # LIBUSB_LIBRARIES - The libraries needed by libusb | ||
| # | ||
|
|
||
| # FreeBSD has built-in libusb since 800069 | ||
| IF(CMAKE_SYSTEM_NAME MATCHES FreeBSD) | ||
| EXEC_PROGRAM(sysctl ARGS -n kern.osreldate OUTPUT_VARIABLE FREEBSD_VERSION) | ||
| SET(MIN_FREEBSD_VERSION 800068) | ||
| IF(FREEBSD_VERSION GREATER ${MIN_FREEBSD_VERSION}) | ||
| SET(LIBUSB_FOUND TRUE) | ||
| SET(LIBUSB_INCLUDE_DIRS "/usr/include") | ||
| SET(LIBUSB_LIBRARIES "usb") | ||
| SET(LIBUSB_LIBRARY_DIRS "/usr/lib/") | ||
| ENDIF(FREEBSD_VERSION GREATER ${MIN_FREEBSD_VERSION}) | ||
| ENDIF(CMAKE_SYSTEM_NAME MATCHES FreeBSD) | ||
| FIND_PACKAGE(PkgConfig) | ||
| # Skip searching for libusb-0.1 on Windows, use libusb-win32 instead | ||
| IF(PKG_CONFIG_FOUND AND NOT WIN32) | ||
| PKG_SEARCH_MODULE(LIBUSB libusb libusb-0.1) | ||
| PKG_CHECK_MODULES(LIBUSB ${LIBUSB_MODULE_NAME}) | ||
| ENDIF(PKG_CONFIG_FOUND AND NOT WIN32) | ||
|
|
||
| IF(NOT LIBUSB_FOUND) | ||
| IF(WIN32) | ||
| IF(MINGW) | ||
| FIND_PATH(LIBUSB_INCLUDE_DIRS lusb0_usb.h "${CMAKE_CURRENT_BINARY_DIR}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH) | ||
| FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "${CMAKE_CURRENT_BINARY_DIR}/LibUSB-Win32/lib/gcc") | ||
| SET(LIBUSB_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/LibUSB-Win32/bin/x86/") | ||
| ELSE(MINGW) | ||
| FIND_PATH(LIBUSB_INCLUDE_DIRS lusb0_usb.h "$ENV{ProgramW6432}/libusb-win32/include" NO_SYSTEM_ENVIRONMENT_PATH) | ||
| FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramW6432}/libusb-win32/lib/msvc_x64") | ||
| SET(LIBUSB_LIBRARY_DIR "$ENV{ProgramW6432}/libusb-win32/bin/amd64/") | ||
| ENDIF(MINGW) | ||
| # Must fix up variable to avoid backslashes during packaging | ||
| STRING(REGEX REPLACE "\\\\" "/" LIBUSB_LIBRARY_DIR ${LIBUSB_LIBRARY_DIR}) | ||
| ELSE(WIN32) | ||
| # If not under Windows we use PkgConfig | ||
| FIND_PACKAGE (PkgConfig) | ||
| IF(PKG_CONFIG_FOUND) | ||
| PKG_CHECK_MODULES(LIBUSB REQUIRED libusb) | ||
| ELSE(PKG_CONFIG_FOUND) | ||
| MESSAGE(FATAL_ERROR "Could not find PkgConfig") | ||
| ENDIF(PKG_CONFIG_FOUND) | ||
| ENDIF(WIN32) | ||
|
|
||
| IF(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES) | ||
| SET(LIBUSB_FOUND TRUE) | ||
| ENDIF(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES) | ||
| FIND_PATH(LIBUSB_INCLUDE_DIRS NAMES usb.h lusb0_usb.h) | ||
| FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb libusb0) | ||
| GET_FILENAME_COMPONENT(LIBUSB_LIBRARY_DIRS ${LIBUSB_LIBRARIES} PATH CACHE) | ||
| ENDIF(NOT LIBUSB_FOUND) | ||
ikspress marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| IF(LIBUSB_FOUND) | ||
| IF(NOT LIBUSB_FIND_QUIETLY) | ||
| MESSAGE(STATUS "Found LIBUSB: ${LIBUSB_LIBRARIES} ${LIBUSB_INCLUDE_DIRS}") | ||
| ENDIF (NOT LIBUSB_FIND_QUIETLY) | ||
| ELSE(LIBUSB_FOUND) | ||
| IF(LIBUSB_FIND_REQUIRED) | ||
| MESSAGE(FATAL_ERROR "Could not find LIBUSB") | ||
| ENDIF(LIBUSB_FIND_REQUIRED) | ||
| ENDIF(LIBUSB_FOUND) | ||
| INCLUDE(FindPackageHandleStandardArgs) | ||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB REQUIRED_VARS | ||
| LIBUSB_INCLUDE_DIRS | ||
| LIBUSB_LIBRARIES | ||
| LIBUSB_LIBRARY_DIRS | ||
| ) | ||
| MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES LIBUSB_LIBRARY_DIRS) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.