Windows: Fix nfc-scan-device to compile by linking in contrib/nfc_win32.c

Re-factored the executable call with a list that is created, so that its easier to modify per tool.
This commit is contained in:
Alex Lian 2013-01-27 23:24:03 -05:00 committed by Romuald Conty
parent 9eeaf33b94
commit 87182b5a65

View file

@ -15,13 +15,23 @@ TARGET_LINK_LIBRARIES(nfcutils nfc)
# Examples # Examples
FOREACH(source ${UTILS-SOURCES}) FOREACH(source ${UTILS-SOURCES})
SET (TARGETS ${source}.c)
IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) IF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
ADD_EXECUTABLE(${source} ${source}.c mifare) LIST(APPEND TARGETS mifare)
ELSE()
ADD_EXECUTABLE(${source} ${source}.c)
ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic")) ENDIF((${source} MATCHES "nfc-mfultralight") OR (${source} MATCHES "nfc-mfclassic"))
IF(${source} MATCHES "nfc-scan-device")
LIST(APPEND TARGETS ../contrib/win32/nfc_win32)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../contrib/win32)
ENDIF(${source} MATCHES "nfc-scan-device")
ADD_EXECUTABLE(${source} ${TARGETS})
TARGET_LINK_LIBRARIES(${source} nfc) TARGET_LINK_LIBRARIES(${source} nfc)
TARGET_LINK_LIBRARIES(${source} nfcutils) TARGET_LINK_LIBRARIES(${source} nfcutils)
INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils) INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils)
ENDFOREACH(source) ENDFOREACH(source)