forked from nfc-tools/libnfc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
45 lines (39 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
SET(EXAMPLES-SOURCES
nfc-anticol
nfc-dep-initiator
nfc-dep-target
nfc-emulate-forum-tag2
nfc-emulate-tag
nfc-emulate-uid
nfc-mfsetuid
nfc-poll
nfc-relay
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libnfc)
# Examples
FOREACH(source ${EXAMPLES-SOURCES})
SET (TARGETS ${source}.c)
IF(WIN32)
SET(RC_COMMENT "${PACKAGE_NAME} example")
SET(RC_INTERNAL_NAME ${source})
SET(RC_ORIGINAL_NAME ${source}.exe)
SET(RC_FILE_TYPE VFT_APP)
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)
ADD_EXECUTABLE(${source} ${TARGETS})
TARGET_LINK_LIBRARIES(${source} nfc)
TARGET_LINK_LIBRARIES(${source} nfcutils)
INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples)
ENDFOREACH(source)
#install required libraries
IF(WIN32 AND NOT MINGW)
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()
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)