Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Switch to cmake build system #191

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0f1a071
First version of cmake build system
MatejFranceskin Feb 1, 2019
c892715
Updated mavlink submodule
MatejFranceskin Feb 1, 2019
83e33e0
Fixed realsense cmake build
MatejFranceskin Feb 3, 2019
388d5b3
CMake improved gazebo detection
MatejFranceskin Feb 3, 2019
9daf71a
cmake - conditional link library list
MatejFranceskin Feb 4, 2019
efdae7a
cmake - fix gazebo find_package
MatejFranceskin Feb 4, 2019
a27ba3e
First version of cmake build system
MatejFranceskin Feb 1, 2019
3dd30a8
Updated mavlink submodule
MatejFranceskin Feb 1, 2019
d6be334
Fixed realsense cmake build
MatejFranceskin Feb 3, 2019
42eab42
CMake improved gazebo detection
MatejFranceskin Feb 3, 2019
6abd943
cmake - conditional link library list
MatejFranceskin Feb 4, 2019
3b69c61
cmake - fix gazebo find_package
MatejFranceskin Feb 4, 2019
c1e1b40
Merge branch 'pr-cmake' of https://github.com/MatejFranceskin/camera-…
MatejFranceskin Feb 18, 2019
1d6b79c
Removed configure build system and added install for cmake
MatejFranceskin Feb 26, 2019
5c67c85
Merge branch 'master' into pr-cmake
MatejFranceskin Feb 27, 2019
7918209
cmake - added "make tests" target
MatejFranceskin Feb 27, 2019
a91520f
Merge branch 'master' of https://github.com/Dronecode/camera-manager …
MatejFranceskin Mar 8, 2019
177df21
cmake - added compile options
MatejFranceskin Mar 9, 2019
00ca25e
Clean up of .gitignore
MatejFranceskin Mar 18, 2019
bb4835f
Addressed PR-cmake review comments
MatejFranceskin Mar 18, 2019
4dc7128
make tests separate target
MatejFranceskin Mar 18, 2019
d223fc4
Removed SRC_FILES var in cmakelists
MatejFranceskin Mar 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(CameraManagerRoot)
project(CameraManager)
add_subdirectory(src)
add_subdirectory(test EXCLUDE_FROM_ALL)
add_subdirectory(test)

1 change: 1 addition & 0 deletions cmake/FindAvahi.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2015 Damien Buhl (alias daminetreg)
MatejFranceskin marked this conversation as resolved.
Show resolved Hide resolved
# All rights reserved.
# https://github.com/ruslo/hunter

# Try to find Avahi client and libdns_sd_compat library.
# It can be used as :
Expand Down
62 changes: 41 additions & 21 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,26 @@ add_definitions(
-Wno-missing-field-initializers
)

file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
avahi_publisher.cpp
conf_file.cpp
main.cpp
pollable.cpp
VideoCaptureGst.cpp
CameraComponent.cpp
glib_mainloop.cpp
mainloop.cpp
socket.cpp
VideoStreamRtsp.cpp
CameraParameters.cpp
ImageCaptureGst.cpp
mavlink_server.cpp
util.cpp
VideoStreamUdp.cpp
CameraServer.cpp
log.cpp
PluginManager.cpp
v4l2_interface.cpp)

