From d65a21941e2eb51565b90b2f7f514226bb128f8d Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Sat, 17 Jun 2023 12:17:17 +0300 Subject: [PATCH 1/9] Compile for windows x64 and x86 --- .github/workflows/windows-config/action.yml | 51 ++++++ .github/workflows/windows.yml | 109 ++++++++++++ .gitignore | 1 + CMakeLists.txt | 2 +- cmake/FindFreeimage.cmake | 9 +- cmake/SearchForStuff.cmake | 47 +++++- deps/vcpkg/cache/linux/.gitkeep | 0 deps/vcpkg/cache/windows/.gitkeep | 0 deps/vcpkg/manifest/vcpkg.json | 156 ++++++++++++++++++ deps/vcpkg/triplets/x86-windows-release.cmake | 4 + gazebo/rendering/RenderEngine.cc | 2 + 11 files changed, 370 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/windows-config/action.yml create mode 100644 .github/workflows/windows.yml create mode 100644 deps/vcpkg/cache/linux/.gitkeep create mode 100644 deps/vcpkg/cache/windows/.gitkeep create mode 100644 deps/vcpkg/manifest/vcpkg.json create mode 100644 deps/vcpkg/triplets/x86-windows-release.cmake diff --git a/.github/workflows/windows-config/action.yml b/.github/workflows/windows-config/action.yml new file mode 100644 index 0000000000..e0435035cb --- /dev/null +++ b/.github/workflows/windows-config/action.yml @@ -0,0 +1,51 @@ +name: windows-config +description: configure windows +inputs: + arch: + required: true + type: choice + options: + - x86 + - x64 + +runs: + using: "composite" + steps: + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: deps\vcpkg\cache\windows + key: windows-${{ inputs.arch }}-${{ hashFiles('.github\workflows\windows-config\action.yml') }} + + - name: Setup msbuild + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ inputs.arch }} + + - name: Fix vcpkg + shell: cmd + run: vcpkg.exe integrate remove + + - name: Clone vcpkg + shell: cmd + run: | + git clone https://github.com/microsoft/vcpkg/ + + - name: Configure Gazebo + shell: cmd + run: | + set VCPKG_BINARY_SOURCES=clear;files,%CD%\deps\vcpkg\cache\windows,readwrite; + cmake . -G Ninja -B build ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake ^ + -DVCPKG_MANIFEST_DIR=deps\vcpkg\manifest ^ + -DVCPKG_OVERLAY_TRIPLETS=deps\vcpkg\triplets ^ + -DVCPKG_INSTALLED_DIR=%CD%\vcpkg\installed ^ + -DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-windows-release ^ + -DVCPKG_HOST_TRIPLET=${{ inputs.arch }}-windows-release ^ + -DVCPKG_INSTALL_OPTIONS=--clean-after-build ^ + -DUSE_EXTERNAL_TINYXML=ON ^ + -DUSE_EXTERNAL_TINYXML2=ON ^ + -DUSE_EXTERNAL_TINY_PROCESS_LIBRARY=ON ^ + -DGZ_PROTOBUF_USE_CMAKE_CONFIG=ON ^ + -DCMAKE_INSTALL_PREFIX=%CD%\vcpkg\installed\${{ inputs.arch }}-windows-release diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..ee2c9bb464 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,109 @@ +name: 🪟 Windows +on: + push: + branches: [ gazebo11 ] + pull_request: + branches: [ gazebo11 ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + config: + name: ${{ matrix.arch }}-config + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + - arch: x86 + steps: + - uses: actions/checkout@v3 + + - name: Config Gazebo + uses: ./.github/workflows/windows-config/ + with: + arch: ${{ matrix.arch }} + + - name: Prepare logs on failure + if: failure() + shell: cmd + run: | + 7z a -t7z -r -mx=9 logs.7z ^ + vcpkg/buildtrees/*.log + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v3 + with: + name: windows_logs_${{matrix.arch}}_${{github.event.pull_request.head.sha}} + path: logs.7z + + build: + name: ${{ matrix.arch }}-build + needs: config + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - arch: x64 + - arch: x86 + steps: + - uses: actions/checkout@v3 + + - name: Config Gazebo + uses: ./.github/workflows/windows-config/ + with: + arch: ${{ matrix.arch }} + + - name: Build Gazebo + shell: cmd + run: | + set /a proc=%NUMBER_OF_PROCESSORS% + echo proc=%proc% + cmake --build build --config Release -j %proc% + + - name: Install Gazebo + shell: cmd + run: | + cmake --install build --config Release + + - name: Tests suite compilation + shell: cmd + run: | + echo compile and run tests here + + - name: Prepare logs on failure + if: failure() + shell: cmd + run: | + 7z a -t7z -r -mx=9 logs.7z ^ + vcpkg/buildtrees/*.log ^ + build/.ninja_log ^ + build/build.ninja ^ + build/install_manifest.txt ^ + build/vcpkg-manifest-install.log + + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v3 + with: + name: windows_logs_${{matrix.arch}}_${{github.event.pull_request.head.sha}} + path: logs.7z + + - name: Prepare artifacts for deploy + if: success() + shell: cmd + run: | + move vcpkg\installed\${{ matrix.arch }}-windows-release vcpkg\installed\gazebo + 7z a -t7z -r gazebo.7z ./vcpkg/installed/gazebo/ + + - name: Upload gazebo + if: success() + uses: actions/upload-artifact@v3 + with: + name: gazebo_windows_${{matrix.arch}}_${{github.event.pull_request.head.sha}} + path: gazebo.7z diff --git a/.gitignore b/.gitignore index e5bb58bdc7..c8d0306268 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build build_* build-* Ogre.log +deps/vcpkg/cache .DS_Store *.swp *.orig diff --git a/CMakeLists.txt b/CMakeLists.txt index 90780f5ca0..5c45dcce27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,7 +193,7 @@ set(GAZEBO_MODEL_DATABASE_URI http://models.gazebosim.org) set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR}) # Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems when # we pass it to the compiler later. -string(REPLACE "\n" "" OGRE_RESOURCE_PATH ${OGRE_RESOURCE_PATH}) +string(REPLACE "\n" "" OGRE_RESOURCE_PATH "${OGRE_RESOURCE_PATH}") FILE(TO_CMAKE_PATH "${OGRE_RESOURCE_PATH}" OGRE_RESOURCE_PATH) diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake index afd1b33772..f1f5cfe300 100644 --- a/cmake/FindFreeimage.cmake +++ b/cmake/FindFreeimage.cmake @@ -4,7 +4,14 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) ######################################## # Find packages if (PKG_CONFIG_FOUND) - pkg_check_modules(freeimage freeimage>=${MIN_FREEIMAGE_VERSION}) + find_package(freeimage CONFIG) + if (freeimage_FOUND) + set(freeimage_LIBRARIES freeimage::FreeImage) + message (STATUS "FreeImage found") + endif() + if (NOT freeimage_FOUND) + pkg_check_modules(freeimage freeimage>=${MIN_FREEIMAGE_VERSION}) + endif() if (NOT freeimage_FOUND) message (STATUS " freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.") endif (NOT freeimage_FOUND) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 948cf0a8a1..d08f12b12e 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -164,9 +164,12 @@ if (PKG_CONFIG_FOUND) # Find Simbody set(SimTK_INSTALL_DIR ${SimTK_INSTALL_PREFIX}) #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) - find_package(Simbody) - if (Simbody_FOUND) - message (STATUS "Looking for Simbody - found") + find_package(Simbody CONFIG) + if (Simbody_FOUND) + if ("${Simbody_LIBRARIES}" STREQUAL "" OR "${Simbody_LIBRARIES}" STREQUAL "Simbody_LIBRARIES-NOTFOUND") + set(Simbody_LIBRARIES SimTKmath SimTKcommon SimTKsimbody) + endif() + message (STATUS "Simbody_LIBRARIES: ${Simbody_LIBRARIES}") set (HAVE_SIMBODY TRUE) else() message (STATUS "Looking for Simbody - not found") @@ -213,7 +216,13 @@ if (PKG_CONFIG_FOUND) if (USE_EXTERNAL_TINYXML) message (STATUS "Using system tinyxml.") - pkg_check_modules(tinyxml tinyxml) + find_package(tinyxml CONFIG) + if (tinyxml_FOUND) + message (STATUS "tinyxml found via find_package") + endif() + if (NOT tinyxml_FOUND) + pkg_check_modules(tinyxml tinyxml) + endif() if (NOT tinyxml_FOUND) find_path (tinyxml_INCLUDE_DIRS tinyxml.h ${tinyxml_INCLUDE_DIRS} ENV CPATH) find_library(tinyxml_LIBRARIES NAMES tinyxml) @@ -327,7 +336,14 @@ if (PKG_CONFIG_FOUND) ################################################# # Find TBB - pkg_check_modules(TBB tbb) + find_package(TBB CONFIG REQUIRED) + if (TBB_FOUND) + set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) + message (STATUS "TBB version: " ${TBB_VERSION}) + endif() + if (NOT TBB_FOUND) + pkg_check_modules(TBB tbb) + endif() set (TBB_PKG_CONFIG "tbb") if (NOT TBB_FOUND) message(STATUS "TBB not found, attempting to detect manually") @@ -355,6 +371,7 @@ if (PKG_CONFIG_FOUND) if (DEFINED TBB_VERSION AND NOT ${TBB_VERSION} STREQUAL "") if (${TBB_VERSION} VERSION_GREATER_EQUAL "2021.0") set(HAVE_TBB_GREATER_OR_EQUAL_2021 ON) + message (STATUS "HAVE_TBB_GREATER_OR_EQUAL_2021=ON") endif() endif() @@ -583,13 +600,20 @@ if (PKG_CONFIG_FOUND) # First and preferred option is to look for bullet standard pkgconfig, # so check it first. if it is not present, check for the OSRF # custom bullet2.82.pc file - pkg_check_modules(BULLET bullet>=2.82) + find_package(BULLET CONFIG 2.82) if (NOT BULLET_FOUND) - pkg_check_modules(BULLET bullet2.82>=2.82) + pkg_check_modules(BULLET bullet>=2.82) + endif() + if (NOT BULLET_FOUND) + pkg_check_modules(BULLET bullet2.82>=2.82) endif() if (BULLET_FOUND) set (HAVE_BULLET TRUE) + if (${BULLET_VERSION} STREQUAL "") + set (BULLET_VERSION ${BULLET_VERSION_STRING}) + endif() + message (STATUS "Bullet found: " ${BULLET_VERSION}) add_definitions( -DLIBBULLET_VERSION=${BULLET_VERSION} ) else() set (HAVE_BULLET FALSE) @@ -635,7 +659,7 @@ endif () ######################################## # Find SDFormat set(SDF_MIN_REQUIRED_VERSION 9.8) -find_package(sdformat9 ${SDF_MIN_REQUIRED_VERSION} REQUIRED) +find_package(sdformat9 CONFIG ${SDF_MIN_REQUIRED_VERSION} REQUIRED) if (sdformat9_FOUND) message (STATUS "Looking for SDFormat9 - found") else () @@ -679,13 +703,18 @@ endif () ######################################## # Find gdal -include (FindGDAL) +find_package(GDAL CONFIG) +if ("${GDAL_LIBRARY}" STREQUAL "") + unset(GDAL_FOUND CACHE) + include (FindGDAL) +endif() if (NOT GDAL_FOUND) message (STATUS "Looking for libgdal - not found") BUILD_WARNING ("GDAL not found, Digital elevation terrains support will be disabled.") set (HAVE_GDAL OFF CACHE BOOL "HAVE GDAL" FORCE) else () message (STATUS "Looking for libgdal - found") + message (STATUS "GDAL_LIBRARY: ${GDAL_LIBRARY}") set (HAVE_GDAL ON CACHE BOOL "HAVE GDAL" FORCE) endif () diff --git a/deps/vcpkg/cache/linux/.gitkeep b/deps/vcpkg/cache/linux/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/vcpkg/cache/windows/.gitkeep b/deps/vcpkg/cache/windows/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/vcpkg/manifest/vcpkg.json b/deps/vcpkg/manifest/vcpkg.json new file mode 100644 index 0000000000..bb3579ee8a --- /dev/null +++ b/deps/vcpkg/manifest/vcpkg.json @@ -0,0 +1,156 @@ +{ + "name": "gazebo", + "description": "Open source robotics simulator.", + "homepage": "http://gazebosim.org", + "license": "Apache-2.0", + "builtin-baseline": "19af97cba8ca48474e4ad15a24ed50271a9ecdac", + "dependencies": [ + "boost-asio", + "boost-date-time", + "boost-filesystem", + "boost-format", + "boost-interprocess", + "boost-iostreams", + "boost-program-options", + "boost-property-tree", + "boost-regex", + "boost-system", + "boost-thread", + "boost-uuid", + "ccd", + "freeimage", + { + "name": "hdf5", + "features": [ + "cpp" + ] + }, + "ignition-common3", + "ignition-fuel-tools4", + "ignition-math6", + "ignition-msgs5", + "ignition-transport8", + { + "name": "libtar", + "platform": "!windows" + }, + "ogre", + "opengl", + { + "name": "pkgconf", + "host": true + }, + "protobuf", + "qt5-base", + "qwt", + "sdformat9", + "tbb", + "tiny-process-library", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "bullet", + "dart", + "ffmpeg", + "gdal", + "graphviz", + "gts", + "libusb", + "openal", + "simbody" + ], + "features": { + "bullet": { + "description": "Use the bullet physics engine", + "dependencies": [ + "bullet3" + ] + }, + "dart": { + "description": "Use the dart physics engine", + "dependencies": [ + "dartsim" + ] + }, + "ffmpeg": { + "description": "Enable audio-video capabilities", + "dependencies": [ + { + "name": "ffmpeg", + "features": [ + "avcodec", + "avformat", + "swscale" + ] + } + ] + }, + "gdal": { + "description": "Enable digital elevation terrains support", + "dependencies": [ + "gdal" + ] + }, + "graphviz": { + "description": "Enable model editor's schematic view", + "dependencies": [ + "graphviz" + ] + }, + "gts": { + "description": "Enable CSG support", + "dependencies": [ + "gts" + ] + }, + "libusb": { + "description": "Enable USB peripheral support", + "dependencies": [ + "libusb" + ] + }, + "openal": { + "description": "Enable audio support", + "dependencies": [ + "openal-soft" + ] + }, + "plugins": { + "description": "Build gazebo plugins", + "supports": "!linux" + }, + "simbody": { + "description": "Use the simbody physics engine", + "dependencies": [ + "simbody" + ] + }, + "tools": { + "description": "Build gazebo tools", + "supports": "!(linux & static)" + } + }, + "overrides": [ + { + "name": "ogre", + "version": "1.12.9", + "port-version": 10 + }, + { + "name": "qwt", + "version": "6.1.5" + }, + { + "name": "graphviz", + "version": "2.49.1", + "port-version": 4 + } + ] +} diff --git a/deps/vcpkg/triplets/x86-windows-release.cmake b/deps/vcpkg/triplets/x86-windows-release.cmake new file mode 100644 index 0000000000..0a277bdb77 --- /dev/null +++ b/deps/vcpkg/triplets/x86-windows-release.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_BUILD_TYPE release) diff --git a/gazebo/rendering/RenderEngine.cc b/gazebo/rendering/RenderEngine.cc index 3700bca5c9..9ea4b04cbf 100644 --- a/gazebo/rendering/RenderEngine.cc +++ b/gazebo/rendering/RenderEngine.cc @@ -22,6 +22,8 @@ // Not Apple or Windows #if not defined(__APPLE__) && not defined(_WIN32) +#define GL_GLEXT_LEGACY +#define GLX_GLXEXT_LEGACY # include # include # include From bd3c45c18f2138260cd2a0405c9e0a6fe98d7a18 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Mon, 14 Aug 2023 23:25:59 +0300 Subject: [PATCH 2/9] Refactor according comments. --- .github/workflows/windows.yml | 2 +- cmake/FindFreeimage.cmake | 15 ++++++------- cmake/SearchForStuff.cmake | 38 ++++++++++++++------------------ gazebo/rendering/RenderEngine.cc | 2 -- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ee2c9bb464..3f6c2dc8ad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: 🪟 Windows +name: 🪟 Windows-vcpkg on: push: branches: [ gazebo11 ] diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake index f1f5cfe300..53211ce725 100644 --- a/cmake/FindFreeimage.cmake +++ b/cmake/FindFreeimage.cmake @@ -4,19 +4,18 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake) ######################################## # Find packages if (PKG_CONFIG_FOUND) + pkg_check_modules(freeimage freeimage>=${MIN_FREEIMAGE_VERSION}) + if (NOT freeimage_FOUND) + message (STATUS " freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.") + endif (NOT freeimage_FOUND) +endif (PKG_CONFIG_FOUND) +if (NOT freeimage_FOUND) find_package(freeimage CONFIG) if (freeimage_FOUND) set(freeimage_LIBRARIES freeimage::FreeImage) message (STATUS "FreeImage found") endif() - if (NOT freeimage_FOUND) - pkg_check_modules(freeimage freeimage>=${MIN_FREEIMAGE_VERSION}) - endif() - if (NOT freeimage_FOUND) - message (STATUS " freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.") - endif (NOT freeimage_FOUND) -endif (PKG_CONFIG_FOUND) - +endif() if (NOT freeimage_FOUND) find_path(freeimage_INCLUDE_DIRS FreeImage.h) if (NOT freeimage_INCLUDE_DIRS) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index d08f12b12e..0bfc26ad04 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -164,12 +164,11 @@ if (PKG_CONFIG_FOUND) # Find Simbody set(SimTK_INSTALL_DIR ${SimTK_INSTALL_PREFIX}) #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) - find_package(Simbody CONFIG) + find_package(Simbody) if (Simbody_FOUND) if ("${Simbody_LIBRARIES}" STREQUAL "" OR "${Simbody_LIBRARIES}" STREQUAL "Simbody_LIBRARIES-NOTFOUND") set(Simbody_LIBRARIES SimTKmath SimTKcommon SimTKsimbody) endif() - message (STATUS "Simbody_LIBRARIES: ${Simbody_LIBRARIES}") set (HAVE_SIMBODY TRUE) else() message (STATUS "Looking for Simbody - not found") @@ -216,12 +215,12 @@ if (PKG_CONFIG_FOUND) if (USE_EXTERNAL_TINYXML) message (STATUS "Using system tinyxml.") - find_package(tinyxml CONFIG) - if (tinyxml_FOUND) - message (STATUS "tinyxml found via find_package") - endif() + pkg_check_modules(tinyxml tinyxml) if (NOT tinyxml_FOUND) - pkg_check_modules(tinyxml tinyxml) + find_package(tinyxml CONFIG) + if (tinyxml_FOUND) + message (STATUS "tinyxml found via find_package") + endif() endif() if (NOT tinyxml_FOUND) find_path (tinyxml_INCLUDE_DIRS tinyxml.h ${tinyxml_INCLUDE_DIRS} ENV CPATH) @@ -336,13 +335,13 @@ if (PKG_CONFIG_FOUND) ################################################# # Find TBB - find_package(TBB CONFIG REQUIRED) - if (TBB_FOUND) - set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) - message (STATUS "TBB version: " ${TBB_VERSION}) - endif() + pkg_check_modules(TBB tbb) if (NOT TBB_FOUND) - pkg_check_modules(TBB tbb) + find_package(TBB CONFIG REQUIRED) + if (TBB_FOUND) + set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) + message (STATUS "TBB version: " ${TBB_VERSION}) + endif() endif() set (TBB_PKG_CONFIG "tbb") if (NOT TBB_FOUND) @@ -371,7 +370,6 @@ if (PKG_CONFIG_FOUND) if (DEFINED TBB_VERSION AND NOT ${TBB_VERSION} STREQUAL "") if (${TBB_VERSION} VERSION_GREATER_EQUAL "2021.0") set(HAVE_TBB_GREATER_OR_EQUAL_2021 ON) - message (STATUS "HAVE_TBB_GREATER_OR_EQUAL_2021=ON") endif() endif() @@ -600,14 +598,13 @@ if (PKG_CONFIG_FOUND) # First and preferred option is to look for bullet standard pkgconfig, # so check it first. if it is not present, check for the OSRF # custom bullet2.82.pc file - find_package(BULLET CONFIG 2.82) + pkg_check_modules(BULLET bullet>=2.82) if (NOT BULLET_FOUND) - pkg_check_modules(BULLET bullet>=2.82) + pkg_check_modules(BULLET bullet2.82>=2.82) endif() - if (NOT BULLET_FOUND) - pkg_check_modules(BULLET bullet2.82>=2.82) + if (NOT BULLET_FOUND) + find_package(BULLET CONFIG 2.82) endif() - if (BULLET_FOUND) set (HAVE_BULLET TRUE) if (${BULLET_VERSION} STREQUAL "") @@ -659,7 +656,7 @@ endif () ######################################## # Find SDFormat set(SDF_MIN_REQUIRED_VERSION 9.8) -find_package(sdformat9 CONFIG ${SDF_MIN_REQUIRED_VERSION} REQUIRED) +find_package(sdformat9 ${SDF_MIN_REQUIRED_VERSION} REQUIRED) if (sdformat9_FOUND) message (STATUS "Looking for SDFormat9 - found") else () @@ -714,7 +711,6 @@ if (NOT GDAL_FOUND) set (HAVE_GDAL OFF CACHE BOOL "HAVE GDAL" FORCE) else () message (STATUS "Looking for libgdal - found") - message (STATUS "GDAL_LIBRARY: ${GDAL_LIBRARY}") set (HAVE_GDAL ON CACHE BOOL "HAVE GDAL" FORCE) endif () diff --git a/gazebo/rendering/RenderEngine.cc b/gazebo/rendering/RenderEngine.cc index 9ea4b04cbf..3700bca5c9 100644 --- a/gazebo/rendering/RenderEngine.cc +++ b/gazebo/rendering/RenderEngine.cc @@ -22,8 +22,6 @@ // Not Apple or Windows #if not defined(__APPLE__) && not defined(_WIN32) -#define GL_GLEXT_LEGACY -#define GLX_GLXEXT_LEGACY # include # include # include From 2d49ed4de62342772da4da6fecb1d1f2fc4086a4 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 16 Aug 2023 06:44:53 +0300 Subject: [PATCH 3/9] revert changes of tbb --- cmake/SearchForStuff.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 0bfc26ad04..b3ec0656f2 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -335,13 +335,13 @@ if (PKG_CONFIG_FOUND) ################################################# # Find TBB - pkg_check_modules(TBB tbb) + find_package(TBB CONFIG REQUIRED) + if (TBB_FOUND) + set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) + message (STATUS "TBB version: " ${TBB_VERSION}) + endif() if (NOT TBB_FOUND) - find_package(TBB CONFIG REQUIRED) - if (TBB_FOUND) - set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) - message (STATUS "TBB version: " ${TBB_VERSION}) - endif() + pkg_check_modules(TBB tbb) endif() set (TBB_PKG_CONFIG "tbb") if (NOT TBB_FOUND) From 6483a50b72ce66aaaf53ec98d4a343307d07b759 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 16 Aug 2023 18:43:42 +0300 Subject: [PATCH 4/9] simbody workaround comment explanation. --- cmake/SearchForStuff.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index b3ec0656f2..fa00cca590 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -166,6 +166,7 @@ if (PKG_CONFIG_FOUND) #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) find_package(Simbody) if (Simbody_FOUND) + # When simbody is found but it don't define any libs, we should manually define the libs. if ("${Simbody_LIBRARIES}" STREQUAL "" OR "${Simbody_LIBRARIES}" STREQUAL "Simbody_LIBRARIES-NOTFOUND") set(Simbody_LIBRARIES SimTKmath SimTKcommon SimTKsimbody) endif() From 9d7660fd424f202766133899b1d9a848bdccb506 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 16 Aug 2023 20:07:00 +0300 Subject: [PATCH 5/9] bug fix: - revert tbb changes - unset(freeimage_FOUND CACHE) - unset(tinyxml_FOUND CACHE) - set(Simbody_LIBRARIES ${Simbody_STATIC_LIBRARIES}) when ${Simbody_LIBRARIES} not found. this is static build case --- cmake/FindFreeimage.cmake | 2 ++ cmake/SearchForStuff.cmake | 15 +++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake index 53211ce725..9b04450a54 100644 --- a/cmake/FindFreeimage.cmake +++ b/cmake/FindFreeimage.cmake @@ -10,6 +10,8 @@ if (PKG_CONFIG_FOUND) endif (NOT freeimage_FOUND) endif (PKG_CONFIG_FOUND) if (NOT freeimage_FOUND) + # Workaround for CMake bug https://gitlab.kitware.com/cmake/cmake/issues/17135 + unset(freeimage_FOUND CACHE) find_package(freeimage CONFIG) if (freeimage_FOUND) set(freeimage_LIBRARIES freeimage::FreeImage) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index fa00cca590..3cef4823b1 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -166,9 +166,9 @@ if (PKG_CONFIG_FOUND) #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) find_package(Simbody) if (Simbody_FOUND) - # When simbody is found but it don't define any libs, we should manually define the libs. + # When simbody is found but it static libs, we need to add it manually. if ("${Simbody_LIBRARIES}" STREQUAL "" OR "${Simbody_LIBRARIES}" STREQUAL "Simbody_LIBRARIES-NOTFOUND") - set(Simbody_LIBRARIES SimTKmath SimTKcommon SimTKsimbody) + set(Simbody_LIBRARIES ${Simbody_STATIC_LIBRARIES}) endif() set (HAVE_SIMBODY TRUE) else() @@ -218,6 +218,8 @@ if (PKG_CONFIG_FOUND) message (STATUS "Using system tinyxml.") pkg_check_modules(tinyxml tinyxml) if (NOT tinyxml_FOUND) + # Workaround for CMake bug https://gitlab.kitware.com/cmake/cmake/issues/17135 + unset(tinyxml_FOUND CACHE) find_package(tinyxml CONFIG) if (tinyxml_FOUND) message (STATUS "tinyxml found via find_package") @@ -336,14 +338,7 @@ if (PKG_CONFIG_FOUND) ################################################# # Find TBB - find_package(TBB CONFIG REQUIRED) - if (TBB_FOUND) - set(TBB_LIBRARIES TBB::tbb TBB::tbbmalloc) - message (STATUS "TBB version: " ${TBB_VERSION}) - endif() - if (NOT TBB_FOUND) - pkg_check_modules(TBB tbb) - endif() + pkg_check_modules(TBB tbb) set (TBB_PKG_CONFIG "tbb") if (NOT TBB_FOUND) message(STATUS "TBB not found, attempting to detect manually") From 72ae3b7f02e9e1119418a5a77e13e3200fee5b8d Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 16 Aug 2023 20:22:02 +0300 Subject: [PATCH 6/9] Review comments: - revert changes of freeimages - revert changes of tinyxml --- cmake/FindFreeimage.cmake | 10 +--------- cmake/SearchForStuff.cmake | 11 ++--------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake index 9b04450a54..afd1b33772 100644 --- a/cmake/FindFreeimage.cmake +++ b/cmake/FindFreeimage.cmake @@ -9,15 +9,7 @@ if (PKG_CONFIG_FOUND) message (STATUS " freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.") endif (NOT freeimage_FOUND) endif (PKG_CONFIG_FOUND) -if (NOT freeimage_FOUND) - # Workaround for CMake bug https://gitlab.kitware.com/cmake/cmake/issues/17135 - unset(freeimage_FOUND CACHE) - find_package(freeimage CONFIG) - if (freeimage_FOUND) - set(freeimage_LIBRARIES freeimage::FreeImage) - message (STATUS "FreeImage found") - endif() -endif() + if (NOT freeimage_FOUND) find_path(freeimage_INCLUDE_DIRS FreeImage.h) if (NOT freeimage_INCLUDE_DIRS) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 3cef4823b1..3ccbe01be8 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -165,7 +165,8 @@ if (PKG_CONFIG_FOUND) set(SimTK_INSTALL_DIR ${SimTK_INSTALL_PREFIX}) #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) find_package(Simbody) - if (Simbody_FOUND) + if (Simbody_FOUND) + message (STATUS "Looking for Simbody - found") # When simbody is found but it static libs, we need to add it manually. if ("${Simbody_LIBRARIES}" STREQUAL "" OR "${Simbody_LIBRARIES}" STREQUAL "Simbody_LIBRARIES-NOTFOUND") set(Simbody_LIBRARIES ${Simbody_STATIC_LIBRARIES}) @@ -217,14 +218,6 @@ if (PKG_CONFIG_FOUND) if (USE_EXTERNAL_TINYXML) message (STATUS "Using system tinyxml.") pkg_check_modules(tinyxml tinyxml) - if (NOT tinyxml_FOUND) - # Workaround for CMake bug https://gitlab.kitware.com/cmake/cmake/issues/17135 - unset(tinyxml_FOUND CACHE) - find_package(tinyxml CONFIG) - if (tinyxml_FOUND) - message (STATUS "tinyxml found via find_package") - endif() - endif() if (NOT tinyxml_FOUND) find_path (tinyxml_INCLUDE_DIRS tinyxml.h ${tinyxml_INCLUDE_DIRS} ENV CPATH) find_library(tinyxml_LIBRARIES NAMES tinyxml) From 605c80e6bf2157ff1e2877083b14648899e3e469 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Tue, 22 Aug 2023 20:00:04 +0300 Subject: [PATCH 7/9] include (FindGDAL) first --- cmake/SearchForStuff.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 3ccbe01be8..d16bd5f7f3 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -689,10 +689,10 @@ endif () ######################################## # Find gdal -find_package(GDAL CONFIG) +include (FindGDAL) if ("${GDAL_LIBRARY}" STREQUAL "") unset(GDAL_FOUND CACHE) - include (FindGDAL) + find_package(GDAL CONFIG) endif() if (NOT GDAL_FOUND) message (STATUS "Looking for libgdal - not found") From 4851c1c211326b28fb021d989cafc40a0d4a46ed Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 23 Aug 2023 19:15:51 +0300 Subject: [PATCH 8/9] remote find package FindGDAL --- cmake/SearchForStuff.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index d16bd5f7f3..4f5859781d 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -690,10 +690,6 @@ endif () ######################################## # Find gdal include (FindGDAL) -if ("${GDAL_LIBRARY}" STREQUAL "") - unset(GDAL_FOUND CACHE) - find_package(GDAL CONFIG) -endif() if (NOT GDAL_FOUND) message (STATUS "Looking for libgdal - not found") BUILD_WARNING ("GDAL not found, Digital elevation terrains support will be disabled.") From 1cf4633dc9374fd8cd4de7ca613961c5d63844b3 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Fri, 15 Sep 2023 02:27:33 +0300 Subject: [PATCH 9/9] Remove upload --- .github/workflows/windows-config/action.yml | 2 +- .github/workflows/windows.yml | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/windows-config/action.yml b/.github/workflows/windows-config/action.yml index e0435035cb..23f16615e4 100644 --- a/.github/workflows/windows-config/action.yml +++ b/.github/workflows/windows-config/action.yml @@ -15,7 +15,7 @@ runs: uses: actions/cache@v3 with: path: deps\vcpkg\cache\windows - key: windows-${{ inputs.arch }}-${{ hashFiles('.github\workflows\windows-config\action.yml') }} + key: windows-${{ inputs.arch }}-${{ hashFiles('.github\workflows\windows-config\action.yml', 'deps\vcpkg\manifest\vcpkg.json') }} - name: Setup msbuild uses: ilammy/msvc-dev-cmd@v1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3f6c2dc8ad..2574370238 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -93,17 +93,3 @@ jobs: with: name: windows_logs_${{matrix.arch}}_${{github.event.pull_request.head.sha}} path: logs.7z - - - name: Prepare artifacts for deploy - if: success() - shell: cmd - run: | - move vcpkg\installed\${{ matrix.arch }}-windows-release vcpkg\installed\gazebo - 7z a -t7z -r gazebo.7z ./vcpkg/installed/gazebo/ - - - name: Upload gazebo - if: success() - uses: actions/upload-artifact@v3 - with: - name: gazebo_windows_${{matrix.arch}}_${{github.event.pull_request.head.sha}} - path: gazebo.7z