gazebosim / gz-cmake

A set of CMake modules that are used by the C++-based Gazebo projects.
https://gazebosim.org/libs/cmake
Apache License 2.0
27 stars 31 forks source link

In gz-cmake 3.2.2 FindGzOgre2 now can define OGRE2_RESOURCE_PATH as a list #361

Closed traversaro closed 1 year ago

traversaro commented 1 year ago

Until https://github.com/gazebosim/gz-cmake/pull/342 OGRE2_RESOURCE_PATH could only be defined as a CMake variable with a single string, while since https://github.com/gazebosim/gz-cmake/pull/342 OGRE2_RESOURCE_PATH can also be a list of string.

In the case in which OGRE2_RESOURCE_PATH is a list of strings, downstream projects that consider OGRE2_RESOURCE_PATH to be a single string (such as gz-rendering, see https://github.com/gazebosim/gz-rendering/blob/gz-rendering7_7.4.0/ogre2/src/CMakeLists.txt#L21), a string that starts with " but not ended with " is passed to the compiler, resulting in this error:

2023-07-03T14:42:03.0953789Z /home/conda/feedstock_root/build_artifacts/gz-rendering7_1688394561041/_build_env/bin/x86_64-conda-linux-gnu-c++ -DHAVE_EGL=1 -DHAVE_GLX=1 -DOGRE_IGNORE_UNKNOWN_DEBUG -Dgz_rendering7_ogre2_EXPORTS -D/home/conda/feedstock_root/build_artifacts/gz-rendering7_1688394561041/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/OGRE-Next" -DOGRE2_RESOURCE_PATH=\"/home/conda/feedstock_root/build_artifacts/gz-rendering7_1688394561041/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/OGRE -DOGRE2_VERSION=\"2.3.1\" -DGLX_GLXEXT_LEGACY -O3 -DNDEBUG  -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic  -std=c++17 -fPIC -fvisibility=default -msse -msse2 -mfpmath=sse -msse3 -mssse3 -msse4.1 -msse4.2 -fPIC -I/home/conda/feedstock_root/build_artifacts/gz-rendering7_1688394561041/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/uuid -MD -MT ogre2/src/CMakeFiles/gz-rendering7-ogre2.dir/Ogre2RenderEngine.cc.o -MF ogre2/src/CMakeFiles/gz-rendering7-ogre2.dir/Ogre2RenderEngine.cc.o.d -o ogre2/src/CMakeFiles/gz-rendering7-ogre2.dir/Ogre2RenderEngine.cc.o -c /home/conda/feedstock_root/build_artifacts/gz-rendering7_1688394561041/work/ogre2/src/Ogre2RenderEngine.cc
2023-07-03T14:42:03.0961725Z /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
2023-07-03T14:42:03.0962200Z /bin/sh: -c: line 1: syntax error: unexpected end of file

Environment

Steps to reproduce

This happened on conda-forge builds, but could happen on any platform in which OGRE2_RESOURCE_PATH ends up being a list.