add_executable(${PROJECT_NAME}
${SRC_FILES}
Expand Down Expand Up @@ -74,69 +93,70 @@ option(WITH_GAZEBO "Enable support for Gazebo simulated cameras" OFF)
option(WITH_AERO "Enable support for Intel Aero cameras" OFF)
option(WITH_CUSTOM "Enable support for Custom cameras" OFF)

IF(WITH_MAVLINK)
if(WITH_MAVLINK)
add_definitions(-DENABLE_MAVLINK)
ENDIF(WITH_MAVLINK)
endif(WITH_MAVLINK)

IF(WITH_AERO)
if(WITH_AERO)
add_definitions(-DENABLE_AERO)
add_subdirectory(Plugins/AeroAtomIspCamera)
target_link_libraries(${PROJECT_NAME}
AeroAtomIspCamera
)
ENDIF(WITH_AERO)
endif(WITH_AERO)

IF(WITH_CUSTOM)
if(WITH_CUSTOM)
add_definitions(-DENABLE_CUSTOM)
add_subdirectory(Plugins/CustomCamera)
target_link_libraries(${PROJECT_NAME}
CustomCamera
)
ENDIF(WITH_CUSTOM)
endif(WITH_CUSTOM)

IF(WITH_AVAHI)
if(WITH_AVAHI)
find_package(Avahi QUIET)
IF(Avahi_FOUND)
if(Avahi_FOUND)
add_definitions(-DENABLE_AVAHI)
target_link_libraries(${PROJECT_NAME}
Avahi::client
Avahi::glib
)
MESSAGE(STATUS "Found Avahi: ${Avahi_CLIENT_INCLUDE_DIRS}")
ENDIF(Avahi_FOUND)
ENDIF(WITH_AVAHI)
endif(Avahi_FOUND)
endif(WITH_AVAHI)

IF(WITH_GAZEBO)
if(WITH_GAZEBO)
find_package(gazebo QUIET)
IF(gazebo_FOUND)
if(gazebo_FOUND)
add_subdirectory(Plugins/GazeboCamera)
add_definitions(-DENABLE_GAZEBO)
target_link_libraries(${PROJECT_NAME}
GazeboCamera
${GAZEBO_LIBRARIES}
)
MESSAGE(STATUS "Found Gazebo: ${GAZEBO_LIBRARIES}")
ENDIF(gazebo_FOUND)
ENDIF(WITH_GAZEBO)
endif(gazebo_FOUND)
endif(WITH_GAZEBO)

IF(WITH_REALSENSE)
if(WITH_REALSENSE)
FIND_PACKAGE(RealSense QUIET)
IF(RealSense_FOUND)
if(RealSense_FOUND)
add_subdirectory(Plugins/RealSenseCamera)
add_definitions(-DENABLE_REALSENSE)
target_link_libraries(${PROJECT_NAME}
RealSenseCamera
${RealSense_LIBRARIES}
)
MESSAGE(STATUS "Found RealSense: ${RealSense_INCLUDE_DIRS}")
ENDIF(RealSense_FOUND)
ENDIF(WITH_REALSENSE)
endif(RealSense_FOUND)
endif(WITH_REALSENSE)

# RealSense2
MatejFranceskin marked this conversation as resolved.
Show resolved Hide resolved
# Currently not supported - but it will be in the future
#FIND_PACKAGE(RealSense2 QUIET)
#IF(RealSense2_FOUND)
#if(RealSense2_FOUND)
# MESSAGE(STATUS "Found RealSense2: ${RealSense2_INCLUDE_DIRS}")
#ENDIF(RealSense2_FOUND)
#endif(RealSense2_FOUND)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

Expand Down
6 changes: 4 additions & 2 deletions src/Plugins/AeroAtomIspCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
CameraDeviceAeroAtomIsp.cpp
PluginAeroAtomIsp.cpp)
MatejFranceskin marked this conversation as resolved.
Show resolved Hide resolved

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

add_library(AeroAtomIspCamera ${SRC_FILES})
add_library(AeroAtomIspCamera ${SRC_FILES})
6 changes: 4 additions & 2 deletions src/Plugins/CustomCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
CameraDeviceCustom.cpp
PluginCustom.cpp)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

add_library(CustomCamera ${SRC_FILES})
add_library(CustomCamera ${SRC_FILES})
6 changes: 4 additions & 2 deletions src/Plugins/GazeboCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
find_package(gazebo REQUIRED)

file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
CameraDeviceGazebo.cpp
PluginGazebo.cpp)

include_directories(
${GAZEBO_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

add_library(GazeboCamera ${SRC_FILES})
add_library(GazeboCamera ${SRC_FILES})
6 changes: 4 additions & 2 deletions src/Plugins/RealSenseCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
CameraDeviceRealSense.cpp
PluginRealSense.cpp)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

add_library(RealSenseCamera ${SRC_FILES})
add_library(RealSenseCamera ${SRC_FILES})
6 changes: 4 additions & 2 deletions src/Plugins/V4l2Camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
file(GLOB SRC_FILES *.cpp)
file(GLOB SRC_FILES
CameraDeviceV4l2.cpp
PluginV4l2.cpp)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

add_library(V4l2Camera ${SRC_FILES})
add_library(V4l2Camera ${SRC_FILES})