From 2e2dc8d3e5b12f3b822c257a40bf68c5789b4895 Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Mon, 14 Jul 2025 22:15:51 +0100 Subject: [PATCH] Configuration - VCPKG add GTest feature (#616) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Bumped OCCT version from 7.8.1 to 8.0.0 and updated the documentation URL. - Enhanced descriptions for existing vcpkg features and introduced a “gtest” feature in vcpkg.json. - Modified CMakeLists.txt to add/unset the GTest vcpkg feature and reorganized test setup calls. --- .github/actions/run-gtest/action.yml | 7 +++--- CMakeLists.txt | 17 ++++++++----- adm/vcpkg/vcpkg.json | 36 ++++++++++++++++------------ 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.github/actions/run-gtest/action.yml b/.github/actions/run-gtest/action.yml index d3fb85d625..f9d11f6a9c 100644 --- a/.github/actions/run-gtest/action.yml +++ b/.github/actions/run-gtest/action.yml @@ -58,7 +58,6 @@ runs: run: | cd install call env.bat vc14 win64 release - cd bin set GTEST_OUTPUT="" OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 type gtest_output.log @@ -82,8 +81,8 @@ runs: with: name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }} path: | - install/bin/gtest_results.xml - install/bin/gtest_output.log + install/**/gtest_results.xml + install/**/gtest_output.log retention-days: 15 - name: Check for test failures on Windows @@ -91,7 +90,7 @@ runs: id: check-failures-windows shell: pwsh run: | - cd install/bin + cd install $log = Get-Content "gtest_output.log" -Raw if ($log -match "\[\s+FAILED\s+\]") { Write-Error "GTest failures detected in the output." diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dba1d4307..fcdc8cea77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -759,6 +759,17 @@ else() OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC") endif() +# GTest +if (BUILD_GTEST) + OCCT_ADD_VCPKG_FEATURE ("gtest") + list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/gtest") +else() + OCCT_UNSET_VCPKG_FEATURE ("gtest") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST") + OCCT_CHECK_AND_UNSET_GROUP ("GTest") + OCCT_CHECK_AND_UNSET ("INSTALL_GTEST") +endif() + # qt for samples if (BUILD_SAMPLES_QT) # check qt 3rdparty path @@ -1198,7 +1209,6 @@ endforeach() # Setup Google Test integration if enabled if (BUILD_GTEST) - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gtest") enable_testing() OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_gtest") @@ -1212,11 +1222,6 @@ if (BUILD_GTEST) # Set environment variables for all tests OCCT_SET_GTEST_ENVIRONMENT() -else() - # Disable GTest integration if not enabled - OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST") - OCCT_CHECK_AND_UNSET_GROUP ("GTest") - OCCT_CHECK_AND_UNSET ("INSTALL_GTEST") endif() if (BUILD_DOC_Overview OR BUILD_DOC_RefMan) diff --git a/adm/vcpkg/vcpkg.json b/adm/vcpkg/vcpkg.json index 81e1829cf7..89d3a2413a 100644 --- a/adm/vcpkg/vcpkg.json +++ b/adm/vcpkg/vcpkg.json @@ -1,10 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "opencascade", - "version": "7.8.1", + "version": "8.0.0", "description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.", "homepage": "https://github.com/Open-Cascade-SAS/OCCT", - "documentation": "https://github.com/Open-Cascade-SAS/OCCT/wiki", + "documentation": "https://dev.opencascade.org/doc/overview/html", "license": "LGPL-2.1", "dependencies": [ { @@ -35,7 +35,7 @@ ], "features": { "angle": { - "description": "Enables optional usage of OpenGL ES 2.0. Part of the module-visualization.", + "description": "Enables OpenGL ES 2.0 through ANGLE project. Required for 3D visualization in OCCT on UWP platform where desktop OpenGL is not available.", "dependencies": [ { "name": "angle", @@ -44,19 +44,19 @@ ] }, "opengl": { - "description": "Enables optional usage of OpenGL. Part of the module-visualization.", + "description": "Enables OpenGL support for 3D visualization toolkit. Required for OCCT's OpenGL rendering pipeline and graphical display drivers.", "dependencies": [ "opengl" ] }, "tcl": { - "description": "Enables optional usage of Tcl. Part of the module-foundation-classes.", + "description": "Enables Tcl scripting support for OCCT's DRAWEXE test harness and command-line interface. Provides access to OCCT's geometric algorithms through scripting.", "dependencies": [ "tcl" ] }, "tcltk": { - "description": "Enables optional usage of TclTk. Part of the module-foundation-classes.", + "description": "Enables Tcl/Tk GUI support for DRAWEXE test harness. Provides windowed interface for OCCT's geometric modeling and visualization tools.", "dependencies": [ { "name": "tcl", @@ -71,13 +71,13 @@ ] }, "freeimage": { - "description": "Enables optional usage of FreeImage. Part of the module-visualization.", + "description": "Enables FreeImage support for advanced image file format handling (TIFF, PNG, JPEG, etc.) in OCCT's imaging and visualization components.", "dependencies": [ "freeimage" ] }, "freetype": { - "description": "Enables optional usage of FreeType. Part of the module-visualization.", + "description": "Enables FreeType font rendering engine for high-quality text display in OCCT's 3D visualization and technical drawing output.", "supports": "!uwp", "dependencies": [ "fontconfig", @@ -88,19 +88,19 @@ ] }, "rapidjson": { - "description": "Enables optional usage of RapidJSON. Part of the module-data-exchange.", + "description": "Enables RapidJSON for efficient JSON parsing and serialization in OCCT's glTF 2.0 import/export functionality.", "dependencies": [ "rapidjson" ] }, "tbb": { - "description": "Enables optional usage of TBB. Part of the module-foundation-classes.", + "description": "Enables Intel Threading Building Blocks for optimized parallel computing. Replaces OCCT's default threading with TBB's task-based parallelism for better performance.", "dependencies": [ "tbb" ] }, "vtk": { - "description": "Enables optional usage of VTK. Part of the module-visualization.", + "description": "Enables VTK (Visualization Toolkit) integration for advanced scientific visualization capabilities and mesh processing in OCCT.", "dependencies": [ { "name": "vtk", @@ -112,28 +112,34 @@ ] }, "draco": { - "description": "Enables optional usage of Draco. Part of the module-data-exchange.", + "description": "Enables Google Draco geometry compression for efficient mesh storage and transmission in OCCT's glTF 2.0 import/export workflow.", "dependencies": [ "draco" ] }, "ffmpeg": { - "description": "Enables optional usage of FFmpeg. Part of the module-visualization.", + "description": "Enables FFmpeg multimedia framework for video encoding/decoding and animation export capabilities in OCCT's visualization pipeline.", "dependencies": [ "ffmpeg" ] }, "openvr": { - "description": "Enables optional usage of OpenVR. Part of the module-visualization.", + "description": "Enables OpenVR SDK integration for virtual reality support in OCCT's 3D visualization, allowing immersive CAD model exploration.", "dependencies": [ "openvr" ] }, "jemalloc": { - "description": "Enables optional usage of jemalloc. Part of the module-foundation-classes.", + "description": "Enables jemalloc high-performance memory allocator as replacement for system malloc. Improves memory usage patterns for large-scale CAD operations.", "dependencies": [ "jemalloc" ] + }, + "gtest": { + "description": "Enables Google Test framework for building OCCT's unit test suite. Required for running automated tests and validation of OCCT functionality.", + "dependencies": [ + "gtest" + ] } } } \ No newline at end of file -- 2.39.5