Fix CMake pkg-config generation: "Requires:" is now dynamic.

Fix devices.h, #endif should not be followed by the name of the block.
Fix CMake libnfc_usb compilation.
Rename tools to examples in CMake file.
(This patch comes from Fkooman, thanks !)
This commit is contained in:
Romuald Conty 2009-09-14 08:47:31 +00:00
parent e2dc2c133a
commit 0977dd1c0b
3 changed files with 21 additions and 13 deletions

View file

@ -1,10 +1,11 @@
SET(LIBRARY-SOURCES libnfc rs232 bitutils dev_arygon)
SET(TOOLS-SOURCES list mftool mfultool initiator target anticol emulate relay)
SET(EXAMPLES-SOURCES list mftool mfultool initiator target anticol emulate relay)
# 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)
@ -12,7 +13,8 @@ ENDIF(LIBNFC_PCSC)
IF(LIBNFC_USB)
FIND_PACKAGE(LIBUSB REQUIRED)
ADD_DEFINITIONS("-DHAVE_LIBUSB=1")
SET(LIBRARY-SOURCES ${LIBRARY-SOURCES} "dev_pn531 dev_pn533")
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)
@ -64,7 +66,7 @@ IF(MSVC)
ENDIF(MSVC)
# Examples
FOREACH(source ${TOOLS-SOURCES})
FOREACH(source ${EXAMPLES-SOURCES})
ADD_EXECUTABLE(nfc-${source} ${source}.c)
TARGET_LINK_LIBRARIES(nfc-${source} nfc)
INSTALL(TARGETS nfc-${source} RUNTIME DESTINATION bin COMPONENT examples)