Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera visual fov fix #3307

Open
wants to merge 72 commits into
base: gazebo11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
7d10842
Remove X11 call from Gazebo 7
chapulina Feb 21, 2020
13c1e01
Close branch remove_x11
chapulina Mar 31, 2020
ef4a8b1
Merged in remove_x11 (pull request #3195)
chapulina Mar 31, 2020
a07d57f
[gazebo7] Update BitBucket links (#2715)
chapulina May 6, 2020
bbc6498
backport lockstep changes to gz9
iche033 Jul 22, 2020
825b193
add sensor extension class as workaround to preserve ABI compatibility
iche033 Jul 23, 2020
f72befc
fix image sensor container abi
iche033 Jul 23, 2020
137fd96
port tests
iche033 Jul 23, 2020
dc2f7dd
add test world src files
iche033 Jul 24, 2020
bd38258
test removing type
iche033 Jul 26, 2020
95855f8
remove unused param
iche033 Jul 28, 2020
9351f5c
[backport Gazebo7] Fixed crash when collision size is zero (#2769)
ahcorde Jul 28, 2020
de8980d
⬆️ 7.16.1
chapulina Jul 28, 2020
b0f42d4
7 ➡️ 9
chapulina Jul 28, 2020
a479501
backport camera strict test world fix
iche033 Jul 29, 2020
cca6528
Merge pull request #2793 from osrf/respect_fps_gz9
mabelzhang Jul 30, 2020
bf171c4
revert change
chapulina Aug 3, 2020
11ebf3d
7 ➡️ 9 (#2801)
chapulina Aug 4, 2020
5881f82
Fix race condition on Publisher shutdown (#2812)
iche033 Aug 7, 2020
21db7f2
⬆️ 9.14.0 (#2815)
chapulina Aug 7, 2020
af30f74
[Gazebo9] More enhancement for Windows build (#2789)
seanyen Aug 11, 2020
c55942e
[Gazebo9] Fixed fails for OSX: Added using namespace boost::placehold…
ahcorde Aug 11, 2020
be44390
Port Ignition Common's profiler to Gazebo 9 (#2813)
chapulina Aug 11, 2020
439247e
ColladaLoader: fix cases where VERTEX and NORMAL share same polylist …
k-okada Aug 25, 2020
3a848db
Fix assumptions that CMAKE_INSTALL_*DIR paths are relative. (#2779)
lopsided98 Aug 31, 2020
2f3024d
use true unlit black (zero) values for objects without reflectance ma…
iche033 Sep 2, 2020
85f8332
remove lighting param (#2840)
iche033 Sep 18, 2020
7adba90
[Gazebo 9] Publish performance metrics (#2819)
ahcorde Sep 25, 2020
c8bf695
Improve transport::Publisher reliability (#2725)
nlamprian Sep 30, 2020
fededa7
⬆️ 9.15.0 (#2850)
chapulina Oct 1, 2020
ce6570f
[Gazebo 9] Added Profiler to gazebo::rendering and gzclient (#2836)
ahcorde Oct 3, 2020
6d6568b
fix segfault when deleting an model that's being manipulated (#2856)
iche033 Oct 13, 2020
98e67e6
SimpleTrackedVehiclePlugin: fix for boost 1.74 (#2865)
scpeters Oct 27, 2020
7ffc25a
Fix physics based sensor update rate in lockstep mode (#2863)
iche033 Oct 29, 2020
5ecd18a
Add mutex to make Sensor::SetActive threadsafe (#2871)
iche033 Nov 16, 2020
9ec3439
Support resource files with spaces (#2877)
chapulina Nov 21, 2020
305b15a
Update TinyOBJLoader to v2.0.0rc8 (#2885)
chapulina Nov 23, 2020
d7d481a
⬆️ 9.16.0 (#2889)
chapulina Nov 24, 2020
5b4f917
Generate spot light shadow maps (#2914)
iche033 Jan 21, 2021
ca1709d
Fix performance metrics deadlock (#2917)
scpeters Jan 21, 2021
46b5dc9
Fix support for camera with single channel floating point image forma…
iche033 Jan 23, 2021
d94e2e0
Fix changelog
scpeters Jan 23, 2021
db40ad5
optimize collision checking in ode (#2945)
iche033 Mar 8, 2021
d6bd532
Lens flare cleanup and colorization (#2927)
mogumbo Mar 30, 2021
f09ce61
Fix size of light visual (#2947)
peci1 Apr 15, 2021
0c8d93b
LensFlare - allow inheritance (#2965)
kjeppesen1 Apr 16, 2021
811da8f
Remove warning message in verbose mode when using gpu rays or depth c…
eborghi10 Apr 17, 2021
31dbbcc
Fix depth camera breaking shadows (#2907)
Benlitz Apr 17, 2021
c467d7f
LensFlare: rename SetCameraSensor to SetCameraImpl (#2975)
scpeters Apr 19, 2021
bf3ffb4
Protect DepthCameraPlugin globals with a mutex (#2949)
ivanpauno Apr 7, 2021
a5201c7
Avoid deadlock in ConnectionManager::Stop (#2950)
ivanpauno Apr 7, 2021
e9c4101
Fix ogre_log test (#2954)
scpeters Mar 30, 2021
7d34e91
Bump to 9.17.0 and update changelog (#2980)
scpeters Apr 22, 2021
b5f09f2
Check for nullptr in TopicManager::ConnectPubToSub (gazebo9) (#2988)
j-rivero May 6, 2021
e714bc9
Prepare for 9.18.0 (#2997)
j-rivero May 10, 2021
d4525ae
Add warning if GAZEBO_RESOURCE_PATH may not be set correctly (#2991)
paudrow May 7, 2021
1a69fa6
Check for SDF files containing sibling elements of the same type with…
j-rivero Jun 10, 2021
e4400ae
Prepare 9.19.0 release (#3020)
j-rivero Jun 10, 2021
6deb6ef
Require sdformat 6.3.0 or greater (gazebo9) (#3022)
j-rivero Jun 30, 2021
8ce1215
Partially fixes #1718 - Apply Force/Torque for nested models (#3039) …
iche033 Aug 6, 2021
75ac09d
Make links within nested models modifiable from GUI Client (#3031)
lihui815 Aug 10, 2021
c343565
Fix build with qwt 6.2, deprecation warning (#3047)
scpeters Jul 22, 2021
f8b4d09
Find tbb version < 2021 with pkg-config (#3037)
scpeters Jul 6, 2021
13b7605
move multilink worlds to to test (#3059)
iche033 Aug 12, 2021
9de9a42
Install Profiler headers (#3032)
Aug 13, 2021
ee44d86
Make events threadsafe (#3064)
j-rivero Aug 16, 2021
4b1fa4d
Merge pull request #3062 from osrf/backport_3031
iche033 Aug 16, 2021
16b99c6
Backport PR #3030 to Gazebo9 for CURL fixes (#3041)
j-rivero Aug 19, 2021
94afbb1
Fix light preview parameters (#2982)
peci1 Jan 4, 2022
f37fd3c
Fix missing namespace for string (#3211)
Tobias-Fischer May 3, 2022
e014863
Fix focal builds: use python3 with check_test_ran.py (#3155) (#3278)
scpeters Jan 30, 2023
aa31ed2
Make CameraVisual distance depend on horizontal_fov
Mar 17, 2023
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
36 changes: 26 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)

set (GAZEBO_MAJOR_VERSION 9)
set (GAZEBO_MINOR_VERSION 13)
set (GAZEBO_MINOR_VERSION 19)
# The patch version may have been bumped for prerelease purposes; be sure to
# check gazebo-release/ubuntu/debian/changelog@default to determine what the
# next patch version should be for a regular release.
set (GAZEBO_PATCH_VERSION 2)
set (GAZEBO_PATCH_VERSION 0)

set (GAZEBO_VERSION ${GAZEBO_MAJOR_VERSION}.${GAZEBO_MINOR_VERSION})
set (GAZEBO_VERSION_FULL ${GAZEBO_MAJOR_VERSION}.${GAZEBO_MINOR_VERSION}.${GAZEBO_PATCH_VERSION})
Expand All @@ -37,6 +37,14 @@ if(NOT DEFINED BUILD_TESTING)
set(BUILD_TESTING OFF)
endif()

option(ENABLE_PROFILER "Enable Gazebo Profiler" FALSE)

if(ENABLE_PROFILER)
add_definitions("-DGZ_PROFILER_ENABLE=1")
else()
add_definitions("-DGZ_PROFILER_ENABLE=0")
endif()

#============================================================================
# We turn off extensions because (1) we do not ever want to use non-standard
# compiler extensions, and (2) this variable is on by default, causing cmake
Expand Down Expand Up @@ -158,11 +166,11 @@ message (STATUS "----------------------------------------\n")
# 2. In the generation of cmake/setup.sh from cmake/setup.sh.in
set(GAZEBO_DEFAULT_MASTER_HOST localhost)
set(GAZEBO_DEFAULT_MASTER_PORT 11345)
set(GAZEBO_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/gazebo-${GAZEBO_MAJOR_VERSION}/plugins)
set(GAZEBO_PLUGIN_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/plugins)
FILE(TO_NATIVE_PATH "${GAZEBO_PLUGIN_PATH}" GAZEBO_PLUGIN_PATH)
set(GAZEBO_MODEL_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
set(GAZEBO_MODEL_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
FILE(TO_NATIVE_PATH "${GAZEBO_MODEL_PATH}" GAZEBO_MODEL_PATH)
set(GAZEBO_RESOURCE_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
set(GAZEBO_RESOURCE_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
FILE(TO_NATIVE_PATH "${GAZEBO_RESOURCE_PATH}" GAZEBO_RESOURCE_PATH)
set(GAZEBO_MODEL_DATABASE_URI http://models.gazebosim.org)
set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR})
Expand Down Expand Up @@ -254,7 +262,11 @@ filter_valid_compiler_flags(${WARN_LEVEL}
# Check and add visibility hidden by default. Only in UNIX
# Windows and MacosX does not handled properly the hidden compilation
if (UNIX AND NOT APPLE)
filter_valid_compiler_flags(-fvisibility=hidden -fvisibility-inlines-hidden)
if (ENABLE_PROFILER)
filter_valid_compiler_flags(-fvisibility-inlines-hidden)
else()
filter_valid_compiler_flags(-fvisibility=hidden -fvisibility-inlines-hidden)
endif()
endif()

if (MSVC)
Expand Down Expand Up @@ -320,15 +332,15 @@ else (build_errors)
gz_install_includes("" ${PROJECT_BINARY_DIR}/gazebo/gazebo_config.h)

configure_file(${CMAKE_SOURCE_DIR}/cmake/setup.sh.in ${PROJECT_BINARY_DIR}/setup.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/)
# Also install the setup.sh in an unversioned location
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo/)

if (WIN32)
configure_file(${CMAKE_SOURCE_DIR}/cmake/setup.bat.in ${PROJECT_BINARY_DIR}/setup.bat @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.bat DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.bat DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/)
# Also install the setup.bat in an unversioned location
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.bat DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gazebo/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.bat DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo/)
endif ()

if (DEFINED CMAKE_CXX_FLAGS)
Expand Down Expand Up @@ -391,6 +403,10 @@ else (build_errors)
set (Boost_PKGCONFIG_LIBS "${Boost_PKGCONFIG_LIBS} ${bname}")
endforeach(b)

include(${gazebo_cmake_dir}/JoinPaths.cmake)
join_paths(pkgconfig_libdir "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
join_paths(pkgconfig_includedir "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")

foreach (pkgconfig ${pkgconfig_files})
configure_file(${CMAKE_SOURCE_DIR}/cmake/pkgconfig/${pkgconfig}.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${pkgconfig}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/pkgconfig/${pkgconfig}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig COMPONENT pkgconfig)
Expand Down
131 changes: 129 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,124 @@
## Gazebo 9

## Gazebo 9.xx.x (202x-xx-xx)
## Gazebo 9.19.0 (2021-06-10)

## Gazebo 9.13.2 (202x-xx-xx)
1. Enable output of gzerr for SDF sibling elements of same type with same name,
following the SDF 1.6 specification.
Environment variable GAZEBO9_BACKWARDS_COMPAT_WARNINGS_ERRORS can be set to
use the previous behaviour and do not report these problems.
* [Pull request #3016](https://github.com/osrf/gazebo/pull/3016)

1. Add warning if GAZEBO_RESOURCE_PATH may not be set correctly
* [Pull request #2991](https://github.com/osrf/gazebo/pull/2991)

## Gazebo 9.18.0 (2021-05-07)

1. Check for nullptr in TopicManager::ConnectPubToSub
* A contribution from Emerson Knapp <[email protected]> (Amazon)
* [Pull request #2988](https://github.com/osrf/gazebo/pull/2988)
* [Issue #2875](https://github.com/osrf/gazebo/issues/2875)

## Gazebo 9.17.0 (2021-04-21)

1. Generate spot light shadow maps
* [Pull request #2914](https://github.com/osrf/gazebo/pull/2914)

1. Fix performance metrics deadlock with multiple types of sensors
* [Pull request #2917](https://github.com/osrf/gazebo/pull/2917)
* [Issue #2902](https://github.com/osrf/gazebo/issues/2902)

1. Fix support for camera with single channel floating point image format
* [Pull request #2918](https://github.com/osrf/gazebo/pull/2918)

1. Optimize collision checking in ODE
* [Pull request #2945](https://github.com/osrf/gazebo/pull/2945)

1. Lens flare cleanup and colorization
* [Pull request #2927](https://github.com/osrf/gazebo/pull/2927)

1. Fix size of light visual
* [Pull request #2947](https://github.com/osrf/gazebo/pull/2947)

1. LensFlare - allow inheritance
* [Pull request #2965](https://github.com/osrf/gazebo/pull/2965)
* [Pull request #2975](https://github.com/osrf/gazebo/pull/2975)

1. Silence message conversion warning messages
* [Pull request #2972](https://github.com/osrf/gazebo/pull/2972)

1. Fix depth camera breaking shadows
* [Pull request #2907](https://github.com/osrf/gazebo/pull/2907)

1. Protect DepthCameraPlugin globals with a mutex
* [Pull request #2949](https://github.com/osrf/gazebo/pull/2949)

1. Avoid deadlock in ConnectionManager::Stop
* [Pull request #2950](https://github.com/osrf/gazebo/pull/2950)

1. Fix `ogre_log` test
* [Pull request #2954](https://github.com/osrf/gazebo/pull/2954)

## Gazebo 9.16.0 (2020-11-24)

1. Updated the version of TinyOBJLoader from 1.0.0 to 2.0.0rc8.
* [Pull request #2885](https://github.com/osrf/gazebo/pull/2885)

1. Support resource files with spaces
* [Pull request #2877](https://github.com/osrf/gazebo/pull/2877)

1. Fix physics based sensor update rate in lockstep mode
* [Pull request #2863](https://github.com/osrf/gazebo/pull/2863)

1. Added Profiler to gazebo::rendering and gzclient
* [Pull request #2836](https://github.com/osrf/gazebo/pull/2836)

1. Fix segfault when deleting an model that's being manipulated
* [Pull request #2856](https://github.com/osrf/gazebo/pull/2856)

1. SimpleTrackedVehiclePlugin: fix for boost 1.74
* [Pull request #2865](https://github.com/osrf/gazebo/pull/2865)

1. Add mutex to make Sensor::SetActive threadsafe
* [Pull request #2871](https://github.com/osrf/gazebo/pull/2871)

## Gazebo 9.15.0 (2020-09-30)

1. More enhancement for Windows build
* [Pull request #2789](https://github.com/osrf/gazebo/pull/2789)

1. Fixed fails for OSX: Added using namespace boost::placeholders
* [Pull request #2809](https://github.com/osrf/gazebo/pull/2809)

1. Add profiler
* [Pull request #2813](https://github.com/osrf/gazebo/pull/2813)

1. ColladaLoader: fix cases where VERTEX and NORMAL share same polylist <p>
* [Pull request #2825](https://github.com/osrf/gazebo/pull/2825)

1. Fix assumptions that CMAKE\_INSTALL\_\*DIR paths are relative
* [Pull request #2779](https://github.com/osrf/gazebo/pull/2779)

1. Fix reflectance values for objects without a reflectance map
* [Pull request #2833](https://github.com/osrf/gazebo/pull/2833)

1. Remove lighting param
* [Pull request #2840](https://github.com/osrf/gazebo/pull/2840)

1. Publish performance metrics
* [Pull request #2819](https://github.com/osrf/gazebo/pull/2819)

1. Improve transport::Publisher reliability
* [Pull request #2725](https://github.com/osrf/gazebo/pull/2725)

## Gazebo 9.14.0 (2020-08-07)

1. Lockstep between sensors and physics
* [Pull request #2793](https://github.com/osrf/gazebo/pull/2793)

1. Fix race condition on Publisher shutdown
* [Pull request #2812](https://github.com/osrf/gazebo/pull/2812)

## Gazebo 9.13.2 (2020-07-20)

1. Fix sensor update rate throttling when new sensors are spawned
* [Pull request #2784](https://github.com/osrf/gazebo/pull/2784)
Expand Down Expand Up @@ -1417,6 +1533,17 @@

## Gazebo 7.X.X (2019-XX-XX)

## Gazebo 7.16.1 (2019-07-28)

1. Remove X11 call from Gazebo 7
* [BitBucket pull request 3195](https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-requests/3195)

1. Update BitBucket links
* [Pull request 2715](https://github.com/osrf/gazebo/pull/2715)

1. [backport Gazebo7] Fixed crash when collision size is zero
* [Pull request 2769](https://github.com/osrf/gazebo/pull/2769)

## Gazebo 7.16.0 (2019-09-04)

1. VariableGearboxPlugin: use splines to support arbitrary smooth input-output gearbox profiles
Expand Down
7 changes: 7 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Deprecated code produces compile-time warnings. These warning serve as
notification to users that their code should be upgraded. The next major
release will remove the deprecated code.

## Gazebo 9.15 to 9.16

### Modifications

Updated the version of TinyOBJLoader from 1.0.0 to 2.0.0rc8.
See the changelog at https://github.com/osrf/gazebo/blob/gazebo9/deps/tinyobjloader/tiny_obj_loader.h

## Gazebo 8.4 to 9.x

### Models with duplicate names will not be inserted
Expand Down
2 changes: 1 addition & 1 deletion cmake/GazeboTestUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ macro (gz_build_tests)

# Check that the test produced a result and create a failure if it didn't.
# Guards against crashed and timed out tests.
add_test(check_${BINARY_NAME} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
add_test(check_${BINARY_NAME} ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

if(GAZEBO_RUN_VALGRIND_TESTS AND VALGRIND_PROGRAM)
Expand Down
6 changes: 5 additions & 1 deletion cmake/GazeboUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ endmacro()
#################################################
macro (gz_install_library _name)
set_target_properties(${_name} PROPERTIES SOVERSION ${GAZEBO_MAJOR_VERSION} VERSION ${GAZEBO_VERSION_FULL})
install (TARGETS ${_name} DESTINATION ${LIB_INSTALL_DIR} COMPONENT shlib)
install (TARGETS ${_name}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
COMPONENT shlib)
endmacro ()

#################################################
Expand Down
23 changes: 23 additions & 0 deletions cmake/JoinPaths.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This module provides a function for joining paths
# known from most languages
#
# SPDX-License-Identifier: (MIT OR CC0-1.0)
# Copyright 2020 Jan Tojnar
# https://github.com/jtojnar/cmake-snips
#
# Modelled after Python’s os.path.join
# https://docs.python.org/3.7/library/os.path.html#os.path.join
# Windows not supported
function(join_paths joined_path first_path_segment)
set(temp_path "${first_path_segment}")
foreach(current_segment IN LISTS ARGN)
if(NOT ("${current_segment}" STREQUAL ""))
if(IS_ABSOLUTE "${current_segment}")
set(temp_path "${current_segment}")
else()
set(temp_path "${temp_path}/${current_segment}")
endif()
endif()
endforeach()
set(${joined_path} "${temp_path}" PARENT_SCOPE)
endfunction()
45 changes: 27 additions & 18 deletions cmake/SearchForStuff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@ endif ()
# Find packages

find_package(CURL)
if (CURL_FOUND)
# FindCURL.cmake distributed with CMake exports
# the CURL_INCLUDE_DIRS variable, while the pkg_check_modules
# function exports the CURL_INCLUDEDIR variable.
# TODO: once the configure.bat VS2013 based script has been removed,
# remove the call pkg_check_modules(CURL libcurl) and all the uses of
# CURL_LIBDIR and CURL_INCLUDEDIR and use directly the variables
# CURL_INCLUDE_DIRS and CURL_LIBRARIES provided by FindCURL.cmake
set(CURL_INCLUDEDIR ${CURL_INCLUDE_DIRS})
if (CURL_FOUND AND NOT TARGET CURL::libcurl AND CURL_LIBRARY)
# Make a target on Bionic because FindCURL.cmake only sets old-style CMake variables
add_library(CURL::libcurl SHARED IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LOCATION "${CURL_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${CURL_LIBRARIES}")
if (WIN32)
set_target_properties(CURL::libcurl PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB")
endif()
endif ()

# In Visual Studio we use configure.bat to trick all path cmake
Expand All @@ -110,13 +112,6 @@ if (MSVC)
endif()

if (PKG_CONFIG_FOUND)
if (NOT CURL_FOUND)
pkg_check_modules(CURL libcurl)
endif ()
if (NOT CURL_FOUND)
BUILD_ERROR ("Missing: libcurl. Required for connection to model database.")
endif()

pkg_check_modules(PROFILER libprofiler)
if (PROFILER_FOUND)
set (CMAKE_LINK_FLAGS_PROFILE "-Wl,--no-as-needed -lprofiler -Wl,--as-needed ${CMAKE_LINK_FLAGS_PROFILE}" CACHE INTERNAL "Link flags for profile")
Expand Down Expand Up @@ -303,7 +298,7 @@ if (PKG_CONFIG_FOUND)

#################################################
# Find TBB
pkg_check_modules(TBB tbb)
pkg_check_modules(TBB tbb<2021)
set (TBB_PKG_CONFIG "tbb")
if (NOT TBB_FOUND)
message(STATUS "TBB not found, attempting to detect manually")
Expand Down Expand Up @@ -580,7 +575,7 @@ endif ()

########################################
# Find SDFormat
set (SDFormat_MIN_VERSION 6)
set (SDFormat_MIN_VERSION 6.3.0)
find_package(SDFormat ${SDFormat_MIN_VERSION})
if (SDFormat_FOUND)
message (STATUS "Looking for SDFormat ${SDFormat_MIN_VERSION} - found")
Expand Down Expand Up @@ -653,6 +648,20 @@ else()
set(HAVE_SPNAV FALSE)
endif()

########################################
# Find python3, which is used by tools/check_test_ran.py
if (${CMAKE_VERSION} VERSION_LESS 3.12)
find_package(PythonInterp 3)
else()
find_package(Python3 COMPONENTS Interpreter)
if (Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
endif()
if (NOT EXISTS ${PYTHON_EXECUTABLE})
BUILD_WARNING("python3 not found. The check_test_ran.py script will cause tests to fail.")
endif()

########################################
# Find xsltproc, which is used by tools/check_test_ran.py
find_program(XSLTPROC xsltproc)
Expand Down
Loading