libnfc/utils/CMakeLists.txt

70 lines
2.1 KiB
Text
Raw Permalink Normal View History

2012-03-01 13:00:23 +01:00
SET(UTILS-SOURCES
2017-05-17 13:38:20 +02:00
nfc-barcode
2012-03-01 13:00:23 +01:00
nfc-emulate-forum-tag4
2014-02-03 00:04:08 +01:00
nfc-jewel
2012-03-01 13:00:23 +01:00
nfc-list
nfc-mfclassic
nfc-mfultralight
nfc-read-forum-tag3
nfc-relay-picc
nfc-scan-device
2012-03-01 13:00:23 +01:00
)
ADD_LIBRARY(nfcutils STATIC
nfc-utils.c
)
TARGET_LINK_LIBRARIES(nfcutils nfc)
# Examples
FOREACH(source ${UTILS-SOURCES})
SET (TARGETS ${source}.c)
IF(WIN32)
SET(RC_COMMENT "${PACKAGE_NAME} utility")
SET(RC_INTERNAL_NAME ${source})
SET(RC_ORIGINAL_NAME ${source}.exe)
2020-07-11 15:12:57 +02:00
# RC_FILE_TYPE: VFT_APP
2020-07-07 19:40:46 +02:00
SET(RC_FILE_TYPE 0x00000001L)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc @ONLY)
LIST(APPEND TARGETS ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc)
ENDIF(WIN32)
2014-02-03 00:04:08 +01:00
IF(${source} MATCHES "nfc-jewel")
LIST(APPEND TARGETS jewel.c)
2014-02-03 00:04:08 +01:00
ENDIF(${source} MATCHES "nfc-jewel")
IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
LIST(APPEND TARGETS mifare.c)
ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
2013-01-31 16:04:47 +01:00
IF(WIN32)
IF(${source} MATCHES "nfc-scan-device")
LIST(APPEND TARGETS ../contrib/win32/stdlib.c)
2013-01-31 16:04:47 +01:00
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32)
ENDIF(${source} MATCHES "nfc-scan-device")
2018-03-17 19:06:38 +01:00
IF(${source} MATCHES "nfc-read-forum-tag3")
LIST(APPEND TARGETS ${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32/getopt.c)
ENDIF()
2013-01-31 16:04:47 +01:00
ENDIF(WIN32)
ADD_EXECUTABLE(${source} ${TARGETS})
TARGET_LINK_LIBRARIES(${source} nfc)
TARGET_LINK_LIBRARIES(${source} nfcutils)
INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils)
ENDFOREACH(source)
#install required libraries
IF(WIN32)
INCLUDE(InstallRequiredSystemLibraries)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake @ONLY)
INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake)
ENDIF(WIN32)
IF(NOT WIN32)
# Manuals for the examples
FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals)
ENDIF(NOT WIN32)