CMakeLists.txt 1.91 KB
Newer Older
Romuald Conty's avatar
Romuald Conty committed
1 2
SET(UTILS-SOURCES 
  nfc-emulate-forum-tag4
Pim 't Hart's avatar
Pim 't Hart committed
3
  nfc-jewel
Romuald Conty's avatar
Romuald Conty committed
4 5 6 7 8
  nfc-list
  nfc-mfclassic
  nfc-mfultralight
  nfc-read-forum-tag3
  nfc-relay-picc
9
  nfc-scan-device
Romuald Conty's avatar
Romuald Conty committed
10
)
11 12 13 14

ADD_LIBRARY(nfcutils STATIC 
  nfc-utils.c
)
15
TARGET_LINK_LIBRARIES(nfcutils nfc)
16 17 18

# Examples
FOREACH(source ${UTILS-SOURCES})
19 20
  SET (TARGETS ${source}.c)

Alex Lian's avatar
Alex Lian committed
21 22 23 24 25
  IF(WIN32)
    SET(RC_COMMENT "${PACKAGE_NAME} utility")
    SET(RC_INTERNAL_NAME ${source})
    SET(RC_ORIGINAL_NAME ${source}.exe)
    SET(RC_FILE_TYPE VFT_APP)
26
    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc @ONLY)
Alex Lian's avatar
Alex Lian committed
27 28 29
    LIST(APPEND TARGETS ${CMAKE_CURRENT_BINARY_DIR}/../windows/${source}.rc)
  ENDIF(WIN32)

Pim 't Hart's avatar
Pim 't Hart committed
30 31 32 33
  IF(${source} MATCHES "nfc-jewel")
    LIST(APPEND TARGETS jewel)
  ENDIF(${source} MATCHES "nfc-jewel")

34
  IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
35
    LIST(APPEND TARGETS mifare)
36
  ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
37

38 39
  IF(WIN32)
    IF(${source} MATCHES "nfc-scan-device")
40
      LIST(APPEND TARGETS ../contrib/win32/stdlib)
41 42 43
      INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32)
    ENDIF(${source} MATCHES "nfc-scan-device")
  ENDIF(WIN32)
44 45 46

  ADD_EXECUTABLE(${source} ${TARGETS})

47 48
  TARGET_LINK_LIBRARIES(${source} nfc)
  TARGET_LINK_LIBRARIES(${source} nfcutils)
49

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
  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)