c70d1211c2917e6849b1ae3a62668b13871c0d32
[libam7xxx.git] / examples / CMakeLists.txt
1 add_definitions("-D_POSIX_C_SOURCE=2") # for getopt()
2 add_definitions("-D_POSIX_SOURCE") # for sigaction
3 add_definitions("-D_BSD_SOURCE") # for strdup
4
5 include_directories(${CMAKE_SOURCE_DIR}/src/)
6
7 # Build a test app that sends a single picture
8 add_executable(picoproj picoproj.c)
9 target_link_libraries(picoproj am7xxx)
10 install(TARGETS picoproj
11   DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
12
13 # Build a more complete example
14 find_package(FFmpeg REQUIRED)
15
16 include_directories(${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS})
17 include_directories(${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS})
18 include_directories(${FFMPEG_LIBSWSCALE_INCLUDE_DIRS})
19
20 # xcb is used to retrieve the full screen dimensions when using x11grab
21 # as input format
22 find_package(XCB)
23 if (XCB_FOUND)
24   add_definitions("${LIBXCB_DEFINITIONS} -DHAVE_XCB")
25   include_directories(${LIBXCB_INCLUDE_DIRS})
26 endif()
27
28 add_executable(am7xxx-play am7xxx-play.c)
29
30 target_link_libraries(am7xxx-play am7xxx
31   ${FFMPEG_LIBAVDEVICE_LIBRARIES}
32   ${FFMPEG_LIBSWSCALE_LIBRARIES}
33   ${LIBXCB_LIBRARIES})
34 install(TARGETS am7xxx-play
35   DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")