-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
73 lines (54 loc) · 2.87 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 2.8.3)
project(ros_http_video_streamer)
find_package(catkin REQUIRED roscpp rostime sensor_msgs image_transport mk)
find_package(Boost COMPONENTS system filesystem thread REQUIRED)
find_package ( BZip2 REQUIRED )
find_package ( ZLIB REQUIRED )
include_directories(include ${catkin_INCLUDE_DIRS})
set_source_files_properties( third_party_make PROPERTIES GENERATED true)
add_custom_command ( OUTPUT third_party_make
COMMAND make
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdparty/ )
include_directories(include ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/ ${ZLIB_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR})
link_directories(${catkin_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${ZLIB_LIBRARY_DIRS} ${BZIP2_LIBRARY_DIR})
add_definitions(${ZLIB_CFLAGS_OTHER} ${BZIP2_CFLAGS_OTHER})
execute_process(COMMAND make WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdparty/ )
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS sensor_msgs image_transport roscpp rostime mk
)
add_executable(${PROJECT_NAME} src/ffmpeg_wrapper.cpp
src/server.cpp
src/connection.cpp
src/topic_streamer.cpp
src/reply.cpp
src/request_parser.cpp
src/image_subscriber.cpp
src/ffmpeg_encoder.cpp
)
add_library(avcodec STATIC IMPORTED)
set_property(TARGET avcodec PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/libavcodec/libavcodec.a)
add_library(avformat STATIC IMPORTED)
set_property(TARGET avformat PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/libavformat/libavformat.a)
add_library(avutil STATIC IMPORTED)
set_property(TARGET avutil PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/libavutil/libavutil.a)
add_library(avfilter STATIC IMPORTED)
set_property(TARGET avfilter PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/libavfilter/libavfilter.a)
add_library(swscale STATIC IMPORTED)
set_property(TARGET swscale PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/ffmpeg/libswscale/libswscale.a)
add_library(vpx STATIC IMPORTED)
set_property(TARGET vpx PROPERTY
IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/3rdparty/sources/libvpx/libvpx.a)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES} avcodec avformat avutil avfilter swscale vpx
${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES})
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)