Compare commits

..
1 Commits
Author SHA1 Message Date
Clifford Yapp 775385815b Stash some notes and tests on update checking
We ideally want to trigger configure updates, patching repeats, etc.
when git repository updates are pulled down, but because most of our
builds make src copies and apply patches an update into the src git
tree doesn't automatically trigger rebuilding.

Investigating whether a custom update step can be made to do the steps
for us automatically.  The addition of patching makes what needs to
happen for this a bit involved - what's being committed here is just the
beginnings of thinking about how to do what's needed, and is not
functional.
2024-08-07 11:00:13 -04:00
288 changed files with 37653 additions and 15334 deletions
-1
View File
@@ -1 +0,0 @@
*.patch -whitespace
-214
View File
@@ -1,214 +0,0 @@
name: Binary dependencies
on:
push:
schedule:
- cron: '30 2 * * 3'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
env:
BEXT_ARCHIVE_RETENTION_DAYS: 90
jobs:
# Finalized package metadata retains its install prefix. runner.temp is
# stable between producer and consumer jobs on each pinned runner image.
linux_release:
name: Ubuntu GCC Release Build
runs-on: ubuntu-24.04
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Setup - System
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
# Install XCB/OpenGL dev pkgs for Qt - see:
# https://wiki.qt.io/Building_Qt_6_from_Git
# https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libgl-dev
sudo apt-get install libinput-dev
sudo apt-get clean
- name: Configure
run: cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/bext_output"
- name: Build
run: cmake --build build --parallel 2 --verbose
- name: Package dependency tree
if: github.ref == 'refs/heads/main'
shell: bash
env:
BEXT_CHANNEL: ubuntu-24.04-${{ runner.arch }}-release
working-directory: ${{ runner.temp }}/bext_output
run: |
test -d install
test -d noinstall
test -f bext-install-manifest.json
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
- name: Upload dependency tree
if: github.ref == 'refs/heads/main'
id: upload
uses: actions/upload-artifact@v4
with:
name: bext-ubuntu-24.04-${{ runner.arch }}-release-${{ github.sha }}
path: ${{ runner.temp }}/bext-ubuntu-24.04-${{ runner.arch }}-release.tar.gz
if-no-files-found: error
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
compression-level: 0
windows_ninja_release:
name: MSVC - Ninja Release build
runs-on: windows-2025
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Add github workspace to path
shell: pwsh
run: Add-Content -Path $env:GITHUB_PATH -Value $env:GITHUB_WORKSPACE
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
shell: pwsh
run: |
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Release -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/bext_output"
# Ensure generated files are flushed before compilation begins.
Write-VolumeCache C
Write-VolumeCache D
- name: Build
shell: pwsh
run: cmake --build build --parallel 2 --verbose
- name: Package dependency tree
if: github.ref == 'refs/heads/main'
shell: bash
env:
BEXT_CHANNEL: windows-2025-${{ runner.arch }}-release
working-directory: ${{ runner.temp }}/bext_output
run: |
test -d install
test -d noinstall
test -f bext-install-manifest.json
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
- name: Upload dependency tree
if: github.ref == 'refs/heads/main'
id: upload
uses: actions/upload-artifact@v4
with:
name: bext-windows-2025-${{ runner.arch }}-release-${{ github.sha }}
path: ${{ runner.temp }}/bext-windows-2025-${{ runner.arch }}-release.tar.gz
if-no-files-found: error
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
compression-level: 0
macos_release:
name: macOS Clang Release Build
runs-on: macos-15
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Install Xquartz
run: brew install xquartz --cask
- name: Configure
env:
CC: clang
CXX: clang++
run: cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON -DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/bext_output"
- name: Build
run: cmake --build build --parallel 2 --verbose
- name: Package dependency tree
if: github.ref == 'refs/heads/main'
shell: bash
env:
BEXT_CHANNEL: macos-15-${{ runner.arch }}-release
working-directory: ${{ runner.temp }}/bext_output
run: |
test -d install
test -d noinstall
test -f bext-install-manifest.json
cmake -E tar cfz "$RUNNER_TEMP/bext-$BEXT_CHANNEL.tar.gz" --format=gnutar install noinstall bext-install-manifest.json
- name: Upload dependency tree
if: github.ref == 'refs/heads/main'
id: upload
uses: actions/upload-artifact@v4
with:
name: bext-macos-15-${{ runner.arch }}-release-${{ github.sha }}
path: ${{ runner.temp }}/bext-macos-15-${{ runner.arch }}-release.tar.gz
if-no-files-found: error
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
compression-level: 0
publish:
name: Publish dependency set
if: github.ref == 'refs/heads/main'
needs: [linux_release, windows_ninja_release, macos_release]
runs-on: ubuntu-24.04
permissions:
actions: write
contents: read
steps:
- name: Record complete dependency set
run: echo "${{ github.sha }}" > "$RUNNER_TEMP/bext-production"
- name: Upload completion marker
id: marker
uses: actions/upload-artifact@v4
with:
name: bext-production-${{ github.sha }}
path: ${{ runner.temp }}/bext-production
if-no-files-found: error
retention-days: ${{ env.BEXT_ARCHIVE_RETENTION_DAYS }}
- name: Remove superseded dependency sets
shell: bash
env:
GH_TOKEN: ${{ github.token }}
CURRENT_ARTIFACT_IDS: ${{ needs.linux_release.outputs.artifact-id }},${{ needs.windows_ninja_release.outputs.artifact-id }},${{ needs.macos_release.outputs.artifact-id }},${{ steps.marker.outputs.artifact-id }}
run: |
set -euo pipefail
artifact_pattern='^bext-((ubuntu-24\.04|windows-2025|macos-15)-(X86|X64|ARM|ARM64)-release|production)-'
artifact_rows="$(gh api --paginate "repos/$GITHUB_REPOSITORY/actions/artifacts?per_page=100" --jq '.artifacts[] | [.id, .name] | @tsv')"
while IFS=$'\t' read -r artifact_id artifact_name; do
if [[ "$artifact_name" =~ $artifact_pattern && ",${CURRENT_ARTIFACT_IDS}," != *",${artifact_id},"* ]]; then
gh api --method DELETE "repos/$GITHUB_REPOSITORY/actions/artifacts/$artifact_id"
fi
done <<< "$artifact_rows"
+104 -57
View File
@@ -20,32 +20,11 @@ name: BRL-CAD
on: [push]
jobs:
dependency_metadata:
name: Dependency metadata and supply-chain checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate dependency metadata and documentation
run: cmake -DBEXT_SOURCE_DIR="$GITHUB_WORKSPACE" -DBEXT_DOC_MODE=CHECK -P CMake/GenerateDependencyDocs.cmake
- name: Generate SPDX SBOM
run: cmake -DBEXT_SOURCE_DIR="$GITHUB_WORKSPACE" -DBEXT_SBOM_OUTPUT="$RUNNER_TEMP/bext.spdx.json" -P CMake/GenerateSbom.cmake
- name: Upload SPDX SBOM
uses: actions/upload-artifact@v4
with:
name: bext-spdx-sbom
path: ${{ runner.temp }}/bext.spdx.json
linux_configure_presets:
name: Ubuntu Configure Preset - ${{ matrix.preset }}
runs-on: ubuntu-latest
windows_ninja_release:
name: MSVC - Ninja Release build
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
preset: [auto, bundled, minimal, everything]
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
@@ -53,23 +32,36 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup - System
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
# Install XCB/OpenGL dev pkgs for Qt - see:
# https://wiki.qt.io/Building_Qt_6_from_Git
# https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install flex bison m4 libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libgl-dev
sudo apt-get install libinput-dev
sudo apt-get clean
- name: Add github workspace to path
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
shell: powershell
run: |
export PATH=$GITHUB_WORKSPACE:$PATH
cmake --preset ${{ matrix.preset }} -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
powershell Write-VolumeCache C
powershell Write-VolumeCache D
- name: Build
shell: powershell
run: |
cd build; ninja -j2 -v
# TODO - if the loading isn't too extreme, it would be good to do a BRL-CAD
# build against the output of this...
# - name: Build - BRL-CAD
# run: |
# # TODO - figure out how to do this...
windows_ninja_debug:
name: MSVC - Ninja Debug build
@@ -96,7 +88,7 @@ jobs:
- name: Configure
shell: powershell
run: |
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Debug -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Debug -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
@@ -131,16 +123,11 @@ jobs:
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
shell: cmd
run: |
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
@@ -150,6 +137,7 @@ jobs:
- name: Build
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake --build build --config Release -j2
windows_std_tools_debug:
@@ -168,16 +156,11 @@ jobs:
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
shell: cmd
run: |
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DEXT_BUILD_VERBOSE=ON
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
@@ -187,9 +170,45 @@ jobs:
- name: Build
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake --build build --config Debug -j2
linux_release:
name: Ubuntu GCC Release Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Setup - System
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
# Install XCB/OpenGL dev pkgs for Qt - see:
# https://wiki.qt.io/Building_Qt_6_from_Git
# https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libgl-dev
sudo apt-get install libinput-dev
sudo apt-get clean
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd build && ninja -j2 -v
linux_debug:
name: Ubuntu GCC Debug Build
runs-on: ubuntu-latest
@@ -218,8 +237,7 @@ jobs:
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
# We're running into disk space issues with the Linux debug build, so turn off GDAL
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_GDAL=OFF -DEXT_BUILD_VERBOSE=ON
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: |
@@ -227,6 +245,34 @@ jobs:
cd build && ninja -j2 -v
osx_release:
name: macOS Clang Release Build
runs-on: macos-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Install Xquartz
run: |
brew install xquartz --cask
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
export CC=clang
export CXX=clang++
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd build && ninja -j2 -v
osx_debug:
name: macOS Clang Debug Build
runs-on: macos-latest
@@ -248,9 +294,10 @@ jobs:
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
export CC=clang
export CXX=clang++
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DEXT_BUILD_VERBOSE=ON
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd build && ninja -j2 -v
+43 -98
View File
@@ -2,363 +2,308 @@
path = patch/patch
url = https://github.com/BRL-CAD/patch
ignore = dirty
shallow = true
[submodule "astyle/astyle"]
path = astyle/astyle
url = https://github.com/BRL-CAD/astyle
ignore = dirty
shallow = true
[submodule "lief/LIEF"]
path = lief/LIEF
url = https://github.com/BRL-CAD/LIEF
branch = master
ignore = dirty
shallow = true
[submodule "lemon/lemon"]
path = lemon/lemon
url = https://github.com/BRL-CAD/lemon
ignore = dirty
shallow = true
[submodule "re2c/re2c"]
path = re2c/re2c
url = https://github.com/BRL-CAD/re2c
branch = RELEASE
ignore = dirty
shallow = true
[submodule "perplex/perplex"]
path = perplex/perplex
url = https://github.com/BRL-CAD/perplex
ignore = dirty
shallow = true
[submodule "plief/plief"]
path = plief/plief
url = https://github.com/BRL-CAD/plief
ignore = dirty
shallow = true
[submodule "strclear/strclear"]
path = strclear/strclear
url = https://github.com/BRL-CAD/strclear
ignore = dirty
shallow = true
[submodule "xmltools/xmltools"]
path = xmltools/xmltools
url = https://github.com/BRL-CAD/xmltools
ignore = dirty
[submodule "zlib/zlib"]
path = zlib/zlib
url = https://github.com/BRL-CAD/zlib
ignore = dirty
shallow = true
[submodule "png/libpng"]
path = png/libpng
url = https://github.com/BRL-CAD/libpng
branch = RELEASE
ignore = dirty
shallow = true
[submodule "netpbm/netpbm"]
path = netpbm/netpbm
url = https://github.com/BRL-CAD/netpbm
branch = brlcad
ignore = dirty
shallow = true
[submodule "regex/regex"]
path = regex/regex
url = https://github.com/BRL-CAD/regex
ignore = dirty
shallow = true
[submodule "linenoise/linenoise"]
path = linenoise/linenoise
url = https://github.com/BRL-CAD/linenoise
branch = RELEASE
ignore = dirty
[submodule "lmdb/lmdb"]
path = lmdb/lmdb
url = https://github.com/BRL-CAD/lmdb
branch = RELEASE
ignore = dirty
shallow = true
[submodule "eigen/eigen"]
path = eigen/eigen
url = https://github.com/BRL-CAD/eigen
branch = RELEASE
ignore = dirty
shallow = true
[submodule "stepcode/stepcode"]
path = stepcode/stepcode
url = https://github.com/BRL-CAD/stepcode
branch = RELEASE
ignore = dirty
shallow = true
[submodule "sqlite3/sqlite3"]
path = sqlite3/sqlite3
url = https://github.com/BRL-CAD/sqlite3.git
ignore = dirty
shallow = true
[submodule "proj/PROJ"]
path = proj/PROJ
url = https://github.com/BRL-CAD/PROJ
branch = RELEASE
ignore = dirty
shallow = true
[submodule "gdal/gdal"]
path = gdal/gdal
url = https://github.com/BRL-CAD/gdal
branch = RELEASE
ignore = dirty
shallow = true
[submodule "assetimport/assimp"]
path = assetimport/assimp
url = https://github.com/BRL-CAD/assimp
branch = RELEASE
ignore = dirty
shallow = true
[submodule "opencv/opencv"]
path = opencv/opencv
url = https://github.com/BRL-CAD/opencv
branch = RELEASE
ignore = dirty
[submodule "openmesh/OpenMesh"]
path = openmesh/OpenMesh
url = https://github.com/BRL-CAD/OpenMesh
branch = RELEASE
ignore = dirty
shallow = true
[submodule "opennurbs/opennurbs"]
path = opennurbs/opennurbs
url = https://github.com/BRL-CAD/opennurbs
branch = RELEASE
ignore = dirty
shallow = true
[submodule "openvdb/openvdb"]
path = openvdb/openvdb
url = https://github.com/BRL-CAD/openvdb
branch = master
ignore = dirty
shallow = true
[submodule "osmesa/osmesa"]
path = osmesa/osmesa
url = https://github.com/BRL-CAD/osmesa
ignore = dirty
shallow = true
[submodule "utahrle/utahrle"]
path = utahrle/utahrle
url = https://github.com/BRL-CAD/utahrle
ignore = dirty
[submodule "tk/tk"]
path = tk/tk
url = https://github.com/BRL-CAD/tk
branch = RELEASE
ignore = dirty
shallow = true
[submodule "itk/itk"]
[submodule "itcl3/itcl"]
path = itcl/itcl
url = https://github.com/BRL-CAD/itcl
branch = RELEASE
ignore = dirty
[submodule "itk3/itk"]
path = itk/itk
url = https://github.com/BRL-CAD/itk
branch = main
branch = RELEASE
ignore = dirty
shallow = true
[submodule "iwidgets/iwidgets"]
path = iwidgets/iwidgets
url = https://github.com/BRL-CAD/iwidgets
ignore = dirty
shallow = true
[submodule "tktable/tktable"]
path = tktable/tktable
url = https://github.com/BRL-CAD/tktable
ignore = dirty
shallow = true
[submodule "tkhtml/tkhtml"]
path = tkhtml/tkhtml
url = https://github.com/BRL-CAD/tkhtml
ignore = dirty
shallow = true
[submodule "qt/qt"]
path = qt/qt
url = https://github.com/BRL-CAD/qt
ignore = dirty
shallow = true
[submodule "flexbison/bison"]
path = flexbison/bison
url = https://github.com/BRL-CAD/bison
ignore = dirty
shallow = true
[submodule "flexbison/flex"]
path = flexbison/flex
url = https://github.com/BRL-CAD/flex
branch = RELEASE
ignore = dirty
shallow = true
[submodule "flexbison/winflexbison"]
path = flexbison/winflexbison
url = https://github.com/BRL-CAD/winflexbison
branch = RELEASE
ignore = dirty
shallow = true
[submodule "minizip-ng/minizip-ng"]
path = minizip-ng/minizip-ng
url = https://github.com/BRL-CAD/minizip-ng
branch = RELEASE
ignore = dirty
shallow = true
[submodule "lz4/lz4"]
path = lz4/lz4
url = https://github.com/BRL-CAD/lz4
branch = RELEASE
ignore = dirty
shallow = true
[submodule "deflate/libdeflate"]
path = deflate/libdeflate
url = https://github.com/BRL-CAD/libdeflate
branch = RELEASE
ignore = dirty
shallow = true
[submodule "fmt/fmt"]
path = fmt/fmt
url = https://github.com/BRL-CAD/fmt
branch = RELEASE
ignore = dirty
shallow = true
[submodule "yaml-cpp/yaml-cpp"]
path = yaml-cpp/yaml-cpp
url = https://github.com/BRL-CAD/yaml-cpp
branch = RELEASE
ignore = dirty
shallow = true
[submodule "pystring/pystring"]
path = pystring/pystring
url = https://github.com/BRL-CAD/pystring
branch = RELEASE
ignore = dirty
shallow = true
[submodule "expat/libexpat"]
path = expat/libexpat
url = https://github.com/BRL-CAD/libexpat
branch = RELEASE
ignore = dirty
shallow = true
[submodule "pugixml/pugixml"]
path = pugixml/pugixml
url = https://github.com/BRL-CAD/pugixml
branch = RELEASE
ignore = dirty
shallow = true
[submodule "xerces-c/xerces-c"]
path = xerces-c/xerces-c
url = https://github.com/BRL-CAD/xerces-c
branch = RELEASE
ignore = dirty
shallow = true
[submodule "icu/icu"]
path = icu/icu
url = https://github.com/BRL-CAD/icu
branch = RELEASE
ignore = dirty
shallow = true
[submodule "jpeg/libjpeg-turbo"]
path = jpeg/libjpeg-turbo
url = https://github.com/BRL-CAD/libjpeg-turbo
branch = RELEASE
ignore = dirty
shallow = true
[submodule "tiff/libtiff"]
path = tiff/libtiff
url = https://github.com/BRL-CAD/libtiff
branch = RELEASE
ignore = dirty
shallow = true
[submodule "onetbb/oneTBB"]
path = onetbb/oneTBB
url = https://github.com/BRL-CAD/oneTBB
branch = RELEASE
ignore = dirty
shallow = true
[submodule "llvm/llvm-project"]
path = llvm/llvm-project
url = https://github.com/BRL-CAD/llvm-project
branch = RELEASE
ignore = dirty
shallow = true
[submodule "zstd/zstd"]
path = zstd/zstd
url = https://github.com/BRL-CAD/zstd
branch = RELEASE
ignore = dirty
shallow = true
[submodule "boost/boost"]
path = boost/boost
url = https://github.com/BRL-CAD/boost
branch = RELEASE
ignore = dirty
shallow = true
[submodule "openexr/openexr"]
path = openexr/openexr
url = https://github.com/BRL-CAD/openexr
branch = RELEASE
ignore = dirty
shallow = true
[submodule "opencolorio/OpenColorIO"]
path = opencolorio/OpenColorIO
url = https://github.com/BRL-CAD/OpenColorIO
branch = RELEASE
ignore = dirty
shallow = true
[submodule "openimageio/oiio"]
path = openimageio/oiio
url = https://github.com/BRL-CAD/oiio
branch = RELEASE
ignore = dirty
shallow = true
[submodule "osl/OpenShadingLanguage"]
path = osl/OpenShadingLanguage
url = https://github.com/BRL-CAD/OpenShadingLanguage
branch = RELEASE
ignore = dirty
shallow = true
[submodule "embree/embree"]
path = embree/embree
url = https://github.com/BRL-CAD/embree
branch = RELEASE
ignore = dirty
shallow = true
[submodule "rkcommon/rkcommon"]
path = rkcommon/rkcommon
url = https://github.com/BRL-CAD/rkcommon
branch = RELEASE
ignore = dirty
shallow = true
[submodule "ispc/ispc"]
path = ispc/ispc
url = https://github.com/BRL-CAD/ispc
branch = RELEASE
ignore = dirty
shallow = true
[submodule "ospray/ospray"]
path = ospray/ospray
url = https://github.com/BRL-CAD/ospray
branch = RELEASE
ignore = dirty
shallow = true
[submodule "ncurses/ncurses"]
path = ncurses/ncurses
url = https://github.com/BRL-CAD/ncurses
ignore = dirty
shallow = true
[submodule "tcl/tcl"]
path = tcl/tcl
url = https://github.com/BRL-CAD/tcl.git
branch = RELEASE
ignore = dirty
shallow = true
[submodule "manifold/manifold"]
path = manifold/manifold
url = https://github.com/BRL-CAD/manifold.git
branch = RELEASE
ignore = dirty
shallow = true
[submodule "appleseed/appleseed"]
path = appleseed/appleseed
url = https://github.com/BRL-CAD/appleseed
ignore = dirty
shallow = true
[submodule "geogram/geogram"]
path = geogram/geogram
url = https://github.com/BRL-CAD/geogram.git
branch = RELEASE
ignore = dirty
[submodule "gte/GeometricTools"]
path = gte/GeometricTools
url = https://github.com/BRL-CAD/GeometricTools
ignore = dirty
shallow = true
[submodule "mmesh/mmesh"]
path = mmesh/mmesh
url = https://github.com/BRL-CAD/mmesh.git
ignore = dirty
shallow = true
[submodule "clipper2/Clipper2"]
path = clipper2/Clipper2
url = https://github.com/BRL-CAD/Clipper2.git
ignore = dirty
shallow = true
[submodule "tinygltf/tinygltf"]
path = tinygltf/tinygltf
url = https://github.com/BRL-CAD/tinygltf.git
ignore = dirty
shallow = true
[submodule "poissonrecon/PoissonRecon"]
path = poissonrecon/PoissonRecon
url = https://github.com/BRL-CAD/PoissonRecon
ignore = dirty
shallow = true
[submodule "bullet/bullet3"]
path = bullet/bullet3
url = https://github.com/BRL-CAD/bullet3.git
branch = RELEASE
ignore = dirty
shallow = true
[submodule "oidn/oidn"]
path = oidn/oidn
url = https://github.com/BRL-CAD/oidn
-80
View File
@@ -1,80 +0,0 @@
set(bext_root "${CMAKE_CURRENT_LIST_DIR}/..")
get_filename_component(bext_root "${bext_root}" ABSOLUTE)
include("${CMAKE_CURRENT_LIST_DIR}/BextGit.cmake")
if (NOT DEFINED PROFILE)
message(FATAL_ERROR "Set PROFILE to one of: auto, bundled, minimal, everything")
endif (NOT DEFINED PROFILE)
string(TOLOWER "${PROFILE}" profile)
set(active_groups)
if (profile STREQUAL "auto" OR profile STREQUAL "bundled")
set(active_groups BRLCAD BRLCAD_EXTRA GDAL QT TCL)
elseif (profile STREQUAL "minimal")
set(active_groups BRLCAD)
elseif (profile STREQUAL "everything")
set(active_groups APPLESEED BRLCAD BRLCAD_EXTRA GDAL OSPRAY QT TCL)
else ()
message(FATAL_ERROR "Unknown PROFILE \"${PROFILE}\". Expected: auto, bundled, minimal, everything")
endif ()
find_program(GIT_EXECUTABLE git)
if (NOT GIT_EXECUTABLE)
message(FATAL_ERROR "Unable to find git executable required for bootstrap")
endif (NOT GIT_EXECUTABLE)
file(STRINGS "${bext_root}/CMakeLists.txt" project_lines REGEX "add_project\\(")
set(project_paths)
foreach(line ${project_lines})
string(STRIP "${line}" stripped_line)
if (stripped_line MATCHES "^#")
continue()
endif (stripped_line MATCHES "^#")
if (NOT stripped_line MATCHES "^add_project\\(([A-Za-z0-9_+.-]+)")
continue()
endif (NOT stripped_line MATCHES "^add_project\\(([A-Za-z0-9_+.-]+)")
set(project_name "${CMAKE_MATCH_1}")
set(include_project FALSE)
if (stripped_line MATCHES "GROUPS \"([^\"]+)\"")
set(project_groups "${CMAKE_MATCH_1}")
string(REPLACE ";" ";" project_groups "${project_groups}")
foreach(group ${project_groups})
list(FIND active_groups "${group}" group_index)
if (NOT group_index EQUAL -1)
set(include_project TRUE)
break()
endif (NOT group_index EQUAL -1)
endforeach(group ${project_groups})
else ()
set(include_project TRUE)
endif ()
if (include_project)
list(APPEND project_paths "${project_name}")
endif (include_project)
endforeach(line ${project_lines})
list(REMOVE_DUPLICATES project_paths)
list(SORT project_paths)
string(REPLACE ";" ", " active_groups_str "${active_groups}")
string(REPLACE ";" ", " project_paths_str "${project_paths}")
message(STATUS "bext bootstrap profile: ${profile}")
message(STATUS "active USE_* groups: ${active_groups_str}")
message(STATUS "project submodules: ${project_paths_str}")
if (LIST_ONLY)
message(STATUS "LIST_ONLY is ON, skipping git submodule update")
return()
endif (LIST_ONLY)
bext_git_submodule_update("${bext_root}" --jobs 8 -- ${project_paths})
message(STATUS "Bootstrap complete for profile ${profile}")
-220
View File
@@ -1,220 +0,0 @@
# Derive bext dependency metadata from the existing build files. This module
# deliberately does not introduce a manifest: CMakeLists.txt, per-project
# .deps files, wrapper install settings, .gitmodules, and the Git index remain
# the sources of truth.
function(_bext_inventory_key out value)
string(TOUPPER "${value}" key)
string(REGEX REPLACE "[^A-Z0-9]" "_" key "${key}")
set(${out} "${key}" PARENT_SCOPE)
endfunction()
function(_bext_inventory_set project field value)
_bext_inventory_key(key "${project}")
set_property(GLOBAL PROPERTY "BEXT_INVENTORY_${key}_${field}" "${value}")
endfunction()
function(bext_inventory_get out project field)
_bext_inventory_key(key "${project}")
get_property(value GLOBAL PROPERTY "BEXT_INVENTORY_${key}_${field}")
set(${out} "${value}" PARENT_SCOPE)
endfunction()
function(_bext_inventory_submodule_lookup out_url out_sha source_dir path)
get_property(entries GLOBAL PROPERTY BEXT_INVENTORY_SUBMODULES)
foreach(entry ${entries})
string(REPLACE "|" ";" parts "${entry}")
list(GET parts 0 entry_path)
if ("${entry_path}" STREQUAL "${path}")
list(GET parts 1 entry_url)
execute_process(
COMMAND git ls-tree HEAD -- "${path}"
WORKING_DIRECTORY "${source_dir}"
RESULT_VARIABLE tree_result
OUTPUT_VARIABLE tree_line
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT tree_result EQUAL 0 OR NOT tree_line MATCHES "^[0-9]+ commit ([0-9a-f]+)")
message(FATAL_ERROR "Unable to read pinned commit for submodule ${path}")
endif()
set(${out_url} "${entry_url}" PARENT_SCOPE)
set(${out_sha} "${CMAKE_MATCH_1}" PARENT_SCOPE)
return()
endif()
endforeach()
set(${out_url} "" PARENT_SCOPE)
set(${out_sha} "" PARENT_SCOPE)
endfunction()
function(bext_collect_dependency_inventory source_dir)
get_filename_component(source_dir "${source_dir}" ABSOLUTE)
if (NOT EXISTS "${source_dir}/CMakeLists.txt" OR NOT EXISTS "${source_dir}/.gitmodules")
message(FATAL_ERROR "${source_dir} is not a bext source tree")
endif()
# Read submodule paths and URLs without requiring submodules to be populated.
file(STRINGS "${source_dir}/.gitmodules" gitmodule_lines)
set(submodules)
set(current_path "")
foreach(line ${gitmodule_lines})
string(STRIP "${line}" line)
if (line MATCHES "^path = (.+)$")
set(current_path "${CMAKE_MATCH_1}")
elseif(line MATCHES "^url = (.+)$" AND current_path)
list(APPEND submodules "${current_path}|${CMAKE_MATCH_1}")
set(current_path "")
endif()
endforeach()
set_property(GLOBAL PROPERTY BEXT_INVENTORY_SUBMODULES "${submodules}")
file(STRINGS "${source_dir}/CMakeLists.txt" top_lines)
set(projects)
foreach(line ${top_lines})
string(STRIP "${line}" stripped)
if (stripped MATCHES "^#" OR NOT stripped MATCHES "^add_project\\(([^ )]+)")
continue()
endif()
set(project "${CMAKE_MATCH_1}")
list(APPEND projects "${project}")
if (stripped MATCHES "GROUPS +\"([^\"]+)\"")
set(groups "${CMAKE_MATCH_1}")
else()
set(groups "always considered")
endif()
_bext_inventory_set("${project}" GROUPS "${groups}")
endforeach()
list(REMOVE_DUPLICATES projects)
set(all_providers)
foreach(project ${projects})
set(wrapper "${source_dir}/${project}/CMakeLists.txt")
if (NOT EXISTS "${wrapper}")
message(FATAL_ERROR "Project ${project} has no wrapper CMakeLists.txt")
endif()
file(READ "${wrapper}" wrapper_text)
if (wrapper_text MATCHES "-DCMAKE_INSTALL_PREFIX=\\$\\{CMAKE_BUNDLE_INSTALL_PREFIX\\}" OR
wrapper_text MATCHES "--prefix=\\$\\{CMAKE_BUNDLE_INSTALL_PREFIX\\}")
set(output_class install)
elseif(wrapper_text MATCHES "-DCMAKE_INSTALL_PREFIX=\\$\\{CMAKE_NOBUNDLE_INSTALL_PREFIX\\}" OR
wrapper_text MATCHES "--prefix=\\$\\{CMAKE_NOBUNDLE_INSTALL_PREFIX\\}")
set(output_class noinstall)
elseif(wrapper_text MATCHES "CMAKE_BUNDLE_INSTALL_PREFIX" AND
NOT wrapper_text MATCHES "CMAKE_NOBUNDLE_INSTALL_PREFIX")
# Some custom build drivers (currently Tcl) receive the prefix through a
# configured helper script rather than directly in ExternalProject_Add.
set(output_class install)
else()
message(FATAL_ERROR "Cannot derive output class for ${project}")
endif()
_bext_inventory_set("${project}" OUTPUT "${output_class}")
if (wrapper_text MATCHES "DOC_LICENSE_DIR")
set(has_license TRUE)
else()
set(has_license FALSE)
endif()
_bext_inventory_set("${project}" HAS_LICENSE "${has_license}")
set(deps)
set(depfile "${source_dir}/${project}/${project}.deps")
if (EXISTS "${depfile}")
file(STRINGS "${depfile}" dep_lines)
foreach(dep ${dep_lines})
string(STRIP "${dep}" dep)
if (dep AND NOT dep MATCHES "^#")
string(TOLOWER "${dep}" dep)
string(REPLACE "_" "-" dep "${dep}")
list(APPEND deps "${dep}")
endif()
endforeach()
endif()
list(REMOVE_DUPLICATES deps)
_bext_inventory_set("${project}" DEPS "${deps}")
set(paths)
string(REGEX MATCHALL "git_submodule_init\\([A-Za-z0-9_+./-]+ +" init_calls "${wrapper_text}")
foreach(call ${init_calls})
string(REGEX REPLACE "git_submodule_init\\(([A-Za-z0-9_+./-]+) +" "\\1" path "${call}")
list(APPEND paths "${project}/${path}")
endforeach()
list(REMOVE_DUPLICATES paths)
if (NOT paths)
message(FATAL_ERROR "Project ${project} does not declare a source with git_submodule_init")
endif()
_bext_inventory_set("${project}" SUBMODULE_PATHS "${paths}")
set(urls)
set(shas)
foreach(path ${paths})
_bext_inventory_submodule_lookup(url sha "${source_dir}" "${path}")
if (NOT url)
message(FATAL_ERROR "${project} uses ${path}, but it is absent from .gitmodules")
endif()
list(APPEND urls "${url}")
list(APPEND shas "${sha}")
endforeach()
_bext_inventory_set("${project}" SOURCE_URLS "${urls}")
_bext_inventory_set("${project}" SOURCE_SHAS "${shas}")
string(REGEX MATCHALL "ExternalProject_Add\\([A-Za-z0-9_+-]+_BLD" provider_calls "${wrapper_text}")
foreach(call ${provider_calls})
string(REGEX REPLACE "ExternalProject_Add\\(([A-Za-z0-9_+-]+)_BLD" "\\1" provider "${call}")
string(TOLOWER "${provider}" provider)
string(REPLACE "_" "-" provider "${provider}")
list(APPEND all_providers "${provider}")
endforeach()
endforeach()
list(REMOVE_DUPLICATES all_providers)
# Validate dependency references and topological consistency.
foreach(project ${projects})
bext_inventory_get(deps "${project}" DEPS)
foreach(dep ${deps})
list(FIND projects "${dep}" project_index)
list(FIND all_providers "${dep}" provider_index)
if (project_index EQUAL -1 AND provider_index EQUAL -1)
message(FATAL_ERROR "${project}.deps references unknown dependency ${dep}")
endif()
endforeach()
endforeach()
set(resolved)
set(remaining ${projects})
while(remaining)
set(progress FALSE)
foreach(project ${remaining})
bext_inventory_get(deps "${project}" DEPS)
set(ready TRUE)
foreach(dep ${deps})
list(FIND projects "${dep}" dep_project_index)
if (NOT dep_project_index EQUAL -1)
list(FIND resolved "${dep}" resolved_index)
if (resolved_index EQUAL -1)
set(ready FALSE)
endif()
endif()
endforeach()
if (ready)
list(APPEND resolved "${project}")
list(REMOVE_ITEM remaining "${project}")
set(progress TRUE)
endif()
endforeach()
if (NOT progress)
message(FATAL_ERROR "Dependency cycle detected among: ${remaining}")
endif()
endwhile()
# Distributed outputs must install their legal notice alongside the bundle.
foreach(project ${projects})
bext_inventory_get(output_class "${project}" OUTPUT)
bext_inventory_get(has_license "${project}" HAS_LICENSE)
if (output_class STREQUAL "install" AND NOT has_license)
message(FATAL_ERROR "Bundled project ${project} does not install a license via DOC_LICENSE_DIR")
endif()
endforeach()
list(SORT projects)
set(BEXT_INVENTORY_PROJECTS "${projects}" PARENT_SCOPE)
endfunction()
-104
View File
@@ -1,104 +0,0 @@
# Shared repository selection for configure-time and bootstrap submodule updates.
# Keep .gitmodules canonical and scope all overrides to the Git process tree.
include_guard(GLOBAL)
set(_BEXT_GIT_CANONICAL_ROOT "https://github.com/BRL-CAD")
set(BEXT_REPOSITORY_ROOT "${_BEXT_GIT_CANONICAL_ROOT}" CACHE STRING
"Repository URL or local mirror directory containing bext's dependency repositories")
function(bext_git_repository_root out_root out_local)
set(root "${BEXT_REPOSITORY_ROOT}")
set(local FALSE)
if (root STREQUAL "")
message(FATAL_ERROR "BEXT_REPOSITORY_ROOT must be a repository URL or local mirror directory")
endif ()
# Check drive paths before URL schemes or scp-style SSH locations.
if (root MATCHES "^file://")
set(local TRUE)
string(REPLACE "=" "%3D" root "${root}")
elseif (root MATCHES "^[A-Za-z]:[/\\\\]" OR
NOT (root MATCHES "^[A-Za-z][A-Za-z0-9+.-]*://" OR root MATCHES "^[^/]+:.+"))
set(local TRUE)
string(REPLACE "\\" "/" root "${root}")
if (WIN32 OR NOT root MATCHES "^[A-Za-z]:/")
get_filename_component(root "${root}" ABSOLUTE
BASE_DIR "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/..")
endif ()
# Encode path characters with special meaning in a file URL. In
# particular, a literal % in a native path must not become a URL escape.
string(REPLACE "%" "%25" root "${root}")
string(REPLACE " " "%20" root "${root}")
string(REPLACE "#" "%23" root "${root}")
string(REPLACE "?" "%3F" root "${root}")
string(REPLACE "=" "%3D" root "${root}")
if (root MATCHES "^[A-Za-z]:/")
set(root "file:///${root}")
elseif (root MATCHES "^//")
set(root "file:${root}")
else ()
set(root "file://${root}")
endif ()
endif ()
if (NOT root MATCHES "^file:///*$")
string(REGEX REPLACE "/+$" "" root "${root}")
string(APPEND root "/")
else ()
set(root "file:///")
endif ()
set(${out_root} "${root}" PARENT_SCOPE)
set(${out_local} "${local}" PARENT_SCOPE)
endfunction()
function(bext_git_submodule_update working_directory)
find_program(GIT_EXECUTABLE git)
if (NOT GIT_EXECUTABLE)
message(FATAL_ERROR "Need to populate Git submodules, but unable to find git executable")
endif ()
bext_git_repository_root(root local)
set(git_command "${GIT_EXECUTABLE}")
if (WIN32)
list(APPEND git_command -c core.longpaths=true)
endif ()
if (NOT root STREQUAL "${_BEXT_GIT_CANONICAL_ROOT}/")
list(APPEND git_command -c "url.${root}.insteadOf=${_BEXT_GIT_CANONICAL_ROOT}/")
endif ()
set(shallow_args)
if (local)
list(APPEND git_command -c protocol.file.allow=always)
# The environment restriction also reaches recursive Git processes and
# overrides any protocol permissions in the user's Git configuration.
list(PREPEND git_command "${CMAKE_COMMAND}" -E env GIT_ALLOW_PROTOCOL=file --)
list(APPEND shallow_args --no-recommend-shallow)
elseif (GIT_SHALLOW_CLONE)
list(APPEND shallow_args --recommend-shallow)
endif ()
execute_process(
COMMAND ${git_command} submodule update --init --recursive ${shallow_args} ${ARGN}
WORKING_DIRECTORY "${working_directory}"
RESULT_VARIABLE git_result
)
if (NOT git_result STREQUAL "0")
set(local_note "")
if (local)
set(local_note " Only file transport is permitted; all required repositories and pinned commits must be available locally, including recursive submodules.")
endif ()
message(WARNING
"Git submodule update failed in ${working_directory} using BEXT_REPOSITORY_ROOT=${BEXT_REPOSITORY_ROOT} (${git_result}).${local_note}")
endif ()
endfunction()
bext_git_repository_root(_bext_git_root _bext_git_local)
message(STATUS "bext repository root: ${_bext_git_root}")
if (_bext_git_local)
message(STATUS "bext Git updates: file transport only, shallow recommendations disabled")
if (GIT_SHALLOW_CLONE)
message(STATUS "Ignoring GIT_SHALLOW_CLONE for the local repository mirror")
endif ()
endif ()
unset(_bext_git_root)
unset(_bext_git_local)
+1 -1
View File
@@ -48,7 +48,7 @@ function(DllTypeCheck btype dlldir)
file(GLOB dll_files RELATIVE "${dlldir}" "${dlldir}/*.dll")
set(non_match 0)
foreach(dlf ${dll_files})
message("Dll Type check: ${dlf}")
message("Checking ${dlf}")
# dumpbin doesn't like CMake style paths
file(TO_NATIVE_PATH "${dlf}" TBFN)
# https://stackoverflow.com/a/28304716/2037687
-451
View File
@@ -1,451 +0,0 @@
# Finalize the bundled bext output and publish its file-processing manifest.
foreach(required_var
BEXT_INSTALL_ROOT
BEXT_MANIFEST
BEXT_SOURCE_ROOT
BEXT_BINARY_ROOT
BEXT_NOINSTALL_ROOT
BEXT_STRCLEAR
BEXT_SYSTEM_NAME
BIN_DIR
LIB_DIR)
if (NOT DEFINED ${required_var} OR "${${required_var}}" STREQUAL "")
message(FATAL_ERROR "${required_var} is required")
endif ()
endforeach()
function(bext_json_escape outvar value)
set(escaped "${value}")
string(REPLACE "\\" "\\\\" escaped "${escaped}")
string(REPLACE "\"" "\\\"" escaped "${escaped}")
string(REPLACE "\r" "\\r" escaped "${escaped}")
string(REPLACE "\n" "\\n" escaped "${escaped}")
set(${outvar} "${escaped}" PARENT_SCOPE)
endfunction()
function(bext_write_json_array manifest key values)
file(APPEND "${manifest}" " \"${key}\": [\n")
set(first TRUE)
foreach(value ${${values}})
bext_json_escape(escaped "${value}")
if (first)
set(first FALSE)
else ()
file(APPEND "${manifest}" ",\n")
endif ()
file(APPEND "${manifest}" " \"${escaped}\"")
endforeach()
file(APPEND "${manifest}" "\n ]")
endfunction()
function(bext_write_file_list outvar filename values)
file(WRITE "${filename}" "")
foreach(value ${${values}})
file(APPEND "${filename}" "${value}\n")
endforeach()
set(${outvar} "${filename}" PARENT_SCOPE)
endfunction()
function(bext_content_fingerprints outvar root label file_list_var)
set(records "")
foreach(relative IN LISTS ${file_list_var})
set(path "${root}/${relative}")
if (IS_SYMLINK "${path}")
file(READ_SYMLINK "${path}" value)
string(APPEND records "L ${label}/${relative} ${value}\n")
else ()
file(SHA256 "${path}" value)
string(APPEND records "F ${label}/${relative} ${value}\n")
endif ()
endforeach()
set(${outvar} "${records}" PARENT_SCOPE)
endfunction()
function(bext_relative_path outvar path)
file(RELATIVE_PATH relative "${BEXT_INSTALL_ROOT}" "${path}")
string(REPLACE "\\" "/" relative "${relative}")
set(${outvar} "${relative}" PARENT_SCOPE)
endfunction()
function(bext_is_skipped path outvar)
if ("${path}" MATCHES "(^|/)(encodings|include|man|msgs)(/|$)")
set(${outvar} TRUE PARENT_SCOPE)
else ()
set(${outvar} FALSE PARENT_SCOPE)
endif ()
endfunction()
function(bext_is_cmake_file path outvar)
if ("${path}" MATCHES "(Deps|Modules|Version|Targets|Config)\\.cmake$" OR
"${path}" MATCHES "\\.pc$")
set(${outvar} TRUE PARENT_SCOPE)
else ()
set(${outvar} FALSE PARENT_SCOPE)
endif ()
endfunction()
function(bext_run_binary_clear files)
if (NOT files)
return()
endif ()
set(clear_targets
"${BEXT_SOURCE_ROOT}"
"${BEXT_BINARY_ROOT}"
"${BEXT_NOINSTALL_ROOT}"
"${BEXT_INSTALL_ROOT}"
)
set(file_list "${BEXT_BINARY_ROOT}/CMakeFiles/bext-binary-files.txt")
bext_write_file_list(file_list "${file_list}" files)
set(command "${BEXT_STRCLEAR}" -p -b -c --files "${file_list}")
list(APPEND command ${clear_targets})
execute_process(
COMMAND ${command}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "strclear binary cleanup failed: ${error}${output}")
endif ()
endfunction()
function(bext_run_rpath_update files)
if (NOT files OR NOT BEXT_PLIEF)
return()
endif ()
execute_process(
COMMAND "${BEXT_PLIEF}" --help
RESULT_VARIABLE help_result
OUTPUT_VARIABLE help_output
ERROR_QUIET
)
if (NOT help_result EQUAL 0)
message(FATAL_ERROR "Unable to query ${BEXT_PLIEF}")
endif ()
set(rpath_args --set-rpath "${BEXT_INSTALL_ROOT}/${LIB_DIR}")
if ("${help_output}" MATCHES "--set-rpath-if-needed")
list(APPEND rpath_args
--set-rpath-if-needed
--stale-rpath-prefix "${BEXT_INSTALL_ROOT}"
--stale-rpath-prefix "${BEXT_BINARY_ROOT}"
)
if ("${help_output}" MATCHES "--set-rpath-if-needed-prepend")
list(APPEND rpath_args --set-rpath-if-needed-prepend)
endif ()
endif ()
if ("${help_output}" MATCHES "--files")
set(file_list "${BEXT_BINARY_ROOT}/CMakeFiles/bext-rpath-files.txt")
bext_write_file_list(file_list "${file_list}" files)
execute_process(
COMMAND "${BEXT_PLIEF}" ${rpath_args} --files "${file_list}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "RPATH update failed: ${error}${output}")
endif ()
else ()
foreach(file ${files})
execute_process(
COMMAND "${BEXT_PLIEF}" ${rpath_args} "${file}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "RPATH update failed for ${file}: ${error}${output}")
endif ()
endforeach()
endif ()
endfunction()
function(bext_run_text_replace files target replacement)
if (NOT files OR "${target}" STREQUAL "")
return()
endif ()
set(text_paths)
foreach(relative ${files})
list(APPEND text_paths "${BEXT_INSTALL_ROOT}/${relative}")
endforeach()
set(file_list "${BEXT_BINARY_ROOT}/CMakeFiles/bext-text-files.txt")
bext_write_file_list(file_list "${file_list}" text_paths)
execute_process(
COMMAND "${BEXT_STRCLEAR}" -p --files "${file_list}" "${target}" "${replacement}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "strclear text replacement failed for ${target}: ${error}${output}")
endif ()
endfunction()
file(MAKE_DIRECTORY "${BEXT_BINARY_ROOT}/CMakeFiles")
file(GLOB_RECURSE installed_files
LIST_DIRECTORIES false
RELATIVE "${BEXT_INSTALL_ROOT}"
"${BEXT_INSTALL_ROOT}/*"
)
list(SORT installed_files)
set(classify_files)
set(skipped_files)
foreach(relative ${installed_files})
set(path "${BEXT_INSTALL_ROOT}/${relative}")
if (IS_SYMLINK "${path}")
list(APPEND skipped_files "${relative}")
continue()
endif ()
bext_is_skipped("${relative}" skipped)
if (skipped)
list(APPEND skipped_files "${relative}")
else ()
list(APPEND classify_files "${path}")
endif ()
endforeach()
set(text_files)
set(binary_probe_files)
if (classify_files)
execute_process(
COMMAND "${BEXT_STRCLEAR}" --help
RESULT_VARIABLE strclear_help_result
OUTPUT_VARIABLE strclear_help
ERROR_QUIET
)
if (NOT strclear_help_result EQUAL 0)
message(FATAL_ERROR "Unable to query ${BEXT_STRCLEAR}")
endif ()
if ("${strclear_help}" MATCHES "--classify" AND "${strclear_help}" MATCHES "--files")
set(classify_list "${BEXT_BINARY_ROOT}/CMakeFiles/bext-classify-files.txt")
bext_write_file_list(classify_list "${classify_list}" classify_files)
execute_process(
COMMAND "${BEXT_STRCLEAR}" --classify --files "${classify_list}"
RESULT_VARIABLE classify_result
OUTPUT_VARIABLE classify_output
ERROR_VARIABLE classify_error
)
if (NOT classify_result EQUAL 0)
message(FATAL_ERROR "strclear classification failed: ${classify_error}${classify_output}")
endif ()
string(REPLACE "\r\n" "\n" classify_output "${classify_output}")
string(REPLACE "\n" ";" classify_records "${classify_output}")
foreach(record ${classify_records})
if ("${record}" STREQUAL "")
continue()
endif ()
string(JSON type ERROR_VARIABLE json_error GET "${record}" type)
string(JSON path ERROR_VARIABLE path_error GET "${record}" path)
if (NOT "${json_error}" STREQUAL "NOTFOUND" OR NOT "${path_error}" STREQUAL "NOTFOUND")
message(FATAL_ERROR "Invalid strclear classification record: ${record}")
endif ()
bext_relative_path(relative "${path}")
if ("${type}" STREQUAL "TEXT")
list(APPEND text_files "${relative}")
elseif ("${type}" STREQUAL "BINARY")
list(APPEND binary_probe_files "${relative}")
else ()
message(FATAL_ERROR "Unknown strclear classification: ${type}")
endif ()
endforeach()
else ()
foreach(path ${classify_files})
execute_process(
COMMAND "${BEXT_STRCLEAR}" -B "${path}"
RESULT_VARIABLE binary_result
ERROR_QUIET
)
bext_relative_path(relative "${path}")
if (binary_result EQUAL 0)
list(APPEND binary_probe_files "${relative}")
elseif (binary_result EQUAL 1)
list(APPEND text_files "${relative}")
else ()
message(FATAL_ERROR "strclear could not classify ${path}")
endif ()
endforeach()
endif ()
endif ()
set(rpath_files)
set(binary_files)
if (binary_probe_files)
if (BEXT_PLIEF)
execute_process(
COMMAND "${BEXT_PLIEF}" --help
RESULT_VARIABLE plief_help_result
OUTPUT_VARIABLE plief_help
ERROR_QUIET
)
else ()
set(plief_help_result 1)
endif ()
if (plief_help_result EQUAL 0 AND "${plief_help}" MATCHES "--classify" AND "${plief_help}" MATCHES "--files")
set(plief_list "${BEXT_BINARY_ROOT}/CMakeFiles/bext-plief-files.txt")
set(plief_paths)
foreach(relative ${binary_probe_files})
list(APPEND plief_paths "${BEXT_INSTALL_ROOT}/${relative}")
endforeach()
bext_write_file_list(plief_list "${plief_list}" plief_paths)
execute_process(
COMMAND "${BEXT_PLIEF}" --classify --files "${plief_list}"
RESULT_VARIABLE plief_result
OUTPUT_VARIABLE plief_output
ERROR_VARIABLE plief_error
)
if (NOT plief_result EQUAL 0)
message(FATAL_ERROR "plief classification failed: ${plief_error}${plief_output}")
endif ()
string(REPLACE "\r\n" "\n" plief_output "${plief_output}")
string(REPLACE "\n" ";" plief_records "${plief_output}")
foreach(record ${plief_records})
if ("${record}" STREQUAL "")
continue()
endif ()
string(JSON type ERROR_VARIABLE json_error GET "${record}" type)
string(JSON path ERROR_VARIABLE path_error GET "${record}" path)
if (NOT "${json_error}" STREQUAL "NOTFOUND" OR NOT "${path_error}" STREQUAL "NOTFOUND")
message(FATAL_ERROR "Invalid plief classification record: ${record}")
endif ()
bext_relative_path(relative "${path}")
if ("${type}" STREQUAL "ELF")
list(APPEND rpath_files "${relative}")
elseif ("${type}" STREQUAL "OTHER")
list(APPEND binary_files "${relative}")
else ()
message(FATAL_ERROR "Unknown plief classification: ${type}")
endif ()
endforeach()
else ()
if ("${BEXT_SYSTEM_NAME}" STREQUAL "Darwin")
foreach(relative ${binary_probe_files})
execute_process(
COMMAND otool -l "${BEXT_INSTALL_ROOT}/${relative}"
RESULT_VARIABLE otool_result
OUTPUT_VARIABLE otool_output
ERROR_QUIET
)
if (otool_result EQUAL 0 AND
NOT "${otool_output}" MATCHES "Archive|not an object")
list(APPEND rpath_files "${relative}")
else ()
list(APPEND binary_files "${relative}")
endif ()
endforeach()
else ()
list(APPEND binary_files ${binary_probe_files})
endif ()
endif ()
else ()
set(plief_help_result 1)
endif ()
list(SORT text_files)
list(SORT rpath_files)
list(SORT binary_files)
set(cmake_files)
set(plain_text_files)
foreach(relative ${text_files})
bext_is_cmake_file("${relative}" is_cmake)
if (is_cmake)
list(APPEND cmake_files "${relative}")
else ()
list(APPEND plain_text_files "${relative}")
endif ()
endforeach()
list(SORT cmake_files)
list(SORT plain_text_files)
# Replace paths that only have meaning while bext is being built. Keep the
# install prefix intact: downstream projects replace this canonical prefix
# with their own staging prefix after copying the finalized tree.
set(text_paths ${text_files})
foreach(clear_target
"${BEXT_SOURCE_ROOT}"
"${BEXT_BINARY_ROOT}"
"${BEXT_NOINSTALL_ROOT}")
bext_run_text_replace("${text_paths}" "${clear_target}" "${BEXT_INSTALL_ROOT}")
endforeach()
# Clear paths before restoring the canonical bext RPATH. Clearing the install
# root after the RPATH update would also clear the newly written RPATH.
set(all_binary_files ${rpath_files} ${binary_files})
set(binary_paths)
set(rpath_paths)
foreach(relative ${all_binary_files})
list(APPEND binary_paths "${BEXT_INSTALL_ROOT}/${relative}")
endforeach()
foreach(relative ${rpath_files})
list(APPEND rpath_paths "${BEXT_INSTALL_ROOT}/${relative}")
endforeach()
set(binary_cleanup_paths ${binary_paths})
if ("${BEXT_SYSTEM_NAME}" STREQUAL "Darwin" AND
NOT BEXT_PLIEF)
# Without plief, preserve Mach-O RPATH load commands for BRL-CAD's
# install_name_tool staging pass.
set(binary_cleanup_paths)
foreach(relative ${binary_files})
list(APPEND binary_cleanup_paths "${BEXT_INSTALL_ROOT}/${relative}")
endforeach()
endif ()
bext_run_binary_clear("${binary_cleanup_paths}")
bext_run_rpath_update("${rpath_paths}")
file(WRITE "${BEXT_MANIFEST}.tmp" "{\n")
file(APPEND "${BEXT_MANIFEST}.tmp" " \"schema\": 1,\n")
bext_json_escape(platform "${BEXT_SYSTEM_NAME}")
file(APPEND "${BEXT_MANIFEST}.tmp" " \"platform\": \"${platform}\",\n")
file(APPEND "${BEXT_MANIFEST}.tmp" " \"install_root\": \"install\",\n")
file(APPEND "${BEXT_MANIFEST}.tmp" " \"generated_by\": \"bext\",\n")
bext_write_json_array("${BEXT_MANIFEST}.tmp" "files" installed_files)
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
bext_write_json_array("${BEXT_MANIFEST}.tmp" "rpath" rpath_files)
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
bext_write_json_array("${BEXT_MANIFEST}.tmp" "binary" binary_files)
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
bext_write_json_array("${BEXT_MANIFEST}.tmp" "cmake" cmake_files)
file(APPEND "${BEXT_MANIFEST}.tmp" ",\n")
bext_write_json_array("${BEXT_MANIFEST}.tmp" "text" plain_text_files)
file(APPEND "${BEXT_MANIFEST}.tmp" "\n}\n")
file(COPY_FILE "${BEXT_MANIFEST}.tmp" "${BEXT_MANIFEST}" ONLY_IF_DIFFERENT)
file(REMOVE "${BEXT_MANIFEST}.tmp")
# Existing files are watched by downstream builds. This list also detects
# additions and removals without changing its timestamp on a no-op build.
file(GLOB_RECURSE noinstall_files
LIST_DIRECTORIES false
RELATIVE "${BEXT_NOINSTALL_ROOT}"
"${BEXT_NOINSTALL_ROOT}/*"
)
list(REMOVE_ITEM noinstall_files "build-stamp")
list(SORT noinstall_files)
set(noinstall_inventory "${BEXT_BINARY_ROOT}/CMakeFiles/bext-noinstall-files.txt")
bext_write_file_list(noinstall_inventory "${noinstall_inventory}" noinstall_files)
file(COPY_FILE "${noinstall_inventory}" "${BEXT_NOINSTALL_ROOT}/build-stamp"
ONLY_IF_DIFFERENT)
# Finalized binaries and config files may be rewritten on every install even
# when their resulting bytes are unchanged. Publish one stable dependency for
# downstream builds instead of making them watch every output timestamp.
bext_content_fingerprints(installed_content "${BEXT_INSTALL_ROOT}" "install"
installed_files)
bext_content_fingerprints(noinstall_content "${BEXT_NOINSTALL_ROOT}" "noinstall"
noinstall_files)
file(SHA256 "${BEXT_MANIFEST}" manifest_digest)
string(SHA256 content_digest
"${installed_content}${noinstall_content}M ${manifest_digest}\n")
set(content_stamp "${BEXT_BINARY_ROOT}/bext-content-stamp")
file(WRITE "${content_stamp}.tmp" "${content_digest}\n")
file(COPY_FILE "${content_stamp}.tmp" "${content_stamp}" ONLY_IF_DIFFERENT)
file(REMOVE "${content_stamp}.tmp")
message(STATUS "Generated bext install manifest: ${BEXT_MANIFEST}")
+7 -49
View File
@@ -1,38 +1,3 @@
# F I N D G T E . C M A K E
# BRL-CAD
#
# Copyright (c) 2024 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###
# Find GeometricTools Mathematics headers
#
# Once done this will define
@@ -54,7 +19,7 @@ endif()
# Try each search configuration.
foreach(search ${_GTE_SEARCHES})
find_path(GTE_INCLUDE_DIR NAMES Mathematics/ConvexHull3.h ${${search}} PATH_SUFFIXES include include/GTE)
find_path(GTE_INCLUDE_DIR NAMES GTE/Mathematics/ConvexHull3.h ${${search}} PATH_SUFFIXES include)
endforeach()
mark_as_advanced(GTE_INCLUDE_DIR)
@@ -65,18 +30,11 @@ include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTE REQUIRED_VARS GTE_INCLUDE_DIR)
if(GTE_FOUND)
set(GTE_INCLUDE_DIRS ${GTE_INCLUDE_DIR})
set(GTE_INCLUDE_DIRS ${GTE_INCLUDE_DIR})
if(NOT TARGET GTE::GTE)
add_library(GTE::GTE UNKNOWN IMPORTED)
set_target_properties(GTE::GTE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GTE_INCLUDE_DIRS}")
endif()
if(NOT TARGET GTE::GTE)
add_library(GTE::GTE UNKNOWN IMPORTED)
set_target_properties(GTE::GTE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GTE_INCLUDE_DIRS}")
endif()
endif()
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+112
View File
@@ -0,0 +1,112 @@
# Find Geogram
# ------------
#
# Find Geogram include dirs and libraries
#
# This module defines the following variables:
#
# Geogram_FOUND - True if geogram has been found.
# Geogram::geogram - Imported target for the main Geogram library.
# Geogram::geogram_gfx - Imported target for Geogram graphics library.
#
# This module reads hints about the Geogram location from the following
# environment variables:
#
# GEOGRAM_INSTALL_PREFIX - Directory where Geogram is installed.
#
# Authors: Jeremie Dumas
# Pierre Moulon
# Bruno Levy
set (GEOGRAM_SEARCH_PATHS
"${GEOGRAM_ROOT}"
${GEOGRAM_INSTALL_PREFIX}
"$ENV{GEOGRAM_INSTALL_PREFIX}"
"/usr/local/"
"$ENV{PROGRAMFILES}/Geogram"
"$ENV{PROGRAMW6432}/Geogram"
)
set (GEOGRAM_SEARCH_PATHS_SYSTEM
"/usr/lib"
"/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}"
)
find_path (GEOGRAM_INCLUDE_DIR
geogram/basic/common.h
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES include/geogram1
)
find_library (GEOGRAM_LIBRARY
NAMES geogram
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES lib
)
find_library (GEOGRAM_GFX_LIBRARY
NAMES geogram_gfx
PATHS ${GEOGRAM_SEARCH_PATHS}
PATH_SUFFIXES lib
)
# This one we search in both Geogram search path and
# system search path since it may be already installed
# in the system
find_library (GEOGRAM_GLFW3_LIBRARY
NAMES glfw3 glfw geogram_glfw3 glfw3dll glfwdll
PATHS ${GEOGRAM_SEARCH_PATHS} ${GEOGRAM_SEARCH_PATHS_SYSTEM}
PATH_SUFFIXES lib
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(
GEOGRAM DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
)
# Create an imported target for Geogram
If (GEOGRAM_FOUND)
set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/../..)
if (NOT TARGET Geogram::geogram)
add_library (Geogram::geogram UNKNOWN IMPORTED)
# Interface include directory
set_target_Properties(Geogram::geogram PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOGRAM_INCLUDE_DIR}"
)
# Link to library file
Set_Target_Properties(Geogram::geogram PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GEOGRAM_LIBRARY}"
)
endif ()
if (NOT TARGET Geogram::geogram_gfx)
add_library (Geogram::geogram_gfx UNKNOWN IMPORTED)
set_target_properties(Geogram::geogram_gfx PROPERTIES
INTERFACE_LINK_LIBRARIES ${GEOGRAM_GLFW3_LIBRARY}
)
# Interface include directory
set_target_properties(Geogram::geogram_gfx PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GEOGRAM_INCLUDE_DIR}"
)
# Link to library file
set_target_properties(Geogram::geogram_gfx PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GEOGRAM_GFX_LIBRARY}"
)
endif ()
endif ()
# Hide variables from the default CMake-Gui options
mark_as_advanced (GEOGRAM_LIBRARY GEOGRAM_GFX_LIBRARY GEOGRAM_INCLUDE_DIR)
+118
View File
@@ -0,0 +1,118 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindTCL
-------
This module finds if Tcl is installed and determines where the include
files and libraries are. It also determines what the name of the
library is. This code sets the following variables:
::
ITCL_FOUND = Tcl was found
ITCL_LIBRARY = path to Tcl library (tcl tcl80)
ITCL_INCLUDE_PATH = path to where tcl.h can be found
ITCL_STUB_LIBRARY = path to Tcl stub library
#]=======================================================================]
include(CMakeFindFrameworks)
set(_ITCL_SEARCHES)
# Search ITCL_ROOT first if it is set.
if(ITCL_ROOT)
set(_ITCL_SEARCH_ROOT PATHS ${ITCL_ROOT} NO_DEFAULT_PATH)
list(APPEND _ITCL_SEARCHES _ITCL_SEARCH_ROOT)
endif()
set(ITCL_POSSIBLE_LIB_PATH_SUFFIXES
lib
lib/itcl
lib/itcl3.4
itcl
itcl3.4
)
set(ITCL_POSSIBLE_LIB_NAMES
itcl
itcl3
itcl3.4
)
if(NOT ITCL_LIBRARY)
foreach(search ${_ITCL_SEARCHES})
find_library(ITCL_LIBRARY
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES})
endforeach()
endif()
if(NOT ITCL_LIBRARY)
find_library(ITCL_LIBRARY
NAMES ${ITCL_POSSIBLE_LIB_NAMES}
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
)
endif(NOT ITCL_LIBRARY)
set(ITCLSTUB_POSSIBLE_LIB_NAMES
itclstub
itclstub3
itclstub3.4
)
if(NOT ITCL_STUB_LIBRARY)
foreach(search ${_ITCL_SEARCHES})
find_library(ITCL_STUB_LIBRARY
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
)
endforeach()
endif()
if(NOT ITCL_STUB_LIBRARY)
find_library(ITCL_STUB_LIBRARY
NAMES ${ITCLSTUB_POSSIBLE_LIB_NAMES}
PATH_SUFFIXES ${ITCL_POSSIBLE_LIB_PATH_SUFFIXES}
)
endif()
set(ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES
include
include/itcl
include/itcl3
include/itcl3.4
)
foreach(search ${_ITCL_SEARCHES})
find_path(ITCL_INCLUDE_PATH
NAMES itcl.h ${${search}}
PATH_SUFFIXES ${ITCL_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
endforeach()
if (NOT ITCL_INCLUDE_PATH)
find_path(ITCL_INCLUDE_PATH
NAMES itcl.h
HINTS ${ITCL_POSSIBLE_INCLUDE_PATHS}
)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ITCL
REQUIRED_VARS ITCL_LIBRARY ITCL_STUB_LIBRARY ITCL_INCLUDE_PATH
)
mark_as_advanced(
ITCL_INCLUDE_PATH
ITCL_LIBRARY
ITCL_STUB_LIBRARY
)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-23
View File
@@ -107,29 +107,6 @@ endif (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
mark_as_advanced(LEMON_TEMPLATE)
# Verify lemon supports %realloc and %free directives (BRL-CAD extensions).
# System lemon (from SQLite) does not support these, but stepcode requires them.
if(LEMON_EXECUTABLE AND LEMON_TEMPLATE)
set(_lemon_test_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/lemon_test")
file(MAKE_DIRECTORY "${_lemon_test_dir}")
file(WRITE "${_lemon_test_dir}/test.y"
"%token_type {int}\n%realloc realloc\n%free free\n%start_symbol start\nstart ::= .\n")
execute_process(
COMMAND ${LEMON_EXECUTABLE} -T${LEMON_TEMPLATE} -q test.y
WORKING_DIRECTORY "${_lemon_test_dir}"
RESULT_VARIABLE _lemon_test_result
OUTPUT_QUIET ERROR_QUIET
)
if(NOT _lemon_test_result EQUAL 0)
message(STATUS "Found lemon at ${LEMON_EXECUTABLE} but it lacks %realloc/%free support")
set(LEMON_EXECUTABLE "LEMON_EXECUTABLE-NOTFOUND" CACHE FILEPATH "Path to lemon" FORCE)
set(LEMON_TEMPLATE "LEMON_TEMPLATE-NOTFOUND" CACHE FILEPATH "Path to lempar.c" FORCE)
endif()
file(REMOVE_RECURSE "${_lemon_test_dir}")
unset(_lemon_test_dir)
unset(_lemon_test_result)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
+76
View File
@@ -0,0 +1,76 @@
#.rst:
# FindLINENOISE
# --------
#
# Find the native LINENOISE includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``LINENOISE::LINENOISE``, if
# LINENOISE has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# LINENOISE_INCLUDE_DIRS - where to find linenoise.h, etc.
# LINENOISE_LIBRARIES - List of libraries when using linenoise.
# LINENOISE_FOUND - True if linenoise found.
#
# Hints
# ^^^^^
#
# A user may set ``LINENOISE_ROOT`` to a linenoise installation root to tell this
# module where to look.
#=============================================================================
# Copyright 2001-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
set(_LINENOISE_SEARCHES)
# Search LINENOISE_ROOT first if it is set.
if(LINENOISE_ROOT)
set(_LINENOISE_SEARCH_ROOT PATHS ${LINENOISE_ROOT} NO_DEFAULT_PATH)
list(APPEND _LINENOISE_SEARCHES _LINENOISE_SEARCH_ROOT)
endif()
set(LINENOISE_NAMES linenoise linenoised)
# Try each search configuration.
foreach(search ${_LINENOISE_SEARCHES})
find_path(LINENOISE_INCLUDE_DIR NAMES linenoise.h ${${search}} PATH_SUFFIXES include include/linenoise)
find_library(LINENOISE_LIBRARY NAMES ${LINENOISE_NAMES} ${${search}} PATH_SUFFIXES lib)
endforeach()
mark_as_advanced(LINENOISE_LIBRARY LINENOISE_INCLUDE_DIR)
# handle the QUIETLY and REQUIRED arguments and set LINENOISE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LINENOISE REQUIRED_VARS LINENOISE_LIBRARY LINENOISE_INCLUDE_DIR)
if(LINENOISE_FOUND)
set(LINENOISE_INCLUDE_DIRS ${LINENOISE_INCLUDE_DIR})
set(LINENOISE_LIBRARIES ${LINENOISE_LIBRARY})
if(NOT TARGET LINENOISE::LINENOISE)
add_library(LINENOISE::LINENOISE UNKNOWN IMPORTED)
set_target_properties(LINENOISE::LINENOISE PROPERTIES
IMPORTED_LOCATION "${LINENOISE_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LINENOISE_INCLUDE_DIRS}")
endif()
endif()
-4
View File
@@ -48,10 +48,6 @@ if(LMDB_ROOT)
list(APPEND _LMDB_SEARCHES _LMDB_SEARCH_ROOT)
endif()
# Fall back to default system paths
set(_LMDB_SEARCH_NORMAL)
list(APPEND _LMDB_SEARCHES _LMDB_SEARCH_NORMAL)
set(LMDB_NAMES lmdb lmdbd)
# Try each search configuration.
-94
View File
@@ -1,94 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindMMESH
--------
Find the native MMESH includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``MMESH::MMESH``, if
MMESH has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
MMESH_INCLUDE_DIRS - where to find mmesh.h, etc.
MMESH_LIBRARIES - List of libraries when using openNURBS.
MMESH_FOUND - True if openNURBS found.
Hints
^^^^^
A user may set ``MMESH_ROOT`` to a openNURBS installation root to tell this
module where to look.
#]=======================================================================]
set(_MMESH_SEARCHES)
# Search MMESH_ROOT first if it is set.
if(MMESH_ROOT)
set(_MMESH_SEARCH_ROOT PATHS ${MMESH_ROOT} NO_DEFAULT_PATH)
list(APPEND _MMESH_SEARCHES _MMESH_SEARCH_ROOT)
endif()
set(MMESH_NAMES mmesh OSMesa)
# Try each search configuration.
foreach(search ${_MMESH_SEARCHES})
find_path(MMESH_INCLUDE_DIR NAMES meshdecimation.h ${${search}} PATH_SUFFIXES include/mmesh mmesh)
endforeach()
# Allow MMESH_LIBRARY to be set manually, as the location of the openNURBS library
if(NOT MMESH_LIBRARY)
foreach(search ${_MMESH_SEARCHES})
find_library(MMESH_LIBRARY NAMES ${MMESH_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
endforeach()
endif()
unset(MMESH_NAMES)
mark_as_advanced(MMESH_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MMESH REQUIRED_VARS MMESH_LIBRARY MMESH_INCLUDE_DIR)
if(MMESH_FOUND)
set(MMESH_INCLUDE_DIRS ${MMESH_INCLUDE_DIR})
if(NOT MMESH_LIBRARIES)
set(MMESH_LIBRARIES ${MMESH_LIBRARY})
endif()
if(NOT TARGET MMESH::MMESH)
add_library(MMESH::MMESH UNKNOWN IMPORTED)
set_target_properties(MMESH::MMESH PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MMESH_INCLUDE_DIRS}")
if(MMESH_LIBRARY_RELEASE)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(MMESH::MMESH PROPERTIES
IMPORTED_LOCATION_RELEASE "${MMESH_LIBRARY_RELEASE}")
endif()
if(MMESH_LIBRARY_DEBUG)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(MMESH::MMESH PROPERTIES
IMPORTED_LOCATION_DEBUG "${MMESH_LIBRARY_DEBUG}")
endif()
if(NOT MMESH_LIBRARY_RELEASE AND NOT MMESH_LIBRARY_DEBUG)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_LOCATION "${MMESH_LIBRARY}")
endif()
endif()
endif()
+152
View File
@@ -0,0 +1,152 @@
#
# Try to find OPENMESH
# Once done this will define
#
# OPENMESH_FOUND - system has OPENMESH
# OPENMESH_INCLUDE_DIRS - the OPENMESH include directories
# OPENMESH_LIBRARIES - Link these to use OPENMESH
###
# - helpful cmake flags when building
#
# OPENMESH_ROOT - path to OpenMesh root if it is built outside of the usual location
#
#=============================================================================
#
# Copyright 2015 Computer Graphics Group, RWTH Aachen University
# Authors: Jan Möbius <moebius@cs.rwth-aachen.de>
# Hans-Christian Ebke <ebke@cs.rwth-aachen.de>
#
#
#===========================================================================
#
# OpenMesh
# Copyright (c) 2001-2015, RWTH-Aachen University
# Department of Computer Graphics and Multimedia
# All rights reserved.
# www.openmesh.org
#
#---------------------------------------------------------------------------
# This file is part of OpenMesh.
#---------------------------------------------------------------------------
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#===========================================================================
#if already found via finder or simulated finder in openmesh CMakeLists.txt, skip the search
IF (NOT OPENMESH_FOUND)
SET (SEARCH_PATHS
"${OPENMESH_ROOT}"
/usr/local/
/usr/
"${CMAKE_SOURCE_DIR}/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src/OpenMesh"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src/OpenMesh"
"C:/Program Files/OpenMesh 8.1"
"C:/Program Files/OpenMesh 8.0"
"C:/Program Files/OpenMesh 7.2"
"C:/Program Files/OpenMesh 7.1"
"C:/Program Files/OpenMesh 7.0"
"C:/Program Files/OpenMesh 6.3"
"C:/Program Files/OpenMesh 6.2"
"C:/Program Files/OpenMesh 6.1"
"C:/Program Files/OpenMesh 6.0"
"C:/Program Files/OpenMesh 5.2"
"C:/Program Files/OpenMesh 5.1"
"C:/Program Files/OpenMesh 5.0"
"C:/Program Files/OpenMesh 4.2"
"C:/Program Files/OpenMesh 4.1"
"C:/Program Files/OpenMesh 4.0"
"C:/Program Files/OpenMesh 3.4"
"C:/Program Files/OpenMesh 3.3"
"C:/Program Files/OpenMesh 3.2"
"C:/Program Files/OpenMesh 3.1"
"C:/Program Files/OpenMesh 3.0"
"C:/Program Files/OpenMesh 2.4.1"
"C:/Program Files/OpenMesh 2.4"
"C:/Program Files/OpenMesh 2.0/include"
"C:/libs/OpenMesh 8.1"
"C:/libs/OpenMesh 8.0"
"C:/libs/OpenMesh 7.1"
"C:/libs/OpenMesh 7.0"
"C:/libs/OpenMesh 6.3"
"C:/libs/OpenMesh 6.2"
"C:/libs/OpenMesh 6.1"
"C:/libs/OpenMesh 6.0"
"C:/libs/OpenMesh 5.2"
"C:/libs/OpenMesh 5.1"
"C:/libs/OpenMesh 5.0"
"C:/libs/OpenMesh 4.2"
"C:/libs/OpenMesh 4.1"
"C:/libs/OpenMesh 4.0"
"C:/libs/OpenMesh 3.4"
"C:/libs/OpenMesh 3.3"
"C:/libs/OpenMesh 3.2"
"C:/libs/OpenMesh 3.1"
"C:/libs/OpenMesh 3.0"
"C:/libs/OpenMesh 2.4.1"
"C:/libs/OpenMesh 2.4"
"${OPENMESH_LIBRARY_DIR}"
)
FIND_PATH (OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES include)
FIND_LIBRARY(OPENMESH_CORE_LIBRARY_RELEASE NAMES OpenMeshCore
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
FIND_LIBRARY(OPENMESH_CORE_LIBRARY_DEBUG NAMES OpenMeshCored
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY_RELEASE NAMES OpenMeshTools
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY_DEBUG NAMES OpenMeshToolsd
PATHS ${SEARCH_PATHS}
PATH_SUFFIXES lib lib64)
#select configuration depending on platform (optimized... on windows)
include(SelectLibraryConfigurations)
select_library_configurations( OPENMESH_TOOLS )
select_library_configurations( OPENMESH_CORE )
set(OPENMESH_LIBRARIES ${OPENMESH_CORE_LIBRARY} ${OPENMESH_TOOLS_LIBRARY} CACHE STRING "OpenMesh Core and Tools libraries" FORCE)
set(OPENMESH_INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR} CACHE STRING "OpenMesh include directory" FORCE)
#checks, if OPENMESH was found and sets OPENMESH_FOUND if so
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenMesh DEFAULT_MSG
OPENMESH_CORE_LIBRARY OPENMESH_TOOLS_LIBRARY OPENMESH_INCLUDE_DIR)
mark_as_advanced(OPENMESH_INCLUDE_DIR OPENMESH_CORE_LIBRARY_RELEASE OPENMESH_CORE_LIBRARY_DEBUG OPENMESH_TOOLS_LIBRARY_RELEASE OPENMESH_TOOLS_LIBRARY_DEBUG)
endif()
-9
View File
@@ -55,10 +55,6 @@ find_package(ZLIB ${_FIND_ZLIB_ARG})
if(ZLIB_FOUND)
set(_PNG_SEARCHES)
if(APPLE)
set(_PNG_CMAKE_FIND_FRAMEWORK "${CMAKE_FIND_FRAMEWORK}")
set(CMAKE_FIND_FRAMEWORK LAST)
endif()
# Search PNG_ROOT first if it is set.
if(PNG_ROOT)
@@ -111,10 +107,6 @@ if(ZLIB_FOUND)
select_library_configurations(PNG)
mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG)
endif()
if(APPLE)
set(CMAKE_FIND_FRAMEWORK "${_PNG_CMAKE_FIND_FRAMEWORK}")
unset(_PNG_CMAKE_FIND_FRAMEWORK)
endif()
unset(PNG_NAMES)
unset(PNG_NAMES_DEBUG)
@@ -144,7 +136,6 @@ if(ZLIB_FOUND)
if(NOT TARGET PNG::PNG)
add_library(PNG::PNG UNKNOWN IMPORTED)
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_NO_SYSTEM TRUE
INTERFACE_COMPILE_DEFINITIONS "${_PNG_COMPILE_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
-4
View File
@@ -42,10 +42,6 @@ if(SQLite3_ROOT)
list(APPEND _SQLite3_SEARCHES _SQLite3_SEARCH_ROOT)
endif()
# Fall back to default system paths
set(_SQLite3_SEARCH_NORMAL)
list(APPEND _SQLite3_SEARCHES _SQLite3_SEARCH_NORMAL)
set(SQLite3_NAMES sqlite3 sqlite libsqlite3 libsqlite)
# Try each search configuration.
+217 -275
View File
@@ -34,6 +34,7 @@ TTK_STUB_LIBRARY = path to ttk stub library
#]=======================================================================]
include(CMakeFindFrameworks)
set(_TCL_SEARCHES)
@@ -47,11 +48,8 @@ if(WIN32)
get_filename_component(
ActiveTcl_CurrentVersion
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME
)
set(
TCLTK_POSSIBLE_BIN_PATHS
${TCLTK_POSSIBLE_BIN_PATHS}
NAME)
set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
@@ -59,16 +57,13 @@ if(WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
)
)
get_filename_component(
ActiveTcl_CurrentVersion
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
NAME
)
set(
TCLTK_POSSIBLE_LIB_PATHS
${TCLTK_POSSIBLE_LIB_PATHS}
NAME)
set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -79,11 +74,9 @@ if(WIN32)
"$ENV{ProgramFiles}/Tcl/Lib"
"C:/Program Files/Tcl/lib"
"C:/Tcl/lib"
)
)
set(
TCLTK_POSSIBLE_INCLUDE_PATHS
${TCLTK_POSSIBLE_INCLUDE_PATHS}
set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
@@ -94,30 +87,20 @@ if(WIN32)
"$ENV{ProgramFiles}/Tcl/include"
"C:/Program Files/Tcl/include"
"C:/Tcl/include"
)
)
endif()
set(
TCL_TCLSH_NAMES
set(TCL_TCLSH_NAMES
tclsh
tclsh${TCL_LIBRARY_VERSION}
tclsh${TK_LIBRARY_VERSION}
tclsh${TK_WISH_VERSION}
tclsh87
tclsh8.7
tclsh86
tclsh8.6
tclsh85
tclsh8.5
tclsh84
tclsh8.4
tclsh83
tclsh8.3
tclsh82
tclsh8.2
tclsh80
tclsh8.0
)
tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
tclsh87 tclsh8.7
tclsh86 tclsh8.6
tclsh85 tclsh8.5
tclsh84 tclsh8.4
tclsh83 tclsh8.3
tclsh82 tclsh8.2
tclsh80 tclsh8.0
)
if(CYGWIN)
set(TCL_TCLSH_NAMES ${TCL_TCLSH_NAMES} cygtclsh83 cygtclsh80)
endif(CYGWIN)
@@ -125,298 +108,257 @@ endif(CYGWIN)
foreach(search ${_TCL_SEARCHES})
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} ${${search}} PATH_SUFFIXES bin)
endforeach()
if(NOT TCL_TCLSH)
if (NOT TCL_TCLSH)
find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
endif(NOT TCL_TCLSH)
endif (NOT TCL_TCLSH)
if(TCL_ENABLE_TK)
set(
TK_WISH_NAMES
if (TCL_ENABLE_TK)
set(TK_WISH_NAMES
wish
wish${TCL_LIBRARY_VERSION}
wish${TK_LIBRARY_VERSION}
wish${TCL_TCLSH_VERSION}
wish86
wish8.6
wish85
wish8.5
wish84
wish8.4
wish83
wish8.3
wish82
wish8.2
wish80
wish8.0
)
wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
wish86 wish8.6
wish85 wish8.5
wish84 wish8.4
wish83 wish8.3
wish82 wish8.2
wish80 wish8.0
)
if(CYGWIN)
set(TK_WISH_NAMES ${TK_WISH_NAMES} cygwish80)
set(TK_WISH_NAMES ${TK_WISH_NAMES} cygwish80 )
endif()
foreach(search ${_TCL_SEARCHES})
find_program(TK_WISH NAMES ${TK_WISH_NAMES} ${${search}} PATH_SUFFIXES bin)
endforeach()
if(NOT TK_WISH)
find_program(TK_WISH NAMES ${TK_WISH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
endif(NOT TK_WISH)
endif(TCL_ENABLE_TK)
if (NOT TK_WISH)
find_program(TK_WISH NAMES ${TK_WISH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
endif (NOT TK_WISH)
endif (TCL_ENABLE_TK)
if(TCLSH_VERSION_STRING)
set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
else()
get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
string(REGEX REPLACE "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
string(REGEX REPLACE
"^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
endif()
set(TCLTK_POSSIBLE_LIB_PATHS "${TCL_INCLUDE_PATH_PARENT}/lib" "${TCL_LIBRARY_PATH}" "${TCL_TCLSH_PATH_PARENT}/lib")
if(TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_LIB_PATHS
set(TCLTK_POSSIBLE_LIB_PATHS
"${TCL_INCLUDE_PATH_PARENT}/lib"
"${TCL_LIBRARY_PATH}"
"${TCL_TCLSH_PATH_PARENT}/lib"
)
if (TCL_ENABLE_TK)
set(TCLTK_POSSIBLE_LIB_PATHS
${TCLTK_POSSIBLE_LIB_PATHS}
"${TK_INCLUDE_PATH_PARENT}/lib"
"${TK_LIBRARY_PATH}"
"${TK_WISH_PATH_PARENT}/lib"
)
endif(TCL_ENABLE_TK)
)
endif (TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
set(TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
lib
lib/tcl
lib/tcl/tcl8.7
lib/tcl/tcl8.6
lib/tcl/tcl8.5
lib/tcl/tcl8.4
)
if(TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
)
if (TCL_ENABLE_TK)
set(TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
lib/tcl/tk8.7
lib/tcl/tk8.6
lib/tcl/tk8.5
lib/tcl/tk8.4
)
endif(TCL_ENABLE_TK)
)
endif (TCL_ENABLE_TK)
set(
TCL_POSSIBLE_LIB_NAMES
set(TCL_POSSIBLE_LIB_NAMES
tcl
tcl${TCL_LIBRARY_VERSION}
tcl${TCL_TCLSH_VERSION}
tcl${TK_WISH_VERSION}
tcl87
tcl8.7
tcl87t
tcl8.7t
tcl86
tcl8.6
tcl86t
tcl8.6t
tcl85
tcl8.5
tcl84
tcl8.4
tcl83
tcl8.3
tcl82
tcl8.2
tcl80
tcl8.0
)
tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
tcl87 tcl8.7 tcl87t tcl8.7t
tcl86 tcl8.6 tcl86t tcl8.6t
tcl85 tcl8.5
tcl84 tcl8.4
tcl83 tcl8.3
tcl82 tcl8.2
tcl80 tcl8.0
)
if(NOT TCL_LIBRARY)
foreach(search ${_TCL_SEARCHES})
find_library(
TCL_LIBRARY
find_library(TCL_LIBRARY
NAMES ${TCL_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES})
endforeach()
endif()
if(NOT TCL_LIBRARY)
find_library(
TCL_LIBRARY
find_library(TCL_LIBRARY
NAMES ${TCL_POSSIBLE_LIB_NAMES}
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
)
endif(NOT TCL_LIBRARY)
set(
TCLSTUB_POSSIBLE_LIB_NAMES
set(TCLSTUB_POSSIBLE_LIB_NAMES
tclstub
tclstub${TK_LIBRARY_VERSION}
tclstub${TCL_TCLSH_VERSION}
tclstub${TK_WISH_VERSION}
tclstub87
tclstub8.7
tclstub86
tclstub8.6
tclstub85
tclstub8.5
tclstub84
tclstub8.4
tclstub83
tclstub8.3
tclstub82
tclstub8.2
tclstub80
tclstub8.0
)
tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
tclstub87 tclstub8.7
tclstub86 tclstub8.6
tclstub85 tclstub8.5
tclstub84 tclstub8.4
tclstub83 tclstub8.3
tclstub82 tclstub8.2
tclstub80 tclstub8.0
)
if(NOT TCL_STUB_LIBRARY)
foreach(search ${_TCL_SEARCHES})
find_library(
TCL_STUB_LIBRARY
find_library(TCL_STUB_LIBRARY
NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR
${${search}}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
)
endforeach()
endif()
if(NOT TCL_STUB_LIBRARY)
find_library(TCL_STUB_LIBRARY NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
find_library(TCL_STUB_LIBRARY
NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
endif()
if(TCL_ENABLE_TK)
set(
TK_POSSIBLE_LIB_NAMES
if (TCL_ENABLE_TK)
set(TK_POSSIBLE_LIB_NAMES
tk
tk${TK_LIBRARY_VERSION}
tk${TCL_TCLSH_VERSION}
tk${TK_WISH_VERSION}
tk87
tk8.7
tk87t
tk8.7t
tk86
tk8.6
tk86t
tk8.6t
tk85
tk8.5
tk84
tk8.4
tk83
tk8.3
tk82
tk8.2
tk80
tk8.0
)
tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
tk87 tk8.7 tk87t tk8.7t
tk86 tk8.6 tk86t tk8.6t
tk85 tk8.5
tk84 tk8.4
tk83 tk8.3
tk82 tk8.2
tk80 tk8.0
)
if(NOT TK_LIBRARY)
foreach(search ${_TCL_SEARCHES})
find_library(
TK_LIBRARY
NAMES ${TK_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
find_library(TK_LIBRARY
NAMES ${TK_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
endforeach()
endif()
if(NOT TK_LIBRARY)
find_library(
TK_LIBRARY
find_library(TK_LIBRARY
NAMES ${TK_POSSIBLE_LIB_NAMES}
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
)
endif(NOT TK_LIBRARY)
set(
TK_STUB_POSSIBLE_LIB_NAMES
set(TK_STUB_POSSIBLE_LIB_NAMES
tkstub
tkstub${TCL_LIBRARY_VERSION}
tkstub${TCL_TCLSH_VERSION}
tkstub${TK_WISH_VERSION}
tkstub87
tkstub8.7
tkstub86
tkstub8.6
tkstub85
tkstub8.5
tkstub84
tkstub8.4
tkstub83
tkstub8.3
tkstub82
tkstub8.2
tkstub80
tkstub8.0
)
tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
tkstub87 tkstub8.7
tkstub86 tkstub8.6
tkstub85 tkstub8.5
tkstub84 tkstub8.4
tkstub83 tkstub8.3
tkstub82 tkstub8.2
tkstub80 tkstub8.0
)
if(NOT TK_STUB_LIBRARY)
foreach(search ${_TCL_SEARCHES})
find_library(
TK_STUB_LIBRARY
NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
find_library(TK_STUB_LIBRARY
NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
endforeach()
endif()
if(NOT TK_STUB_LIBRARY)
find_library(TK_STUB_LIBRARY NAMES ${TK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
find_library(TK_STUB_LIBRARY
NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
endif()
set(
TTK_STUB_POSSIBLE_LIB_NAMES
set(TTK_STUB_POSSIBLE_LIB_NAMES
ttkstub
ttkstub${TCL_LIBRARY_VERSION}
ttkstub${TCL_TCLSH_VERSION}
ttkstub${TK_WISH_VERSION}
ttkstub88
ttkstub8.8
ttkstub87
ttkstub8.7
ttkstub86
ttkstub8.6
ttkstub85
ttkstub8.5
)
ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
ttkstub88 ttkstub8.8
ttkstub87 ttkstub8.7
ttkstub86 ttkstub8.6
ttkstub85 ttkstub8.5
)
if(NOT TTK_STUB_LIBRARY)
foreach(search ${_TCL_SEARCHES})
find_library(
TTK_STUB_LIBRARY
NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
find_library(TTK_STUB_LIBRARY
NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
NAMES_PER_DIR ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
)
endforeach()
endif()
if(NOT TTK_STUB_LIBRARY)
find_library(TTK_STUB_LIBRARY NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES} PATHS ${TCLTK_POSSIBLE_LIB_PATHS})
find_library(TTK_STUB_LIBRARY
NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
)
endif()
endif(TCL_ENABLE_TK)
endif (TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_INCLUDE_PATHS
CMAKE_FIND_FRAMEWORKS(Tcl)
if (TCL_ENABLE_TK)
CMAKE_FIND_FRAMEWORKS(Tk)
endif (TCL_ENABLE_TK)
set(TCL_FRAMEWORK_INCLUDES)
if(Tcl_FRAMEWORKS)
if(NOT TCL_INCLUDE_PATH)
foreach(dir ${Tcl_FRAMEWORKS})
set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
endforeach()
endif()
endif()
if (TCL_ENABLE_TK)
set(TK_FRAMEWORK_INCLUDES)
if(Tk_FRAMEWORKS)
if(NOT TK_INCLUDE_PATH)
foreach(dir ${Tk_FRAMEWORKS})
set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
${dir}/Headers ${dir}/PrivateHeaders)
endforeach()
endif()
endif()
endif (TCL_ENABLE_TK)
set(TCLTK_POSSIBLE_INCLUDE_PATHS
"${TCL_LIBRARY_PATH_PARENT}/include"
"${TCL_INCLUDE_PATH}"
${TCL_FRAMEWORK_INCLUDES}
"${TCL_TCLSH_PATH_PARENT}/include"
)
if(TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_INCLUDE_PATHS
)
if (TCL_ENABLE_TK)
set(TCLTK_POSSIBLE_INCLUDE_PATHS
${TCLTK_POSSIBLE_INCLUDE_PATHS}
"${TCL_LIBRARY_PATH_PARENT}/include"
"${TCL_INCLUDE_PATH}"
${TCL_FRAMEWORK_INCLUDES}
"${TCL_TCLSH_PATH_PARENT}/include"
)
endif(TCL_ENABLE_TK)
)
endif (TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
include
include/tcl${TCL_LIBRARY_VERSION}
include/tcl8.7
@@ -426,71 +368,73 @@ set(
include/tcl8.3
include/tcl8.2
include/tcl8.0
)
)
if(TCL_ENABLE_TK)
set(
TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
if (TCL_ENABLE_TK)
set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
include/tcl${TK_LIBRARY_VERSION}
include/tk8.7
include/tk8.6
include/tk8.5
include/tk8.4
)
endif(TCL_ENABLE_TK)
)
endif (TCL_ENABLE_TK)
foreach(search ${_TCL_SEARCHES})
find_path(TCL_INCLUDE_PATH NAMES tcl.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
find_path(TCL_INCLUDE_PATH
NAMES tcl.h ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
endforeach()
if(NOT TCL_INCLUDE_PATH)
find_path(
TCL_INCLUDE_PATH
if (NOT TCL_INCLUDE_PATH)
find_path(TCL_INCLUDE_PATH
NAMES tcl.h
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
)
endif()
if(TCL_ENABLE_TK)
if (TCL_ENABLE_TK)
foreach(search ${_TCL_SEARCHES})
find_path(TK_INCLUDE_PATH NAMES tk.h ${${search}} PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES})
find_path(TK_INCLUDE_PATH
NAMES tk.h ${${search}}
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
endforeach()
if(NOT TK_INCLUDE_PATH)
find_path(
TK_INCLUDE_PATH
if (NOT TK_INCLUDE_PATH)
find_path(TK_INCLUDE_PATH
NAMES tk.h
HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
)
)
endif()
# IFF we have TCL_TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that the
# windowing system matches the specified type
if(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
set(
tkwin_script
"
if (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
set(tkwin_script "
set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM\"
set fileId [open $filename \"w\"]
set windowingsystem [tk windowingsystem]
puts $fileId $windowingsystem
close $fileId
exit
"
)
")
set(tkwin_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tk_windowingsystem.tcl")
set(WSYS "wm-NOTFOUND")
file(WRITE ${tkwin_scriptfile} ${tkwin_script})
execute_process(COMMAND ${TK_WISH} ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
if(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
if (EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
file(READ "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM" readresultvar)
string(REGEX REPLACE "\n" "" WSYS "${readresultvar}")
endif(EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
endif (EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
# If we have no information about the windowing system or it does not match
# a specified system, the find_package detection has failed
if(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
if (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
unset(TCL_LIBRARY CACHE)
unset(TCL_STUB_LIBRARY CACHE)
unset(TK_LIBRARY CACHE)
@@ -508,31 +452,28 @@ if(TCL_ENABLE_TK)
unset(TCL_STUB_LIBRARY CACHE)
unset(TK_STUB_LIBRARY CACHE)
unset(TTK_STUB_LIBRARY CACHE)
endif(NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
endif(NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
endif(TCL_ENABLE_TK)
endif (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
endif (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
endif (TCL_ENABLE_TK)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
TCL
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TCL_TCLSH
VERSION_VAR TCLSH_VERSION_STRING
)
VERSION_VAR TCLSH_VERSION_STRING)
if(TCL_ENABLE_TK)
if (TCL_ENABLE_TK)
set(FPHSA_NAME_MISMATCHED 1)
set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
find_package_handle_standard_args(
TCLTK
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH
)
set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLTK
REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH)
set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
find_package_handle_standard_args(TK REQUIRED_VARS TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH TK_WISH)
set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK
REQUIRED_VARS TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH TK_WISH)
unset(FPHSA_NAME_MISMATCHED)
endif(TCL_ENABLE_TK)
endif (TCL_ENABLE_TK)
mark_as_advanced(
TCL_INCLUDE_PATH
@@ -544,7 +485,8 @@ mark_as_advanced(
TK_STUB_LIBRARY
TK_WISH
TTK_STUB_LIBRARY
)
)
# Local Variables:
# tab-width: 8
+102
View File
@@ -0,0 +1,102 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindUTAHRLE
--------
Find the native UTAHRLE includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``UTAHRLE::UTAHRLE``, if
UTAHRLE has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
UTAHRLE_INCLUDE_DIRS - where to find pam.h, etc.
UTAHRLE_LIBRARIES - List of libraries when using utahrle.
UTAHRLE_FOUND - True if utahrle found.
Hints
^^^^^
A user may set ``UTAHRLE_ROOT`` to a utahrle installation root to tell this
module where to look.
#]=======================================================================]
set(_UTAHRLE_SEARCHES)
# Search UTAHRLE_ROOT first if it is set.
if(UTAHRLE_ROOT)
set(_UTAHRLE_SEARCH_ROOT PATHS ${UTAHRLE_ROOT} NO_DEFAULT_PATH)
list(APPEND _UTAHRLE_SEARCHES _UTAHRLE_SEARCH_ROOT)
endif()
# Normal search.
set(_UTAHRLE_x86 "(x86)")
set(_UTAHRLE_SEARCH_NORMAL
PATHS "$ENV{ProgramFiles}/utahrle"
"$ENV{ProgramFiles${_UTAHRLE_x86}}/utahrle")
unset(_UTAHRLE_x86)
list(APPEND _UTAHRLE_SEARCHES _UTAHRLE_SEARCH_NORMAL)
set(UTAHRLE_NAMES utahrle)
# Try each search configuration.
foreach(search ${_UTAHRLE_SEARCHES})
find_path(UTAHRLE_INCLUDE_DIR NAMES rle.h ${${search}} PATH_SUFFIXES include include/utahrle)
endforeach()
# Allow UTAHRLE_LIBRARY to be set manually, as the location of the utahrle library
if(NOT UTAHRLE_LIBRARY)
foreach(search ${_UTAHRLE_SEARCHES})
find_library(UTAHRLE_LIBRARY NAMES ${UTAHRLE_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
endforeach()
endif()
unset(UTAHRLE_NAMES)
mark_as_advanced(UTAHRLE_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UTAHRLE REQUIRED_VARS UTAHRLE_LIBRARY UTAHRLE_INCLUDE_DIR)
if(UTAHRLE_FOUND)
set(UTAHRLE_INCLUDE_DIRS ${UTAHRLE_INCLUDE_DIR})
if(NOT UTAHRLE_LIBRARIES)
set(UTAHRLE_LIBRARIES ${UTAHRLE_LIBRARY})
endif()
if(NOT TARGET UTAHRLE::UTAHRLE)
add_library(UTAHRLE::UTAHRLE UNKNOWN IMPORTED)
set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${UTAHRLE_INCLUDE_DIRS}")
if(UTAHRLE_LIBRARY_RELEASE)
set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
IMPORTED_LOCATION_RELEASE "${UTAHRLE_LIBRARY_RELEASE}")
endif()
if(UTAHRLE_LIBRARY_DEBUG)
set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(UTAHRLE::UTAHRLE PROPERTIES
IMPORTED_LOCATION_DEBUG "${UTAHRLE_LIBRARY_DEBUG}")
endif()
if(NOT UTAHRLE_LIBRARY_RELEASE AND NOT UTAHRLE_LIBRARY_DEBUG)
set_property(TARGET UTAHRLE::UTAHRLE APPEND PROPERTY
IMPORTED_LOCATION "${UTAHRLE_LIBRARY}")
endif()
endif()
endif()
+90 -489
View File
@@ -1,522 +1,123 @@
# Distributed under the OSI-approved BSD 3-Clause License.
# See CMake's LICENSE.rst or https://cmake.org/licensing for details.
#.rst:
# FindZLIB
# --------
#
# BRL-CAD local variant:
# - Based on the modern CMake FindZLIB module structure.
# - Preserves BRL-CAD's custom zlib library names, including z_brl.
# - Honors ZLIB_ROOT and ENV{ZLIB_ROOT} as installation-root hints.
# - Keeps the traditional ZLIB::ZLIB target.
# - Adds optional variant targets when they can be found:
# ZLIB::ZLIB_SHARED
# ZLIB::ZLIB_STATIC
# ZLIB::ZLIBSTATIC (alias-compatible with upstream zlib's config package)
# Find the native ZLIB includes and library.
#
#[=======================================================================[.rst:
FindZLIB
--------
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
# ZLIB has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
#
# ::
#
# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
# ZLIB_VERSION_MAJOR - The major version of zlib
# ZLIB_VERSION_MINOR - The minor version of zlib
# ZLIB_VERSION_PATCH - The patch version of zlib
# ZLIB_VERSION_TWEAK - The tweak version of zlib
#
# Backward Compatibility
# ^^^^^^^^^^^^^^^^^^^^^^
#
# The following variable are provided for backward compatibility
#
# ::
#
# ZLIB_MAJOR_VERSION - The major version of zlib
# ZLIB_MINOR_VERSION - The minor version of zlib
# ZLIB_PATCH_VERSION - The patch version of zlib
#
# Hints
# ^^^^^
#
# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
# module where to look.
Finds the native zlib data compression library.
Imported Targets
^^^^^^^^^^^^^^^^
This module provides the following imported targets, when found:
``ZLIB::ZLIB``
Compatibility/default target that encapsulates the selected zlib usage
requirements. Selection follows ``ZLIB_USE_STATIC_LIBS`` when set.
``ZLIB::ZLIB_SHARED``
Shared zlib target, when a shared zlib library can be identified.
``ZLIB::ZLIB_STATIC``
Static zlib target, when a static zlib library can be identified.
``ZLIB::ZLIBSTATIC``
Alias to ``ZLIB::ZLIB_STATIC`` when the static target is available. This
matches the target name used by zlib's own CMake package.
Result Variables
^^^^^^^^^^^^^^^^
``ZLIB_FOUND``
Boolean indicating whether zlib was found.
``ZLIB_VERSION``
The version of zlib found.
``ZLIB_INCLUDE_DIRS``
Include directories containing ``zlib.h`` and other headers needed to use
zlib.
``ZLIB_LIBRARIES``
List of libraries needed to link to the default/selected zlib.
``ZLIB_SHARED_FOUND``
Boolean indicating whether a shared zlib library was found.
``ZLIB_STATIC_FOUND``
Boolean indicating whether a static zlib library was found.
``ZLIB_SHARED_LIBRARIES``
Shared zlib library or debug/optimized library list, when found.
``ZLIB_STATIC_LIBRARIES``
Static zlib library or debug/optimized library list, when found.
Hints
^^^^^
``ZLIB_ROOT``
A user may set this variable to a zlib installation root.
``ENV{ZLIB_ROOT}``
Environment-variable form of ``ZLIB_ROOT``.
``ZLIB_USE_STATIC_LIBS``
Set to ``ON`` before calling ``find_package(ZLIB)`` to prefer static
libraries for the compatibility/default ``ZLIB::ZLIB`` target.
``ZLIB_NAMES`` and ``ZLIB_NAMES_DEBUG``
Optional project override for the default selected-library search names.
``ZLIB_SHARED_NAMES`` and ``ZLIB_SHARED_NAMES_DEBUG``
Optional project override for shared-library search names.
``ZLIB_STATIC_NAMES`` and ``ZLIB_STATIC_NAMES_DEBUG``
Optional project override for static-library search names.
The default name lists include BRL-CAD's custom ``z_brl`` name.
#]=======================================================================]
cmake_policy(PUSH)
if(POLICY CMP0159)
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
endif()
#=============================================================================
# Copyright 2001-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
set(_ZLIB_SEARCHES)
# Search ZLIB_ROOT first if it is set. Support both a CMake variable and
# an environment variable for command-line and packaged-build workflows.
# Search ZLIB_ROOT first if it is set.
if(ZLIB_ROOT)
set(_ZLIB_SEARCH_ROOT PATHS "${ZLIB_ROOT}" NO_DEFAULT_PATH)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
elseif(DEFINED ENV{ZLIB_ROOT} AND NOT "$ENV{ZLIB_ROOT}" STREQUAL "")
set(_ZLIB_SEARCH_ROOT PATHS "$ENV{ZLIB_ROOT}" NO_DEFAULT_PATH)
set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
endif()
# Normal search.
set(_ZLIB_x86 "(x86)")
set(_ZLIB_SEARCH_NORMAL
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
"$ENV{ProgramFiles}/zlib"
"$ENV{ProgramFiles${_ZLIB_x86}}/zlib"
)
unset(_ZLIB_x86)
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
"$ENV{PROGRAMFILES}/zlib"
)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
# BRL-CAD uses z_brl for its bundled zlib. Keep that name first so an
# explicitly supplied root or local prefix finds the BRL-CAD build before a
# generic system zlib.
set(_ZLIB_DEFAULT_SHARED_NAMES
z_brl
z
zlib
zdll
zlib1
zlibstatic
zlibwapi
zlibvc
zlibstat
)
set(_ZLIB_DEFAULT_SHARED_NAMES_DEBUG
z_brld
zd
zlibd
zdlld
zlibd1
zlib1d
zlibstaticd
zlibwapid
zlibvcd
zlibstatd
)
set(_ZLIB_DEFAULT_STATIC_NAMES
# On Windows the import library for the shared zlib and the static library
# share the .lib suffix, so the static name must come first and be distinct
# from the shared import lib (z_brl.lib) or find_library would pick the import
# lib and keep the z_brl.dll runtime dependency. BRL-CAD's static zlib is
# z_brl-static.lib.
z_brl-static
z_brl
z_brl_static
z_brlstatic
zs
zlibstatic
zlibstat
zlib
z
)
set(_ZLIB_DEFAULT_STATIC_NAMES_DEBUG
z_brld
z_brld_static
z_brldstatic
zsd
zlibstaticd
zlibstatd
zlibd
zd
)
if(NOT ZLIB_SHARED_NAMES)
set(ZLIB_SHARED_NAMES ${_ZLIB_DEFAULT_SHARED_NAMES})
endif()
if(NOT ZLIB_SHARED_NAMES_DEBUG)
set(ZLIB_SHARED_NAMES_DEBUG ${_ZLIB_DEFAULT_SHARED_NAMES_DEBUG})
endif()
if(NOT ZLIB_STATIC_NAMES)
set(ZLIB_STATIC_NAMES ${_ZLIB_DEFAULT_STATIC_NAMES})
endif()
if(NOT ZLIB_STATIC_NAMES_DEBUG)
set(ZLIB_STATIC_NAMES_DEBUG ${_ZLIB_DEFAULT_STATIC_NAMES_DEBUG})
endif()
if(NOT ZLIB_NAMES)
if(ZLIB_USE_STATIC_LIBS)
set(ZLIB_NAMES ${ZLIB_STATIC_NAMES})
else()
set(ZLIB_NAMES ${ZLIB_SHARED_NAMES})
endif()
endif()
if(NOT ZLIB_NAMES_DEBUG)
if(ZLIB_USE_STATIC_LIBS)
set(ZLIB_NAMES_DEBUG ${ZLIB_STATIC_NAMES_DEBUG})
else()
set(ZLIB_NAMES_DEBUG ${ZLIB_SHARED_NAMES_DEBUG})
endif()
endif()
set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
# Try each search configuration.
foreach(search ${_ZLIB_SEARCHES})
find_path(ZLIB_INCLUDE_DIR
NAMES zlib.h
${${search}}
PATH_SUFFIXES include
)
find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
endforeach()
function(_zlib_save_find_library_state)
foreach(v CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES)
if(DEFINED ${v})
set(_zlib_ORIG_${v} "${${v}}" PARENT_SCOPE)
set(_zlib_HAD_${v} TRUE PARENT_SCOPE)
else()
set(_zlib_ORIG_${v} PARENT_SCOPE)
set(_zlib_HAD_${v} FALSE PARENT_SCOPE)
endif()
endforeach()
endfunction()
macro(_zlib_restore_find_library_state)
foreach(v CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES)
if(_zlib_HAD_${v})
set(${v} "${_zlib_ORIG_${v}}")
else()
unset(${v})
endif()
endforeach()
endmacro()
function(_zlib_find_variant prefix libtype)
set(options)
set(oneValueArgs)
set(multiValueArgs NAMES NAMES_DEBUG)
cmake_parse_arguments(_ZLIB_FIND "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
_zlib_save_find_library_state()
# Support the MinGW/win32 Makefile.gcc build style.
if(WIN32)
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
endif()
if(libtype STREQUAL "STATIC")
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()
elseif(libtype STREQUAL "SHARED")
if(WIN32)
# On Windows, shared zlib is normally discovered through an import
# library. Distinguishing a .lib import library from a static .lib is
# not reliable by suffix alone, so the name list does most of the work.
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll.a .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
elseif(APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so ${CMAKE_FIND_LIBRARY_SUFFIXES})
elseif(UNIX)
set(CMAKE_FIND_LIBRARY_SUFFIXES .so ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
endif()
foreach(search ${_ZLIB_SEARCHES})
find_library(${prefix}_LIBRARY_RELEASE
NAMES ${_ZLIB_FIND_NAMES}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES lib lib64
)
find_library(${prefix}_LIBRARY_DEBUG
NAMES ${_ZLIB_FIND_NAMES_DEBUG}
NAMES_PER_DIR
${${search}}
PATH_SUFFIXES lib lib64
)
endforeach()
_zlib_restore_find_library_state()
set(${prefix}_LIBRARY_RELEASE "${${prefix}_LIBRARY_RELEASE}" PARENT_SCOPE)
set(${prefix}_LIBRARY_DEBUG "${${prefix}_LIBRARY_DEBUG}" PARENT_SCOPE)
endfunction()
# Main/default search. Preserve CMake's behavior of allowing ZLIB_LIBRARY to
# be set manually as the selected library.
if(NOT ZLIB_LIBRARY)
_zlib_find_variant(ZLIB UNKNOWN
NAMES ${ZLIB_NAMES}
NAMES_DEBUG ${ZLIB_NAMES_DEBUG}
)
include(SelectLibraryConfigurations)
select_library_configurations(ZLIB)
endif()
# Variant searches. These do not override the selected/default ZLIB_LIBRARY.
if(NOT ZLIB_SHARED_LIBRARY)
_zlib_find_variant(ZLIB_SHARED SHARED
NAMES ${ZLIB_SHARED_NAMES}
NAMES_DEBUG ${ZLIB_SHARED_NAMES_DEBUG}
)
include(SelectLibraryConfigurations)
select_library_configurations(ZLIB_SHARED)
endif()
if(NOT ZLIB_STATIC_LIBRARY)
_zlib_find_variant(ZLIB_STATIC STATIC
NAMES ${ZLIB_STATIC_NAMES}
NAMES_DEBUG ${ZLIB_STATIC_NAMES_DEBUG}
)
include(SelectLibraryConfigurations)
select_library_configurations(ZLIB_STATIC)
endif()
unset(ZLIB_NAMES)
unset(ZLIB_NAMES_DEBUG)
unset(_ZLIB_DEFAULT_SHARED_NAMES)
unset(_ZLIB_DEFAULT_SHARED_NAMES_DEBUG)
unset(_ZLIB_DEFAULT_STATIC_NAMES)
unset(_ZLIB_DEFAULT_STATIC_NAMES_DEBUG)
mark_as_advanced(
ZLIB_INCLUDE_DIR
ZLIB_LIBRARY
ZLIB_LIBRARY_RELEASE
ZLIB_LIBRARY_DEBUG
ZLIB_SHARED_LIBRARY
ZLIB_SHARED_LIBRARY_RELEASE
ZLIB_SHARED_LIBRARY_DEBUG
ZLIB_STATIC_LIBRARY
ZLIB_STATIC_LIBRARY_RELEASE
ZLIB_STATIC_LIBRARY_DEBUG
)
mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H
REGEX "^#define ZLIB_VERSION \"[^\"]*\"$"
)
file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
if(ZLIB_H MATCHES "ZLIB_VERSION \"(([0-9]+)\\.([0-9]+)(\\.([0-9]+)(\\.([0-9]+))?)?)")
set(ZLIB_VERSION_STRING "${CMAKE_MATCH_1}")
set(ZLIB_VERSION_MAJOR "${CMAKE_MATCH_2}")
set(ZLIB_VERSION_MINOR "${CMAKE_MATCH_3}")
set(ZLIB_VERSION_PATCH "${CMAKE_MATCH_5}")
set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_7}")
else()
set(ZLIB_VERSION_STRING "")
set(ZLIB_VERSION_MAJOR "")
set(ZLIB_VERSION_MINOR "")
set(ZLIB_VERSION_PATCH "")
string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
# only append a TWEAK version if it exists:
set(ZLIB_VERSION_TWEAK "")
endif()
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
set(ZLIB_VERSION "${ZLIB_VERSION_STRING}")
endif()
set(ZLIB_SHARED_FOUND FALSE)
if(ZLIB_INCLUDE_DIR AND ZLIB_SHARED_LIBRARY)
set(ZLIB_SHARED_FOUND TRUE)
set(ZLIB_SHARED_LIBRARIES ${ZLIB_SHARED_LIBRARY})
endif()
set(ZLIB_STATIC_FOUND FALSE)
if(ZLIB_INCLUDE_DIR AND ZLIB_STATIC_LIBRARY)
set(ZLIB_STATIC_FOUND TRUE)
set(ZLIB_STATIC_LIBRARIES ${ZLIB_STATIC_LIBRARY})
endif()
# Component support:
# find_package(ZLIB COMPONENTS shared)
# find_package(ZLIB COMPONENTS static)
#
# The compatibility/no-component case keeps the classic single-result behavior.
set(_ZLIB_REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
foreach(_zlib_component IN LISTS ZLIB_FIND_COMPONENTS)
if(_zlib_component STREQUAL "shared")
if(ZLIB_SHARED_FOUND)
set(ZLIB_shared_FOUND TRUE)
else()
set(ZLIB_shared_FOUND FALSE)
if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
endif()
list(APPEND _ZLIB_REQUIRED_VARS ZLIB_SHARED_LIBRARY)
elseif(_zlib_component STREQUAL "static")
if(ZLIB_STATIC_FOUND)
set(ZLIB_static_FOUND TRUE)
else()
set(ZLIB_static_FOUND FALSE)
endif()
list(APPEND _ZLIB_REQUIRED_VARS ZLIB_STATIC_LIBRARY)
else()
set(ZLIB_${_zlib_component}_FOUND FALSE)
endif()
endforeach()
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
endif()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZLIB
REQUIRED_VARS ${_ZLIB_REQUIRED_VARS}
VERSION_VAR ZLIB_VERSION
HANDLE_COMPONENTS
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
VERSION_VAR ZLIB_VERSION_STRING)
if(ZLIB_FOUND)
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
if(NOT ZLIB_LIBRARIES)
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
endif()
if(ZLIB_SHARED_FOUND AND NOT TARGET ZLIB::ZLIB_SHARED)
add_library(ZLIB::ZLIB_SHARED UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB_SHARED PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}"
IMPORTED_NO_SYSTEM TRUE
)
if(ZLIB_SHARED_LIBRARY_RELEASE)
set_property(TARGET ZLIB::ZLIB_SHARED APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
set_target_properties(ZLIB::ZLIB_SHARED PROPERTIES
IMPORTED_LOCATION_RELEASE "${ZLIB_SHARED_LIBRARY_RELEASE}"
)
endif()
if(ZLIB_SHARED_LIBRARY_DEBUG)
set_property(TARGET ZLIB::ZLIB_SHARED APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties(ZLIB::ZLIB_SHARED PROPERTIES
IMPORTED_LOCATION_DEBUG "${ZLIB_SHARED_LIBRARY_DEBUG}"
)
endif()
if(NOT ZLIB_SHARED_LIBRARY_RELEASE AND NOT ZLIB_SHARED_LIBRARY_DEBUG)
set_target_properties(ZLIB::ZLIB_SHARED PROPERTIES
IMPORTED_LOCATION "${ZLIB_SHARED_LIBRARY}"
)
endif()
endif()
if(ZLIB_STATIC_FOUND AND NOT TARGET ZLIB::ZLIB_STATIC)
add_library(ZLIB::ZLIB_STATIC STATIC IMPORTED)
set_target_properties(ZLIB::ZLIB_STATIC PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}"
IMPORTED_NO_SYSTEM TRUE
)
if(ZLIB_STATIC_LIBRARY_RELEASE)
set_property(TARGET ZLIB::ZLIB_STATIC APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
set_target_properties(ZLIB::ZLIB_STATIC PROPERTIES
IMPORTED_LOCATION_RELEASE "${ZLIB_STATIC_LIBRARY_RELEASE}"
)
endif()
if(ZLIB_STATIC_LIBRARY_DEBUG)
set_property(TARGET ZLIB::ZLIB_STATIC APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties(ZLIB::ZLIB_STATIC PROPERTIES
IMPORTED_LOCATION_DEBUG "${ZLIB_STATIC_LIBRARY_DEBUG}"
)
endif()
if(NOT ZLIB_STATIC_LIBRARY_RELEASE AND NOT ZLIB_STATIC_LIBRARY_DEBUG)
set_target_properties(ZLIB::ZLIB_STATIC PROPERTIES
IMPORTED_LOCATION "${ZLIB_STATIC_LIBRARY}"
)
endif()
endif()
if(TARGET ZLIB::ZLIB_STATIC AND NOT TARGET ZLIB::ZLIBSTATIC)
add_library(ZLIB::ZLIBSTATIC ALIAS ZLIB::ZLIB_STATIC)
endif()
if(NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}"
IMPORTED_NO_SYSTEM TRUE
)
if(ZLIB_LIBRARY_RELEASE)
set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
set_target_properties(ZLIB::ZLIB PROPERTIES
IMPORTED_LOCATION_RELEASE "${ZLIB_LIBRARY_RELEASE}"
)
endif()
if(ZLIB_LIBRARY_DEBUG)
set_property(TARGET ZLIB::ZLIB APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties(ZLIB::ZLIB PROPERTIES
IMPORTED_LOCATION_DEBUG "${ZLIB_LIBRARY_DEBUG}"
)
endif()
if(NOT ZLIB_LIBRARY_RELEASE AND NOT ZLIB_LIBRARY_DEBUG)
if(NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB PROPERTIES
IMPORTED_LOCATION "${ZLIB_LIBRARY}"
)
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
endif()
endif()
endif()
unset(_ZLIB_REQUIRED_VARS)
unset(_zlib_component)
unset(_ZLIB_SEARCHES)
unset(_ZLIB_SEARCH_ROOT)
unset(_ZLIB_SEARCH_NORMAL)
cmake_policy(POP)
-72
View File
@@ -1,72 +0,0 @@
if (NOT DEFINED BEXT_SOURCE_DIR)
message(FATAL_ERROR "BEXT_SOURCE_DIR is required")
endif()
if (NOT DEFINED BEXT_DOC_MODE)
set(BEXT_DOC_MODE CHECK)
endif()
include("${BEXT_SOURCE_DIR}/CMake/BextDependencyInventory.cmake")
bext_collect_dependency_inventory("${BEXT_SOURCE_DIR}")
set(generated "<!-- BEGIN GENERATED PROJECT TABLE -->\n")
string(APPEND generated "<!-- Generated by CMake/GenerateDependencyDocs.cmake; do not edit this block. -->\n")
string(APPEND generated "| Project | `USE_*` group(s) | Output | Dependencies | Source |\n")
string(APPEND generated "| --- | --- | --- | --- | --- |\n")
foreach(project ${BEXT_INVENTORY_PROJECTS})
bext_inventory_get(groups "${project}" GROUPS)
bext_inventory_get(output_class "${project}" OUTPUT)
bext_inventory_get(deps "${project}" DEPS)
bext_inventory_get(urls "${project}" SOURCE_URLS)
if (groups STREQUAL "always considered")
set(group_text "always considered")
else()
set(group_text "")
foreach(group ${groups})
if (group_text)
string(APPEND group_text ", ")
endif()
string(APPEND group_text "`USE_${group}`")
endforeach()
endif()
if (deps)
set(dep_text "")
foreach(dep ${deps})
if (dep_text)
string(APPEND dep_text ", ")
endif()
string(APPEND dep_text "`${dep}`")
endforeach()
else()
set(dep_text "—")
endif()
list(GET urls 0 primary_url)
string(APPEND generated "| `${project}` | ${group_text} | `${output_class}` | ${dep_text} | [repository](${primary_url}) |\n")
endforeach()
string(APPEND generated "<!-- END GENERATED PROJECT TABLE -->")
set(doc "${BEXT_SOURCE_DIR}/DEPENDENCIES.md")
file(READ "${doc}" current)
set(begin "<!-- BEGIN GENERATED PROJECT TABLE -->")
set(end "<!-- END GENERATED PROJECT TABLE -->")
string(FIND "${current}" "${begin}" begin_pos)
string(FIND "${current}" "${end}" end_pos)
if (begin_pos EQUAL -1 OR end_pos EQUAL -1 OR end_pos LESS begin_pos)
message(FATAL_ERROR "DEPENDENCIES.md is missing generated table markers")
endif()
string(LENGTH "${end}" end_len)
math(EXPR suffix_pos "${end_pos} + ${end_len}")
string(SUBSTRING "${current}" 0 ${begin_pos} prefix)
string(SUBSTRING "${current}" ${suffix_pos} -1 suffix)
set(expected "${prefix}${generated}${suffix}")
if (BEXT_DOC_MODE STREQUAL "WRITE")
file(WRITE "${doc}" "${expected}")
message(STATUS "Updated ${doc}")
elseif(BEXT_DOC_MODE STREQUAL "CHECK")
if (NOT current STREQUAL expected)
message(FATAL_ERROR "DEPENDENCIES.md is stale; run the update_dependency_docs target")
endif()
message(STATUS "Dependency metadata and DEPENDENCIES.md are valid")
else()
message(FATAL_ERROR "Unknown BEXT_DOC_MODE ${BEXT_DOC_MODE}; expected CHECK or WRITE")
endif()
-541
View File
@@ -1,541 +0,0 @@
if (NOT DEFINED BEXT_SOURCE_DIR)
message(FATAL_ERROR "BEXT_SOURCE_DIR is required")
endif ()
if (NOT DEFINED BEXT_BINARY_DIR)
message(FATAL_ERROR "BEXT_BINARY_DIR is required")
endif ()
set(graph_dot "${BEXT_BINARY_DIR}/bext.dot")
set(graph_svg "${BEXT_BINARY_DIR}/bext.svg")
function(_bext_graph_normalize_id out raw_value)
string(TOLOWER "${raw_value}" normalized)
string(REPLACE "_" "-" normalized "${normalized}")
set(${out} "${normalized}" PARENT_SCOPE)
endfunction()
function(_bext_graph_key out raw_value)
string(REGEX REPLACE "[^A-Za-z0-9]" "_" key "${raw_value}")
set(${out} "${key}" PARENT_SCOPE)
endfunction()
function(_bext_graph_set prefix node_id value)
_bext_graph_key(prop_key "${node_id}")
set_property(GLOBAL PROPERTY "${prefix}_${prop_key}" "${value}")
endfunction()
function(_bext_graph_get out prefix node_id)
_bext_graph_key(prop_key "${node_id}")
get_property(prop_value GLOBAL PROPERTY "${prefix}_${prop_key}")
set(${out} "${prop_value}" PARENT_SCOPE)
endfunction()
function(_bext_graph_append prefix node_id value)
_bext_graph_key(prop_key "${node_id}")
get_property(prop_values GLOBAL PROPERTY "${prefix}_${prop_key}")
list(APPEND prop_values "${value}")
list(REMOVE_DUPLICATES prop_values)
set_property(GLOBAL PROPERTY "${prefix}_${prop_key}" "${prop_values}")
endfunction()
function(_bext_graph_get_list out prefix node_id)
_bext_graph_key(prop_key "${node_id}")
get_property(prop_values GLOBAL PROPERTY "${prefix}_${prop_key}")
set(${out} "${prop_values}" PARENT_SCOPE)
endfunction()
function(_bext_graph_quote out value)
string(REPLACE "\"" "\\\"" escaped "${value}")
set(${out} "\"${escaped}\"" PARENT_SCOPE)
endfunction()
function(_bext_graph_label out value)
string(REPLACE "-" " " label_text "${value}")
set(${out} "${label_text}" PARENT_SCOPE)
endfunction()
function(_bext_graph_xml_escape out value)
string(REPLACE "&" "&amp;" escaped "${value}")
string(REPLACE "<" "&lt;" escaped "${escaped}")
string(REPLACE ">" "&gt;" escaped "${escaped}")
string(REPLACE "\"" "&quot;" escaped "${escaped}")
set(${out} "${escaped}" PARENT_SCOPE)
endfunction()
function(_bext_graph_write_line)
cmake_parse_arguments(ARG "" "TEXT" "" ${ARGN})
file(APPEND "${graph_dot}" "${ARG_TEXT}\n")
endfunction()
function(_bext_graph_color_by_depth out_fill out_outline out_font out_outline_font depth output_class)
set(strong_colors "#2563eb" "#0f766e" "#65a30d" "#d97706" "#dc2626" "#9333ea" "#0891b2" "#4f46e5")
set(pale_colors "#dbeafe" "#ccfbf1" "#ecfccb" "#ffedd5" "#fee2e2" "#f3e8ff" "#cffafe" "#e0e7ff")
set(strong_fonts "#ffffff" "#ffffff" "#111827" "#111827" "#ffffff" "#ffffff" "#111827" "#ffffff")
math(EXPR palette_index "(${depth} - 1) % 8")
list(GET strong_colors ${palette_index} strong_fill)
list(GET pale_colors ${palette_index} pale_fill)
list(GET strong_fonts ${palette_index} strong_font)
if ("${output_class}" STREQUAL "noinstall")
set(${out_fill} "${pale_fill}" PARENT_SCOPE)
set(${out_outline} "${strong_fill}" PARENT_SCOPE)
set(${out_font} "${strong_fill}" PARENT_SCOPE)
set(${out_outline_font} "${strong_fill}" PARENT_SCOPE)
else ()
set(${out_fill} "${strong_fill}" PARENT_SCOPE)
set(${out_outline} "${strong_fill}" PARENT_SCOPE)
set(${out_font} "${strong_font}" PARENT_SCOPE)
set(${out_outline_font} "${strong_fill}" PARENT_SCOPE)
endif ()
endfunction()
function(_bext_graph_find_submodule_url out project_name submodule_path)
set(search_path "${project_name}/${submodule_path}")
list(LENGTH submodule_path_entries submodule_count)
if (submodule_count GREATER 0)
math(EXPR last_index "${submodule_count} - 1")
foreach(idx RANGE 0 ${last_index})
list(GET submodule_path_entries ${idx} entry)
string(REPLACE "|" ";" parts "${entry}")
list(GET parts 0 entry_path)
list(GET parts 1 entry_url)
if ("${entry_path}" STREQUAL "${search_path}")
set(${out} "${entry_url}" PARENT_SCOPE)
return()
endif ()
endforeach ()
endif ()
set(${out} "" PARENT_SCOPE)
endfunction()
file(STRINGS "${BEXT_SOURCE_DIR}/.gitmodules" gitmodule_lines)
set(current_submodule_path "")
foreach(line ${gitmodule_lines})
string(STRIP "${line}" stripped_line)
if (stripped_line MATCHES "^path = (.+)$")
set(current_submodule_path "${CMAKE_MATCH_1}")
endif ()
if (stripped_line MATCHES "^url = (.+)$")
if (current_submodule_path)
list(APPEND submodule_path_entries "${current_submodule_path}|${CMAKE_MATCH_1}")
set(current_submodule_path "")
endif ()
endif ()
endforeach()
file(STRINGS "${BEXT_SOURCE_DIR}/CMakeLists.txt" top_level_lines)
set(project_ids)
set(actual_edges)
set(all_dep_ids)
foreach(line ${top_level_lines})
string(STRIP "${line}" stripped_line)
if (stripped_line MATCHES "^#")
continue()
endif ()
if (NOT stripped_line MATCHES "^add_project\\(([^ \t\\)]+)")
continue()
endif ()
set(project_name "${CMAKE_MATCH_1}")
_bext_graph_normalize_id(project_id "${project_name}")
list(APPEND project_ids "${project_id}")
_bext_graph_set(NODE_LABEL "${project_id}" "${project_name}")
_bext_graph_set(NODE_CLASS "${project_id}" "install")
set(project_cmakelists "${BEXT_SOURCE_DIR}/${project_name}/CMakeLists.txt")
file(READ "${project_cmakelists}" project_text)
if (project_text MATCHES "CMAKE_INSTALL_PREFIX=\\$\\{CMAKE_NOBUNDLE_INSTALL_PREFIX\\}" OR
project_text MATCHES "--prefix=\\$\\{CMAKE_NOBUNDLE_INSTALL_PREFIX\\}")
_bext_graph_set(NODE_CLASS "${project_id}" "noinstall")
endif ()
set(depfile "${BEXT_SOURCE_DIR}/${project_name}/${project_name}.deps")
if (EXISTS "${depfile}")
file(STRINGS "${depfile}" dep_lines)
foreach(dep_line ${dep_lines})
string(STRIP "${dep_line}" dep_name)
if (NOT dep_name)
continue()
endif ()
_bext_graph_normalize_id(dep_id "${dep_name}")
list(APPEND actual_edges "${project_id}|${dep_id}")
list(APPEND all_dep_ids "${dep_id}")
_bext_graph_get(dep_label NODE_LABEL "${dep_id}")
if (NOT dep_label)
string(TOLOWER "${dep_name}" dep_label_text)
_bext_graph_set(NODE_LABEL "${dep_id}" "${dep_label_text}")
endif ()
endforeach ()
endif ()
file(STRINGS "${project_cmakelists}" project_lines)
foreach(project_line ${project_lines})
string(STRIP "${project_line}" stripped_project_line)
if (stripped_project_line MATCHES "git_submodule_init\\(([A-Za-z0-9_+./-]+)[ \t]")
list(APPEND submodule_paths "${CMAKE_MATCH_1}")
endif ()
if (stripped_project_line MATCHES "ExternalProject_Add\\(([A-Za-z0-9_]+)_BLD")
_bext_graph_normalize_id(provider_id "${CMAKE_MATCH_1}")
list(APPEND provider_ids "${provider_id}")
endif ()
endforeach ()
list(REMOVE_DUPLICATES submodule_paths)
list(REMOVE_DUPLICATES provider_ids)
if (submodule_paths)
_bext_graph_set(PROJECT_SUBMODULE_PATHS "${project_id}" "${submodule_paths}")
endif ()
if (provider_ids)
_bext_graph_set(PROJECT_PROVIDER_IDS "${project_id}" "${provider_ids}")
endif ()
unset(submodule_paths)
unset(provider_ids)
endforeach()
list(REMOVE_DUPLICATES project_ids)
list(SORT project_ids)
list(REMOVE_DUPLICATES actual_edges)
list(REMOVE_DUPLICATES all_dep_ids)
set(alias_ids)
foreach(dep_id ${all_dep_ids})
list(FIND project_ids "${dep_id}" project_idx)
if (project_idx EQUAL -1)
list(APPEND alias_ids "${dep_id}")
endif ()
endforeach()
list(REMOVE_DUPLICATES alias_ids)
list(SORT alias_ids)
set(provider_edges)
foreach(project_id ${project_ids})
_bext_graph_get(project_name NODE_LABEL "${project_id}")
_bext_graph_get(project_submodule_paths PROJECT_SUBMODULE_PATHS "${project_id}")
foreach(submodule_path ${project_submodule_paths})
_bext_graph_find_submodule_url(project_url "${project_name}" "${submodule_path}")
if (project_url)
_bext_graph_set(NODE_URL "${project_id}" "${project_url}")
break()
endif ()
endforeach ()
_bext_graph_get(provider_ids PROJECT_PROVIDER_IDS "${project_id}")
foreach(provider_id ${provider_ids})
list(FIND alias_ids "${provider_id}" alias_idx)
if (alias_idx EQUAL -1)
continue()
endif ()
list(APPEND provider_edges "${project_id}|${provider_id}")
_bext_graph_get(alias_url NODE_URL "${provider_id}")
if (NOT alias_url)
foreach(submodule_path ${project_submodule_paths})
get_filename_component(submodule_name "${submodule_path}" NAME)
_bext_graph_normalize_id(submodule_id "${submodule_name}")
if ("${submodule_id}" STREQUAL "${provider_id}")
_bext_graph_find_submodule_url(alias_url_candidate "${project_name}" "${submodule_path}")
if (alias_url_candidate)
_bext_graph_set(NODE_URL "${provider_id}" "${alias_url_candidate}")
break()
endif ()
endif ()
endforeach ()
endif ()
_bext_graph_get(alias_class NODE_CLASS "${provider_id}")
if (NOT alias_class)
_bext_graph_get(project_class NODE_CLASS "${project_id}")
_bext_graph_set(NODE_CLASS "${provider_id}" "${project_class}")
endif ()
endforeach ()
endforeach()
list(REMOVE_DUPLICATES provider_edges)
list(SORT provider_edges)
set(node_ids ${project_ids} ${alias_ids})
list(REMOVE_DUPLICATES node_ids)
list(SORT node_ids)
set(incoming_project_targets)
foreach(edge ${actual_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
list(FIND project_ids "${edge_dst}" dst_project_idx)
if (NOT dst_project_idx EQUAL -1)
list(APPEND incoming_project_targets "${edge_dst}")
endif ()
endforeach()
list(REMOVE_DUPLICATES incoming_project_targets)
set(entry_project_ids)
foreach(project_id ${project_ids})
list(FIND incoming_project_targets "${project_id}" incoming_idx)
if (incoming_idx EQUAL -1)
list(APPEND entry_project_ids "${project_id}")
endif ()
endforeach()
list(SORT entry_project_ids)
set(active_nodes ${entry_project_ids})
foreach(project_id ${entry_project_ids})
_bext_graph_set(NODE_DEPTH "${project_id}" "1")
endforeach()
set(changed TRUE)
while (changed)
set(changed FALSE)
foreach(edge ${actual_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
_bext_graph_get(src_depth NODE_DEPTH "${edge_src}")
if (NOT src_depth)
continue()
endif ()
math(EXPR candidate_depth "${src_depth} + 1")
_bext_graph_get(dst_depth NODE_DEPTH "${edge_dst}")
if (NOT dst_depth OR candidate_depth LESS dst_depth)
_bext_graph_set(NODE_DEPTH "${edge_dst}" "${candidate_depth}")
set(changed TRUE)
endif ()
endforeach ()
endwhile ()
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
if (NOT node_depth)
_bext_graph_set(NODE_DEPTH "${node_id}" "1")
endif ()
endforeach()
set(max_depth 1)
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
if (node_depth GREATER max_depth)
set(max_depth "${node_depth}")
endif ()
endforeach()
file(WRITE "${graph_dot}" "digraph Deps {\n")
_bext_graph_write_line(TEXT " graph [rankdir=LR, overlap=false, splines=true];")
_bext_graph_write_line(TEXT " node [shape=box, style=bold, fontname=\"Helvetica\", penwidth=2.0, margin=\"0.12,0.06\"];")
_bext_graph_write_line(TEXT " edge [color=\"#6b7280\", arrowsize=0.7, penwidth=1.4];")
_bext_graph_write_line(TEXT "")
_bext_graph_write_line(TEXT " \"BRL_CAD\" [label=\"BRL-CAD\", URL=\"https://github.com/BRL-CAD/brlcad\", style=\"filled,bold\", fillcolor=\"#111827\", color=\"#111827\", fontcolor=\"#ffffff\", penwidth=2.4];")
_bext_graph_write_line(TEXT "")
foreach(depth RANGE 1 ${max_depth})
set(depth_nodes)
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
if ("${node_depth}" STREQUAL "${depth}")
list(APPEND depth_nodes "${node_id}")
endif ()
endforeach ()
if (depth_nodes)
list(SORT depth_nodes)
_bext_graph_write_line(TEXT " { rank=same;")
foreach(node_id ${depth_nodes})
_bext_graph_get(node_label NODE_LABEL "${node_id}")
_bext_graph_get(node_class NODE_CLASS "${node_id}")
_bext_graph_get(node_url NODE_URL "${node_id}")
_bext_graph_color_by_depth(node_fill node_outline node_font node_outline_font "${depth}" "${node_class}")
_bext_graph_quote(node_name_q "${node_id}")
_bext_graph_quote(node_label_q "${node_label}")
if (node_url)
_bext_graph_quote(node_url_q "${node_url}")
set(url_attr ", URL=${node_url_q}")
else ()
set(url_attr "")
endif ()
if ("${node_class}" STREQUAL "noinstall")
set(node_style "filled,bold")
else ()
set(node_style "filled,bold")
endif ()
_bext_graph_write_line(TEXT " ${node_name_q} [label=${node_label_q}, style=\"${node_style}\", fillcolor=\"${node_fill}\", color=\"${node_outline}\", fontcolor=\"${node_font}\"${url_attr}];")
endforeach ()
_bext_graph_write_line(TEXT " }")
_bext_graph_write_line(TEXT "")
endif ()
endforeach ()
foreach(entry_project_id ${entry_project_ids})
_bext_graph_quote(entry_q "${entry_project_id}")
_bext_graph_write_line(TEXT " \"BRL_CAD\" -> ${entry_q} [color=\"#9ca3af\", penwidth=1.6];")
endforeach ()
if (entry_project_ids)
_bext_graph_write_line(TEXT "")
endif ()
list(SORT actual_edges)
foreach(edge ${actual_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
_bext_graph_quote(src_q "${edge_src}")
_bext_graph_quote(dst_q "${edge_dst}")
_bext_graph_write_line(TEXT " ${src_q} -> ${dst_q};")
endforeach ()
if (provider_edges)
_bext_graph_write_line(TEXT "")
foreach(edge ${provider_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
_bext_graph_quote(src_q "${edge_src}")
_bext_graph_quote(dst_q "${edge_dst}")
_bext_graph_write_line(TEXT " ${src_q} -> ${dst_q} [style=dashed, color=\"#9ca3af\", arrowhead=none, constraint=false];")
endforeach ()
endif ()
_bext_graph_write_line(TEXT "}")
set(node_width 190)
set(node_height 42)
set(column_gap 120)
set(row_gap 22)
set(graph_margin 40)
set(max_nodes_per_depth 1)
foreach(depth RANGE 1 ${max_depth})
set(depth_nodes)
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
if ("${node_depth}" STREQUAL "${depth}")
list(APPEND depth_nodes "${node_id}")
endif ()
endforeach ()
list(LENGTH depth_nodes depth_node_count)
if (depth_node_count GREATER max_nodes_per_depth)
set(max_nodes_per_depth "${depth_node_count}")
endif ()
endforeach ()
math(EXPR graph_width "${graph_margin} * 2 + (${max_depth} + 1) * ${node_width} + ${max_depth} * ${column_gap}")
math(EXPR graph_height "${graph_margin} * 2 + ${max_nodes_per_depth} * ${node_height} + (${max_nodes_per_depth} - 1) * ${row_gap}")
math(EXPR root_x "${graph_margin}")
math(EXPR root_y "(${graph_height} - ${node_height}) / 2")
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
set(depth_nodes)
foreach(depth_node_id ${node_ids})
_bext_graph_get(depth_node_depth NODE_DEPTH "${depth_node_id}")
if ("${depth_node_depth}" STREQUAL "${node_depth}")
list(APPEND depth_nodes "${depth_node_id}")
endif ()
endforeach ()
list(SORT depth_nodes)
list(FIND depth_nodes "${node_id}" depth_index)
math(EXPR node_x "${graph_margin} + ${node_depth} * (${node_width} + ${column_gap})")
math(EXPR node_y "${graph_margin} + ${depth_index} * (${node_height} + ${row_gap})")
_bext_graph_set(NODE_X "${node_id}" "${node_x}")
_bext_graph_set(NODE_Y "${node_id}" "${node_y}")
endforeach ()
file(WRITE "${graph_svg}" "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"${graph_width}\" height=\"${graph_height}\" viewBox=\"0 0 ${graph_width} ${graph_height}\">\n")
file(APPEND "${graph_svg}" " <defs>\n")
file(APPEND "${graph_svg}" " <marker id=\"arrow\" markerWidth=\"10\" markerHeight=\"8\" refX=\"9\" refY=\"4\" orient=\"auto\" markerUnits=\"strokeWidth\">\n")
file(APPEND "${graph_svg}" " <path d=\"M0,0 L10,4 L0,8 z\" fill=\"#6b7280\" />\n")
file(APPEND "${graph_svg}" " </marker>\n")
file(APPEND "${graph_svg}" " </defs>\n")
file(APPEND "${graph_svg}" " <rect width=\"100%\" height=\"100%\" fill=\"#ffffff\" />\n")
foreach(entry_project_id ${entry_project_ids})
_bext_graph_get(dst_x NODE_X "${entry_project_id}")
_bext_graph_get(dst_y NODE_Y "${entry_project_id}")
math(EXPR src_cx "${root_x} + ${node_width}")
math(EXPR src_cy "${root_y} + (${node_height} / 2)")
set(dst_cx "${dst_x}")
math(EXPR dst_cy "${dst_y} + (${node_height} / 2)")
math(EXPR control_dx "(${dst_cx} - ${src_cx}) / 2")
math(EXPR control1_x "${src_cx} + ${control_dx}")
math(EXPR control2_x "${dst_cx} - ${control_dx}")
file(APPEND "${graph_svg}" " <path d=\"M ${src_cx} ${src_cy} C ${control1_x} ${src_cy}, ${control2_x} ${dst_cy}, ${dst_cx} ${dst_cy}\" fill=\"none\" stroke=\"#9ca3af\" stroke-width=\"1.6\" marker-end=\"url(#arrow)\" />\n")
endforeach ()
foreach(edge ${actual_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
_bext_graph_get(src_x NODE_X "${edge_src}")
_bext_graph_get(src_y NODE_Y "${edge_src}")
_bext_graph_get(dst_x NODE_X "${edge_dst}")
_bext_graph_get(dst_y NODE_Y "${edge_dst}")
math(EXPR src_cx "${src_x} + ${node_width}")
math(EXPR src_cy "${src_y} + (${node_height} / 2)")
set(dst_cx "${dst_x}")
math(EXPR dst_cy "${dst_y} + (${node_height} / 2)")
math(EXPR control_dx "(${dst_cx} - ${src_cx}) / 2")
math(EXPR control1_x "${src_cx} + ${control_dx}")
math(EXPR control2_x "${dst_cx} - ${control_dx}")
file(APPEND "${graph_svg}" " <path d=\"M ${src_cx} ${src_cy} C ${control1_x} ${src_cy}, ${control2_x} ${dst_cy}, ${dst_cx} ${dst_cy}\" fill=\"none\" stroke=\"#6b7280\" stroke-width=\"1.4\" marker-end=\"url(#arrow)\" />\n")
endforeach ()
foreach(edge ${provider_edges})
string(REPLACE "|" ";" edge_parts "${edge}")
list(GET edge_parts 0 edge_src)
list(GET edge_parts 1 edge_dst)
_bext_graph_get(src_x NODE_X "${edge_src}")
_bext_graph_get(src_y NODE_Y "${edge_src}")
_bext_graph_get(dst_x NODE_X "${edge_dst}")
_bext_graph_get(dst_y NODE_Y "${edge_dst}")
math(EXPR src_cx "${src_x} + ${node_width}")
math(EXPR src_cy "${src_y} + (${node_height} / 2)")
set(dst_cx "${dst_x}")
math(EXPR dst_cy "${dst_y} + (${node_height} / 2)")
math(EXPR control_dx "(${dst_cx} - ${src_cx}) / 2")
math(EXPR control1_x "${src_cx} + ${control_dx}")
math(EXPR control2_x "${dst_cx} - ${control_dx}")
file(APPEND "${graph_svg}" " <path d=\"M ${src_cx} ${src_cy} C ${control1_x} ${src_cy}, ${control2_x} ${dst_cy}, ${dst_cx} ${dst_cy}\" fill=\"none\" stroke=\"#9ca3af\" stroke-width=\"1.4\" stroke-dasharray=\"6 5\" />\n")
endforeach ()
file(APPEND "${graph_svg}" " <g>\n")
file(APPEND "${graph_svg}" " <a xlink:href=\"https://github.com/BRL-CAD/brlcad\">\n")
file(APPEND "${graph_svg}" " <rect x=\"${root_x}\" y=\"${root_y}\" width=\"${node_width}\" height=\"${node_height}\" rx=\"8\" fill=\"#111827\" stroke=\"#111827\" stroke-width=\"2.4\" />\n")
math(EXPR root_text_x "${root_x} + (${node_width} / 2)")
math(EXPR root_text_y "${root_y} + 27")
file(APPEND "${graph_svg}" " <text x=\"${root_text_x}\" y=\"${root_text_y}\" text-anchor=\"middle\" font-family=\"Helvetica\" font-size=\"16\" font-weight=\"700\" fill=\"#ffffff\">BRL-CAD</text>\n")
file(APPEND "${graph_svg}" " </a>\n")
file(APPEND "${graph_svg}" " </g>\n")
foreach(node_id ${node_ids})
_bext_graph_get(node_depth NODE_DEPTH "${node_id}")
_bext_graph_get(node_label NODE_LABEL "${node_id}")
_bext_graph_get(node_class NODE_CLASS "${node_id}")
_bext_graph_get(node_url NODE_URL "${node_id}")
_bext_graph_get(node_x NODE_X "${node_id}")
_bext_graph_get(node_y NODE_Y "${node_id}")
_bext_graph_color_by_depth(node_fill node_outline node_font node_outline_font "${node_depth}" "${node_class}")
_bext_graph_xml_escape(node_label_xml "${node_label}")
if (node_url)
_bext_graph_xml_escape(node_url_xml "${node_url}")
file(APPEND "${graph_svg}" " <g>\n")
file(APPEND "${graph_svg}" " <a xlink:href=\"${node_url_xml}\">\n")
else ()
file(APPEND "${graph_svg}" " <g>\n")
endif ()
file(APPEND "${graph_svg}" " <rect x=\"${node_x}\" y=\"${node_y}\" width=\"${node_width}\" height=\"${node_height}\" rx=\"8\" fill=\"${node_fill}\" stroke=\"${node_outline}\" stroke-width=\"2.0\" />\n")
math(EXPR text_x "${node_x} + (${node_width} / 2)")
math(EXPR text_y "${node_y} + 27")
file(APPEND "${graph_svg}" " <text x=\"${text_x}\" y=\"${text_y}\" text-anchor=\"middle\" font-family=\"Helvetica\" font-size=\"14\" font-weight=\"600\" fill=\"${node_font}\">${node_label_xml}</text>\n")
if (node_url)
file(APPEND "${graph_svg}" " </a>\n")
endif ()
file(APPEND "${graph_svg}" " </g>\n")
endforeach ()
file(APPEND "${graph_svg}" "</svg>\n")
if (DEFINED GRAPHVIZ_DOT_EXECUTABLE AND GRAPHVIZ_DOT_EXECUTABLE)
foreach(render_format png pdf)
if (DEFINED BEXT_RENDER_${render_format} AND BEXT_RENDER_${render_format})
execute_process(
COMMAND "${GRAPHVIZ_DOT_EXECUTABLE}" "-T${render_format}" "-o" "${BEXT_BINARY_DIR}/bext.${render_format}" "${graph_dot}"
COMMAND_ERROR_IS_FATAL ANY
)
endif ()
endforeach ()
endif ()
-115
View File
@@ -1,115 +0,0 @@
if (NOT DEFINED BEXT_SOURCE_DIR)
message(FATAL_ERROR "BEXT_SOURCE_DIR is required")
endif()
if (NOT DEFINED BEXT_SBOM_OUTPUT)
message(FATAL_ERROR "BEXT_SBOM_OUTPUT is required")
endif()
include("${BEXT_SOURCE_DIR}/CMake/BextDependencyInventory.cmake")
bext_collect_dependency_inventory("${BEXT_SOURCE_DIR}")
function(_bext_json_escape out value)
string(REPLACE "\\" "\\\\" value "${value}")
string(REPLACE "\"" "\\\"" value "${value}")
string(REPLACE "\n" "\\n" value "${value}")
string(REPLACE "\r" "\\r" value "${value}")
string(REPLACE "\t" "\\t" value "${value}")
set(${out} "${value}" PARENT_SCOPE)
endfunction()
function(_bext_spdx_id out project)
string(REGEX REPLACE "[^A-Za-z0-9.-]" "-" id "${project}")
set(${out} "SPDXRef-Package-${id}" PARENT_SCOPE)
endfunction()
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY "${BEXT_SOURCE_DIR}"
RESULT_VARIABLE git_result
OUTPUT_VARIABLE bext_revision
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT git_result EQUAL 0)
message(FATAL_ERROR "Unable to determine the bext revision")
endif()
string(TIMESTAMP created "%Y-%m-%dT%H:%M:%SZ" UTC)
get_filename_component(sbom_dir "${BEXT_SBOM_OUTPUT}" DIRECTORY)
file(MAKE_DIRECTORY "${sbom_dir}")
file(WRITE "${BEXT_SBOM_OUTPUT}" "{\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"spdxVersion\": \"SPDX-2.3\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"dataLicense\": \"CC0-1.0\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"SPDXID\": \"SPDXRef-DOCUMENT\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"name\": \"bext-dependencies\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"documentNamespace\": \"https://github.com/BRL-CAD/bext/sbom/${bext_revision}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"creationInfo\": {\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"created\": \"${created}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"creators\": [\"Tool: bext-GenerateSbom.cmake\"]\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " },\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"packages\": [\n")
list(LENGTH BEXT_INVENTORY_PROJECTS project_count)
set(project_index 0)
foreach(project ${BEXT_INVENTORY_PROJECTS})
math(EXPR project_index "${project_index} + 1")
bext_inventory_get(groups "${project}" GROUPS)
bext_inventory_get(output_class "${project}" OUTPUT)
bext_inventory_get(urls "${project}" SOURCE_URLS)
bext_inventory_get(shas "${project}" SOURCE_SHAS)
list(GET urls 0 primary_url)
list(GET shas 0 primary_sha)
_bext_spdx_id(spdx_id "${project}")
string(REPLACE ";" ", " all_urls "${urls}")
string(REPLACE ";" ", " all_shas "${shas}")
string(REPLACE ";" ", " group_text "${groups}")
_bext_json_escape(comment "groups: ${group_text}; output: ${output_class}; sources: ${all_urls}; pinned commits: ${all_shas}")
_bext_json_escape(primary_url "${primary_url}")
file(APPEND "${BEXT_SBOM_OUTPUT}" " {\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"name\": \"${project}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"SPDXID\": \"${spdx_id}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"versionInfo\": \"${primary_sha}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"downloadLocation\": \"${primary_url}\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"filesAnalyzed\": false,\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"licenseConcluded\": \"NOASSERTION\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"licenseDeclared\": \"NOASSERTION\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"copyrightText\": \"NOASSERTION\",\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"comment\": \"${comment}\"\n")
if (project_index LESS project_count)
file(APPEND "${BEXT_SBOM_OUTPUT}" " },\n")
else()
file(APPEND "${BEXT_SBOM_OUTPUT}" " }\n")
endif()
endforeach()
file(APPEND "${BEXT_SBOM_OUTPUT}" " ],\n")
file(APPEND "${BEXT_SBOM_OUTPUT}" " \"relationships\": [\n")
set(relationships)
foreach(project ${BEXT_INVENTORY_PROJECTS})
_bext_spdx_id(project_id "${project}")
list(APPEND relationships "SPDXRef-DOCUMENT|DESCRIBES|${project_id}")
bext_inventory_get(deps "${project}" DEPS)
foreach(dep ${deps})
list(FIND BEXT_INVENTORY_PROJECTS "${dep}" dep_index)
if (NOT dep_index EQUAL -1)
_bext_spdx_id(dep_id "${dep}")
list(APPEND relationships "${project_id}|DEPENDS_ON|${dep_id}")
endif()
endforeach()
endforeach()
list(LENGTH relationships relationship_count)
set(relationship_index 0)
foreach(relationship ${relationships})
math(EXPR relationship_index "${relationship_index} + 1")
string(REPLACE "|" ";" parts "${relationship}")
list(GET parts 0 source_id)
list(GET parts 1 relationship_type)
list(GET parts 2 target_id)
file(APPEND "${BEXT_SBOM_OUTPUT}" " {\"spdxElementId\": \"${source_id}\", \"relationshipType\": \"${relationship_type}\", \"relatedSpdxElement\": \"${target_id}\"}")
if (relationship_index LESS relationship_count)
file(APPEND "${BEXT_SBOM_OUTPUT}" ",\n")
else()
file(APPEND "${BEXT_SBOM_OUTPUT}" "\n")
endif()
endforeach()
file(APPEND "${BEXT_SBOM_OUTPUT}" " ]\n}\n")
message(STATUS "Generated SPDX 2.3 SBOM: ${BEXT_SBOM_OUTPUT}")
-163
View File
@@ -1,163 +0,0 @@
# J A V A C H E C K . C M A K E
# BRL-CAD
#
# Copyright (c) 2024 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###
# Utility function to check that dlls can be loaded by the Java
# System.loadLibrary mechanism. Parameters (all are mandatory):
#
# Required parameters:
# DLL_DIR = directory holding shared library files to check
#
# The following can be specified in lieu of relying on find_package
# to locate Java:
# JCEXEC = path to javac compiler
# JAREXEC = path to jar archive creater
# JEXEC = path to java executable
function(JavaCheck JC_EXEC JAR_EXEC J_EXEC DLL_SUFFIX dlldir)
if (NOT EXISTS "${dlldir}")
message(FATAL_ERROR "Dll directory ${dlldir} not found\n")
endif ()
if (NOT EXISTS "${JC_EXEC}")
message(FATAL_ERROR "Java compiler executable ${JC_EXEC} not found\n")
endif ()
if (NOT EXISTS "${JAR_EXEC}")
message(FATAL_ERROR "Java archive creation executable ${JAR_EXEC} not found\n")
endif ()
if (NOT EXISTS "${J_EXEC}")
message(FATAL_ERROR "Java executable ${J_EXEC} not found\n")
endif ()
file(WRITE ${dlldir}/LoadLib.java "class LoadLib
{
public static void main(String []args)
{
if (args.length < 1) {
System.out.println(\"No DLL specified\");
System.exit(1);
}
System.out.println(\"Loading \" + args[0]);
System.loadLibrary(args[0]);
System.out.println(\"Done\");
}
}
"
)
# Help make sure Java finds the dynamically linked libraries in question
if (WIN32)
set(ENV{PATH} "${dlldir};$ENV{PATH}")
else (WIN32)
set(ENV{LD_LIBRARY_PATH} "${dlldir}")
endif (WIN32)
# Compile the file and create the jar archive
execute_process(COMMAND ${JC_EXEC} LoadLib.java
RESULT_VARIABLE LSTATUS OUTPUT_VARIABLE LOUT ERROR_VARIABLE LOUT
WORKING_DIRECTORY ${dlldir}
)
if (LSTATUS)
file(REMOVE ${dlldir}/LoadLib.java)
message(FATAL_ERROR "Failed to compile LoadLib.class: ${LOUT}")
endif (LSTATUS)
execute_process(COMMAND ${JAR_EXEC} -cf LoadLib.jar LoadLib.class
RESULT_VARIABLE LSTATUS OUTPUT_VARIABLE LOUT ERROR_VARIABLE LOUT
WORKING_DIRECTORY ${dlldir}
)
if (LSTATUS)
file(REMOVE ${dlldir}/LoadLib.java)
file(REMOVE ${dlldir}/LoadLib.class)
message(FATAL_ERROR "Failed to create JAR file LoadLib.jar: ${LOUT}")
endif (LSTATUS)
file(GLOB dll_files RELATIVE "${dlldir}" "${dlldir}/*${DLL_SUFFIX}")
set(load_fail 0)
foreach(dlf ${dll_files})
string(REGEX REPLACE "^lib" "" dlf "${dlf}")
string(REGEX REPLACE "${DLL_SUFFIX}$" "" dlf "${dlf}")
message("Dll System.loadLibrary check: ${J_EXEC} -cp LoadLib.jar LoadLib ${dlf}")
execute_process(COMMAND ${J_EXEC} -cp LoadLib.jar LoadLib ${dlf}
RESULT_VARIABLE LSTATUS OUTPUT_VARIABLE LOUT ERROR_VARIABLE LOUT
WORKING_DIRECTORY ${dlldir}
)
if (LSTATUS)
message("System.loadLibrary call with dll file ${dlf} did not succeed: ${LOUT}")
set(load_fail 1)
endif (LSTATUS)
endforeach(dlf ${dll_files})
file(REMOVE ${dlldir}/LoadLib.java)
file(REMOVE ${dlldir}/LoadLib.class)
file(REMOVE ${dlldir}/LoadLib.jar)
if (load_fail)
message(FATAL_ERROR "Dll files present that failed to load with LoadLibrary.")
endif (load_fail)
endfunction(JavaCheck)
if (NOT JCEXEC OR NOT JAREXEC OR NOT JEXEC)
find_package(Java REQUIRED)
set(JEXEC ${Java_JAVA_EXECUTABLE})
set(JCEXEC ${Java_JAVAC_EXECUTABLE})
set(JAREXEC ${Java_JAR_EXECUTABLE})
endif (NOT JCEXEC OR NOT JAREXEC OR NOT JEXEC)
# Populate CMAKE_SHARED_LIBRARY_SUFFIX variable. See:
# https://discourse.cmake.org/t/cmake-shared-library-suffix-in-script-processing-p-mode/11646
if (NOT DLLSUFFIX)
set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
include(${CMAKE_ROOT}/Modules/CMakeDetermineSystem.cmake)
include(${CMAKE_ROOT}/Modules/CMakeSystemSpecificInitialize.cmake)
include(${CMAKE_ROOT}/Modules/CMakeSystemSpecificInformation.cmake)
file(REMOVE ${CMAKE_PLATFORM_INFO_DIR})
set(DLLSUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif (NOT DLLSUFFIX)
# Report the active parameters
message("Java executable (JEXEC): ${JEXEC}")
message("Java compiler executable (JCEXEC): ${JCEXEC}")
message("Java archiver executable (JAREXEC): ${JAREXEC}")
message("Dll suffix (DLLSUFFIX): ${DLLSUFFIX}")
message("Dll directory (DLL_DIR): ${DLL_DIR}")
if (JCEXEC AND JAREXEC AND JEXEC AND DLLSUFFIX AND DLL_DIR)
JavaCheck(${JCEXEC} ${JAREXEC} ${JEXEC} ${DLLSUFFIX} ${DLL_DIR})
endif ()
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-75
View File
@@ -1,75 +0,0 @@
# L O A D L I B R A R Y C H E C K . C M A K E
# BRL-CAD
#
# Copyright (c) 2024 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###
# Utility function to check that a dll can be loaded by the LoadLibrary
# function on Windows.
function(LoadLibraryCheck LLTEST_EXEC dlldir)
if (NOT EXISTS "${dlldir}")
message("Dll directory ${dlldir} not found\n")
return()
endif (NOT EXISTS "${dlldir}")
if (NOT EXISTS "${LLTEST_EXEC}")
message("Test executable ${LLTEST_EXEC} not found\n")
return()
endif (NOT EXISTS "${LLTEST_EXEC}")
file(GLOB dll_files RELATIVE "${dlldir}" "${dlldir}/*.dll")
set(load_fail 0)
foreach(dlf ${dll_files})
message("Dll LoadLibrary check: ${LLTEST_EXEC} ${dlf}")
execute_process(COMMAND ${LLTEST_EXEC} ${dlf}
RESULT_VARIABLE LSTATUS OUTPUT_VARIABLE LOUT ERROR_VARIABLE LOUT
WORKING_DIRECTORY ${dlldir}
)
if (LSTATUS)
message("LoadLibrary call with dll file ${dllfile} did not succeed: ${LOUT}")
set(load_fail 1)
endif (LSTATUS)
endforeach(dlf ${dll_files})
if (load_fail)
message(FATAL_ERROR "Dll files present that failed to load with LoadLibrary.")
endif (load_fail)
endfunction(LoadLibraryCheck)
if (LEXEC AND DLL_DIR)
LoadLibraryCheck(${LEXEC} ${DLL_DIR})
endif (LEXEC AND DLL_DIR)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-43
View File
@@ -1,43 +0,0 @@
/* L O A D L I B R A R Y T E S T . C P P
*
* Published in 2024 by the United States Government.
* This work is in the public domain.
*
*/
/** @file LoadLibraryTest.cpp
*
* File to test if a Dll file can be successfully loaded
* by the Windows LoadLibrary call.
*/
#include <windows.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
if (argc < 2) {
printf("lltest <dllfile>\n");
return -1;
}
HINSTANCE linst = LoadLibrary(TEXT(argv[1]));
if (linst == NULL) {
printf("LoadLibrary of %s failed\n", argv[1]);
return 1;
}
BOOL flr = FreeLibrary(linst);
if (!flr) {
printf("FreeLibrary failed for %s\n", argv[1]);
return 1;
}
printf("Success\n");
return 0;
}
// Local Variables:
// tab-width: 8
// mode: C++
// c-basic-offset: 4
// indent-tabs-mode: t
// c-file-style: "stroustrup"
// End:
// ex: shiftwidth=4 tabstop=8
-246
View File
@@ -1,246 +0,0 @@
cmake_minimum_required(VERSION 3.19)
if (NOT DEFINED BEXT_PATCH_NATIVE_EXECUTABLE OR NOT BEXT_PATCH_NATIVE_EXECUTABLE)
message(FATAL_ERROR "BEXT_PATCH_NATIVE_EXECUTABLE is not defined")
endif()
if (NOT DEFINED BEXT_PATCH_CHECK_OPTION OR NOT BEXT_PATCH_CHECK_OPTION)
set(BEXT_PATCH_CHECK_OPTION "--dry-run")
endif()
set(patch_args)
set(seen_separator FALSE)
set(has_forward_flag FALSE)
set(has_reverse_flag FALSE)
set(has_noninteractive_flag FALSE)
set(has_check_flag FALSE)
set(has_input_file FALSE)
set(has_reject_file FALSE)
set(expect_input_file FALSE)
set(expect_reject_file FALSE)
set(input_file "")
math(EXPR last_arg "${CMAKE_ARGC} - 1")
foreach(arg_index RANGE 0 ${last_arg})
set(arg "${CMAKE_ARGV${arg_index}}")
if (seen_separator)
# Some platform patch tools accept -p1 while others require -p 1.
# Normalize the compact form once here for every wrapped invocation.
if (arg MATCHES "^-p([0-9]+)$")
list(APPEND patch_args "-p" "${CMAKE_MATCH_1}")
else()
list(APPEND patch_args "${arg}")
endif()
if (expect_input_file)
set(input_file "${arg}")
set(expect_input_file FALSE)
elseif (expect_reject_file)
set(expect_reject_file FALSE)
elseif (arg STREQUAL "-i" OR arg STREQUAL "--input")
set(has_input_file TRUE)
set(expect_input_file TRUE)
elseif (arg MATCHES "^-i(.+)")
set(has_input_file TRUE)
set(input_file "${CMAKE_MATCH_1}")
elseif (arg MATCHES "^--input=(.+)")
set(has_input_file TRUE)
set(input_file "${CMAKE_MATCH_1}")
endif()
if (arg STREQUAL "-r" OR arg STREQUAL "--reject-file")
set(has_reject_file TRUE)
set(expect_reject_file TRUE)
elseif (arg MATCHES "^-r(.+)")
set(has_reject_file TRUE)
elseif (arg MATCHES "^--reject-file=(.+)")
set(has_reject_file TRUE)
endif()
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
set(has_forward_flag TRUE)
endif()
if (arg STREQUAL "-R" OR arg STREQUAL "--reverse")
set(has_reverse_flag TRUE)
endif()
if (arg STREQUAL "-f" OR arg STREQUAL "--force" OR
arg STREQUAL "-t" OR arg STREQUAL "--batch")
set(has_noninteractive_flag TRUE)
endif()
if (arg STREQUAL "-C" OR arg STREQUAL "--dry-run")
set(has_check_flag TRUE)
endif()
endif()
if (arg STREQUAL "--")
set(seen_separator TRUE)
endif()
endforeach()
if (NOT seen_separator)
message(FATAL_ERROR "Patch wrapper requires '--' before patch arguments")
endif()
if (NOT patch_args)
message(FATAL_ERROR "Patch wrapper did not receive any patch arguments")
endif()
if (expect_input_file)
message(FATAL_ERROR "Patch input option is missing its file path")
endif()
if (expect_reject_file)
message(FATAL_ERROR "Patch reject option is missing its file path")
endif()
set(reject_path "")
set(reject_log_path "")
if (input_file AND DEFINED BEXT_PATCH_REJECT_DIR AND
BEXT_PATCH_REJECT_DIR)
get_filename_component(patch_name "${input_file}" NAME)
get_filename_component(patch_context "${CMAKE_CURRENT_BINARY_DIR}" NAME)
string(REGEX REPLACE "[^A-Za-z0-9_.-]" "_" patch_context
"${patch_context}")
set(reject_path
"${BEXT_PATCH_REJECT_DIR}/${patch_context}-${patch_name}.rej")
set(reject_log_path "${reject_path}.log")
endif()
function(clear_reject_artifacts)
if (reject_path)
file(REMOVE "${reject_path}" "${reject_log_path}")
endif()
endfunction()
function(preserve_reject_artifacts)
if (NOT reject_path)
return()
endif()
# Keep a native reject file when patch emitted one. Applicability checks do
# not normally emit rejects, so fall back to preserving the full patch.
file(MAKE_DIRECTORY "${BEXT_PATCH_REJECT_DIR}")
if (EXISTS "${reject_path}")
file(SIZE "${reject_path}" reject_size)
else()
set(reject_size 0)
endif()
if (reject_size EQUAL 0)
configure_file("${input_file}" "${reject_path}" COPYONLY)
endif()
file(WRITE "${reject_log_path}"
"Patch file: ${input_file}\n"
"Working directory: ${CMAKE_CURRENT_BINARY_DIR}\n\n"
"${patch_failure_output}")
message(STATUS
"Saved failed patch and diagnostics to ${reject_path} and "
"${reject_log_path}")
endfunction()
clear_reject_artifacts()
if (reject_path AND NOT has_reject_file)
list(APPEND patch_args "-r" "${reject_path}")
endif()
# Patch commands run during configure/build steps cannot consult a user. The
# short -t form is accepted by the bundled and supported Unix patch tools.
# Preserve an explicit --force/-f choice if a caller has made one.
if (NOT has_noninteractive_flag)
list(PREPEND patch_args "-t")
endif()
# Preflight file-based patches so a bad patch cannot leave a source tree half
# modified. Stdin cannot be preflighted because it cannot be replayed for the
# real invocation.
if (has_input_file AND NOT has_check_flag)
set(forward_check_args ${patch_args})
list(PREPEND forward_check_args "${BEXT_PATCH_CHECK_OPTION}")
execute_process(
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${forward_check_args}
RESULT_VARIABLE forward_check_result
OUTPUT_VARIABLE forward_check_stdout
ERROR_VARIABLE forward_check_stderr
)
if (NOT forward_check_result EQUAL 0)
if (forward_check_result EQUAL 1 AND has_forward_flag AND
NOT has_reverse_flag)
set(reverse_check_args)
foreach(arg IN LISTS patch_args)
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
continue()
endif()
list(APPEND reverse_check_args "${arg}")
endforeach()
list(PREPEND reverse_check_args "${BEXT_PATCH_CHECK_OPTION}" "-R")
execute_process(
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_check_args}
RESULT_VARIABLE reverse_result
OUTPUT_QUIET
ERROR_QUIET
)
if (reverse_result EQUAL 0)
clear_reject_artifacts()
message(STATUS
"Patch already applied or reversed; continuing because -N/--forward was requested."
)
return()
endif()
endif()
set(patch_failure_output
"${forward_check_stdout}${forward_check_stderr}")
preserve_reject_artifacts()
if (forward_check_stdout)
message("${forward_check_stdout}")
endif()
if (forward_check_stderr)
message("${forward_check_stderr}")
endif()
message(FATAL_ERROR
"Patch preflight failed with exit code ${forward_check_result}"
)
endif()
endif()
execute_process(
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${patch_args}
RESULT_VARIABLE patch_result
OUTPUT_VARIABLE patch_stdout
ERROR_VARIABLE patch_stderr
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE
)
if (patch_result EQUAL 0)
clear_reject_artifacts()
return()
endif()
if (patch_result EQUAL 1 AND has_forward_flag AND NOT has_reverse_flag)
set(reverse_check_args)
foreach(arg IN LISTS patch_args)
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
continue()
endif()
list(APPEND reverse_check_args "${arg}")
endforeach()
list(PREPEND reverse_check_args "${BEXT_PATCH_CHECK_OPTION}" "-R")
execute_process(
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_check_args}
RESULT_VARIABLE reverse_result
OUTPUT_QUIET
ERROR_QUIET
)
if (reverse_result EQUAL 0)
clear_reject_artifacts()
execute_process(
COMMAND ${CMAKE_COMMAND} -E echo
"Patch already applied or reversed; continuing because -N/--forward was requested."
)
return()
endif()
endif()
set(patch_failure_output "${patch_stdout}${patch_stderr}")
preserve_reject_artifacts()
message(FATAL_ERROR "Patch command failed with exit code ${patch_result}")
+149
View File
@@ -0,0 +1,149 @@
cmake_policy(SET CMP0007 NEW)
if (NOT EXISTS "@SRC_DIR@")
message(FATAL_ERROR "@SRC_DIR@ not found on filesystem")
endif (NOT EXISTS "@SRC_DIR@")
file(GLOB_RECURSE SRC_FILES LIST_DIRECTORIES false RELATIVE "@SRC_DIR@" "@SRC_DIR@/*")
list(FILTER SRC_FILES EXCLUDE REGEX ".*[.]git.*")
list(SORT SRC_FILES)
# If we have a prior existing source directory state, read it in
set(prev_md5)
set(prev_files)
if (EXISTS "@MD5_SUMMARY@")
# Read each line in to make two lists - files and MD5 hashes. First entry
# is MD5. Will use file list to get the index to use to get the MD5 hash
# for each file in subsequent lookups
file(STRINGS "@MD5_SUMMARY@" hash_strings)
foreach(hs ${hash_strings})
set(hlist ${hs})
list(POP_FRONT hlist pmd5)
list(APPEND prev_md5 "${pmd5}")
list(APPEND prev_files "${hlist}")
endforeach(hs ${hash_strings})
file(REMOVE "@MD5_SUMMARY@")
endif (EXISTS "@MD5_SUMMARY@")
message("prev_files: ${prev_files}")
# Generate an MD5 summary for the current source dir state
set(curr_md5)
set(curr_files)
foreach(S ${SRC_FILES})
file(MD5 "@SRC_DIR@/${S}" md5_hash)
file(APPEND "@MD5_SUMMARY@" "${md5_hash};${S}\n")
list(APPEND curr_md5 "${md5_hash}")
list(APPEND curr_files "${S}")
endforeach(S ${SRC_FILES})
message("curr_files: ${curr_files}")
# Check if we have any changed files. If so, update the src copy
set(updated_files)
foreach(S ${SRC_FILES})
list(FIND prev_files "${S}" prev_ind)
if ("${prev_ind}" EQUAL -1)
# New file
message("New file: ${S}")
list(APPEND update_files ${S})
continue()
endif ("${prev_ind}" EQUAL -1)
# Check file contents
list(GET prev_md5 ${prev_ind} pmd5)
list(FIND curr_files "${S}" curr_ind)
list(GET curr_md5 ${curr_ind} cmd5)
if (NOT "${pmd5}" STREQUAL "${cmd5}")
list(APPEND update_files ${S})
message("File changed: ${S}")
endif (NOT "${pmd5}" STREQUAL "${cmd5}")
endforeach(S ${SRC_FILES})
# Copy any changed files from the src directory to the build directory
foreach(CF ${updated_files})
execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "@SRC_DIR@/${CF}" "@BLD_DIR@/${CF}")
endforeach(S ${SRC_FILES})
# If we have previously applied patches, read in that information. We will need:
#
# md5 of previously applied patch file. If that's changed, we need to remove all
# added files from the previous patch and re-apply
#
# list of files changed by the patch. If any of the updated files were also
# patch targets, we need to reset all files involved with the patch and
# re-apply. To that end, we also need a separate list of files added by the
# patch so we can remove them. (Unless a file created by patch is already part
# of the update list - in that case leave the file from the update - the patch
# will need to be corrected.)
set(patch_changed_files)
if (EXISTS "@PATCH_CHANGED_SUMMARY@")
file(STRINGS "@PATCH_CHANGED_SUMMARY@" patch_changed_files)
file(REMOVE "@PATCH_CHANGED_SUMMARY@")
endif (EXISTS "@PATCH_CHANGED_SUMMARY@")
set(patch_added_files)
if (EXISTS "@PATCH_ADDED_SUMMARY@")
file(STRINGS "@PATCH_ADDED_SUMMARY@" patch_added_files)
file(REMOVE "@PATCH_ADDED_SUMMARY@")
endif (EXISTS "@PATCH_ADDED_SUMMARY@")
# First check for changed files
set(changed_patch FALSE)
foreach(pcf ${patch_changed_files})
list(FIND updated_files "${pcf}" pcf_ind)
if (NOT "${pcf_ind}" EQUAL -1)
set(changed_patch TRUE)
endif (NOT "${pcf_ind}" EQUAL -1)
endforeach(pcf ${patch_changed_files})
# Remove files present only in the build dir
# TODO - this needs to be more nuanced - files may be added by patching, and we don't
# want to remove those
if (NOT EXISTS "@BLD_DIR@")
message(FATAL_ERROR "@BLD_DIR@ not found on filesystem")
endif (NOT EXISTS "@BLD_DIR@")
file(GLOB_RECURSE BLD_FILES LIST_DIRECTORIES false RELATIVE "@BLD_DIR@" "@BLD_DIR@/*")
list(FILTER BLD_FILES EXCLUDE REGEX ".*[.]git.*")
set(BLD_ONLY ${BLD_FILES})
list(REMOVE_ITEM BLD_ONLY ${SRC_FILES})
foreach(B ${BLD_ONLY})
message("Removing: ${B}")
file(REMOVE "@BLD_DIR@/${B}")
endforeach(B ${BLD_ONLY})
# If any previously patched files are present in the updated
# files list (or if we have never applied patches before)
# we need to proceed with patching.
set(prev_files)
if (EXISTS "@PATCH_SUMMARY@")
# Read each line in to make two lists - files and MD5 hashes. First entry
# is MD5. Will use file list to get the index to use to get the MD5 hash
# for each file in subsequent lookups
file(STRINGS "@MD5_SUMMARY@" hash_strings)
foreach(hs ${hash_strings})
set(hlist ${hs})
list(POP_FRONT hlist pmd5)
list(APPEND prev_md5 "${pmd5}")
list(APPEND prev_files "${hlist}")
endforeach(hs ${hash_strings})
file(REMOVE "@MD5_SUMMARY@")
endif (EXISTS "@MD5_SUMMARY@")
# Copy any changed files from the src directory to the build directory
foreach(S ${SRC_FILES})
execute_process(COMMAND "@CMAKE_COMMAND@" -E compare_files "@SRC_DIR@/${S}" "@BLD_DIR@/${S}" RESULT_VARIABLE FILES_DIFFER)
if (FILES_DIFFER)
execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "@SRC_DIR@/${S}" "@BLD_DIR@/${S}")
set(HAVE_DIFFERENCE TRUE)
endif (FILES_DIFFER)
endforeach(S ${SRC_FILES})
set(PFILES @PATCH_FILES@)
foreach(PF ${PFILES})
# Ignore whitespace, don't attempt reverse patching
execute_process(COMMAND "@PATCH_EXECUTABLE@" -E -p1 --ignore-whitespace -N -i "@CMAKE_CURRENT_SOURCE_DIR@/${PF}")
endforeach(PF ${PFILES})
-464
View File
@@ -1,464 +0,0 @@
# U T I L S . C M A K E
# BRL-CAD
#
# Copyright (c) 2025 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###
include("${CMAKE_CURRENT_LIST_DIR}/BextGit.cmake")
###############################################################################
# It is common for more complex targets to need to key build settings off of
# whether or not their dependencies are being built locally. These macros are
# used to cut down on boilerplate code
###############################################################################
macro(TargetVars roots)
foreach(root ${${roots}})
if (NOT ${root}_ADDED)
message(FATAL_ERROR "${root} is listed as a dependency but is not yet added - fix project ordering in top level CMakeLists.txt file")
endif (NOT ${root}_ADDED)
if (TARGET ${root}_BLD)
set(${root}_TARGET 1)
# Also set the TARGET var in the parent scope - may need it in other
# build logic besides the current directory.
set(${root}_TARGET 1 PARENT_SCOPE)
endif (TARGET ${root}_BLD)
endforeach(root ${${roots}})
endmacro(TargetVars root)
###
# Loads dependencies from an in-src file named same as containing
# directory with .deps suffix. Dependencies are added to the
# corresponding ${proot}_DEPENDS variable.
###
macro(RegisterDeps proot)
get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME)
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
message(FATAL_ERROR "No ${dirname}.deps file found in ${CMAKE_CURRENT_SOURCE_DIR}/")
endif (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps" DEP_LINES)
string(TOLOWER "${proot}" lr)
# Add each dependency to this directory's _DEPENDS list
foreach(dl ${DEP_LINES})
set(${proot}_DEPENDS ${${proot}_DEPENDS} ${dl})
endforeach(dl ${DEP_LINES})
# Add all dependencies to the global ALL_DEPENDENCIES list
get_property(ALL_DEPS GLOBAL PROPERTY ALL_DEPENDENCIES)
set(ALL_DEPS ${ALL_DEPS} ${${proot}_DEPENDS})
list(SORT ALL_DEPS)
list(REMOVE_DUPLICATES ALL_DEPS)
set_property(GLOBAL PROPERTY ALL_DEPENDENCIES ${ALL_DEPS})
# Set the TARGET variables for CMake generator expression "if" tests
TargetVars(${proot}_DEPENDS)
endmacro(RegisterDeps)
macro(TargetInstallDeps croot roots)
foreach(root ${${roots}})
if (TARGET ${root}_BLD)
ExternalProject_Add_stepdependencies(${croot}_BLD configure ${root}_BLD-install)
endif (TARGET ${root}_BLD)
endforeach(root ${${root}})
endmacro(TargetInstallDeps root)
###############################################################################
# We're using submodules to avoid automatically having to download a huge
# amount of source code if it isn't needed. Define a convenience function
# to use in the project to populate the submodule checkouts if needed.
###############################################################################
function(git_submodule_init path checkfile)
string(REGEX REPLACE "[^A-Za-z0-9_+.-]" "_" stamp_name "${path}")
set(sha1_stamp "${CMAKE_CURRENT_BINARY_DIR}/build_sha1_${stamp_name}.txt")
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile}")
bext_git_submodule_update("${CMAKE_CURRENT_SOURCE_DIR}" -- "${path}")
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile}")
message(FATAL_ERROR "Git submodule ${path} is missing ${checkfile} after checkout")
endif ()
execute_process(
COMMAND git log -1 --format=%H
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${path}
OUTPUT_VARIABLE GIT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(WRITE "${sha1_stamp}" ${GIT_SHA1})
else ()
execute_process(
COMMAND git log -1 --format=%H
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${path}
OUTPUT_VARIABLE GIT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (EXISTS "${sha1_stamp}" )
file(READ "${sha1_stamp}" BUILD_SHA1)
if (NOT "${BUILD_SHA1}" MATCHES "${GIT_SHA1}")
message("Outdated sha1 stamp found for ${path}: resetting build directory ${CMAKE_CURRENT_BINARY_DIR}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif (NOT "${BUILD_SHA1}" MATCHES "${GIT_SHA1}")
endif()
file(WRITE "${sha1_stamp}" ${GIT_SHA1})
endif ()
endfunction(git_submodule_init path)
###############################################################################
# If we're using BRLCAD_COMPONENTS, the check of enabled/disabled is more
# nuanced. For bext, the BRLCAD_COMPONENTS list should be the expanded list
# from BRL-CAD's parent logic that fully populates the dependencies, not just
# the components directly specified by the user to BRL-CAD's configure.
###############################################################################
function(cad_enable pname components)
if (DEFINED BRLCAD_COMPONENTS)
# To avoid problems passing multiple components in, we support using ':' as
# a delimiter in addition to the standard CMake list entry delimiter ';'.
# TODO: If this doesn't cut it we'll probably have to pass in a file
# containing a list and read that.
string(REPLACE ":" ";" BRLCAD_COMPONENTS "${BRLCAD_COMPONENTS}")
# In case the component list changed, make sure we're
# not using a cached result.
unset(ENABLE_${pname} CACHE)
unset(DISABLE_${pname} CACHE)
set(acomponents ${components})
# Look for a component in the list
foreach(c ${BRLCAD_COMPONENTS})
list(FIND acomponents ${c} LFIND)
if (NOT LFIND EQUAL -1)
bext_enable_all_default(${pname} ${pname})
set(ENABLE_${pname} ${ENABLE_${pname}} PARENT_SCOPE)
set(DISABLE_${pname} OFF PARENT_SCOPE)
return()
endif (NOT LFIND EQUAL -1)
endforeach(c ${components})
# If we're a component build and this component
# isn't enabled, it's a definite off
set(ENABLE_${pname} OFF)
set(DISABLE_${pname} ON)
endif (DEFINED BRLCAD_COMPONENTS)
# Check for ENABLE_ALL
bext_enable_all_default(${pname} ${pname})
# Final decision
set(ENABLE_${pname} ${ENABLE_${pname}} PARENT_SCOPE)
set(DISABLE_${pname} ${DISABLE_${pname}} PARENT_SCOPE)
endfunction(cad_enable pname components)
###############################################################################
# The enable-disable-find logic for many dependencies follows a pattern. Try
# to wrap that pattern up so we can more easily adjust it for multiple projects
# simultaneously.
###############################################################################
macro(bext_enable pname)
string(TOUPPER "${pname}" upname)
#string(TOLOWER "${pname}" lpname)
bext_enable_all_default(${upname} ${pname})
if (NOT ENABLE_${upname} AND NOT DISABLE_${upname})
# This is an optional probe: a "not found" result is the normal, expected
# path that simply turns on the local build below, and the configure
# summary already reports which packages are built locally vs. found on the
# system. Pass QUIET so a missing package does not emit CMake's verbose
# "could not find a package configuration file" warning, which is noise
# here rather than something the developer needs to act on.
find_package(${pname} QUIET)
if (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})
set(ENABLE_${upname} "ON" CACHE BOOL "Enable ${pname} build")
endif (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})
endif (NOT ENABLE_${upname} AND NOT DISABLE_${upname})
set(ENABLE_${upname} "${ENABLE_${upname}}" CACHE BOOL "Enable ${pname} build")
endmacro(bext_enable pname)
###############################################################################
# Configure summary helpers
###############################################################################
macro(bext_enable_all_default enable_name summary_name)
if (ENABLE_ALL AND NOT DEFINED ENABLE_${enable_name})
set(ENABLE_${enable_name} ON)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_${enable_name})
if (ENABLE_ALL AND ENABLE_${enable_name})
string(TOUPPER "${summary_name}" bext_enable_all_tracking_name)
string(REPLACE "-" "_" bext_enable_all_tracking_name "${bext_enable_all_tracking_name}")
set(BEXT_ENABLE_ALL_FORCED_${bext_enable_all_tracking_name} ON CACHE INTERNAL "Project selected for local build while ENABLE_ALL is active")
endif (ENABLE_ALL AND ENABLE_${enable_name})
endmacro(bext_enable_all_default enable_name summary_name)
function(_bext_summary_append property_name value)
get_property(values GLOBAL PROPERTY ${property_name})
list(APPEND values "${value}")
list(REMOVE_DUPLICATES values)
set_property(GLOBAL PROPERTY ${property_name} "${values}")
endfunction(_bext_summary_append property_name value)
function(_bext_summary_project_uses_local_build out pname upname)
set(local_build FALSE)
if (TARGET ${upname}_BLD)
set(local_build TRUE)
endif (TARGET ${upname}_BLD)
if (DEFINED ENABLE_${upname} AND ENABLE_${upname})
set(local_build TRUE)
endif (DEFINED ENABLE_${upname} AND ENABLE_${upname})
if ("${pname}" STREQUAL "flexbison")
if (TARGET FLEX_BLD OR TARGET BISON_BLD)
set(local_build TRUE)
endif (TARGET FLEX_BLD OR TARGET BISON_BLD)
endif ("${pname}" STREQUAL "flexbison")
if ("${pname}" STREQUAL "qt")
if (TARGET Qt6_BLD OR TARGET Qt6Svg_BLD)
set(local_build TRUE)
endif (TARGET Qt6_BLD OR TARGET Qt6Svg_BLD)
endif ("${pname}" STREQUAL "qt")
if ("${pname}" STREQUAL "tk")
if (TARGET TK_BLD)
set(local_build TRUE)
endif (TARGET TK_BLD)
endif ("${pname}" STREQUAL "tk")
set(${out} ${local_build} PARENT_SCOPE)
endfunction(_bext_summary_project_uses_local_build out pname upname)
function(_bext_summary_list_to_string out values)
set(list_values ${values})
if (list_values)
list(SORT list_values)
string(REPLACE ";" ", " rendered "${list_values}")
else (list_values)
set(rendered "none")
endif (list_values)
set(${out} "${rendered}" PARENT_SCOPE)
endfunction(_bext_summary_list_to_string out values)
function(bext_print_configure_summary)
set(active_groups)
foreach(grp APPLESEED BRLCAD BRLCAD_EXTRA GDAL OSPRAY QT TCL)
if (USE_${grp})
list(APPEND active_groups ${grp})
endif (USE_${grp})
endforeach(grp APPLESEED BRLCAD BRLCAD_EXTRA GDAL OSPRAY QT TCL)
get_property(local_projects GLOBAL PROPERTY BEXT_SUMMARY_LOCAL_PROJECTS)
get_property(system_projects GLOBAL PROPERTY BEXT_SUMMARY_SYSTEM_PROJECTS)
get_property(skipped_projects GLOBAL PROPERTY BEXT_SUMMARY_SKIPPED_PROJECTS)
get_property(forced_projects GLOBAL PROPERTY BEXT_SUMMARY_ENABLE_ALL_PROJECTS)
_bext_summary_list_to_string(active_groups_str "${active_groups}")
_bext_summary_list_to_string(local_projects_str "${local_projects}")
_bext_summary_list_to_string(system_projects_str "${system_projects}")
_bext_summary_list_to_string(skipped_projects_str "${skipped_projects}")
_bext_summary_list_to_string(forced_projects_str "${forced_projects}")
message(STATUS "")
message(STATUS "bext configure summary")
message(STATUS " active USE_* groups: ${active_groups_str}")
message(STATUS " local builds: ${local_projects_str}")
message(STATUS " not built locally: ${system_projects_str}")
if (ENABLE_ALL)
message(STATUS " ENABLE_ALL local-build set: ${forced_projects_str}")
endif (ENABLE_ALL)
message(STATUS " skipped because group inactive: ${skipped_projects_str}")
message(STATUS " bundled output root: ${CMAKE_BUNDLE_INSTALL_PREFIX}")
message(STATUS " noinstall output root: ${CMAKE_NOBUNDLE_INSTALL_PREFIX}")
message(STATUS "")
endfunction(bext_print_configure_summary)
###############################################################################
# The primary add_project function used to add individual dependency
# directories.
###############################################################################
function(add_project pname)
cmake_parse_arguments(A "" "" "GROUPS" ${ARGN})
string(TOUPPER "${pname}" UPNAME)
string(REPLACE "-" "_" UPNAME "${UPNAME}")
if (NOT A_GROUPS)
add_subdirectory(${pname})
_bext_summary_project_uses_local_build(local_build ${pname} ${UPNAME})
if (local_build)
_bext_summary_append(BEXT_SUMMARY_LOCAL_PROJECTS ${pname})
if (ENABLE_ALL AND BEXT_ENABLE_ALL_FORCED_${UPNAME})
_bext_summary_append(BEXT_SUMMARY_ENABLE_ALL_PROJECTS ${pname})
endif (ENABLE_ALL AND BEXT_ENABLE_ALL_FORCED_${UPNAME})
else (local_build)
_bext_summary_append(BEXT_SUMMARY_SYSTEM_PROJECTS ${pname})
endif (local_build)
set(${UPNAME}_ADDED 1 PARENT_SCOPE)
return()
endif (NOT A_GROUPS)
set(is_added FALSE)
foreach(grp ${A_GROUPS})
if (USE_${grp})
add_subdirectory(${pname})
set(is_added TRUE)
set(${UPNAME}_ADDED 1 PARENT_SCOPE)
break()
endif (USE_${grp})
endforeach(grp ${A_GROUPS})
if (is_added)
_bext_summary_project_uses_local_build(local_build ${pname} ${UPNAME})
if (local_build)
_bext_summary_append(BEXT_SUMMARY_LOCAL_PROJECTS ${pname})
if (ENABLE_ALL AND BEXT_ENABLE_ALL_FORCED_${UPNAME})
_bext_summary_append(BEXT_SUMMARY_ENABLE_ALL_PROJECTS ${pname})
endif (ENABLE_ALL AND BEXT_ENABLE_ALL_FORCED_${UPNAME})
else (local_build)
_bext_summary_append(BEXT_SUMMARY_SYSTEM_PROJECTS ${pname})
endif (local_build)
endif (is_added)
if (NOT is_added)
_bext_summary_append(BEXT_SUMMARY_SKIPPED_PROJECTS ${pname})
if (ENABLE_${UPNAME})
message("Disabling ${pname}")
set(STALE_INSTALL_WARN TRUE PARENT_SCOPE)
endif (ENABLE_${UPNAME})
execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/${pname})
unset(ENABLE_${UPNAME} CACHE)
endif (NOT is_added)
endfunction(add_project pname)
###############################################################################
# Make the built-in clean target reset ExternalProject working state without
# requiring a top-level CMake reconfigure. We preserve the generated control
# files in STAMP_DIR and TMP_DIR, but remove the step marker files and any
# generated source/build directories that can be safely recreated by the next
# build.
###############################################################################
function(_bext_collect_subdirs out dir)
set(dirs "${dir}")
get_property(subdirs DIRECTORY "${dir}" PROPERTY SUBDIRECTORIES)
foreach(subdir ${subdirs})
_bext_collect_subdirs(child_dirs "${subdir}")
list(APPEND dirs ${child_dirs})
endforeach()
set(${out} "${dirs}" PARENT_SCOPE)
endfunction(_bext_collect_subdirs out dir)
function(_bext_path_is_in_build_tree out path)
if (NOT path)
set(${out} FALSE PARENT_SCOPE)
return()
endif()
file(RELATIVE_PATH rel "${CMAKE_BINARY_DIR}" "${path}")
if (IS_ABSOLUTE "${rel}" OR "${rel}" MATCHES "^\\.\\.")
set(${out} FALSE PARENT_SCOPE)
else()
set(${out} TRUE PARENT_SCOPE)
endif()
endfunction(_bext_path_is_in_build_tree out path)
function(_bext_register_extproject_clean ep_target)
if (NOT TARGET ${ep_target})
return()
endif()
ExternalProject_Get_Property(${ep_target} SOURCE_DIR)
set(ep_source_dir "${SOURCE_DIR}")
ExternalProject_Get_Property(${ep_target} BINARY_DIR)
set(ep_build_dir "${BINARY_DIR}")
ExternalProject_Get_Property(${ep_target} STAMP_DIR)
set(ep_stamp_dir "${STAMP_DIR}")
_bext_path_is_in_build_tree(ep_source_is_generated "${ep_source_dir}")
_bext_path_is_in_build_tree(ep_build_is_generated "${ep_build_dir}")
set(clean_files
"${ep_stamp_dir}/${ep_target}-mkdir"
"${ep_stamp_dir}/${ep_target}-configure"
"${ep_stamp_dir}/${ep_target}-build"
"${ep_stamp_dir}/${ep_target}-install"
"${ep_stamp_dir}/${ep_target}-done"
)
# If the source tree is a generated copy in the build directory, remove it
# and force the full download/update/patch pipeline to rerun on next build.
if (ep_source_is_generated)
list(APPEND clean_files
"${ep_stamp_dir}/${ep_target}-download"
"${ep_stamp_dir}/${ep_target}-update"
"${ep_stamp_dir}/${ep_target}-patch"
"${ep_source_dir}"
)
endif()
# Some wrappers use a separate generated binary directory outside the default
# *_BLD-prefix/src tree (Qt is the main case.) If it lives in the build tree
# and isn't the same path as SOURCE_DIR, it is safe to remove here.
if (ep_build_is_generated AND NOT "${ep_build_dir}" STREQUAL "${ep_source_dir}")
list(APPEND clean_files "${ep_build_dir}")
endif()
list(REMOVE_DUPLICATES clean_files)
set_property(TARGET ${ep_target} APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${clean_files}")
if (TARGET ${ep_target}-install)
set_property(TARGET ${ep_target}-install APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${clean_files}")
endif()
endfunction(_bext_register_extproject_clean ep_target)
function(register_external_project_clean_targets)
_bext_collect_subdirs(all_dirs "${CMAKE_SOURCE_DIR}")
list(REMOVE_DUPLICATES all_dirs)
foreach(dir ${all_dirs})
get_property(dir_targets DIRECTORY "${dir}" PROPERTY BUILDSYSTEM_TARGETS)
foreach(dir_target ${dir_targets})
if ("${dir_target}" MATCHES "_BLD$")
_bext_register_extproject_clean("${dir_target}")
endif()
endforeach()
endforeach()
endfunction(register_external_project_clean_targets)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+228 -616
View File
@@ -23,7 +23,7 @@
# still possible to request a system library in individual cases.
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.26)
cmake_minimum_required(VERSION 3.19)
project(BEXT)
@@ -73,31 +73,6 @@ endif(CMAKE_CONFIGURATION_TYPES)
mark_as_advanced(CMAKE_BUILD_TYPE)
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
# Frameworks are deprecated in CMake, so avoid finding them
set(CMAKE_FIND_FRAMEWORK NEVER)
#------------------------------------------------------------------------------
# Check if our working directory is in a symlinked path - that can cause some
# serious problems for things like install and rpath updating when it comes
# time to integrate into a build, so be loud.
set(PROBLEM_PATH 0)
file(REAL_PATH "${PROJECT_SOURCE_DIR}" PROJECT_REAL_SOURCE_DIR)
if (NOT "${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_REAL_SOURCE_DIR}")
message(WARNING "PROJECT_SOURCE_DIR is \"${PROJECT_SOURCE_DIR}\" but REAL_PATH is \"${PROJECT_REAL_SOURCE_DIR}\". Working with a symlinked alias path causes problems in subsequent file processing and is NOT recommended.")
set(PROBLEM_PATH 1)
endif()
file(REAL_PATH "${PROJECT_BINARY_DIR}" PROJECT_REAL_BINARY_DIR)
if (NOT "${PROJECT_BINARY_DIR}" STREQUAL "${PROJECT_REAL_BINARY_DIR}")
message(WARNING "PROJECT_BINARY_DIR is \"${PROJECT_BINARY_DIR}\" but REAL_PATH is \"${PROJECT_REAL_BINARY_DIR}\". Working with a symlinked alias path causes problems in subsequent file processing and is NOT recommended.")
set(PROBLEM_PATH 1)
endif()
if (PROBLEM_PATH)
find_program(SLEEP_EXEC sleep)
if(SLEEP_EXEC)
execute_process(COMMAND ${SLEEP_EXEC} 15)
endif(SLEEP_EXEC)
endif(PROBLEM_PATH)
#------------------------------------------------------------------------------
# Once we do a run, we want our ENABLE_ALL setting to be consistent in
# subsequent CMake runs
@@ -123,11 +98,6 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT DEFINED CMAKE_BUILD_TYPE)
# If the user hasn't specified it otherwise, build the static libraries too
if (NOT DEFINED BUILD_STATIC_LIBS)
set(BUILD_STATIC_LIBS ON)
endif (NOT DEFINED BUILD_STATIC_LIBS)
# Define some variables
if(NOT DEFINED BIN_DIR)
set(BIN_DIR bin)
@@ -148,18 +118,29 @@ endif(NOT DEFINED DATA_DIR)
# directory to hold both of these outputs, and we want it to be in a standard
# location that other projects will know to look for.
# Default to the build directory for output and installation
# Try to get the home directory
set(ENV_HOME "$ENV{HOME}")
if (NOT ENV_HOME)
set(ENV_HOME "$ENV{USERPROFILE}")
endif (NOT ENV_HOME)
# If we're not being forced to a specific location
# and we know where home is, use it
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "default install path" FORCE)
set(CMAKE_INSTALL_PREFIX "${ENV_HOME}")
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Make sure subsequent configures stick with the same installation path, whether specified or not
# If home didn't work, fall back on the build directory
if (NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
endif (NOT CMAKE_INSTALL_PREFIX)
# Having decided on the path, make sure subsequent configures stick with it
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Calculated or specified install prefix" FORCE)
message("prefix is ${CMAKE_INSTALL_PREFIX}")
set(CMAKE_BUNDLE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/install" CACHE PATH "Outputs for bundling" FORCE)
set(CMAKE_NOBUNDLE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/noinstall" CACHE PATH "Build tools NOT intended for bundling" FORCE)
set(BEXT_ROOT bext_output)
set(CMAKE_BUNDLE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}/install" CACHE PATH "Outputs for bundling" FORCE)
set(CMAKE_NOBUNDLE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}/noinstall" CACHE PATH "Build tools NOT intended for bundling" FORCE)
file(MAKE_DIRECTORY "${CMAKE_BUNDLE_INSTALL_PREFIX}")
file(MAKE_DIRECTORY "${CMAKE_NOBUNDLE_INSTALL_PREFIX}")
@@ -195,61 +176,6 @@ endif (EXT_BUILD_VERBOSE)
# ExternalProject_Add feature to manage 3rd party builds
include(ExternalProject)
# ExternalProject source convention:
# * Use SOURCE_DIR for an existing submodule built directly in place when no
# source patching or staging is needed.
# * Use a local URL when patching a submodule, so ExternalProject stages a
# build-tree copy before PATCH_COMMAND and other source modifications run.
# * A large source tree such as Qt6 is built in place when unmodified, but is
# staged when caller-supplied patches must be applied.
# Do not replace URL with SOURCE_DIR merely to avoid the local URL spelling;
# that can cause patches or generated-file changes to modify the checkout.
#---------------------------------------------------------------------
# CMake 4.0 removed support for cmake_minimum_required(VERSION < 3.5), but a
# number of our bundled third party projects still declare such old minimums.
# Because each dependency is configured as an independent ExternalProject
# sub-build (a separate cmake invocation), a top level CMAKE_POLICY_VERSION_MINIMUM
# setting - whether on the command line or from a CMakePresets cache variable -
# does NOT reach those sub-builds. To make old dependencies configure regardless
# of how bext itself is invoked, establish a default policy floor here and wrap
# ExternalProject_Add so that every CMake-based sub-build is configured with it.
#
# The flag is inserted as the first CMAKE_ARGS value so it always lands inside
# the CMAKE_ARGS group regardless of which ExternalProject keywords follow.
# Sub-builds that drive a non-CMake configure (i.e. have no CMAKE_ARGS) are left
# untouched. Defining a command that already exists makes the original available
# under the same name with a leading underscore, a documented CMake behavior.
if (NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif (NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
function(ExternalProject_Add name)
# Rebuild the call as a string of bracket-quoted arguments so that empty
# arguments (e.g. CONFIGURE_COMMAND "") and values containing spaces,
# semicolons or generator expressions are all preserved exactly. Inject the
# policy floor immediately after the CMAKE_ARGS token so it becomes the first
# CMAKE_ARGS value.
set(ep_call "_ExternalProject_Add([==[${name}]==]")
if (ARGC GREATER 1)
math(EXPR ep_last "${ARGC} - 1")
foreach(ep_i RANGE 1 ${ep_last})
string(APPEND ep_call " [==[${ARGV${ep_i}}]==]")
if ("${ARGV${ep_i}}" STREQUAL "CMAKE_ARGS")
string(APPEND ep_call " [==[-DCMAKE_POLICY_VERSION_MINIMUM=${CMAKE_POLICY_VERSION_MINIMUM}]==]")
endif ("${ARGV${ep_i}}" STREQUAL "CMAKE_ARGS")
endforeach(ep_i RANGE 1 ${ep_last})
endif (ARGC GREATER 1)
string(APPEND ep_call ")")
cmake_language(EVAL CODE "${ep_call}")
if (TARGET ${name}-install)
get_property(_bext_install_targets GLOBAL PROPERTY BEXT_INSTALL_TARGETS)
list(APPEND _bext_install_targets ${name}-install)
list(REMOVE_DUPLICATES _bext_install_targets)
set_property(GLOBAL PROPERTY BEXT_INSTALL_TARGETS "${_bext_install_targets}")
endif (TARGET ${name}-install)
endfunction(ExternalProject_Add name)
# In case we need to pass some sort of reasonable parallel
# flag to a build system, check our processor count
include(ProcessorCount)
@@ -259,14 +185,6 @@ if (NOT pcnt)
set(pcnt 1)
endif (NOT pcnt)
# External projects driven by a direct make invocation set their own -j value
# below. Do not also pass down the top-level generator's jobserver state:
# GNU make encodes it in MAKEFLAGS using options that other make variants
# (notably FreeBSD make) do not understand.
set(BEXT_MAKE_COMMAND
${CMAKE_COMMAND} -E env --unset=MAKEFLAGS --unset=MFLAGS make
)
# We want to pass the build type option to CMake builds if we're not using a
# multiconfig generator - define a variable that will either be empty or define
# the desired CMake line based on GENERATOR_IS_MULTI_CONFIG (see
@@ -277,21 +195,11 @@ if (NOT isMultiConfig)
set(BUILD_TYPE_SPECIFIER "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif (NOT isMultiConfig)
# With MSVC, some non-CMake subbuilds need the vcvars bat file to set up their
# environment. Always reinitialize the generated wrappers: a parent shell such
# as Git Bash can reorder PATH while leaving Visual Studio's environment markers
# intact. The wrappers also put the selected compiler's directory first so a
# POSIX utility named link cannot shadow MSVC's link.exe.
# With MSVC, some of the non-CMake subbuilds are going to need the vcvars bat
# file to set up the environment.
if(MSVC)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BEXT_MSVC_TARGET_ARCH x64)
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BEXT_MSVC_TARGET_ARCH x86)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
get_filename_component(BEXT_MSVC_COMPILER_BIN_DIR "${CMAKE_C_COMPILER}" DIRECTORY)
set(COMPILER_DIR "${BEXT_MSVC_COMPILER_BIN_DIR}")
get_filename_component(COMPILER_DIR "${CMAKE_C_COMPILER}" DIRECTORY)
get_filename_component(COMPILER_ROOT "${COMPILER_DIR}" NAME)
set(VCVARS_BAT "${COMPILER_DIR}/vcvars${COMPILER_ROOT}.bat")
if(NOT EXISTS "${VCVARS_BAT}")
@@ -301,11 +209,11 @@ if(MSVC)
get_filename_component(COMPILER_DIR "${COMPILER_DIR}" DIRECTORY)
endforeach(DIRS RANGE 0 5)
set(COMPILER_DIR "${COMPILER_DIR}/Auxiliary/Build")
if(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
if(CMAKE_CL_64)
set(VCVARS_BAT "${COMPILER_DIR}/vcvars64.bat")
else(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
else(CMAKE_CL_64)
set(VCVARS_BAT "${COMPILER_DIR}/vcvars32.bat")
endif(BEXT_MSVC_TARGET_ARCH STREQUAL "x64")
endif(CMAKE_CL_64)
if(NOT EXISTS "${VCVARS_BAT}")
message(FATAL_ERROR "Could not find vcvars bat file in ${COMPILER_DIR}")
endif(NOT EXISTS "${VCVARS_BAT}")
@@ -313,28 +221,107 @@ if(MSVC)
endif(MSVC)
# If configurations change after a build has been performed, we don't
# automatically scrub a pre-existing output directory to remove the files from
# the newly disabled components. This variable records whether we need to warn
# the user about this.
set(STALE_INSTALL_WARN FALSE)
# Gather graph generation inputs from the existing source-of-truth files.
file(GLOB BEXT_GRAPH_PROJECT_FILES
RELATIVE "${CMAKE_SOURCE_DIR}"
"*/*.deps"
"*/CMakeLists.txt"
)
list(REMOVE_DUPLICATES BEXT_GRAPH_PROJECT_FILES)
list(SORT BEXT_GRAPH_PROJECT_FILES)
# Add a target that will run every time we build and touch a file in
# noinstall to allow interested parent CMake builds to be aware of potential
# changes, even if all that happens is to add files - otherwise, add-only
# operations won't trigger a CMake reconfigure even if the client build is
# watching the install files.
file(MAKE_DIRECTORY ${CMAKE_NOBUNDLE_INSTALL_PREFIX})
add_custom_target(BuildStamp ALL COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_NOBUNDLE_INSTALL_PREFIX}/build-stamp)
###############################################################################
# Include some utility macros and functions to reduce boilerplate code needed
# in dependency CMakeLists.txt files
# It is common for more complex targets to need to key build settings off of
# whether or not their dependencies are being built locally. These macros are
# used to cut down on boilerplate code
###############################################################################
include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils.cmake")
configure_file("${CMAKE_SOURCE_DIR}/dependencies.dot" "${CMAKE_BINARY_DIR}/bext.dot" COPYONLY)
macro(TargetVars roots)
foreach(root ${${roots}})
if (NOT ${root}_ADDED)
message(FATAL_ERROR "${root} is listed as a dependency but is not yet added - fix project ordering in top level CMakeLists.txt file")
endif (NOT ${root}_ADDED)
if (TARGET ${root}_BLD)
set(${root}_TARGET 1)
endif (TARGET ${root}_BLD)
endforeach(root ${${roots}})
endmacro(TargetVars root)
###
# Loads dependencies from an in-src file named same as containing
# directory with .deps suffix. Dependencies are added to the
# corresponding ${proot}_DEPENDS variable.
#
# FIXME: Dependencies are also added here to a .dot file dependency
# graph file, but that shouldn't be intertwined here as side effect.
###
macro(RegisterDeps proot)
get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME)
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
message(FATAL_ERROR "No ${dirname}.deps file found in ${CMAKE_CURRENT_SOURCE_DIR}/")
endif (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps" DEP_LINES)
string(TOLOWER "${proot}" lr)
# Add each dependency to this directory's _DEPENDS list
foreach(dl ${DEP_LINES})
set(${proot}_DEPENDS ${${proot}_DEPENDS} ${dl})
endforeach(dl ${DEP_LINES})
# Add all dependencies to the global ALL_DEPENDENCIES list
get_property(ALL_DEPS GLOBAL PROPERTY ALL_DEPENDENCIES)
set(ALL_DEPS ${ALL_DEPS} ${${proot}_DEPENDS})
list(SORT ALL_DEPS)
list(REMOVE_DUPLICATES ALL_DEPS)
set_property(GLOBAL PROPERTY ALL_DEPENDENCIES ${ALL_DEPS})
# Set the TARGET variables for CMake generator expression "if" tests
TargetVars(${proot}_DEPENDS)
# Add each dependency to a global .dot file
foreach(dl ${DEP_LINES})
string(TOLOWER "${dl}" ldl)
if (NOT "${ldl}" STREQUAL "patch")
file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\t${lr} -> ${ldl};\n")
endif (NOT "${ldl}" STREQUAL "patch")
endforeach(dl ${DEP_LINES})
endmacro(RegisterDeps)
macro(TargetInstallDeps croot roots)
foreach(root ${${roots}})
if (TARGET ${root}_BLD)
ExternalProject_Add_stepdependencies(${croot}_BLD configure ${root}_BLD-install)
endif (TARGET ${root}_BLD)
endforeach(root ${${root}})
endmacro(TargetInstallDeps root)
###############################################################################
# We're using submodules to avoid automatically having to download a huge
# amount of source code if it isn't needed. Define a convenience function
# to use in the project to populate the submodule checkouts if needed.
###############################################################################
function(git_submodule_init path checkfile)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
find_program(GIT_EXECUTABLE git)
if (NOT GIT_EXECUTABLE)
message(FATAL_ERROR "Need to populate Git submodule, but unable to find git executable")
endif (NOT GIT_EXECUTABLE)
if (NOT GIT_SHALLOW_CLONE)
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${path}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else (NOT GIT_SHALLOW_CLONE)
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --recommend-shallow ${path}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif (NOT GIT_SHALLOW_CLONE)
endif (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
endfunction(git_submodule_init path)
###############################################################################
# There are a large number of external packages that may need to be built -
@@ -353,21 +340,105 @@ option(USE_OSPRAY "OSPRay rendering system" OFF)
option(USE_QT "Qt graphical toolkit support" ON)
option(USE_TCL "Tcl/Tk support" ON)
# An Xmin prefix selects a coherent toolkit build profile. Individual
# dependency logic applies the version-matched patches only when that
# dependency is selected for a local build.
set(BEXT_XMIN_ROOT "" CACHE PATH "Installed Xmin SDK used by bundled Tk and Qt")
if (BEXT_XMIN_ROOT)
if (NOT UNIX OR APPLE)
message(FATAL_ERROR "The bext Xmin profile currently requires Linux or BSD")
endif ()
if (NOT IS_DIRECTORY "${BEXT_XMIN_ROOT}")
message(FATAL_ERROR "BEXT_XMIN_ROOT is not an installed SDK: ${BEXT_XMIN_ROOT}")
endif ()
file(REAL_PATH "${BEXT_XMIN_ROOT}" BEXT_XMIN_ROOT)
set(BEXT_XMIN_ROOT "${BEXT_XMIN_ROOT}" CACHE PATH "Installed Xmin SDK used by bundled Tk and Qt" FORCE)
endif ()
# If we're using BRLCAD_COMPONENTS, the check is more nuanced.
# For bext, the BRLCAD_COMPONENTS list should be the expanded
# list from BRL-CAD's parent logic that fully populates the
# dependencies, not just the components directly specified by
# the user to BRL-CAD's configure.
function(cad_enable pname components)
if (DEFINED BRLCAD_COMPONENTS)
# In case the component list changed, make sure we're
# not using a cached result.
unset(ENABLE_${pname} CACHE)
unset(DISABLE_${pname} CACHE)
set(acomponents ${components})
# Look for a component in the list
foreach(c ${BRLCAD_COMPONENTS})
list(FIND acomponents ${c} LFIND)
if (NOT LFIND EQUAL -1)
if (ENABLE_ALL AND NOT DEFINED ENABLE_${pname})
set(ENABLE_${pname} ON PARENT_SCOPE)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_${pname})
set(DISABLE_${pname} OFF PARENT_SCOPE)
return()
endif (NOT LFIND EQUAL -1)
endforeach(c ${components})
# If we're a component build and this component
# isn't enabled, it's a definite off
set(ENABLE_${pname} OFF)
set(DISABLE_${pname} ON)
endif (DEFINED BRLCAD_COMPONENTS)
# Check for ENABLE_ALL
if (ENABLE_ALL AND NOT DEFINED ENABLE_${pname})
set(ENABLE_${pname} ON)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_${pname})
# Final decision
set(ENABLE_${pname} ${ENABLE_${pname}} PARENT_SCOPE)
set(DISABLE_${pname} ${DISABLE_${pname}} PARENT_SCOPE)
endfunction(cad_enable pname components)
# The enable-disable-find logic for a lot of these follows a
# pattern. Try to wrap that pattern up so we can more easily
# adjust it for multiple projects simultaneously.
macro(bext_enable pname)
string(TOUPPER "${pname}" upname)
#string(TOLOWER "${pname}" lpname)
if (ENABLE_ALL AND NOT DEFINED ENABLE_${upname})
set(ENABLE_${upname} ON)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_${upname})
if (NOT ENABLE_${upname} AND NOT DISABLE_${upname})
find_package(${pname})
if (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})
set(ENABLE_${upname} "ON" CACHE BOOL "Enable ${pname} build")
endif (NOT ${pname}_FOUND AND NOT DEFINED ENABLE_${upname})
endif (NOT ENABLE_${upname} AND NOT DISABLE_${upname})
set(ENABLE_${upname} "${ENABLE_${upname}}" CACHE BOOL "Enable ${pname} build")
endmacro(bext_enable pname)
# If configurations change after a build has been performed,
# we don't automatically scrub a pre-existing output directory
# to remove the files from the newly disabled components.
# Warn the user of this
set(STALE_INSTALL_WARN FALSE)
function(add_project pname)
cmake_parse_arguments(A "" "" "GROUPS" ${ARGN})
string(TOUPPER "${pname}" UPNAME)
string(REPLACE "-" "_" UPNAME "${UPNAME}")
if (NOT A_GROUPS)
add_subdirectory(${pname})
set(${UPNAME}_ADDED 1 PARENT_SCOPE)
return()
endif (NOT A_GROUPS)
set(is_added FALSE)
foreach(grp ${A_GROUPS})
if (USE_${grp})
add_subdirectory(${pname})
set(is_added TRUE)
set(${UPNAME}_ADDED 1 PARENT_SCOPE)
break()
endif (USE_${grp})
endforeach(grp ${A_GROUPS})
if (NOT is_added)
if (ENABLE_${UPNAME})
message("Disabling ${pname}")
set(STALE_INSTALL_WARN TRUE PARENT_SCOPE)
endif (ENABLE_${UPNAME})
execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/${pname})
unset(ENABLE_${UPNAME} CACHE)
endif (NOT is_added)
endfunction(add_project pname)
###############################################################################
# Python is a build-time dependency for both LLVM and ISPC. I think
@@ -396,460 +467,13 @@ if (USE_OSPRAY)
endif (USE_OSPRAY)
###############################################################################
# Applying patch files cross platform is a challenging problem due to the
# shortage of portable tools and issues with LF vs CRLF files - see
# https://gitlab.kitware.com/cmake/cmake/-/issues/16854 for more background on
# this. We need to address the patch build tool first thing, since any of the
# other ExternalProject_Add builds that follow may depend on it.
# There are a lot of individual projects, and their ordering is important. We
# store them as a separate file.
###############################################################################
add_project(patch)
include("${CMAKE_SOURCE_DIR}/dependencies.cmake")
###############################################################################
# Although we have bundled flex and bison programs, they can be problematic to
# build - they require working Autotools tool chains (except on Windows where
# we have winflexbison). We therefore attempt these builds only if we need to.
# This check must come after the patch subdirectory, since if we DO add_project
# the flexbison directory it will need the patch executable.
###############################################################################
if (USE_APPLESEED OR USE_OSPRAY)
if (ENABLE_ALL)
if (NOT DEFINED ENABLE_BISON)
set(ENABLE_BISON ON)
endif (NOT DEFINED ENABLE_BISON)
endif (ENABLE_ALL)
if (NOT ENABLE_FLEX)
find_package(FLEX 2.6)
if (NOT FLEX_FOUND AND NOT DEFINED ENABLE_FLEX)
set(ENABLE_FLEX ON)
endif (NOT FLEX_FOUND AND NOT DEFINED ENABLE_FLEX)
endif (NOT ENABLE_FLEX)
if (NOT ENABLE_BISON)
find_package(BISON 3.0)
if (NOT BISON_FOUND AND NOT DEFINED ENABLE_BISON)
set(ENABLE_BISON ON)
endif (NOT BISON_FOUND AND NOT DEFINED ENABLE_BISON)
endif (NOT ENABLE_BISON)
if (ENABLE_FLEX OR ENABLE_BISON)
add_project(flexbison GROUPS "APPLESEED;OSPRAY")
endif (ENABLE_FLEX OR ENABLE_BISON)
# Whether or not we actually added the subdirectories, let subsequent targets
# know we have handled the FLEX and BISON dependencies. Some will list these
# as potential build targets, since we may try to compile them, but as the
# default orientation for these is "build only if we have to" the find
# process itself needs to satisfy the check.
set(FLEX_ADDED 1)
set(BISON_ADDED 1)
endif (USE_APPLESEED OR USE_OSPRAY)
###############################################################################
# Build tools are used during compilation, but are not bundled or distributed
# with binary packages. We group these tools here for convenience. Unlike the
# build targets intended for distribution, these outputs are all
# targeted to the noinstall subdirectory.
###############################################################################
add_project(astyle GROUPS "BRLCAD")
add_project(lemon GROUPS "BRLCAD")
add_project(re2c GROUPS "BRLCAD")
add_project(perplex GROUPS "BRLCAD")
add_project(strclear GROUPS "BRLCAD")
# RPATH editing - LIEF has the core capabilities, and plief exposes them via
# a command line utility with patchelf compatible options, so we can drop
# either patchelf or plief into our upstream workflows.
add_project(lief GROUPS "BRLCAD")
add_project(plief GROUPS "BRLCAD")
###############################################################################
# Build logic is broken out per-library, but the ordering is important. Some
# libraries will depend on others listed here (for example, we want openNURBS
# to use our bundled zlib if it is enabled.) Developers adding, reordering or
# removing dependencies here need to make sure they are aware of impact they
# may be having on other external projects in other files.
###############################################################################
# zlib compression/decompression library
# https://zlib.net
add_project(zlib GROUPS "APPLESEED;BRLCAD;OSPRAY;TCL")
# LLVM - code generation support, add it as EARLY as possible
# https://llvm.org/
add_project(llvm GROUPS "APPLESEED;OSPRAY")
# zstd - fast lossless compression library
# https://github.com/facebook/zstd
add_project(zstd GROUPS "APPLESEED;OSPRAY")
# minizip-ng - zip manipulation library written in C
# https://github.com/zlib-ng/minizip-ng
add_project(minizip-ng GROUPS "APPLESEED")
# LZ4 - lossless compression algorithm
# https://github.com/lz4/lz4
add_project(lz4 GROUPS "APPLESEED")
# libdeflate fast, whole-buffer DEFLATE-based compression
# https://github.com/ebiggers/libdeflate
add_project(deflate GROUPS "APPLESEED")
# fmt - formatting library providing an alternative to C++ iostreams
# https://github.com/fmtlib/fmt
add_project(fmt GROUPS "APPLESEED")
# yaml-cpp - YAML parser and emitter in C++ matching the YAML 1.2 spec
# https://github.com/jbeder/yaml-cpp
add_project(yaml-cpp GROUPS "APPLESEED")
# pystring - collection of C++ functions which match the interface and behavior
# of python's string class methods
# https://github.com/imageworks/pystring
add_project(pystring GROUPS "APPLESEED")
# Henry Spencer's regular expression matching library
# https://github.com/BRL-CAD/regex
add_project(regex GROUPS "BRLCAD")
# expat - library for parsing XML 1.0 Fourth Edition
# https://github.com/libexpat/libexpat
add_project(expat GROUPS "APPLESEED")
# International Components for Unicode
# https://github.com/unicode-org/icu
add_project(icu GROUPS "APPLESEED")
# Xerces-C++ - a validating XML parser
# https://xerces.apache.org/xerces-c/
add_project(xerces-c GROUPS "APPLESEED")
# Boost - C++ libraries
# https://www.boost.org
# https://github.com/boostorg/boost
add_project(boost GROUPS "APPLESEED")
# netpbm library - support for pnm,ppm,pbm, etc. image files
# http://netpbm.sourceforge.net/
add_project(netpbm GROUPS "BRLCAD")
# libjpeg-turbo - JPEG image codec
# https://github.com/libjpeg-turbo/libjpeg-turbo
add_project(jpeg GROUPS "APPLESEED;BRLCAD;GDAL")
# libpng - Portable Network Graphics image file support
# http://www.libpng.org/pub/png/libpng.html
add_project(png GROUPS "APPLESEED;BRLCAD;TCL")
# libtiff - Tag Image File Format (TIFF) support
# https://libtiff.gitlab.io/libtiff/
# https://gitlab.com/libtiff/libtiff
add_project(tiff GROUPS "APPLESEED;GDAL")
# OpenEXR - EXR image storage format
# https://openexr.com/
# https://github.com/AcademySoftwareFoundation/openexr
add_project(openexr GROUPS "APPLESEED")
# OpenColorIO - color management
# https://opencolorio.org
# https://github.com/AcademySoftwareFoundation/OpenColorIO
# Note - the VFX Reference Platform (https://vfxplatform.com/)
# is a useful reference for what versions to expect elements
# of the rendering pipeline software stack to use/require
add_project(opencolorio GROUPS "APPLESEED")
# OpenImageIO - reading and writing images, aimed at VFX studios
# https://github.com/OpenImageIO/oiio
add_project(openimageio GROUPS "APPLESEED")
# ncurses - text-based user interfaces library
# https://invisible-island.net/ncurses/
add_project(ncurses GROUPS "OSPRAY")
# Lightning Memory-Mapped Database
# https://github.com/LMDB/lmdb
add_project(lmdb GROUPS "BRLCAD")
# Eigen - linear algebra library
# https://eigen.tuxfamily.org
add_project(eigen GROUPS "BRLCAD;APPLESEED")
# oneTBB - Threading Building Blocks
# https://github.com/oneapi-src/oneTBB
add_project(onetbb GROUPS "APPLESEED;OSPRAY;BRLCAD")
# rkcommon - C++ infrastructure and CMake utilities
# https://github.com/ospray/rkcommon
add_project(rkcommon GROUPS "OSPRAY")
# ISPC - Implicit SPMD Program Compiler
# https://ispc.github.io
# https://github.com/ispc/ispc
add_project(ispc GROUPS "OSPRAY")
# STEPcode - support for reading and writing STEP files
# https://github.com/stepcode/stepcode
add_project(stepcode GROUPS "BRLCAD_EXTRA")
# SQLITE3 - embeddable database
# https://www.sqlite.org
add_project(sqlite3 GROUPS "GDAL")
# PROJ - generic coordinate transformation
# https://proj.org
add_project(proj GROUPS "GDAL")
# GDAL - translator library for raster and vector geospatial data formats
# https://gdal.org
add_project(gdal GROUPS "GDAL")
# OpenVDB - storage and manipulation of sparse volumetric data discretized on
# three-dimensional grids
# https://github.com/AcademySoftwareFoundation/openvdb
add_project(openvdb GROUPS "BRLCAD_EXTRA")
# tinygltf - tiny glTF library(loader/saver)
# https://github.com/syoyo/tinygltf
add_project(tinygltf GROUPS "BRLCAD")
# pugixml - a light-weight C++ XML processing library
# https://pugixml.org/
add_project(pugixml GROUPS "BRLCAD;APPLESEED")
# Open Asset Import Library - library for supporting I/O for a number of
# Geometry file formats
# https://github.com/assimp/assimp
add_project(assetimport GROUPS "BRLCAD")
# OpenCV - Open Source Computer Vision Library
# http://opencv.org
add_project(opencv GROUPS "BRLCAD_EXTRA")
# Clipper2 - A Polygon Clipping and Offsetting library
# https://github.com/AngusJohnson/Clipper2
add_project(clipper2 GROUPS "BRLCAD")
# GeometricTools - a collection of geometry algorithms.
# https://github.com/davideberly/GeometricTools
add_project(gte GROUPS "BRLCAD")
# Adaptive Multigrid Solvers - Poisson Surface Reconstruction code.
# https://github.com/mkazhdan/PoissonRecon
add_project(poissonrecon GROUPS "BRLCAD")
# mmesh - mesh decimation and processing library.
# https://github.com/BRL-CAD/mmesh
add_project(mmesh GROUPS "BRLCAD")
# Manifold Library - used for performing boolean ops on meshes
# https://github.com/elalish/manifold
add_project(manifold GROUPS "BRLCAD")
# openNURBS - Non-Uniform Rational BSpline library
# https://github.com/mcneel/opennurbs
add_project(opennurbs GROUPS "BRLCAD")
# OSMesa - Off Screen Mesa Rendering Library
# https://github.com/starseeker/osmesa
add_project(osmesa GROUPS "BRLCAD")
# Bullet3 - collision detection/multi-physics simulation library
# https://github.com/bulletphysics/bullet3
add_project(bullet GROUPS "BRLCAD_EXTRA")
# Open Shading Language (OSL) - language for programmable shading
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#
# TODO - need to check if https://github.com/lexxmark/winflexbison will
# work for Windows for OSL's usage of flex/bison...
add_project(osl GROUPS "APPLESEED")
# Embree raytracing kernel
# https://github.com/embree/embree
add_project(embree GROUPS "APPLESEED;OSPRAY")
# TCL - scripting language. For Tcl/Tk builds we want
# static lib building on so we get the stub libraries.
# https://www.tcl.tk
set(TCL_ENABLE_TK ON CACHE BOOL "enable tk")
# Tcl 8.6.18 bundles Itcl 4.3.7. Itk remains a separate upstream project.
# Keep the compatibility floors distinct from the bundled versions so a newer
# system installation can be used without changing the versions we ship.
set(BEXT_ITCL_MIN_VERSION "4.3.0")
set(BEXT_ITCL_BUNDLED_VERSION "4.3.7")
set(BEXT_ITCL_BUNDLED_SOURCE_DIR
"${CMAKE_SOURCE_DIR}/tcl/tcl/pkgs/itcl${BEXT_ITCL_BUNDLED_VERSION}"
)
set(BEXT_ITK_MIN_VERSION "4.2.3")
set(BEXT_ITK_BUNDLED_VERSION "4.2.7")
set(BEXT_TK_COMPONENTS "archer;mged;bwish;rtwizard;brlman")
add_project(tcl GROUPS "TCL")
add_project(tk GROUPS "TCL")
add_project(itk GROUPS "TCL")
add_project(iwidgets GROUPS "TCL")
add_project(tkhtml GROUPS "TCL")
add_project(tktable GROUPS "TCL")
# Qt - cross-platform user interface/application development toolkit
# https://download.qt.io/archive/qt
add_project(qt GROUPS "QT")
# Appleseed - global illumination rendering engine
# https://github.com/appleseedhq/appleseed
add_project(appleseed GROUPS "APPLESEED")
# Open Image Denoise - AI denoiser used by OSPRay's denoiser module
# https://github.com/RenderKit/oidn
add_project(oidn GROUPS "OSPRAY")
# OSPRay - ray tracing engine
# https://github.com/ospray/OSPRay
add_project(ospray GROUPS "OSPRAY")
###############################################################################
# Finalize the bundled output after all external projects have installed.
# BRL-CAD can then consume the manifest without repeating file classification
# during every configure pass.
###############################################################################
set(BEXT_STRCLEAR_EXPECTED
"${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}/strclear${CMAKE_EXECUTABLE_SUFFIX}")
if (TARGET STRCLEAR_BLD)
set(BEXT_STRCLEAR_EXECUTABLE "${BEXT_STRCLEAR_EXPECTED}")
else ()
find_program(BEXT_STRCLEAR_EXECUTABLE NAMES strclear HINTS "${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}")
endif ()
if (NOT BEXT_STRCLEAR_EXECUTABLE)
message(FATAL_ERROR "bext finalization requires strclear")
endif ()
set(BEXT_PLIEF_EXPECTED
"${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}/plief${CMAKE_EXECUTABLE_SUFFIX}")
if (TARGET PLIEF_BLD)
set(BEXT_PLIEF_EXECUTABLE "${BEXT_PLIEF_EXPECTED}")
else ()
find_program(BEXT_PLIEF_EXECUTABLE NAMES plief patchelf HINTS "${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}")
endif ()
set(BEXT_INSTALL_MANIFEST "${CMAKE_INSTALL_PREFIX}/bext-install-manifest.json")
set(BEXT_FINALIZE_SCRIPT "${CMAKE_SOURCE_DIR}/CMake/FinalizeInstall.cmake")
get_property(BEXT_INSTALL_TARGETS GLOBAL PROPERTY BEXT_INSTALL_TARGETS)
list(REMOVE_DUPLICATES BEXT_INSTALL_TARGETS)
add_custom_target(bext_finalize ALL
COMMAND ${CMAKE_COMMAND}
-DBEXT_INSTALL_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DBEXT_MANIFEST=${BEXT_INSTALL_MANIFEST}
-DBEXT_SOURCE_ROOT=${CMAKE_SOURCE_DIR}
-DBEXT_BINARY_ROOT=${CMAKE_BINARY_DIR}
-DBEXT_NOINSTALL_ROOT=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
-DBEXT_STRCLEAR=${BEXT_STRCLEAR_EXECUTABLE}
-DBEXT_PLIEF=${BEXT_PLIEF_EXECUTABLE}
-DBEXT_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-P ${BEXT_FINALIZE_SCRIPT}
DEPENDS ${BEXT_INSTALL_TARGETS}
VERBATIM
)
if (TARGET STRCLEAR_BLD-install)
add_dependencies(bext_finalize STRCLEAR_BLD-install)
endif ()
if (TARGET PLIEF_BLD-install)
add_dependencies(bext_finalize PLIEF_BLD-install)
endif ()
###############################################################################
# Teach the built-in clean target how to reset generated ExternalProject state
# while preserving the top-level configure metadata and install trees.
###############################################################################
register_external_project_clean_targets()
###############################################################################
# Generate the dependency graph from the existing build metadata. The DOT file
# is always emitted during the normal build, and rendered forms are generated
# too when Graphviz's dot tool is available.
###############################################################################
find_program(GRAPHVIZ_DOT_EXECUTABLE dot)
set(BEXT_GRAPH_OUTPUTS
"${CMAKE_BINARY_DIR}/bext.dot"
"${CMAKE_BINARY_DIR}/bext.svg"
)
if (GRAPHVIZ_DOT_EXECUTABLE)
list(APPEND BEXT_GRAPH_OUTPUTS
"${CMAKE_BINARY_DIR}/bext.png"
"${CMAKE_BINARY_DIR}/bext.pdf"
)
endif ()
set(BEXT_GRAPH_DEPENDS
"${CMAKE_SOURCE_DIR}/CMake/GenerateDepsGraph.cmake"
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/.gitmodules"
)
foreach(graph_input ${BEXT_GRAPH_PROJECT_FILES})
list(APPEND BEXT_GRAPH_DEPENDS "${CMAKE_SOURCE_DIR}/${graph_input}")
endforeach()
add_custom_command(
OUTPUT ${BEXT_GRAPH_OUTPUTS}
COMMAND ${CMAKE_COMMAND}
-DBEXT_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBEXT_BINARY_DIR=${CMAKE_BINARY_DIR}
-DGRAPHVIZ_DOT_EXECUTABLE=${GRAPHVIZ_DOT_EXECUTABLE}
-DBEXT_RENDER_png=$<BOOL:${GRAPHVIZ_DOT_EXECUTABLE}>
-DBEXT_RENDER_pdf=$<BOOL:${GRAPHVIZ_DOT_EXECUTABLE}>
-P ${CMAKE_SOURCE_DIR}/CMake/GenerateDepsGraph.cmake
DEPENDS ${BEXT_GRAPH_DEPENDS}
VERBATIM
)
add_custom_target(deps_graph ALL DEPENDS ${BEXT_GRAPH_OUTPUTS})
# Validate the derived dependency inventory and ensure the checked-in reference
# table matches it. Updating documentation is explicit because normal builds
# must not modify the source tree.
add_custom_target(check_dependency_metadata
COMMAND ${CMAKE_COMMAND}
-DBEXT_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBEXT_DOC_MODE=CHECK
-P ${CMAKE_SOURCE_DIR}/CMake/GenerateDependencyDocs.cmake
VERBATIM
)
add_custom_target(update_dependency_docs
COMMAND ${CMAKE_COMMAND}
-DBEXT_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBEXT_DOC_MODE=WRITE
-P ${CMAKE_SOURCE_DIR}/CMake/GenerateDependencyDocs.cmake
VERBATIM
)
set(BEXT_SBOM_OUTPUT "${CMAKE_BINARY_DIR}/bext.spdx.json")
add_custom_command(
OUTPUT "${BEXT_SBOM_OUTPUT}"
COMMAND ${CMAKE_COMMAND}
-DBEXT_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DBEXT_SBOM_OUTPUT=${BEXT_SBOM_OUTPUT}
-P ${CMAKE_SOURCE_DIR}/CMake/GenerateSbom.cmake
DEPENDS
${CMAKE_SOURCE_DIR}/CMake/BextDependencyInventory.cmake
${CMAKE_SOURCE_DIR}/CMake/GenerateSbom.cmake
${CMAKE_SOURCE_DIR}/CMakeLists.txt
${CMAKE_SOURCE_DIR}/.gitmodules
${BEXT_GRAPH_DEPENDS}
VERBATIM
)
add_custom_target(sbom DEPENDS "${BEXT_SBOM_OUTPUT}")
add_custom_target(supply_chain_check
DEPENDS check_dependency_metadata sbom
)
# Now that we have the dependencies specified, finish the dependencies DOT file
file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\n}\n")
###############################################################################
# Warn the user if the settings changed in a way the indicate there is a risk
@@ -863,30 +487,17 @@ if (EXISTS "${CMAKE_BUNDLE_INSTALL_PREFIX}" AND STALE_INSTALL_WARN)
endif (OFILES_BIN OR OFILES_LIB)
endif (EXISTS "${CMAKE_BUNDLE_INSTALL_PREFIX}" AND STALE_INSTALL_WARN)
bext_print_configure_summary()
###############################################################################
# On Windows, if we get dlls built for the wrong configuration it can cause
# problems. Define a utility target to check
###############################################################################
add_custom_target(dll_typecheck
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=\"$<CONFIG>\" -DDLL_DIR=\"${CMAKE_INSTALL_PREFIX}/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/DllTypeCheck.cmake)
###############################################################################
# Check that Windows LoadLibrary call can succeed with our dll outputs
###############################################################################
if (WIN32)
add_executable(lltest ${CMAKE_SOURCE_DIR}/CMake/LoadLibraryTest.cpp)
add_custom_target(dll_loadcheck
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=\"$<CONFIG>\" -DLEXEC=\"$<TARGET_FILE:lltest>\" -DDLL_DIR=\"${CMAKE_INSTALL_PREFIX}/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/LoadLibraryCheck.cmake
DEPENDS lltest
)
endif (WIN32)
add_custom_target(dllcheck
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=\"$<CONFIG>\" -DDLL_DIR=\"${CMAKE_INSTALL_PREFIX}/bext_output/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/DllTypeCheck.cmake)
###############################################################################
# Report where we will be putting our output
###############################################################################
message(STATUS "Output directory: ${CMAKE_INSTALL_PREFIX}")
message("Output directory: ${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}")
# Local Variables:
# tab-width: 8
@@ -894,3 +505,4 @@ message(STATUS "Output directory: ${CMAKE_INSTALL_PREFIX}")
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-165
View File
@@ -1,165 +0,0 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "layout",
"hidden": true,
"description": "Output layout for presets whose name already carries the config (e.g. auto/Release, auto/Debug): build/<profile>/<Config>. Release and Debug trees sit side by side so both configs can be kept and consumed at once.",
"binaryDir": "${sourceDir}/build/${presetName}"
},
{
"name": "layout-implicit-release",
"hidden": true,
"description": "Output layout for the unqualified convenience aliases (e.g. --preset=auto): build/<profile>/Release. Resolves to the same tree as <profile>/Release.",
"binaryDir": "${sourceDir}/build/${presetName}/Release"
},
{
"name": "type-release",
"hidden": true,
"description": "Single-config Release build type (matches a BRL-CAD Release build).",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "type-debug",
"hidden": true,
"description": "Single-config Debug build type (matches a BRL-CAD Debug build).",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "profile-auto",
"hidden": true,
"description": "Standard BRL-CAD-oriented profile. Use suitable system packages when found and build local copies only when needed.",
"cacheVariables": {
"USE_APPLESEED": "OFF",
"USE_BRLCAD": "ON",
"USE_BRLCAD_EXTRA": "ON",
"USE_GDAL": "ON",
"USE_OSPRAY": "OFF",
"USE_QT": "ON",
"USE_TCL": "ON"
}
},
{
"name": "profile-bundled",
"hidden": true,
"description": "Standard BRL-CAD-oriented profile with bundled/local builds preferred for all active dependency groups.",
"cacheVariables": {
"ENABLE_ALL": "ON",
"USE_APPLESEED": "OFF",
"USE_BRLCAD": "ON",
"USE_BRLCAD_EXTRA": "ON",
"USE_GDAL": "ON",
"USE_OSPRAY": "OFF",
"USE_QT": "ON",
"USE_TCL": "ON"
}
},
{
"name": "profile-minimal",
"hidden": true,
"description": "Core BRL-CAD profile without extras, GDAL, Qt, Tcl/Tk, Appleseed, or OSPRay.",
"cacheVariables": {
"USE_APPLESEED": "OFF",
"USE_BRLCAD": "ON",
"USE_BRLCAD_EXTRA": "OFF",
"USE_GDAL": "OFF",
"USE_OSPRAY": "OFF",
"USE_QT": "OFF",
"USE_TCL": "OFF"
}
},
{
"name": "profile-everything",
"hidden": true,
"description": "Enable all current dependency groups and prefer bundled/local builds for all of them.",
"cacheVariables": {
"ENABLE_ALL": "ON",
"USE_APPLESEED": "ON",
"USE_BRLCAD": "ON",
"USE_BRLCAD_EXTRA": "ON",
"USE_GDAL": "ON",
"USE_OSPRAY": "ON",
"USE_QT": "ON",
"USE_TCL": "ON",
"CMAKE_POLICY_VERSION_MINIMUM": "3.5"
}
},
{
"name": "auto",
"displayName": "Auto (Release)",
"description": "Convenience alias for auto/Release.",
"inherits": ["layout-implicit-release", "profile-auto", "type-release"]
},
{
"name": "auto/Release",
"displayName": "Auto (Release)",
"inherits": ["layout", "profile-auto", "type-release"]
},
{
"name": "auto/Debug",
"displayName": "Auto (Debug)",
"inherits": ["layout", "profile-auto", "type-debug"]
},
{
"name": "bundled",
"displayName": "Bundled (Release)",
"description": "Convenience alias for bundled/Release.",
"inherits": ["layout-implicit-release", "profile-bundled", "type-release"]
},
{
"name": "bundled/Release",
"displayName": "Bundled (Release)",
"inherits": ["layout", "profile-bundled", "type-release"]
},
{
"name": "bundled/Debug",
"displayName": "Bundled (Debug)",
"inherits": ["layout", "profile-bundled", "type-debug"]
},
{
"name": "minimal",
"displayName": "Minimal (Release)",
"description": "Convenience alias for minimal/Release.",
"inherits": ["layout-implicit-release", "profile-minimal", "type-release"]
},
{
"name": "minimal/Release",
"displayName": "Minimal (Release)",
"inherits": ["layout", "profile-minimal", "type-release"]
},
{
"name": "minimal/Debug",
"displayName": "Minimal (Debug)",
"inherits": ["layout", "profile-minimal", "type-debug"]
},
{
"name": "everything",
"displayName": "Everything (Release)",
"description": "Convenience alias for everything/Release.",
"inherits": ["layout-implicit-release", "profile-everything", "type-release"]
},
{
"name": "everything/Release",
"displayName": "Everything (Release)",
"inherits": ["layout", "profile-everything", "type-release"]
},
{
"name": "everything/Debug",
"displayName": "Everything (Debug)",
"inherits": ["layout", "profile-everything", "type-debug"]
}
]
}
-171
View File
@@ -1,171 +0,0 @@
# bext - Dependency Reference
This file is a package map for `bext`. It shows which `USE_*` groups can bring
each project into scope and whether its outputs land in `install/` or
`noinstall/`.
A package listed here may still use a system installation instead of building a
local copy unless `ENABLE_ALL=ON` or `ENABLE_<pkg>=ON` is used.
For some BRL-CAD-related packages, `BRLCAD_COMPONENTS` can narrow the final
selection further.
# Output types
* `install` - bundled output intended for downstream use
* `noinstall` - build-only tool or compile-time-only asset
# Projects
<!-- BEGIN GENERATED PROJECT TABLE -->
<!-- Generated by CMake/GenerateDependencyDocs.cmake; do not edit this block. -->
| Project | `USE_*` group(s) | Output | Dependencies | Source |
| --- | --- | --- | --- | --- |
| `appleseed` | `USE_APPLESEED` | `install` | `boost`, `eigen`, `embree`, `jpeg`, `llvm`, `lz4`, `onetbb`, `opencolorio`, `openexr`, `openimageio`, `osl`, `patch`, `png`, `tiff`, `xerces-c`, `zlib` | [repository](https://github.com/BRL-CAD/appleseed) |
| `assetimport` | `USE_BRLCAD` | `install` | `patch`, `pugixml`, `zlib` | [repository](https://github.com/BRL-CAD/assimp) |
| `astyle` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/astyle) |
| `boost` | `USE_APPLESEED` | `install` | `icu`, `patch`, `zlib`, `zstd` | [repository](https://github.com/BRL-CAD/boost) |
| `bullet` | `USE_BRLCAD_EXTRA` | `install` | `patch` | [repository](https://github.com/BRL-CAD/bullet3.git) |
| `clipper2` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/Clipper2.git) |
| `deflate` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/libdeflate) |
| `eigen` | `USE_BRLCAD`, `USE_APPLESEED` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/eigen) |
| `embree` | `USE_APPLESEED`, `USE_OSPRAY` | `install` | `boost`, `onetbb`, `patch`, `zlib` | [repository](https://github.com/BRL-CAD/embree) |
| `expat` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/libexpat) |
| `flexbison` | `USE_APPLESEED`, `USE_OSPRAY` | `noinstall` | — | [repository](https://github.com/BRL-CAD/winflexbison) |
| `fmt` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/fmt) |
| `gdal` | `USE_GDAL` | `install` | `patch`, `png`, `proj`, `sqlite3`, `tiff`, `zlib` | [repository](https://github.com/BRL-CAD/gdal) |
| `gte` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/GeometricTools) |
| `icu` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/icu) |
| `ispc` | `USE_OSPRAY` | `install` | `bison`, `flex`, `patch`, `llvm`, `ncurses`, `zlib` | [repository](https://github.com/BRL-CAD/ispc) |
| `itk` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/itk) |
| `iwidgets` | `USE_TCL` | `install` | `patch`, `itk` | [repository](https://github.com/BRL-CAD/iwidgets) |
| `jpeg` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_GDAL` | `install` | `patch` | [repository](https://github.com/BRL-CAD/libjpeg-turbo) |
| `lemon` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/lemon) |
| `lief` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/LIEF) |
| `llvm` | `USE_APPLESEED`, `USE_OSPRAY` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/llvm-project) |
| `lmdb` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/lmdb) |
| `lz4` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/lz4) |
| `manifold` | `USE_BRLCAD` | `install` | `patch`, `clipper2` | [repository](https://github.com/BRL-CAD/manifold.git) |
| `minizip-ng` | `USE_APPLESEED` | `install` | `patch`, `zlib`, `zstd` | [repository](https://github.com/BRL-CAD/minizip-ng) |
| `mmesh` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/mmesh.git) |
| `ncurses` | `USE_OSPRAY` | `install` | `patch` | [repository](https://github.com/BRL-CAD/ncurses) |
| `netpbm` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/netpbm) |
| `oidn` | `USE_OSPRAY` | `install` | `ispc`, `onetbb` | [repository](https://github.com/BRL-CAD/oidn) |
| `onetbb` | `USE_APPLESEED`, `USE_OSPRAY`, `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/oneTBB) |
| `opencolorio` | `USE_APPLESEED` | `install` | `expat`, `minizip-ng`, `openexr`, `patch`, `pystring`, `yaml-cpp`, `zlib`, `zstd` | [repository](https://github.com/BRL-CAD/OpenColorIO) |
| `opencv` | `USE_BRLCAD_EXTRA` | `install` | `patch`, `png`, `zlib` | [repository](https://github.com/BRL-CAD/opencv) |
| `openexr` | `USE_APPLESEED` | `install` | `deflate`, `patch` | [repository](https://github.com/BRL-CAD/openexr) |
| `openimageio` | `USE_APPLESEED` | `install` | `boost`, `fmt`, `jpeg`, `opencolorio`, `openexr`, `patch`, `png`, `tiff`, `zlib` | [repository](https://github.com/BRL-CAD/oiio) |
| `opennurbs` | `USE_BRLCAD` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/opennurbs) |
| `openvdb` | `USE_BRLCAD_EXTRA` | `install` | `onetbb`, `patch`, `zlib` | [repository](https://github.com/BRL-CAD/openvdb) |
| `osl` | `USE_APPLESEED` | `install` | `bison`, `boost`, `flex`, `llvm`, `openexr`, `openimageio`, `patch`, `pugixml`, `zlib` | [repository](https://github.com/BRL-CAD/OpenShadingLanguage) |
| `osmesa` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/osmesa) |
| `ospray` | `USE_OSPRAY` | `install` | `embree`, `ispc`, `oidn`, `onetbb`, `patch`, `rkcommon` | [repository](https://github.com/BRL-CAD/ospray) |
| `patch` | always considered | `noinstall` | — | [repository](https://github.com/BRL-CAD/patch) |
| `perplex` | `USE_BRLCAD` | `noinstall` | `patch`, `lemon`, `re2c` | [repository](https://github.com/BRL-CAD/perplex) |
| `plief` | `USE_BRLCAD` | `noinstall` | `lief`, `patch` | [repository](https://github.com/BRL-CAD/plief) |
| `png` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_TCL` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/libpng) |
| `poissonrecon` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/PoissonRecon) |
| `proj` | `USE_GDAL` | `install` | `patch`, `sqlite3` | [repository](https://github.com/BRL-CAD/PROJ) |
| `pugixml` | `USE_BRLCAD`, `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/pugixml) |
| `pystring` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/pystring) |
| `qt` | `USE_QT` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/qt) |
| `re2c` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/re2c) |
| `regex` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/regex) |
| `rkcommon` | `USE_OSPRAY` | `install` | `onetbb`, `patch` | [repository](https://github.com/BRL-CAD/rkcommon) |
| `sqlite3` | `USE_GDAL` | `install` | `patch` | [repository](https://github.com/BRL-CAD/sqlite3.git) |
| `stepcode` | `USE_BRLCAD_EXTRA` | `install` | `lemon`, `patch`, `perplex`, `re2c` | [repository](https://github.com/BRL-CAD/stepcode) |
| `strclear` | `USE_BRLCAD` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/strclear) |
| `tcl` | `USE_TCL` | `install` | `patch`, `zlib` | [repository](https://github.com/BRL-CAD/tcl.git) |
| `tiff` | `USE_APPLESEED`, `USE_GDAL` | `install` | `jpeg`, `patch`, `zlib` | [repository](https://github.com/BRL-CAD/libtiff) |
| `tinygltf` | `USE_BRLCAD` | `install` | `patch` | [repository](https://github.com/BRL-CAD/tinygltf.git) |
| `tk` | `USE_TCL` | `install` | `patch`, `tcl` | [repository](https://github.com/BRL-CAD/tk) |
| `tkhtml` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/tkhtml) |
| `tktable` | `USE_TCL` | `install` | `patch`, `tcl`, `tk` | [repository](https://github.com/BRL-CAD/tktable) |
| `xerces-c` | `USE_APPLESEED` | `install` | `icu`, `patch` | [repository](https://github.com/BRL-CAD/xerces-c) |
| `yaml-cpp` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/yaml-cpp) |
| `zlib` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_OSPRAY`, `USE_TCL` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zlib) |
| `zstd` | `USE_APPLESEED`, `USE_OSPRAY` | `install` | `patch` | [repository](https://github.com/BRL-CAD/zstd) |
<!-- END GENERATED PROJECT TABLE -->
# Notes
* `install/` versus `noinstall/` is about downstream use, not importance.
Several `noinstall` entries are essential build helpers.
* `ENABLE_ALL=ON` does not add `USE_APPLESEED` or `USE_OSPRAY` by itself.
Those groups still need to be enabled explicitly.
* A few source trees, such as `patchelf`, are present in the repository but are
not currently added by the top-level build.
* Run the `update_dependency_docs` target after changing project groups,
dependency edges, output locations, or submodule sources. CI runs
`check_dependency_metadata` to detect drift, unknown edges, cycles, missing
source pins, and missing bundled-output license installation.
* The `sbom` target writes an SPDX 2.3 JSON inventory to `bext.spdx.json` in
the build directory. `supply_chain_check` validates metadata and produces
the SBOM together.
# Adding a dependency
For maintainers, the high-level workflow for adding a new dependency to `bext`
is:
1. Decide whether the dependency belongs in `bext` at all.
Only add repositories that are expected to support live BRL-CAD or related
build features. Exploratory work that may be discarded should stay in a branch
until the dependency choice is settled.
2. Prepare the BRL-CAD-hosted source repository first.
`bext` generally points at BRL-CAD-managed copies of upstream sources rather
than upstream repositories directly. Before wiring anything into `bext`, make
sure the BRL-CAD copy has the intended `RELEASE` content, submodules handled as
needed, and license files available for installation.
3. Choose the `USE_*` group or groups that should bring the dependency into
scope.
This controls when the dependency is considered at all. If none of the
existing groups fit, add a new one only if it represents a real build profile
that users can reason about.
4. Add the new top-level directory and git submodule.
The directory should usually contain:
* the upstream source as a git submodule
* a managing `CMakeLists.txt`
* a `<name>.deps` file listing other `bext` projects it depends on
* any patch files or helper resources needed by the build
After `git submodule add`, update `.gitmodules` to include `ignore = dirty` for
the new entry, consistent with the existing submodules.
5. Add the build logic.
Follow the patterns used by nearby dependencies:
* use `git_submodule_init(...)`
* use `RegisterDeps(...)`
* decide whether the outputs belong in `install` or `noinstall`
* copy license files into `${DOC_LICENSE_DIR}`
* use `bext_enable(...)`, `cad_enable(...)`, or custom logic as needed to
respect system detection and BRL-CAD component selection
6. Register the dependency in the top-level build.
Add `add_project(...)` to the top-level `CMakeLists.txt` in dependency order so
that any prerequisites appear earlier in the file.
7. Update the docs.
At minimum:
* add the project to this file
* update `INSTALL.md` if the new dependency adds system prerequisites
* update `NOTES.md` if the dependency needs special submodule or maintainer
handling
8. Test the intended selection behavior and build flow.
Check at least:
* the default configure path for the relevant `USE_*` groups
* `-DENABLE_ALL=ON`
* any new or changed prerequisite detection
* downstream use if the outputs are intended for BRL-CAD bundling
9. Only after the dependency is working, commit the new submodule reference and
the `bext` integration together.
That keeps the repository history aligned with a working configuration rather
than a partial experiment.
For lower-level git and submodule procedures, see [NOTES.md](NOTES.md).
+22 -138
View File
@@ -1,167 +1,51 @@
# bext - Installation Notes
# bext - Installation
This file covers machine setup and source checkout details. For the main build
flow and option behavior, see [README.md](README.md).
# Base requirements
All builds need:
* Git
* CMake 3.19 or newer
* A modern C compiler
* A modern C++ compiler
Additional requirements depend on the enabled stacks:
* `USE_APPLESEED` and `USE_OSPRAY` will use a system `flex` and
`bison` if they are already installed. If they are not and `bext`
needs to build them locally on non-Windows platforms, a working
Autotools stack is also needed.
* `USE_QT`, `USE_APPLESEED`, or `USE_OSPRAY` need Python 3 available
to the build.
* `USE_OSPRAY` needs `m4`.
# Source checkout options
Default clone:
```sh
git clone https://github.com/BRL-CAD/bext
```
This is usually the best starting point. `bext` will populate submodules on
demand during configure.
Recursive clone:
```sh
git clone --recursive https://github.com/BRL-CAD/bext
```
Use this if you want all submodule content fetched up front, or if you expect
to configure and build without network access later.
Shallow clone options:
* `cmake ../bext -DGIT_SHALLOW_CLONE=ON ...`
* `git clone --recursive --depth=1 https://github.com/BRL-CAD/bext`
Shallow clones are fine for compile-only use, but they are not recommended for
development or for submodule update work.
# Alternate repositories and offline mirrors
`BEXT_REPOSITORY_ROOT` selects the directory containing the dependency
repositories. It defaults to `https://github.com/BRL-CAD`. For another host,
specify the URL of the equivalent repository directory:
```sh
cmake --preset auto -DBEXT_REPOSITORY_ROOT=https://git.example.org/brlcad
```
For offline use, the directory can contain bare Git mirrors such as
`bext.git`, `astyle.git`, and `libpng.git`, as produced by BRL-CAD's
`sh/mirror_repos.sh`. Clone bext first, then let CMake populate the required
submodules:
```sh
git clone /path/to/mirror/BRL-CAD/bext.git
cd bext
cmake --preset auto -DBEXT_REPOSITORY_ROOT=/path/to/mirror/BRL-CAD
```
The root points directly to the repositories; CMake does not append `BRL-CAD`.
Local paths and `file://` URLs are supported, as are remote Git URLs including
`ssh://` URLs. Relative local paths are resolved against the bext source
directory. Quote the `-D` argument if the path contains spaces. The setting
is saved in the configure cache.
The optional bootstrap script accepts the same setting:
```sh
cmake -DPROFILE=auto -DBEXT_REPOSITORY_ROOT=/path/to/mirror/BRL-CAD \
-P CMake/BextBootstrap.cmake
```
Bootstrap runs separately from configure, so pass the setting to both commands
if you use both workflows. `LIST_ONLY=ON` previews bootstrap selection without
fetching.
CMake redirects `https://github.com/BRL-CAD/` URLs using command-scoped Git
configuration, including recursive submodule operations. Local roots enable
file transport and forbid network transport for those Git operations. They
also disable shallow-clone recommendations, even with `GIT_SHALLOW_CLONE=ON`,
so full mirrors can supply older pinned commits. The mirrors must contain all
required commits. Recursive submodules outside that URL prefix need their
own Git URL mappings and local mirrors; otherwise initialization fails.
The override does not change `.gitmodules` or install persistent Git rewrite
settings. To return CMake-driven updates to GitHub, set
`-DBEXT_REPOSITORY_ROOT=https://github.com/BRL-CAD`. Direct Git commands use
their normal configuration. This setting controls submodule fetching, not
network access by dependency build scripts.
# Path and directory caveats
* Avoid symlinked source or build directory paths. `bext` warns about these
because they can cause downstream install and rpath problems.
* On non-Windows platforms, bundled Tcl/Tk builds do not support spaces in the
source or build directory path.
For building all of the projects present in this repository, you will need Git, CMake, a modern C/C++ compiler and some support libraries installed on your operating system. If you want flex and bison you'll also need a working Autotools stack on non-Windows platforms.
# Ubuntu Linux
Base packages:
```sh
Basic tools needed for all configurations:
```
sudo apt install git cmake gcc g++
```
For Tcl/Tk builds:
```sh
For Tk you'll need basic X11 libraries:
```
sudo apt install libfontconfig1-dev libfreetype6-dev xserver-xorg-dev libx11-dev libxi-dev libxext-dev
```
For Qt, Appleseed, and OSPRay:
```sh
For Qt, Appleseed and OSPRay you'll need Python
```
sudo apt install libpython3-dev
```
For Qt on X11 systems, install the XCB development packages:
```sh
For Qt you'll also need (in addition to the above) the XCB packages (see https://doc.qt.io/qt-6/linux-requirements.html)
```
sudo apt install libx11-xcb-dev libxfixes-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev
```
For OSPRay:
```sh
For OSPRay you'll need m4, and for the ISPC compiler used by OSPRay you'll need the gcc multilib packages:
```
sudo apt install m4 gcc-multilib g++-multilib
```
If you want to rely on system `flex` and `bison`:
```sh
If you don't want to build flex and bison for the OSPRay/Appleseed stacks you can also install those:
```
sudo apt install flex bison
```
If `bext` may need to build `flex` and `bison` locally:
```sh
sudo apt install autotools-dev autoconf
If you do want to build them, install the Autotools stack:
```
sudo apt-get install autotools-dev autoconf
```
# Windows
If you enable Qt, Appleseed, or OSPRay, make sure Python 3 is installed and
available in the build environment.
Windows will need some variety of Python installed for Qt/Appleseed/OSPRay.
Keep the source and build directories close to the drive root when possible.
Some Windows build tools still have path length limits, even though bext enables
Git's long path handling when it checks out submodules.
# OSX
# macOS
XCode
What else? - TODO
Assuming XCode is installed, good to go.
+9 -98
View File
@@ -2,88 +2,7 @@
When using submodules, there are some fairly non-intuitive aspects of managing them that need to be taken into consideration:
# Checkout out particular versions of bext
Because bext makes extensive use of git submodules, operations that in the BRL-CAD repository can normally be achieved with basic git commands may need additional options in bext to achieve expected results. A common example is switching a clone of bext to a specific revision. If you have (say) a checkout of main branch but wish to obtain bext's contents from the rel-7-40-2 branch, one might intuitively think a checkout would work. However, doing that checkout, we see:
```
bext (main)$ git checkout rel-7-40-2
M assetimport/assimp
M astyle/astyle
M gdal/gdal
M gte/GeometricTools
M lief/LIEF
M lmdb/lmdb
M netpbm/netpbm
M opennurbs/opennurbs
M png/libpng
M proj/PROJ
M sqlite3/sqlite3
M tiff/libtiff
branch 'rel-7-40-2' set up to track 'origin/rel-7-40-2'.
Switched to a new branch 'rel-7-40-2'
```
What are the modification notifications about? What has happened is the populated submodules are still in the state set up by the main branch - the checkout to rel-7-40-2 in the parent git repository did not alter their states, and so according to the rel-7-40-2 branch they are modified compared to what they should be:
```
bext (rel-7-40-2)$ git status
On branch rel-7-40-2
Your branch is up to date with 'origin/rel-7-40-2'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: assetimport/assimp (new commits)
modified: astyle/astyle (new commits)
modified: gdal/gdal (new commits)
modified: gte/GeometricTools (new commits)
modified: lief/LIEF (new commits)
modified: lmdb/lmdb (new commits)
modified: netpbm/netpbm (new commits)
modified: opennurbs/opennurbs (new commits)
modified: png/libpng (new commits)
modified: proj/PROJ (new commits)
modified: sqlite3/sqlite3 (new commits)
modified: tiff/libtiff (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
```
Note that not all submodules are listed. In this case, bext was configured to only clone specific libraries needed for a BRL-CAD build, and unpopulated submodules have made the change to the new version without incident. To also put the populated submodules in the expected state, a second command is needed:
```
bext (rel-7-40-2)$ git submodule update --recursive
Submodule path 'assetimport/assimp': checked out '3783459a97c67ec9e44fbec8c64aa83ff352dd15'
Submodule path 'astyle/astyle': checked out 'c35f91f650455dc7b9fb16c65bb8f9a94f6a1479'
Submodule path 'gdal/gdal': checked out '6caa025977ad22a32cba0646cafc30c36ca4f423'
Submodule path 'gte/GeometricTools': checked out '2cc6ea322f4fca3b51805768485d3da15409aeec'
Submodule path 'lief/LIEF': checked out '2b68ae538316f9ded03f9e3661d63551ab755cb0'
Submodule path 'lmdb/lmdb': checked out 'ddd0a773e2f44d38e4e31ec9ed81af81f4e4ccbb'
Submodule path 'netpbm/netpbm': checked out '3f1172417c2453de752839243e9a36fba5b16b70'
Submodule path 'opennurbs/opennurbs': checked out '6dce0c19e71812a87cc9de189ba5fdbbf7b56e28'
Submodule path 'png/libpng': checked out 'ed217e3e601d8e462f7fd1e04bed43ac42212429'
Submodule path 'proj/PROJ': checked out '47410920e0426d0eccbdbc27ca9dfc494f68a084'
Submodule path 'sqlite3/sqlite3': checked out 'e3012e5fa233146122a08ab41f33f7747d6c821c'
Submodule path 'tiff/libtiff': checked out '8b20804fc0ddeaa93667b799b5e1a2a7dc9e3fb2'
```
A second status check will now report a clean tree:
```
bext (rel-7-40-2)$ git status
On branch rel-7-40-2
Your branch is up to date with 'origin/rel-7-40-2'.
```
# Adding a submodule (using Tcl as an example)
NOTE: When testing out new possible dependencies for BEXT, work should be done in
a branch first and then merged into main. Once part of the main history, we can't
remove a dependency repository without breaking bext history - thus, we only want to
add dependencies we're actually going to use for implementing live features. Exploratory
work that might be thrown away is outside of bext's 'main' branch scope.
```
user@linux:~/bext (main) $ cd tcl
user@linux:~/bext/tcl (main) $ git submodule add -b RELEASE https://github.com/BRL-CAD/tcl.git
@@ -134,13 +53,6 @@ user@linux:~/bext (main) $ git commit -m "Update submodule references for AssetI
user@linux:~/bext (main) $ git push
```
# Parallelize updates
git config submodule.fetchJobs 0 # 0 = one job per CPU core
git config fetch.parallel 0
git config fetch.recurseSubmodules on-demand # only fetch the submodules that changed
# Changing the branch of a submodule
https://stackoverflow.com/questions/29882960/changing-an-existing-submodules-branch
@@ -357,7 +269,7 @@ process are:
suggests the upstream might be receptive to changing how their install
structure is laid out.
Once you have everything installing into install/ correctly and
Once you have everything installing into bext_output/install/ correctly and
using the correct dependencies, congratulations - you're now ready to add
the submodule to bext in lieu of a working source copy. This will allow
bext to manage when and how the directory is populated based on build
@@ -365,10 +277,9 @@ settings, as well as providing a convenient(ish) mechanism for updating
submodule references as needed (see above).
As an example, we document below the steps taken for the geogram library from
https://github.com/BrunoLevy/geogram (which we're no longer actively bundling,
but it still serves as a good illustration.) After creating a full fork of the
project via github and verifying actions were not enabled, we clone the new
repository recursively to get the source code of all submodules:
https://github.com/BrunoLevy/geogram After creating a full fork of the project
via github and verifying actions were not enabled, we clone the new repository
recursively to get the source code of all submodules:
```
$ git clone --recursive git@github.com:BRL-CAD/geogram.git
@@ -567,7 +478,7 @@ optional third party components:
```
geogram (RELEASE)$ mkdir build && cd build
build (RELEASE)$ cmake .. -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_WITH_GRAPHICS=OFF -DGEOGRAM_WITH_LUA=OFF -DGEOGRAM_WITH_HLBFGS=OFF -DGEOGRAM_WITH_TETGEN=OFF -DGEOGRAM_WITH_TRIANGLE=OFF -DCMAKE_BUILD_TYPE=Release
build (RELEASE)$ cmake .. -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_WITH_GRAPHICS=OFF -DGEOGRAM_WITH_LUA=OFF -DGEOGRAM_WITH_HLBFGS=OFF -DGEOGRAM_WITH_TETGEN=OFF -DGEOGRAM_WITH_TRIANGLE=OFF
CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
@@ -750,7 +661,7 @@ so we run make with the GEOGRAM_BLD target.
```
bext (main) $ cp -r ~/geogram geogram/
bext (main) $ mkdir build && cd build
build (main) $ cmake .. -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release
build (main) $ cmake .. -DENABLE_ALL=ON
build (main) $ make GEOGRAM_BLD
[ 0%] Creating directories for 'PATCH_BLD'
[ 0%] No download step for 'PATCH_BLD'
@@ -778,10 +689,10 @@ build (main) $ make GEOGRAM_BLD
[100%] Built target GEOGRAM_BLD
```
Once we have a successful completion, we inspect the contents of install:
Once we have a successful completion, we inspect the contents of bext_output/install:
```
bext/build (main) $ ls -R ~/install/
bext/build (main) $ ls -R ~/bext_output/install/
```
One thing to note is that a lot of the third party headers have been installed,
@@ -875,7 +786,7 @@ By convention we keep the labels alphabetized.
Note that the bext build takes responsibility for making third party
dependencies relocatable by leveraging LIEF, but if the upstream project ends
up encoding fixed install paths rather than using relative lookups it may
happen that a working install copy fails to work when copied into
happen that a working bext_output/install copy fails to work when copied into
the main BRL-CAD build. If and when that happens, the original sources must be
patched to allow for relocatable execution (we have to do this for Tcl, for
example.) This should be done via patch file, and if the upstream project will
+80 -163
View File
@@ -1,183 +1,100 @@
# bext - External Dependencies for BRL-CAD
# bext - External Dependencies Management
`bext` builds third-party libraries and helper tools used by
[BRL-CAD](https://github.com/BRL-CAD/brlcad). By default it prefers suitable
system packages and builds local copies only when they are needed.
This repository manages the building of dependencies used by large scale computer graphics projects, with a primary focus on the [BRL-CAD](https://github.com/BRL-CAD/brlcad) computer aided design system.
# Quick start
Clone the repository, configure with the official `auto` preset, and build:
* Clone this repository
```sh
git clone https://github.com/BRL-CAD/bext
cd bext
cmake --preset auto
cmake --build build/auto --config Release --parallel 8
```
Submodules are populated on demand during configure. For checkout and
platform setup details, see [INSTALL.md](INSTALL.md).
The preset workflow relies on CMake's newer preset support. If you are using
CMake 3.19 or 3.20, use the raw configure equivalents below.
# Optional bootstrap
If you want to fetch a given profile's source submodules up front
instead of letting configure fetch them on demand:
(This should be fast - by default most of the downloading happens during the configure process.)
* Make a build directory
```sh
cmake -DPROFILE=auto -P CMake/BextBootstrap.cmake
cmake --preset auto
mkdir bext_build && cd bext_build
```
Use `LIST_ONLY=ON` to preview the selected submodules without fetching them,
and `GIT_SHALLOW_CLONE=ON` to specify shallow clones during bootstrap.
Both configure and bootstrap accept `BEXT_REPOSITORY_ROOT` to fetch from an
alternate host or a local Git mirror. See [alternate repositories and offline
mirrors](INSTALL.md#alternate-repositories-and-offline-mirrors) for examples.
# How manual selection works
Build selection happens in three layers:
1. `USE_*` options decide which dependency families are in scope.
2. For in-scope packages, the default behavior is to use a suitable system
package if one is found and build a local copy only when needed.
3. `ENABLE_<pkg>=ON` or `OFF` overrides one package explicitly.
Default `USE_*` values:
* `USE_BRLCAD=ON`
* `USE_BRLCAD_EXTRA=ON`
* `USE_GDAL=ON`
* `USE_QT=ON`
* `USE_TCL=ON`
* `USE_APPLESEED=OFF`
* `USE_OSPRAY=OFF`
`ENABLE_ALL=ON` changes step 2 by preferring local builds for packages in the
active `USE_*` groups. It does not turn on groups whose `USE_*` option is
`OFF`.
When `bext` is driven from a BRL-CAD build, `BRLCAD_COMPONENTS` can further
narrow some BRL-CAD-related packages to only those needed by the requested
component set.
# Official profiles
The supported configure entry points are:
* `auto` - standard BRL-CAD-oriented profile using suitable system packages
when found
* `bundled` - standard BRL-CAD-oriented profile with bundled/local builds
preferred for all active groups
* `minimal` - core BRL-CAD profile without extras, GDAL, Qt, Tcl/Tk,
Appleseed, or OSPRay
* `everything` - all current groups enabled with bundled/local builds
preferred throughout
Use them like this:
* Configure with CMake. Individual components can be enabled or disabled, but the ENABLE_ALL flag is used to automatically turn on all the projects. There are also USE_* variables that can enable or disable various groupings of components based on which specific application stacks the user wishes to support.
```sh
cmake --preset auto
cmake --preset bundled
cmake --preset minimal
cmake --preset everything
cmake ../bext -DENABLE_ALL=ON
```
Build using the preset's build directory:
* Run the build process.
```sh
cmake --build build/auto --config Release --parallel 8
```
# Raw configure equivalents
`auto`:
```sh
cmake ../bext -DCMAKE_BUILD_TYPE=Release
```
`bundled`:
```sh
cmake ../bext -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release
```
`minimal`:
```sh
cmake ../bext \
-DUSE_BRLCAD_EXTRA=OFF \
-DUSE_GDAL=OFF \
-DUSE_QT=OFF \
-DUSE_TCL=OFF \
-DCMAKE_BUILD_TYPE=Release
```
`everything`:
```sh
cmake ../bext \
-DENABLE_ALL=ON \
-DUSE_APPLESEED=ON \
-DUSE_OSPRAY=ON \
-DCMAKE_BUILD_TYPE=Release
```
# Build outputs
By default, `CMAKE_INSTALL_PREFIX` is the build directory. `bext` creates two
output trees under that prefix:
* `install/` - files intended to be bundled with downstream software
* `noinstall/` - build-only tools and compile-time-only assets
* `bext-install-manifest.json` - relative file classifications and the
platform metadata needed by downstream staging builds
The normal build finalizes bundled binaries after all dependency install steps.
It uses `strclear` and, where available, `plief` to remove stale build paths and
normalize RPATH-bearing files before writing the manifest. Consumers should
continue to treat `install/` as read-only and perform their own staging-specific
path and RPATH edits on copied files.
The normal build also generates a dependency graph in the build directory as
`bext.dot`. When Graphviz `dot` is available, the build also emits rendered
forms such as `bext.svg`, `bext.png`, and `bext.pdf`.
When BRL-CAD consumes a `bext` build, `BRLCAD_EXT_DIR` should point at the
parent directory containing both `install/` and `noinstall/`.
# Using the build outputs with BRL-CAD
If you used the `auto` preset, `BRLCAD_EXT_DIR` should be `../bext/build/auto`.
Configure BRL-CAD with:
```sh
git clone https://github.com/BRL-CAD/brlcad
mkdir brlcad_build
cd brlcad_build
cmake ../brlcad -DBRLCAD_EXT_DIR=../bext_build -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --parallel 8
```
If you built Qt in `bext`, also enable Qt in BRL-CAD:
Note that if you know you are going to build most or all of the component projects you can immediately populate all submodules when performing the clone:
```sh
cmake ../brlcad \
-DBRLCAD_EXT_DIR=../bext_build \
-DBRLCAD_ENABLE_QT=ON \
-DCMAKE_BUILD_TYPE=Release
git clone --recursive https://github.com/BRL-CAD/bext
```
# More information
This is primarily useful if you want to do all the downloading at once up front or you are preparing to work in an environment without an internet connection.
A word of caution - full cloning of all the repository contents can be time, bandwidth and space intensive. To help alleviate this a bit, you can add -DGIT_SHALLOW_CLONE=ON to the CMake configure, or if you're pre-cloning all repositories ahead of time use --depth=1 option with the above recursive clone. Be aware that shallow clones have some limitations that make them unsuitable for much other than compiling (updating to newer versions of submodules won't work, for example) so shallow clones aren't recommended for development.
# USE_* Options
A complete ENABLE_ALL build of all components in this repository is a *very* large build, and developers not needing some subset of the components may wish to avoid paying the price of building *all* submodules. That is why the USE_* options are defined - ENABLE_ALL will only enable those submodules that indicate they are used by at least one active USE_* option. By default, USE_BRLCAD, USE_BRLCAD_EXTRA, USE_GDAL and USE_TCL are enabled as they collectively define the most common set of dependencies used by a standard BRL-CAD build. However, if a developer is building BRL-CAD without terrain support and without Tcl/Tk support, setting USE_GDAL and USE_TCL to OFF will skip compilation of those submodules. Available USE_* options are:
* USE_BRLCAD - Core BRL-CAD dependencies always needed to build BRL-CAD successfully.
* USE_BRLCAD_EXTRA - Optional BRL-CAD dependencies.
* USE_GDAL - Geospatial Data Abstraction Library and dependencies
* USE_TCL - Tcl/Tk and associated packages
* USE_QT - Qt - cross-platform software for creating graphical user interfaces
* USE_APPLESEED - Physically-based global illumination rendering engine
* USE_OSPRAY - Intel high performance ray tracing engine
(For BRL-CAD components specifically, a more nuanced enable/disable decision can be made if the BRLCAD_COMPONENTS variable is set. If the parent BRL-CAD build is only building a subset of the BRL-CAD target set, no all dependencies will be needed.)
# Using the Build Outputs with BRL-CAD
At the moment this repository and BRL-CAD's support of it are still experimental.
To test it, the steps are as follows:
* Clone the BRL-CAD repository
```sh
git clone https://github.com/BRL-CAD/brlcad
```
* Remove the internal 3rd party directories (be sure NOT to accidentally commit this change to the repository...)
```sh
cd brlcad && rm -rf misc/tools/ext src/other
```
* Make a build directory
```sh
cd .. && mkdir brlcad_exttest_build && cd brlcad_exttest_build
```
* Configure with CMake, specifying the path holding the bext output directory the BRLCAD_EXT_DIR variable to locate bext_output. Unless you have overridden the CMAKE_INSTALL_PREFIX of the bext build, it will be located in your home directory. The bext_output directory should in turn contain install and noinstall folders. If you also wish to test with Qt, you must currently enable that support in BRL-CAD as well. (Note that the BRL-CAD configure process is responsible for staging the BRLCAD_EXT_DIR contents into the build directory, so it can take some time to complete...)
```sh
cmake ../brlcad -DBRLCAD_EXT_DIR=<your_bext_output_dir> -DBRLCAD_ENABLE_QT=ON
```
* Run the build process.
```sh
cmake --build . --config Release --parallel 8
cmake --build . --target package --parallel 8
```
If all goes well, the final result should be a relocatable BRL-CAD archive
including both the main BRL-CAD outputs and the products of this external
dependencies repository.
# About This Repository
In broad, the structure of the source tree is two tiered - the top level directories each denote a specific dependency project (Tcl, Qt, GDAL, etc.). Within that directory are found:
* A reference (using git submodules) to a copy of the upstream source code
* Our managing CMakeLists.txt file defining the logic for building that project
* A <dirname>.deps file identifying a project's dependencies on other bext projects
* Any patch files or other supporting resources not part of the upstream tree
Sometimes third party libraries will depend on other third party libraries (for example, libpng's use of zlib) - when a bundled component that is a dependency of other bundled projects is enabled, the expectation is that the other bundled
components will use our copy rather than system copies of those libraries.
# Compilation-Only Tools
Although most of the components here are intended for bundling with the eventual binary software distribution, there are some exceptions to that rule. A few of the projects (AStyle, patch, LIEF, etc.) target a different installation folder and are used only for compilation (for this repository and/or when bundling the results of building this repository with other applications.)
There are also header-only "libraries" such as Eigen that are needed only for compilation, and do not need to be distributed with our packages.
To figure out which projects are in these categories, check for a CMAKE_NOBUNDLE_INSTALL_PREFIX target being used by their top level CMakeLists.txt file managing the ExternalProject_Add build definition.
* [INSTALL.md](INSTALL.md) - platform prerequisites, checkout options, and
setup caveats
* [DEPENDENCIES.md](DEPENDENCIES.md) - package-to-group reference, output
classification, and dependency addition workflow
* [NOTES.md](NOTES.md) - maintainer notes and submodule procedures
* [XMIN.md](XMIN.md) - testing-only headless X11 support using Xmin
+1 -8
View File
@@ -1,16 +1,9 @@
A bunch of the patches are still adding FindZLIB.cmake - fix.
Make sure for all the Find*.cmake files we're adding we reference
the copy in the toplevel bext/CMake directory unless there's a reason
not to - shouldn't be making per-proejct addfiles/ copies of those
since we'd just have to update each one.
Right now, I don't think we're really handling switching config options
properly. If we enable/disable individual components, dependencies using
those components need to be reset - their old compiles will no longer be
valid if one of their dependencies changes. We need to:
1. clear the output directories, so the contents reflect the new
1. clear the bext_output directory, so the contents reflect the new
settings rather than keeping potentially outdated files
2. remove old build directory contents for those projects that have
-48
View File
@@ -1,48 +0,0 @@
# Xmin-backed bundled toolkits
Xmin is a small, self-contained X11 server and client library - see
https://github.com/starseeker/Xmin
An installed Xmin SDK can provide the X11 and OpenGL surface for bext's
bundled Tk and Qt, allowing fully interactive automated GUI application testing
in an environment that has neither X nor OpenGL.
Set `BEXT_XMIN_ROOT` to select the standard Xmin profile:
```sh
cmake -S /path/to/bext -B /path/to/bext-build \
-DBEXT_XMIN_ROOT=/absolute/path/to/xmin-sdk \
-DENABLE_TCL=ON -DENABLE_QT=ON
```
The profile affects only Tk and Qt packages selected for a local build. It
does not enable a package excluded by `USE_*`, `BRLCAD_COMPONENTS`, or an
explicit `DISABLE_*` setting.
* Tk is configured with `--with-xmin` and bext's matching Tk patch.
* Qt is built with the matching Xmin patch, the qxcb desktop-OpenGL profile,
and dependency audits that reject accidental host X11 or OpenGL linkage.
The patches are maintained next to the dependency build logic as
`tk/tk_xmin.patch` and `qt/qt_xmin.patch`. They are tied to the exact Tk
and Qt submodule revisions in this repository. Updating either dependency
therefore requires updating its patch; a stale patch fails during the patch
step rather than silently producing a mixed build.
The Xmin SDK must include toolkit-client support for Tk. Qt additionally
requires the Qt X11 compatibility client and client OpenGL support. Normal
system discovery is unchanged when `BEXT_XMIN_ROOT` is empty.
Qt's installed package metadata retains an explicit dependency on Xmin.
Downstream projects must therefore keep the same SDK discoverable with
`Xmin_DIR` or `CMAKE_PREFIX_PATH`; configuration fails instead of falling back
to host X libraries when that SDK is absent.
## Advanced toolkit patch controls
Unix builds may pass additional, semicolon-separated absolute patch paths in
`TK_EXTRA_PATCHES`, plus additional Tk `configure` arguments in
`TK_CONFIGURE_ARGS`. `QT_EXTRA_PATCHES` provides the corresponding Qt
hook. `QT_XMIN_ROOT` remains available for manually supplied Qt Xmin patches.
These low-level controls are not needed when `BEXT_XMIN_ROOT` selects the
standard profile.
+4 -28
View File
@@ -9,32 +9,20 @@ if (ENABLE_APPLESEED)
if (TARGET ZLIB_BLD)
set(Z_PREFIX_STR "brl_")
endif (TARGET ZLIB_BLD)
set(APPLESEED_SIMD_ARGS)
if (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)")
list(APPEND APPLESEED_SIMD_ARGS
-DUSE_SSE=OFF
-DUSE_SSE42=OFF
-DUSE_AVX=OFF
-DUSE_AVX2=OFF
-DUSE_F16C=OFF
)
endif ()
ExternalProject_Add(APPLESEED_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/appleseed"
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/appleseed"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/appleseed.patch
#PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/appleseed.patch
CMAKE_ARGS
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
${BUILD_TYPE_SPECIFIER}
${APPLESEED_SIMD_ARGS}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
-DBOOST_ROOT=$<$<BOOL:${BOOST_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DEigen3_ROOT=$<$<BOOL:${EIGEN_BUNDLED}>:${CMAKE_NOBUNDLE_INSTALL_PREFIX}>
-DEMBREE_ROOT=$<$<BOOL:${EMBREE_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DISPC_ROOT=$<$<BOOL:${ISPC_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
$<$<BOOL:${ONETBB_TARGET}>:-DTBB_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DTBB_ROOT=$<$<BOOL:${TBB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DJPEG_ROOT=$<$<BOOL:${JPEG_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DPNG_ROOT=$<$<BOOL:${PNG_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DTIFF_ROOT=$<$<BOOL:${TIFF_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
@@ -44,16 +32,6 @@ if (ENABLE_APPLESEED)
-DOPENEXR_ROOT=$<$<BOOL:${OPENEXR_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DOPENIMAGEIO_ROOT=$<$<BOOL:${OPENIMAGEIO_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DOSL_ROOT=$<$<BOOL:${OSL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
# appleseed locates the OSL tools (oslc shader compiler, oslinfo query tool)
# via find_program() calls in its FindOSL.cmake that are malformed -- the
# path hint is parsed as an additional program name -- so the tools are only
# found if they happen to be on PATH, otherwise OSL_COMPILER / OSL_QUERY_INFO
# end up empty. That breaks the .osl->.oso build (command degrades to just
# its flags, "'-O2' is not recognized") and the post-build copy of oslinfo
# into the sandbox (cmake -E copy with an empty source). Pass both tools
# explicitly, as appleseed's own CI does; find_program() honors a pre-set var.
-DOSL_COMPILER=$<$<BOOL:${OSL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}/${BIN_DIR}/oslc${CMAKE_EXECUTABLE_SUFFIX}>
-DOSL_QUERY_INFO=$<$<BOOL:${OSL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}/${BIN_DIR}/oslinfo${CMAKE_EXECUTABLE_SUFFIX}>
-DXERCES_C_ROOT=$<$<BOOL:${XERCES_C_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DZLIB_C_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DWITH_STUDIO=OFF
@@ -63,7 +41,6 @@ if (ENABLE_APPLESEED)
-DWITH_PYTHON3_BINDINGS=OFF
-DINSTALL_TESTS=OFF
-DINSTALL_API_EXAMPLES=OFF
-DWARNINGS_AS_ERRORS=OFF
-DUSE_FIND_PACKAGE_FOR_EMBREE=ON
-DUSE_FIND_PACKAGE_FOR_EXR=ON
-DUSE_FIND_PACKAGE_FOR_LZ4=ON
@@ -75,13 +52,11 @@ if (ENABLE_APPLESEED)
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_PREFIX_PATH=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
-DOpenEXR_DIR=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}/cmake/OpenEXR
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
@@ -106,3 +81,4 @@ endif (ENABLE_APPLESEED)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-152
View File
@@ -1,152 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74ed663..ba8c28e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,9 +224,28 @@ if (USE_STATIC_BOOST)
endif ()
find_package(Boost 1.70 REQUIRED COMPONENTS atomic chrono date_time filesystem regex system thread wave)
add_definitions(-DBOOST_FILESYSTEM_VERSION=3 -DBOOST_FILESYSTEM_NO_DEPRECATED -DBOOST_ALL_DYN_LINK)
+if (MSVC)
+ # Boost 1.85's auto_link.hpp caps its MSVC toolset tag at vc143 (VS2022), but
+ # the bundled Boost is built with the newer (VS2026) toolset and installed as
+ # vc145. With BOOST_ALL_DYN_LINK the auto-link #pragma comment(lib, ...)
+ # directives would otherwise request boost_*-vc143-mt-x64-1_85.lib, which do
+ # not exist (LNK1104). Override the tag to match the bundled libraries.
+ add_definitions(-DBOOST_LIB_TOOLSET="vc145")
+endif ()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
find_package(OSL REQUIRED)
+# appleseed links OSL via the oslcomp/oslexec/oslquery_LIBRARY_IMP variables,
+# which are only populated by appleseed's module-mode FindOSL.cmake. When OSL is
+# resolved in CONFIG mode instead (e.g. CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON with
+# a bundled OSLConfig.cmake), those variables stay empty and OSL is silently left
+# out of the link (unresolved OSL_v1_xx::ShadingSystem/RendererServices/... at
+# link time). Fall back to the imported targets provided by OSLConfig.
+if (TARGET OSL::oslexec AND NOT oslexec_LIBRARY_IMP)
+ set(oslcomp_LIBRARY_IMP OSL::oslcomp)
+ set(oslexec_LIBRARY_IMP OSL::oslexec)
+ set(oslquery_LIBRARY_IMP OSL::oslquery)
+endif ()
-find_package(OpenEXR REQUIRED)
+find_package(OpenEXR MODULE REQUIRED)
find_package(OpenImageIO REQUIRED)
@@ -275,7 +294,6 @@ endif ()
include_directories(
${IMATH_INCLUDE_DIRS}
- ${IMATH_INCLUDE_DIRS}/OpenEXR/
${LZ4_INCLUDE_DIR}
${OPENCOLORIO_INCLUDE_DIRS}
${OPENEXR_INCLUDE_DIRS}
@@ -674,3 +692,11 @@ endif ()
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+find_package(OpenEXR REQUIRED)
+get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
+if (APPLE)
+foreach (IMATH_INCLUDE_DIR IN LISTS IMATH_INCLUDES)
+ string (REGEX REPLACE "/Imath/?$" "" IMATH_INCLUDE_DIR "${IMATH_INCLUDE_DIR}")
+ add_compile_options("-Wp,-I${IMATH_INCLUDE_DIR}")
+endforeach ()
+endif ()
diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake
index 00c769d..0f38a0d 100644
--- a/cmake/FindOpenEXR.cmake
+++ b/cmake/FindOpenEXR.cmake
@@ -56,16 +56,22 @@ if (TARGET OpenEXR::OpenEXR AND TARGET Imath::Imath)
# Mimic old style variables
set (OPENEXR_VERSION ${OpenEXR_VERSION})
get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
+ set (IMATH_INCLUDE_DIRS ${IMATH_INCLUDES})
+ string (REGEX REPLACE "/Imath/?$" "" IMATH_INCLUDE_DIRS "${IMATH_INCLUDE_DIRS}")
+ set (IMATH_INCLUDE_DIR ${IMATH_INCLUDES})
get_target_property(ILMBASE_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
- get_target_property(ILMBASE_IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
- get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
- get_target_property(OPENEXR_IEX_LIBRARY OpenEXR::Iex INTERFACE_LINK_LIBRARIES)
- get_target_property(OPENEXR_ILMTHREAD_LIBRARY OpenEXR::IlmThread INTERFACE_LINK_LIBRARIES)
+ set (ILMBASE_IMATH_LIBRARY Imath::Imath)
+ set (IMATH_LIBRARY Imath::Imath)
+ set (OPENEXR_IEX_LIBRARY OpenEXR::Iex)
+ set (OPENEXR_ILMTHREAD_LIBRARY OpenEXR::IlmThread)
set (ILMBASE_LIBRARIES ${ILMBASE_IMATH_LIBRARY})
set (ILMBASE_FOUND true)
get_target_property(OPENEXR_INCLUDES OpenEXR::OpenEXR INTERFACE_INCLUDE_DIRECTORIES)
- get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::OpenEXR INTERFACE_LINK_LIBRARIES)
+ set (OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDES})
+ string (REGEX REPLACE "/OpenEXR/?$" "" OPENEXR_INCLUDE_DIRS "${OPENEXR_INCLUDE_DIRS}")
+ set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDES})
+ set (OPENEXR_ILMIMF_LIBRARY OpenEXR::OpenEXR)
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_LIBRARIES})
set (OPENEXR_FOUND true)
diff --git a/src/thirdparty/bcd/bcd/Denoiser.cpp b/src/thirdparty/bcd/bcd/Denoiser.cpp
index 109ec87..ef7ed8e 100644
--- a/src/thirdparty/bcd/bcd/Denoiser.cpp
+++ b/src/thirdparty/bcd/bcd/Denoiser.cpp
@@ -125,7 +125,7 @@ bool Denoiser::denoise()
i,
boost::ref(abortRequested)));
- denoiseThreads.push_back(move(t));
+ denoiseThreads.push_back(std::move(t));
startPixelIndexIt = endPixelIndexIt;
}
diff --git a/src/appleseed/main/allocator.cpp b/src/appleseed/main/allocator.cpp
--- a/src/appleseed/main/allocator.cpp
+++ b/src/appleseed/main/allocator.cpp
@@ -58,6 +58,7 @@
#include <cassert>
#include <cstdint>
#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <ctime>
#include <exception>
@@ -501,7 +502,14 @@
if (size < 1)
size = 1;
- void* ptr = aligned_malloc(size, MemoryAlignment);
+ /* BRL-CAD PATCH: use plain malloc (already 16-byte aligned on x64)
+ * instead of aligned_malloc. This operator new/delete override only
+ * applies inside appleseed.dll, so std::strings/objects allocated by the
+ * default CRT allocator in other modules (art.exe, brl-cad DLLs,
+ * msvcp140d) and freed here would hit aligned_free() on a non-aligned
+ * block and crash (seen in foundation::SearchPaths::do_to_string at
+ * render start). malloc/free keep every module on one shared CRT heap. */
+ void* ptr = malloc(size);
if (!ptr)
throw std::bad_alloc();
@@ -514,7 +522,7 @@
if (!ptr)
return;
- aligned_free(ptr);
+ free(ptr);
}
}
diff --git a/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp b/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp
--- a/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp
+++ b/src/appleseed/renderer/device/cpu/cpurenderdevice.cpp
@@ -86,7 +86,12 @@
m_texture_system,
m_error_handler);
m_shading_system->attribute("lockgeom", 1);
- m_shading_system->attribute("colorspace", "Linear");
+ /* BRL-CAD PATCH: OSL's working color space must be a name OSL knows (its
+ * default is "Rec709", the linear-Rec709 working space). The upstream
+ * "Linear" is not a recognized OSL color space, so OSL logged
+ * "Unknown color space \"Linear\"" on every color transform and flagged an
+ * error (nonzero process exit) even though rendering succeeded. */
+ m_shading_system->attribute("colorspace", "Rec709");
m_shading_system->attribute("commonspace", "world");
m_shading_system->attribute("statistics:level", 1);
m_shading_system->attribute(
+6 -12
View File
@@ -1,7 +1,6 @@
# Decide if we're using assetimport.
# Also, assetimport is used directly by a libgcv plugin and (until we update to Manifold 3.0)
# is needed by Manifold, which is used by librt
cad_enable(ASSETIMPORT "libgcv;librt")
# Decide if we're using assetimport - used by Manifold which is used by librt.
# Also, assetimport is used directly by a libgcv plugin
cad_enable(ASSETIMPORT "librt;libgcv")
bext_enable(ASSETIMPORT)
@@ -13,22 +12,19 @@ if (ENABLE_ASSETIMPORT)
RegisterDeps(ASSETIMPORT)
if (TARGET ZLIB_BLD)
set(Z_PREFIX_STR "brl_")
set(ZLIB_TARGET ZLIB_BLD)
endif (TARGET ZLIB_BLD)
ExternalProject_Add(ASSETIMPORT_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/assimp"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/assetimport_CMake.patch
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/assetimport_stb.patch
COMMAND ${CMAKE_COMMAND};-E;remove;<SOURCE_DIR>/cmake-modules/FindZLIB.cmake
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake-modules/FindZLIB.cmake
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/assetimport.patch
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
-DZLIB_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-Dpugixml_ROOT=$<$<BOOL:${PUGIXML_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DPUGIXML_ROOT=$<$<BOOL:${PUGIXML_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
@@ -37,11 +33,9 @@ if (ENABLE_ASSETIMPORT)
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DASSIMP_BUILD_USE_CCACHE=OFF
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_BUILD_TESTS=OFF
-DASSIMP_BUILD_MINIZIP=ON
-DASSIMP_BUILD_ZLIB=OFF
-DASSIMP_INJECT_DEBUG_POSTFIX=OFF
-DASSIMP_INSTALL_PDB=OFF
DEPENDS ${ASSETIMPORT_DEPS}
+259
View File
@@ -0,0 +1,259 @@
diff -Naur ASSETIMPORT/cmake-modules/FindZLIB.cmake ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake
--- ASSETIMPORT/cmake-modules/FindZLIB.cmake 2024-06-25 10:10:10.163683303 -0400
+++ ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake 2024-06-25 10:08:14.147412121 -0400
@@ -1,48 +1,123 @@
-#-------------------------------------------------------------------
-# This file is part of the CMake build system for OGRE
-# (Object-oriented Graphics Rendering Engine)
-# For the latest info, see http://www.ogre3d.org/
+#.rst:
+# FindZLIB
+# --------
#
-# The contents of this file are placed in the public domain. Feel
-# free to make use of it in any way you like.
-#-------------------------------------------------------------------
-
-# - Try to find ZLIB
-# Once done, this will define
+# Find the native ZLIB includes and library.
#
-# ZLIB_FOUND - system has ZLIB
-# ZLIB_INCLUDE_DIRS - the ZLIB include directories
-# ZLIB_LIBRARIES - link these to use ZLIB
-
-include(FindPkgMacros)
-findpkg_begin(ZLIB)
-
-# Get path, convert backslashes as ${ENV_${var}}
-getenv_path(ZLIB_HOME)
-
-# construct search paths
-set(ZLIB_PREFIX_PATH ${ZLIB_HOME} ${ENV_ZLIB_HOME})
-create_search_paths(ZLIB)
-# redo search if prefix path changed
-clear_if_changed(ZLIB_PREFIX_PATH
- ZLIB_LIBRARY_FWK
- ZLIB_LIBRARY_REL
- ZLIB_LIBRARY_DBG
- ZLIB_INCLUDE_DIR
-)
-
-set(ZLIB_LIBRARY_NAMES z zlib zdll)
-get_debug_names(ZLIB_LIBRARY_NAMES)
-
-use_pkgconfig(ZLIB_PKGC zzip-zlib-config)
-
-findpkg_framework(ZLIB)
-
-find_path(ZLIB_INCLUDE_DIR NAMES zlib.h HINTS ${ZLIB_INC_SEARCH_PATH} ${ZLIB_PKGC_INCLUDE_DIRS})
-find_library(ZLIB_LIBRARY_REL NAMES ${ZLIB_LIBRARY_NAMES} HINTS ${ZLIB_LIB_SEARCH_PATH} ${ZLIB_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
-find_library(ZLIB_LIBRARY_DBG NAMES ${ZLIB_LIBRARY_NAMES_DBG} HINTS ${ZLIB_LIB_SEARCH_PATH} ${ZLIB_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
-
-make_library_set(ZLIB_LIBRARY)
-
-findpkg_finish(ZLIB)
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
+# ZLIB has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+#
+# ::
+#
+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
+#
+# The following variable are provided for backward compatibility
+#
+# ::
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
+# ZLIB_MINOR_VERSION - The minor version of zlib
+# ZLIB_PATCH_VERSION - The patch version of zlib
+#
+# Hints
+# ^^^^^
+#
+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
+# module where to look.
+#=============================================================================
+# Copyright 2001-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+set(_ZLIB_SEARCHES)
+
+# Search ZLIB_ROOT first if it is set.
+if(ZLIB_ROOT)
+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_ZLIB_SEARCH_NORMAL
+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+ "$ENV{PROGRAMFILES}/zlib"
+ )
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+
+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
+
+# Try each search configuration.
+foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
+
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+
+ # only append a TWEAK version if it exists:
+ set(ZLIB_VERSION_TWEAK "")
+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
+
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
+ VERSION_VAR ZLIB_VERSION_STRING)
+
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if(NOT TARGET ZLIB::ZLIB)
+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+ endif()
+endif()
diff -Naur ASSETIMPORT/code/AssetLib/MDL/MDLFileData.h ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h
--- ASSETIMPORT/code/AssetLib/MDL/MDLFileData.h 2024-06-25 10:10:10.171683183 -0400
+++ ASSETIMPORT_BLD/code/AssetLib/MDL/MDLFileData.h 2024-06-25 10:08:14.148412106 -0400
@@ -876,7 +876,7 @@
: apcOutBones(),
iNum()
{
- abNeedMaterials.reserve(10);
+ //abNeedMaterials.reserve(10);
}
//! Destruction: properly delete all allocated resources
diff -Naur ASSETIMPORT/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt
--- ASSETIMPORT/code/CMakeLists.txt 2024-06-25 10:10:10.175683123 -0400
+++ ASSETIMPORT_BLD/code/CMakeLists.txt 2024-06-25 10:08:14.149412091 -0400
@@ -906,17 +906,18 @@
SOURCE_GROUP( Extra FILES ${Extra_SRCS})
# pugixml
-IF(ASSIMP_HUNTER_ENABLED)
- hunter_add_package(pugixml)
- find_package(pugixml CONFIG REQUIRED)
-ELSE()
- SET( Pugixml_SRCS
- ../contrib/pugixml/src/pugiconfig.hpp
- ../contrib/pugixml/src/pugixml.hpp
- )
- INCLUDE_DIRECTORIES("../contrib/pugixml/src")
- SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS})
-ENDIF()
+#IF(ASSIMP_HUNTER_ENABLED)
+# hunter_add_package(pugixml)
+# find_package(pugixml CONFIG REQUIRED)
+#ELSE()
+# SET( Pugixml_SRCS
+# ../contrib/pugixml/src/pugiconfig.hpp
+# ../contrib/pugixml/src/pugixml.hpp
+# )
+# INCLUDE_DIRECTORIES("../contrib/pugixml/src")
+# SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS})
+#ENDIF()
+find_package(pugixml REQUIRED)
# utf8
IF(ASSIMP_HUNTER_ENABLED)
@@ -1268,6 +1269,10 @@
$<INSTALL_INTERFACE:${ASSIMP_INCLUDE_INSTALL_DIR}>
)
+if (TARGET pugixml)
+ set(PUGIXML_LIBRARIES pugixml)
+endif (TARGET pugixml)
+
IF(ASSIMP_HUNTER_ENABLED)
TARGET_LINK_LIBRARIES(assimp
PUBLIC
@@ -1289,7 +1294,7 @@
target_link_libraries(assimp PRIVATE ${draco_LIBRARIES})
endif()
ELSE()
- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES})
+ TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${PUGIXML_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES})
if (ASSIMP_BUILD_DRACO)
target_link_libraries(assimp ${draco_LIBRARIES})
endif()
@@ -1307,6 +1312,7 @@
TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES})
ENDIF ()
+if(0)
if( MSVC )
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
# CMake 3.12 added a variable for this
@@ -1353,11 +1359,12 @@
target_compile_definitions(assimp PUBLIC WindowsStore)
TARGET_LINK_LIBRARIES(assimp advapi32)
endif()
+endif(0)
SET_TARGET_PROPERTIES( assimp PROPERTIES
VERSION ${ASSIMP_VERSION}
SOVERSION ${ASSIMP_SOVERSION} # use full version
- OUTPUT_NAME assimp${LIBRARY_SUFFIX}
+ #OUTPUT_NAME assimp${LIBRARY_SUFFIX}
)
if (APPLE)
-98
View File
@@ -1,98 +0,0 @@
--- assimp/CMakeLists.txt 2025-07-22 16:48:44.626337172 -0400
+++ ASSETIMPORT_BLD/CMakeLists.txt 2025-07-22 16:28:32.943270150 -0400
@@ -37,6 +37,7 @@
SET(CMAKE_POLICY_DEFAULT_CMP0012 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
+SET(CMAKE_POLICY_DEFAULT_CMP0144 NEW)
CMAKE_MINIMUM_REQUIRED( VERSION 3.22 )
--- assimp/cmake-modules/assimp-plain-config.cmake.in 2025-07-22 16:48:43.776340530 -0400
+++ ASSETIMPORT_BLD/cmake-modules/assimp-plain-config.cmake.in 2025-07-22 16:28:33.458267904 -0400
@@ -1,5 +1,7 @@
@PACKAGE_INIT@
+find_package(ZLIB MODULE REQUIRED)
+
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
set(ASSIMP_ROOT_DIR ${PACKAGE_PREFIX_DIR})
diff -Naur assimp/code/CMakeLists.txt ASSETIMPORT_BLD/code/CMakeLists.txt
--- assimp/code/CMakeLists.txt 2026-02-04 16:56:22.592686074 -0500
+++ ASSETIMPORT_BLD/code/CMakeLists.txt 2026-02-04 16:55:19.040925630 -0500
@@ -1113,18 +1113,19 @@
ENDIF() # IF (ASSIMP_BUILD_USD_IMPORTER)
# pugixml
-IF(ASSIMP_HUNTER_ENABLED)
- hunter_add_package(pugixml)
- find_package(pugixml CONFIG REQUIRED)
-ELSEIF(NOT TARGET pugixml::pugixml)
- SET( Pugixml_SRCS
- ../contrib/pugixml/src/pugiconfig.hpp
- ../contrib/pugixml/src/pugixml.cpp
- ../contrib/pugixml/src/pugixml.hpp
- )
- INCLUDE_DIRECTORIES("../contrib/pugixml/src")
- SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS})
-ENDIF()
+#IF(ASSIMP_HUNTER_ENABLED)
+# hunter_add_package(pugixml)
+# find_package(pugixml CONFIG REQUIRED)
+#ELSEIF(NOT TARGET pugixml::pugixml)
+# SET( Pugixml_SRCS
+# ../contrib/pugixml/src/pugiconfig.hpp
+# ../contrib/pugixml/src/pugixml.cpp
+# ../contrib/pugixml/src/pugixml.hpp
+# )
+# INCLUDE_DIRECTORIES("../contrib/pugixml/src")
+# SOURCE_GROUP( Contrib\\Pugixml FILES ${Pugixml_SRCS})
+#ENDIF()
+find_package(pugixml REQUIRED)
# utf8
IF(ASSIMP_HUNTER_ENABLED)
@@ -1414,6 +1415,10 @@
$<INSTALL_INTERFACE:${ASSIMP_INCLUDE_INSTALL_DIR}>
)
+if (TARGET pugixml)
+ set(PUGIXML_LIBRARIES pugixml)
+endif (TARGET pugixml)
+
IF(ASSIMP_HUNTER_ENABLED)
TARGET_LINK_LIBRARIES(assimp
PUBLIC
@@ -1435,7 +1440,8 @@
target_link_libraries(assimp PRIVATE ${draco_LIBRARIES})
endif()
ELSE()
- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES})
+ find_package(ZLIB MODULE REQUIRED)
+ TARGET_LINK_LIBRARIES(assimp ZLIB::ZLIB ${PUGIXML_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES})
if (ASSIMP_BUILD_DRACO)
target_link_libraries(assimp ${draco_LIBRARIES})
endif()
@@ -1453,6 +1459,7 @@
TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES})
ENDIF ()
+if(0)
if( MSVC )
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
# CMake 3.12 added a variable for this
@@ -1499,11 +1506,12 @@
target_compile_definitions(assimp PUBLIC WindowsStore)
TARGET_LINK_LIBRARIES(assimp advapi32)
endif()
+endif(0)
SET_TARGET_PROPERTIES( assimp PROPERTIES
VERSION ${ASSIMP_VERSION}
SOVERSION ${ASSIMP_SOVERSION} # use full version
- OUTPUT_NAME assimp${LIBRARY_SUFFIX}
+ #OUTPUT_NAME assimp${LIBRARY_SUFFIX}
)
if (APPLE)
-12
View File
@@ -1,12 +0,0 @@
diff -Naur assimp/contrib/stb/stb_image.h ASSETIMPORT_BLD/contrib/stb/stb_image.h
--- assimp/contrib/stb/stb_image.h 2026-02-05 14:22:20.343920277 -0500
+++ ASSETIMPORT_BLD/contrib/stb/stb_image.h 2026-02-05 14:24:43.112400148 -0500
@@ -5079,7 +5079,7 @@
{
stbi_uc palette[1024], pal_img_n=0;
stbi_uc has_trans=0, tc[3]={0};
- stbi__uint16 tc16[3];
+ stbi__uint16 tc16[3]={0};
stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
int first=1,k,interlace=0, color=0, is_iphone=0;
stbi__context *s = z->s;
+5 -4
View File
@@ -1,6 +1,8 @@
# Astyle is not bundled with BRL-CAD - it is a source code formatting tool,
# optionally used during compilation to validate our style guidelines.
bext_enable_all_default(ASTYLE astyle)
if (ENABLE_ALL AND NOT DEFINED ENABLE_ASTYLE)
set(ENABLE_ASTYLE ON)
endif (ENABLE_ALL AND NOT DEFINED ENABLE_ASTYLE)
if (NOT ENABLE_ASTYLE)
@@ -28,14 +30,12 @@ if (ENABLE_ASTYLE)
${BUILD_TYPE_SPECIFIER}
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${LIB_DIR}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=OFF
-DBUILD_JAVA_LIBS=OFF
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
@@ -53,3 +53,4 @@ endif (ENABLE_ASTYLE)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+31 -128
View File
@@ -1,74 +1,22 @@
diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
--- astyle/CMakeLists.txt 2026-09-09 09:23:57.197122193 -0400
+++ ASTYLE_BLD/CMakeLists.txt 2026-09-09 09:17:33.423173910 -0400
@@ -17,6 +17,8 @@
endif()
set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Linux Soname Version
set(MAJORVER 3)
@@ -72,151 +74,13 @@
target_compile_options(astyle PRIVATE /utf-8)
endif()
-# Set build-specific compile options
-if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
- if(BUILD_JAVA_LIBS)
- find_package(JNI)
- if (NOT JNI_FOUND)
- set(err_jni "Use '-DJAVA_HOME=<JNI Directory>' to define the Java path")
- message(FATAL_ERROR ${err_jni})
- endif()
- target_compile_options(astyle PRIVATE -DASTYLE_JNI)
- target_include_directories(astyle PRIVATE ${JNI_INCLUDE_DIRS})
- else()
- target_compile_options(astyle PRIVATE -DASTYLE_LIB)
- endif()
- # Windows DLL exports removed
- set_property(TARGET astyle PROPERTY DEFINE_SYMBOL "")
- # Linux solib version added
- set_property(TARGET astyle PROPERTY VERSION ${SOLIBVER})
- set_property(TARGET astyle PROPERTY SOVERSION ${MAJORVER})
-endif()
-
-
-# Linker options:
-
-# Strip release builds
-if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
- if(NOT BUILD_STATIC_LIBS AND NOT BORLAND AND NOT MSVC)
- add_custom_command(TARGET astyle POST_BUILD
- COMMAND ${CMAKE_STRIP} $<TARGET_FILE_NAME:astyle>)
- endif()
-endif()
-# Shared library options
-if(BUILD_SHARED_LIBS)
- set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") # remove -rdynamic
- if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
- # need static linking because cannot find the intel libraries at runtime
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
- elseif(MINGW)
- # minGW dlls don't work
- # tdm-gcc dlls work with everything except python
- set(CMAKE_SHARED_LINKER_FLAGS
- "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias -Wl,--dll")
- elseif(BORLAND)
- # use a development environment to compile Borland dlls
- endif()
-endif()
-
-
-# Installation options:
-
diff -Naur astyle/build/cmake/InstallOptions.cmake ASTYLE_BLD/build/cmake/InstallOptions.cmake
--- astyle/build/cmake/InstallOptions.cmake 2024-06-24 11:35:23.444068225 -0400
+++ ASTYLE_BLD/build/cmake/InstallOptions.cmake 2024-06-24 11:36:14.697228521 -0400
@@ -1,45 +1,10 @@
-# Define install directories
-# To uninstall 'xargs rm < install_manifest.txt'
-# Default linux install prefix is /usr/local"
-# This may be modified by -DCMAKE_INSTALL_PREFIX=
-# Default Win32 install prefix is not used (C:/Program Files (x86))
-
+install(TARGETS astyle
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin
+ )
+install(FILES ${DOCS} DESTINATION share/doc/astyle/html)
+if (MAN)
+ INSTALL(FILES ${MAN} DESTINATION man/man1)
+endif (MAN)
-option(INSTALL_DOC ON)
-
-if(BUILD_SHARED_LIBS OR BUILD_STATIC_LIBS)
@@ -108,66 +56,21 @@ diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
- endif()
- endif()
-endif()
-
-
-# output files:
+install(TARGETS astyle
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin
+ )
+install(FILES ${DOCS} DESTINATION share/doc/astyle/html)
+if (MAN)
+ INSTALL(FILES ${MAN} DESTINATION man/man1)
+endif (MAN)
diff -Naur astyle/CMakeLists.txt ASTYLE_BLD/CMakeLists.txt
--- astyle/CMakeLists.txt 2024-06-06 01:30:44.000000000 -0400
+++ ASTYLE_BLD/CMakeLists.txt 2024-06-28 12:11:49.297259511 -0400
@@ -6,9 +6,13 @@
-# Set output file names if different than 'astyle'
-if(BUILD_JAVA_LIBS)
- if(WIN32)
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle32j)
- set_property(TARGET astyle PROPERTY PREFIX "")
- else()
- set_property(TARGET astyle PROPERTY OUTPUT_NAME astylej)
- endif()
-elseif(BUILD_SHARED_LIBS)
- if(WIN32)
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle32)
- set_property(TARGET astyle PROPERTY PREFIX "")
- endif()
-elseif(BUILD_STATIC_LIBS)
- if(WIN32)
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyleLib)
- set_property(TARGET astyle PROPERTY PREFIX "")
- endif()
-else()
- if(WIN32)
- set_property(TARGET astyle PROPERTY OUTPUT_NAME AStyle)
- endif()
-endif()
-
-
-# print info:
-
-if(BUILD_JAVA_LIBS)
- SET(ASTYLE_BUILD_TYPE "Java Shared Library")
-elseif(BUILD_SHARED_LIBS)
- SET(ASTYLE_BUILD_TYPE "Shared Library")
-elseif(BUILD_STATIC_LIBS)
- SET(ASTYLE_BUILD_TYPE "Static Library")
-else()
- SET(ASTYLE_BUILD_TYPE "Executable")
-endif()
-
-# Display build information
-
-message( STATUS "---------- General Configuration ----------" )
-message( STATUS )
-message( STATUS "CMake Generator: ${CMAKE_GENERATOR}" )
-message( STATUS "CMake Compiler: ${CMAKE_CXX_COMPILER_ID}" )
-message( STATUS "AStyle Build: ${ASTYLE_BUILD_TYPE}" )
-message( STATUS "AStyle Configuration: ${CMAKE_BUILD_TYPE}" )
-if( BUILD_JAVA_LIBS )
- message( STATUS "Java Include Path: ${JAVA_INCLUDE_PATH}" )
-endif()
-message( STATUS )
-message( STATUS "-------------------------------------------" )
project(astyle CXX)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
include( build/cmake/Options.cmake REQUIRED )
include( build/cmake/CompilerOptions.cmake REQUIRED )
-include( build/cmake/LinkerOptions.cmake REQUIRED )
+#include( build/cmake/LinkerOptions.cmake REQUIRED )
include( build/cmake/InstallOptions.cmake REQUIRED )
include( build/cmake/OutputFiles.cmake REQUIRED )
include( build/cmake/PrintInfo.cmake REQUIRED )
+1 -2
View File
@@ -16,8 +16,6 @@ if (ENABLE_BOOST)
URL "${CMAKE_CURRENT_SOURCE_DIR}/boost"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/boost_cmake.patch
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/libs/iostreams/cmake/FindZLIB.cmake
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/boost/FindICU.cmake;<SOURCE_DIR>/libs/locale/cmake/FindICU.cmake
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
@@ -59,3 +57,4 @@ endif (ENABLE_BOOST)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-437
View File
@@ -1,437 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindICU
-------
.. versionadded:: 3.7
Find the International Components for Unicode (ICU) libraries and
programs.
This module supports multiple components.
Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
``lx``, ``test``, ``tu`` and ``uc``.
Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
``in``; any of the names may be used, and the appropriate
platform-specific library name will be automatically selected.
.. versionadded:: 3.11
Added support for static libraries on Windows.
This module reports information about the ICU installation in
several variables. General variables::
ICU_VERSION - ICU release version
ICU_FOUND - true if the main programs and libraries were found
ICU_LIBRARIES - component libraries to be linked
ICU_INCLUDE_DIRS - the directories containing the ICU headers
Imported targets::
ICU::<C>
Where ``<C>`` is the name of an ICU component, for example
``ICU::i18n``; ``<C>`` is lower-case.
ICU programs are reported in::
ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
ICU_GENBRK_EXECUTABLE - path to genbrk executable
ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
ICU_GENRB_EXECUTABLE - path to genrb executable
ICU_GENDICT_EXECUTABLE - path to gendict executable
ICU_DERB_EXECUTABLE - path to derb executable
ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
ICU_UCONV_EXECUTABLE - path to uconv executable
ICU_GENCFU_EXECUTABLE - path to gencfu executable
ICU_MAKECONV_EXECUTABLE - path to makeconv executable
ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
ICU_GENCCODE_EXECUTABLE - path to genccode executable
ICU_GENSPREP_EXECUTABLE - path to gensprep executable
ICU_ICUPKG_EXECUTABLE - path to icupkg executable
ICU_GENCMN_EXECUTABLE - path to gencmn executable
ICU component libraries are reported in::
ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
ICU datafiles are reported in::
ICU_MAKEFILE_INC - Makefile.inc
ICU_PKGDATA_INC - pkgdata.inc
This module reads hints about search results from::
ICU_ROOT - the root of the ICU installation
The environment variable ``ICU_ROOT`` may also be used; the
ICU_ROOT variable takes precedence.
The following cache variables may also be set::
ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
ICU_INCLUDE_DIR - the directory containing the ICU headers
ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
.. note::
In most cases none of the above variables will require setting,
unless multiple ICU versions are available and a specific version
is required.
Other variables one may set to control this module are::
ICU_DEBUG - Set to ON to enable debug output from FindICU.
#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
set(icu_programs
gencnval
icuinfo
genbrk
icu-config
genrb
gendict
derb
pkgdata
uconv
gencfu
makeconv
gennorm2
genccode
gensprep
icupkg
gencmn)
set(icu_data
Makefile.inc
pkgdata.inc)
# The ICU checks are contained in a function due to the large number
# of temporary variables needed.
function(_ICU_FIND)
# Set up search paths, taking compiler into account. Search ICU_ROOT,
# with ICU_ROOT in the environment as a fallback if unset.
if(ICU_ROOT)
list(APPEND icu_roots "${ICU_ROOT}")
else()
if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
list(APPEND icu_roots "${NATIVE_PATH}")
set(ICU_ROOT "${NATIVE_PATH}"
CACHE PATH "Location of the ICU installation" FORCE)
endif()
endif()
# Find include directory
list(APPEND icu_include_suffixes "include")
find_path(ICU_INCLUDE_DIR
NAMES "unicode/utypes.h"
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_include_suffixes}
DOC "ICU include directory")
set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
# Get version
if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
"\\1" icu_version_string "${icu_header_str}")
set(ICU_VERSION "${icu_version_string}")
set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
unset(icu_header_str)
unset(icu_version_string)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# 64-bit binary directory
set(_bin64 "bin64")
# 64-bit library directory
set(_lib64 "lib64")
endif()
# Find all ICU programs
list(APPEND icu_binary_suffixes "${_bin64}" "bin" "sbin")
foreach(program ${icu_programs})
string(TOUPPER "${program}" program_upcase)
set(cache_var "ICU_${program_upcase}_EXECUTABLE")
set(program_var "ICU_${program_upcase}_EXECUTABLE")
find_program("${cache_var}"
NAMES "${program}"
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_binary_suffixes}
DOC "ICU ${program} executable"
NO_PACKAGE_ROOT_PATH
)
mark_as_advanced("${cache_var}")
set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
endforeach()
# Find all ICU libraries
list(APPEND icu_library_suffixes "${_lib64}" "lib")
set(ICU_REQUIRED_LIBS_FOUND ON)
set(static_prefix )
# static icu libraries compiled with MSVC have the prefix 's'
if(MSVC)
set(static_prefix "s")
endif()
foreach(component ${ICU_FIND_COMPONENTS})
string(TOUPPER "${component}" component_upcase)
set(component_cache "ICU_${component_upcase}_LIBRARY")
set(component_cache_release "${component_cache}_RELEASE")
set(component_cache_debug "${component_cache}_DEBUG")
set(component_found "ICU_${component_upcase}_FOUND")
set(component_found_compat "${component_upcase}_FOUND")
set(component_libnames "icu${component}")
set(component_debug_libnames "icu${component}d")
# Special case deliberate library naming mismatches between Unix
# and Windows builds
unset(component_libnames)
unset(component_debug_libnames)
list(APPEND component_libnames "icu${component}")
list(APPEND component_debug_libnames "icu${component}d")
if(component STREQUAL "data")
list(APPEND component_libnames "icudt")
# Note there is no debug variant at present
list(APPEND component_debug_libnames "icudtd")
endif()
if(component STREQUAL "dt")
list(APPEND component_libnames "icudata")
# Note there is no debug variant at present
list(APPEND component_debug_libnames "icudatad")
endif()
if(component STREQUAL "i18n")
list(APPEND component_libnames "icuin")
list(APPEND component_debug_libnames "icuind")
endif()
if(component STREQUAL "in")
list(APPEND component_libnames "icui18n")
list(APPEND component_debug_libnames "icui18nd")
endif()
if(static_prefix)
unset(static_component_libnames)
unset(static_component_debug_libnames)
foreach(component_libname ${component_libnames})
list(APPEND static_component_libnames
${static_prefix}${component_libname})
endforeach()
foreach(component_libname ${component_debug_libnames})
list(APPEND static_component_debug_libnames
${static_prefix}${component_libname})
endforeach()
list(APPEND component_libnames ${static_component_libnames})
list(APPEND component_debug_libnames ${static_component_debug_libnames})
endif()
find_library("${component_cache_release}"
NAMES ${component_libnames}
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_library_suffixes}
DOC "ICU ${component} library (release)"
NO_PACKAGE_ROOT_PATH
)
find_library("${component_cache_debug}"
NAMES ${component_debug_libnames}
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_library_suffixes}
DOC "ICU ${component} library (debug)"
NO_PACKAGE_ROOT_PATH
)
include(SelectLibraryConfigurations)
select_library_configurations(ICU_${component_upcase})
mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
if(${component_cache})
set("${component_found}" ON)
set("${component_found_compat}" ON)
list(APPEND ICU_LIBRARY "${${component_cache}}")
if (ICU_FIND_REQUIRED_${component})
list(APPEND ICU_LIBS_FOUND "${component} (required): ${${component_cache}}")
else()
list(APPEND ICU_LIBS_FOUND "${component} (optional): ${${component_cache}}")
endif()
else()
if (ICU_FIND_REQUIRED_${component})
set(ICU_REQUIRED_LIBS_FOUND OFF)
list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
else()
list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
endif()
endif()
mark_as_advanced("${component_found}")
mark_as_advanced("${component_found_compat}")
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
endforeach()
set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
# Find all ICU data files
if(CMAKE_LIBRARY_ARCHITECTURE)
list(APPEND icu_data_suffixes
"${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
"lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
"${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
"lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
endif()
list(APPEND icu_data_suffixes
"${_lib64}/icu/${ICU_VERSION}"
"lib/icu/${ICU_VERSION}"
"${_lib64}/icu"
"lib/icu")
foreach(data ${icu_data})
string(TOUPPER "${data}" data_upcase)
string(REPLACE "." "_" data_upcase "${data_upcase}")
set(cache_var "ICU_${data_upcase}")
set(data_var "ICU_${data_upcase}")
find_file("${cache_var}"
NAMES "${data}"
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_data_suffixes}
DOC "ICU ${data} data file")
mark_as_advanced("${cache_var}")
set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
endforeach()
if(NOT ICU_FIND_QUIETLY)
if(ICU_LIBS_FOUND)
message(STATUS "Found the following ICU libraries:")
foreach(found ${ICU_LIBS_FOUND})
message(STATUS " ${found}")
endforeach()
endif()
if(ICU_LIBS_NOTFOUND)
message(STATUS "The following ICU libraries were not found:")
foreach(notfound ${ICU_LIBS_NOTFOUND})
message(STATUS " ${notfound}")
endforeach()
endif()
endif()
if(ICU_DEBUG)
message(STATUS "--------FindICU.cmake search debug--------")
message(STATUS "ICU binary path search order: ${icu_roots}")
message(STATUS "ICU include path search order: ${icu_roots}")
message(STATUS "ICU library path search order: ${icu_roots}")
message(STATUS "----------------")
endif()
endfunction()
_ICU_FIND()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
FOUND_VAR ICU_FOUND
REQUIRED_VARS ICU_INCLUDE_DIR
ICU_LIBRARY
_ICU_REQUIRED_LIBS_FOUND
VERSION_VAR ICU_VERSION
FAIL_MESSAGE "Failed to find all ICU components")
unset(_ICU_REQUIRED_LIBS_FOUND)
if(ICU_FOUND)
set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
set(ICU_LIBRARIES "${ICU_LIBRARY}")
foreach(_ICU_component ${ICU_FIND_COMPONENTS})
string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
set(_ICU_component_found "ICU_${_ICU_component_upcase}_FOUND")
set(_ICU_imported_target "ICU::${_ICU_component}")
if(${_ICU_component_found})
set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
if(NOT TARGET ${_ICU_imported_target})
add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
if(ICU_INCLUDE_DIR)
set_target_properties(${_ICU_imported_target} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
endif()
if(EXISTS "${${_ICU_component_cache}}")
set_target_properties(${_ICU_imported_target} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${${_ICU_component_cache}}")
endif()
if(EXISTS "${${_ICU_component_cache_release}}")
set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(${_ICU_imported_target} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
endif()
if(EXISTS "${${_ICU_component_cache_debug}}")
set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(${_ICU_imported_target} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
endif()
if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
set_target_properties(${_ICU_imported_target} PROPERTIES
INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
endif()
endif()
endif()
unset(_ICU_component_upcase)
unset(_ICU_component_cache)
unset(_ICU_component_lib)
unset(_ICU_component_found)
unset(_ICU_imported_target)
endforeach()
endif()
if(ICU_DEBUG)
message(STATUS "--------FindICU.cmake results debug--------")
message(STATUS "ICU found: ${ICU_FOUND}")
message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
foreach(program IN LISTS icu_programs)
string(TOUPPER "${program}" program_upcase)
set(program_lib "ICU_${program_upcase}_EXECUTABLE")
message(STATUS "${program} program: ${program_lib}=${${program_lib}}")
unset(program_upcase)
unset(program_lib)
endforeach()
foreach(data IN LISTS icu_data)
string(TOUPPER "${data}" data_upcase)
string(REPLACE "." "_" data_upcase "${data_upcase}")
set(data_lib "ICU_${data_upcase}")
message(STATUS "${data} data: ${data_lib}=${${data_lib}}")
unset(data_upcase)
unset(data_lib)
endforeach()
foreach(component IN LISTS ICU_FIND_COMPONENTS)
string(TOUPPER "${component}" component_upcase)
set(component_lib "ICU_${component_upcase}_LIBRARIES")
set(component_found "ICU_${component_upcase}_FOUND")
set(component_found_compat "${component_upcase}_FOUND")
message(STATUS "${component} library found: ${component_found}=${${component_found}}")
message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}")
message(STATUS "${component} library: ${component_lib}=${${component_lib}}")
unset(component_upcase)
unset(component_lib)
unset(component_found)
unset(component_found_compat)
endforeach()
message(STATUS "----------------")
endif()
unset(icu_programs)
+575 -10
View File
@@ -1,8 +1,134 @@
diff --git a/libs/iostreams/CMakeLists.txt b/libs/iostreams/CMakeLists.txt
index 1d8352f5..11f8e584 100644
--- a/libs/iostreams/CMakeLists.txt
+++ b/libs/iostreams/CMakeLists.txt
@@ -6,6 +6,8 @@ cmake_minimum_required(VERSION 3.5...3.16)
diff -Naur boost/libs/iostreams/cmake/FindZLIB.cmake BOOST_BLD/libs/iostreams/cmake/FindZLIB.cmake
--- boost/libs/iostreams/cmake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500
+++ BOOST_BLD/libs/iostreams/cmake/FindZLIB.cmake 2023-09-19 20:06:29.832486499 -0400
@@ -0,0 +1,123 @@
+#.rst:
+# FindZLIB
+# --------
+#
+# Find the native ZLIB includes and library.
+#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
+# ZLIB has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+#
+# ::
+#
+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
+#
+# The following variable are provided for backward compatibility
+#
+# ::
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
+# ZLIB_MINOR_VERSION - The minor version of zlib
+# ZLIB_PATCH_VERSION - The patch version of zlib
+#
+# Hints
+# ^^^^^
+#
+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
+# module where to look.
+
+#=============================================================================
+# Copyright 2001-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+set(_ZLIB_SEARCHES)
+
+# Search ZLIB_ROOT first if it is set.
+if(ZLIB_ROOT)
+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_ZLIB_SEARCH_NORMAL
+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+ "$ENV{PROGRAMFILES}/zlib"
+ )
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+
+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
+
+# Try each search configuration.
+foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
+
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+
+ # only append a TWEAK version if it exists:
+ set(ZLIB_VERSION_TWEAK "")
+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
+
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
+ VERSION_VAR ZLIB_VERSION_STRING)
+
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if(NOT TARGET ZLIB::ZLIB)
+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+ endif()
+endif()
diff -Naur boost/libs/iostreams/CMakeLists.txt BOOST_BLD/libs/iostreams/CMakeLists.txt
--- boost/libs/iostreams/CMakeLists.txt 2023-09-19 20:13:32.123188586 -0400
+++ BOOST_BLD/libs/iostreams/CMakeLists.txt 2023-09-19 20:07:09.587847180 -0400
@@ -6,6 +6,8 @@
project(boost_iostreams VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -11,11 +137,450 @@ index 1d8352f5..11f8e584 100644
add_library(boost_iostreams
src/file_descriptor.cpp
src/mapped_file.cpp
diff --git a/libs/locale/CMakeLists.txt b/libs/locale/CMakeLists.txt
index f47ad394..21956d88 100644
--- a/libs/locale/CMakeLists.txt
+++ b/libs/locale/CMakeLists.txt
@@ -6,6 +6,8 @@ cmake_minimum_required(VERSION 3.11...3.20)
diff -Naur boost/libs/locale/cmake/FindICU.cmake BOOST_BLD/libs/locale/cmake/FindICU.cmake
--- boost/libs/locale/cmake/FindICU.cmake 1969-12-31 19:00:00.000000000 -0500
+++ BOOST_BLD/libs/locale/cmake/FindICU.cmake 2023-09-19 20:12:51.128083577 -0400
@@ -0,0 +1,436 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindICU
+-------
+
+.. versionadded:: 3.7
+
+Find the International Components for Unicode (ICU) libraries and
+programs.
+
+This module supports multiple components.
+Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
+``lx``, ``test``, ``tu`` and ``uc``.
+
+Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
+``in``; any of the names may be used, and the appropriate
+platform-specific library name will be automatically selected.
+
+.. versionadded:: 3.11
+ Added support for static libraries on Windows.
+
+This module reports information about the ICU installation in
+several variables. General variables::
+
+ ICU_VERSION - ICU release version
+ ICU_FOUND - true if the main programs and libraries were found
+ ICU_LIBRARIES - component libraries to be linked
+ ICU_INCLUDE_DIRS - the directories containing the ICU headers
+
+Imported targets::
+
+ ICU::<C>
+
+Where ``<C>`` is the name of an ICU component, for example
+``ICU::i18n``; ``<C>`` is lower-case.
+
+ICU programs are reported in::
+
+ ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
+ ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
+ ICU_GENBRK_EXECUTABLE - path to genbrk executable
+ ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
+ ICU_GENRB_EXECUTABLE - path to genrb executable
+ ICU_GENDICT_EXECUTABLE - path to gendict executable
+ ICU_DERB_EXECUTABLE - path to derb executable
+ ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
+ ICU_UCONV_EXECUTABLE - path to uconv executable
+ ICU_GENCFU_EXECUTABLE - path to gencfu executable
+ ICU_MAKECONV_EXECUTABLE - path to makeconv executable
+ ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
+ ICU_GENCCODE_EXECUTABLE - path to genccode executable
+ ICU_GENSPREP_EXECUTABLE - path to gensprep executable
+ ICU_ICUPKG_EXECUTABLE - path to icupkg executable
+ ICU_GENCMN_EXECUTABLE - path to gencmn executable
+
+ICU component libraries are reported in::
+
+ ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
+ ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
+
+ICU datafiles are reported in::
+
+ ICU_MAKEFILE_INC - Makefile.inc
+ ICU_PKGDATA_INC - pkgdata.inc
+
+This module reads hints about search results from::
+
+ ICU_ROOT - the root of the ICU installation
+
+The environment variable ``ICU_ROOT`` may also be used; the
+ICU_ROOT variable takes precedence.
+
+The following cache variables may also be set::
+
+ ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
+ ICU_INCLUDE_DIR - the directory containing the ICU headers
+ ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
+
+.. note::
+
+ In most cases none of the above variables will require setting,
+ unless multiple ICU versions are available and a specific version
+ is required.
+
+Other variables one may set to control this module are::
+
+ ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#]=======================================================================]
+
+# Written by Roger Leigh <rleigh@codelibre.net>
+
+set(icu_programs
+ gencnval
+ icuinfo
+ genbrk
+ icu-config
+ genrb
+ gendict
+ derb
+ pkgdata
+ uconv
+ gencfu
+ makeconv
+ gennorm2
+ genccode
+ gensprep
+ icupkg
+ gencmn)
+
+set(icu_data
+ Makefile.inc
+ pkgdata.inc)
+
+# The ICU checks are contained in a function due to the large number
+# of temporary variables needed.
+function(_ICU_FIND)
+ # Set up search paths, taking compiler into account. Search ICU_ROOT,
+ # with ICU_ROOT in the environment as a fallback if unset.
+ if(ICU_ROOT)
+ list(APPEND icu_roots "${ICU_ROOT}")
+ else()
+ if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
+ file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
+ list(APPEND icu_roots "${NATIVE_PATH}")
+ set(ICU_ROOT "${NATIVE_PATH}"
+ CACHE PATH "Location of the ICU installation" FORCE)
+ endif()
+ endif()
+
+ # Find include directory
+ list(APPEND icu_include_suffixes "include")
+ find_path(ICU_INCLUDE_DIR
+ NAMES "unicode/utypes.h"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_include_suffixes}
+ DOC "ICU include directory")
+ set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
+
+ # Get version
+ if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+ file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
+ REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
+
+ string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
+ "\\1" icu_version_string "${icu_header_str}")
+ set(ICU_VERSION "${icu_version_string}")
+ set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
+ unset(icu_header_str)
+ unset(icu_version_string)
+ endif()
+
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # 64-bit binary directory
+ set(_bin64 "bin64")
+ # 64-bit library directory
+ set(_lib64 "lib64")
+ endif()
+
+
+ # Find all ICU programs
+ list(APPEND icu_binary_suffixes "${_bin64}" "bin" "sbin")
+ foreach(program ${icu_programs})
+ string(TOUPPER "${program}" program_upcase)
+ set(cache_var "ICU_${program_upcase}_EXECUTABLE")
+ set(program_var "ICU_${program_upcase}_EXECUTABLE")
+ find_program("${cache_var}"
+ NAMES "${program}"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_binary_suffixes}
+ DOC "ICU ${program} executable"
+ NO_PACKAGE_ROOT_PATH
+ )
+ mark_as_advanced("${cache_var}")
+ set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
+ endforeach()
+
+ # Find all ICU libraries
+ list(APPEND icu_library_suffixes "${_lib64}" "lib")
+ set(ICU_REQUIRED_LIBS_FOUND ON)
+ set(static_prefix )
+ # static icu libraries compiled with MSVC have the prefix 's'
+ if(MSVC)
+ set(static_prefix "s")
+ endif()
+ foreach(component ${ICU_FIND_COMPONENTS})
+ string(TOUPPER "${component}" component_upcase)
+ set(component_cache "ICU_${component_upcase}_LIBRARY")
+ set(component_cache_release "${component_cache}_RELEASE")
+ set(component_cache_debug "${component_cache}_DEBUG")
+ set(component_found "ICU_${component_upcase}_FOUND")
+ set(component_found_compat "${component_upcase}_FOUND")
+ set(component_libnames "icu${component}")
+ set(component_debug_libnames "icu${component}d")
+
+ # Special case deliberate library naming mismatches between Unix
+ # and Windows builds
+ unset(component_libnames)
+ unset(component_debug_libnames)
+ list(APPEND component_libnames "icu${component}")
+ list(APPEND component_debug_libnames "icu${component}d")
+ if(component STREQUAL "data")
+ list(APPEND component_libnames "icudt")
+ # Note there is no debug variant at present
+ list(APPEND component_debug_libnames "icudtd")
+ endif()
+ if(component STREQUAL "dt")
+ list(APPEND component_libnames "icudata")
+ # Note there is no debug variant at present
+ list(APPEND component_debug_libnames "icudatad")
+ endif()
+ if(component STREQUAL "i18n")
+ list(APPEND component_libnames "icuin")
+ list(APPEND component_debug_libnames "icuind")
+ endif()
+ if(component STREQUAL "in")
+ list(APPEND component_libnames "icui18n")
+ list(APPEND component_debug_libnames "icui18nd")
+ endif()
+
+ if(static_prefix)
+ unset(static_component_libnames)
+ unset(static_component_debug_libnames)
+ foreach(component_libname ${component_libnames})
+ list(APPEND static_component_libnames
+ ${static_prefix}${component_libname})
+ endforeach()
+ foreach(component_libname ${component_debug_libnames})
+ list(APPEND static_component_debug_libnames
+ ${static_prefix}${component_libname})
+ endforeach()
+ list(APPEND component_libnames ${static_component_libnames})
+ list(APPEND component_debug_libnames ${static_component_debug_libnames})
+ endif()
+ find_library("${component_cache_release}"
+ NAMES ${component_libnames}
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_library_suffixes}
+ DOC "ICU ${component} library (release)"
+ NO_PACKAGE_ROOT_PATH
+ )
+ find_library("${component_cache_debug}"
+ NAMES ${component_debug_libnames}
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_library_suffixes}
+ DOC "ICU ${component} library (debug)"
+ NO_PACKAGE_ROOT_PATH
+ )
+ include(SelectLibraryConfigurations)
+ select_library_configurations(ICU_${component_upcase})
+ mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
+ if(${component_cache})
+ set("${component_found}" ON)
+ set("${component_found_compat}" ON)
+ list(APPEND ICU_LIBRARY "${${component_cache}}")
+ if (ICU_FIND_REQUIRED_${component})
+ list(APPEND ICU_LIBS_FOUND "${component} (required): ${${component_cache}}")
+ else()
+ list(APPEND ICU_LIBS_FOUND "${component} (optional): ${${component_cache}}")
+ endif()
+ else()
+ if (ICU_FIND_REQUIRED_${component})
+ set(ICU_REQUIRED_LIBS_FOUND OFF)
+ list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
+ else()
+ list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
+ endif()
+ endif()
+ mark_as_advanced("${component_found}")
+ mark_as_advanced("${component_found_compat}")
+ set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
+ set("${component_found}" "${${component_found}}" PARENT_SCOPE)
+ set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
+ endforeach()
+ set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
+ set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
+
+ # Find all ICU data files
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ list(APPEND icu_data_suffixes
+ "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+ "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+ "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
+ "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
+ endif()
+ list(APPEND icu_data_suffixes
+ "${_lib64}/icu/${ICU_VERSION}"
+ "lib/icu/${ICU_VERSION}"
+ "${_lib64}/icu"
+ "lib/icu")
+ foreach(data ${icu_data})
+ string(TOUPPER "${data}" data_upcase)
+ string(REPLACE "." "_" data_upcase "${data_upcase}")
+ set(cache_var "ICU_${data_upcase}")
+ set(data_var "ICU_${data_upcase}")
+ find_file("${cache_var}"
+ NAMES "${data}"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_data_suffixes}
+ DOC "ICU ${data} data file")
+ mark_as_advanced("${cache_var}")
+ set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
+ endforeach()
+
+ if(NOT ICU_FIND_QUIETLY)
+ if(ICU_LIBS_FOUND)
+ message(STATUS "Found the following ICU libraries:")
+ foreach(found ${ICU_LIBS_FOUND})
+ message(STATUS " ${found}")
+ endforeach()
+ endif()
+ if(ICU_LIBS_NOTFOUND)
+ message(STATUS "The following ICU libraries were not found:")
+ foreach(notfound ${ICU_LIBS_NOTFOUND})
+ message(STATUS " ${notfound}")
+ endforeach()
+ endif()
+ endif()
+
+ if(ICU_DEBUG)
+ message(STATUS "--------FindICU.cmake search debug--------")
+ message(STATUS "ICU binary path search order: ${icu_roots}")
+ message(STATUS "ICU include path search order: ${icu_roots}")
+ message(STATUS "ICU library path search order: ${icu_roots}")
+ message(STATUS "----------------")
+ endif()
+endfunction()
+
+_ICU_FIND()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
+ FOUND_VAR ICU_FOUND
+ REQUIRED_VARS ICU_INCLUDE_DIR
+ ICU_LIBRARY
+ _ICU_REQUIRED_LIBS_FOUND
+ VERSION_VAR ICU_VERSION
+ FAIL_MESSAGE "Failed to find all ICU components")
+
+unset(_ICU_REQUIRED_LIBS_FOUND)
+
+if(ICU_FOUND)
+ set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
+ set(ICU_LIBRARIES "${ICU_LIBRARY}")
+ foreach(_ICU_component ${ICU_FIND_COMPONENTS})
+ string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
+ set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
+ set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
+ set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
+ set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
+ set(_ICU_component_found "ICU_${_ICU_component_upcase}_FOUND")
+ set(_ICU_imported_target "ICU::${_ICU_component}")
+ if(${_ICU_component_found})
+ set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
+ if(NOT TARGET ${_ICU_imported_target})
+ add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
+ if(ICU_INCLUDE_DIR)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache}}")
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${${_ICU_component_cache}}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache_release}}")
+ set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+ IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache_debug}}")
+ set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+ IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
+ endif()
+ if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
+ endif()
+ endif()
+ endif()
+ unset(_ICU_component_upcase)
+ unset(_ICU_component_cache)
+ unset(_ICU_component_lib)
+ unset(_ICU_component_found)
+ unset(_ICU_imported_target)
+ endforeach()
+endif()
+
+if(ICU_DEBUG)
+ message(STATUS "--------FindICU.cmake results debug--------")
+ message(STATUS "ICU found: ${ICU_FOUND}")
+ message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
+ message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
+ message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
+ message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
+
+ foreach(program IN LISTS icu_programs)
+ string(TOUPPER "${program}" program_upcase)
+ set(program_lib "ICU_${program_upcase}_EXECUTABLE")
+ message(STATUS "${program} program: ${program_lib}=${${program_lib}}")
+ unset(program_upcase)
+ unset(program_lib)
+ endforeach()
+
+ foreach(data IN LISTS icu_data)
+ string(TOUPPER "${data}" data_upcase)
+ string(REPLACE "." "_" data_upcase "${data_upcase}")
+ set(data_lib "ICU_${data_upcase}")
+ message(STATUS "${data} data: ${data_lib}=${${data_lib}}")
+ unset(data_upcase)
+ unset(data_lib)
+ endforeach()
+
+ foreach(component IN LISTS ICU_FIND_COMPONENTS)
+ string(TOUPPER "${component}" component_upcase)
+ set(component_lib "ICU_${component_upcase}_LIBRARIES")
+ set(component_found "ICU_${component_upcase}_FOUND")
+ set(component_found_compat "${component_upcase}_FOUND")
+ message(STATUS "${component} library found: ${component_found}=${${component_found}}")
+ message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}")
+ message(STATUS "${component} library: ${component_lib}=${${component_lib}}")
+ unset(component_upcase)
+ unset(component_lib)
+ unset(component_found)
+ unset(component_found_compat)
+ endforeach()
+ message(STATUS "----------------")
+endif()
+
+unset(icu_programs)
diff -Naur boost/libs/locale/CMakeLists.txt BOOST_BLD/libs/locale/CMakeLists.txt
--- boost/libs/locale/CMakeLists.txt 2023-09-19 20:13:32.379183041 -0400
+++ BOOST_BLD/libs/locale/CMakeLists.txt 2023-09-19 20:12:31.660513836 -0400
@@ -6,6 +6,8 @@
project(boost_locale VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
-78
View File
@@ -1,78 +0,0 @@
# Decide if we're using Bullet
cad_enable(BULLET "libged")
bext_enable(Bullet)
# Decision made, start processing if we are enabled
if (ENABLE_BULLET)
git_submodule_init(bullet3 CMakeLists.txt)
RegisterDeps(BULLET)
set(BULLET_CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
-DINSTALL_LIBS=ON
-DUSE_DOUBLE_PRECISION=ON
-DUSE_GRAPHICAL_BENCHMARK=OFF
-DBUILD_BULLET3=OFF
-DBUILD_EXTRAS=OFF
-DENABLE_VHACD=OFF
-DBUILD_CPU_DEMOS=OFF
-DUSE_GLUT=OFF
-DBUILD_ENET=OFF
-DBUILD_CLSOCKET=OFF
-DBUILD_EGL=OFF
-DBUILD_OPENGL3_DEMOS=OFF
-DBUILD_BULLET2_DEMOS=OFF
-DBUILD_UNIT_TESTS=OFF
)
if(MSVC)
list(APPEND BULLET_CMAKE_ARGS
-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
)
endif()
ExternalProject_Add(BULLET_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/bullet3"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/bullet_cmake.patch
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/bullet_wdocumentation.patch
CMAKE_ARGS ${BULLET_CMAKE_ARGS}
-DBUILD_UNIT_TESTS=OFF
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
TargetInstallDeps(BULLET BULLET_DEPENDS)
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/bullet3/LICENSE.txt
${DOC_LICENSE_DIR}/bullet.txt
COPYONLY
)
endif (ENABLE_BULLET)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
Submodule bullet/bullet3 deleted from 63c4d67e33
-12
View File
@@ -1,12 +0,0 @@
diff -Naur bullet3/CMakeLists.txt BULLET_BLD/CMakeLists.txt
--- bullet3/CMakeLists.txt 2026-03-18 12:04:48.152344880 -0400
+++ BULLET_BLD/CMakeLists.txt 2026-03-18 09:52:07.100507175 -0400
@@ -23,6 +23,8 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
#MESSAGE("CMAKE_CXX_FLAGS_DEBUG="+${CMAKE_CXX_FLAGS_DEBUG})
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
SET(CLAMP_VELOCITIES "0" CACHE STRING "Clamp rigid bodies' velocity to this value, if larger than zero. Useful to prevent floating point errors or in general runaway velocities in complex scenarios")
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
-197
View File
@@ -1,197 +0,0 @@
diff --git a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
index 1febc2b..e2b550c 100644
--- a/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
+++ b/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
@@ -240,7 +240,7 @@ This is accessible through btGeneric6DofConstraint.getLimitMotor method,
This brings support for limit parameters and motors. </li>
<li> Angulars limits have these possible ranges:
-<table border=1 >
+<table border="1" >
<tr>
<td><b>AXIS</b></td>
<td><b>MIN ANGLE</b></td>
diff --git a/src/LinearMath/btMatrix3x3.h b/src/LinearMath/btMatrix3x3.h
index 4391a52..d43d51c 100644
--- a/src/LinearMath/btMatrix3x3.h
+++ b/src/LinearMath/btMatrix3x3.h
@@ -708,7 +708,7 @@ public:
* @param rot stores the rotation from the coordinate system in which the matrix is diagonal to the original
* coordinate system, i.e., old_this = rot * new_this * rot^T.
* @param threshold See iteration
- * @param iteration The iteration stops when all off-diagonal elements are less than the threshold multiplied
+ * @param maxSteps The iteration stops when all off-diagonal elements are less than the threshold multiplied
* by the sum of the absolute values of the diagonal, or when maxSteps have been executed.
*
* Note that this matrix is assumed to be symmetric.
@@ -794,8 +794,8 @@ public:
/**@brief Calculate the matrix cofactor
* @param r1 The first row to use for calculating the cofactor
* @param c1 The first column to use for calculating the cofactor
- * @param r1 The second row to use for calculating the cofactor
- * @param c1 The second column to use for calculating the cofactor
+ * @param r2 The second row to use for calculating the cofactor
+ * @param c2 The second column to use for calculating the cofactor
* See http://en.wikipedia.org/wiki/Cofactor_(linear_algebra) for more details
*/
btScalar cofac(int r1, int c1, int r2, int c2) const
diff --git a/src/LinearMath/btQuadWord.h b/src/LinearMath/btQuadWord.h
index 851596b..682a13c 100644
--- a/src/LinearMath/btQuadWord.h
+++ b/src/LinearMath/btQuadWord.h
@@ -142,9 +142,9 @@ public:
}
/**@brief Set x,y,z and zero w
- * @param x Value of x
- * @param y Value of y
- * @param z Value of z
+ * @param _x Value of x
+ * @param _y Value of y
+ * @param _z Value of z
*/
SIMD_FORCE_INLINE void setValue(const btScalar& _x, const btScalar& _y, const btScalar& _z)
{
@@ -162,10 +162,10 @@ public:
}
*/
/**@brief Set the values
- * @param x Value of x
- * @param y Value of y
- * @param z Value of z
- * @param w Value of w
+ * @param _x Value of x
+ * @param _y Value of y
+ * @param _z Value of z
+ * @param _w Value of w
*/
SIMD_FORCE_INLINE void setValue(const btScalar& _x, const btScalar& _y, const btScalar& _z, const btScalar& _w)
{
@@ -181,9 +181,9 @@ public:
}
/**@brief Three argument constructor (zeros w)
- * @param x Value of x
- * @param y Value of y
- * @param z Value of z
+ * @param _x Value of x
+ * @param _y Value of y
+ * @param _z Value of z
*/
SIMD_FORCE_INLINE btQuadWord(const btScalar& _x, const btScalar& _y, const btScalar& _z)
{
@@ -191,10 +191,10 @@ public:
}
/**@brief Initializing constructor
- * @param x Value of x
- * @param y Value of y
- * @param z Value of z
- * @param w Value of w
+ * @param _x Value of x
+ * @param _y Value of y
+ * @param _z Value of z
+ * @param _w Value of w
*/
SIMD_FORCE_INLINE btQuadWord(const btScalar& _x, const btScalar& _y, const btScalar& _z, const btScalar& _w)
{
diff --git a/src/LinearMath/btQuaternion.h b/src/LinearMath/btQuaternion.h
index 40d6e14..6c68fae 100644
--- a/src/LinearMath/btQuaternion.h
+++ b/src/LinearMath/btQuaternion.h
@@ -84,8 +84,8 @@ public:
{
}
/**@brief Axis angle Constructor
- * @param axis The axis which the rotation is around
- * @param angle The magnitude of the rotation around the angle (Radians) */
+ * @param _axis The axis which the rotation is around
+ * @param _angle The magnitude of the rotation around the angle (Radians) */
btQuaternion(const btVector3& _axis, const btScalar& _angle)
{
setRotation(_axis, _angle);
@@ -104,7 +104,7 @@ public:
}
/**@brief Set the rotation using axis angle notation
* @param axis The axis around which to rotate
- * @param angle The magnitude of the rotation in Radians */
+ * @param _angle The magnitude of the rotation in Radians */
void setRotation(const btVector3& axis, const btScalar& _angle)
{
btScalar d = axis.length();
@@ -134,9 +134,9 @@ public:
cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
}
/**@brief Set the quaternion using euler angles
- * @param yaw Angle around Z
- * @param pitch Angle around Y
- * @param roll Angle around X */
+ * @param yawZ Angle around Z
+ * @param pitchY Angle around Y
+ * @param rollX Angle around X */
void setEulerZYX(const btScalar& yawZ, const btScalar& pitchY, const btScalar& rollX)
{
btScalar halfYaw = btScalar(yawZ) * btScalar(0.5);
@@ -155,9 +155,9 @@ public:
}
/**@brief Get the euler angles from this quaternion
- * @param yaw Angle around Z
- * @param pitch Angle around Y
- * @param roll Angle around X */
+ * @param yawZ Angle around Z
+ * @param pitchY Angle around Y
+ * @param rollX Angle around X */
void getEulerZYX(btScalar& yawZ, btScalar& pitchY, btScalar& rollX) const
{
btScalar squ;
diff --git a/src/LinearMath/btVector3.h b/src/LinearMath/btVector3.h
index 9da1627..942f1a0 100644
--- a/src/LinearMath/btVector3.h
+++ b/src/LinearMath/btVector3.h
@@ -119,9 +119,9 @@ public:
}
/**@brief Constructor from scalars
- * @param x X value
- * @param y Y value
- * @param z Z value
+ * @param _x X value
+ * @param _y Y value
+ * @param _z Z value
*/
SIMD_FORCE_INLINE btVector3(const btScalar& _x, const btScalar& _y, const btScalar& _z)
{
@@ -155,7 +155,7 @@ public:
#endif // #if defined (BT_USE_SSE_IN_API) || defined (BT_USE_NEON)
/**@brief Add a vector to this one
- * @param The vector to add to this one */
+ * @param v The vector to add to this one */
SIMD_FORCE_INLINE btVector3& operator+=(const btVector3& v)
{
#if defined(BT_USE_SSE_IN_API) && defined(BT_USE_SSE)
@@ -171,7 +171,7 @@ public:
}
/**@brief Subtract a vector from this one
- * @param The vector to subtract */
+ * @param v The vector to subtract */
SIMD_FORCE_INLINE btVector3& operator-=(const btVector3& v)
{
#if defined(BT_USE_SSE_IN_API) && defined(BT_USE_SSE)
@@ -1190,10 +1190,10 @@ public:
}
*/
/**@brief Set the values
- * @param x Value of x
- * @param y Value of y
- * @param z Value of z
- * @param w Value of w
+ * @param _x Value of x
+ * @param _y Value of y
+ * @param _z Value of z
+ * @param _w Value of w
*/
SIMD_FORCE_INLINE void setValue(const btScalar& _x, const btScalar& _y, const btScalar& _z, const btScalar& _w)
{
-80
View File
@@ -1,80 +0,0 @@
diff -Naur CLIPPER2_BLD/CMakeLists.txt CLIPPER2/CMakeLists.txt
--- CLIPPER2_BLD/CMakeLists.txt 2026-04-30 12:34:52.299493949 -0400
+++ CLIPPER2/CMakeLists.txt 2026-04-30 12:38:11.412869621 -0400
@@ -18,6 +18,7 @@
option(USE_EXTERNAL_GTEST "Use system-wide installed GoogleTest" OFF)
option(USE_EXTERNAL_GBENCHMARK "Use the googlebenchmark" OFF)
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
+option(BUILD_STATIC_LIBS "Also build static library archives (Clipper2-static / Clipper2Z-static) alongside the primary libraries" OFF)
set(CLIPPER2_USINGZ "ON" CACHE STRING "Build Clipper2Z, either \"ON\" or \"OFF\" or \"ONLY\"")
# CLIPPER2_MAX_DECIMAL_PRECISION: maximum decimal precision when scaling PathsD to Paths64.
@@ -78,6 +79,68 @@
endif()
endif()
+# -----------------------------------------------------------------------
+# Optional static library targets (meaningful when BUILD_SHARED_LIBS=ON)
+# -----------------------------------------------------------------------
+if(BUILD_STATIC_LIBS)
+ set(CLIPPER2_STATIC_LIBS "")
+
+ if (NOT (CLIPPER2_USINGZ STREQUAL "ONLY"))
+ list(APPEND CLIPPER2_STATIC_LIBS Clipper2_static)
+ add_library(Clipper2_static STATIC ${CLIPPER2_INC} ${CLIPPER2_SRC})
+
+ set_target_properties(Clipper2_static PROPERTIES
+ OUTPUT_NAME Clipper2-static
+ EXPORT_NAME Clipper2-static
+ )
+
+ target_compile_definitions(Clipper2_static PUBLIC
+ CLIPPER2_MAX_DECIMAL_PRECISION=${CLIPPER2_MAX_DECIMAL_PRECISION}
+ $<$<BOOL:${CLIPPER2_HI_PRECISION}>:CLIPPER2_HI_PRECISION>
+ )
+
+ target_include_directories(Clipper2_static PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Clipper2Lib/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
+
+ if (NOT MSVC)
+ target_link_libraries(Clipper2_static PUBLIC m)
+ endif()
+ endif()
+
+ if (NOT (CLIPPER2_USINGZ STREQUAL "OFF"))
+ list(APPEND CLIPPER2_STATIC_LIBS Clipper2Z_static)
+ add_library(Clipper2Z_static STATIC ${CLIPPER2_INC} ${CLIPPER2_SRC})
+
+ set_target_properties(Clipper2Z_static PROPERTIES
+ OUTPUT_NAME Clipper2Z-static
+ EXPORT_NAME Clipper2Z-static
+ )
+
+ target_compile_definitions(Clipper2Z_static PUBLIC
+ USINGZ
+ CLIPPER2_MAX_DECIMAL_PRECISION=${CLIPPER2_MAX_DECIMAL_PRECISION}
+ $<$<BOOL:${CLIPPER2_HI_PRECISION}>:CLIPPER2_HI_PRECISION>
+ )
+
+ target_include_directories(Clipper2Z_static PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Clipper2Lib/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
+
+ if (NOT MSVC)
+ target_link_libraries(Clipper2Z_static PUBLIC m)
+ endif()
+ endif()
+
+ install(TARGETS ${CLIPPER2_STATIC_LIBS} EXPORT Clipper2-targets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+endif()
+
+
# secondary Clipper2 library with USINGZ defined (if required)
if (NOT (CLIPPER2_USINGZ STREQUAL "OFF"))
list(APPEND CLIPPER2_LIBS Clipper2Z)
+299
View File
@@ -0,0 +1,299 @@
###############################################################################
# Applying patch files cross platform is a challenging problem due to the
# shortage of portable tools and issues with LF vs CRLF files - see
# https://gitlab.kitware.com/cmake/cmake/-/issues/16854 for more background on
# this. We need to address the patch build tool first thing, since any of the
# other ExternalProject_Add builds that follow may depend on it.
###############################################################################
add_project(patch)
###############################################################################
# Although we have bundled flex and bison programs, they can be problematic to
# build - they require working Autotools tool chains (except on Windows where
# we have winflexbison). We therefore attempt these builds only if we need to.
# This check must come after the patch subdirectory, since if we DO add_project
# the flexbison directory it will need the patch executable.
###############################################################################
if (USE_APPLESEED OR USE_OSPRAY)
find_package(FLEX)
if (NOT FLEX_FOUND)
set(ENABLE_FLEX ON)
endif (NOT FLEX_FOUND)
find_package(BISON)
if (NOT BISON_FOUND)
set(ENABLE_BISON ON)
endif (NOT BISON_FOUND)
if (ENABLE_FLEX OR ENABLE_BISON)
add_project(flexbison GROUPS "APPLESEED;OSPRAY")
endif (ENABLE_FLEX OR ENABLE_BISON)
# Whether or not we actually added the subdirectories, let subsequent targets
# know we have handled the FLEX and BISON dependencies. Some will list these
# as potential build targets, since we may try to compile them, but as the
# default orientation for these is "build only if we have to" the find
# process itself needs to satisfy the check.
set(FLEX_ADDED 1)
set(BISON_ADDED 1)
endif (USE_APPLESEED OR USE_OSPRAY)
###############################################################################
# Build tools are used during compilation, but are not bundled or distributed
# with binary packages. We group these tools here for convenience. Unlike the
# build targets intended for distribution, these outputs are all
# targeted to the noinstall subdirectory.
###############################################################################
add_project(astyle GROUPS "BRLCAD")
add_project(lemon GROUPS "BRLCAD")
add_project(re2c GROUPS "BRLCAD")
add_project(perplex GROUPS "BRLCAD")
add_project(strclear GROUPS "BRLCAD")
add_project(xmltools GROUPS "BRLCAD_EXTRA") # Used for Docbook building
# RPATH editing - LIEF has the core capabilities, and plief exposes them via
# a command line utility with patchelf compatible options, so we can drop
# either patchelf or plief into our upstream workflows.
add_project(lief GROUPS "BRLCAD")
add_project(plief GROUPS "BRLCAD")
# Keeping this set up for easy turn-on until we're confident plief+LIEF has
# all of our use cases covered - plief is preferred, but we've already hit
# one case where a bug in LIEF had to be fixed.
#add_project(patchelf GROUPS "BRLCAD")
###############################################################################
# Build logic is broken out per-library, but the ordering is important. Some
# libraries will depend on others listed here (for example, we want openNURBS
# to use our bundled zlib if it is enabled.) Developers adding, reordering or
# removing dependencies here need to make sure they are aware of impact they
# may be having on other external projects in other files.
###############################################################################
# zlib compression/decompression library
# https://zlib.net
add_project(zlib GROUPS "APPLESEED;BRLCAD;OSPRAY")
# zstd - fast lossless compression library
# https://github.com/facebook/zstd
add_project(zstd GROUPS "APPLESEED;OSPRAY")
# minizip-ng - zip manipulation library written in C
# https://github.com/zlib-ng/minizip-ng
add_project(minizip-ng GROUPS "APPLESEED")
# LZ4 - lossless compression algorithm
# https://github.com/lz4/lz4
add_project(lz4 GROUPS "APPLESEED")
# libdeflate fast, whole-buffer DEFLATE-based compression
# https://github.com/ebiggers/libdeflate
add_project(deflate GROUPS "APPLESEED")
# fmt - formatting library providing an alternative to C++ iostreams
# https://github.com/fmtlib/fmt
add_project(fmt GROUPS "APPLESEED")
# yaml-cpp - YAML parser and emitter in C++ matching the YAML 1.2 spec
# https://github.com/jbeder/yaml-cpp
add_project(yaml-cpp GROUPS "APPLESEED")
# pystring - collection of C++ functions which match the interface and behavior
# of python's string class methods
# https://github.com/imageworks/pystring
add_project(pystring GROUPS "APPLESEED")
# Henry Spencer's regular expression matching library
# https://github.com/BRL-CAD/regex
add_project(regex GROUPS "BRLCAD")
# expat - library for parsing XML 1.0 Fourth Edition
# https://github.com/libexpat/libexpat
add_project(expat GROUPS "APPLESEED")
# International Components for Unicode
# https://github.com/unicode-org/icu
add_project(icu GROUPS "APPLESEED")
# Xerces-C++ - a validating XML parser
# https://xerces.apache.org/xerces-c/
add_project(xerces-c GROUPS "APPLESEED")
# Boost - C++ libraries
# https://www.boost.org
# https://github.com/boostorg/boost
add_project(boost GROUPS "APPLESEED")
# netpbm library - support for pnm,ppm,pbm, etc. image files
# http://netpbm.sourceforge.net/
add_project(netpbm GROUPS "BRLCAD")
# libjpeg-turbo - JPEG image codec
# https://github.com/libjpeg-turbo/libjpeg-turbo
add_project(jpeg GROUPS "APPLESEED;GDAL")
# libpng - Portable Network Graphics image file support
# http://www.libpng.org/pub/png/libpng.html
add_project(png GROUPS "APPLESEED;BRLCAD")
# libtiff - Tag Image File Format (TIFF) support
# https://libtiff.gitlab.io/libtiff/
# https://gitlab.com/libtiff/libtiff
add_project(tiff GROUPS "APPLESEED;GDAL")
# OpenEXR - EXR image storage format
# https://openexr.com/
# https://github.com/AcademySoftwareFoundation/openexr
add_project(openexr GROUPS "APPLESEED")
# UtahRLE - Raster Image library
# https://github.com/BRL-CAD/utahrle
add_project(utahrle GROUPS "BRLCAD")
# OpenColorIO - color management
# https://opencolorio.org
# https://github.com/AcademySoftwareFoundation/OpenColorIO
# Note - the VFX Reference Platform (https://vfxplatform.com/)
# is a useful reference for what versions to expect elements
# of the rendering pipeline software stack to use/require
add_project(opencolorio GROUPS "APPLESEED")
# OpenImageIO - reading and writing images, aimed at VFX studios
# https://github.com/OpenImageIO/oiio
add_project(openimageio GROUPS "APPLESEED")
# ncurses - text-based user interfaces library
# https://invisible-island.net/ncurses/
add_project(ncurses GROUPS "OSPRAY")
# Linenoise - line editing library
# https://github.com/msteveb/linenoise
add_project(linenoise GROUPS "BRLCAD")
# Lightning Memory-Mapped Database
# https://github.com/LMDB/lmdb
add_project(lmdb GROUPS "BRLCAD")
# Eigen - linear algebra library
# https://eigen.tuxfamily.org
add_project(eigen GROUPS "BRLCAD;APPLESEED")
# oneTBB - Threading Building Blocks
# https://github.com/oneapi-src/oneTBB
add_project(onetbb GROUPS "APPLESEED;OSPRAY")
# rkcommon - C++ infrastructure and CMake utilities
# https://github.com/ospray/rkcommon
add_project(rkcommon GROUPS "OSPRAY")
# LLVM - code generation support
# https://llvm.org/
add_project(llvm GROUPS "APPLESEED;OSPRAY")
# ISPC - Implicit SPMD Program Compiler
# https://ispc.github.io
# https://github.com/ispc/ispc
add_project(ispc GROUPS "OSPRAY")
# STEPcode - support for reading and writing STEP files
# https://github.com/stepcode/stepcode
add_project(stepcode GROUPS "BRLCAD_EXTRA")
# SQLITE3 - embeddable database
# https://www.sqlite.org
add_project(sqlite3 GROUPS "GDAL")
# PROJ - generic coordinate transformation
# https://proj.org
add_project(proj GROUPS "GDAL")
# GDAL - translator library for raster and vector geospatial data formats
# https://gdal.org
add_project(gdal GROUPS "GDAL")
# pugixml - a light-weight C++ XML processing library
# https://pugixml.org/
add_project(pugixml GROUPS "BRLCAD;APPLESEED")
# Open Asset Import Library - library for supporting I/O for a number of
# Geometry file formats
# https://github.com/assimp/assimp
add_project(assetimport GROUPS "BRLCAD")
# OpenCV - Open Source Computer Vision Library
# http://opencv.org
add_project(opencv GROUPS "BRLCAD_EXTRA")
# GeometricTools - a collection of geometry algorithms.
# https://github.com/davideberly/GeometricTools
add_project(gte GROUPS "BRLCAD")
# Adaptive Multigrid Solvers - Poisson Surface Reconstruction code.
# https://github.com/mkazhdan/PoissonRecon
#add_project(poissonrecon GROUPS "BRLCAD")
# OpenMesh Library - library for representing and manipulating polygonal meshes
# https://www.graphics.rwth-aachen.de/software/openmesh/
add_project(openmesh GROUPS "BRLCAD_EXTRA")
# Manifold Library - used for performing boolean ops on meshes
# https://github.com/elalish/manifold
add_project(manifold GROUPS "BRLCAD")
# openNURBS - Non-Uniform Rational BSpline library
# https://github.com/mcneel/opennurbs
add_project(opennurbs GROUPS "BRLCAD")
# OSMesa - Off Screen Mesa Rendering Library
# https://github.com/starseeker/osmesa
add_project(osmesa GROUPS "BRLCAD")
# Geogram - a programming library with geometric algorithms
# https://github.com/BrunoLevy/geogram
add_project(geogram GROUPS "BRLCAD_EXTRA")
# Open Shading Language (OSL) - language for programmable shading
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#
# TODO - need to check if https://github.com/lexxmark/winflexbison will
# work for Windows for OSL's usage of flex/bison...
add_project(osl GROUPS "APPLESEED")
# Embree raytracing kernel
# https://github.com/embree/embree
add_project(embree GROUPS "APPLESEED;OSPRAY")
# TCL - scripting language. For Tcl/Tk builds we want
# static lib building on so we get the stub libraries.
# https://www.tcl.tk
set(TCL_ENABLE_TK ON CACHE BOOL "enable tk")
add_project(tcl GROUPS "TCL")
add_project(tk GROUPS "TCL")
add_project(itcl GROUPS "TCL")
add_project(itk GROUPS "TCL")
add_project(iwidgets GROUPS "TCL")
add_project(tkhtml GROUPS "TCL")
add_project(tktable GROUPS "TCL")
# Qt - cross-platform user interface/application development toolkit
# https://download.qt.io/archive/qt
add_project(qt GROUPS "QT")
# Appleseed - global illumination rendering engine
# https://github.com/appleseedhq/appleseed
add_project(appleseed GROUPS "APPLESEED")
# OSPRay - ray tracing engine
# https://github.com/ospray/OSPRay
add_project(ospray GROUPS "OSPRAY")
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+167
View File
@@ -0,0 +1,167 @@
/* D E P E N D E N C I E S . D O T
*
* Copyright (c) 2023 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* Redistribution and use in source (Graphviz format) and 'compiled'
* forms (PDF, PostScript, HTML, RTF, etc.), with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code (DOT format) must retain the
* above copyright notice, this list of conditions and the following
* disclaimer.
*
* 2. Redistributions in compiled form (transformed to other DTDs,
* converted to PDF, PostScript, HTML, RTF, and other formats) must
* reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. The name of the author may not be used to endorse or promote
* products derived from this documentation without specific prior
* written permission.
*
* THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* To generate a PDF from this input, use dot:
*
* dot -Tpdf -o bext.pdf bext.dot
*
* The checked-in dependencies.dot file is a prefix - most of the relationships
* between components come from the dependency information in the bext CMake
* build system. The build directory should hold a bext.dot file with that
* information populated.
*
* To generated the most complete DOT file, enable all build options in CMake -
* for example: -DENABLE_ALL=ON -DUSE_APPLESEED=ON -DUSE_OSPRAY=ON
*/
digraph Deps{
// Top level BRL-CAD node
brlcad [color = "black", style = bold, shape = box, URL="https://github.com/BRL-CAD/brlcad", label = "BRL-CAD"];
// Dependency Nodes
appleseed [color = "blue", style = bold, shape = box, URL="https://github.com/appleseedhq/appleseed", label = "Appleseed"];
assetimport [color = "black", style = bold, shape = box, URL="https://github.com/assimp/assimp", label = "ASSIMP"];
astyle [color = "orange", style = bold, shape = box, URL="https://astyle.sourceforge.net/", label = "AStyle"];
bison [color = "orange", style = bold, shape = box, URL="https://www.gnu.org/software/bison", label = "Bison"];
boost [color = "blue", style = bold, shape = box, URL="https://github.com/boostorg/boost", label = "Boost"];
deflate [color = "blue", style = bold, shape = box, URL="https://github.com/ebiggers/libdeflate", label = "libdeflate"];
eigen [color = "black", style = bold, shape = box, URL="https://eigen.tuxfamily.org", label = "Eigen"];
embree [color = "blue", style = bold, shape = box, URL="https://github.com/embree/embree", label = "Embree"];
expat [color = "blue", style = bold, shape = box, URL="https://github.com/libexpat/libexpat", label = "expat"];
flex [color = "orange", style = bold, shape = box, URL="https://github.com/westes/flex", label = "Flex"];
flexbison [color = "orange", style = bold, shape = box, URL="https://github.com/lexxmark/winflexbison", label = "winflexbison"];
fmt [color = "blue", style = bold, shape = box, URL="https://github.com/fmtlib/fmt", label = "fmt"];
gdal [color = "black", style = bold, shape = box, URL="https://gdal.org", label = "GDAL"];
icu [color = "blue", style = bold, shape = box, URL="https://github.com/unicode-org/icu", label = "ICU"];
ispc [color = "blue", style = bold, shape = box, URL="https://github.com/ispc/ispc", label = "ISPC"];
itcl [color = "black", style = bold, shape = box, URL="https://core.tcl-lang.org/itcl", label = "ITcl"];
itk [color = "black", style = bold, shape = box, URL="https://core.tcl-lang.org/itk", label = "ITk"];
iwidgets [color = "black", style = bold, shape = box, URL="https://incrtcl.sourceforge.net/iwidgets/iwidgets.html", label = "Iwidgets"];
jpeg [color = "blue", style = bold, shape = box, URL="https://github.com/libjpeg-turbo/libjpeg-turbo", label = "libjpeg"];
lemon [color = "orange", style = bold, shape = box, URL="https://www.sqlite.org/src/file/tool", label = "Lemon"];
lief [color = "orange", style = bold, shape = box, URL="https://github.com/lief-project/LIEF", label = "LIEF"];
linenoise [color = "black", style = bold, shape = box, URL="https://github.com/msteveb/linenoise", label = "Linenoise"];
llvm [color = "blue", style = bold, shape = box, URL="https://llvm.org", label = "LLVM"];
lmdb [color = "black", style = bold, shape = box, URL="https://github.com/LMDB/lmdb", label = "LMDB"];
lz4 [color = "blue", style = bold, shape = box, URL="https://github.com/lz4/lz4", label = "LZ4"];
minizip_ng [color = "blue", style = bold, shape = box, URL="https://github.com/zlib-ng/minizip-ng", label = "minizip-ng"];
ncurses [color = "blue", style = bold, shape = box, URL="https://invisible-island.net/ncurses", label = "ncurses"];
netpbm [color = "black", style = bold, shape = box, URL="http://netpbm.sourceforge.net", label = "netpbm"];
onetbb [color = "blue", style = bold, shape = box, URL="https://github.com/oneapi-src/oneTBB", label = "oneTBB"];
opencolorio [color = "blue", style = bold, shape = box, URL="https://github.com/AcademySoftwareFoundation/OpenColorIO", label = "OpenColorIO"];
opencv [color = "black", style = bold, shape = box, URL="http://opencv.org", label = "OpenCV"];
openexr [color = "blue", style = bold, shape = box, URL="https://github.com/AcademySoftwareFoundation/openexr", label = "OpenEXR"];
openimageio [color = "blue", style = bold, shape = box, URL="https://github.com/OpenImageIO/oiio", label = "OpenImageIO"];
openmesh [color = "black", style = bold, shape = box, URL="https://www.graphics.rwth-aachen.de/software/openmesh", label = "OpenMesh"];
opennurbs [color = "black", style = bold, shape = box, URL="https://github.com/mcneel/opennurbs", label = "openNURBS"];
osl [color = "blue", style = bold, shape = box, URL="https://github.com/AcademySoftwareFoundation/OpenShadingLanguage", label = "OSL"];
osmesa [color = "black", style = bold, shape = box, URL="https://github.com/starseeker/osmesa", label = "OSMesa"];
ospray [color = "blue", style = bold, shape = box, URL="https://github.com/ospray/OSPRay", label = "OSPRay"];
//patch [color = "orange", style = bold, shape = box, URL="https://github.com/shannonbooth/patch", label = "Patch"];
patchelf [color = "orange", style = bold, shape = box, URL="https://github.com/NixOS/patchelf", label = "patchelf"];
perplex [color = "orange", style = bold, shape = box, URL="https://github.com/BRL-CAD/perplex", label = "perplex"];
plief [color = "orange", style = bold, shape = box, URL="https://github.com/BRL-CAD/plief", label = "plief"];
png [color = "black", style = bold, shape = box, URL="http://www.libpng.org/pub/png/libpng.html", label = "libpng"];
poly2tri [color = "black", style = bold, shape = box, URL="https://github.com/jhasse/poly2tri", label = "Poly2Tri"];
proj [color = "black", style = bold, shape = box, URL="https://proj.org", label = "PROJ"];
pugixml [color = "black", style = bold, shape = box, URL="https://pugixml.org", label = "pugixml"];
pystring [color = "blue", style = bold, shape = box, URL="https://github.com/imageworks/pystring", label = "pystring"];
qt [color = "black", style = bold, shape = box, URL="https://download.qt.io/archive/qt", label = "Qt"];
re2c [color = "orange", style = bold, shape = box, URL="https://github.com/skvadrik/re2c", label = "re2c"];
regex [color = "black", style = bold, shape = box, URL="https://github.com/BRL-CAD/regex", label = "regex"];
rkcommon [color = "blue", style = bold, shape = box, URL="https://github.com/ospray/rkcommon", label = "rkcommon"];
sqlite3 [color = "black", style = bold, shape = box, URL="https://www.sqlite.org", label = "SQLite3"];
stepcode [color = "black", style = bold, shape = box, URL="https://github.com/stepcode/stepcode", label = "STEPcode"];
strclear [color = "orange", style = bold, shape = box, URL="https://github.com/BRL-CAD/strclear", label = "strclear"];
tcl [color = "black", style = bold, shape = box, URL="https://www.tcl.tk", label = "Tcl"];
tiff [color = "blue", style = bold, shape = box, URL="https://gitlab.com/libtiff/libtiff", label = "libtiff"];
tk [color = "black", style = bold, shape = box, URL="https://www.tcl.tk", label = "Tk"];
tkhtml [color = "black", style = bold, shape = box, URL="https://github.com/BRL-CAD/tkhtml", label = "Tkhtml"];
tktable [color = "black", style = bold, shape = box, URL="https://tktable.sourceforge.net", label = "Tktable"];
utahrle [color = "black", style = bold, shape = box, URL="https://github.com/BRL-CAD/utahrle", label = "UtahRLE"];
xerces_c [color = "blue", style = bold, shape = box, URL="https://xerces.apache.org/xerces-c", label = "Xerces-C++"];
xmltools [color = "orange", style = bold, shape = box, URL="https://github.com/GNOME/libxml2", label = "xmltools"];
yaml_cpp [color = "blue", style = bold, shape = box, URL="https://github.com/jbeder/yaml-cpp", label = "yaml-cpp"];
zlib [color = "black", style = bold, shape = box, URL="https://zlib.net", label = "Zlib"];
zstd [color = "blue", style = bold, shape = box, URL="https://github.com/facebook/zstd", label = "Zstd"];
iwidgets -> itk;
itk -> itcl;
itk -> tk;
tk -> tcl;
tkhtml -> tk;
tktable -> tk;
ispc -> flexbison;
osl -> flexbison;
brlcad -> assetimport;
brlcad -> astyle;
brlcad -> eigen;
brlcad -> gdal;
brlcad -> itcl;
brlcad -> itk;
brlcad -> tcl;
brlcad -> tk;
brlcad -> iwidgets;
brlcad -> lemon;
brlcad -> linenoise;
brlcad -> lmdb;
brlcad -> netpbm;
brlcad -> opencv;
brlcad -> openmesh;
brlcad -> opennurbs;
brlcad -> osmesa;
brlcad -> patchelf;
brlcad -> perplex;
brlcad -> plief;
brlcad -> png;
brlcad -> poly2tri;
brlcad -> qt;
brlcad -> re2c;
brlcad -> regex;
brlcad -> stepcode;
brlcad -> strclear;
brlcad -> tkhtml;
brlcad -> tktable;
brlcad -> utahrle;
brlcad -> xmltools;
brlcad -> zlib;
brlcad -> appleseed;
brlcad -> ospray;
+3 -28
View File
@@ -1,7 +1,7 @@
# Decide if we're using Eigen
cad_enable(EIGEN "libbg;libbn;librt")
unset(EIGEN_BUNDLED CACHE)
unset(ENGEN_BUNDLED CACHE)
if (NOT ENABLE_EIGEN AND NOT DISABLE_EIGEN)
@@ -24,36 +24,10 @@ if (ENABLE_EIGEN)
RegisterDeps(EIGEN)
set(EIGEN_PATCH_FILES "${CMAKE_CURRENT_SOURCE_DIR}/eigen_common.patch")
if (APPLE)
list(APPEND EIGEN_PATCH_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/eigen_macos.patch")
endif (APPLE)
if (MSVC)
list(APPEND EIGEN_PATCH_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/eigen_msvc.patch")
endif (MSVC)
set(EIGEN_PATCH_COMMAND)
foreach(EIGEN_PATCH_FILE IN LISTS EIGEN_PATCH_FILES)
if (NOT EIGEN_PATCH_COMMAND)
set(EIGEN_PATCH_COMMAND
${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i ${EIGEN_PATCH_FILE}
)
else ()
list(APPEND EIGEN_PATCH_COMMAND
COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS}
-i ${EIGEN_PATCH_FILE}
)
endif ()
endforeach ()
unset(EIGEN_PATCH_FILE)
unset(EIGEN_PATCH_FILES)
ExternalProject_Add(EIGEN_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/eigen"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${EIGEN_PATCH_COMMAND}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/eigen.patch
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DEIGEN_BUILD_DOC=OFF
@@ -87,3 +61,4 @@ endif (ENABLE_EIGEN)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+25
View File
@@ -0,0 +1,25 @@
diff -Naur eigen/CMakeLists.txt EIGEN_BLD/CMakeLists.txt
--- eigen/CMakeLists.txt 2024-04-16 20:37:46.506698007 -0400
+++ EIGEN_BLD/CMakeLists.txt 2024-04-16 20:38:21.574118370 -0400
@@ -635,7 +635,7 @@
export (TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake)
# Export Eigen3 package to CMake registry such that it can be easily found by
# CMake even if it has not been installed to a standard directory.
-export (PACKAGE Eigen3)
+#export (PACKAGE Eigen3)
install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
diff -Naur eigen/Eigen/src/Core/util/Memory.h EIGEN_BLD/Eigen/src/Core/util/Memory.h
--- eigen/Eigen/src/Core/util/Memory.h 2024-04-16 20:37:46.522697745 -0400
+++ EIGEN_BLD/Eigen/src/Core/util/Memory.h 2024-04-16 20:37:14.119233248 -0400
@@ -586,6 +586,9 @@
// to the appropriate stack allocation function
#if ! defined EIGEN_ALLOCA && ! defined EIGEN_GPU_COMPILE_PHASE
#if EIGEN_OS_LINUX || EIGEN_OS_MAC || (defined alloca)
+ #if EIGEN_OS_MAC
+ # include <alloca.h>
+ #endif
#define EIGEN_ALLOCA alloca
#elif EIGEN_COMP_MSVC
#define EIGEN_ALLOCA _alloca
-11
View File
@@ -1,11 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -260,7 +260,7 @@
export (TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake)
# Export Eigen3 package to CMake registry such that it can be easily found by
# CMake even if it has not been installed to a standard directory.
- export (PACKAGE Eigen3)
+ #export (PACKAGE Eigen3)
install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
-12
View File
@@ -1,12 +0,0 @@
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -647,6 +647,9 @@
// to the appropriate stack allocation function
#if !defined EIGEN_ALLOCA && !defined EIGEN_GPU_COMPILE_PHASE
#if EIGEN_OS_LINUX || EIGEN_OS_MAC || (defined alloca)
+#if EIGEN_OS_MAC
+# include <alloca.h>
+#endif
#define EIGEN_ALLOCA alloca
#elif EIGEN_COMP_MSVC
#define EIGEN_ALLOCA _alloca
-15
View File
@@ -1,15 +0,0 @@
--- a/lapack/CMakeLists.txt
+++ b/lapack/CMakeLists.txt
@@ -20,6 +20,12 @@
add_custom_target(lapack)
include_directories(../blas)
+
+# Eigen's template-heavy complex LAPACK sources can exceed the default COFF
+# section limit when compiled with MSVC, particularly in debug builds.
+if(MSVC)
+ set_property(SOURCE complex_single.cpp complex_double.cpp APPEND PROPERTY COMPILE_OPTIONS "/bigobj")
+endif()
set(EigenLapack_SRCS
dsecnd_INT_CPU_TIME.cpp second_INT_CPU_TIME.cpp single.cpp double.cpp complex_single.cpp complex_double.cpp
+2 -2
View File
@@ -15,11 +15,10 @@ if (ENABLE_EMBREE)
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/embree.patch
CMAKE_ARGS
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
${BUILD_TYPE_SPECIFIER}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
$<$<BOOL:${ONETBB_TARGET}>:-DTBB_ROOT=${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DTBB_ROOT=$<$<BOOL:${TBB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DISPC_ROOT=$<$<BOOL:${ISPC_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DZLIB_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DEMBREE_TUTORIALS=OFF
@@ -60,3 +59,4 @@ endif (ENABLE_EMBREE)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+1 -1
View File
@@ -3,7 +3,7 @@ bext_enable(EXPAT)
if (ENABLE_EXPAT)
git_submodule_init(libexpat expat/CMakeLists.txt)
git_submodule_init(libexpat CMakeLists.txt)
RegisterDeps(EXPAT)
+11 -23
View File
@@ -57,8 +57,8 @@ if (NOT WIN32)
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/flex.patch
CONFIGURE_COMMAND ${FLEX_SRC_DIR}/autogen.sh
COMMAND ${FLEX_SRC_DIR}/configure --prefix=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 install
BUILD_COMMAND make -j${pcnt}
INSTALL_COMMAND make -j1 install
DEPENDS ${ZLIB_TARGET}
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
@@ -74,35 +74,21 @@ if (NOT WIN32)
git_submodule_init(bison configure)
set(BISON_DEPENDS)
set(BISON_DEPENDS PATCH)
TargetVars(BISON_DEPENDS)
set(BISON_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/BISON_BLD-prefix/src/BISON_BLD")
set(BISON_CONFIGURE_ENV MAKEINFO=true)
if (APPLE)
# macOS 26 declares posix_spawn_file_actions_addchdir, but the symbol is
# unavailable when targeting older macOS releases. Bison 3.8.2's older
# gnulib consequently fails its link check and then redeclares the SDK
# function with an incompatible replacement type. The positive cache
# result makes gnulib select its rpl_ wrapper around the available _np
# function, avoiding both the new symbol and the conflicting declaration.
list(APPEND BISON_CONFIGURE_ENV ac_cv_func_posix_spawn_file_actions_addchdir=yes)
endif (APPLE)
ExternalProject_Add(BISON_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/bison"
BUILD_IN_SOURCE ON
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
# Preserve the shipped Autotools outputs when ExternalProject copies the
# source tree. This prevents make from requiring Autoconf, Autoheader,
# or Automake from the host.
CONFIGURE_COMMAND ${CMAKE_COMMAND};-E;touch_nocreate;${BISON_SRC_DIR}/configure;${BISON_SRC_DIR}/lib/config.in.h;${BISON_SRC_DIR}/Makefile.in
# The release checkout includes generated Info documentation. Do not
# require host Texinfo when staging changes file timestamp ordering.
COMMAND ${CMAKE_COMMAND} -E env ${BISON_CONFIGURE_ENV} ${BISON_SRC_DIR}/configure --prefix=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${BISON_SRC_DIR}/doc/bison.info
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 install
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/bison.patch
CONFIGURE_COMMAND chmod +x ${BISON_SRC_DIR}/autogen.sh
COMMAND ${BISON_SRC_DIR}/autogen.sh
COMMAND ${BISON_SRC_DIR}/configure --prefix=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
BUILD_COMMAND make -j${pcnt}
INSTALL_COMMAND make -j1 install
DEPENDS ${ZLIB_TARGET}
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
@@ -123,3 +109,5 @@ endif (NOT WIN32)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+83
View File
@@ -0,0 +1,83 @@
diff -Naur bison-3.8/autogen.sh bison/autogen.sh
--- bison-3.8/autogen.sh 1969-12-31 19:00:00.000000000 -0500
+++ bison/autogen.sh 2023-09-14 10:59:17.620985283 -0400
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# This file is part of flex.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+
+# Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE.
+
+# If you see no configure script, then run ./autogen.sh to create it
+# and procede with the "normal" build procedures.
+
+# use LIBTOOLIZE, if set
+LIBTOOLIZE_ORIG="$LIBTOOLIZE";
+if test "x$LIBTOOLIZE" = "x"; then LIBTOOLIZE=libtoolize; fi
+
+# test libtoolize
+$LIBTOOLIZE --version 2>/dev/null
+if test "$?" -ne 0; then
+ LIBTOOLIZE=glibtoolize
+ $LIBTOOLIZE --version 2>/dev/null
+ if test "$?" -ne 0; then
+ echo "error: libtoolize not working, re-run with LIBTOOLIZE=/path/to/libtoolize"
+ echo " LIBTOOLIZE is currently \"$LIBTOOLIZE_ORIG\""
+ exit 1
+ fi
+fi
+
+#if we pretend to have a ChangeLog, then automake is less
+#worried. (Don't worry, we *do* have a ChangeLog, we just need the
+#Makefile first.)
+
+if ! test -f ChangeLog; then
+ touch ChangeLog
+fi
+"$LIBTOOLIZE" --install --force
+autoreconf --install --force
diff -Naur bison-3.8/lib/gnulib.mk bison/lib/gnulib.mk
--- bison-3.8/lib/gnulib.mk 2021-09-07 06:54:09.000000000 -0400
+++ bison/lib/gnulib.mk 2023-09-14 11:00:31.903736511 -0400
@@ -1223,7 +1223,7 @@
mv $(top_srcdir)/lib/iconv_open-zos.h-t $(top_srcdir)/lib/iconv_open-zos.h
BUILT_SOURCES += lib/iconv_open-aix.h lib/iconv_open-hpux.h lib/iconv_open-irix.h lib/iconv_open-osf.h lib/iconv_open-solaris.h lib/iconv_open-zos.h
MOSTLYCLEANFILES += lib/iconv_open-aix.h-t lib/iconv_open-hpux.h-t lib/iconv_open-irix.h-t lib/iconv_open-osf.h-t lib/iconv_open-solaris.h-t lib/iconv_open-zos.h-t
-MAINTAINERCLEANFILES += lib/iconv_open-aix.h lib/iconv_open-hpux.h lib/iconv_open-irix.h lib/iconv_open-osf.h lib/iconv_open-solaris.h lib/iconv_open-zos.h
+MAINTAINERCLEANFILES = lib/iconv_open-aix.h lib/iconv_open-hpux.h lib/iconv_open-irix.h lib/iconv_open-osf.h lib/iconv_open-solaris.h lib/iconv_open-zos.h
EXTRA_DIST += lib/iconv_open-aix.h lib/iconv_open-hpux.h lib/iconv_open-irix.h lib/iconv_open-osf.h lib/iconv_open-solaris.h lib/iconv_open-zos.h
EXTRA_DIST += lib/iconv.c lib/iconv_close.c lib/iconv_open-aix.gperf lib/iconv_open-hpux.gperf lib/iconv_open-irix.gperf lib/iconv_open-osf.gperf lib/iconv_open-solaris.gperf lib/iconv_open-zos.gperf lib/iconv_open.c
diff -Naur bison-3.8/Makefile.am bison/Makefile.am
--- bison-3.8/Makefile.am 2021-06-23 00:48:48.000000000 -0400
+++ bison/Makefile.am 2023-09-14 10:57:47.586496865 -0400
@@ -66,12 +66,8 @@
include build-aux/local.mk
include data/local.mk
-include doc/local.mk
-include etc/local.mk
-include examples/local.mk
include lib/local.mk
include src/local.mk
-include tests/local.mk
clean-local:
rm -rf $(CLEANDIRS)
-3
View File
@@ -18,9 +18,6 @@ if (ENABLE_GDAL)
URL "${CMAKE_CURRENT_SOURCE_DIR}/gdal"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/gdal.patch
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/gdal_setjmp.patch
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/modules/packages/FindZLIB.cmake
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindPNG.cmake;<SOURCE_DIR>/cmake/modules/packages/FindPNG.cmake
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
+314 -19
View File
@@ -1,35 +1,329 @@
--- a/cmake/modules/packages/FindSQLite3.cmake
+++ b/cmake/modules/packages/FindSQLite3.cmake
diff -Naurw gdal-3.6.3/cmake/modules/FindPNG.cmake gdal/cmake/modules/FindPNG.cmake
--- gdal-3.6.3/cmake/modules/FindPNG.cmake 1969-12-31 19:00:00.000000000 -0500
+++ gdal/cmake/modules/FindPNG.cmake 2023-08-17 10:20:09.862683802 -0400
@@ -0,0 +1,161 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindPNG
+-------
+
+Find libpng, the official reference library for the PNG image format.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.5
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``PNG::PNG``
+ The libpng library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``PNG_INCLUDE_DIRS``
+ where to find png.h, etc.
+``PNG_LIBRARIES``
+ the libraries to link against to use PNG.
+``PNG_DEFINITIONS``
+ You should add_definitions(${PNG_DEFINITIONS}) before compiling code
+ that includes png library files.
+``PNG_FOUND``
+ If false, do not try to use PNG.
+``PNG_VERSION_STRING``
+ the version of the PNG library found (since CMake 2.8.8)
+
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+The following variables may also be set, for backwards compatibility:
+
+``PNG_LIBRARY``
+ where to find the PNG library.
+``PNG_INCLUDE_DIR``
+ where to find the PNG headers (same as PNG_INCLUDE_DIRS)
+
+Since PNG depends on the ZLib compression library, none of the above
+will be defined unless ZLib can be found.
+#]=======================================================================]
+
+if(PNG_FIND_QUIETLY)
+ set(_FIND_ZLIB_ARG QUIET)
+endif()
+find_package(ZLIB ${_FIND_ZLIB_ARG})
+
+if(ZLIB_FOUND)
+ find_path(PNG_PNG_INCLUDE_DIR png.h PATH_SUFFIXES include/libpng)
+ mark_as_advanced(PNG_PNG_INCLUDE_DIR)
+
+ list(APPEND PNG_NAMES png_brl libpng_brl png libpng)
+ unset(PNG_NAMES_DEBUG)
+ set(_PNG_VERSION_SUFFIXES 17 16 15 14 12)
+ if (PNG_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)(\\..*)?$")
+ set(_PNG_VERSION_SUFFIX_MIN "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+ if (PNG_FIND_VERSION_EXACT)
+ set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN})
+ else ()
+ string(REGEX REPLACE
+ "${_PNG_VERSION_SUFFIX_MIN}.*" "${_PNG_VERSION_SUFFIX_MIN}"
+ _PNG_VERSION_SUFFIXES "${_PNG_VERSION_SUFFIXES}")
+ endif ()
+ unset(_PNG_VERSION_SUFFIX_MIN)
+ endif ()
+ foreach(v IN LISTS _PNG_VERSION_SUFFIXES)
+ list(APPEND PNG_NAMES png_brl${v} libpng_brl${v} png${v} libpng${v} libpng${v}_static)
+ list(APPEND PNG_NAMES_DEBUG png_brl${v}d libpng_brl${v}d png${v}d libpng${v}d libpng${v}_staticd)
+ endforeach()
+ unset(_PNG_VERSION_SUFFIXES)
+ # For compatibility with versions prior to this multi-config search, honor
+ # any PNG_LIBRARY that is already specified and skip the search.
+ if(NOT PNG_LIBRARY)
+ find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} NAMES_PER_DIR)
+ find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} NAMES_PER_DIR)
+ include(SelectLibraryConfigurations)
+ select_library_configurations(PNG)
+ mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG)
+ endif()
+ unset(PNG_NAMES)
+ unset(PNG_NAMES_DEBUG)
+
+ # Set by select_library_configurations(), but we want the one from
+ # find_package_handle_standard_args() below.
+ unset(PNG_FOUND)
+
+ if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
+ # png.h includes zlib.h. Sigh.
+ set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
+ set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatibility
+ set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
+ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
+ ("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
+ list(APPEND PNG_LIBRARIES m)
+ endif()
+
+ if (CYGWIN)
+ if(BUILD_SHARED_LIBS)
+ # No need to define PNG_USE_DLL here, because it's default for Cygwin.
+ else()
+ set (PNG_DEFINITIONS -DPNG_STATIC)
+ set(_PNG_COMPILE_DEFINITIONS PNG_STATIC)
+ endif()
+ endif ()
+
+ if(NOT TARGET PNG::PNG)
+ add_library(PNG::PNG UNKNOWN IMPORTED)
+ set_target_properties(PNG::PNG PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "${_PNG_COMPILE_DEFINITIONS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
+ ("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
+ set_property(TARGET PNG::PNG APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES m)
+ endif()
+
+ if(EXISTS "${PNG_LIBRARY}")
+ set_target_properties(PNG::PNG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${PNG_LIBRARY}")
+ endif()
+ if(EXISTS "${PNG_LIBRARY_RELEASE}")
+ set_property(TARGET PNG::PNG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(PNG::PNG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}")
+ endif()
+ if(EXISTS "${PNG_LIBRARY_DEBUG}")
+ set_property(TARGET PNG::PNG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(PNG::PNG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
+ endif()
+ endif()
+
+ unset(_PNG_COMPILE_DEFINITIONS)
+ endif ()
+
+ if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
+ file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
+
+ string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
+ unset(png_version_str)
+ endif ()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PNG
+ REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
+ VERSION_VAR PNG_VERSION_STRING)
diff -Naur gdal/cmake/modules/packages/FindSQLite3.cmake GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake
--- gdal/cmake/modules/packages/FindSQLite3.cmake 2024-06-25 09:56:45.835498631 -0400
+++ GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake 2024-06-25 09:59:46.365399374 -0400
@@ -57,7 +57,7 @@
NAMES sqlite3.h
HINTS ${PC_SQLITE3_INCLUDE_DIRS})
find_library(SQLite3_LIBRARY
- NAMES sqlite3 sqlite3_i
+ NAMES sqlite3 sqlite3_i libsqlite3 libsqlite libsqlite3_i
NAMES_PER_DIR
HINTS ${PC_SQLITE3_LIBRARY_DIRS})
endif()
--- a/gcore/gdal_multidomainmetadata.h
+++ b/gcore/gdal_multidomainmetadata.h
@@ -18,6 +18,15 @@
#include "cpl_port.h"
#include "cpl_string.h"
+#ifndef STRCASECMP
# Extract version information from the header file
diff -Naurw gdal-3.6.3/cmake/modules/packages/FindZLIB.cmake gdal/cmake/modules/packages/FindZLIB.cmake
--- gdal-3.6.3/cmake/modules/packages/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500
+++ gdal/cmake/modules/packages/FindZLIB.cmake 2023-08-17 10:20:09.866683737 -0400
@@ -0,0 +1,123 @@
+#.rst:
+# FindZLIB
+# --------
+#
+# Find the native ZLIB includes and library.
+#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
+# ZLIB has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+#
+# ::
+#
+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
+#
+# The following variable are provided for backward compatibility
+#
+# ::
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
+# ZLIB_MINOR_VERSION - The minor version of zlib
+# ZLIB_PATCH_VERSION - The patch version of zlib
+#
+# Hints
+# ^^^^^
+#
+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
+# module where to look.
+
+#=============================================================================
+# Copyright 2001-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+set(_ZLIB_SEARCHES)
+
+# Search ZLIB_ROOT first if it is set.
+if(ZLIB_ROOT)
+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_ZLIB_SEARCH_NORMAL
+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+ "$ENV{PROGRAMFILES}/zlib"
+ )
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+
+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
+
+# Try each search configuration.
+foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
+
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+
+ # only append a TWEAK version if it exists:
+ set(ZLIB_VERSION_TWEAK "")
+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
+
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
+ VERSION_VAR ZLIB_VERSION_STRING)
+
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if(NOT TARGET ZLIB::ZLIB)
+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+ endif()
+endif()
diff -Naur gdal/gcore/gdal_priv.h GDAL_BLD/gcore/gdal_priv.h
--- gdal/gcore/gdal_priv.h 2024-06-26 17:01:06.199711566 -0400
+++ GDAL_BLD/gcore/gdal_priv.h 2024-06-26 17:00:48.433037793 -0400
@@ -96,6 +96,13 @@
/* GDALMultiDomainMetadata */
/************************************************************************/
+#if defined(_WIN32)
+#define STRCASECMP(a, b) (_stricmp(a, b))
+#else
+/** Alias for strcasecmp() */
+#define STRCASECMP(a, b) (strcasecmp(a, b))
+#endif
+#endif
+
#include <map>
/*! @cond Doxygen_Suppress */
--- a/gdal.cmake
+++ b/gdal.cmake
@@ -238,12 +238,6 @@
//! @cond Doxygen_Suppress
class CPL_DLL GDALMultiDomainMetadata
{
diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake
--- gdal/gdal.cmake 2024-06-25 09:56:45.660500506 -0400
+++ GDAL_BLD/gdal.cmake 2024-06-25 09:55:37.834206511 -0400
@@ -379,12 +379,6 @@
set_property(TARGET ${GDAL_LIB_TARGET_NAME} PROPERTY PLUGIN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gdalplugins")
@@ -42,9 +336,10 @@
if (MINGW AND BUILD_SHARED_LIBS)
set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES SUFFIX "-${GDAL_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif ()
--- a/port/cpl_port.h
+++ b/port/cpl_port.h
@@ -1019,7 +1019,7 @@
diff -Naur gdal/port/cpl_port.h GDAL_BLD/port/cpl_port.h
--- gdal/port/cpl_port.h 2024-06-25 09:56:45.954497348 -0400
+++ GDAL_BLD/port/cpl_port.h 2024-06-25 09:55:37.836206491 -0400
@@ -1123,7 +1123,7 @@
#define TRUE 1
#endif
-26
View File
@@ -1,26 +0,0 @@
--- a/frmts/png/pngdataset.cpp
+++ b/frmts/png/pngdataset.cpp
@@ -42,7 +42,9 @@
#pragma clang diagnostic pop
#endif
-#include <csetjmp>
+extern "C" {
+#include <setjmp.h>
+}
#include <algorithm>
#include <limits>
--- a/frmts/png/pngdataset.h
+++ b/frmts/png/pngdataset.h
@@ -40,7 +40,9 @@
#include "png.h"
-#include <csetjmp>
+extern "C" {
+#include <setjmp.h>
+}
#include <algorithm>
#include <array>
+60
View File
@@ -0,0 +1,60 @@
# Decide if we're using Geogram
cad_enable(GEOGRAM "librt")
bext_enable(Geogram)
# Decision made, start processing if we are enabled
if (ENABLE_GEOGRAM)
git_submodule_init(geogram CMakeLists.txt)
RegisterDeps(GEOGRAM)
ExternalProject_Add(GEOGRAM_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/geogram"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/geogram_cmake.patch
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/geogram_win32.patch
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
-DGEOGRAM_LIB_ONLY=ON
-DGEOGRAM_WITH_GRAPHICS=OFF
-DGEOGRAM_WITH_LUA=OFF
-DGEOGRAM_WITH_HLBFGS=OFF
-DGEOGRAM_WITH_TETGEN=OFF
-DGEOGRAM_WITH_TRIANGLE=OFF
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
TargetInstallDeps(GEOGRAM GEOGRAM_DEPENDS)
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/geogram/LICENSE
${DOC_LICENSE_DIR}/geogram.txt
COPYONLY
)
endif (ENABLE_GEOGRAM)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+1
Submodule geogram/geogram added at 888172e37e
+41
View File
@@ -0,0 +1,41 @@
diff -Naur geogram/CMakeLists.txt GEOGRAM_BLD/CMakeLists.txt
--- geogram/CMakeLists.txt 2024-04-19 18:18:32.084173009 -0400
+++ GEOGRAM_BLD/CMakeLists.txt 2024-04-19 18:19:29.107021784 -0400
@@ -88,18 +88,6 @@
endif()
##############################################################################
-# RPATH (where executables find the .so / DLLs)
-# - Enables RPATH support for MACOSX
-# - Makes RPATH of dynamic libraries and executable point to the directory
-# where libraries are installed.
-
-if(VORPALINE_BUILD_DYNAMIC)
- set(CMAKE_MACOSX_RPATH 1)
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-endif()
-
-set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-
# uninstall target
# Needs to be created before add_subdirectory() because GLFw has
# also an uninstall target that will be inhibited if there is
diff -Naur geogram/src/lib/geogram/CMakeLists.txt GEOGRAM_BLD/src/lib/geogram/CMakeLists.txt
--- geogram/src/lib/geogram/CMakeLists.txt 2024-04-19 18:18:32.092172847 -0400
+++ GEOGRAM_BLD/src/lib/geogram/CMakeLists.txt 2024-04-19 18:18:42.479961704 -0400
@@ -45,7 +45,7 @@
include_directories(${PROJECT_BINARY_DIR}/src/lib)
-add_library(geogram ${SOURCES} $<TARGET_OBJECTS:geogram_third_party>)
+add_library(geogram SHARED ${SOURCES} $<TARGET_OBJECTS:geogram_third_party>)
target_include_directories(geogram PRIVATE
${PROJECT_SOURCE_DIR}/src/lib/geogram/third_party/amgcl
--- geogram/cmake/platforms/Linux-clang.cmake 2024-07-12 20:43:59.314646694 -0400
+++ GEOGRAM_BLD/cmake/platforms/Linux-clang.cmake 2024-07-12 20:42:45.974952959 -0400
@@ -147,3 +147,4 @@
endmacro()
+add_link_options(-latomic)
+217
View File
@@ -0,0 +1,217 @@
diff -Naur geogram/cmake/FindGeogram.cmake GEOGRAM_BLD/cmake/FindGeogram.cmake
--- geogram/cmake/FindGeogram.cmake 2024-05-16 19:12:42.296106646 -0400
+++ GEOGRAM_BLD/cmake/FindGeogram.cmake 2024-05-16 19:13:05.295717740 -0400
@@ -109,36 +109,3 @@
# Hide variables from the default CMake-Gui options
mark_as_advanced (GEOGRAM_LIBRARY GEOGRAM_GFX_LIBRARY GEOGRAM_INCLUDE_DIR)
-# Some specific settings for Windows
-
-if(WIN32)
-
- # Default mode for Windows uses static libraries. Use this variable to
- # link with geogram compiled as DLLs.
- set(VORPALINE_BUILD_DYNAMIC FALSE CACHE BOOL "Installed Geogram uses DLLs")
-
- # remove warning for multiply defined symbols (caused by multiple
- # instanciations of STL templates)
- add_definitions(/wd4251)
-
- # remove all unused stuff from windows.h
- add_definitions(-DWIN32_LEAN_AND_MEAN)
- add_definitions(-DVC_EXTRALEAN)
-
- # do not define a min() and a max() macro, breaks
- # std::min() and std::max() !!
- add_definitions(-DNOMINMAX )
-
- # we want M_PI etc...
- add_definitions(-D_USE_MATH_DEFINES)
-
- if(NOT VORPALINE_BUILD_DYNAMIC)
- # If we use static library, we link with the static C++ runtime.
- foreach(config ${CMAKE_CONFIGURATION_TYPES})
- string(TOUPPER ${config} config)
- string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
- string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
- endforeach()
- endif()
-
-endif()
diff -Naur geogram/cmake/platforms/Windows-vs.cmake GEOGRAM_BLD/cmake/platforms/Windows-vs.cmake
--- geogram/cmake/platforms/Windows-vs.cmake 2024-05-16 19:12:42.300106579 -0400
+++ GEOGRAM_BLD/cmake/platforms/Windows-vs.cmake 2024-05-16 19:13:46.791015211 -0400
@@ -64,18 +64,9 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
endif()
-# Change flags for static link
-if(VORPALINE_BUILD_DYNAMIC)
# remove warning for multiply defined symbols (caused by multiple
# instanciations of STL templates)
- add_definitions(/wd4251)
-else()
- foreach(config ${CMAKE_CONFIGURATION_TYPES})
- string(TOUPPER ${config} config)
- string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
- string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
- endforeach()
-endif()
+add_definitions(/wd4251)
# Additional release flags
foreach(config RELEASE RELWITHDEBINFO MINSIZEREL)
diff -Naur geogram/src/tutorial/01_basics/hello_geogram/FindGeogram.cmake GEOGRAM_BLD/src/tutorial/01_basics/hello_geogram/FindGeogram.cmake
--- geogram/src/tutorial/01_basics/hello_geogram/FindGeogram.cmake 2024-05-16 19:12:42.376105295 -0400
+++ GEOGRAM_BLD/src/tutorial/01_basics/hello_geogram/FindGeogram.cmake 2024-05-16 19:14:56.457833524 -0400
@@ -5,8 +5,9 @@
#
# This module defines the following variables:
#
-# Geogram_FOUND - True if geogram has been found.
-# Geogram::geogram - Imported target for the main Geogram library.
+# Geogram_FOUND - True if geogram has been found.
+# Geogram::geogram - Imported target for the main Geogram library.
+# Geogram::geogram_gfx - Imported target for Geogram graphics library.
#
# This module reads hints about the Geogram location from the following
# environment variables:
@@ -52,20 +53,20 @@
# system search path since it may be already installed
# in the system
find_library (GEOGRAM_GLFW3_LIBRARY
- NAMES glfw3 glfw geogram_glfw3
+ NAMES glfw3 glfw geogram_glfw3 glfw3dll glfwdll
PATHS ${GEOGRAM_SEARCH_PATHS} ${GEOGRAM_SEARCH_PATHS_SYSTEM}
PATH_SUFFIXES lib
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(
- Geogram DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
+ GEOGRAM DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
)
# Create an imported target for Geogram
-If (Geogram_FOUND)
+If (GEOGRAM_FOUND)
- set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/..)
+ set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/../..)
if (NOT TARGET Geogram::geogram)
add_library (Geogram::geogram UNKNOWN IMPORTED)
@@ -108,36 +109,3 @@
# Hide variables from the default CMake-Gui options
mark_as_advanced (GEOGRAM_LIBRARY GEOGRAM_GFX_LIBRARY GEOGRAM_INCLUDE_DIR)
-# Some specific settings for Windows
-
-if(WIN32)
-
- # Default mode for Windows uses static libraries. Use this variable to
- # link with geogram compiled as DLLs.
- set(VORPALINE_BUILD_DYNAMIC FALSE CACHE BOOL "Installed Geogram uses DLLs")
-
- # remove warning for multiply defined symbols (caused by multiple
- # instanciations of STL templates)
- add_definitions(/wd4251)
-
- # remove all unused stuff from windows.h
- add_definitions(-DWIN32_LEAN_AND_MEAN)
- add_definitions(-DVC_EXTRALEAN)
-
- # do not define a min() and a max() macro, breaks
- # std::min() and std::max() !!
- add_definitions(-DNOMINMAX )
-
- # we want M_PI etc...
- add_definitions(-D_USE_MATH_DEFINES)
-
- if(NOT VORPALINE_BUILD_DYNAMIC)
- # If we use static library, we link with the static C++ runtime.
- foreach(config ${CMAKE_CONFIGURATION_TYPES})
- string(TOUPPER ${config} config)
- string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
- string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
- endforeach()
- endif()
-
-endif()
diff -Naur geogram/src/tutorial/01_basics/hello_GLUP_app/FindGeogram.cmake GEOGRAM_BLD/src/tutorial/01_basics/hello_GLUP_app/FindGeogram.cmake
--- geogram/src/tutorial/01_basics/hello_GLUP_app/FindGeogram.cmake 2024-05-16 19:12:42.376105295 -0400
+++ GEOGRAM_BLD/src/tutorial/01_basics/hello_GLUP_app/FindGeogram.cmake 2024-05-16 19:14:16.402513268 -0400
@@ -5,8 +5,9 @@
#
# This module defines the following variables:
#
-# Geogram_FOUND - True if geogram has been found.
-# Geogram::geogram - Imported target for the main Geogram library.
+# Geogram_FOUND - True if geogram has been found.
+# Geogram::geogram - Imported target for the main Geogram library.
+# Geogram::geogram_gfx - Imported target for Geogram graphics library.
#
# This module reads hints about the Geogram location from the following
# environment variables:
@@ -52,20 +53,20 @@
# system search path since it may be already installed
# in the system
find_library (GEOGRAM_GLFW3_LIBRARY
- NAMES glfw3 glfw geogram_glfw3
+ NAMES glfw3 glfw geogram_glfw3 glfw3dll glfwdll
PATHS ${GEOGRAM_SEARCH_PATHS} ${GEOGRAM_SEARCH_PATHS_SYSTEM}
PATH_SUFFIXES lib
)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(
- Geogram DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
+ GEOGRAM DEFAULT_MSG GEOGRAM_LIBRARY GEOGRAM_INCLUDE_DIR
)
# Create an imported target for Geogram
-If (Geogram_FOUND)
+If (GEOGRAM_FOUND)
- set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/..)
+ set(GEOGRAM_INSTALL_PREFIX ${GEOGRAM_INCLUDE_DIR}/../..)
if (NOT TARGET Geogram::geogram)
add_library (Geogram::geogram UNKNOWN IMPORTED)
@@ -108,36 +109,3 @@
# Hide variables from the default CMake-Gui options
mark_as_advanced (GEOGRAM_LIBRARY GEOGRAM_GFX_LIBRARY GEOGRAM_INCLUDE_DIR)
-# Some specific settings for Windows
-
-if(WIN32)
-
- # Default mode for Windows uses static libraries. Use this variable to
- # link with geogram compiled as DLLs.
- set(VORPALINE_BUILD_DYNAMIC FALSE CACHE BOOL "Installed Geogram uses DLLs")
-
- # remove warning for multiply defined symbols (caused by multiple
- # instanciations of STL templates)
- add_definitions(/wd4251)
-
- # remove all unused stuff from windows.h
- add_definitions(-DWIN32_LEAN_AND_MEAN)
- add_definitions(-DVC_EXTRALEAN)
-
- # do not define a min() and a max() macro, breaks
- # std::min() and std::max() !!
- add_definitions(-DNOMINMAX )
-
- # we want M_PI etc...
- add_definitions(-D_USE_MATH_DEFINES)
-
- if(NOT VORPALINE_BUILD_DYNAMIC)
- # If we use static library, we link with the static C++ runtime.
- foreach(config ${CMAKE_CONFIGURATION_TYPES})
- string(TOUPPER ${config} config)
- string(REPLACE /MD /MT CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}")
- string(REPLACE /MD /MT CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}")
- endforeach()
- endif()
-
-endif()
+1 -1
View File
@@ -6,7 +6,7 @@ diff -Naur GeometricTools/CMakeLists.txt GTE_BLD/CMakeLists.txt
+
+project(GTE)
+
+file(GLOB GTE_MFILES LIST_DIRECTORIES false "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
+file(GLOB GTE_MFILES "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*")
+
+if(NOT DEFINED INCLUDE_DIR)
+ set(INCLUDE_DIR include)
+3 -2
View File
@@ -15,8 +15,8 @@ if (NOT WIN32 AND NOT APPLE)
BUILD_IN_SOURCE ON
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
CONFIGURE_COMMAND <SOURCE_DIR>/<SOURCE_SUBDIR>/configure --disable-extras --disable-tools --disable-tests --disable-samples --prefix=${CMAKE_BUNDLE_INSTALL_PREFIX}
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 install
BUILD_COMMAND make -j${pcnt}
INSTALL_COMMAND make -j1 install
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
@@ -43,3 +43,4 @@ endif (NOT WIN32 AND NOT APPLE)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+11 -86
View File
@@ -15,113 +15,37 @@ if (ENABLE_ISPC)
if (TARGET ZLIB_BLD)
set(Z_PREFIX_STR "brl_")
endif (TARGET ZLIB_BLD)
set(ISPC_PROGRAM_PATH_ARGS)
if (FLEX_TARGET OR BISON_TARGET)
list(APPEND ISPC_PROGRAM_PATH_ARGS
-DCMAKE_PROGRAM_PATH=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}
)
endif ()
if (M4_EXECUTABLE)
# Normalize to forward slashes. M4_EXECUTABLE may arrive with native
# backslashes (e.g. set in CMakePresets as C:\...\m4.exe); passed verbatim
# through ExternalProject_Add's CMAKE_ARGS those backslashes are consumed as
# escapes and the ISPC sub-build sees a mangled, non-existent path.
file(TO_CMAKE_PATH "${M4_EXECUTABLE}" M4_EXECUTABLE_CMAKE)
list(APPEND ISPC_PROGRAM_PATH_ARGS
-DM4_EXECUTABLE=${M4_EXECUTABLE_CMAKE}
)
endif ()
# winflexbison installs its binaries as win_flex.exe / win_bison.exe on
# Windows; the portable names are plain flex / bison elsewhere.
if (WIN32)
set(ISPC_FLEX_NAME win_flex.exe)
set(ISPC_BISON_NAME win_bison.exe)
else ()
set(ISPC_FLEX_NAME flex)
set(ISPC_BISON_NAME bison)
endif ()
set(ISPC_FLEXBISON_ARGS)
if (BISON_TARGET)
list(APPEND ISPC_FLEXBISON_ARGS
-DBISON_EXECUTABLE=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}/${ISPC_BISON_NAME}
)
endif (BISON_TARGET)
if (FLEX_TARGET)
list(APPEND ISPC_FLEXBISON_ARGS
-DFLEX_EXECUTABLE=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${BIN_DIR}/${ISPC_FLEX_NAME}
)
endif (FLEX_TARGET)
# Select the compiler used to build ispc itself. ispc only forces clang on
# UNIX (see its CMakeLists.txt); on Windows it happily builds with MSVC, which
# is in fact the conventional Windows toolchain for ispc. We therefore switch
# to the bundled LLVM clang only where the platform SDK is expected to be
# compatible with that bundled compiler.
if (LLVM_TARGET AND NOT WIN32 AND NOT APPLE)
set(ISPC_C_COMPILER "${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
set(ISPC_CXX_COMPILER "${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
else ()
set(ISPC_C_COMPILER "${CMAKE_C_COMPILER}")
set(ISPC_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
endif ()
set(ISPC_DEBUG_ARGS)
if (WIN32)
# ispc is a build-time codegen tool we never need to debug, and (like LLVM)
# it statically links the large bundled LLVM. In a Debug config MSVC links
# ispc.exe with the default "/debug /INCREMENTAL" and tries to emit a full
# PDB, which fails with LNK1201 (error writing to program database). Suppress
# debug-info generation for the Debug config so ispc links cleanly; the CRT
# selection (and thus Debug/Release compatibility) is unaffected. The quotes
# must wrap the whole -D argument, not just the value -- see llvm/CMakeLists.txt.
list(APPEND ISPC_DEBUG_ARGS
"-DCMAKE_CXX_FLAGS_DEBUG=$<$<CONFIG:Debug>:/DEBUG:NONE>"
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=$<$<CONFIG:Debug>:/DEBUG:NONE /INCREMENTAL:NO>"
)
endif ()
# ispc links against the bundled LLVM. Pass the bundled LLVM clang compiler
# location when we are switching to it (non-Windows); otherwise ispc is built
# with the native compiler above.
# ispc depends on the clang compiler - its build will switch the compiler if
# not already using clang. Need to pass in the bundled LLVM clang compiler
# location, if we have it.
ExternalProject_Add(ISPC_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/ispc"
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/ispc.patch
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/FindZLIB.cmake
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX_STR=${Z_PREFIX_STR}>
# On Windows ispc links itself with /DEPENDENTLOADFLAG:0x800, which limits
# the loader to %SystemRoot%\system32 when resolving the exe's imports. The
# bundled zlib ships as z_brl.dll in the install tree (not system32), so a
# dynamically-linked ispc-slim.exe cannot start (exit 0xC0000135,
# STATUS_DLL_NOT_FOUND) either during the build (when it generates the stdlib
# bitcode) or once installed. Link zlib statically so ispc-slim.exe has no
# non-system DLL dependency and satisfies its own hardening flag. This is
# honored by our FindZLIB.cmake, including the find_package(ZLIB) that the
# bundled LLVM's config re-runs (LLVM is what pulls in the zlib dependency).
$<$<AND:$<BOOL:${WIN32}>,$<BOOL:${ZLIB_TARGET}>>:-DZLIB_USE_STATIC_LIBS=ON>
${ISPC_PROGRAM_PATH_ARGS}
${ISPC_FLEXBISON_ARGS}
-DFLEX_ROOT=$<$<BOOL:${FLEX_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DBISON_ROOT=$<$<BOOL:${BISON_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DCurses_ROOT=$<$<BOOL:${NCURSES_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DLLVM_ROOT=$<$<BOOL:${LLVM_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DZLIB_ROOT=$<$<BOOL:${ZLIB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
$<$<BOOL:${LLVM_TARGET}>:-DLLVM_CONFIG_EXECUTABLE=${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/llvm-config${CMAKE_EXECUTABLE_SUFFIX}>
$<$<BOOL:${LLVM_TARGET}>:-DLLVM_CONFIG_EXECUTABLE=${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/llvm-config>
-DISPC_INCLUDE_EXAMPLES=OFF
-DISPC_INCLUDE_DPCPP_EXAMPLES=OFF
-DISPC_INCLUDE_TESTS=OFF
-DBIN_DIR=${BIN_DIR}
-DLIB_DIR=${LIB_DIR}
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
-DCMAKE_CXX_COMPILER=${ISPC_CXX_COMPILER}
-DCMAKE_C_COMPILER=${ISPC_C_COMPILER}
-DCMAKE_CXX_COMPILER=$<IF:${LLVM_TARGET},${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/clang++,${CMAKE_CXX_COMPILER}>
-DCMAKE_C_COMPILER=$<IF:${LLVM_TARGET},${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/clang,${CMAKE_C_COMPILER}>
#-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
#-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
${ISPC_DEBUG_ARGS}
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
@@ -146,3 +70,4 @@ endif (ENABLE_ISPC)
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+148 -50
View File
@@ -1,36 +1,142 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 042e6dd..0d3a2ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -312,6 +312,7 @@ endif()
diff -Naur ispc/cmake/FindZLIB.cmake ISPC_BLD/cmake/FindZLIB.cmake
--- ispc/cmake/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500
+++ ISPC_BLD/cmake/FindZLIB.cmake 2023-12-21 14:04:49.612387610 -0500
@@ -0,0 +1,123 @@
+#.rst:
+# FindZLIB
+# --------
+#
+# Find the native ZLIB includes and library.
+#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
+# ZLIB has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+# ZLIB_LIBRARIES - List of libraries when using zlib.
+# ZLIB_FOUND - True if zlib found.
+#
+# ::
+#
+# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+# ZLIB_VERSION_MAJOR - The major version of zlib
+# ZLIB_VERSION_MINOR - The minor version of zlib
+# ZLIB_VERSION_PATCH - The patch version of zlib
+# ZLIB_VERSION_TWEAK - The tweak version of zlib
+#
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
+#
+# The following variable are provided for backward compatibility
+#
+# ::
+#
+# ZLIB_MAJOR_VERSION - The major version of zlib
+# ZLIB_MINOR_VERSION - The minor version of zlib
+# ZLIB_PATCH_VERSION - The patch version of zlib
+#
+# Hints
+# ^^^^^
+#
+# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
+# module where to look.
+
+#=============================================================================
+# Copyright 2001-2011 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+set(_ZLIB_SEARCHES)
+
+# Search ZLIB_ROOT first if it is set.
+if(ZLIB_ROOT)
+ set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
+endif()
+
+# Normal search.
+set(_ZLIB_SEARCH_NORMAL
+ PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
+ "$ENV{PROGRAMFILES}/zlib"
+ )
+list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
+
+set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
+
+# Try each search configuration.
+foreach(search ${_ZLIB_SEARCHES})
+ find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
+ find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
+endforeach()
+
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+
+if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+ file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
+ string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
+
+ # only append a TWEAK version if it exists:
+ set(ZLIB_VERSION_TWEAK "")
+ if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)")
+ set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
+ set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
+ endif()
+
+ set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
+ set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
+ set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
+ VERSION_VAR ZLIB_VERSION_STRING)
+
+if(ZLIB_FOUND)
+ set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+ set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if(NOT TARGET ZLIB::ZLIB)
+ add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::ZLIB PROPERTIES
+ IMPORTED_LOCATION "${ZLIB_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
+ endif()
+endif()
diff -Naur ispc/CMakeLists.txt ISPC_BLD/CMakeLists.txt
--- ispc/CMakeLists.txt 2024-06-26 20:46:06.003030179 -0400
+++ ISPC_BLD/CMakeLists.txt 2024-06-26 20:52:51.978011242 -0400
@@ -265,6 +265,7 @@
endif()
set(BITCODE2CPP "${CMAKE_CURRENT_SOURCE_DIR}/scripts/bitcode2cpp.py")
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ispcrt/cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FixWindowsPath.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Git.cmake)
@@ -805,9 +806,18 @@
list(APPEND LINK_OPTIONS_PRIVATE /DYNAMICBASE)
# Control flow guard
list(APPEND LINK_OPTIONS_PRIVATE /GUARD:CF)
# When resolving statically linked import dependencies of the module, limit
# the module search path to %windows%\system32 directory only.
- list(APPEND LINK_OPTIONS_PRIVATE /DEPENDENTLOADFLAG:0x800)
+ # bext: apply this loader hardening only to non-Debug builds. A Debug ispc
+ # depends on the debug CRT DLLs (ucrtbased/msvcp140d/vcruntime140d/
+ # vcruntime140_1d), which are never present in system32. Under
+ # /DEPENDENTLOADFLAG:0x800 the loader searches only system32 and cannot find
+ # them, so ispc-slim.exe fails to start (exit 0xC0000135) when it is run
+ # during the build to generate the stdlib bitcode.
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" ISPC_BEXT_BUILD_TYPE_UC)
+ if (NOT ISPC_BEXT_BUILD_TYPE_UC STREQUAL "DEBUG")
+ list(APPEND LINK_OPTIONS_PRIVATE /DEPENDENTLOADFLAG:0x800)
+ endif()
if (MSVC AND NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
list(APPEND LINK_OPTIONS_PUBLIC /OPT:REF /OPT:ICF)
endif()
@@ -846,6 +847,10 @@ if (NOT WIN32 AND NOT APPLE)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLLVM.cmake)
@@ -712,6 +713,10 @@
list(APPEND LINK_LIBRARIES "-Wl,--start-group")
endif()
@@ -41,25 +147,17 @@ index 042e6dd..0d3a2ca 100644
# Link against Clang libraries
foreach(clangLib ${CLANG_LIBRARY_LIST})
# Preferred way to build ISPC is to link it with individual clang static
diff --git a/src/util.cpp b/src/util.cpp
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -51,4 +51,4 @@
void std::__libcpp_verbose_abort(char const *format, ...)
-#if ISPC_LLVM_VERSION >= ISPC_LLVM_20_0
+#if defined(__APPLE__) || ISPC_LLVM_VERSION >= ISPC_LLVM_20_0
noexcept
#endif
diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake
--- a/cmake/GenerateBuiltins.cmake
+++ b/cmake/GenerateBuiltins.cmake
@@ -357,7 +357,7 @@ function(builtin_xe_to_cpp os)
add_custom_command(
OUTPUT ${bc}
- COMMAND cat ${input} | \"${LLVM_AS_EXECUTABLE}\" -o ${bc}
+ COMMAND "${LLVM_AS_EXECUTABLE}" ${input} -o ${bc}
DEPENDS ${input}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
@@ -762,7 +767,12 @@
# but it contains both libform.so and libcurses.so.
# We need libcurses.so only, so exclude libform.so from the list.
list(FILTER CURSES_LIBRARIES EXCLUDE REGEX ".*libform.*")
- list(APPEND LINK_LIBRARIES pthread ${CURSES_LIBRARIES})
+ list(APPEND LINK_LIBRARIES pthread)
+ if (CURSES_NCURSES_LIBRARY)
+ list(APPEND LINK_LIBRARIES ${CURSES_NCURSES_LIBRARY})
+ elseif (CURSES_NCURSES_LIBRARY)
+ list(APPEND LINK_LIBRARIES ${CURSES_LIBRARIES})
+ endif ()
endif()
endif()
+139
View File
@@ -0,0 +1,139 @@
if (USE_BRLCAD)
# Decide if we're using ITcl
cad_enable(ITCL "archer;mged;bwish;rtwizard;brlman")
else (USE_BRLCAD)
if (ENABLE_TCL AND NOT DEFINED ENABLE_ITCL)
set(ENABLE_ITCL ON)
endif (ENABLE_TCL AND NOT DEFINED ENABLE_ITCL)
endif (USE_BRLCAD)
if (NOT ENABLE_ITCL AND NOT DEFINED DISABLE_ITCL)
find_package(ITCL)
if (NOT ITCL_FOUND AND NOT DEFINED ENABLE_ITCL)
set(ENABLE_ITCL "ON" CACHE BOOL "Enable itcl build")
endif (NOT ITCL_FOUND AND NOT DEFINED ENABLE_ITCL)
endif (NOT ENABLE_ITCL AND NOT DEFINED DISABLE_ITCL)
set(ENABLE_ITCL "${ENABLE_ITCL}" CACHE BOOL "Enable itcl build")
if (ENABLE_ITCL)
git_submodule_init(itcl configure.in)
RegisterDeps(ITCL)
# Itcl3 has a problem in that it requires internal Tcl headers.
# Occasionally (but not always) we can get these headers from
# a system include path.
if (NOT TARGET TCL_BLD)
# If we're not building the bundled Tcl, see if the system
# Tcl gives us the private headers.
set(CMAKE_FIND_FRAMEWORK NEVER)
find_package(TCL)
set(HDRS_CANDIDATE_DIR ${TCL_INCLUDE_PATH}8.6/tcl-private)
if (EXISTS ${HDRS_CANDIDATE_DIR})
set(TCL_PRIVATE_HDRS ${HDRS_CANDIDATE_DIR}/generic)
if(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${HDRS_CANDIDATE_DIR}/unix)
else(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${HDRS_CANDIDATE_DIR}/win)
endif(NOT WIN32)
endif (EXISTS ${HDRS_CANDIDATE_DIR})
endif (NOT TARGET TCL_BLD)
# message("TCL HEADERS1: ${TCL_PRIVATE_HDRS}")
# If we can't find them from the system, see if we have a local
# clone of Tcl to use
if (NOT TCL_PRIVATE_HDRS AND EXISTS ${CMAKE_SOURCE_DIR}/tcl/tcl)
set(TCL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/tcl/tcl)
set(TCL_PRIVATE_HDRS ${TCL_SOURCE_DIR}/generic)
if(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${TCL_SOURCE_DIR}/unix)
else(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${TCL_SOURCE_DIR}/win)
endif(NOT WIN32)
endif (NOT TCL_PRIVATE_HDRS AND EXISTS ${CMAKE_SOURCE_DIR}/tcl/tcl)
# message("TCL HEADERS2: ${TCL_PRIVATE_HDRS}")
# If we STILL don't have anything, patch the Itcl sources to add
# the headers in question
set(TCL_HDRS_PATCH_CMD)
if (NOT TCL_PRIVATE_HDRS)
set(TCL_HDRS_PATCH_CMD ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/tcl_priv_hdrs.patch)
set(TCL_PRIVATE_HDRS "${CMAKE_CURRENT_BINARY_DIR}/ITCL_BLD-prefix/src/ITCL_BLD/tcl_hdrs")
if(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${TCL_PRIVATE_HDRS}/unix)
else(NOT WIN32)
set(TCL_PRIVATE_HDRS_OS ${TCL_PRIVATE_HDRS}/win)
endif(NOT WIN32)
endif (NOT TCL_PRIVATE_HDRS)
# message("TCL HEADERS3: ${TCL_PRIVATE_HDRS}")
# When building ITCL, its path setup must take into account the subdirectory
# in which we are storing the library.
set(RPATH_SUFFIX itcl3.4)
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/itcl")
set(BLD_DIR "${CMAKE_CURRENT_BINARY_DIR}/ITCL_BLD-prefix/src/ITCL_BLD")
file(MAKE_DIRECTORY ${BLD_DIR})
set(MD5_SUMMARY "${BLD_DIR}/../md5_summary.txt")
set(PATCH_FILES itcl.patch ${TCL_HDRS_PATCH})
configure_file(${CMAKE_SOURCE_DIR}/CMake/UpdateSync.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/UpdateSync.cmake @ONLY)
ExternalProject_Add(ITCL_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/itcl"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
UPDATE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UpdateSync.cmake
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
-DLIB_DIR=${LIB_DIR}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}/${RPATH_SUFFIX}
-DINCLUDE_DIR=${INCLUDE_DIR}
-DSHARED_DIR=${LIB_DIR}
-DTCL_ENABLE_TK=ON
-DTCL_ROOT=$<$<BOOL:${TCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DTCL_PRIVATE_HDRS=${TCL_PRIVATE_HDRS}
-DTCL_PRIVATE_HDRS_OS=${TCL_PRIVATE_HDRS_OS}
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
TargetInstallDeps(ITCL ITCL_DEPENDS)
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/itcl/license.terms
${DOC_LICENSE_DIR}/itcl3.txt
COPYONLY
)
endif (ENABLE_ITCL)
mark_as_advanced(ITCL_LIBRARY)
mark_as_advanced(ITCL_LIBRARIES)
mark_as_advanced(ITCL_VERSION)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
Submodule
+1
Submodule itcl/itcl added at 33cea588fa
+3
View File
@@ -0,0 +1,3 @@
PATCH
TCL
+872
View File
@@ -0,0 +1,872 @@
diff -Naur itcl/CMake/FindTCL.cmake ITCL_BLD/CMake/FindTCL.cmake
--- itcl/CMake/FindTCL.cmake 1969-12-31 19:00:00.000000000 -0500
+++ ITCL_BLD/CMake/FindTCL.cmake 2024-08-06 13:12:35.229286326 -0400
@@ -0,0 +1,496 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindTCL
+-------
+
+This module finds if Tcl is installed and determines where the include
+files and libraries are. It also determines what the name of the
+library is. This code sets the following variables:
+
+::
+
+TCL_FOUND = Tcl was found
+TCLSH_FOUND = TRUE if tclsh has been found
+TCL_LIBRARY = path to Tcl library (tcl tcl80)
+TCL_INCLUDE_PATH = path to where tcl.h can be found
+TCL_TCLSH = path to tclsh binary (tcl tcl80)
+
+
+
+If TCL_ENABLE_TK is set, the following are also set:
+
+::
+
+TK_FOUND = Tk was found
+TCLTK_FOUND = Tcl and Tk were found
+TK_LIBRARY = path to Tk library (tk tk80 etc)
+TK_INCLUDE_PATH = path to where tk.h can be found
+TK_WISH = full path to the wish executable
+TCL_STUB_LIBRARY = path to Tcl stub library
+TK_STUB_LIBRARY = path to Tk stub library
+TTK_STUB_LIBRARY = path to ttk stub library
+
+#]=======================================================================]
+
+include(CMakeFindFrameworks)
+
+set(_TCL_SEARCHES)
+
+# Search TCL_ROOT first if it is set.
+if(TCL_ROOT)
+ set(_TCL_SEARCH_ROOT PATHS ${TCL_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _TCL_SEARCHES _TCL_SEARCH_ROOT)
+endif()
+
+if(WIN32)
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+ NAME)
+ set(TCLTK_POSSIBLE_BIN_PATHS ${TCLTK_POSSIBLE_BIN_PATHS}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin"
+ )
+
+ get_filename_component(
+ ActiveTcl_CurrentVersion
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]"
+ NAME)
+ set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib"
+ "$ENV{ProgramFiles}/Tcl/Lib"
+ "C:/Program Files/Tcl/lib"
+ "C:/Tcl/lib"
+ )
+
+ set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
+ "$ENV{ProgramFiles}/Tcl/include"
+ "C:/Program Files/Tcl/include"
+ "C:/Tcl/include"
+ )
+endif()
+
+set(TCL_TCLSH_NAMES
+ tclsh
+ tclsh${TCL_LIBRARY_VERSION} tclsh${TK_LIBRARY_VERSION} tclsh${TK_WISH_VERSION}
+ tclsh87 tclsh8.7
+ tclsh86 tclsh8.6
+ tclsh85 tclsh8.5
+ tclsh84 tclsh8.4
+ tclsh83 tclsh8.3
+ tclsh82 tclsh8.2
+ tclsh80 tclsh8.0
+ )
+if(CYGWIN)
+ set(TCL_TCLSH_NAMES ${TCL_TCLSH_NAMES} cygtclsh83 cygtclsh80)
+endif(CYGWIN)
+
+foreach(search ${_TCL_SEARCHES})
+ find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} ${${search}} PATH_SUFFIXES bin)
+endforeach()
+if (NOT TCL_TCLSH)
+ find_program(TCL_TCLSH NAMES ${TCL_TCLSH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
+endif (NOT TCL_TCLSH)
+
+if (TCL_ENABLE_TK)
+ set(TK_WISH_NAMES
+ wish
+ wish${TCL_LIBRARY_VERSION} wish${TK_LIBRARY_VERSION} wish${TCL_TCLSH_VERSION}
+ wish86 wish8.6
+ wish85 wish8.5
+ wish84 wish8.4
+ wish83 wish8.3
+ wish82 wish8.2
+ wish80 wish8.0
+ )
+
+ if(CYGWIN)
+ set(TK_WISH_NAMES ${TK_WISH_NAMES} cygwish80 )
+ endif()
+
+ foreach(search ${_TCL_SEARCHES})
+ find_program(TK_WISH NAMES ${TK_WISH_NAMES} ${${search}} PATH_SUFFIXES bin)
+ endforeach()
+ if (NOT TK_WISH)
+ find_program(TK_WISH NAMES ${TK_WISH_NAMES} HINTS ${TCLTK_POSSIBLE_BIN_PATHS})
+ endif (NOT TK_WISH)
+endif (TCL_ENABLE_TK)
+
+if(TCLSH_VERSION_STRING)
+ set(TCL_TCLSH_VERSION "${TCLSH_VERSION_STRING}")
+else()
+ get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
+ get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+ string(REGEX REPLACE
+ "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")
+endif()
+
+set(TCLTK_POSSIBLE_LIB_PATHS
+ "${TCL_INCLUDE_PATH_PARENT}/lib"
+ "${TCL_LIBRARY_PATH}"
+ "${TCL_TCLSH_PATH_PARENT}/lib"
+ )
+if (TCL_ENABLE_TK)
+ set(TCLTK_POSSIBLE_LIB_PATHS
+ ${TCLTK_POSSIBLE_LIB_PATHS}
+ "${TK_INCLUDE_PATH_PARENT}/lib"
+ "${TK_LIBRARY_PATH}"
+ "${TK_WISH_PATH_PARENT}/lib"
+ )
+endif (TCL_ENABLE_TK)
+
+set(TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
+ lib
+ lib/tcl
+ lib/tcl/tcl8.7
+ lib/tcl/tcl8.6
+ lib/tcl/tcl8.5
+ lib/tcl/tcl8.4
+ )
+if (TCL_ENABLE_TK)
+ set(TCLTK_POSSIBLE_LIB_PATH_SUFFIXES
+ ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ lib/tcl/tk8.7
+ lib/tcl/tk8.6
+ lib/tcl/tk8.5
+ lib/tcl/tk8.4
+ )
+endif (TCL_ENABLE_TK)
+
+set(TCL_POSSIBLE_LIB_NAMES
+ tcl
+ tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
+ tcl87 tcl8.7 tcl87t tcl8.7t
+ tcl86 tcl8.6 tcl86t tcl8.6t
+ tcl85 tcl8.5
+ tcl84 tcl8.4
+ tcl83 tcl8.3
+ tcl82 tcl8.2
+ tcl80 tcl8.0
+ )
+
+if(NOT TCL_LIBRARY)
+ foreach(search ${_TCL_SEARCHES})
+ find_library(TCL_LIBRARY
+ NAMES ${TCL_POSSIBLE_LIB_NAMES}
+ NAMES_PER_DIR ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES})
+ endforeach()
+endif()
+if(NOT TCL_LIBRARY)
+ find_library(TCL_LIBRARY
+ NAMES ${TCL_POSSIBLE_LIB_NAMES}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+endif(NOT TCL_LIBRARY)
+
+set(TCLSTUB_POSSIBLE_LIB_NAMES
+ tclstub
+ tclstub${TK_LIBRARY_VERSION} tclstub${TCL_TCLSH_VERSION} tclstub${TK_WISH_VERSION}
+ tclstub87 tclstub8.7
+ tclstub86 tclstub8.6
+ tclstub85 tclstub8.5
+ tclstub84 tclstub8.4
+ tclstub83 tclstub8.3
+ tclstub82 tclstub8.2
+ tclstub80 tclstub8.0
+ )
+if(NOT TCL_STUB_LIBRARY)
+ foreach(search ${_TCL_SEARCHES})
+ find_library(TCL_STUB_LIBRARY
+ NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
+ NAMES_PER_DIR ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+ endforeach()
+endif()
+if(NOT TCL_STUB_LIBRARY)
+ find_library(TCL_STUB_LIBRARY
+ NAMES ${TCLSTUB_POSSIBLE_LIB_NAMES}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+endif()
+
+if (TCL_ENABLE_TK)
+ set(TK_POSSIBLE_LIB_NAMES
+ tk
+ tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
+ tk87 tk8.7 tk87t tk8.7t
+ tk86 tk8.6 tk86t tk8.6t
+ tk85 tk8.5
+ tk84 tk8.4
+ tk83 tk8.3
+ tk82 tk8.2
+ tk80 tk8.0
+ )
+
+ if(NOT TK_LIBRARY)
+ foreach(search ${_TCL_SEARCHES})
+ find_library(TK_LIBRARY
+ NAMES ${TK_POSSIBLE_LIB_NAMES}
+ NAMES_PER_DIR ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+ endforeach()
+ endif()
+ if(NOT TK_LIBRARY)
+ find_library(TK_LIBRARY
+ NAMES ${TK_POSSIBLE_LIB_NAMES}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+ endif(NOT TK_LIBRARY)
+
+ set(TK_STUB_POSSIBLE_LIB_NAMES
+ tkstub
+ tkstub${TCL_LIBRARY_VERSION} tkstub${TCL_TCLSH_VERSION} tkstub${TK_WISH_VERSION}
+ tkstub87 tkstub8.7
+ tkstub86 tkstub8.6
+ tkstub85 tkstub8.5
+ tkstub84 tkstub8.4
+ tkstub83 tkstub8.3
+ tkstub82 tkstub8.2
+ tkstub80 tkstub8.0
+ )
+
+ if(NOT TK_STUB_LIBRARY)
+ foreach(search ${_TCL_SEARCHES})
+ find_library(TK_STUB_LIBRARY
+ NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
+ NAMES_PER_DIR ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+ endforeach()
+ endif()
+ if(NOT TK_STUB_LIBRARY)
+ find_library(TK_STUB_LIBRARY
+ NAMES ${TK_STUB_POSSIBLE_LIB_NAMES}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ endif()
+
+ set(TTK_STUB_POSSIBLE_LIB_NAMES
+ ttkstub
+ ttkstub${TCL_LIBRARY_VERSION} ttkstub${TCL_TCLSH_VERSION} ttkstub${TK_WISH_VERSION}
+ ttkstub88 ttkstub8.8
+ ttkstub87 ttkstub8.7
+ ttkstub86 ttkstub8.6
+ ttkstub85 ttkstub8.5
+ )
+
+ if(NOT TTK_STUB_LIBRARY)
+ foreach(search ${_TCL_SEARCHES})
+ find_library(TTK_STUB_LIBRARY
+ NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
+ NAMES_PER_DIR ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_LIB_PATH_SUFFIXES}
+ )
+ endforeach()
+ endif()
+ if(NOT TTK_STUB_LIBRARY)
+ find_library(TTK_STUB_LIBRARY
+ NAMES ${TTK_STUB_POSSIBLE_LIB_NAMES}
+ PATHS ${TCLTK_POSSIBLE_LIB_PATHS}
+ )
+ endif()
+endif (TCL_ENABLE_TK)
+
+CMAKE_FIND_FRAMEWORKS(Tcl)
+if (TCL_ENABLE_TK)
+ CMAKE_FIND_FRAMEWORKS(Tk)
+endif (TCL_ENABLE_TK)
+
+set(TCL_FRAMEWORK_INCLUDES)
+if(Tcl_FRAMEWORKS)
+ if(NOT TCL_INCLUDE_PATH)
+ foreach(dir ${Tcl_FRAMEWORKS})
+ set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers)
+ endforeach()
+ endif()
+endif()
+
+if (TCL_ENABLE_TK)
+ set(TK_FRAMEWORK_INCLUDES)
+ if(Tk_FRAMEWORKS)
+ if(NOT TK_INCLUDE_PATH)
+ foreach(dir ${Tk_FRAMEWORKS})
+ set(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES}
+ ${dir}/Headers ${dir}/PrivateHeaders)
+ endforeach()
+ endif()
+ endif()
+endif (TCL_ENABLE_TK)
+
+set(TCLTK_POSSIBLE_INCLUDE_PATHS
+ "${TCL_LIBRARY_PATH_PARENT}/include"
+ "${TCL_INCLUDE_PATH}"
+ ${TCL_FRAMEWORK_INCLUDES}
+ "${TCL_TCLSH_PATH_PARENT}/include"
+ )
+if (TCL_ENABLE_TK)
+ set(TCLTK_POSSIBLE_INCLUDE_PATHS
+ ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+ "${TCL_LIBRARY_PATH_PARENT}/include"
+ "${TCL_INCLUDE_PATH}"
+ ${TCL_FRAMEWORK_INCLUDES}
+ "${TCL_TCLSH_PATH_PARENT}/include"
+ )
+endif (TCL_ENABLE_TK)
+
+set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
+ include
+ include/tcl${TCL_LIBRARY_VERSION}
+ include/tcl8.7
+ include/tcl8.6
+ include/tcl8.5
+ include/tcl8.4
+ include/tcl8.3
+ include/tcl8.2
+ include/tcl8.0
+ )
+
+if (TCL_ENABLE_TK)
+ set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
+ ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
+ include/tcl${TK_LIBRARY_VERSION}
+ include/tk8.7
+ include/tk8.6
+ include/tk8.5
+ include/tk8.4
+ )
+endif (TCL_ENABLE_TK)
+
+
+foreach(search ${_TCL_SEARCHES})
+ find_path(TCL_INCLUDE_PATH
+ NAMES tcl.h ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
+ )
+endforeach()
+if (NOT TCL_INCLUDE_PATH)
+ find_path(TCL_INCLUDE_PATH
+ NAMES tcl.h
+ HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
+ )
+endif()
+
+if (TCL_ENABLE_TK)
+
+ foreach(search ${_TCL_SEARCHES})
+ find_path(TK_INCLUDE_PATH
+ NAMES tk.h ${${search}}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
+ )
+ endforeach()
+ if (NOT TK_INCLUDE_PATH)
+ find_path(TK_INCLUDE_PATH
+ NAMES tk.h
+ HINTS ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+ PATH_SUFFIXES ${TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES}
+ )
+ endif()
+
+ # IFF we have TCL_TK_SYSTEM_GRAPHICS set and have a system TK_WISH, check that the
+ # windowing system matches the specified type
+ if (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
+ set(tkwin_script "
+ set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM\"
+ set fileId [open $filename \"w\"]
+ set windowingsystem [tk windowingsystem]
+ puts $fileId $windowingsystem
+ close $fileId
+ exit
+ ")
+ set(tkwin_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tk_windowingsystem.tcl")
+ set(WSYS "wm-NOTFOUND")
+ file(WRITE ${tkwin_scriptfile} ${tkwin_script})
+ execute_process(COMMAND ${TK_WISH} ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+ if (EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
+ file(READ "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM" readresultvar)
+ string(REGEX REPLACE "\n" "" WSYS "${readresultvar}")
+ endif (EXISTS "${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM")
+
+ # If we have no information about the windowing system or it does not match
+ # a specified system, the find_package detection has failed
+ if (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
+ unset(TCL_LIBRARY CACHE)
+ unset(TCL_STUB_LIBRARY CACHE)
+ unset(TK_LIBRARY CACHE)
+ unset(TK_STUB_LIBRARY CACHE)
+ unset(TCL_FOUND CACHE)
+ unset(TK_FOUND CACHE)
+ unset(TCLTK_FOUND CACHE)
+ unset(TCLSH_FOUND CACHE)
+ unset(TCL_LIBRARY CACHE)
+ unset(TCL_INCLUDE_PATH CACHE)
+ unset(TCL_TCLSH CACHE)
+ unset(TK_LIBRARY CACHE)
+ unset(TK_INCLUDE_PATH CACHE)
+ unset(TK_WISH CACHE)
+ unset(TCL_STUB_LIBRARY CACHE)
+ unset(TK_STUB_LIBRARY CACHE)
+ unset(TTK_STUB_LIBRARY CACHE)
+ endif (NOT "${WSYS}" STREQUAL "${TCL_TK_SYSTEM_GRAPHICS}")
+ endif (NOT "${TCL_TK_SYSTEM_GRAPHICS}" STREQUAL "" AND TK_WISH AND NOT TARGET "${TK_WISH}")
+endif (TCL_ENABLE_TK)
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL
+ REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TCL_TCLSH
+ VERSION_VAR TCLSH_VERSION_STRING)
+
+if (TCL_ENABLE_TK)
+ set(FPHSA_NAME_MISMATCHED 1)
+ set(TCLTK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+ set(TCLTK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLTK
+ REQUIRED_VARS TCL_LIBRARY TCL_STUB_LIBRARY TCL_INCLUDE_PATH TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH)
+ set(TK_FIND_REQUIRED ${TCL_FIND_REQUIRED})
+ set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK
+ REQUIRED_VARS TK_LIBRARY TK_STUB_LIBRARY TK_INCLUDE_PATH TK_WISH)
+ unset(FPHSA_NAME_MISMATCHED)
+endif (TCL_ENABLE_TK)
+
+mark_as_advanced(
+ TCL_INCLUDE_PATH
+ TCL_LIBRARY
+ TCL_STUB_LIBRARY
+ TCL_TCLSH
+ TK_INCLUDE_PATH
+ TK_LIBRARY
+ TK_STUB_LIBRARY
+ TK_WISH
+ TTK_STUB_LIBRARY
+ )
+
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8
diff -Naur itcl/CMakeLists.txt ITCL_BLD/CMakeLists.txt
--- itcl/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500
+++ ITCL_BLD/CMakeLists.txt 2024-08-06 13:14:14.013768111 -0400
@@ -0,0 +1,223 @@
+# C M A K E L I S T S . T X T
+# ITCL
+#
+# Copyright (c) 2010 United States Government as represented by
+# the U.S. Army Research Laboratory.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# 3. The name of the author may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# *******************************************************************
+# *** ITCL CMakeLists.txt ***
+# *******************************************************************
+
+# Minimum required version of CMake
+cmake_minimum_required(VERSION 3.18)
+
+# set CMake project name
+project(ITCL)
+
+# install(CODE) uses generator expressions - requires 3.14 or newer.
+# We want it to be on, but until we can bump our minimum requirement
+# set it to OLD to make sure we don't break anything.
+if (POLICY CMP0087)
+ cmake_policy(SET CMP0087 OLD)
+endif (POLICY CMP0087)
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+
+set(CMAKE_FIND_FRAMEWORK NEVER)
+find_package(TCL)
+
+# version numbers
+set(ITCL_VERSION_MAJOR 3)
+set(ITCL_VERSION_MINOR 4)
+set(ITCL_PATCH_LEVEL 3)
+
+set(ITCL_VERSION "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
+
+#---------------------------------------------------------------------
+# Initialize some relative variable names
+if(NOT BIN_DIR)
+ if (WIN32)
+ set(BIN_DIR lib)
+ else (WIN32)
+ set(BIN_DIR bin)
+ endif (WIN32)
+endif(NOT BIN_DIR)
+if(NOT SHARED_DIR)
+ set(SHARED_DIR lib)
+endif(NOT SHARED_DIR)
+if(NOT LIB_DIR)
+ set(LIB_DIR lib)
+endif(NOT LIB_DIR)
+if(NOT INCLUDE_DIR)
+ set(INCLUDE_DIR include)
+endif(NOT INCLUDE_DIR)
+
+#----------------------------------------------------------------------------
+# First, get some standard options out of the way
+add_definitions(-DSTDC_HEADERS=1)
+
+# We're building Itcl
+add_definitions(-DBUILD_itcl)
+
+# Use fPIC if we have it
+include(CheckCCompilerFlag)
+check_c_compiler_flag(-fPIC HAVE_PIC_COMPILER_FLAG)
+if(HAVE_PIC_COMPILER_FLAG)
+ add_definitions(-fPIC)
+endif(HAVE_PIC_COMPILER_FLAG)
+
+#--------------------------------------------------------------------
+# Header checks.
+#--------------------------------------------------------------------
+
+include(CMakeParseArguments)
+include(CheckIncludeFiles)
+include(CheckCSourceCompiles)
+function(Tcl_Check_Include_File filename)
+ cmake_parse_arguments(OPT "USE" "" "" ${ARGN})
+ string(REPLACE "." "_" var "${filename}")
+ string(REPLACE "/" "_" var "${var}")
+ string(TOUPPER "${var}" var)
+ check_include_files(${filename} HAVE_${var})
+ if(HAVE_${var})
+ set(CVAR HAVE_${var})
+ if(OPT_USE)
+ # Usability test requested - we're not done yet.
+ check_c_source_compiles("#include <${filename}>\nint main() {return 0;}" ${var}_USABLE)
+ if(${var}_USABLE)
+ set(HAVE_${var} 1 PARENT_SCOPE)
+ set(${CVAR} 1 PARENT_SCOPE)
+ add_definitions(-D${CVAR}=1)
+ endif(${var}_USABLE)
+ else(OPT_USE)
+ set(HAVE_${var} 1 PARENT_SCOPE)
+ set(${CVAR} 1 PARENT_SCOPE)
+ add_definitions(-D${CVAR}=1)
+ endif(OPT_USE)
+ endif(HAVE_${var})
+endfunction(Tcl_Check_Include_File)
+
+Tcl_Check_Include_File(sys/types.h)
+Tcl_Check_Include_File(sys/stat.h)
+Tcl_Check_Include_File(stdlib.h)
+Tcl_Check_Include_File(string.h)
+Tcl_Check_Include_File(strings.h)
+Tcl_Check_Include_File(memory.h)
+Tcl_Check_Include_File(inttypes.h)
+Tcl_Check_Include_File(stdint.h)
+Tcl_Check_Include_File(unistd.h)
+Tcl_Check_Include_File(net/errno.h)
+Tcl_Check_Include_File(dirent.h)
+Tcl_Check_Include_File(errno.h USE)
+Tcl_Check_Include_File(float.h USE)
+Tcl_Check_Include_File(values.h USE)
+Tcl_Check_Include_File(limits.h USE)
+Tcl_Check_Include_File(sys/wait.h USE)
+Tcl_Check_Include_File(dlfcn.h USE)
+Tcl_Check_Include_File(sys/param.h USE)
+
+set(ITCL_SRCS
+ generic/itclStubInit.c
+ generic/itclStubLib.c
+ generic/itcl_bicmds.c
+ generic/itcl_class.c
+ generic/itcl_cmds.c
+ generic/itcl_ensemble.c
+ generic/itcl_linkage.c
+ generic/itcl_methods.c
+ generic/itcl_migrate.c
+ generic/itcl_objects.c
+ generic/itcl_parse.c
+ generic/itcl_util.c
+ )
+
+if(WIN32)
+ set(ITCL_SRCS ${ITCL_SRCS} win/dllEntryPoint.c)
+endif(WIN32)
+
+set(ITCL_STUB_SRCS generic/itclStubLib.c)
+
+set(ITCL_INCLUDE_PATH ${ITCL_SOURCE_DIR}/generic ${ITCL_BINARY_DIR}/include)
+mark_as_advanced(ITCL_INCLUDE_PATH)
+
+# ITcl requires private Tcl headers, which we can't always assume from a system
+# install of Tcl. Require the build to tell us where to look
+if (NOT DEFINED TCL_PRIVATE_HDRS)
+ message(FATAL_ERROR "Itcl3 needs to know where to find the Tcl private headers")
+endif (NOT DEFINED TCL_PRIVATE_HDRS)
+
+include_directories(
+ ${TCL_INCLUDE_PATH}
+ ${ITCL_INCLUDE_PATH}
+ ${TCL_PRIVATE_HDRS};${TCL_PRIVATE_HDRS_OS}
+ )
+
+add_library(itcl${ITCL_VERSION} SHARED ${ITCL_SRCS})
+target_link_libraries(itcl${ITCL_VERSION} ${M_LIBRARY} ${TCL_STUB_LIBRARY} )
+set_property(TARGET itcl${ITCL_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+install(TARGETS itcl${ITCL_VERSION}
+ RUNTIME DESTINATION ${BIN_DIR}/itcl${ITCL_VERSION}
+ LIBRARY DESTINATION ${SHARED_DIR}/itcl${ITCL_VERSION}
+ ARCHIVE DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
+
+add_library(itclstub STATIC ${ITCL_STUB_SRCS})
+install(TARGETS itclstub
+ RUNTIME DESTINATION ${BIN_DIR}/itcl${ITCL_VERSION}
+ LIBRARY DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION}
+ ARCHIVE DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
+set_property(TARGET itclstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+
+# Create pkgIndex.tcl files
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl"
+ CONTENT "
+if {![package vsatisfies [package provide Tcl] 8.5]} {return}
+package ifneeded Itcl ${ITCL_VERSION} [list load [file join $dir ../../${SHARED_DIR}/itcl${ITCL_VERSION} $<TARGET_FILE_NAME:itcl${ITCL_VERSION}>] Itcl]
+")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
+
+install(FILES library/itcl.tcl DESTINATION ${LIB_DIR}/itcl${ITCL_VERSION})
+
+set(ITCL_HDRS
+ generic/itcl.h
+ generic/itclDecls.h
+ generic/itclInt.h
+ generic/itclIntDecls.h
+ )
+install(FILES ${ITCL_HDRS} DESTINATION ${INCLUDE_DIR})
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8
+
diff -Naur itcl/generic/itcl_cmds.c ITCL_BLD/generic/itcl_cmds.c
--- itcl/generic/itcl_cmds.c 2024-08-06 13:13:08.429776852 -0400
+++ ITCL_BLD/generic/itcl_cmds.c 2024-08-06 13:12:35.230286310 -0400
@@ -53,9 +53,6 @@
if {[info exists library]} {\n\
lappend dirs $library\n\
} else {\n\
- if {[catch {uplevel #0 source -rsrc itcl}] == 0} {\n\
- return\n\
- }\n\
set dirs {}\n\
if {[info exists env(ITCL_LIBRARY)]} {\n\
lappend dirs $env(ITCL_LIBRARY)\n\
@@ -866,7 +863,7 @@
int objc; /* number of arguments */
Tcl_Obj *CONST objv[]; /* argument objects */
{
- int pLevel = (int)clientData;
+ int pLevel = (int)(size_t)clientData;
int result;
int oldLevel;
@@ -1145,7 +1142,7 @@
if (!entry) {
Tcl_AppendResult(interp,
"can't scope variable \"", token,
- "\": missing object context\"",
+ "\": missing object context",
(char*)NULL);
result = TCL_ERROR;
goto scopeCmdDone;
diff -Naur itcl/generic/itclInt.decls ITCL_BLD/generic/itclInt.decls
--- itcl/generic/itclInt.decls 2024-08-06 13:13:08.429776852 -0400
+++ ITCL_BLD/generic/itclInt.decls 2024-08-06 13:12:35.230286310 -0400
@@ -252,7 +252,7 @@
CONST char* arglist, CONST char* body, ItclMemberCode** mcodePtr)
}
declare 58 generic {
- void Itcl_DeleteMemberCode (CONST char* cdata)
+ void Itcl_DeleteMemberCode (char* cdata)
}
declare 59 generic {
int Itcl_GetMemberCode (Tcl_Interp* interp, ItclMember* member)
diff -Naur itcl/generic/itclIntDecls.h ITCL_BLD/generic/itclIntDecls.h
--- itcl/generic/itclIntDecls.h 2024-08-06 13:13:08.429776852 -0400
+++ ITCL_BLD/generic/itclIntDecls.h 2024-08-06 13:12:35.230286310 -0400
@@ -410,7 +410,7 @@
#ifndef Itcl_DeleteMemberCode_TCL_DECLARED
#define Itcl_DeleteMemberCode_TCL_DECLARED
/* 58 */
-TCL_EXTERN(void) Itcl_DeleteMemberCode _ANSI_ARGS_((CONST char* cdata));
+TCL_EXTERN(void) Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata));
#endif
#ifndef Itcl_GetMemberCode_TCL_DECLARED
#define Itcl_GetMemberCode_TCL_DECLARED
@@ -853,7 +853,7 @@
int (*itcl_ChangeMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc* mfunc, CONST char* arglist, CONST char* body)); /* 55 */
void (*itcl_DeleteMemberFunc) _ANSI_ARGS_((CONST char* cdata)); /* 56 */
int (*itcl_CreateMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, CONST char* arglist, CONST char* body, ItclMemberCode** mcodePtr)); /* 57 */
- void (*itcl_DeleteMemberCode) _ANSI_ARGS_((CONST char* cdata)); /* 58 */
+ void (*itcl_DeleteMemberCode) _ANSI_ARGS_((char* cdata)); /* 58 */
int (*itcl_GetMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclMember* member)); /* 59 */
void *reserved60;
int (*itcl_EvalMemberCode) _ANSI_ARGS_((Tcl_Interp * interp, ItclMemberFunc * mfunc, ItclMember * member, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 61 */
diff -Naur itcl/generic/itcl_methods.c ITCL_BLD/generic/itcl_methods.c
--- itcl/generic/itcl_methods.c 2024-08-06 13:13:08.429776852 -0400
+++ ITCL_BLD/generic/itcl_methods.c 2024-08-06 13:12:35.230286310 -0400
@@ -731,8 +731,7 @@
* ------------------------------------------------------------------------
*/
void
-Itcl_DeleteMemberCode(cdata)
- CONST char* cdata; /* pointer to member function definition */
+Itcl_DeleteMemberCode(char *cdata)
{
ItclMemberCode* mcode = (ItclMemberCode*)cdata;
@@ -1156,7 +1155,7 @@
nameLen = strlen(name);
localPtr = (CompiledLocal*)ckalloc(
- (unsigned)(sizeof(CompiledLocal)-sizeof(localPtr->name) + nameLen+1)
+ TclOffset(CompiledLocal, name) + nameLen+1
);
localPtr->nextPtr = NULL;
diff -Naur itcl/win/itcl.rc ITCL_BLD/win/itcl.rc
--- itcl/win/itcl.rc 1969-12-31 19:00:00.000000000 -0500
+++ ITCL_BLD/win/itcl.rc 2024-08-06 13:12:35.230286310 -0400
@@ -0,0 +1,55 @@
+//
+// Version resource script.
+//
+
+#include <winver.h>
+#include <itcl.h>
+
+//
+// build-up the name suffix that defines the type of build this is.
+//
+#if DEBUG && !UNCHECKED
+#define SUFFIX_DEBUG "g"
+#else
+#define SUFFIX_DEBUG ""
+#endif
+
+#define SUFFIX SUFFIX_DEBUG
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,ITCL_RELEASE_SERIAL
+ PRODUCTVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,ITCL_RELEASE_SERIAL
+ FILEFLAGSMASK 0x3fL
+#ifdef DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "Itcl language extension for Tcl\0"
+ VALUE "Authors", "Michael McLennan\0"
+ VALUE "OriginalFilename", "itcl" STRINGIFY(ITCL_MAJOR_VERSION) STRINGIFY(ITCL_MINOR_VERSION) SUFFIX ".dll\0"
+ VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0"
+ VALUE "FileVersion", ITCL_PATCH_LEVEL
+ VALUE "LegalCopyright", "Copyright \251 1993-2004\0"
+ VALUE "ProductName", "[Incr Tcl] " ITCL_VERSION " for Windows\0"
+ VALUE "ProductVersion", ITCL_PATCH_LEVEL
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+
+
File diff suppressed because it is too large Load Diff
+65 -90
View File
@@ -1,119 +1,94 @@
# Itk uses private Tcl and Itcl interfaces plus Tk stubs. Build it only as
# part of bext's internally consistent Tcl/Tk stack; system Tcl/Tk must supply
# Itk.
# Unfortunately, there does not appear to be a reliable way to test for the
# presence of the Itk package on a system Tcl/Tk. We key off of the presence
# of the TK_BLD and ITCL_BLD targets, but that may produce a false negative if
# those builds are both off but we still need Itk. As far as I can tell the
# "package require Itk" test (which is what is required to properly test for an
# available Itk package) can ONLY be performed successfully on a system that
# supports creation of a graphics window. Window creation isn't typically
# available on continuous integration runners, which means the test will always
# fail there even when it shouldn't.
if (USE_BRLCAD)
# We try to find the itk library, since that's the only test we can do without
# needing the graphical invocation. Unfortunately, even a find_library search
# looking for libitk isn't completely reliable, since the presence of a shared
# library is not a guarantee it is correctly hooked into the "package require"
# mechanism of the system Tcl/Tk we want to use. (It is possible to have more
# than one Tcl/Tk on a system - this situation is known to have occurred on the
# Mac when 3rd party package managers are used, for example.)
cad_enable(ITK "${BEXT_TK_COMPONENTS}")
# Hopefully situations where a user has a complex Itcl/Itk setup are rare
# enough that it won't be a significant issue, since there appears to be
# only so much we can do to sort it out...
else (USE_BRLCAD)
bext_enable_all_default(ITK itk)
endif (USE_BRLCAD)
if (TARGET TK_BLD AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_ITK)
if (ENABLE_ITCL AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_TCL)
set(ENABLE_ITK ON)
endif ()
endif (ENABLE_ITCL AND NOT DEFINED ENABLE_ITK AND NOT DISABLE_TCL)
if (NOT ENABLE_ITK AND NOT DISABLE_ITCL AND NOT DISABLE_TCL)
find_library(ITK_SYS_LIBRARY NAMES itk3)
if (NOT ITK_SYS_LIBRARY AND NOT DEFINED ENABLE_ITK)
set(ENABLE_ITK "ON" CACHE BOOL "Enable itk build")
endif (NOT ITK_SYS_LIBRARY AND NOT DEFINED ENABLE_ITK)
endif (NOT ENABLE_ITK AND NOT DISABLE_ITCL AND NOT DISABLE_TCL)
set(ENABLE_ITK "${ENABLE_ITK}" CACHE BOOL "Enable itk build")
if (ENABLE_ITK)
if (NOT TARGET TCL_BLD OR NOT TARGET TK_BLD)
message(FATAL_ERROR
"A local Itk build requires bext's bundled Tcl and Tk because Itk uses "
"private Tcl and Itcl interfaces. A system Tcl/Tk stack must provide "
"Itk ${BEXT_ITK_MIN_VERSION} or newer; otherwise configure with "
"-DENABLE_TCL=ON."
)
endif ()
git_submodule_init(itk configure)
git_submodule_init(itk configure.in)
RegisterDeps(ITK)
set(BEXT_ITK_VERSION "${BEXT_ITK_BUNDLED_VERSION}" CACHE INTERNAL "Bundled Itk version" FORCE)
set(RPATH_SUFFIX "itk${BEXT_ITK_BUNDLED_VERSION}")
set(ITK_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD")
set(ITK_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD-build")
# If we're building ITK, it's path setup must take into account the
# subdirectory in which we are storing the library.
set(RPATH_SUFFIX itk3.4)
set(WITH_TCL_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}")
set(WITH_TCL_INCLUDE_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${INCLUDE_DIR}")
set(TCL_SRC_DIR "${CMAKE_BINARY_DIR}/tcl/TCL_BLD-prefix/src/TCL_BLD")
set(WITH_TK_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}")
set(WITH_TK_INCLUDE_DIR "${CMAKE_BUNDLE_INSTALL_PREFIX}/${INCLUDE_DIR}")
set(TK_SRC_DIR "${CMAKE_BINARY_DIR}/tk/TK_BLD-prefix/src/TK_BLD")
set(WITH_ITCL_DIR "${BEXT_ITCL_CONFIG_DIR}")
set(ITCL_SRC_DIR "${BEXT_ITCL_SOURCE_DIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_configure.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_configure.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_build.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_build.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itk_install.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/itk_install.cmake @ONLY)
set(ITK_PATCH_COMMAND
${CMAKE_COMMAND}
"-DITK_SOURCE_DIR=<SOURCE_DIR>"
"-DITK_PATCH_EXECUTABLE=${PATCH_NATIVE_EXECUTABLE}"
"-DITK_PATCH_CHECK_OPTION=${PATCH_CHECK_OPTION}"
"-DITK_PATCH_REJECT_DIR=${PATCH_REJECT_DIR}"
"-DITK_PATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/itk.patch"
"-DITK_INSTALL_PATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/itk_install.patch"
-P "${CMAKE_CURRENT_SOURCE_DIR}/itk_apply_patch.cmake"
ExternalProject_Add(ITK_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/itk.patch
CMAKE_ARGS
${BUILD_TYPE_SPECIFIER}
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
-DLIB_DIR=${LIB_DIR}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}/${RPATH_SUFFIX}
-DINCLUDE_DIR=${INCLUDE_DIR}
-DITCL_ROOT=$<$<BOOL:${ITCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DSHARED_DIR=${LIB_DIR}
-DTCL_ENABLE_TK=ON
-DTCL_ROOT=$<$<BOOL:${TCL_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
-DTCL_SOURCE_DIR=${CMAKE_SOURCE_DIR}/tcl/tcl
-DTK_SOURCE_DIR=${CMAKE_SOURCE_DIR}/tk/tk
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
if (NOT MSVC)
ExternalProject_Add(ITK_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${ITK_PATCH_COMMAND}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/manifest.uuid <SOURCE_DIR>/manifest.uuid
COMMAND ${CMAKE_COMMAND} -E make_directory <SOURCE_DIR>/tclconfig
COMMAND ${CMAKE_COMMAND} -E copy ${BEXT_ITCL_BUNDLED_SOURCE_DIR}/tclconfig/install-sh <SOURCE_DIR>/tclconfig/install-sh
CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_configure.cmake
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 INSTALL_OPTIONS=-C install
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
else (NOT MSVC)
# Itk's rules.vc is newer than Tcl 8.6's, so rules-ext.vc selects the
# local nmake support files. Upstream omits the matching targets.vc;
# supply the complete file rather than patching one into existence.
ExternalProject_Add(ITK_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/itk"
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
PATCH_COMMAND ${ITK_PATCH_COMMAND}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/manifest.uuid <SOURCE_DIR>/manifest.uuid
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/targets.vc <SOURCE_DIR>/win/targets.vc
COMMAND ${CMAKE_COMMAND} -E make_directory <SOURCE_DIR>/tclconfig
COMMAND ${CMAKE_COMMAND} -E copy ${BEXT_ITCL_BUNDLED_SOURCE_DIR}/tclconfig/install-sh <SOURCE_DIR>/tclconfig/install-sh
CONFIGURE_COMMAND ""
BINARY_DIR ${ITK_SRC_DIR}/win
BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_build.cmake
INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/itk_install.cmake
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
STEP_TARGETS install
)
endif (NOT MSVC)
TargetInstallDeps(ITK ITK_DEPENDS)
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/itk/license.terms
${DOC_LICENSE_DIR}/itk.txt
${DOC_LICENSE_DIR}/itk3.txt
COPYONLY
)
endif (ENABLE_ITK)
mark_as_advanced(ITK_LIBRARY)
mark_as_advanced(ITK_LIBRARIES)
mark_as_advanced(ITK_VERSION)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-51
View File
@@ -1,51 +0,0 @@
Itk in bext
===========
Tcl 8.6.18 already bundles Itcl 4.3.7, so bext deliberately has no separate
Itcl project. Itk is not part of either source distribution, so the bundled
stack builds Itk from its own upstream repository after Tcl and Tk. A system
Tcl/Tk stack must already provide Itcl and Itk; bext never builds Itk against
system Tcl/Tk.
Itk cannot be built from installed public headers alone. Its implementation
includes Tcl's private tclInt.h and Itcl's private itclInt.h and directly uses
the corresponding internal structures and entry points. The Itk build must
therefore use the private headers and stubs from the exact Tcl/Itcl sources it
accompanies. Bext supplies the standard install-sh helper omitted from the Itk
repository. On Windows, explicit Tcl, Tk, and Itcl source directories are
passed to nmake. On Unix-like platforms, upstream's generated TEA configure
logic gets the corresponding source locations from the bundled configuration.
Upstream's generic Windows TEA install target copies only ``*.tcl`` library
files. Itk also needs its ``*.itk`` class definitions and ``tclIndex`` at
runtime, so bext extends the nmake install target to copy them and verifies the
complete script set before accepting the install.
Itk itself makes no direct Xlib calls: all of its window-system interaction
goes through Tk stubs. Upstream's TEA configuration nevertheless adds the
host X library to Itk. Bext suppresses that unnecessary dependency so Itk
uses the X implementation selected by its matching Tk build and does not mix
two incompatible X ABIs in builds such as the Xmin test configuration.
Itk's own nominal Itcl 4.1 requirement is not sufficient: its upstream suite
has seven failures with Itcl 4.1.0, involving private/protected components and
destroyed-component cleanup, while all 100 tests pass with Itcl 4.1.1. Bext
therefore retains 4.1.1 as Itk's stub and package-index floor.
BRL-CAD has a stronger system-stack requirement. With Tcl/Tk 8.6.18, Itcl
4.1.1, 4.1.2, and 4.2.3 fail the Tk-first Iwidgets baseline because they lack
Itcl 4.3.0's workaround for Tcl 8.6.15's `Tcl_NewObjectInstance` behavior.
The complete baseline passes with Itcl 4.3.0 and Itk 4.2.3, so bext requires
Itcl 4.3.0 or newer before accepting a system stack.
System selection is all-or-nothing: Tcl must load Itcl 4.3.0 or newer, and its
package path must advertise Itk 4.2.3 or newer before bext accepts the matching
system Tk. Itk detection asks Tcl's package handler to index available versions
without executing the selected package's load script, enforcing the floor on
headless builders without trying to create a Tk window. If either extension is
missing or too old, bext selects the complete bundled stack.
The bundled Itk revision reports version 4.2.7 and includes the upstream August
2024 release plus subsequent Windows, Tcl/Tk 9, warning, and TEA maintenance.
The complete upstream suite and BRL-CAD GUI baseline pass with the bundled
Itcl under Xmin using the Xmin-compatible Tk build.
+1 -1
Submodule itk/itk updated: e697407849...0d1dc9780c
+1
View File
@@ -1,4 +1,5 @@
PATCH
TCL
TK
ITCL
+3496 -104
View File
File diff suppressed because it is too large Load Diff
-48
View File
@@ -1,48 +0,0 @@
if (NOT ITK_SOURCE_DIR OR NOT ITK_PATCH_EXECUTABLE OR
NOT ITK_PATCH_CHECK_OPTION OR NOT ITK_PATCH_REJECT_DIR OR
NOT ITK_PATCH_FILE OR NOT ITK_INSTALL_PATCH_FILE)
message(FATAL_ERROR
"Itk patching requires source, patch tool, check option, reject "
"directory, and patch file paths")
endif ()
# Upstream stores this Windows makefile with CRLF line endings. The BSD patch
# utility used on some Unix hosts does not normalize them, so normalize the
# staged copy before applying the cross-platform source patches.
set(ITK_WINDOWS_MAKEFILE "${ITK_SOURCE_DIR}/win/makefile.vc")
file(READ "${ITK_WINDOWS_MAKEFILE}" ITK_WINDOWS_MAKEFILE_CONTENTS)
string(REPLACE "\r\n" "\n" ITK_WINDOWS_MAKEFILE_CONTENTS "${ITK_WINDOWS_MAKEFILE_CONTENTS}")
file(WRITE "${ITK_WINDOWS_MAKEFILE}" "${ITK_WINDOWS_MAKEFILE_CONTENTS}")
set(ITK_PATCH_WRAPPER "${CMAKE_CURRENT_LIST_DIR}/../CMake/PatchWrapper.cmake")
set(ITK_PATCH_FILES
"${ITK_PATCH_FILE}"
"${ITK_INSTALL_PATCH_FILE}"
)
foreach (ITK_CURRENT_PATCH_FILE IN LISTS ITK_PATCH_FILES)
execute_process(
COMMAND "${CMAKE_COMMAND}"
"-DBEXT_PATCH_NATIVE_EXECUTABLE=${ITK_PATCH_EXECUTABLE}"
"-DBEXT_PATCH_CHECK_OPTION=${ITK_PATCH_CHECK_OPTION}"
"-DBEXT_PATCH_REJECT_DIR=${ITK_PATCH_REJECT_DIR}"
-P "${ITK_PATCH_WRAPPER}" -- -E -p1 -N -i "${ITK_CURRENT_PATCH_FILE}"
WORKING_DIRECTORY "${ITK_SOURCE_DIR}"
RESULT_VARIABLE ITK_PATCH_RESULT
OUTPUT_VARIABLE ITK_PATCH_OUTPUT
ERROR_VARIABLE ITK_PATCH_ERROR
)
if (ITK_PATCH_RESULT)
message(FATAL_ERROR
"Itk source patch failed for ${ITK_CURRENT_PATCH_FILE}:\n"
"${ITK_PATCH_OUTPUT}${ITK_PATCH_ERROR}"
)
endif ()
endforeach ()
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-37
View File
@@ -1,37 +0,0 @@
message("Itk build begins\n")
set(BUILD_SCRIPT "${CMAKE_BINARY_DIR}/build_itk.bat")
file(WRITE "${BUILD_SCRIPT}"
"@echo off\n"
"set VSCMD_DEBUG=0\n"
"set \"NoDefaultCurrentDirectoryInExePath=\"\n"
"call \"@VCVARS_BAT@\"\n"
"if errorlevel 1 exit /b %ERRORLEVEL%\n"
"set \"PATH=@BEXT_MSVC_COMPILER_BIN_DIR@;%PATH%\"\n"
"cd /D \"@ITK_SRC_DIR@/win\"\n"
"set CC=\n"
"set RC=\n"
"nmake -f makefile.vc TCLDIR=@TCL_SRC_DIR@ TKDIR=@TK_SRC_DIR@ ITCLDIR=@ITCL_SRC_DIR@ INSTALLDIR=@CMAKE_BUNDLE_INSTALL_PREFIX@ SUFX=\n"
"exit /b %ERRORLEVEL%\n"
)
execute_process(
WORKING_DIRECTORY "@ITK_SRC_DIR@/win"
COMMAND cmd /c "${BUILD_SCRIPT}"
RESULT_VARIABLE ITK_RET
OUTPUT_VARIABLE CMD_OUT
ERROR_VARIABLE CMD_OUT
)
if (ITK_RET)
message(FATAL_ERROR "Itk build failed:\n${CMD_OUT}\n")
endif (ITK_RET)
message("Itk build succeeded:\n${CMD_OUT}\n")
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-41
View File
@@ -1,41 +0,0 @@
if (APPLE)
execute_process(
COMMAND xcrun --show-sdk-path
OUTPUT_VARIABLE SDK_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(ENV{LDFLAGS} "-isysroot ${SDK_PATH} -L${SDK_PATH}/usr/lib -L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@ -F${SDK_PATH}/System/Library/Frameworks -framework CoreFoundation")
set(ENV{CFLAGS} "-isysroot ${SDK_PATH} -L${SDK_PATH}/usr/lib -L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@ -F${SDK_PATH}/System/Library/Frameworks")
set(ENV{CPPFLAGS} "-isystem ${SDK_PATH}/usr/include -F${SDK_PATH}/System/Library/Frameworks -I@CMAKE_BUNDLE_INSTALL_PREFIX@/@INCLUDE_DIR@")
else ()
set(ENV{LD_LIBRARY_PATH} "@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@")
set(ENV{LDFLAGS} "-L@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@")
set(ENV{CPPFLAGS} "-I@CMAKE_BUNDLE_INSTALL_PREFIX@/@INCLUDE_DIR@")
endif (APPLE)
execute_process(
COMMAND "@ITK_SRC_DIR@/configure"
--prefix=@CMAKE_BUNDLE_INSTALL_PREFIX@
--with-tcl=@WITH_TCL_DIR@
--with-tk=@WITH_TK_DIR@
--with-itcl=@WITH_ITCL_DIR@
--with-tclinclude=@WITH_TCL_INCLUDE_DIR@
--with-tkinclude=@WITH_TK_INCLUDE_DIR@
RESULT_VARIABLE ITK_RET
WORKING_DIRECTORY "@ITK_BIN_DIR@"
OUTPUT_VARIABLE MSG
ERROR_VARIABLE MSG
)
if (ITK_RET)
message(FATAL_ERROR "Itk configure failed:\n${MSG}\n")
endif (ITK_RET)
message("${MSG}\nItk configure succeeded.\n")
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-62
View File
@@ -1,62 +0,0 @@
set(INSTALL_SCRIPT "${CMAKE_BINARY_DIR}/install_itk.bat")
file(WRITE "${INSTALL_SCRIPT}"
"@echo off\n"
"set VSCMD_DEBUG=0\n"
"set \"NoDefaultCurrentDirectoryInExePath=\"\n"
"call \"@VCVARS_BAT@\"\n"
"if errorlevel 1 exit /b %ERRORLEVEL%\n"
"set \"PATH=@BEXT_MSVC_COMPILER_BIN_DIR@;%PATH%\"\n"
"cd /D \"@ITK_SRC_DIR@/win\"\n"
"set CC=\n"
"set RC=\n"
"nmake -f makefile.vc install TCLDIR=@TCL_SRC_DIR@ TKDIR=@TK_SRC_DIR@ ITCLDIR=@ITCL_SRC_DIR@ INSTALLDIR=@CMAKE_BUNDLE_INSTALL_PREFIX@ SUFX=\n"
"exit /b %ERRORLEVEL%\n"
)
execute_process(
WORKING_DIRECTORY "@ITK_SRC_DIR@/win"
COMMAND cmd /c "${INSTALL_SCRIPT}"
RESULT_VARIABLE ITK_RET
OUTPUT_VARIABLE CMD_OUT
ERROR_VARIABLE CMD_OUT
)
if (ITK_RET)
message(FATAL_ERROR "Itk install failed:\n${CMD_OUT}\n")
endif (ITK_RET)
set(ITK_SCRIPT_INSTALL_DIR
"@CMAKE_BUNDLE_INSTALL_PREFIX@/@LIB_DIR@/itk@BEXT_ITK_BUNDLED_VERSION@"
)
set(ITK_REQUIRED_SCRIPT_FILES
Archetype.itk
Toplevel.itk
Widget.itk
itk.tcl
pkgIndex.tcl
tclIndex
)
set(ITK_MISSING_SCRIPT_FILES)
foreach (ITK_REQUIRED_SCRIPT_FILE ${ITK_REQUIRED_SCRIPT_FILES})
if (NOT EXISTS "${ITK_SCRIPT_INSTALL_DIR}/${ITK_REQUIRED_SCRIPT_FILE}")
list(APPEND ITK_MISSING_SCRIPT_FILES
"${ITK_SCRIPT_INSTALL_DIR}/${ITK_REQUIRED_SCRIPT_FILE}"
)
endif ()
endforeach ()
if (ITK_MISSING_SCRIPT_FILES)
list(JOIN ITK_MISSING_SCRIPT_FILES "\n " ITK_MISSING_SCRIPT_FILES_TEXT)
message(FATAL_ERROR
"Itk install did not produce required runtime scripts:\n"
" ${ITK_MISSING_SCRIPT_FILES_TEXT}\n"
)
endif ()
message("Itk install succeeded:\n${CMD_OUT}\n")
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8

Some files were not shown because too many files have changed in this diff Show More