File: CMakeLists.txt

package info (click to toggle)
libopenobex 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 972 kB
  • ctags: 1,552
  • sloc: ansic: 9,988; xml: 407; makefile: 96
file content (46 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download
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
46

add_subdirectory ( lib )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/lib )
add_subdirectory ( obex_test )
add_subdirectory ( ircp )

add_definitions ( -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE)

set ( OPENOBEX_COMMON_APPS
  irxfer
  irobex_palm3
)
set ( OPENOBEX_APPS
  obex_find
)

if ( NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )
  #obex_tcp uses functions that are only available
  #under Windows7, so we do not compile for now.
  list ( APPEND OPENOBEX_COMMON_APPS obex_tcp )
endif ( NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )

foreach ( prog ${OPENOBEX_COMMON_APPS} )
  list ( APPEND ${prog}_LIBS openobex-apps-common )
  list ( APPEND OPENOBEX_APPS ${prog} )
endforeach ( prog )

foreach ( prog ${OPENOBEX_APPS} )
  set ( ${prog}_SOURCES ${prog}.c )
  list ( APPEND ${prog}_LIBS openobex )
endforeach ( prog )

if ( WIN32 )
  list ( APPEND obex_tcp_LIBS ws2_32 )
endif ( WIN32 )

foreach ( prog ${OPENOBEX_APPS} )
  add_executable ( ${prog} EXCLUDE_FROM_ALL ${${prog}_SOURCES} )
  target_link_libraries ( ${prog} ${${prog}_LIBS} )
  install ( PROGRAMS $<TARGET_FILE:${prog}>
    DESTINATION ${CMAKE_INSTALL_BINDIR}
    COMPONENT applications
    OPTIONAL
  )
endforeach ( prog )
add_dependencies ( openobex-apps ${OPENOBEX_APPS} )