-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arsene Berod
committed
Jun 8, 2022
1 parent
db23ce6
commit f40aa70
Showing
222 changed files
with
87,189 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from conans import ConanFile, tools, CMake | ||
|
||
|
||
class LibNFCConan(ConanFile): | ||
name = "LibNFC" | ||
version = "1.7.1" | ||
settings = "os", "compiler", "build_type", "arch" | ||
description = "libnfc" | ||
url = "None" | ||
license = "None" | ||
options = {'shared': [True]} | ||
default_options = 'shared=True' | ||
exports_sources = "linux*" | ||
|
||
def configure_cmake(self): | ||
cmake = CMake(self, build_type=self.settings.build_type) | ||
cmake.configure(source_folder='linux/libnfc-1.7.1') | ||
return cmake | ||
|
||
def build(self): | ||
if self.settings.os == 'Windows': | ||
# just use pre-package binaries | ||
return | ||
cmake = self.configure_cmake() | ||
cmake.build() | ||
|
||
def package(self): | ||
# Depending on target architecture we either package one or the other | ||
# dlls | ||
if self.settings.os == 'Windows': | ||
if self.settings.arch == 'x86_64': | ||
self.copy('*.dll', 'bin', 'win/dll/x64/{}'.format(self.settings.build_type)) | ||
self.copy('*.lib', 'lib', 'win/lib/x64') | ||
self.copy("libusb0.dll", 'bin', 'libusb_x64') | ||
else: | ||
self.copy('*.dll', 'bin', 'win/dll/Win32/{}'.format(self.settings.build_type)) | ||
self.copy('*.lib', 'lib', 'win/lib/Win32') | ||
self.copy("libusb0.dll", 'bin', 'libusb_x86') | ||
self.copy('*.h', 'include', 'win/include') | ||
else: | ||
cmake = self.configure_cmake() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
if self.settings.os == 'Windows': | ||
self.cpp_info.bindirs = ['bin'] | ||
self.cpp_info.libdirs = ['lib'] | ||
self.cpp_info.libs.append('libnfc.lib') | ||
else: | ||
self.cpp_info.libs.append("nfc") |
Binary file not shown.
Binary file not shown.
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Alphabetical cleaned output of "git shortlog -s -e|cut -c 8-" : | ||
Adam Laurie <adam@algroup.co.uk> | ||
Ahti Legonkov <ahti.legonkov@gmail.com> | ||
Alex Lian <alian@alum.mit.edu> | ||
Anugrah Redja Kusuma <anugrah.redja@gmail.com> | ||
Audrey Diacre <adiacre@il4p.fr> | ||
Emanuele Bertoldi <emanuele.bertoldi@gmail.com> | ||
Eugeny Boger <eugenyboger@gmail.com> | ||
Francois Kooman <fkooman@tuxed.net> | ||
Jiapeng Li <gapleehit@gmail.com> | ||
Julien Schueller <julien.schueller@gmail.com> | ||
Laurent Latil <laurent@latil.nom.fr> | ||
Ludovic Rousseau <ludovic.rousseau@gmail.com> | ||
Marcello Morena <marcello.morena@gmail.com> | ||
Mike Auty <mike.auty@gmail.com> | ||
Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | ||
Peter Meerwald <pmeerw@pmeerw.net> | ||
Philippe Teuwen <yobibe@gmail.com> | ||
Pim 't Hart <pimmeyproductions@gmail.com> | ||
Roel Verdult <roel@libnfc.org> | ||
Romain Tartiere <romain.tartiere@gmail.com> | ||
Romuald Conty <romuald@libnfc.org> | ||
lego <lego@debian-fresh.prx> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,196 @@ | ||
PROJECT(libnfc C) | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | ||
SET(VERSION_MAJOR "1") | ||
SET(VERSION_MINOR "7") | ||
SET(VERSION_PATCH "1") | ||
|
||
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") | ||
|
||
SET(PACKAGE_NAME "libnfc") | ||
SET(PACKAGE_VERSION ${VERSION}) | ||
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") | ||
|
||
# config.h | ||
IF(WIN32) | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_windows.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h) | ||
SET(LIBNFC_SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/config" CACHE PATH "libnfc configuration directory") | ||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32) | ||
ELSE(WIN32) | ||
SET(_XOPEN_SOURCE 600) | ||
SET(SYSCONFDIR "/etc" CACHE PATH "System configuration directory") | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_posix.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h) | ||
ENDIF(WIN32) | ||
|
||
ADD_DEFINITIONS("-DHAVE_CONFIG_H") | ||
|
||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
|
||
# make it easy to locate CMake modules for finding libraries | ||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") | ||
|
||
# Options | ||
SET(LIBNFC_LOG ON CACHE BOOL "Enable log facility (errors, warning, info and debug messages)") | ||
IF(LIBNFC_LOG) | ||
ADD_DEFINITIONS(-DLOG) | ||
ENDIF(LIBNFC_LOG) | ||
|
||
SET(LIBNFC_ENVVARS ON CACHE BOOL "Enable envvars facility") | ||
IF(LIBNFC_ENVVARS) | ||
ADD_DEFINITIONS(-DENVVARS) | ||
ENDIF(LIBNFC_ENVVARS) | ||
|
||
SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode") | ||
IF(LIBNFC_DEBUG_MODE) | ||
ADD_DEFINITIONS(-DDEBUG) | ||
SET(CMAKE_C_FLAGS "-g3 ${CMAKE_C_FLAGS}") | ||
SET(WIN32_MODE "debug") | ||
SET(CMAKE_RC_FLAGS "-D_DEBUG ${CMAKE_RC_FLAGS}") | ||
ELSE(LIBNFC_DEBUG_MODE) | ||
SET(WIN32_MODE "release") | ||
ENDIF(LIBNFC_DEBUG_MODE) | ||
|
||
SET(LIBNFC_CONFFILES_MODE ON CACHE BOOL "Enable configuration files") | ||
IF(LIBNFC_CONFFILES_MODE) | ||
ADD_DEFINITIONS(-DCONFFILES) | ||
ENDIF(LIBNFC_CONFFILES_MODE) | ||
|
||
# Doxygen | ||
SET(builddir "${CMAKE_BINARY_DIR}") | ||
SET(top_srcdir "${CMAKE_SOURCE_DIR}") | ||
INCLUDE(UseDoxygen) | ||
|
||
IF(DEFINED CMAKE_INSTALL_LIBDIR) | ||
SET(libdir ${CMAKE_INSTALL_LIBDIR}) | ||
ELSE(DEFINED CMAKE_INSTALL_LIBDIR) | ||
SET(CMAKE_INSTALL_LIBDIR lib) | ||
SET(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) | ||
ENDIF(DEFINED CMAKE_INSTALL_LIBDIR) | ||
|
||
IF(DEFINED INCLUDE_INSTALL_DIR) | ||
SET(includedir ${INCLUDE_INSTALL_DIR}) | ||
ELSE(DEFINED INCLUDE_INSTALL_DIR) | ||
SET(INCLUDE_INSTALL_DIR include) | ||
SET(includedir ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}) | ||
ENDIF(DEFINED INCLUDE_INSTALL_DIR) | ||
|
||
IF(NOT DEFINED SHARE_INSTALL_PREFIX) | ||
SET(SHARE_INSTALL_PREFIX share) | ||
ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX) | ||
|
||
# Additonnal GCC flags | ||
IF(CMAKE_COMPILER_IS_GNUCC) | ||
# Make sure we will not miss some warnings ;) | ||
SET(CMAKE_C_FLAGS "-Wall -pedantic -std=c99 ${CMAKE_C_FLAGS}") | ||
ENDIF(CMAKE_COMPILER_IS_GNUCC) | ||
|
||
# Workarounds for libusb in C99 | ||
ADD_DEFINITIONS(-Du_int8_t=uint8_t -Du_int16_t=uint16_t) | ||
|
||
IF(MINGW) | ||
# force MinGW-w64 in 32bit mode | ||
SET(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}") | ||
SET(CMAKE_MODULE_LINKER_FLAGS "-m32 -Wl,--enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}") | ||
SET(CMAKE_SHARED_LINKER_FLAGS "-m32 -Wl,--enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}") | ||
SET(CMAKE_EXE_LINKER_FLAGS "-m32 -Wl,--enable-stdcall-fixup ${CMAKE_EXE_LINKER_FLAGS}") | ||
SET(CMAKE_RC_FLAGS "--target=pe-i386 --output-format=coff ${CMAKE_RC_FLAGS}") | ||
ENDIF(MINGW) | ||
|
||
IF(NOT WIN32) | ||
# Set some pkg-config variables | ||
SET(prefix ${CMAKE_INSTALL_PREFIX}) | ||
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}) | ||
SET(PACKAGE "libnfc") | ||
IF(LIBNFC_DRIVER_PN53X_USB) | ||
SET(PKG_REQ ${PKG_REQ} "libusb") | ||
ENDIF(LIBNFC_DRIVER_PN53X_USB) | ||
IF(LIBNFC_DRIVER_ACR122) | ||
SET(PKG_REQ ${PKG_REQ} "libpcsclite") | ||
ENDIF(LIBNFC_DRIVER_ACR122) | ||
# CMake lists are separated by a semi colon, replace with colon | ||
STRING(REPLACE ";" "," PKG_CONFIG_REQUIRES "${PKG_REQ}") | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libnfc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc @ONLY) | ||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
ENDIF(NOT WIN32) | ||
|
||
# Require PCRE for Win32 | ||
IF (WIN32) | ||
FIND_PACKAGE(PCRE REQUIRED) | ||
IF(PCRE_INCLUDE_DIRS) | ||
INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIRS}) | ||
LINK_DIRECTORIES(${PCRE_LIBRARY_DIRS}) | ||
ENDIF(PCRE_INCLUDE_DIRS) | ||
ENDIF(WIN32) | ||
|
||
INCLUDE(LibnfcDrivers) | ||
|
||
IF(PCSC_INCLUDE_DIRS) | ||
INCLUDE_DIRECTORIES(${PCSC_INCLUDE_DIRS}) | ||
LINK_DIRECTORIES(${PCSC_LIBRARY_DIRS}) | ||
ENDIF(PCSC_INCLUDE_DIRS) | ||
|
||
IF(LIBUSB_INCLUDE_DIRS) | ||
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS}) | ||
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS}) | ||
SET(LIBUSB_FOUND TRUE) | ||
ENDIF(LIBUSB_INCLUDE_DIRS) | ||
|
||
# version.rc for Windows | ||
IF(WIN32) | ||
# Date for filling in rc file information | ||
MACRO (GET_CURRENT_YEAR RESULT) | ||
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) | ||
STRING(REGEX REPLACE "\n" "" ${RESULT} ${${RESULT}}) | ||
STRING(REGEX REPLACE ".*(..)/(..)/(....).*" "\\3" ${RESULT} ${${RESULT}}) | ||
ENDMACRO (GET_CURRENT_YEAR) | ||
GET_CURRENT_YEAR(CURRENT_YEAR) | ||
MESSAGE("Year for copyright is " ${CURRENT_YEAR}) | ||
|
||
SET(RC_COMMENT "${PACKAGE_NAME} library") | ||
SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}") | ||
SET(RC_ORIGINAL_NAME ${PACKAGE_NAME}.dll) | ||
SET(RC_FILE_TYPE VFT_DLL) | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/windows/libnfc.rc @ONLY) | ||
ENDIF(WIN32) | ||
|
||
ADD_SUBDIRECTORY(libnfc) | ||
ADD_SUBDIRECTORY(include) | ||
ADD_SUBDIRECTORY(utils) | ||
ADD_SUBDIRECTORY(examples) | ||
|
||
# Binary Package | ||
IF(WIN32) | ||
SET(CPACK_GENERATOR "ZIP") | ||
ELSE(WIN32) | ||
SET(CPACK_GENERATOR "TBZ2") | ||
ENDIF(WIN32) | ||
|
||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Near Field Communication (NFC) library") | ||
SET(CPACK_PACKAGE_VENDOR "Roel Verdult") | ||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") | ||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") | ||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "libnfc") | ||
SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) | ||
SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) | ||
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) | ||
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "NFC Library") | ||
SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Example Applications") | ||
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Development Headers") | ||
IF(NOT WIN32) | ||
SET(CPACK_COMPONENT_MANUALS_DISPLAY_NAME "Example Applications Manuals") | ||
SET(CPACK_COMPONENT_MANUALS_DISABLED TRUE) | ||
SET(CPACK_COMPONENT_MANUALS_DEPENDS examples) | ||
ENDIF(NOT WIN32) | ||
SET(CPACK_COMPONENT_HEADERS_DISABLED TRUE) | ||
SET(CPACK_COMPONENT_HEADERS_DEPENDS libraries) | ||
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries) | ||
|
||
# Source Package | ||
IF(WIN32) | ||
SET(CPACK_SOURCE_GENERATOR "ZIP") | ||
ELSE(WIN32) | ||
SET(CPACK_SOURCE_GENERATOR "ZIP;TBZ2") | ||
ENDIF(WIN32) | ||
|
||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "libnfc-${VERSION}") | ||
SET(CPACK_SOURCE_IGNORE_FILES "~$" "/\\\\.git/" "bin/") | ||
INCLUDE(CPack) |
Oops, something went wrong.