Skip to content

Commit

Permalink
Add include guard to image_downloader.h
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasR30 committed Mar 18, 2024
1 parent f4f5f1f commit 4e88c90
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 41 deletions.
70 changes: 29 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.1)
project(rviz_aerial_map)

set(RVIZ_AERIAL_MAP_VERSION "1.0.0")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_AUTOMOC ON)

# ROS dependencies
find_package(catkin REQUIRED COMPONENTS
roscpp
roslint
rviz
sensor_msgs
ogre_primitives
tas_proj)

# System dependencies
find_package(GDAL)
find_package(Boost REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Network Concurrent REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(OGRE_OV OGRE OGRE-Overlay)
# Old versions of OGRE (pre 1.9) included OGRE-Overlay in the main package
# (i.e. there was no OGRE-Overlay component). So if the above
# pkg_check_modules() failed, try looking for just OGRE.
if (NOT OGRE_OV_FOUND)
pkg_check_modules(OGRE_OV REQUIRED OGRE)
endif ()

###################################
## catkin specific configuration ##
Expand All @@ -33,7 +23,7 @@ catkin_package(
INCLUDE_DIRS include
LIBRARIES map_helper
CATKIN_DEPENDS tas_proj
DEPENDS Qt5Core GDAL Boost)
DEPENDS GDAL)

###########
## Build ##
Expand All @@ -42,16 +32,27 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Concurrent_INCLUDE_DIRS}
${GDAL_INCLUDE_DIRS}
${BOOST_INCLUDE_DIRS}
${OGRE_OV_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)

## This plugin includes Qt widgets, so we must include Qt.
## We'll use the version that rviz used so they are compatible.
if (rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui QtNetwork)
## pull in all required include dirs, define QT_LIBRARIES, etc.
include(${QT_USE_FILE})
else ()
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets Network)
## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
set(QT_LIBRARIES Qt5::Widgets Qt5::Network)
endif ()

## I prefer the Qt signals and slots to avoid defining "emit", "slots",
## etc because they can conflict with boost signals, so define QT_NO_KEYWORDS here.
add_definitions(-DQT_NO_KEYWORDS)

# Build map helper library
add_library(map_helper
src/map_helpers/tiff_tile_helper.cpp
Expand All @@ -65,38 +66,25 @@ target_link_libraries(map_helper
)

# Build rviz plugin library
add_definitions("-Wall -Wunused -std=c++11 -DRVIZ_AERIAL_MAP_VERSION=\"\\\"${RVIZ_AERIAL_MAP_VERSION}\\\"\"")
set(${PROJECT_NAME}_HEADERS
src/aerial_map_display.h
src/vis_helpers/image_downloader.h
)
qt5_wrap_cpp(${PROJECT_NAME}_MOCSrcs ${${PROJECT_NAME}_HEADERS})
add_definitions("-DRVIZ_AERIAL_MAP_VERSION=\"\\\"${RVIZ_AERIAL_MAP_VERSION}\\\"\"")

add_library(${PROJECT_NAME}
src/aerial_map_display.cpp
src/vis_helpers/image_downloader.cpp
src/vis_helpers/texture_cache.cpp
${${PROJECT_NAME}_MOCSrcs}
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Concurrent_LIBRARIES}
map_helper
)
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES} map_helper)

roslint_cpp()
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

#############
## Install ##
#############

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
2 changes: 2 additions & 0 deletions src/vis_helpers/image_downloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/

#pragma once

#include <functional>

#include <QImageReader>
Expand Down

0 comments on commit 4e88c90

Please sign in to comment.