]> OCCT Git - occt.git/commitdiff
Configuration - Add VCPKG port opencascade (#638)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Wed, 23 Jul 2025 14:22:55 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Wed, 23 Jul 2025 14:22:55 +0000 (15:22 +0100)
- Restructures VCPKG manifest directory structure and updates path references accordingly
- Implements a comprehensive portfile.cmake with feature detection, build configuration, and installation logic
- Updates overlay port and triplet paths to reflect the new directory structure

CMakeLists.txt
adm/vcpkg/ports/opencascade/portfile.cmake [new file with mode: 0644]
adm/vcpkg/ports/opencascade/vcpkg-configuration.json [new file with mode: 0644]
adm/vcpkg/ports/opencascade/vcpkg.json [new file with mode: 0644]
adm/vcpkg/vcpkg-configuration.json [deleted file]
adm/vcpkg/vcpkg.json [deleted file]

index 3dbc4159357165f88e4efc9cfbcc14b7c0d966b7..aaec43af87bee404b51c3b568c0d2c72a5d30a0f 100644 (file)
@@ -31,7 +31,7 @@ if (BUILD_USE_VCPKG)
     message(FATAL_ERROR "VCPKG_ROOT is not defined. Please set it to the path of vcpkg root directory.")
   endif()
 
-  set (VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}/adm/vcpkg")
+  set (VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}/adm/vcpkg/ports/opencascade")
 
   # Disable default features for vcpkg manifest
   set (VCPKG_MANIFEST_NO_DEFAULT_FEATURES 1)
diff --git a/adm/vcpkg/ports/opencascade/portfile.cmake b/adm/vcpkg/ports/opencascade/portfile.cmake
new file mode 100644 (file)
index 0000000..ffdee06
--- /dev/null
@@ -0,0 +1,86 @@
+# Get git information for ABI validation
+execute_process(
+    COMMAND git rev-parse --short HEAD
+    WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../.."
+    OUTPUT_VARIABLE GIT_COMMIT_HASH
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    ERROR_QUIET
+    RESULT_VARIABLE GIT_RESULT
+)
+
+if(NOT GIT_RESULT EQUAL 0)
+    set(GIT_COMMIT_HASH "unknown")
+endif()
+
+set(SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../..")
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+    set(BUILD_TYPE "Shared")
+else()
+    set(BUILD_TYPE "Static")
+endif()
+
+set (BUILD_CPP_STANDARD "C++17")
+if ("cpp20" IN_LIST FEATURES)
+    set (BUILD_CPP_STANDARD "C++20")
+elseif ("cpp23" IN_LIST FEATURES)
+    set (BUILD_CPP_STANDARD "C++23")
+endif()
+
+set (BUILD_OPT_PROFILE "Default")
+if ("optimized" IN_LIST FEATURES)
+    set (BUILD_OPT_PROFILE "Production")
+endif()
+
+set (BUILD_MODULE_Draw OFF)
+if ("tcl" IN_LIST FEATURES OR "tcltk" IN_LIST FEATURES)
+    set (BUILD_MODULE_Draw ON)
+endif()
+
+set (USE_MMGR_TYPE "NATIVE")
+if ("jemalloc" IN_LIST FEATURES)
+    set (USE_MMGR_TYPE "JEMALLOC")
+endif()
+
+# Feature mapping to CMake options
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+    FEATURES
+        angle       USE_GLES2
+        opengl      USE_OPENGL
+        freeimage   USE_FREEIMAGE
+        freetype    USE_FREETYPE
+        rapidjson   USE_RAPIDJSON
+        tbb         USE_TBB
+        vtk         USE_VTK
+        tcltk       USE_TK
+        draco       USE_DRACO
+        ffmpeg      USE_FFMPEG
+        openvr      USE_OPENVR
+        gtest       BUILD_GTEST
+        pch         BUILD_USE_PCH
+        d3d         USE_D3D
+        docs        BUILD_DOC_Overview
+)
+
+vcpkg_cmake_configure(
+    SOURCE_PATH "${SOURCE_PATH}"
+    OPTIONS
+        ${FEATURE_OPTIONS}
+        -DBUILD_LIBRARY_TYPE=${BUILD_TYPE}
+        -DINSTALL_DIR_LAYOUT=Vcpkg
+        -DBUILD_USE_VCPKG=ON
+        -DBUILD_CPP_STANDARD=${BUILD_CPP_STANDARD}
+        -DBUILD_OPT_PROFILE=${BUILD_OPT_PROFILE}
+        -DBUILD_MODULE_Draw=${BUILD_MODULE_Draw}
+        -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
+    MAYBE_UNUSED_VARIABLES
+        -DUSE_HASH=${GIT_COMMIT_HASH}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_install_copyright(
+    FILE_LIST
+        "${SOURCE_PATH}/LICENSE_LGPL_21.txt"
+        "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt"
+)
diff --git a/adm/vcpkg/ports/opencascade/vcpkg-configuration.json b/adm/vcpkg/ports/opencascade/vcpkg-configuration.json
new file mode 100644 (file)
index 0000000..4e4500b
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
+  "default-registry": {
+    "kind": "git",
+    "baseline": "2ddc10c8afa00a762a69f21f6427849fe906ede0",
+    "repository": "https://github.com/microsoft/vcpkg"
+  },
+  "registries": [
+    {
+      "kind": "artifact",
+      "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
+      "name": "microsoft"
+    }
+  ],
+  "overlay-ports": [
+    "../../ports"
+  ],
+  "overlay-triplets": [
+    "../../triplets"
+  ]
+}
\ No newline at end of file
diff --git a/adm/vcpkg/ports/opencascade/vcpkg.json b/adm/vcpkg/ports/opencascade/vcpkg.json
new file mode 100644 (file)
index 0000000..17e09f6
--- /dev/null
@@ -0,0 +1,167 @@
+{
+  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
+  "name": "opencascade",
+  "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://dev.opencascade.org/doc/overview/html",
+  "license": "LGPL-2.1",
+  "dependencies": [
+    {
+      "name": "vcpkg-cmake",
+      "host": true
+    },
+    {
+      "name": "vcpkg-cmake-config",
+      "host": true
+    }
+  ],
+  "default-features": [
+    {
+      "name": "tcl"
+    },
+    {
+      "name": "freetype",
+      "platform": "!uwp"
+    },
+    {
+      "name": "angle",
+      "platform": "uwp"
+    },
+    {
+      "name": "opengl",
+      "platform": "!(android | ios | uwp | wasm32)"
+    }
+  ],
+  "features": {
+    "angle": {
+      "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",
+          "platform": "!(linux & !static)"
+        }
+      ]
+    },
+    "opengl": {
+      "description": "Enables OpenGL support for 3D visualization toolkit. Required for OCCT's OpenGL rendering pipeline and graphical display drivers.",
+      "dependencies": [
+        "opengl"
+      ]
+    },
+    "tcl": {
+      "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 Tcl/Tk GUI support for DRAWEXE test harness. Provides windowed interface for OCCT's geometric modeling and visualization tools.",
+      "dependencies": [
+        {
+          "name": "tcl",
+          "features": [
+            "tk"
+          ]
+        },
+        {
+          "name": "libx11",
+          "platform": "!windows"
+        }
+      ]
+    },
+    "freeimage": {
+      "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 FreeType font rendering engine for high-quality text display in OCCT's 3D visualization and technical drawing output.",
+      "supports": "!uwp",
+      "dependencies": [
+        "fontconfig",
+        {
+          "name": "freetype",
+          "default-features": false
+        }
+      ]
+    },
+    "rapidjson": {
+      "description": "Enables RapidJSON for efficient JSON parsing and serialization in OCCT's glTF 2.0 import/export functionality.",
+      "dependencies": [
+        "rapidjson"
+      ]
+    },
+    "tbb": {
+      "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 VTK (Visualization Toolkit) integration for advanced scientific visualization capabilities and mesh processing in OCCT.",
+      "dependencies": [
+        {
+          "name": "vtk",
+          "default-features": false,
+          "features": [
+            "opengl"
+          ]
+        }
+      ]
+    },
+    "draco": {
+      "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 FFmpeg multimedia framework for video encoding/decoding and animation export capabilities in OCCT's visualization pipeline.",
+      "dependencies": [
+        "ffmpeg"
+      ]
+    },
+    "openvr": {
+      "description": "Enables OpenVR SDK integration for virtual reality support in OCCT's 3D visualization, allowing immersive CAD model exploration.",
+      "dependencies": [
+        "openvr"
+      ]
+    },
+    "jemalloc": {
+      "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"
+      ]
+    },
+    "pch": {
+      "description": "Enables precompiled headers to improve compilation speed. Creates shared headers that are compiled once and reused across multiple source files."
+    },
+    "cpp20": {
+      "description": "Enables C++20 standard compilation mode for OCCT. Provides access to latest C++20 features including concepts and modules."
+    },
+    "cpp23": {
+      "description": "Enables C++23 standard compilation mode for OCCT. Provides access to the latest C++23 features including improved constexpr and new standard library components."
+    },
+    "optimized": {
+      "description": "Enables production-level optimizations for maximum performance. Applies aggressive compiler optimizations and removes debug symbols."
+    },
+    "d3d": {
+      "description": "Enables Direct3D support for 3D visualization on Windows. Provides alternative graphics backend to OpenGL for Windows-specific applications.",
+      "supports": "windows"
+    },
+    "docs": {
+      "description": "Enables documentation generation using Doxygen. Creates HTML reference manual and overview documentation for OCCT API.",
+      "dependencies": [
+        "doxygen"
+      ]
+    }
+  }
+}
\ No newline at end of file
diff --git a/adm/vcpkg/vcpkg-configuration.json b/adm/vcpkg/vcpkg-configuration.json
deleted file mode 100644 (file)
index 538de84..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
-  "default-registry": {
-    "kind": "git",
-    "baseline": "2ddc10c8afa00a762a69f21f6427849fe906ede0",
-    "repository": "https://github.com/microsoft/vcpkg"
-  },
-  "registries": [
-    {
-      "kind": "artifact",
-      "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
-      "name": "microsoft"
-    }
-  ],
-  "overlay-ports": [
-    "./ports"
-  ],
-  "overlay-triplets": [
-    "./triplets"
-  ]
-}
\ No newline at end of file
diff --git a/adm/vcpkg/vcpkg.json b/adm/vcpkg/vcpkg.json
deleted file mode 100644 (file)
index 17e09f6..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-{
-  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
-  "name": "opencascade",
-  "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://dev.opencascade.org/doc/overview/html",
-  "license": "LGPL-2.1",
-  "dependencies": [
-    {
-      "name": "vcpkg-cmake",
-      "host": true
-    },
-    {
-      "name": "vcpkg-cmake-config",
-      "host": true
-    }
-  ],
-  "default-features": [
-    {
-      "name": "tcl"
-    },
-    {
-      "name": "freetype",
-      "platform": "!uwp"
-    },
-    {
-      "name": "angle",
-      "platform": "uwp"
-    },
-    {
-      "name": "opengl",
-      "platform": "!(android | ios | uwp | wasm32)"
-    }
-  ],
-  "features": {
-    "angle": {
-      "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",
-          "platform": "!(linux & !static)"
-        }
-      ]
-    },
-    "opengl": {
-      "description": "Enables OpenGL support for 3D visualization toolkit. Required for OCCT's OpenGL rendering pipeline and graphical display drivers.",
-      "dependencies": [
-        "opengl"
-      ]
-    },
-    "tcl": {
-      "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 Tcl/Tk GUI support for DRAWEXE test harness. Provides windowed interface for OCCT's geometric modeling and visualization tools.",
-      "dependencies": [
-        {
-          "name": "tcl",
-          "features": [
-            "tk"
-          ]
-        },
-        {
-          "name": "libx11",
-          "platform": "!windows"
-        }
-      ]
-    },
-    "freeimage": {
-      "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 FreeType font rendering engine for high-quality text display in OCCT's 3D visualization and technical drawing output.",
-      "supports": "!uwp",
-      "dependencies": [
-        "fontconfig",
-        {
-          "name": "freetype",
-          "default-features": false
-        }
-      ]
-    },
-    "rapidjson": {
-      "description": "Enables RapidJSON for efficient JSON parsing and serialization in OCCT's glTF 2.0 import/export functionality.",
-      "dependencies": [
-        "rapidjson"
-      ]
-    },
-    "tbb": {
-      "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 VTK (Visualization Toolkit) integration for advanced scientific visualization capabilities and mesh processing in OCCT.",
-      "dependencies": [
-        {
-          "name": "vtk",
-          "default-features": false,
-          "features": [
-            "opengl"
-          ]
-        }
-      ]
-    },
-    "draco": {
-      "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 FFmpeg multimedia framework for video encoding/decoding and animation export capabilities in OCCT's visualization pipeline.",
-      "dependencies": [
-        "ffmpeg"
-      ]
-    },
-    "openvr": {
-      "description": "Enables OpenVR SDK integration for virtual reality support in OCCT's 3D visualization, allowing immersive CAD model exploration.",
-      "dependencies": [
-        "openvr"
-      ]
-    },
-    "jemalloc": {
-      "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"
-      ]
-    },
-    "pch": {
-      "description": "Enables precompiled headers to improve compilation speed. Creates shared headers that are compiled once and reused across multiple source files."
-    },
-    "cpp20": {
-      "description": "Enables C++20 standard compilation mode for OCCT. Provides access to latest C++20 features including concepts and modules."
-    },
-    "cpp23": {
-      "description": "Enables C++23 standard compilation mode for OCCT. Provides access to the latest C++23 features including improved constexpr and new standard library components."
-    },
-    "optimized": {
-      "description": "Enables production-level optimizations for maximum performance. Applies aggressive compiler optimizations and removes debug symbols."
-    },
-    "d3d": {
-      "description": "Enables Direct3D support for 3D visualization on Windows. Provides alternative graphics backend to OpenGL for Windows-specific applications.",
-      "supports": "windows"
-    },
-    "docs": {
-      "description": "Enables documentation generation using Doxygen. Creates HTML reference manual and overview documentation for OCCT API.",
-      "dependencies": [
-        "doxygen"
-      ]
-    }
-  }
-}
\ No newline at end of file