Attempt to make it works on MacOS. Small fixes. CMake work started.

This commit is contained in:
Romuald Conty 2009-11-04 10:42:53 +00:00
parent 14a9112dea
commit 06a76f6470
7 changed files with 60 additions and 53 deletions

View file

@ -15,7 +15,7 @@ html-am : Doxyfile
.PHONY: html
endif
DISTCLEANFILES = \
DISTCLEANFILES = \
Makefile.in \
configure \
depcomp \

View file

@ -1,4 +1,4 @@
define([rev], esyscmd([sh -c "echo -n 'r' && svnversion -n"]))dnl
define([rev], esyscmd([sh -c "echo -e 'r\c' && svnversion -n"]))dnl
AC_INIT(libnfc, 1.2.1+rev, info@libnfc.org)
AC_CONFIG_HEADER(config.h)

View file

@ -1,21 +1,3 @@
SET(LIBRARY-SOURCES libnfc rs232 bitutils dev_arygon dev_pn532_uart)
# find PCSC library and headers
IF(LIBNFC_PCSC)
FIND_PACKAGE(PCSC REQUIRED)
ADD_DEFINITIONS("-DHAVE_PCSC_LITE=1")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCSC_CFLAGS_OTHER}")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "dev_acr122")
ENDIF(LIBNFC_PCSC)
# find libusb library and headers
IF(LIBNFC_USB)
FIND_PACKAGE(LIBUSB REQUIRED)
ADD_DEFINITIONS("-DHAVE_LIBUSB=1")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS_OTHER}")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "dev_pn531" "dev_pn533")
ENDIF(LIBNFC_USB)
IF(LIBNFC_VERBOSE_OUTPUT)
ADD_DEFINITIONS("-DDEBUG")
ENDIF(LIBNFC_VERBOSE_OUTPUT)
@ -37,31 +19,4 @@ ENDIF(MSVC)
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
# Library
ADD_LIBRARY(nfc SHARED ${LIBRARY-SOURCES})
TARGET_LINK_LIBRARIES(nfc ${LIBUSB_LIBRARIES} ${PCSC_LIBRARIES})
SET_TARGET_PROPERTIES(nfc PROPERTIES SOVERSION 0 VERSION 0.0.0)
IF(MSVC)
# On Windows the shared (runtime) library should be either in the same
# directory as the excutables or in the path, we add it to same directory
INSTALL(TARGETS nfc RUNTIME DESTINATION bin COMPONENT libraries)
# 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)
ELSE(MSVC)
INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
ENDIF(MSVC)
# Headers
FILE(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
INSTALL(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/libnfc COMPONENT headers)
IF(MSVC)
# On Windows we also install the stdint headers, without it programs using it
# can't compile (like if we want to compile the included examples "out of
# tree")
#FILE(GLOB stdint "${CMAKE_CURRENT_SOURCE_DIR}/msvc/*.h")
#INSTALL(FILES ${stdint} DESTINATION ${INCLUDE_INSTALL_DIR}/libnfc COMPONENT headers)
ENDIF(MSVC)
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(lib examples)

31
src/lib/CMakeLists.txt Normal file
View file

@ -0,0 +1,31 @@
SET(LIBRARY-SOURCES nfc bitutils)
# Library
ADD_LIBRARY(nfc SHARED ${LIBRARY-SOURCES})
TARGET_LINK_LIBRARIES(nfc ${LIBUSB_LIBRARIES} ${PCSC_LIBRARIES})
SET_TARGET_PROPERTIES(nfc PROPERTIES SOVERSION 0 VERSION 0.0.0)
IF(MSVC)
# On Windows the shared (runtime) library should be either in the same
# directory as the excutables or in the path, we add it to same directory
INSTALL(TARGETS nfc RUNTIME DESTINATION bin COMPONENT libraries)
# 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)
ELSE(MSVC)
INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
ENDIF(MSVC)
# Headers
FILE(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
INSTALL(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/libnfc COMPONENT headers)
IF(MSVC)
# On Windows we also install the stdint headers, without it programs using it
# can't compile (like if we want to compile the included examples "out of
# tree")
#FILE(GLOB stdint "${CMAKE_CURRENT_SOURCE_DIR}/msvc/*.h")
#INSTALL(FILES ${stdint} DESTINATION ${INCLUDE_INSTALL_DIR}/libnfc COMPONENT headers)
ENDIF(MSVC)
ADD_SUBDIRECTORY(buses drivers)

View file

@ -0,0 +1,2 @@
SET(LIBRARY-SOURCES uart)

View file

@ -27,14 +27,14 @@
#include "defines.h"
#include "types.h"
#ifdef HAVE_PCSC_LITE
#include <drivers/acr122.h>
#include "drivers/acr122.h"
#endif /* HAVE_PCSC_LITE */
#ifdef HAVE_LIBUSB
#include <drivers/pn531.h>
#include <drivers/pn533.h>
#include "drivers/pn531.h"
#include "drivers/pn533.h"
#endif /* HAVE_LIBUSB */
#include <drivers/arygon.h>
#include <drivers/pn532_uart.h>
#include "drivers/arygon.h"
#include "drivers/pn532_uart.h"
const static struct driver_callbacks drivers_callbacks_list[] = {
// Driver Name Connect Transceive Disconnect

View file

@ -0,0 +1,19 @@
SET(LIBRARY-SOURCES arygon pn532_uart)
# find PCSC library and headers
IF(LIBNFC_PCSC)
FIND_PACKAGE(PCSC REQUIRED)
ADD_DEFINITIONS("-DHAVE_PCSC_LITE=1")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PCSC_CFLAGS_OTHER}")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "acr122")
ENDIF(LIBNFC_PCSC)
# find libusb library and headers
IF(LIBNFC_USB)
FIND_PACKAGE(LIBUSB REQUIRED)
ADD_DEFINITIONS("-DHAVE_LIBUSB=1")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS_OTHER}")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "pn531" "pn533")
ENDIF(LIBNFC_USB)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib)