Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
195dc3e24d | ||
|
|
d35d0152f8 | ||
|
|
5801e9f9e6 | ||
|
|
006e9db355 | ||
|
|
8eae2d40eb | ||
|
|
baf3038cd1 | ||
|
|
52011c5dcf | ||
|
|
39b9138854 | ||
|
|
ae9d550713 | ||
|
|
4f151ba7f3 | ||
|
|
3f5aeef137 | ||
|
|
4dd532a1f4 | ||
|
|
87a9e4a361 | ||
|
|
f1bfca24ab | ||
|
|
55c6b66ff4 | ||
|
|
799bec628e | ||
|
|
f50169703c | ||
|
|
f5b44b800b | ||
|
|
2b7b512d91 | ||
|
|
74a62e770f | ||
|
|
b54c4d94c9 | ||
|
|
f388808dd5 | ||
|
|
12f7d5669e | ||
|
|
56e1306436 | ||
|
|
1d8e8de021 | ||
|
|
0cbda94442 | ||
|
|
19777317de | ||
|
|
79b68d9c8c | ||
|
|
fb01cf5ec0 | ||
|
|
b60279fce4 | ||
|
|
f6c1e219f4 | ||
|
|
2aceec95cc | ||
|
|
4e4f85a5f5 | ||
|
|
219f68c626 | ||
|
|
374a5d4b72 | ||
|
|
54051990cd | ||
|
|
ff76b235c7 | ||
|
|
c565aa23d4 | ||
|
|
7d0e799891 | ||
|
|
d9f12abc00 | ||
|
|
13e04ce769 | ||
|
|
b43c55bd16 | ||
|
|
fa85fcbe8e | ||
|
|
a16b4a6baf | ||
|
|
364b6b4ee2 | ||
|
|
4ca1f79ab9 | ||
|
|
6709a5e275 | ||
|
|
62dd245aed | ||
|
|
86895dcdbd | ||
|
|
6efe6ecbcf | ||
|
|
8621d937c2 | ||
|
|
7e35512c44 | ||
|
|
7ebceffe79 | ||
|
|
c57c062f25 | ||
|
|
5f02a06a27 | ||
|
|
2af8cce2bb | ||
|
|
5f9560441f | ||
|
|
6e6a6175fd | ||
|
|
c0c4c2f4d0 | ||
|
|
a48ae4bc4e | ||
|
|
98be15e700 | ||
|
|
0f52b9f48a | ||
|
|
05e442e141 | ||
|
|
c6388d2a70 | ||
|
|
e5775f675f | ||
|
|
9f301944c2 | ||
|
|
122ba04a96 | ||
|
|
10ce6a2a8f | ||
|
|
3b55bceffc | ||
|
|
c116241190 | ||
|
|
84d6e8c641 | ||
|
|
50ca670e0d | ||
|
|
f75541f5a6 | ||
|
|
e6f2e2a2a8 | ||
|
|
01f26ed978 | ||
|
|
119ca0197e | ||
|
|
9ac8d7c62d | ||
|
|
5cec0988eb | ||
|
|
d0c83bb5fc | ||
|
|
5fbd44a9b0 | ||
|
|
99b7124ed1 | ||
|
|
cc4ebeeb38 | ||
|
|
40f83e952b | ||
|
|
13af2bf64c | ||
|
|
71b46f4f20 | ||
|
|
344809cdde | ||
|
|
136738824c | ||
|
|
a84fb416de | ||
|
|
dd504f3f89 | ||
|
|
c41c111bc9 | ||
|
|
b41712afdc | ||
|
|
dffd78f2c3 | ||
|
|
3e43fdd83e | ||
|
|
02798b5732 | ||
|
|
7c9d874bf5 | ||
|
|
949b394e8b | ||
|
|
fb4c47790a | ||
|
|
564f66ef8f | ||
|
|
366d4a8ccb | ||
|
|
d8d2099421 | ||
|
|
bdaf9c1d51 | ||
|
|
ba73add03b | ||
|
|
a61f1674be | ||
|
|
9de877163d | ||
|
|
7eaec42723 | ||
|
|
ef7b754633 | ||
|
|
0139aef7cf | ||
|
|
6f6ee77f4b | ||
|
|
9a4f748199 | ||
|
|
f2f561a701 | ||
|
|
b0ebab1bd4 | ||
|
|
8d3c3d3348 | ||
|
|
606596f1f1 | ||
|
|
d30c9b9c99 | ||
|
|
62dd78aa8d | ||
|
|
2cf50965dc | ||
|
|
14df08be98 | ||
|
|
352b58f0ae | ||
|
|
2fb93e20f4 | ||
|
|
3827531ead | ||
|
|
d1a01b527a | ||
|
|
d26b3f13fb | ||
|
|
b337acc1f3 | ||
|
|
4c289c0d5d | ||
|
|
c66cf8d7e7 | ||
|
|
dda9c16a80 | ||
|
|
bb75c9a35f | ||
|
|
a9dd4139ee | ||
|
|
5f15f22fcd | ||
|
|
39d38050b1 | ||
|
|
a75b442696 | ||
|
|
f8e0be4212 | ||
|
|
43a173bfe5 | ||
|
|
ec45d1802d | ||
|
|
269a10e090 | ||
|
|
8af33bc12f | ||
|
|
1aa3cfdffc | ||
|
|
b78aa61494 | ||
|
|
016b9bd11e | ||
|
|
4df2c07626 | ||
|
|
8ec79c216f | ||
|
|
ccee7d8da2 | ||
|
|
0fe0277e88 | ||
|
|
fd4bf7c3ae | ||
|
|
926bc4d20f | ||
|
|
13e7b8f057 | ||
|
|
c492e7f63b | ||
|
|
63ddb79c16 | ||
|
|
a0f0b51a7d | ||
|
|
1114fad340 | ||
|
|
62e4015096 | ||
|
|
beead06c09 | ||
|
|
69cd9afc93 | ||
|
|
eb20e24397 | ||
|
|
bc73bf4e9b | ||
|
|
cfdef3de77 | ||
|
|
228201d3e1 | ||
|
|
d79f88cb4b | ||
|
|
37cb81016a | ||
|
|
546d964c3b | ||
|
|
194e19196d | ||
|
|
f75ec63b1e | ||
|
|
b8c7c5f262 | ||
|
|
9278314222 | ||
|
|
0352b63f73 | ||
|
|
18fc3a6206 | ||
|
|
edfd0ba01b | ||
|
|
0ae7f1dc1d | ||
|
|
8075a8544d | ||
|
|
e8cdc58fb0 | ||
|
|
4dd690900c | ||
|
|
e810f0e7a6 | ||
|
|
40de130363 | ||
|
|
07e655794b | ||
|
|
a557407c71 | ||
|
|
fa282dc2d1 | ||
|
|
42f9cd28fd | ||
|
|
a7de70fe15 | ||
|
|
b7eb5fa064 | ||
|
|
70bf649aec | ||
|
|
17f3f0c802 | ||
|
|
97144d9ce8 | ||
|
|
5d1739c736 | ||
|
|
657d0b2c8f | ||
|
|
fe856ea716 | ||
|
|
b171adcc33 | ||
|
|
a77f10ccb5 | ||
|
|
4ae43a98dc | ||
|
|
e819891ffc | ||
|
|
174ddc4281 | ||
|
|
a001088581 | ||
|
|
3cfa175196 | ||
|
|
7c54f6d527 | ||
|
|
c944b18111 | ||
|
|
4843b29eb6 | ||
|
|
ecec7ad81d | ||
|
|
a1aeeb1313 | ||
|
|
295cdc9f0f | ||
|
|
06d1ac96f9 | ||
|
|
8d97de2af8 | ||
|
|
fa11494067 | ||
|
|
3211ee1861 | ||
|
|
cef112292a | ||
|
|
5f8ed1189c | ||
|
|
affb3b60f6 | ||
|
|
543b340820 | ||
|
|
935331c5eb | ||
|
|
7cf75fd2c1 | ||
|
|
b83786ff08 | ||
|
|
2b480a266a | ||
|
|
ce95a2668d | ||
|
|
ee06c9068b | ||
|
|
2035d78b52 | ||
|
|
aea0dee2ef | ||
|
|
9cbd27d307 | ||
|
|
7bebf9ea7a | ||
|
|
40a163b478 | ||
|
|
27e9152fe7 | ||
|
|
442086b36c | ||
|
|
82fc774da6 | ||
|
|
66f095a7d9 | ||
|
|
7476dee430 | ||
|
|
632dbeac1b | ||
|
|
998ddc16dc | ||
|
|
8a9a21f285 | ||
|
|
90ea63597e | ||
|
|
df352726ce | ||
|
|
9449a6599f | ||
|
|
f2a02366be | ||
|
|
f68d029b9f | ||
|
|
6f48a372bf | ||
|
|
853629b6aa | ||
|
|
8fe78cfe60 | ||
|
|
0388f4a12f | ||
|
|
5e72707059 | ||
|
|
79a7111dfa | ||
|
|
90642ca5ae | ||
|
|
f11907cb9d | ||
|
|
54be88f43f | ||
|
|
ec648a3f3f | ||
|
|
ca22a6953d | ||
|
|
fdda7359c1 | ||
|
|
4db3a8c285 | ||
|
|
c4a046f7c4 | ||
|
|
8eb4776ce0 | ||
|
|
0dcb158eab | ||
|
|
685e77285f | ||
|
|
650274859e | ||
|
|
3241e30ea9 | ||
|
|
ea95b66680 | ||
|
|
b053baaf86 | ||
|
|
9d046fe578 | ||
|
|
0c539a0395 | ||
|
|
7ac50ea0db | ||
|
|
e466239372 | ||
|
|
ceb224d5b5 | ||
|
|
5277e71dac | ||
|
|
ba8043ccdb | ||
|
|
cf10cf56f1 | ||
|
|
1212ce9664 | ||
|
|
0a45216aff | ||
|
|
fa61afc565 | ||
|
|
e18b1c12a7 | ||
|
|
eb1cb5346e | ||
|
|
bc693f8244 | ||
|
|
eb91894d69 | ||
|
|
d1832df2ad | ||
|
|
068f42ad92 | ||
|
|
ed8a0febc2 | ||
|
|
a8e0ae9020 | ||
|
|
a706f0f997 | ||
|
|
3948f11cf2 | ||
|
|
306f40246d | ||
|
|
e1435bdc0f | ||
|
|
861e6a4d7b |
@@ -20,6 +20,57 @@ 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
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
preset: [auto, bundled, minimal, everything]
|
||||
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 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: Configure
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE:$PATH
|
||||
cmake --preset ${{ matrix.preset }} -DGIT_SHALLOW_CLONE=ON -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
windows_ninja_release:
|
||||
name: MSVC - Ninja Release build
|
||||
runs-on: windows-latest
|
||||
@@ -45,7 +96,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=Release -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=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 -DEXT_BUILD_VERBOSE=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
|
||||
@@ -88,7 +139,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
|
||||
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
|
||||
# We do the following in order to help ensure files are "flushed"
|
||||
# to disk before compilation is attempted
|
||||
# https://superuser.com/a/1553374/1286142
|
||||
@@ -127,7 +178,7 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
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
|
||||
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=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
|
||||
@@ -160,7 +211,7 @@ jobs:
|
||||
shell: cmd
|
||||
run: |
|
||||
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
|
||||
cmake -S . -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DEXT_BUILD_VERBOSE=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
|
||||
@@ -202,7 +253,7 @@ jobs:
|
||||
- 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
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -238,7 +289,7 @@ jobs:
|
||||
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
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_GDAL=OFF -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -267,7 +318,7 @@ 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=Release
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -295,10 +346,9 @@ 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
|
||||
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DEXT_BUILD_VERBOSE=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
|
||||
cd build && ninja -j2 -v
|
||||
|
||||
|
||||
+80
-14
@@ -2,318 +2,384 @@
|
||||
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 = RELEASE
|
||||
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
|
||||
shallow = true
|
||||
[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 "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 "osmesa/osmesa"]
|
||||
path = osmesa/osmesa
|
||||
url = https://github.com/BRL-CAD/osmesa
|
||||
ignore = dirty
|
||||
[submodule "utahrle/utahrle"]
|
||||
path = utahrle/utahrle
|
||||
url = https://github.com/BRL-CAD/utahrle
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "tk/tk"]
|
||||
path = tk/tk
|
||||
url = https://github.com/BRL-CAD/tk
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itcl3/itcl"]
|
||||
path = itcl/itcl
|
||||
url = https://github.com/BRL-CAD/itcl
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "itk3/itk"]
|
||||
path = itk/itk
|
||||
url = https://github.com/BRL-CAD/itk
|
||||
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
|
||||
[submodule "geogram/geogram"]
|
||||
path = geogram/geogram
|
||||
url = https://github.com/BRL-CAD/geogram.git
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[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
|
||||
branch = RELEASE
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "tinygltf/tinygltf"]
|
||||
path = tinygltf/tinygltf
|
||||
url = https://github.com/BRL-CAD/tinygltf.git
|
||||
branch = release
|
||||
ignore = dirty
|
||||
shallow = true
|
||||
[submodule "poissonrecon/PoissonRecon"]
|
||||
path = poissonrecon/PoissonRecon
|
||||
url = https://github.com/BRL-CAD/PoissonRecon
|
||||
branch = RELEASE
|
||||
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
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
set(bext_root "${CMAKE_CURRENT_LIST_DIR}/..")
|
||||
get_filename_component(bext_root "${bext_root}" ABSOLUTE)
|
||||
|
||||
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)
|
||||
|
||||
set(git_args submodule update --init --recursive --jobs 8)
|
||||
if (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args --recommend-shallow)
|
||||
endif (GIT_SHALLOW_CLONE)
|
||||
list(APPEND git_args -- ${project_paths})
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} ${git_args}
|
||||
WORKING_DIRECTORY ${bext_root}
|
||||
COMMAND_ERROR_IS_FATAL ANY
|
||||
)
|
||||
|
||||
message(STATUS "Bootstrap complete for profile ${profile}")
|
||||
@@ -0,0 +1,220 @@
|
||||
# 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()
|
||||
@@ -1,112 +0,0 @@
|
||||
# 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)
|
||||
|
||||
@@ -2,23 +2,22 @@
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindTCL
|
||||
-------
|
||||
FindITCL
|
||||
--------
|
||||
|
||||
This module finds if Tcl is installed and determines where the include
|
||||
This module finds if Itcl 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
|
||||
ITCL_FOUND = Itcl was found
|
||||
ITCL_LIBRARY = path to Itcl library (tcl tcl80)
|
||||
ITCL_INCLUDE_PATH = path to where itcl.h can be found
|
||||
ITCL_STUB_LIBRARY = path to Itcl stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(CMakeFindFrameworks)
|
||||
|
||||
set(_ITCL_SEARCHES)
|
||||
|
||||
|
||||
@@ -107,6 +107,29 @@ 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)
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@ 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.
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
#
|
||||
# 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()
|
||||
@@ -55,6 +55,10 @@ 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)
|
||||
@@ -107,6 +111,10 @@ 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)
|
||||
|
||||
@@ -136,6 +144,7 @@ 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)
|
||||
|
||||
@@ -42,6 +42,10 @@ 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.
|
||||
|
||||
+276
-218
@@ -34,7 +34,6 @@ TTK_STUB_LIBRARY = path to ttk stub library
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(CMakeFindFrameworks)
|
||||
|
||||
set(_TCL_SEARCHES)
|
||||
|
||||
@@ -48,8 +47,11 @@ 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"
|
||||
@@ -57,13 +59,16 @@ 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"
|
||||
@@ -74,9 +79,11 @@ 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"
|
||||
@@ -87,20 +94,30 @@ 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)
|
||||
@@ -108,257 +125,298 @@ 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)
|
||||
|
||||
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
|
||||
)
|
||||
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
|
||||
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)
|
||||
|
||||
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
|
||||
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
|
||||
@@ -368,73 +426,71 @@ set(TCLTK_POSSIBLE_INCLUDE_PATH_SUFFIXES
|
||||
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)
|
||||
@@ -452,28 +508,31 @@ 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
|
||||
@@ -485,8 +544,7 @@ mark_as_advanced(
|
||||
TK_STUB_LIBRARY
|
||||
TK_WISH
|
||||
TTK_STUB_LIBRARY
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
# 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()
|
||||
+489
-90
@@ -1,123 +1,522 @@
|
||||
#.rst:
|
||||
# FindZLIB
|
||||
# --------
|
||||
# Distributed under the OSI-approved BSD 3-Clause License.
|
||||
# See CMake's LICENSE.rst or https://cmake.org/licensing for details.
|
||||
#
|
||||
# Find the native ZLIB includes and library.
|
||||
# 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)
|
||||
#
|
||||
# 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.
|
||||
#[=======================================================================[.rst:
|
||||
FindZLIB
|
||||
--------
|
||||
|
||||
#=============================================================================
|
||||
# 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.)
|
||||
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()
|
||||
|
||||
set(_ZLIB_SEARCHES)
|
||||
|
||||
# Search ZLIB_ROOT first if it is set.
|
||||
# Search ZLIB_ROOT first if it is set. Support both a CMake variable and
|
||||
# an environment variable for command-line and packaged-build workflows.
|
||||
if(ZLIB_ROOT)
|
||||
set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
|
||||
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)
|
||||
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"
|
||||
)
|
||||
PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
|
||||
"$ENV{ProgramFiles}/zlib"
|
||||
"$ENV{ProgramFiles${_ZLIB_x86}}/zlib"
|
||||
)
|
||||
unset(_ZLIB_x86)
|
||||
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
|
||||
|
||||
set(ZLIB_NAMES z_brl z zlib zdll zlib1 zlibd zlibd1)
|
||||
# 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()
|
||||
|
||||
# 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)
|
||||
find_path(ZLIB_INCLUDE_DIR
|
||||
NAMES zlib.h
|
||||
${${search}}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
endforeach()
|
||||
|
||||
mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
|
||||
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
|
||||
)
|
||||
|
||||
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 \"[^\"]*\"$"
|
||||
)
|
||||
|
||||
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:
|
||||
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 "")
|
||||
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()
|
||||
endif()
|
||||
|
||||
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
|
||||
set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
|
||||
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
|
||||
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()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
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)
|
||||
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()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
|
||||
VERSION_VAR ZLIB_VERSION_STRING)
|
||||
find_package_handle_standard_args(ZLIB
|
||||
REQUIRED_VARS ${_ZLIB_REQUIRED_VARS}
|
||||
VERSION_VAR ZLIB_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
|
||||
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET ZLIB::ZLIB)
|
||||
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
|
||||
if(NOT ZLIB_LIBRARIES)
|
||||
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)
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
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()
|
||||
@@ -0,0 +1,541 @@
|
||||
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 "&" "&" escaped "${value}")
|
||||
string(REPLACE "<" "<" escaped "${escaped}")
|
||||
string(REPLACE ">" ">" escaped "${escaped}")
|
||||
string(REPLACE "\"" """ 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 ()
|
||||
@@ -0,0 +1,115 @@
|
||||
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}")
|
||||
@@ -0,0 +1,76 @@
|
||||
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()
|
||||
|
||||
set(patch_args)
|
||||
set(seen_separator FALSE)
|
||||
set(has_forward_flag FALSE)
|
||||
set(has_reverse_flag FALSE)
|
||||
|
||||
math(EXPR last_arg "${CMAKE_ARGC} - 1")
|
||||
foreach(arg_index RANGE 0 ${last_arg})
|
||||
set(arg "${CMAKE_ARGV${arg_index}}")
|
||||
if (seen_separator)
|
||||
list(APPEND patch_args "${arg}")
|
||||
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()
|
||||
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()
|
||||
|
||||
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)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (patch_result EQUAL 1 AND has_forward_flag AND NOT has_reverse_flag)
|
||||
set(reverse_dry_run_args)
|
||||
foreach(arg IN LISTS patch_args)
|
||||
if (arg STREQUAL "-N" OR arg STREQUAL "--forward")
|
||||
continue()
|
||||
endif()
|
||||
list(APPEND reverse_dry_run_args "${arg}")
|
||||
endforeach()
|
||||
list(PREPEND reverse_dry_run_args "--dry-run" "-R")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${BEXT_PATCH_NATIVE_EXECUTABLE}" ${reverse_dry_run_args}
|
||||
RESULT_VARIABLE reverse_result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
if (reverse_result EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"Patch already applied or reversed; continuing because -N/--forward was requested."
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(FATAL_ERROR "Patch command failed with exit code ${patch_result}")
|
||||
@@ -0,0 +1,474 @@
|
||||
# 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.
|
||||
#
|
||||
###
|
||||
|
||||
|
||||
###############################################################################
|
||||
# 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})
|
||||
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)
|
||||
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 (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
|
||||
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 (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${path}/${checkfile})
|
||||
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
|
||||
+513
-216
@@ -23,7 +23,7 @@
|
||||
# still possible to request a system library in individual cases.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(BEXT)
|
||||
|
||||
@@ -73,6 +73,31 @@ 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
|
||||
@@ -98,6 +123,11 @@ 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)
|
||||
@@ -118,29 +148,18 @@ 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.
|
||||
|
||||
# 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
|
||||
# Default to the build directory for output and installation
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${ENV_HOME}")
|
||||
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "default install path" FORCE)
|
||||
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
# 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
|
||||
# Make sure subsequent configures stick with the same installation path, whether specified or not
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Calculated or specified install prefix" 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)
|
||||
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)
|
||||
file(MAKE_DIRECTORY "${CMAKE_BUNDLE_INSTALL_PREFIX}")
|
||||
file(MAKE_DIRECTORY "${CMAKE_NOBUNDLE_INSTALL_PREFIX}")
|
||||
|
||||
@@ -176,6 +195,55 @@ 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 deliberate exception is a very large source tree such as Qt6, where the
|
||||
# copy cost is significant and in-place patching/building is preferred.
|
||||
# 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}")
|
||||
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)
|
||||
@@ -185,6 +253,14 @@ 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
|
||||
@@ -229,99 +305,28 @@ endif(MSVC)
|
||||
file(MAKE_DIRECTORY ${CMAKE_NOBUNDLE_INSTALL_PREFIX})
|
||||
add_custom_target(BuildStamp ALL COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_NOBUNDLE_INSTALL_PREFIX}/build-stamp)
|
||||
|
||||
# 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)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# 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 some utility macros and functions to reduce boilerplate code needed
|
||||
# in dependency CMakeLists.txt files
|
||||
###############################################################################
|
||||
configure_file("${CMAKE_SOURCE_DIR}/dependencies.dot" "${CMAKE_BINARY_DIR}/bext.dot" COPYONLY)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils.cmake")
|
||||
|
||||
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 -
|
||||
@@ -340,105 +345,6 @@ option(USE_OSPRAY "OSPRay rendering system" OFF)
|
||||
option(USE_QT "Qt graphical toolkit support" ON)
|
||||
option(USE_TCL "Tcl/Tk support" ON)
|
||||
|
||||
# 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
|
||||
@@ -467,13 +373,403 @@ if (USE_OSPRAY)
|
||||
endif (USE_OSPRAY)
|
||||
|
||||
###############################################################################
|
||||
# There are a lot of individual projects, and their ordering is important. We
|
||||
# store them as a separate file.
|
||||
# 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.
|
||||
###############################################################################
|
||||
include("${CMAKE_SOURCE_DIR}/dependencies.cmake")
|
||||
add_project(patch)
|
||||
|
||||
# Now that we have the dependencies specified, finish the dependencies DOT file
|
||||
file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\n}\n")
|
||||
###############################################################################
|
||||
# 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")
|
||||
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;BRLCAD;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")
|
||||
|
||||
# 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")
|
||||
|
||||
# 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")
|
||||
|
||||
# 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")
|
||||
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")
|
||||
|
||||
# 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")
|
||||
|
||||
|
||||
###############################################################################
|
||||
# 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
|
||||
)
|
||||
|
||||
###############################################################################
|
||||
# Warn the user if the settings changed in a way the indicate there is a risk
|
||||
@@ -487,12 +783,14 @@ 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}/bext_output/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/DllTypeCheck.cmake)
|
||||
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
|
||||
@@ -500,7 +798,7 @@ add_custom_target(dll_typecheck
|
||||
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}/bext_output/install/bin\" -P ${CMAKE_SOURCE_DIR}/CMake/LoadLibraryCheck.cmake
|
||||
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)
|
||||
@@ -508,7 +806,7 @@ endif (WIN32)
|
||||
###############################################################################
|
||||
# Report where we will be putting our output
|
||||
###############################################################################
|
||||
message("Output directory: ${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}")
|
||||
message(STATUS "Output directory: ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
@@ -516,4 +814,3 @@ message("Output directory: ${CMAKE_INSTALL_PREFIX}/${BEXT_ROOT}")
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
{
|
||||
"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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
# 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) |
|
||||
| `itcl` | `USE_TCL` | `install` | `patch`, `tcl` | [repository](https://github.com/BRL-CAD/itcl) |
|
||||
| `itk` | `USE_TCL` | `install` | `patch`, `tcl`, `tk`, `itcl` | [repository](https://github.com/BRL-CAD/itk) |
|
||||
| `iwidgets` | `USE_TCL` | `install` | `patch`, `itcl`, `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) |
|
||||
| `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` | `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) |
|
||||
| `xmltools` | `USE_BRLCAD_EXTRA` | `noinstall` | `patch` | [repository](https://github.com/BRL-CAD/xmltools) |
|
||||
| `yaml-cpp` | `USE_APPLESEED` | `install` | `patch` | [repository](https://github.com/BRL-CAD/yaml-cpp) |
|
||||
| `zlib` | `USE_APPLESEED`, `USE_BRLCAD`, `USE_OSPRAY` | `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).
|
||||
+83
-23
@@ -1,51 +1,111 @@
|
||||
# bext - Installation
|
||||
# bext - Installation Notes
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
# 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.
|
||||
|
||||
# Ubuntu Linux
|
||||
|
||||
Basic tools needed for all configurations:
|
||||
```
|
||||
Base packages:
|
||||
|
||||
```sh
|
||||
sudo apt install git cmake gcc g++
|
||||
```
|
||||
|
||||
For Tk you'll need basic X11 libraries:
|
||||
```
|
||||
For Tcl/Tk builds:
|
||||
|
||||
```sh
|
||||
sudo apt install libfontconfig1-dev libfreetype6-dev xserver-xorg-dev libx11-dev libxi-dev libxext-dev
|
||||
```
|
||||
|
||||
For Qt, Appleseed and OSPRay you'll need Python
|
||||
```
|
||||
For Qt, Appleseed, and OSPRay:
|
||||
|
||||
```sh
|
||||
sudo apt install libpython3-dev
|
||||
```
|
||||
|
||||
For Qt you'll also need (in addition to the above) the XCB packages (see https://doc.qt.io/qt-6/linux-requirements.html)
|
||||
```
|
||||
For Qt on X11 systems, install the XCB development packages:
|
||||
|
||||
```sh
|
||||
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 you'll need m4, and for the ISPC compiler used by OSPRay you'll need the gcc multilib packages:
|
||||
```
|
||||
For OSPRay:
|
||||
|
||||
```sh
|
||||
sudo apt install m4 gcc-multilib g++-multilib
|
||||
```
|
||||
|
||||
If you don't want to build flex and bison for the OSPRay/Appleseed stacks you can also install those:
|
||||
```
|
||||
If you want to rely on system `flex` and `bison`:
|
||||
|
||||
```sh
|
||||
sudo apt install flex bison
|
||||
```
|
||||
|
||||
If you do want to build them, install the Autotools stack:
|
||||
```
|
||||
sudo apt-get install autotools-dev autoconf
|
||||
If `bext` may need to build `flex` and `bison` locally:
|
||||
|
||||
```sh
|
||||
sudo apt install autotools-dev autoconf
|
||||
```
|
||||
|
||||
# Windows
|
||||
|
||||
Windows will need some variety of Python installed for Qt/Appleseed/OSPRay.
|
||||
If you enable Qt, Appleseed, or OSPRay, make sure Python 3 is installed and
|
||||
available in the build environment.
|
||||
|
||||
# OSX
|
||||
|
||||
XCode
|
||||
|
||||
What else? - TODO
|
||||
# macOS
|
||||
|
||||
Assuming XCode is installed, good to go.
|
||||
|
||||
@@ -77,6 +77,13 @@ 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
|
||||
@@ -127,6 +134,13 @@ 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
|
||||
@@ -343,7 +357,7 @@ process are:
|
||||
suggests the upstream might be receptive to changing how their install
|
||||
structure is laid out.
|
||||
|
||||
Once you have everything installing into bext_output/install/ correctly and
|
||||
Once you have everything installing into 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
|
||||
@@ -351,9 +365,10 @@ 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 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 (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:
|
||||
|
||||
```
|
||||
$ git clone --recursive git@github.com:BRL-CAD/geogram.git
|
||||
@@ -552,7 +567,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
|
||||
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
|
||||
CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
|
||||
Compatibility with CMake < 3.5 will be removed from a future version of
|
||||
CMake.
|
||||
@@ -735,7 +750,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
|
||||
build (main) $ cmake .. -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release
|
||||
build (main) $ make GEOGRAM_BLD
|
||||
[ 0%] Creating directories for 'PATCH_BLD'
|
||||
[ 0%] No download step for 'PATCH_BLD'
|
||||
@@ -763,10 +778,10 @@ build (main) $ make GEOGRAM_BLD
|
||||
[100%] Built target GEOGRAM_BLD
|
||||
```
|
||||
|
||||
Once we have a successful completion, we inspect the contents of bext_output/install:
|
||||
Once we have a successful completion, we inspect the contents of install:
|
||||
|
||||
```
|
||||
bext/build (main) $ ls -R ~/bext_output/install/
|
||||
bext/build (main) $ ls -R ~/install/
|
||||
```
|
||||
|
||||
One thing to note is that a lot of the third party headers have been installed,
|
||||
@@ -860,7 +875,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 bext_output/install copy fails to work when copied into
|
||||
happen that a working 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
|
||||
|
||||
@@ -1,95 +1,170 @@
|
||||
# bext - External Dependencies Management
|
||||
# bext - External Dependencies for BRL-CAD
|
||||
|
||||
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.
|
||||
`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.
|
||||
|
||||
# Quick start
|
||||
|
||||
* Clone this repository
|
||||
Clone the repository, configure with the official `auto` preset, and build:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/BRL-CAD/bext
|
||||
```
|
||||
(This should be fast - by default most of the downloading happens during the configure process.)
|
||||
* Make a build directory
|
||||
```sh
|
||||
mkdir bext_build && cd bext_build
|
||||
```
|
||||
* 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 ../bext -DENABLE_ALL=ON
|
||||
```
|
||||
* Run the build process.
|
||||
```sh
|
||||
cmake --build . --config Release --parallel 8
|
||||
cd bext
|
||||
cmake --preset auto
|
||||
cmake --build build/auto --config Release --parallel 8
|
||||
```
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```sh
|
||||
git clone --recursive https://github.com/BRL-CAD/bext
|
||||
cmake -DPROFILE=auto -P CMake/BextBootstrap.cmake
|
||||
cmake --preset auto
|
||||
```
|
||||
|
||||
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.
|
||||
Use `LIST_ONLY=ON` to preview the selected submodules without fetching them,
|
||||
and `GIT_SHALLOW_CLONE=ON` to specify shallow clones during bootstrap.
|
||||
|
||||
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.
|
||||
# How manual selection works
|
||||
|
||||
# USE_* Options
|
||||
Build selection happens in three layers:
|
||||
|
||||
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:
|
||||
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.
|
||||
|
||||
* 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
|
||||
Default `USE_*` values:
|
||||
|
||||
(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, not all dependencies will be needed.)
|
||||
* `USE_BRLCAD=ON`
|
||||
* `USE_BRLCAD_EXTRA=ON`
|
||||
* `USE_GDAL=ON`
|
||||
* `USE_QT=ON`
|
||||
* `USE_TCL=ON`
|
||||
* `USE_APPLESEED=OFF`
|
||||
* `USE_OSPRAY=OFF`
|
||||
|
||||
# Using the Build Outputs with BRL-CAD
|
||||
`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`.
|
||||
|
||||
At the moment this repository and BRL-CAD's support of it are still experimental.
|
||||
To test it, the steps are as follows:
|
||||
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:
|
||||
|
||||
```sh
|
||||
cmake --preset auto
|
||||
cmake --preset bundled
|
||||
cmake --preset minimal
|
||||
cmake --preset everything
|
||||
```
|
||||
|
||||
Build using the preset's build directory:
|
||||
|
||||
```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
|
||||
|
||||
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:
|
||||
|
||||
* Clone the BRL-CAD repository
|
||||
```sh
|
||||
git clone https://github.com/BRL-CAD/brlcad
|
||||
```
|
||||
* 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_install_dir>/bext_output -DBRLCAD_ENABLE_QT=ON
|
||||
```
|
||||
* Run the build process.
|
||||
```sh
|
||||
mkdir brlcad_build
|
||||
cd brlcad_build
|
||||
cmake ../brlcad -DBRLCAD_EXT_DIR=../bext_build -DCMAKE_BUILD_TYPE=Release
|
||||
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.
|
||||
If you built Qt in `bext`, also enable Qt in BRL-CAD:
|
||||
|
||||
```sh
|
||||
cmake ../brlcad \
|
||||
-DBRLCAD_EXT_DIR=../bext_build \
|
||||
-DBRLCAD_ENABLE_QT=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
```
|
||||
|
||||
# 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.
|
||||
# More information
|
||||
|
||||
* [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
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
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 bext_output directory, so the contents reflect the new
|
||||
1. clear the output directories, so the contents reflect the new
|
||||
settings rather than keeping potentially outdated files
|
||||
|
||||
2. remove old build directory contents for those projects that have
|
||||
|
||||
@@ -9,20 +9,32 @@ 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
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/appleseed"
|
||||
URL "${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}>
|
||||
-DTBB_ROOT=$<$<BOOL:${TBB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
$<$<BOOL:${ONETBB_TARGET}>:-DTBB_ROOT=${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}>
|
||||
@@ -32,6 +44,16 @@ 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
|
||||
@@ -41,6 +63,7 @@ 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
|
||||
@@ -52,11 +75,13 @@ 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}
|
||||
@@ -81,4 +106,3 @@ endif (ENABLE_APPLESEED)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
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(
|
||||
@@ -1,6 +1,7 @@
|
||||
# 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 "libgcv")
|
||||
# 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")
|
||||
|
||||
bext_enable(ASSETIMPORT)
|
||||
|
||||
@@ -12,13 +13,16 @@ if (ENABLE_ASSETIMPORT)
|
||||
|
||||
RegisterDeps(ASSETIMPORT)
|
||||
if (TARGET ZLIB_BLD)
|
||||
set(ZLIB_TARGET ZLIB_BLD)
|
||||
set(Z_PREFIX_STR "brl_")
|
||||
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.patch
|
||||
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
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
$<$<BOOL:${ZLIB_TARGET}>:-DZ_PREFIX=ON>
|
||||
@@ -33,9 +37,11 @@ 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}
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
diff -Naur assimp/CMakeLists.txt ASSETIMPORT_BLD/CMakeLists.txt
|
||||
--- assimp/CMakeLists.txt 2024-08-22 16:04:35.540387715 -0400
|
||||
+++ ASSETIMPORT_BLD/CMakeLists.txt 2024-08-22 16:05:12.765176737 -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 )
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,98 @@
|
||||
--- 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)
|
||||
@@ -0,0 +1,12 @@
|
||||
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;
|
||||
+1
-1
Submodule assetimport/assimp updated: 61aeb7a67b...cfc14a26d2
@@ -1,8 +1,6 @@
|
||||
# Astyle is not bundled with BRL-CAD - it is a source code formatting tool,
|
||||
# optionally used during compilation to validate our style guidelines.
|
||||
if (ENABLE_ALL AND NOT DEFINED ENABLE_ASTYLE)
|
||||
set(ENABLE_ASTYLE ON)
|
||||
endif (ENABLE_ALL AND NOT DEFINED ENABLE_ASTYLE)
|
||||
bext_enable_all_default(ASTYLE astyle)
|
||||
|
||||
if (NOT ENABLE_ASTYLE)
|
||||
|
||||
@@ -30,7 +28,6 @@ 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}
|
||||
@@ -53,4 +50,3 @@ endif (ENABLE_ASTYLE)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ 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>
|
||||
@@ -57,4 +59,3 @@ endif (ENABLE_BOOST)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -0,0 +1,437 @@
|
||||
# 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)
|
||||
|
||||
+10
-575
@@ -1,134 +1,8 @@
|
||||
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 @@
|
||||
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)
|
||||
|
||||
project(boost_iostreams VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
@@ -137,450 +11,11 @@ diff -Naur boost/libs/iostreams/CMakeLists.txt BOOST_BLD/libs/iostreams/CMakeLis
|
||||
add_library(boost_iostreams
|
||||
src/file_descriptor.cpp
|
||||
src/mapped_file.cpp
|
||||
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 @@
|
||||
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)
|
||||
|
||||
project(boost_locale VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
# 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
+1
Submodule bullet/bullet3 added at 63c4d67e33
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
@@ -0,0 +1,197 @@
|
||||
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)
|
||||
{
|
||||
@@ -7,14 +7,14 @@ bext_enable(CLIPPER2)
|
||||
|
||||
if (ENABLE_CLIPPER2)
|
||||
|
||||
git_submodule_init(Clipper2 readme.md)
|
||||
git_submodule_init(Clipper2 README.md)
|
||||
|
||||
RegisterDeps(CLIPPER2)
|
||||
|
||||
ExternalProject_Add(CLIPPER2_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/Clipper2/CPP"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
#PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/clipper2.patch
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/clipper2.patch
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DCLIPPER2_UTILS=OFF
|
||||
@@ -25,6 +25,7 @@ if (ENABLE_CLIPPER2)
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
|
||||
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
|
||||
|
||||
+1
-1
Submodule clipper2/Clipper2 updated: 736ddb0b53...6901921c4b
@@ -0,0 +1,80 @@
|
||||
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)
|
||||
@@ -1,307 +0,0 @@
|
||||
###############################################################################
|
||||
# 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")
|
||||
|
||||
# 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")
|
||||
|
||||
# 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")
|
||||
|
||||
# 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")
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
/* 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;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Decide if we're using Eigen
|
||||
cad_enable(EIGEN "libbg;libbn;librt")
|
||||
|
||||
unset(ENGEN_BUNDLED CACHE)
|
||||
unset(EIGEN_BUNDLED CACHE)
|
||||
|
||||
if (NOT ENABLE_EIGEN AND NOT DISABLE_EIGEN)
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@ 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}>
|
||||
-DTBB_ROOT=$<$<BOOL:${TBB_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
$<$<BOOL:${ONETBB_TARGET}>:-DTBB_ROOT=${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
|
||||
@@ -59,4 +60,3 @@ endif (ENABLE_EMBREE)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+1
-1
Submodule embree/embree updated: 800794931f...f590db83ef
+23
-11
@@ -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 make -j${pcnt}
|
||||
INSTALL_COMMAND make -j1 install
|
||||
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
|
||||
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 install
|
||||
DEPENDS ${ZLIB_TARGET}
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
@@ -74,21 +74,35 @@ if (NOT WIN32)
|
||||
|
||||
git_submodule_init(bison configure)
|
||||
|
||||
set(BISON_DEPENDS PATCH)
|
||||
set(BISON_DEPENDS)
|
||||
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}
|
||||
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
|
||||
# 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
|
||||
DEPENDS ${ZLIB_TARGET}
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
@@ -109,5 +123,3 @@ endif (NOT WIN32)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
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)
|
||||
@@ -18,6 +18,9 @@ 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>
|
||||
|
||||
+1
-1
Submodule gdal/gdal updated: 2ca3becf70...ecf8a961b2
+61
-311
@@ -1,329 +1,79 @@
|
||||
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/apps/gdalalg_raster_tile.cpp GDAL_BLD/apps/gdalalg_raster_tile.cpp
|
||||
--- gdal/apps/gdalalg_raster_tile.cpp 2026-02-04 16:36:48.022371225 -0500
|
||||
+++ GDAL_BLD/apps/gdalalg_raster_tile.cpp 2026-02-04 16:36:21.803485814 -0500
|
||||
@@ -326,37 +326,6 @@
|
||||
.SetMaxValueIncluded(100)
|
||||
.SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
|
||||
- constexpr const char *ADVANCED_RESAMPLING_CATEGORY = "Advanced Resampling";
|
||||
- auto &excludedValuesArg =
|
||||
- AddArg("excluded-values", 0,
|
||||
- _("Tuples of values (e.g. <R>,<G>,<B> or (<R1>,<G1>,<B1>),"
|
||||
- "(<R2>,<G2>,<B2>)) that must beignored as contributing source "
|
||||
- "pixels during (average) resampling"),
|
||||
- &m_excludedValues)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
- auto &excludedValuesPctThresholdArg =
|
||||
- AddArg(
|
||||
- "excluded-values-pct-threshold", 0,
|
||||
- _("Minimum percentage of source pixels that must be set at one of "
|
||||
- "the --excluded-values to cause the excluded value to be used as "
|
||||
- "the target pixel value"),
|
||||
- &m_excludedValuesPctThreshold)
|
||||
- .SetDefault(m_excludedValuesPctThreshold)
|
||||
- .SetMinValueIncluded(0)
|
||||
- .SetMaxValueIncluded(100)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
- auto &nodataValuesPctThresholdArg =
|
||||
- AddArg(
|
||||
- "nodata-values-pct-threshold", 0,
|
||||
- _("Minimum percentage of source pixels that must be set at one of "
|
||||
- "nodata (or alpha=0 or any other way to express transparent pixel"
|
||||
- "to cause the target pixel value to be transparent"),
|
||||
- &m_nodataValuesPctThreshold)
|
||||
- .SetDefault(m_nodataValuesPctThreshold)
|
||||
- .SetMinValueIncluded(0)
|
||||
- .SetMaxValueIncluded(100)
|
||||
- .SetCategory(ADVANCED_RESAMPLING_CATEGORY);
|
||||
-
|
||||
constexpr const char *PUBLICATION_CATEGORY = "Publication";
|
||||
AddArg("webviewer", 0, _("Web viewer to generate"), &m_webviewers)
|
||||
.SetDefault("all")
|
||||
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
|
||||
--- gdal/cmake/modules/packages/FindSQLite3.cmake 2026-02-04 16:36:47.818372116 -0500
|
||||
+++ GDAL_BLD/cmake/modules/packages/FindSQLite3.cmake 2026-02-04 16:28:57.601427168 -0500
|
||||
@@ -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()
|
||||
diff -Naur gdal/gcore/gdal_multidomainmetadata.h GDAL_BLD/gcore/gdal_multidomainmetadata.h
|
||||
--- gdal/gcore/gdal_multidomainmetadata.h 2026-02-05 09:46:40.132404369 -0500
|
||||
+++ GDAL_BLD/gcore/gdal_multidomainmetadata.h 2026-02-05 09:48:20.477951010 -0500
|
||||
@@ -18,6 +18,15 @@
|
||||
#include "cpl_port.h"
|
||||
#include "cpl_string.h"
|
||||
|
||||
# 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 */
|
||||
/************************************************************************/
|
||||
|
||||
+#ifndef STRCASECMP
|
||||
+#if defined(_WIN32)
|
||||
+#define STRCASECMP(a, b) (_stricmp(a, b))
|
||||
+#else
|
||||
+/** Alias for strcasecmp() */
|
||||
+#define STRCASECMP(a, b) (strcasecmp(a, b))
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
//! @cond Doxygen_Suppress
|
||||
class CPL_DLL GDALMultiDomainMetadata
|
||||
{
|
||||
#include <map>
|
||||
|
||||
/*! @cond Doxygen_Suppress */
|
||||
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 @@
|
||||
--- gdal/gdal.cmake 2026-02-04 16:36:47.825372086 -0500
|
||||
+++ GDAL_BLD/gdal.cmake 2026-02-04 16:28:57.602427164 -0500
|
||||
@@ -238,12 +238,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")
|
||||
|
||||
@@ -337,9 +87,9 @@ diff -Naur gdal/gdal.cmake GDAL_BLD/gdal.cmake
|
||||
set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES SUFFIX "-${GDAL_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif ()
|
||||
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 @@
|
||||
--- gdal/port/cpl_port.h 2026-02-04 16:36:47.823372095 -0500
|
||||
+++ GDAL_BLD/port/cpl_port.h 2026-02-04 16:28:57.603427159 -0500
|
||||
@@ -1019,7 +1019,7 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
diff -Naur gdal/frmts/png/pngdataset.cpp GDAL_BLD/frmts/png/pngdataset.cpp
|
||||
--- gdal/frmts/png/pngdataset.cpp 2026-05-29 11:02:04.453453107 -0400
|
||||
+++ GDAL_BLD/frmts/png/pngdataset.cpp 2026-05-29 11:02:51.019304367 -0400
|
||||
@@ -42,7 +42,9 @@
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
-#include <csetjmp>
|
||||
+extern "C" {
|
||||
+#include <setjmp.h>
|
||||
+}
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
diff -Naur gdal/frmts/png/pngdataset.h GDAL_BLD/frmts/png/pngdataset.h
|
||||
--- gdal/frmts/png/pngdataset.h 2026-05-29 11:02:04.454453104 -0400
|
||||
+++ GDAL_BLD/frmts/png/pngdataset.h 2026-05-29 11:02:42.415331850 -0400
|
||||
@@ -40,7 +40,9 @@
|
||||
|
||||
#include "png.h"
|
||||
|
||||
-#include <csetjmp>
|
||||
+extern "C" {
|
||||
+#include <setjmp.h>
|
||||
+}
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@@ -1,60 +0,0 @@
|
||||
# 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
|
||||
|
||||
Submodule geogram/geogram deleted from 888172e37e
@@ -1,41 +0,0 @@
|
||||
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)
|
||||
@@ -1,217 +0,0 @@
|
||||
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()
|
||||
+2
-3
@@ -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 make -j${pcnt}
|
||||
INSTALL_COMMAND make -j1 install
|
||||
BUILD_COMMAND ${BEXT_MAKE_COMMAND} -j${pcnt}
|
||||
INSTALL_COMMAND ${BEXT_MAKE_COMMAND} -j1 install
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
@@ -43,4 +43,3 @@ endif (NOT WIN32 AND NOT APPLE)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+86
-11
@@ -15,37 +15,113 @@ 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 ()
|
||||
|
||||
# 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.
|
||||
# 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.
|
||||
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}>
|
||||
-DFLEX_ROOT=$<$<BOOL:${FLEX_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
-DBISON_ROOT=$<$<BOOL:${BISON_TARGET}>:${CMAKE_BUNDLE_INSTALL_PREFIX}>
|
||||
# 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}
|
||||
-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>
|
||||
$<$<BOOL:${LLVM_TARGET}>:-DLLVM_CONFIG_EXECUTABLE=${CMAKE_BUNDLE_INSTALL_PREFIX}/bin/llvm-config${CMAKE_EXECUTABLE_SUFFIX}>
|
||||
-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=$<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_CXX_COMPILER=${ISPC_CXX_COMPILER}
|
||||
-DCMAKE_C_COMPILER=${ISPC_C_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}
|
||||
@@ -70,4 +146,3 @@ endif (ENABLE_ISPC)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
+1
-1
Submodule ispc/ispc updated: d394222aef...3fc6d50cf2
+28
-148
@@ -1,142 +1,36 @@
|
||||
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()
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 042e6dd..0d3a2ca 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -312,6 +312,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/FindLLVM.cmake)
|
||||
@@ -712,6 +713,10 @@
|
||||
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)
|
||||
list(APPEND LINK_LIBRARIES "-Wl,--start-group")
|
||||
endif()
|
||||
|
||||
@@ -147,17 +41,3 @@ diff -Naur ispc/CMakeLists.txt ISPC_BLD/CMakeLists.txt
|
||||
# Link against Clang libraries
|
||||
foreach(clangLib ${CLANG_LIBRARY_LIST})
|
||||
# Preferred way to build ISPC is to link it with individual clang static
|
||||
@@ -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()
|
||||
|
||||
|
||||
+16
-3
@@ -49,7 +49,7 @@ if (ENABLE_ITCL)
|
||||
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)
|
||||
@@ -64,12 +64,21 @@ if (ENABLE_ITCL)
|
||||
|
||||
# message("TCL HEADERS2: ${TCL_PRIVATE_HDRS}")
|
||||
|
||||
|
||||
# We need to know where the ITcl sources will wind up for some of
|
||||
# this logic
|
||||
set(ITCL_SRC_CPY_TGT "${CMAKE_CURRENT_BINARY_DIR}/ITCL_BLD-prefix/src/ITCL_BLD")
|
||||
|
||||
# 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(CMAKE_VERSION VERSION_LESS "3.26.0")
|
||||
set(TCL_HDRS_PATCH_CMD ${CMAKE_COMMAND};-E;copy_directory;${CMAKE_CURRENT_SOURCE_DIR}/addfiles/tcl_hdrs;${ITCL_SRC_CPY_TGT}/tcl_hdrs)
|
||||
else()
|
||||
set(TCL_HDRS_PATCH_CMD ${CMAKE_COMMAND};-E;copy_directory_if_different;${CMAKE_CURRENT_SOURCE_DIR}/addfiles/tcl_hdrs;${ITCL_SRC_CPY_TGT}/tcl_hdrs)
|
||||
endif()
|
||||
set(TCL_PRIVATE_HDRS "${ITCL_SRC_CPY_TGT}/tcl_hdrs")
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS_OS ${TCL_PRIVATE_HDRS}/unix)
|
||||
else(NOT WIN32)
|
||||
@@ -83,11 +92,15 @@ if (ENABLE_ITCL)
|
||||
# in which we are storing the library.
|
||||
set(RPATH_SUFFIX itcl3.4)
|
||||
|
||||
|
||||
ExternalProject_Add(ITCL_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/itcl"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/itcl.patch
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITCL_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${TCL_HDRS_PATCH_CMD}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/CMakeLists.txt ${ITCL_SRC_CPY_TGT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindTCL.cmake ${ITCL_SRC_CPY_TGT}/CMake
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,554 @@
|
||||
# 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
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
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)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${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_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
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,600 @@
|
||||
/*
|
||||
* tclIntPlatDecls.h --
|
||||
*
|
||||
* This file contains the declarations for all platform dependent
|
||||
* unsupported functions that are exported by the Tcl library. These
|
||||
* interfaces are not guaranteed to remain the same between
|
||||
* versions. Use at your own risk.
|
||||
*
|
||||
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _TCLINTPLATDECLS
|
||||
#define _TCLINTPLATDECLS
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#ifdef BUILD_tcl
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#else
|
||||
# ifdef USE_TCL_STUBS
|
||||
# define TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
* in the generic/tclInt.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Exported function declarations:
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
/* 0 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 1 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 2 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 3 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 4 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 7 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 8 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
||||
/* 12 */
|
||||
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
||||
/* 13 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 15 */
|
||||
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj **attributePtrPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj *attributePtr);
|
||||
/* 17 */
|
||||
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
||||
const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr);
|
||||
/* 18 */
|
||||
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
||||
const char *pathName, const char *fileName,
|
||||
Tcl_StatBuf *statBufPtr,
|
||||
Tcl_GlobTypeData *types);
|
||||
/* 19 */
|
||||
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
||||
const void *runLoopMode);
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
/* 0 */
|
||||
EXTERN void TclWinConvertError(DWORD errCode);
|
||||
/* 1 */
|
||||
EXTERN void TclWinConvertWSAError(DWORD errCode);
|
||||
/* 2 */
|
||||
EXTERN struct servent * TclWinGetServByName(const char *nm,
|
||||
const char *proto);
|
||||
/* 3 */
|
||||
EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
char *optval, int *optlen);
|
||||
/* 4 */
|
||||
EXTERN HINSTANCE TclWinGetTclInstance(void);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN unsigned short TclWinNToHS(unsigned short ns);
|
||||
/* 7 */
|
||||
EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
const char *optval, int optlen);
|
||||
/* 8 */
|
||||
EXTERN int TclpGetPid(Tcl_Pid pid);
|
||||
/* 9 */
|
||||
EXTERN int TclWinGetPlatformId(void);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 12 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 13 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 14 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 15 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclpIsAtty(int fd);
|
||||
/* 17 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 18 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 19 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 20 */
|
||||
EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
|
||||
/* 21 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* 24 */
|
||||
EXTERN char * TclWinNoBackslash(char *path);
|
||||
/* Slot 25 is reserved */
|
||||
/* 26 */
|
||||
EXTERN void TclWinSetInterfaces(int wide);
|
||||
/* 27 */
|
||||
EXTERN void TclWinFlushDirtyChannels(void);
|
||||
/* 28 */
|
||||
EXTERN void TclWinResetInterfaces(void);
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
/* 0 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
/* 1 */
|
||||
EXTERN int TclpCloseFile(TclFile file);
|
||||
/* 2 */
|
||||
EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
|
||||
TclFile writeFile, TclFile errorFile,
|
||||
int numPids, Tcl_Pid *pidPtr);
|
||||
/* 3 */
|
||||
EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
|
||||
/* 4 */
|
||||
EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
|
||||
const char **argv, TclFile inputFile,
|
||||
TclFile outputFile, TclFile errorFile,
|
||||
Tcl_Pid *pidPtr);
|
||||
/* 5 */
|
||||
EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
|
||||
/* 6 */
|
||||
EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
/* 7 */
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 8 */
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
|
||||
/* 11 */
|
||||
EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
|
||||
/* 12 */
|
||||
EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
|
||||
/* 13 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
int dontCopyAtts);
|
||||
/* 15 */
|
||||
EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj **attributePtrPtr);
|
||||
/* 16 */
|
||||
EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
|
||||
int objIndex, Tcl_Obj *fileName,
|
||||
Tcl_Obj *attributePtr);
|
||||
/* 17 */
|
||||
EXTERN int TclMacOSXCopyFileAttributes(const char *src,
|
||||
const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr);
|
||||
/* 18 */
|
||||
EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
|
||||
const char *pathName, const char *fileName,
|
||||
Tcl_StatBuf *statBufPtr,
|
||||
Tcl_GlobTypeData *types);
|
||||
/* 19 */
|
||||
EXTERN void TclMacOSXNotifierAddRunLoopMode(
|
||||
const void *runLoopMode);
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
/* 22 */
|
||||
EXTERN TclFile TclpCreateTempFile_(const char *contents);
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs);
|
||||
/* 30 */
|
||||
EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
|
||||
Tcl_Obj *resultingNameObj);
|
||||
#endif /* MACOSX */
|
||||
|
||||
typedef struct TclIntPlatStubs {
|
||||
int magic;
|
||||
void *hooks;
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 1 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
||||
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
||||
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
||||
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
||||
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
||||
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
||||
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
||||
void (*reserved20)(void);
|
||||
void (*reserved21)(void);
|
||||
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
void (*reserved24)(void);
|
||||
void (*reserved25)(void);
|
||||
void (*reserved26)(void);
|
||||
void (*reserved27)(void);
|
||||
void (*reserved28)(void);
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
void (*tclWinConvertError) (DWORD errCode); /* 0 */
|
||||
void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
|
||||
struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
|
||||
int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
|
||||
HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
|
||||
unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
|
||||
int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char *optval, int optlen); /* 7 */
|
||||
int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
|
||||
int (*tclWinGetPlatformId) (void); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 12 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
|
||||
int (*tclpIsAtty) (int fd); /* 16 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
|
||||
void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 21 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
char * (*tclWinNoBackslash) (char *path); /* 24 */
|
||||
void (*reserved25)(void);
|
||||
void (*tclWinSetInterfaces) (int wide); /* 26 */
|
||||
void (*tclWinFlushDirtyChannels) (void); /* 27 */
|
||||
void (*tclWinResetInterfaces) (void); /* 28 */
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */
|
||||
int (*tclpCloseFile) (TclFile file); /* 1 */
|
||||
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
|
||||
int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
|
||||
int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */
|
||||
int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
|
||||
TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
||||
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
|
||||
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
|
||||
int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */
|
||||
int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */
|
||||
void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
|
||||
void (*reserved20)(void);
|
||||
void (*reserved21)(void);
|
||||
TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
void (*reserved24)(void);
|
||||
void (*reserved25)(void);
|
||||
void (*reserved26)(void);
|
||||
void (*reserved27)(void);
|
||||
void (*reserved28)(void);
|
||||
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
|
||||
int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
|
||||
#endif /* MACOSX */
|
||||
} TclIntPlatStubs;
|
||||
|
||||
extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_TCL_STUBS)
|
||||
|
||||
/*
|
||||
* Inline function declarations:
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
||||
#define TclUnixWaitForFile_ \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclpLocaltime_unix \
|
||||
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
||||
#define TclpGmtime_unix \
|
||||
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
#define TclMacOSXGetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
||||
#define TclMacOSXSetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
||||
#define TclMacOSXCopyFileAttributes \
|
||||
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
||||
#define TclMacOSXMatchType \
|
||||
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
||||
#define TclMacOSXNotifierAddRunLoopMode \
|
||||
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
#define TclpCreateTempFile_ \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
#define TclWinConvertError \
|
||||
(tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
|
||||
#define TclWinConvertWSAError \
|
||||
(tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
|
||||
#define TclWinGetServByName \
|
||||
(tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
|
||||
#define TclWinGetSockOpt \
|
||||
(tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
|
||||
#define TclWinGetTclInstance \
|
||||
(tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
|
||||
#define TclWinNToHS \
|
||||
(tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
|
||||
#define TclWinSetSockOpt \
|
||||
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
|
||||
#define TclpGetPid \
|
||||
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
|
||||
#define TclWinGetPlatformId \
|
||||
(tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
|
||||
#define TclpIsAtty \
|
||||
(tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
|
||||
#define TclWinAddProcess \
|
||||
(tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
#define TclWinNoBackslash \
|
||||
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
|
||||
/* Slot 25 is reserved */
|
||||
#define TclWinSetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
|
||||
#define TclWinFlushDirtyChannels \
|
||||
(tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
|
||||
#define TclWinResetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* WIN */
|
||||
#ifdef MAC_OSX_TCL /* MACOSX */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
|
||||
#define TclpCloseFile \
|
||||
(tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
|
||||
#define TclpCreateCommandChannel \
|
||||
(tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
|
||||
#define TclpCreatePipe \
|
||||
(tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
|
||||
#define TclpCreateProcess \
|
||||
(tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
|
||||
#define TclUnixWaitForFile_ \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
|
||||
#define TclpMakeFile \
|
||||
(tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
|
||||
#define TclpOpenFile \
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
#define TclpLocaltime_unix \
|
||||
(tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
|
||||
#define TclpGmtime_unix \
|
||||
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
#define TclMacOSXGetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
|
||||
#define TclMacOSXSetFileAttribute \
|
||||
(tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
|
||||
#define TclMacOSXCopyFileAttributes \
|
||||
(tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
|
||||
#define TclMacOSXMatchType \
|
||||
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
|
||||
#define TclMacOSXNotifierAddRunLoopMode \
|
||||
(tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
|
||||
/* Slot 20 is reserved */
|
||||
/* Slot 21 is reserved */
|
||||
#define TclpCreateTempFile_ \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
/* Slot 24 is reserved */
|
||||
/* Slot 25 is reserved */
|
||||
/* Slot 26 is reserved */
|
||||
/* Slot 27 is reserved */
|
||||
/* Slot 28 is reserved */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
(tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
|
||||
#endif /* MACOSX */
|
||||
|
||||
#endif /* defined(USE_TCL_STUBS) */
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
#undef TclpLocaltime_unix
|
||||
#undef TclpGmtime_unix
|
||||
#undef TclWinConvertWSAError
|
||||
#define TclWinConvertWSAError TclWinConvertError
|
||||
#undef TclpInetNtoa
|
||||
#define TclpInetNtoa inet_ntoa
|
||||
|
||||
#undef TclpCreateTempFile_
|
||||
#undef TclUnixWaitForFile_
|
||||
#ifndef MAC_OSX_TCL /* not accessible on Win32/UNIX */
|
||||
#undef TclMacOSXGetFileAttribute /* 15 */
|
||||
#undef TclMacOSXSetFileAttribute /* 16 */
|
||||
#undef TclMacOSXCopyFileAttributes /* 17 */
|
||||
#undef TclMacOSXMatchType /* 18 */
|
||||
#undef TclMacOSXNotifierAddRunLoopMode /* 19 */
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
# undef TclWinNToHS
|
||||
# undef TclWinGetServByName
|
||||
# undef TclWinGetSockOpt
|
||||
# undef TclWinSetSockOpt
|
||||
# define TclWinNToHS ntohs
|
||||
# define TclWinGetServByName getservbyname
|
||||
# define TclWinGetSockOpt getsockopt
|
||||
# define TclWinSetSockOpt setsockopt
|
||||
#else
|
||||
# undef TclpGetPid
|
||||
# define TclpGetPid(pid) ((unsigned long) (pid))
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTPLATDECLS */
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* tclPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because
|
||||
* of differences between systems. It reads in platform specific
|
||||
* portability files.
|
||||
*
|
||||
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLPORT
|
||||
#define _TCLPORT
|
||||
|
||||
#ifdef HAVE_TCL_CONFIG_H
|
||||
#include "tclConfig.h"
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
# include "tclWinPort.h"
|
||||
#else
|
||||
# include "tclUnixPort.h"
|
||||
#endif
|
||||
#include "tcl.h"
|
||||
|
||||
#if !defined(LLONG_MIN)
|
||||
# ifdef TCL_WIDE_INT_IS_LONG
|
||||
# define LLONG_MIN LONG_MIN
|
||||
# else
|
||||
# ifdef LLONG_BIT
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<(LLONG_BIT-1)))
|
||||
# else
|
||||
/* Assume we're on a system with a 64-bit 'long long' type */
|
||||
# define LLONG_MIN ((Tcl_WideInt)(Tcl_LongAsWide(1)<<63))
|
||||
# endif
|
||||
# endif
|
||||
/* Assume that if LLONG_MIN is undefined, then so is LLONG_MAX */
|
||||
# define LLONG_MAX (~LLONG_MIN)
|
||||
#endif
|
||||
|
||||
#define UWIDE_MAX ((Tcl_WideUInt)-1)
|
||||
#define WIDE_MAX ((Tcl_WideInt)(UWIDE_MAX >> 1))
|
||||
#define WIDE_MIN ((Tcl_WideInt)((Tcl_WideUInt)WIDE_MAX+1))
|
||||
|
||||
#endif /* _TCLPORT */
|
||||
@@ -0,0 +1,732 @@
|
||||
/*
|
||||
* tclUnixPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because of
|
||||
* differences between systems. It reads in UNIX-related header files and
|
||||
* sets up UNIX-related macros for Tcl's UNIX core. It should be the only
|
||||
* file that contains #ifdefs to handle different flavors of UNIX. This
|
||||
* file sets up the union of all UNIX-related things needed by any of the
|
||||
* Tcl core files. This file depends on configuration #defines such as
|
||||
* NO_DIRENT_H that are set up by the "configure" script.
|
||||
*
|
||||
* Much of the material in this file was originally contributed by Karl
|
||||
* Lehenbauer, Mark Diekhans and Peter da Silva.
|
||||
*
|
||||
* Copyright (c) 1991-1994 The Regents of the University of California.
|
||||
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLUNIXPORT
|
||||
#define _TCLUNIXPORT
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following sets of #includes and #ifdefs are required to get Tcl to
|
||||
* compile under the various flavors of unix.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_NET_ERRNO_H
|
||||
# include <net/errno.h>
|
||||
#endif
|
||||
#include <pwd.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef USE_DIRENT2_H
|
||||
# include "../compat/dirent2.h"
|
||||
#else
|
||||
#ifdef NO_DIRENT_H
|
||||
# include "../compat/dirent.h"
|
||||
#else
|
||||
# include <dirent.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Parameterize for 64-bit filesystem support.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef HAVE_STRUCT_DIRENT64
|
||||
typedef struct dirent64 Tcl_DirEntry;
|
||||
# define TclOSreaddir readdir64
|
||||
#else
|
||||
typedef struct dirent Tcl_DirEntry;
|
||||
# define TclOSreaddir readdir
|
||||
#endif
|
||||
#ifdef HAVE_DIR64
|
||||
typedef DIR64 TclDIR;
|
||||
# define TclOSopendir opendir64
|
||||
# define TclOSrewinddir rewinddir64
|
||||
# define TclOSclosedir closedir64
|
||||
#else
|
||||
typedef DIR TclDIR;
|
||||
# define TclOSopendir opendir
|
||||
# define TclOSrewinddir rewinddir
|
||||
# define TclOSclosedir closedir
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TYPE_OFF64_T
|
||||
typedef off64_t Tcl_SeekOffset;
|
||||
# define TclOSseek lseek64
|
||||
# define TclOSopen open64
|
||||
#else
|
||||
typedef off_t Tcl_SeekOffset;
|
||||
# define TclOSseek lseek
|
||||
# define TclOSopen open
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* Make some symbols available without including <windows.h> */
|
||||
# define DWORD unsigned int
|
||||
# define CP_UTF8 65001
|
||||
# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
|
||||
# define HANDLE void *
|
||||
# define HINSTANCE void *
|
||||
# define SOCKET unsigned int
|
||||
# define WSAEWOULDBLOCK 10035
|
||||
typedef unsigned short WCHAR;
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wignored-attributes"
|
||||
#endif
|
||||
__declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *);
|
||||
__declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int);
|
||||
__declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int,
|
||||
char *, int, const char *, void *);
|
||||
__declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int,
|
||||
WCHAR *, int);
|
||||
__declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *);
|
||||
__declspec(dllimport) extern __stdcall int IsDebuggerPresent(void);
|
||||
__declspec(dllimport) extern __stdcall int GetLastError(void);
|
||||
__declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *);
|
||||
__declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int);
|
||||
__declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int);
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
# define timezone _timezone
|
||||
extern int TclOSstat(const char *name, void *statBuf);
|
||||
extern int TclOSlstat(const char *name, void *statBuf);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
|
||||
# define TclOSstat(name, buf) stat64(name, (struct stat64 *)buf)
|
||||
# define TclOSlstat(name,buf) lstat64(name, (struct stat64 *)buf)
|
||||
#else
|
||||
# define TclOSstat(name, buf) stat(name, (struct stat *)buf)
|
||||
# define TclOSlstat(name, buf) lstat(name, (struct stat *)buf)
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Miscellaneous includes that might be missing.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <sys/file.h>
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifndef NO_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#else
|
||||
# include "../compat/unistd.h"
|
||||
#endif
|
||||
|
||||
extern int TclUnixSetBlockingMode(int fd, int mode);
|
||||
|
||||
#include <utime.h>
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Socket support stuff: This likely needs more work to parameterize for each
|
||||
* system.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <sys/socket.h> /* struct sockaddr, SOCK_STREAM, ... */
|
||||
#ifndef NO_UNAME
|
||||
# include <sys/utsname.h> /* uname system call. */
|
||||
#endif
|
||||
#include <netinet/in.h> /* struct in_addr, struct sockaddr_in */
|
||||
#include <arpa/inet.h> /* inet_ntoa() */
|
||||
#include <netdb.h> /* getaddrinfo() */
|
||||
#ifdef NEED_FAKE_RFC2553
|
||||
# include "../compat/fake-rfc2553.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Some platforms (e.g. SunOS) don't define FLT_MAX and FLT_MIN, so we look
|
||||
* for an alternative definition. If no other alternative is available we use
|
||||
* a reasonable guess.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NO_FLOAT_H
|
||||
# include <float.h>
|
||||
#else
|
||||
#ifndef NO_VALUES_H
|
||||
# include <values.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FLT_MAX
|
||||
# ifdef MAXFLOAT
|
||||
# define FLT_MAX MAXFLOAT
|
||||
# else
|
||||
# define FLT_MAX 3.402823466E+38F
|
||||
# endif
|
||||
#endif
|
||||
#ifndef FLT_MIN
|
||||
# ifdef MINFLOAT
|
||||
# define FLT_MIN MINFLOAT
|
||||
# else
|
||||
# define FLT_MIN 1.175494351E-38F
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* NeXT doesn't define O_NONBLOCK, so #define it here if necessary.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef O_NONBLOCK
|
||||
# define O_NONBLOCK 0x80
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The type of the status returned by wait varies from UNIX system to UNIX
|
||||
* system. The macro below defines it:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef _AIX
|
||||
# define WAIT_STATUS_TYPE pid_t
|
||||
#else
|
||||
#ifndef NO_UNION_WAIT
|
||||
# define WAIT_STATUS_TYPE union wait
|
||||
#else
|
||||
# define WAIT_STATUS_TYPE int
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Supply definitions for macros to query wait status, if not already defined
|
||||
* in header files above.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xFF) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSIGNALED
|
||||
# define WIFSIGNALED(stat) \
|
||||
(((*((int *) &(stat)))) && ((*((int *) &(stat))) \
|
||||
== ((*((int *) &(stat))) & 0x00FF)))
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSTOPPED
|
||||
# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xFF) == 0177)
|
||||
#endif
|
||||
|
||||
#ifndef WSTOPSIG
|
||||
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define constants for waitpid() system call if they aren't defined by a
|
||||
* system header file.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef WNOHANG
|
||||
# define WNOHANG 1
|
||||
#endif
|
||||
#ifndef WUNTRACED
|
||||
# define WUNTRACED 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Supply macros for seek offsets, if they're not already provided by an
|
||||
* include file.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0
|
||||
#endif
|
||||
#ifndef SEEK_CUR
|
||||
# define SEEK_CUR 1
|
||||
#endif
|
||||
#ifndef SEEK_END
|
||||
# define SEEK_END 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The stuff below is needed by the "time" command. If this system has no
|
||||
* gettimeofday call, then must use times() instead.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef NO_GETTOD
|
||||
# include <sys/times.h>
|
||||
#else
|
||||
# ifdef HAVE_BSDGETTIMEOFDAY
|
||||
# define gettimeofday BSDgettimeofday
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef GETTOD_NOT_DECLARED
|
||||
extern int gettimeofday(struct timeval *tp,
|
||||
struct timezone *tzp);
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define access mode constants if they aren't already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef F_OK
|
||||
# define F_OK 00
|
||||
#endif
|
||||
#ifndef X_OK
|
||||
# define X_OK 01
|
||||
#endif
|
||||
#ifndef W_OK
|
||||
# define W_OK 02
|
||||
#endif
|
||||
#ifndef R_OK
|
||||
# define R_OK 04
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define FD_CLOEEXEC (the close-on-exec flag bit) if it isn't already
|
||||
* defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef FD_CLOEXEC
|
||||
# define FD_CLOEXEC 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* On systems without symbolic links (i.e. S_IFLNK isn't defined) define
|
||||
* "lstat" to use "stat" instead.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef S_IFLNK
|
||||
# undef TclOSlstat
|
||||
# define lstat stat
|
||||
# define lstat64 stat64
|
||||
# define TclOSlstat TclOSstat
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define macros to query file type bits, if they're not already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef S_ISREG
|
||||
# ifdef S_IFREG
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# else
|
||||
# define S_ISREG(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISREG */
|
||||
#ifndef S_ISDIR
|
||||
# ifdef S_IFDIR
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISDIR */
|
||||
#ifndef S_ISCHR
|
||||
# ifdef S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISCHR */
|
||||
|
||||
#ifndef S_ISBLK
|
||||
# ifdef S_IFBLK
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# else
|
||||
# define S_ISBLK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISBLK */
|
||||
|
||||
#ifndef S_ISFIFO
|
||||
# ifdef S_IFIFO
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# else
|
||||
# define S_ISFIFO(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISFIFO */
|
||||
|
||||
#ifndef S_ISLNK
|
||||
# ifdef S_IFLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# else
|
||||
# define S_ISLNK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISLNK */
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
# ifdef S_IFSOCK
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
# else
|
||||
# define S_ISSOCK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISSOCK */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Make sure that MAXPATHLEN and MAXNAMLEN are defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# else
|
||||
# define MAXPATHLEN 2048
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MAXNAMLEN
|
||||
# ifdef NAME_MAX
|
||||
# define MAXNAMLEN NAME_MAX
|
||||
# else
|
||||
# define MAXNAMLEN 255
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macro defines the type of the mask arguments to select:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NO_FD_SET
|
||||
# define SELECT_MASK fd_set
|
||||
#else /* NO_FD_SET */
|
||||
# ifndef _AIX
|
||||
typedef long fd_mask;
|
||||
# endif /* !AIX */
|
||||
# if defined(_IBMR2)
|
||||
# define SELECT_MASK void
|
||||
# else /* !defined(_IBMR2) */
|
||||
# define SELECT_MASK int
|
||||
# endif /* defined(_IBMR2) */
|
||||
#endif /* !NO_FD_SET */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Define "NBBY" (number of bits per byte) if it's not already defined.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NBBY
|
||||
# define NBBY 8
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macro defines the number of fd_masks in an fd_set:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
# ifdef OPEN_MAX
|
||||
# define FD_SETSIZE OPEN_MAX
|
||||
# else
|
||||
# define FD_SETSIZE 256
|
||||
# endif
|
||||
#endif /* FD_SETSIZE */
|
||||
|
||||
#ifndef howmany
|
||||
# define howmany(x, y) (((x)+((y)-1))/(y))
|
||||
#endif /* !defined(howmany) */
|
||||
|
||||
#ifndef NFDBITS
|
||||
# define NFDBITS NBBY*sizeof(fd_mask)
|
||||
#endif /* NFDBITS */
|
||||
|
||||
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Not all systems declare the errno variable in errno.h, so this file does it
|
||||
* explicitly. The list of system error messages also isn't generally declared
|
||||
* in a header file anywhere.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef NO_ERRNO
|
||||
extern int errno;
|
||||
#endif /* NO_ERRNO */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Not all systems declare all the errors that Tcl uses! Provide some
|
||||
* work-arounds...
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
# ifdef EFBIG
|
||||
# define EOVERFLOW EFBIG
|
||||
# else /* !EFBIG */
|
||||
# define EOVERFLOW EINVAL
|
||||
# endif /* EFBIG */
|
||||
#endif /* EOVERFLOW */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Variables provided by the C library:
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__) && defined(__DYNAMIC__)
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
# define USE_PUTENV 1
|
||||
#else
|
||||
# if defined(_sgi) || defined(__sgi)
|
||||
# define environ _environ
|
||||
# endif
|
||||
extern char ** environ;
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Darwin specifc configure overrides.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for fat compiles: configure runs only once for multiple architectures
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# if defined(__LP64__) && defined (NO_COREFOUNDATION_64)
|
||||
# undef HAVE_COREFOUNDATION
|
||||
# endif /* __LP64__ && NO_COREFOUNDATION_64 */
|
||||
# include <sys/cdefs.h>
|
||||
# ifdef __DARWIN_UNIX03
|
||||
# if __DARWIN_UNIX03
|
||||
# undef HAVE_PUTENV_THAT_COPIES
|
||||
# else
|
||||
# define HAVE_PUTENV_THAT_COPIES 1
|
||||
# endif
|
||||
# endif /* __DARWIN_UNIX03 */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Include AvailabilityMacros.h here (when available) to ensure any symbolic
|
||||
* MAC_OS_X_VERSION_* constants passed on the command line are translated.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef HAVE_AVAILABILITYMACROS_H
|
||||
# include <AvailabilityMacros.h>
|
||||
# endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for weak import.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef HAVE_WEAK_IMPORT
|
||||
# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
|
||||
# undef HAVE_WEAK_IMPORT
|
||||
# else
|
||||
# ifndef WEAK_IMPORT_ATTRIBUTE
|
||||
# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
||||
# endif
|
||||
# endif
|
||||
# endif /* HAVE_WEAK_IMPORT */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
|
||||
* only use API available in the indicated OS version or earlier.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
# ifdef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 && defined(__LP64__)
|
||||
# undef HAVE_COREFOUNDATION
|
||||
# endif
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
|
||||
# undef HAVE_OSSPINLOCKLOCK
|
||||
# undef HAVE_PTHREAD_ATFORK
|
||||
# undef HAVE_COPYFILE
|
||||
# endif
|
||||
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
|
||||
# ifdef TCL_THREADS
|
||||
/* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
|
||||
# define NO_REALPATH 1
|
||||
# endif
|
||||
# undef HAVE_LANGINFO
|
||||
# endif
|
||||
# endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
||||
# if defined(HAVE_COREFOUNDATION) && defined(__LP64__) && \
|
||||
defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||
# warning "Weak import of 64-bit CoreFoundation is not supported, will not run on Mac OS X < 10.5."
|
||||
# endif
|
||||
/*
|
||||
* For now, test exec-17.1 fails (I/O setup after closing stdout) with
|
||||
* posix_spawnp(), but the classic implementation (based on fork()+execvp())
|
||||
* works well under macOS.
|
||||
*/
|
||||
# undef HAVE_POSIX_SPAWNP
|
||||
# undef HAVE_VFORK
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declarations represent the interface between
|
||||
* generic and unix-specific parts of Tcl. Some of the macros may override
|
||||
* functions declared in tclInt.h.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The default platform eol translation on Unix is TCL_TRANSLATE_LF.
|
||||
*/
|
||||
|
||||
#ifdef DJGPP
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
|
||||
typedef int socklen_t;
|
||||
#else
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_LF
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros have trivial definitions, allowing generic code to
|
||||
* address platform-specific issues.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpReleaseFile(file) /* Nothing. */
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following defines wrap the system memory allocation routines.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpSysAlloc(size, isBin) malloc((size_t)(size))
|
||||
#define TclpSysFree(ptr) free((char *)(ptr))
|
||||
#define TclpSysRealloc(ptr, size) realloc((char *)(ptr), (size_t)(size))
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declaration wrap the C runtime library functions.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define TclpExit exit
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
# include <pthread.h>
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
/* FIXME - Hyper-enormous platform assumption! */
|
||||
#ifndef AF_INET6
|
||||
# define AF_INET6 10
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* Set of MT-safe implementations of some known-to-be-MT-unsafe library calls.
|
||||
* Instead of returning pointers to the static storage, those return pointers
|
||||
* to the TSD data.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
extern struct passwd * TclpGetPwNam(const char *name);
|
||||
extern struct group * TclpGetGrNam(const char *name);
|
||||
extern struct passwd * TclpGetPwUid(uid_t uid);
|
||||
extern struct group * TclpGetGrGid(gid_t gid);
|
||||
extern struct hostent * TclpGetHostByName(const char *name);
|
||||
extern struct hostent * TclpGetHostByAddr(const char *addr,
|
||||
int length, int type);
|
||||
extern void *TclpMakeTcpClientChannelMode(
|
||||
void *tcpSocket, int mode);
|
||||
|
||||
#endif /* _TCLUNIXPORT */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,582 @@
|
||||
/*
|
||||
* tclWinPort.h --
|
||||
*
|
||||
* This header file handles porting issues that occur because of
|
||||
* differences between Windows and Unix. It should be the only
|
||||
* file that contains #ifdefs to handle different flavors of OS.
|
||||
*
|
||||
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _TCLWINPORT
|
||||
#define _TCLWINPORT
|
||||
|
||||
#if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT)
|
||||
/* See [Bug 3354324]: file mtime sets wrong time */
|
||||
# define __MINGW_USE_VC2005_COMPAT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We must specify the lower version we intend to support.
|
||||
*
|
||||
* WINVER = 0x0501 means Windows XP and above
|
||||
*/
|
||||
|
||||
#ifndef WINVER
|
||||
# define WINVER 0x0501
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
/* Compatibility to older visual studio / windows platform SDK */
|
||||
#if !defined(MAXULONG_PTR)
|
||||
typedef DWORD DWORD_PTR;
|
||||
typedef DWORD_PTR * PDWORD_PTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ask for the winsock function typedefs, also.
|
||||
*/
|
||||
#ifndef INCL_WINSOCK_API_TYPEDEFS
|
||||
# define INCL_WINSOCK_API_TYPEDEFS 1
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#ifdef HAVE_WSPIAPI_H
|
||||
# include <wspiapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef CHECK_UNICODE_CALLS
|
||||
# define _UNICODE
|
||||
# define UNICODE
|
||||
# define __TCHAR_DEFINED
|
||||
typedef float *_TCHAR;
|
||||
# define _TCHAR_DEFINED
|
||||
typedef float *TCHAR;
|
||||
#endif /* CHECK_UNICODE_CALLS */
|
||||
|
||||
/*
|
||||
* Pull in the typedef of TCHAR for windows.
|
||||
*/
|
||||
#include <tchar.h>
|
||||
#ifndef _TCHAR_DEFINED
|
||||
/* Borland seems to forget to set this. */
|
||||
typedef _TCHAR TCHAR;
|
||||
# define _TCHAR_DEFINED
|
||||
#endif
|
||||
#if defined(_MSC_VER) && defined(__STDC__)
|
||||
/* VS2005 SP1 misses this. See [Bug #3110161] */
|
||||
typedef _TCHAR TCHAR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following sets of #includes and #ifdefs are required to get Tcl to
|
||||
* compile under the windows compilers.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include <io.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <float.h>
|
||||
#include <malloc.h>
|
||||
#include <process.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
# define strncasecmp _strnicmp
|
||||
# define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Need to block out these includes for building extensions with MetroWerks
|
||||
* compiler for Win32.
|
||||
*/
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include <sys/stat.h>
|
||||
#include <sys/timeb.h>
|
||||
# ifdef __BORLANDC__
|
||||
# include <utime.h>
|
||||
# else
|
||||
# include <sys/utime.h>
|
||||
# endif /* __BORLANDC__ */
|
||||
#endif /* __MWERKS__ */
|
||||
|
||||
/*
|
||||
* The following defines redefine the Windows Socket errors as
|
||||
* BSD errors so Tcl_PosixError can do the right thing.
|
||||
*/
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
# define ENOTEMPTY 41 /* Directory not empty */
|
||||
#endif
|
||||
#ifndef EREMOTE
|
||||
# define EREMOTE 66 /* The object is remote */
|
||||
#endif
|
||||
#ifndef EPFNOSUPPORT
|
||||
# define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#endif
|
||||
#ifndef EADDRINUSE
|
||||
# define EADDRINUSE 100 /* Address already in use */
|
||||
#endif
|
||||
#ifndef EADDRNOTAVAIL
|
||||
# define EADDRNOTAVAIL 101 /* Can't assign requested address */
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
# define EAFNOSUPPORT 102 /* Address family not supported */
|
||||
#endif
|
||||
#ifndef EALREADY
|
||||
# define EALREADY 103 /* Operation already in progress */
|
||||
#endif
|
||||
#ifndef EBADMSG
|
||||
# define EBADMSG 104 /* Not a data message */
|
||||
#endif
|
||||
#ifndef ECANCELED
|
||||
# define ECANCELED 105 /* Canceled */
|
||||
#endif
|
||||
#ifndef ECONNABORTED
|
||||
# define ECONNABORTED 106 /* Software caused connection abort */
|
||||
#endif
|
||||
#ifndef ECONNREFUSED
|
||||
# define ECONNREFUSED 107 /* Connection refused */
|
||||
#endif
|
||||
#ifndef ECONNRESET
|
||||
# define ECONNRESET 108 /* Connection reset by peer */
|
||||
#endif
|
||||
#ifndef EDESTADDRREQ
|
||||
# define EDESTADDRREQ 109 /* Destination address required */
|
||||
#endif
|
||||
#ifndef EHOSTUNREACH
|
||||
# define EHOSTUNREACH 110 /* No route to host */
|
||||
#endif
|
||||
#ifndef EIDRM
|
||||
# define EIDRM 111 /* Identifier removed */
|
||||
#endif
|
||||
#ifndef EINPROGRESS
|
||||
# define EINPROGRESS 112 /* Operation now in progress */
|
||||
#endif
|
||||
#ifndef EISCONN
|
||||
# define EISCONN 113 /* Socket is already connected */
|
||||
#endif
|
||||
#ifndef ELOOP
|
||||
# define ELOOP 114 /* Symbolic link loop */
|
||||
#endif
|
||||
#ifndef EMSGSIZE
|
||||
# define EMSGSIZE 115 /* Message too long */
|
||||
#endif
|
||||
#ifndef ENETDOWN
|
||||
# define ENETDOWN 116 /* Network is down */
|
||||
#endif
|
||||
#ifndef ENETRESET
|
||||
# define ENETRESET 117 /* Network dropped connection on reset */
|
||||
#endif
|
||||
#ifndef ENETUNREACH
|
||||
# define ENETUNREACH 118 /* Network is unreachable */
|
||||
#endif
|
||||
#ifndef ENOBUFS
|
||||
# define ENOBUFS 119 /* No buffer space available */
|
||||
#endif
|
||||
#ifndef ENODATA
|
||||
# define ENODATA 120 /* No data available */
|
||||
#endif
|
||||
#ifndef ENOLINK
|
||||
# define ENOLINK 121 /* Link has be severed */
|
||||
#endif
|
||||
#ifndef ENOMSG
|
||||
# define ENOMSG 122 /* No message of desired type */
|
||||
#endif
|
||||
#ifndef ENOPROTOOPT
|
||||
# define ENOPROTOOPT 123 /* Protocol not available */
|
||||
#endif
|
||||
#ifndef ENOSR
|
||||
# define ENOSR 124 /* Out of stream resources */
|
||||
#endif
|
||||
#ifndef ENOSTR
|
||||
# define ENOSTR 125 /* Not a stream device */
|
||||
#endif
|
||||
#ifndef ENOTCONN
|
||||
# define ENOTCONN 126 /* Socket is not connected */
|
||||
#endif
|
||||
#ifndef ENOTRECOVERABLE
|
||||
# define ENOTRECOVERABLE 127 /* Not recoverable */
|
||||
#endif
|
||||
#ifndef ENOTSOCK
|
||||
# define ENOTSOCK 128 /* Socket operation on non-socket */
|
||||
#endif
|
||||
#ifndef ENOTSUP
|
||||
# define ENOTSUP 129 /* Operation not supported */
|
||||
#endif
|
||||
#ifndef EOPNOTSUPP
|
||||
# define EOPNOTSUPP 130 /* Operation not supported on socket */
|
||||
#endif
|
||||
#ifndef EOTHER
|
||||
# define EOTHER 131 /* Other error */
|
||||
#endif
|
||||
#ifndef EOVERFLOW
|
||||
# define EOVERFLOW 132 /* File too big */
|
||||
#endif
|
||||
#ifndef EOWNERDEAD
|
||||
# define EOWNERDEAD 133 /* Owner dead */
|
||||
#endif
|
||||
#ifndef EPROTO
|
||||
# define EPROTO 134 /* Protocol error */
|
||||
#endif
|
||||
#ifndef EPROTONOSUPPORT
|
||||
# define EPROTONOSUPPORT 135 /* Protocol not supported */
|
||||
#endif
|
||||
#ifndef EPROTOTYPE
|
||||
# define EPROTOTYPE 136 /* Protocol wrong type for socket */
|
||||
#endif
|
||||
#ifndef ETIME
|
||||
# define ETIME 137 /* Timer expired */
|
||||
#endif
|
||||
#ifndef ETIMEDOUT
|
||||
# define ETIMEDOUT 138 /* Connection timed out */
|
||||
#endif
|
||||
#ifndef ETXTBSY
|
||||
# define ETXTBSY 139 /* Text file or pseudo-device busy */
|
||||
#endif
|
||||
#ifndef EWOULDBLOCK
|
||||
# define EWOULDBLOCK 140 /* Operation would block */
|
||||
#endif
|
||||
|
||||
|
||||
/* Visual Studio doesn't have these, so just choose some high numbers */
|
||||
#ifndef ESOCKTNOSUPPORT
|
||||
# define ESOCKTNOSUPPORT 240 /* Socket type not supported */
|
||||
#endif
|
||||
#ifndef ESHUTDOWN
|
||||
# define ESHUTDOWN 241 /* Can't send after socket shutdown */
|
||||
#endif
|
||||
#ifndef ETOOMANYREFS
|
||||
# define ETOOMANYREFS 242 /* Too many references: can't splice */
|
||||
#endif
|
||||
#ifndef EHOSTDOWN
|
||||
# define EHOSTDOWN 243 /* Host is down */
|
||||
#endif
|
||||
#ifndef EUSERS
|
||||
# define EUSERS 244 /* Too many users (for UFS) */
|
||||
#endif
|
||||
#ifndef EDQUOT
|
||||
# define EDQUOT 245 /* Disc quota exceeded */
|
||||
#endif
|
||||
#ifndef ESTALE
|
||||
# define ESTALE 246 /* Stale NFS file handle */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Signals not known to the standard ANSI signal.h. These are used
|
||||
* by Tcl_WaitPid() and generic/tclPosixStr.c
|
||||
*/
|
||||
|
||||
#ifndef SIGTRAP
|
||||
# define SIGTRAP 5
|
||||
#endif
|
||||
#ifndef SIGBUS
|
||||
# define SIGBUS 10
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Supply definitions for macros to query wait status, if not already
|
||||
* defined in header files above.
|
||||
*/
|
||||
|
||||
#ifdef TCL_UNION_WAIT
|
||||
# define WAIT_STATUS_TYPE union wait
|
||||
#else
|
||||
# define WAIT_STATUS_TYPE int
|
||||
#endif /* TCL_UNION_WAIT */
|
||||
|
||||
#ifndef WIFEXITED
|
||||
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xC0000000) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(stat) (*((int *) &(stat)))
|
||||
#endif
|
||||
|
||||
#ifndef WIFSIGNALED
|
||||
# define WIFSIGNALED(stat) ((*((int *) &(stat))) & 0xC0000000)
|
||||
#endif
|
||||
|
||||
#ifndef WTERMSIG
|
||||
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7F)
|
||||
#endif
|
||||
|
||||
#ifndef WIFSTOPPED
|
||||
# define WIFSTOPPED(stat) 0
|
||||
#endif
|
||||
|
||||
#ifndef WSTOPSIG
|
||||
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xFF)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define constants for waitpid() system call if they aren't defined
|
||||
* by a system header file.
|
||||
*/
|
||||
|
||||
#ifndef WNOHANG
|
||||
# define WNOHANG 1
|
||||
#endif
|
||||
#ifndef WUNTRACED
|
||||
# define WUNTRACED 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define access mode constants if they aren't already defined.
|
||||
*/
|
||||
|
||||
#ifndef F_OK
|
||||
# define F_OK 00
|
||||
#endif
|
||||
#ifndef X_OK
|
||||
# define X_OK 01
|
||||
#endif
|
||||
#ifndef W_OK
|
||||
# define W_OK 02
|
||||
#endif
|
||||
#ifndef R_OK
|
||||
# define R_OK 04
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define macros to query file type bits, if they're not already
|
||||
* defined.
|
||||
*/
|
||||
|
||||
#ifndef S_IFLNK
|
||||
# define S_IFLNK 0120000 /* Symbolic Link */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Windows compilers do not define S_IFBLK. However, Tcl uses it in
|
||||
* GetTypeFromMode to identify blockSpecial devices based on the
|
||||
* value in the statsbuf st_mode field. We have no other way to pass this
|
||||
* from NativeStat on Windows so are forced to define it here.
|
||||
* The definition here is essentially what is seen on Linux and MingW.
|
||||
* XXX - the root problem is Tcl using Unix definitions instead of
|
||||
* abstracting the structure into a platform independent one. Sigh - perhaps
|
||||
* Tcl 9
|
||||
*/
|
||||
#ifndef S_IFBLK
|
||||
# define S_IFBLK (S_IFDIR | S_IFCHR)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
# ifdef S_IFREG
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# else
|
||||
# define S_ISREG(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISREG */
|
||||
#ifndef S_ISDIR
|
||||
# ifdef S_IFDIR
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# else
|
||||
# define S_ISDIR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISDIR */
|
||||
#ifndef S_ISCHR
|
||||
# ifdef S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# else
|
||||
# define S_ISCHR(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISCHR */
|
||||
#ifndef S_ISBLK
|
||||
# ifdef S_IFBLK
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# else
|
||||
# define S_ISBLK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISBLK */
|
||||
#ifndef S_ISFIFO
|
||||
# ifdef S_IFIFO
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# else
|
||||
# define S_ISFIFO(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISFIFO */
|
||||
#ifndef S_ISLNK
|
||||
# ifdef S_IFLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# else
|
||||
# define S_ISLNK(m) 0
|
||||
# endif
|
||||
#endif /* !S_ISLNK */
|
||||
|
||||
|
||||
/*
|
||||
* Define MAXPATHLEN in terms of MAXPATH if available
|
||||
*/
|
||||
|
||||
#ifndef MAXPATH
|
||||
# define MAXPATH MAX_PATH
|
||||
#endif /* MAXPATH */
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN MAXPATH
|
||||
#endif /* MAXPATHLEN */
|
||||
|
||||
/*
|
||||
* Define pid_t and uid_t if they're not already defined.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_PID_T)
|
||||
# define pid_t int
|
||||
#endif /* !TCL_PID_T */
|
||||
#if !defined(TCL_UID_T)
|
||||
# define uid_t int
|
||||
#endif /* !TCL_UID_T */
|
||||
|
||||
/*
|
||||
* Visual C++ has some odd names for common functions, so we need to
|
||||
* define a few macros to handle them. Also, it defines EDEADLOCK and
|
||||
* EDEADLK as the same value, which confuses Tcl_ErrnoId().
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||
# define environ _environ
|
||||
# if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
# define hypot _hypot
|
||||
# endif
|
||||
# define exception _exception
|
||||
# undef EDEADLOCK
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
# define timezone _timezone
|
||||
# endif
|
||||
#endif /* _MSC_VER || __MSVCRT__ */
|
||||
|
||||
/*
|
||||
* Borland's timezone and environ functions.
|
||||
*/
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# define timezone _timezone
|
||||
# define environ _environ
|
||||
#endif /* __BORLANDC__ */
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
# if !defined(__CHAR_SIGNED__)
|
||||
# error "You must use the -j switch to ensure char is signed."
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* MSVC 8.0 started to mark many standard C library functions depreciated
|
||||
* including the *printf family and others. Tell it to shut up.
|
||||
* (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0)
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable:4090) /* see: https://developercommunity.visualstudio.com/t/c-compiler-incorrect-propagation-of-const-qualifie/390711 */
|
||||
# pragma warning(disable:4146)
|
||||
# pragma warning(disable:4244)
|
||||
# if _MSC_VER >= 1400
|
||||
# pragma warning(disable:4267)
|
||||
# pragma warning(disable:4996)
|
||||
# endif
|
||||
#endif
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
* The following macros and declarations represent the interface between
|
||||
* generic and windows-specific parts of Tcl. Some of the macros may
|
||||
* override functions declared in tclInt.h.
|
||||
*---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* The default platform eol translation on Windows is TCL_TRANSLATE_CRLF:
|
||||
*/
|
||||
|
||||
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
|
||||
|
||||
/*
|
||||
* Declare dynamic loading extension macro.
|
||||
*/
|
||||
|
||||
#define TCL_SHLIB_EXT ".dll"
|
||||
|
||||
/*
|
||||
* The following define ensures that we use the native putenv
|
||||
* implementation to modify the environment array. This keeps
|
||||
* the C level environment in synch with the system level environment.
|
||||
*/
|
||||
|
||||
#define USE_PUTENV 1
|
||||
#define USE_PUTENV_FOR_UNSET 1
|
||||
|
||||
/*
|
||||
* Msvcrt's putenv() copies the string rather than takes ownership of it.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||
# define HAVE_PUTENV_THAT_COPIES 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Older version of Mingw are known to lack a MWMO_ALERTABLE define.
|
||||
*/
|
||||
#if !defined(MWMO_ALERTABLE)
|
||||
# define MWMO_ALERTABLE 2
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following defines wrap the system memory allocation routines for
|
||||
* use by tclAlloc.c.
|
||||
*/
|
||||
|
||||
#define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
|
||||
(DWORD)0, (DWORD)size))
|
||||
#define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
|
||||
(DWORD)0, (HGLOBAL)ptr))
|
||||
#define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
|
||||
(DWORD)0, (LPVOID)ptr, (DWORD)size))
|
||||
|
||||
/* This type is not defined in the Windows headers */
|
||||
#define socklen_t int
|
||||
|
||||
|
||||
/*
|
||||
* The following macros have trivial definitions, allowing generic code to
|
||||
* address platform-specific issues.
|
||||
*/
|
||||
|
||||
#define TclpReleaseFile(file) ckfree((char *) file)
|
||||
|
||||
/*
|
||||
* The following macros and declarations wrap the C runtime library
|
||||
* functions.
|
||||
*/
|
||||
|
||||
#define TclpExit exit
|
||||
|
||||
#ifndef INVALID_SET_FILE_POINTER
|
||||
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
|
||||
#endif /* INVALID_SET_FILE_POINTER */
|
||||
|
||||
#ifndef LABEL_SECURITY_INFORMATION
|
||||
# define LABEL_SECURITY_INFORMATION (0x00000010L)
|
||||
#endif
|
||||
|
||||
#define Tcl_DirEntry void
|
||||
#define TclDIR void
|
||||
|
||||
#endif /* _TCLWINPORT */
|
||||
-727
@@ -1,730 +1,3 @@
|
||||
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
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,10 +53,21 @@ if (ENABLE_ITK)
|
||||
# subdirectory in which we are storing the library.
|
||||
set(RPATH_SUFFIX itk3.4)
|
||||
|
||||
set(ITK_SRC_CPY_TGT "${CMAKE_CURRENT_BINARY_DIR}/ITK_BLD-prefix/src/ITK_BLD")
|
||||
|
||||
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
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/CMakeLists.txt ${ITK_SRC_CPY_TGT}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindTCL.cmake ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/FindITCL.cmake ${ITK_SRC_CPY_TGT}/CMake
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclDecls.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itcl.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclIntDecls.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/addfiles/itclInt.h ${ITK_SRC_CPY_TGT}/generic/itcl3
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=$<IF:$<BOOL:${WIN32}>,${LIB_DIR},${BIN_DIR}>
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
# C M A K E L I S T S . T X T
|
||||
# ITK
|
||||
#
|
||||
# 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.
|
||||
|
||||
# *******************************************************************
|
||||
# *** Itk CMakeLists.txt ***
|
||||
# *******************************************************************
|
||||
|
||||
# Minimum required version of CMake
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
# set CMake project name
|
||||
project(ITK)
|
||||
|
||||
# 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 REQUIRED)
|
||||
find_package(ITCL REQUIRED)
|
||||
|
||||
# version numbers
|
||||
set(ITK_VERSION_MAJOR 3)
|
||||
set(ITK_VERSION_MINOR 4)
|
||||
set(ITK_PATCH_LEVEL 2)
|
||||
set(ITK_VERSION "${ITK_VERSION_MAJOR}.${ITK_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 Itk
|
||||
add_definitions(-DBUILD_itk)
|
||||
|
||||
# We want to check /usr/local by default, so add it if it exists. (We need
|
||||
# this to find X11 headers on FreeBSD, for example...)
|
||||
if (IS_DIRECTORY /usr/local)
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /usr/local)
|
||||
if (IS_DIRECTORY /usr/local/include)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include)
|
||||
endif (IS_DIRECTORY /usr/local/include)
|
||||
endif (IS_DIRECTORY /usr/local)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# We need to enable the threading macros found in tcl.h and tclInt.h.
|
||||
# The use of the threading features is determined by the core the
|
||||
# extension is loaded into, but we need to compile with these macros
|
||||
# turned on.
|
||||
#--------------------------------------------------------------------
|
||||
add_definitions(-DTCL_THREADS=1)
|
||||
|
||||
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(dlfcn.h USE)
|
||||
Tcl_Check_Include_File(errno.h USE)
|
||||
Tcl_Check_Include_File(float.h USE)
|
||||
Tcl_Check_Include_File(inttypes.h)
|
||||
Tcl_Check_Include_File(limits.h USE)
|
||||
Tcl_Check_Include_File(memory.h)
|
||||
Tcl_Check_Include_File(net/errno.h USE)
|
||||
Tcl_Check_Include_File(stdint.h)
|
||||
Tcl_Check_Include_File(stdlib.h)
|
||||
Tcl_Check_Include_File(string.h)
|
||||
Tcl_Check_Include_File(strings.h)
|
||||
Tcl_Check_Include_File(sys/param.h USE)
|
||||
Tcl_Check_Include_File(sys/stat.h)
|
||||
Tcl_Check_Include_File(sys/types.h)
|
||||
Tcl_Check_Include_File(sys/wait.h USE)
|
||||
Tcl_Check_Include_File(unistd.h)
|
||||
Tcl_Check_Include_File(values.h USE)
|
||||
|
||||
# TODO - for now, we need X11 on both *nix and Mac platforms.
|
||||
# Eventually we'll need to re-enable support for Aqua on Mac...
|
||||
if(NOT WIN32)
|
||||
find_package(X11)
|
||||
endif()
|
||||
|
||||
set(ITK_SRCS
|
||||
generic/itkStubInit.c
|
||||
generic/itkStubLib.c
|
||||
generic/itk_archetype.c
|
||||
generic/itk_cmds.c
|
||||
generic/itk_option.c
|
||||
generic/itk_util.c
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(ITK_SRCS ${ITK_SRCS} win/dllEntryPoint.c)
|
||||
endif(WIN32)
|
||||
|
||||
set(ITK_STUB_SRCS generic/itkStubLib.c)
|
||||
|
||||
set(ITK_INCLUDE_DIRS ${ITK_SOURCE_DIR}/generic ${ITK_BINARY_DIR}/include)
|
||||
mark_as_advanced(ITK_INCLUDE_DIRS)
|
||||
|
||||
|
||||
# Like ITcl, Itk requires private Tcl headers
|
||||
# At least one Linux distro puts what we need here
|
||||
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 ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif ()
|
||||
# Itk also requires private Tk headers
|
||||
set(HDRS_CANDIDATE_DIR ${TCL_INCLUDE_PATH}8.6/tk-private)
|
||||
if (EXISTS ${HDRS_CANDIDATE_DIR})
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${HDRS_CANDIDATE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
endif ()
|
||||
|
||||
# If we don't have what we need, see if we know where to find
|
||||
# a source directory
|
||||
if (NOT TCL_PRIVATE_HDRS)
|
||||
if (NOT DEFINED TCL_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Itk3 needs to know where to find the Tcl source directory")
|
||||
endif (NOT DEFINED TCL_SOURCE_DIR)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_SOURCE_DIR}/generic)
|
||||
if(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TCL_SOURCE_DIR}/unix)
|
||||
else(NOT WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TCL_SOURCE_DIR}/win)
|
||||
endif(NOT WIN32)
|
||||
if (NOT DEFINED TK_SOURCE_DIR)
|
||||
message(FATAL_ERROR "Itk3 needs to know where to find the Tk source directory")
|
||||
endif (NOT DEFINED TK_SOURCE_DIR)
|
||||
if(WIN32)
|
||||
set(TCL_PRIVATE_HDRS ${TCL_PRIVATE_HDRS} ${TK_SOURCE_DIR}/xlib)
|
||||
endif(WIN32)
|
||||
endif (NOT TCL_PRIVATE_HDRS)
|
||||
|
||||
include_directories(
|
||||
# Itcl3 is iffy as a system install - just reference the local copy
|
||||
${CMAKE_SOURCE_DIR}/generic/itcl3
|
||||
${TCL_INCLUDE_PATH}
|
||||
${TK_INCLUDE_PATH}
|
||||
${ITCL_INCLUDE_PATH}
|
||||
${ITK_INCLUDE_DIRS}
|
||||
${X11_INCLUDE_DIR}
|
||||
${TCL_PRIVATE_HDRS}
|
||||
)
|
||||
|
||||
add_library(itk${ITK_VERSION} SHARED ${ITK_SRCS})
|
||||
target_link_libraries(itk${ITK_VERSION} ${M_LIBRARY} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${ITCL_STUB_LIBRARY})
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
|
||||
set_property(TARGET itk${ITK_VERSION} APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
|
||||
install(TARGETS itk${ITK_VERSION}
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itk${ITK_VERSION}
|
||||
LIBRARY DESTINATION ${SHARED_DIR}/itk${ITK_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
add_library(itkstub STATIC ${ITK_STUB_SRCS})
|
||||
target_link_libraries(itkstub ${ITCL_STUB_LIBRARY} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
|
||||
set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
|
||||
install(TARGETS itkstub
|
||||
RUNTIME DESTINATION ${BIN_DIR}/itk${ITK_VERSION}
|
||||
LIBRARY DESTINATION ${LIB_DIR}/itk${ITK_VERSION}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
# 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 Itk ${ITK_VERSION} [list load [file join $dir ../../${SHARED_DIR}/itk${ITK_VERSION} $<TARGET_FILE_NAME:itk${ITK_VERSION}>] Itk]
|
||||
")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION ${LIB_DIR}/itk${ITK_VERSION})
|
||||
|
||||
set(ITK_LIBRARY_FILES
|
||||
library/Archetype.itk
|
||||
library/Toplevel.itk
|
||||
library/Widget.itk
|
||||
library/itk.tcl
|
||||
library/tclIndex
|
||||
)
|
||||
install(FILES ${ITK_LIBRARY_FILES} DESTINATION lib/itk${ITK_VERSION})
|
||||
|
||||
set(ITK_HDRS
|
||||
generic/itk.h
|
||||
generic/itkDecls.h
|
||||
)
|
||||
install(FILES ${ITK_HDRS} DESTINATION ${INCLUDE_DIR})
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# 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
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
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:
|
||||
@@ -0,0 +1,554 @@
|
||||
# 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
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
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)
|
||||
|
||||
set(
|
||||
TCLTK_POSSIBLE_INCLUDE_PATHS
|
||||
"${TCL_LIBRARY_PATH_PARENT}/include"
|
||||
"${TCL_INCLUDE_PATH}"
|
||||
"${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_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
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* PACKAGE: [incr Tcl]
|
||||
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
||||
*
|
||||
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
||||
* C++ provides object-oriented extensions to C. It provides a means
|
||||
* of encapsulating related procedures together with their shared data
|
||||
* in a local namespace that is hidden from the outside world. It
|
||||
* promotes code re-use through inheritance. More than anything else,
|
||||
* it encourages better organization of Tcl applications through the
|
||||
* object-oriented paradigm, leading to code that is easier to
|
||||
* understand and maintain.
|
||||
*
|
||||
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
||||
*
|
||||
* To add [incr Tcl] facilities to a Tcl application, modify the
|
||||
* Tcl_AppInit() routine as follows:
|
||||
*
|
||||
* 1) Include this header file near the top of the file containing
|
||||
* Tcl_AppInit():
|
||||
*
|
||||
* #include "itcl.h"
|
||||
*
|
||||
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
||||
*
|
||||
* if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* 3) Link your application with libitcl.a
|
||||
*
|
||||
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
||||
* above is included in this distribution.
|
||||
*
|
||||
* ========================================================================
|
||||
* AUTHOR: Michael J. McLennan
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
#ifndef ITCL_H
|
||||
#define ITCL_H
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
#ifndef TCL_ALPHA_RELEASE
|
||||
# define TCL_ALPHA_RELEASE 0
|
||||
#endif
|
||||
#ifndef TCL_BETA_RELEASE
|
||||
# define TCL_BETA_RELEASE 1
|
||||
#endif
|
||||
#ifndef TCL_FINAL_RELEASE
|
||||
# define TCL_FINAL_RELEASE 2
|
||||
#endif
|
||||
|
||||
|
||||
#define ITCL_MAJOR_VERSION 3
|
||||
#define ITCL_MINOR_VERSION 4
|
||||
#define ITCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
#define ITCL_RELEASE_SERIAL 3
|
||||
|
||||
#define ITCL_VERSION "3.4"
|
||||
#define ITCL_PATCH_LEVEL "3.4.3"
|
||||
|
||||
/*
|
||||
* A special definition used to allow this header file to be included
|
||||
* in resource files so that they can get obtain version information from
|
||||
* this file. Resource compilers don't like all the C stuff, like typedefs
|
||||
* and procedure declarations, that occur below.
|
||||
*/
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#ifdef BUILD_itcl
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#else
|
||||
# ifdef USE_ITCL_STUBS
|
||||
# define TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Fix the Borland bug that's in the EXTERN macro from tcl.h.
|
||||
*/
|
||||
#ifndef TCL_EXTERN
|
||||
# undef DLLIMPORT
|
||||
# undef DLLEXPORT
|
||||
# ifdef __cplusplus
|
||||
# define TCL_EXTERNC extern "C"
|
||||
# else
|
||||
# define TCL_EXTERNC extern
|
||||
# endif
|
||||
# if defined(STATIC_BUILD)
|
||||
# define DLLIMPORT
|
||||
# define DLLEXPORT
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE
|
||||
# elif (defined(__WIN32__) && ( \
|
||||
defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || \
|
||||
defined(__LCC__) || defined(__WATCOMC__) || \
|
||||
(defined(__GNUC__) && defined(__declspec)) \
|
||||
)) || (defined(MAC_TCL) && FUNCTION_DECLSPEC)
|
||||
# define DLLIMPORT __declspec(dllimport)
|
||||
# define DLLEXPORT __declspec(dllexport)
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE
|
||||
# elif defined(__BORLANDC__)
|
||||
# define DLLIMPORT __import
|
||||
# define DLLEXPORT __export
|
||||
/* Pre-5.5 Borland requires the attributes be placed after the */
|
||||
/* return type instead. */
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC RTYPE TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define DLLIMPORT
|
||||
# define DLLEXPORT
|
||||
# define TCL_EXTERN(RTYPE) TCL_EXTERNC TCL_STORAGE_CLASS RTYPE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Protection levels:
|
||||
*
|
||||
* ITCL_PUBLIC - accessible from any namespace
|
||||
* ITCL_PROTECTED - accessible from namespace that imports in "protected" mode
|
||||
* ITCL_PRIVATE - accessible only within the namespace that contains it
|
||||
*/
|
||||
#define ITCL_PUBLIC 1
|
||||
#define ITCL_PROTECTED 2
|
||||
#define ITCL_PRIVATE 3
|
||||
#define ITCL_DEFAULT_PROTECT 4
|
||||
|
||||
|
||||
/*
|
||||
* Generic stack.
|
||||
*/
|
||||
typedef struct Itcl_Stack {
|
||||
ClientData *values; /* values on stack */
|
||||
int len; /* number of values on stack */
|
||||
int max; /* maximum size of stack */
|
||||
ClientData space[5]; /* initial space for stack data */
|
||||
} Itcl_Stack;
|
||||
|
||||
#define Itcl_GetStackSize(stackPtr) ((stackPtr)->len)
|
||||
|
||||
/*
|
||||
* Generic linked list.
|
||||
*/
|
||||
struct Itcl_List;
|
||||
typedef struct Itcl_ListElem {
|
||||
struct Itcl_List* owner; /* list containing this element */
|
||||
ClientData value; /* value associated with this element */
|
||||
struct Itcl_ListElem *prev; /* previous element in linked list */
|
||||
struct Itcl_ListElem *next; /* next element in linked list */
|
||||
} Itcl_ListElem;
|
||||
|
||||
typedef struct Itcl_List {
|
||||
int validate; /* validation stamp */
|
||||
int num; /* number of elements */
|
||||
struct Itcl_ListElem *head; /* previous element in linked list */
|
||||
struct Itcl_ListElem *tail; /* next element in linked list */
|
||||
} Itcl_List;
|
||||
|
||||
#define Itcl_FirstListElem(listPtr) ((listPtr)->head)
|
||||
#define Itcl_LastListElem(listPtr) ((listPtr)->tail)
|
||||
#define Itcl_NextListElem(elemPtr) ((elemPtr)->next)
|
||||
#define Itcl_PrevListElem(elemPtr) ((elemPtr)->prev)
|
||||
#define Itcl_GetListLength(listPtr) ((listPtr)->num)
|
||||
#define Itcl_GetListValue(elemPtr) ((elemPtr)->value)
|
||||
|
||||
/*
|
||||
* Token representing the state of an interpreter.
|
||||
*/
|
||||
typedef struct Itcl_InterpState_ *Itcl_InterpState;
|
||||
|
||||
|
||||
/*
|
||||
* Include the public function declarations that are accessible via
|
||||
* the stubs table.
|
||||
*/
|
||||
|
||||
#include "itclDecls.h"
|
||||
|
||||
|
||||
/*
|
||||
* Itcl_InitStubs is used by extensions like Itk that can be linked
|
||||
* against the itcl stubs library. If we are not using stubs
|
||||
* then this reduces to package require.
|
||||
*/
|
||||
|
||||
#ifdef USE_ITCL_STUBS
|
||||
|
||||
TCL_EXTERNC CONST char *
|
||||
Itcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
CONST char *version, int exact));
|
||||
#else
|
||||
#define Itcl_InitStubs(interp, version, exact) \
|
||||
Tcl_PkgRequire(interp, "Itcl", version, exact)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Public functions that are not accessible via the stubs table.
|
||||
*/
|
||||
|
||||
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* ITCL_H */
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* itclDecls.h --
|
||||
*
|
||||
* Declarations of functions in the platform independent public Itcl API.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _ITCLDECLS
|
||||
#define _ITCLDECLS
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
* in the itcl/generic/tcl.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
/*
|
||||
* Exported function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itcl_Init_TCL_DECLARED
|
||||
#define Itcl_Init_TCL_DECLARED
|
||||
/* 0 */
|
||||
TCL_EXTERN(int) Itcl_Init _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itcl_SafeInit_TCL_DECLARED
|
||||
#define Itcl_SafeInit_TCL_DECLARED
|
||||
/* 1 */
|
||||
TCL_EXTERN(int) Itcl_SafeInit _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itcl_RegisterC_TCL_DECLARED
|
||||
#define Itcl_RegisterC_TCL_DECLARED
|
||||
/* 2 */
|
||||
TCL_EXTERN(int) Itcl_RegisterC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_CmdProc * proc,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc * deleteProc));
|
||||
#endif
|
||||
#ifndef Itcl_RegisterObjC_TCL_DECLARED
|
||||
#define Itcl_RegisterObjC_TCL_DECLARED
|
||||
/* 3 */
|
||||
TCL_EXTERN(int) Itcl_RegisterObjC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_ObjCmdProc * proc,
|
||||
ClientData clientData,
|
||||
Tcl_CmdDeleteProc * deleteProc));
|
||||
#endif
|
||||
#ifndef Itcl_FindC_TCL_DECLARED
|
||||
#define Itcl_FindC_TCL_DECLARED
|
||||
/* 4 */
|
||||
TCL_EXTERN(int) Itcl_FindC _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
CONST char * name, Tcl_CmdProc ** argProcPtr,
|
||||
Tcl_ObjCmdProc ** objProcPtr,
|
||||
ClientData * cDataPtr));
|
||||
#endif
|
||||
#ifndef Itcl_InitStack_TCL_DECLARED
|
||||
#define Itcl_InitStack_TCL_DECLARED
|
||||
/* 5 */
|
||||
TCL_EXTERN(void) Itcl_InitStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteStack_TCL_DECLARED
|
||||
#define Itcl_DeleteStack_TCL_DECLARED
|
||||
/* 6 */
|
||||
TCL_EXTERN(void) Itcl_DeleteStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PushStack_TCL_DECLARED
|
||||
#define Itcl_PushStack_TCL_DECLARED
|
||||
/* 7 */
|
||||
TCL_EXTERN(void) Itcl_PushStack _ANSI_ARGS_((ClientData cdata,
|
||||
Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PopStack_TCL_DECLARED
|
||||
#define Itcl_PopStack_TCL_DECLARED
|
||||
/* 8 */
|
||||
TCL_EXTERN(ClientData) Itcl_PopStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_PeekStack_TCL_DECLARED
|
||||
#define Itcl_PeekStack_TCL_DECLARED
|
||||
/* 9 */
|
||||
TCL_EXTERN(ClientData) Itcl_PeekStack _ANSI_ARGS_((Itcl_Stack * stack));
|
||||
#endif
|
||||
#ifndef Itcl_GetStackValue_TCL_DECLARED
|
||||
#define Itcl_GetStackValue_TCL_DECLARED
|
||||
/* 10 */
|
||||
TCL_EXTERN(ClientData) Itcl_GetStackValue _ANSI_ARGS_((Itcl_Stack * stack,
|
||||
int pos));
|
||||
#endif
|
||||
#ifndef Itcl_InitList_TCL_DECLARED
|
||||
#define Itcl_InitList_TCL_DECLARED
|
||||
/* 11 */
|
||||
TCL_EXTERN(void) Itcl_InitList _ANSI_ARGS_((Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteList_TCL_DECLARED
|
||||
#define Itcl_DeleteList_TCL_DECLARED
|
||||
/* 12 */
|
||||
TCL_EXTERN(void) Itcl_DeleteList _ANSI_ARGS_((Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_CreateListElem_TCL_DECLARED
|
||||
#define Itcl_CreateListElem_TCL_DECLARED
|
||||
/* 13 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_CreateListElem _ANSI_ARGS_((
|
||||
Itcl_List * listPtr));
|
||||
#endif
|
||||
#ifndef Itcl_DeleteListElem_TCL_DECLARED
|
||||
#define Itcl_DeleteListElem_TCL_DECLARED
|
||||
/* 14 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_DeleteListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * elemPtr));
|
||||
#endif
|
||||
#ifndef Itcl_InsertList_TCL_DECLARED
|
||||
#define Itcl_InsertList_TCL_DECLARED
|
||||
/* 15 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_InsertList _ANSI_ARGS_((Itcl_List * listPtr,
|
||||
ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_InsertListElem_TCL_DECLARED
|
||||
#define Itcl_InsertListElem_TCL_DECLARED
|
||||
/* 16 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_InsertListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * pos, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_AppendList_TCL_DECLARED
|
||||
#define Itcl_AppendList_TCL_DECLARED
|
||||
/* 17 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_AppendList _ANSI_ARGS_((Itcl_List * listPtr,
|
||||
ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_AppendListElem_TCL_DECLARED
|
||||
#define Itcl_AppendListElem_TCL_DECLARED
|
||||
/* 18 */
|
||||
TCL_EXTERN(Itcl_ListElem*) Itcl_AppendListElem _ANSI_ARGS_((
|
||||
Itcl_ListElem * pos, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_SetListValue_TCL_DECLARED
|
||||
#define Itcl_SetListValue_TCL_DECLARED
|
||||
/* 19 */
|
||||
TCL_EXTERN(void) Itcl_SetListValue _ANSI_ARGS_((
|
||||
Itcl_ListElem * elemPtr, ClientData val));
|
||||
#endif
|
||||
#ifndef Itcl_EventuallyFree_TCL_DECLARED
|
||||
#define Itcl_EventuallyFree_TCL_DECLARED
|
||||
/* 20 */
|
||||
TCL_EXTERN(void) Itcl_EventuallyFree _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_FreeProc * fproc));
|
||||
#endif
|
||||
#ifndef Itcl_PreserveData_TCL_DECLARED
|
||||
#define Itcl_PreserveData_TCL_DECLARED
|
||||
/* 21 */
|
||||
TCL_EXTERN(void) Itcl_PreserveData _ANSI_ARGS_((ClientData cdata));
|
||||
#endif
|
||||
#ifndef Itcl_ReleaseData_TCL_DECLARED
|
||||
#define Itcl_ReleaseData_TCL_DECLARED
|
||||
/* 22 */
|
||||
TCL_EXTERN(void) Itcl_ReleaseData _ANSI_ARGS_((ClientData cdata));
|
||||
#endif
|
||||
#ifndef Itcl_SaveInterpState_TCL_DECLARED
|
||||
#define Itcl_SaveInterpState_TCL_DECLARED
|
||||
/* 23 */
|
||||
TCL_EXTERN(Itcl_InterpState) Itcl_SaveInterpState _ANSI_ARGS_((
|
||||
Tcl_Interp* interp, int status));
|
||||
#endif
|
||||
#ifndef Itcl_RestoreInterpState_TCL_DECLARED
|
||||
#define Itcl_RestoreInterpState_TCL_DECLARED
|
||||
/* 24 */
|
||||
TCL_EXTERN(int) Itcl_RestoreInterpState _ANSI_ARGS_((
|
||||
Tcl_Interp* interp, Itcl_InterpState state));
|
||||
#endif
|
||||
#ifndef Itcl_DiscardInterpState_TCL_DECLARED
|
||||
#define Itcl_DiscardInterpState_TCL_DECLARED
|
||||
/* 25 */
|
||||
TCL_EXTERN(void) Itcl_DiscardInterpState _ANSI_ARGS_((
|
||||
Itcl_InterpState state));
|
||||
#endif
|
||||
|
||||
typedef struct ItclStubHooks {
|
||||
struct ItclIntStubs *itclIntStubs;
|
||||
} ItclStubHooks;
|
||||
|
||||
typedef struct ItclStubs {
|
||||
int magic;
|
||||
struct ItclStubHooks *hooks;
|
||||
|
||||
int (*itcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */
|
||||
int (*itcl_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */
|
||||
int (*itcl_RegisterC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 2 */
|
||||
int (*itcl_RegisterObjC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 3 */
|
||||
int (*itcl_FindC) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_CmdProc ** argProcPtr, Tcl_ObjCmdProc ** objProcPtr, ClientData * cDataPtr)); /* 4 */
|
||||
void (*itcl_InitStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 5 */
|
||||
void (*itcl_DeleteStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 6 */
|
||||
void (*itcl_PushStack) _ANSI_ARGS_((ClientData cdata, Itcl_Stack * stack)); /* 7 */
|
||||
ClientData (*itcl_PopStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 8 */
|
||||
ClientData (*itcl_PeekStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 9 */
|
||||
ClientData (*itcl_GetStackValue) _ANSI_ARGS_((Itcl_Stack * stack, int pos)); /* 10 */
|
||||
void (*itcl_InitList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 11 */
|
||||
void (*itcl_DeleteList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 12 */
|
||||
Itcl_ListElem* (*itcl_CreateListElem) _ANSI_ARGS_((Itcl_List * listPtr)); /* 13 */
|
||||
Itcl_ListElem* (*itcl_DeleteListElem) _ANSI_ARGS_((Itcl_ListElem * elemPtr)); /* 14 */
|
||||
Itcl_ListElem* (*itcl_InsertList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 15 */
|
||||
Itcl_ListElem* (*itcl_InsertListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 16 */
|
||||
Itcl_ListElem* (*itcl_AppendList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 17 */
|
||||
Itcl_ListElem* (*itcl_AppendListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 18 */
|
||||
void (*itcl_SetListValue) _ANSI_ARGS_((Itcl_ListElem * elemPtr, ClientData val)); /* 19 */
|
||||
void (*itcl_EventuallyFree) _ANSI_ARGS_((ClientData cdata, Tcl_FreeProc * fproc)); /* 20 */
|
||||
void (*itcl_PreserveData) _ANSI_ARGS_((ClientData cdata)); /* 21 */
|
||||
void (*itcl_ReleaseData) _ANSI_ARGS_((ClientData cdata)); /* 22 */
|
||||
Itcl_InterpState (*itcl_SaveInterpState) _ANSI_ARGS_((Tcl_Interp* interp, int status)); /* 23 */
|
||||
int (*itcl_RestoreInterpState) _ANSI_ARGS_((Tcl_Interp* interp, Itcl_InterpState state)); /* 24 */
|
||||
void (*itcl_DiscardInterpState) _ANSI_ARGS_((Itcl_InterpState state)); /* 25 */
|
||||
} ItclStubs;
|
||||
|
||||
TCL_EXTERNC ItclStubs *itclStubsPtr;
|
||||
|
||||
#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS)
|
||||
|
||||
/*
|
||||
* Inline function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itcl_Init
|
||||
#define Itcl_Init \
|
||||
(itclStubsPtr->itcl_Init) /* 0 */
|
||||
#endif
|
||||
#ifndef Itcl_SafeInit
|
||||
#define Itcl_SafeInit \
|
||||
(itclStubsPtr->itcl_SafeInit) /* 1 */
|
||||
#endif
|
||||
#ifndef Itcl_RegisterC
|
||||
#define Itcl_RegisterC \
|
||||
(itclStubsPtr->itcl_RegisterC) /* 2 */
|
||||
#endif
|
||||
#ifndef Itcl_RegisterObjC
|
||||
#define Itcl_RegisterObjC \
|
||||
(itclStubsPtr->itcl_RegisterObjC) /* 3 */
|
||||
#endif
|
||||
#ifndef Itcl_FindC
|
||||
#define Itcl_FindC \
|
||||
(itclStubsPtr->itcl_FindC) /* 4 */
|
||||
#endif
|
||||
#ifndef Itcl_InitStack
|
||||
#define Itcl_InitStack \
|
||||
(itclStubsPtr->itcl_InitStack) /* 5 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteStack
|
||||
#define Itcl_DeleteStack \
|
||||
(itclStubsPtr->itcl_DeleteStack) /* 6 */
|
||||
#endif
|
||||
#ifndef Itcl_PushStack
|
||||
#define Itcl_PushStack \
|
||||
(itclStubsPtr->itcl_PushStack) /* 7 */
|
||||
#endif
|
||||
#ifndef Itcl_PopStack
|
||||
#define Itcl_PopStack \
|
||||
(itclStubsPtr->itcl_PopStack) /* 8 */
|
||||
#endif
|
||||
#ifndef Itcl_PeekStack
|
||||
#define Itcl_PeekStack \
|
||||
(itclStubsPtr->itcl_PeekStack) /* 9 */
|
||||
#endif
|
||||
#ifndef Itcl_GetStackValue
|
||||
#define Itcl_GetStackValue \
|
||||
(itclStubsPtr->itcl_GetStackValue) /* 10 */
|
||||
#endif
|
||||
#ifndef Itcl_InitList
|
||||
#define Itcl_InitList \
|
||||
(itclStubsPtr->itcl_InitList) /* 11 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteList
|
||||
#define Itcl_DeleteList \
|
||||
(itclStubsPtr->itcl_DeleteList) /* 12 */
|
||||
#endif
|
||||
#ifndef Itcl_CreateListElem
|
||||
#define Itcl_CreateListElem \
|
||||
(itclStubsPtr->itcl_CreateListElem) /* 13 */
|
||||
#endif
|
||||
#ifndef Itcl_DeleteListElem
|
||||
#define Itcl_DeleteListElem \
|
||||
(itclStubsPtr->itcl_DeleteListElem) /* 14 */
|
||||
#endif
|
||||
#ifndef Itcl_InsertList
|
||||
#define Itcl_InsertList \
|
||||
(itclStubsPtr->itcl_InsertList) /* 15 */
|
||||
#endif
|
||||
#ifndef Itcl_InsertListElem
|
||||
#define Itcl_InsertListElem \
|
||||
(itclStubsPtr->itcl_InsertListElem) /* 16 */
|
||||
#endif
|
||||
#ifndef Itcl_AppendList
|
||||
#define Itcl_AppendList \
|
||||
(itclStubsPtr->itcl_AppendList) /* 17 */
|
||||
#endif
|
||||
#ifndef Itcl_AppendListElem
|
||||
#define Itcl_AppendListElem \
|
||||
(itclStubsPtr->itcl_AppendListElem) /* 18 */
|
||||
#endif
|
||||
#ifndef Itcl_SetListValue
|
||||
#define Itcl_SetListValue \
|
||||
(itclStubsPtr->itcl_SetListValue) /* 19 */
|
||||
#endif
|
||||
#ifndef Itcl_EventuallyFree
|
||||
#define Itcl_EventuallyFree \
|
||||
(itclStubsPtr->itcl_EventuallyFree) /* 20 */
|
||||
#endif
|
||||
#ifndef Itcl_PreserveData
|
||||
#define Itcl_PreserveData \
|
||||
(itclStubsPtr->itcl_PreserveData) /* 21 */
|
||||
#endif
|
||||
#ifndef Itcl_ReleaseData
|
||||
#define Itcl_ReleaseData \
|
||||
(itclStubsPtr->itcl_ReleaseData) /* 22 */
|
||||
#endif
|
||||
#ifndef Itcl_SaveInterpState
|
||||
#define Itcl_SaveInterpState \
|
||||
(itclStubsPtr->itcl_SaveInterpState) /* 23 */
|
||||
#endif
|
||||
#ifndef Itcl_RestoreInterpState
|
||||
#define Itcl_RestoreInterpState \
|
||||
(itclStubsPtr->itcl_RestoreInterpState) /* 24 */
|
||||
#endif
|
||||
#ifndef Itcl_DiscardInterpState
|
||||
#define Itcl_DiscardInterpState \
|
||||
(itclStubsPtr->itcl_DiscardInterpState) /* 25 */
|
||||
#endif
|
||||
|
||||
#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
#endif /* _ITCLDECLS */
|
||||
|
||||
@@ -0,0 +1,468 @@
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* PACKAGE: [incr Tcl]
|
||||
* DESCRIPTION: Object-Oriented Extensions to Tcl
|
||||
*
|
||||
* [incr Tcl] provides object-oriented extensions to Tcl, much as
|
||||
* C++ provides object-oriented extensions to C. It provides a means
|
||||
* of encapsulating related procedures together with their shared data
|
||||
* in a local namespace that is hidden from the outside world. It
|
||||
* promotes code re-use through inheritance. More than anything else,
|
||||
* it encourages better organization of Tcl applications through the
|
||||
* object-oriented paradigm, leading to code that is easier to
|
||||
* understand and maintain.
|
||||
*
|
||||
* ADDING [incr Tcl] TO A Tcl-BASED APPLICATION:
|
||||
*
|
||||
* To add [incr Tcl] facilities to a Tcl application, modify the
|
||||
* Tcl_AppInit() routine as follows:
|
||||
*
|
||||
* 1) Include this header file near the top of the file containing
|
||||
* Tcl_AppInit():
|
||||
*
|
||||
* #include "itcl.h"
|
||||
*
|
||||
* 2) Within the body of Tcl_AppInit(), add the following lines:
|
||||
*
|
||||
* if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* 3) Link your application with libitcl.a
|
||||
*
|
||||
* NOTE: An example file "tclAppInit.c" containing the changes shown
|
||||
* above is included in this distribution.
|
||||
*
|
||||
* ========================================================================
|
||||
* AUTHOR: Michael J. McLennan
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
#ifndef ITCLINT_H
|
||||
#define ITCLINT_H
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "itcl.h"
|
||||
|
||||
#ifdef BUILD_itcl
|
||||
# undef TCL_STORAGE_CLASS
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle hiding of errorLine in 8.6
|
||||
*/
|
||||
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
|
||||
#define Tcl_GetErrorLine(interp) ((interp)->errorLine)
|
||||
#endif
|
||||
|
||||
#define ITCL_TCL_PRE_8_5 (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)
|
||||
|
||||
#define ItclCallFrame CallFrame
|
||||
|
||||
#if !ITCL_TCL_PRE_8_5
|
||||
|
||||
#define Itcl_CallFrame Tcl_CallFrame
|
||||
|
||||
#if defined(USE_TCL_STUBS)
|
||||
|
||||
/*
|
||||
* Fix Tcl bug #803489 the right way. We need to always use the old Stub
|
||||
* slot positions, not the new broken ones part of TIP 127. I do like
|
||||
* that these functions have moved to the public space (about time), but
|
||||
* the slot change is the killer and is the painful side affect.
|
||||
*/
|
||||
|
||||
# undef Tcl_CreateNamespace
|
||||
# define Tcl_CreateNamespace \
|
||||
(tclIntStubsPtr->tcl_CreateNamespace)
|
||||
# undef Tcl_DeleteNamespace
|
||||
# define Tcl_DeleteNamespace \
|
||||
(tclIntStubsPtr->tcl_DeleteNamespace)
|
||||
# undef Tcl_AppendExportList
|
||||
# define Tcl_AppendExportList \
|
||||
(tclIntStubsPtr->tcl_AppendExportList)
|
||||
# undef Tcl_Export
|
||||
# define Tcl_Export \
|
||||
(tclIntStubsPtr->tcl_Export)
|
||||
# undef Tcl_Import
|
||||
# define Tcl_Import \
|
||||
(tclIntStubsPtr->tcl_Import)
|
||||
# undef Tcl_ForgetImport
|
||||
# define Tcl_ForgetImport \
|
||||
(tclIntStubsPtr->tcl_ForgetImport)
|
||||
# undef Tcl_GetCurrentNamespace
|
||||
# define Tcl_GetCurrentNamespace \
|
||||
(tclIntStubsPtr->tcl_GetCurrentNamespace)
|
||||
# undef Tcl_GetGlobalNamespace
|
||||
# define Tcl_GetGlobalNamespace \
|
||||
(tclIntStubsPtr->tcl_GetGlobalNamespace)
|
||||
# undef Tcl_FindNamespace
|
||||
# define Tcl_FindNamespace \
|
||||
(tclIntStubsPtr->tcl_FindNamespace)
|
||||
# undef Tcl_FindCommand
|
||||
# define Tcl_FindCommand \
|
||||
(tclIntStubsPtr->tcl_FindCommand)
|
||||
# undef Tcl_GetCommandFromObj
|
||||
# define Tcl_GetCommandFromObj \
|
||||
(tclIntStubsPtr->tcl_GetCommandFromObj)
|
||||
# undef Tcl_GetCommandFullName
|
||||
# define Tcl_GetCommandFullName \
|
||||
(tclIntStubsPtr->tcl_GetCommandFullName)
|
||||
#endif /* use stubs */
|
||||
|
||||
#define ItclInitVarFlags(varPtr) \
|
||||
(varPtr)->flags = 0
|
||||
|
||||
#define ItclInitVarArgument(varPtr) \
|
||||
(varPtr)->flags = VAR_ARGUMENT
|
||||
|
||||
#define ItclVarHashCreateVar(tablePtr, key, newPtr) \
|
||||
TclVarHashCreateVar((tablePtr), (key), (newPtr))
|
||||
|
||||
#define ItclVarRefCount(varPtr) VarHashRefCount(varPtr)
|
||||
|
||||
#define ItclClearVarUndefined(varPtr)
|
||||
|
||||
#define ItclNextLocal(varPtr) ((varPtr)++)
|
||||
|
||||
#define ItclVarObjValue(varPtr) ((varPtr)->value.objPtr)
|
||||
|
||||
#define itclVarInHashSize sizeof(VarInHash)
|
||||
#define itclVarLocalSize sizeof(Var)
|
||||
|
||||
#else /* Compiling on Tcl8.x, x<5 */
|
||||
|
||||
typedef struct Itcl_CallFrame {
|
||||
Tcl_Namespace *nsPtr;
|
||||
int dummy1;
|
||||
int dummy2;
|
||||
void *dummy3;
|
||||
void *dummy4;
|
||||
void *dummy5;
|
||||
int dummy6;
|
||||
void *dummy7;
|
||||
void *dummy8;
|
||||
int dummy9;
|
||||
void *dummy10;
|
||||
void *dummy11;
|
||||
void *dummy12;
|
||||
void *dummy13;
|
||||
} Itcl_CallFrame;
|
||||
|
||||
/*
|
||||
* Definition of runtime behaviour to be able to run irrespective of the Tcl
|
||||
* version.
|
||||
*/
|
||||
|
||||
#define VarInHash Var
|
||||
|
||||
#define TclVarHashTable Tcl_HashTable
|
||||
|
||||
typedef struct ItclShortVar {
|
||||
int flags;
|
||||
union {
|
||||
Tcl_Obj *objPtr;
|
||||
TclVarHashTable *tablePtr;
|
||||
struct Var *linkPtr;
|
||||
} value;
|
||||
} ItclShortVar;
|
||||
|
||||
typedef struct ItclVarInHash {
|
||||
ItclShortVar var;
|
||||
int refCount;
|
||||
Tcl_HashEntry entry;
|
||||
} ItclVarInHash;
|
||||
|
||||
#define ItclOffset(type, field) ((int) ((char *) &((type *) 0)->field))
|
||||
|
||||
#define itclOldRuntime (itclVarFlagOffset!=0)
|
||||
|
||||
extern int itclVarFlagOffset;
|
||||
extern int itclVarRefCountOffset;
|
||||
extern int itclVarInHashSize;
|
||||
extern int itclVarLocalSize;
|
||||
extern int itclVarValueOffset;
|
||||
|
||||
/*
|
||||
* VarReform related macros: provide access to the Var fields with offsets
|
||||
* determined at load time, so that the same code copes with the different
|
||||
* structs in Tcl8.5 and previous Tcl.
|
||||
*/
|
||||
|
||||
#define ItclNextLocal(varPtr) \
|
||||
((varPtr) = (Var *) (((char *)(varPtr))+itclVarLocalSize))
|
||||
|
||||
#define ItclVarObjValue(varPtr) \
|
||||
(*((Tcl_Obj **) (((char *)(varPtr))+itclVarValueOffset)))
|
||||
|
||||
#define ItclVarRefCount(varPtr) \
|
||||
(*((int *) (((char *)(varPtr))+itclVarRefCountOffset)))
|
||||
|
||||
#define ItclVarFlags(varPtr) \
|
||||
(*((int *)(((char *)(varPtr))+itclVarFlagOffset)))
|
||||
|
||||
/* Note that itclVarFlagOffset==0 exactly when we are running in Tcl8.5 */
|
||||
#define ItclInitVarFlags(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
(varPtr)->flags = (VAR_SCALAR | VAR_UNDEFINED | VAR_IN_HASHTABLE);\
|
||||
} else { \
|
||||
((ItclShortVar *)(varPtr))->flags = 0;\
|
||||
}
|
||||
|
||||
/* This is used for CompiledLocal, not for Var & Co. That struct did not
|
||||
* change, but the correct flag init did! The flags bits themselves are
|
||||
* unchanged */
|
||||
|
||||
#define ItclInitVarArgument(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
(varPtr)->flags = (VAR_SCALAR | VAR_ARGUMENT);\
|
||||
} else { \
|
||||
(varPtr)->flags = VAR_ARGUMENT;\
|
||||
}
|
||||
|
||||
#define TclIsVarNamespaceVar(varPtr) \
|
||||
(ItclVarFlags(varPtr) & VAR_NAMESPACE_VAR)
|
||||
|
||||
#define TclSetVarNamespaceVar(varPtr) \
|
||||
if (!TclIsVarNamespaceVar(varPtr)) {\
|
||||
ItclVarFlags(varPtr) |= VAR_NAMESPACE_VAR;\
|
||||
ItclVarRefCount(varPtr)++;\
|
||||
}
|
||||
|
||||
#define ItclClearVarUndefined(varPtr) \
|
||||
if (itclOldRuntime) { \
|
||||
ItclVarFlags(varPtr) &= ~VAR_UNDEFINED;\
|
||||
}
|
||||
|
||||
#ifndef MODULE_SCOPE
|
||||
#define MODULE_SCOPE
|
||||
#endif
|
||||
|
||||
MODULE_SCOPE Var * ItclVarHashCreateVar (TclVarHashTable * tablePtr,
|
||||
const char * key, int * newPtr);
|
||||
|
||||
#endif /* Version dependent defs and macros */
|
||||
|
||||
|
||||
#define ItclVarHashFindVar(tablePtr, key) \
|
||||
ItclVarHashCreateVar((tablePtr), (key), NULL)
|
||||
|
||||
|
||||
/*
|
||||
* Common info for managing all known objects.
|
||||
* Each interpreter has one of these data structures stored as
|
||||
* clientData in the "itcl" namespace. It is also accessible
|
||||
* as associated data via the key ITCL_INTERP_DATA.
|
||||
*/
|
||||
struct ItclObject;
|
||||
typedef struct ItclObjectInfo {
|
||||
Tcl_Interp *interp; /* interpreter that manages this info */
|
||||
Tcl_HashTable objects; /* list of all known objects */
|
||||
|
||||
Itcl_Stack transparentFrames; /* stack of call frames that should be
|
||||
* treated transparently. When
|
||||
* Itcl_EvalMemberCode is invoked in
|
||||
* one of these contexts, it does an
|
||||
* "uplevel" to get past the transparent
|
||||
* frame and back to the calling context. */
|
||||
Tcl_HashTable contextFrames; /* object contexts for active call frames */
|
||||
|
||||
int protection; /* protection level currently in effect */
|
||||
|
||||
Itcl_Stack cdefnStack; /* stack of class definitions currently
|
||||
* being parsed */
|
||||
} ItclObjectInfo;
|
||||
|
||||
#define ITCL_INTERP_DATA "itcl_data"
|
||||
|
||||
/*
|
||||
* Representation for each [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclClass {
|
||||
char *name; /* class name */
|
||||
char *fullname; /* fully qualified class name */
|
||||
Tcl_Interp *interp; /* interpreter that manages this info */
|
||||
Tcl_Namespace *namesp; /* namespace representing class scope */
|
||||
Tcl_Command accessCmd; /* access command for creating instances */
|
||||
|
||||
struct ItclObjectInfo *info; /* info about all known objects */
|
||||
Itcl_List bases; /* list of base classes */
|
||||
Itcl_List derived; /* list of all derived classes */
|
||||
Tcl_HashTable heritage; /* table of all base classes. Look up
|
||||
* by pointer to class definition. This
|
||||
* provides fast lookup for inheritance
|
||||
* tests. */
|
||||
Tcl_Obj *initCode; /* initialization code for new objs */
|
||||
Tcl_HashTable variables; /* definitions for all data members
|
||||
in this class. Look up simple string
|
||||
names and get back ItclVarDefn* ptrs */
|
||||
Tcl_HashTable functions; /* definitions for all member functions
|
||||
in this class. Look up simple string
|
||||
names and get back ItclMemberFunc* ptrs */
|
||||
int numInstanceVars; /* number of instance vars in variables
|
||||
table */
|
||||
Tcl_HashTable resolveVars; /* all possible names for variables in
|
||||
* this class (e.g., x, foo::x, etc.) */
|
||||
Tcl_HashTable resolveCmds; /* all possible names for functions in
|
||||
* this class (e.g., x, foo::x, etc.) */
|
||||
int unique; /* unique number for #auto generation */
|
||||
int flags; /* maintains class status */
|
||||
} ItclClass;
|
||||
|
||||
typedef struct ItclHierIter {
|
||||
ItclClass *current; /* current position in hierarchy */
|
||||
Itcl_Stack stack; /* stack used for traversal */
|
||||
} ItclHierIter;
|
||||
|
||||
/*
|
||||
* Representation for each [incr Tcl] object.
|
||||
*/
|
||||
typedef struct ItclObject {
|
||||
ItclClass *classDefn; /* most-specific class */
|
||||
Tcl_Command accessCmd; /* object access command */
|
||||
|
||||
int dataSize; /* number of elements in data array */
|
||||
Var** data; /* all object-specific data members */
|
||||
Tcl_HashTable* constructed; /* temp storage used during construction */
|
||||
Tcl_HashTable* destructed; /* temp storage used during destruction */
|
||||
} ItclObject;
|
||||
|
||||
#define ITCL_IGNORE_ERRS 0x002 /* useful for construction/destruction */
|
||||
|
||||
/*
|
||||
* Implementation for any code body in an [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclMemberCode {
|
||||
int flags; /* flags describing implementation */
|
||||
CompiledLocal *arglist; /* list of arg names and initial values */
|
||||
int argcount; /* number of args in arglist */
|
||||
Proc *procPtr; /* Tcl proc representation (needed to
|
||||
* handle compiled locals) */
|
||||
union {
|
||||
Tcl_CmdProc *argCmd; /* (argc,argv) C implementation */
|
||||
Tcl_ObjCmdProc *objCmd; /* (objc,objv) C implementation */
|
||||
} cfunc;
|
||||
|
||||
ClientData clientData; /* client data for C implementations */
|
||||
|
||||
} ItclMemberCode;
|
||||
|
||||
#define Itcl_IsMemberCodeImplemented(mcode) \
|
||||
(((mcode)->flags & ITCL_IMPLEMENT_NONE) == 0)
|
||||
|
||||
/*
|
||||
* Basic representation for class members (commands/variables)
|
||||
*/
|
||||
typedef struct ItclMember {
|
||||
Tcl_Interp* interp; /* interpreter containing the class */
|
||||
ItclClass* classDefn; /* class containing this member */
|
||||
char* name; /* member name */
|
||||
char* fullname; /* member name with "class::" qualifier */
|
||||
int protection; /* protection level */
|
||||
int flags; /* flags describing member (see below) */
|
||||
ItclMemberCode *code; /* code associated with member */
|
||||
} ItclMember;
|
||||
|
||||
/*
|
||||
* Flag bits for ItclMemberCode and ItclMember:
|
||||
*/
|
||||
#define ITCL_IMPLEMENT_NONE 0x001 /* no implementation */
|
||||
#define ITCL_IMPLEMENT_TCL 0x002 /* Tcl implementation */
|
||||
#define ITCL_IMPLEMENT_ARGCMD 0x004 /* (argc,argv) C implementation */
|
||||
#define ITCL_IMPLEMENT_OBJCMD 0x008 /* (objc,objv) C implementation */
|
||||
#define ITCL_IMPLEMENT_C 0x00c /* either kind of C implementation */
|
||||
#define ITCL_CONSTRUCTOR 0x010 /* non-zero => is a constructor */
|
||||
#define ITCL_DESTRUCTOR 0x020 /* non-zero => is a destructor */
|
||||
#define ITCL_COMMON 0x040 /* non-zero => is a "proc" */
|
||||
#define ITCL_ARG_SPEC 0x080 /* non-zero => has an argument spec */
|
||||
|
||||
#define ITCL_OLD_STYLE 0x100 /* non-zero => old-style method
|
||||
* (process "config" argument) */
|
||||
|
||||
#define ITCL_THIS_VAR 0x200 /* non-zero => built-in "this" variable */
|
||||
|
||||
/*
|
||||
* Representation of member functions in an [incr Tcl] class.
|
||||
*/
|
||||
typedef struct ItclMemberFunc {
|
||||
ItclMember *member; /* basic member info */
|
||||
Tcl_Command accessCmd; /* Tcl command installed for this function */
|
||||
CompiledLocal *arglist; /* list of arg names and initial values */
|
||||
int argcount; /* number of args in arglist */
|
||||
} ItclMemberFunc;
|
||||
|
||||
/*
|
||||
* Instance variables.
|
||||
*/
|
||||
typedef struct ItclVarDefn {
|
||||
ItclMember *member; /* basic member info */
|
||||
char* init; /* initial value */
|
||||
} ItclVarDefn;
|
||||
|
||||
/*
|
||||
* Instance variable lookup entry.
|
||||
*/
|
||||
typedef struct ItclVarLookup {
|
||||
ItclVarDefn* vdefn; /* variable definition */
|
||||
int usage; /* number of uses for this record */
|
||||
int accessible; /* non-zero => accessible from class with
|
||||
* this lookup record in its resolveVars */
|
||||
char *leastQualName; /* simplist name for this variable, with
|
||||
* the fewest qualifiers. This string is
|
||||
* taken from the resolveVars table, so
|
||||
* it shouldn't be freed. */
|
||||
union {
|
||||
int index; /* index into virtual table (instance data) */
|
||||
Tcl_Var common; /* variable (common data) */
|
||||
} var;
|
||||
} ItclVarLookup;
|
||||
|
||||
/*
|
||||
* Representation for the context in which a body of [incr Tcl]
|
||||
* code executes. In ordinary Tcl, this is a CallFrame. But for
|
||||
* [incr Tcl] code bodies, we must be careful to set up the
|
||||
* CallFrame properly, to plug in instance variables before
|
||||
* executing the code body.
|
||||
*/
|
||||
typedef struct ItclContext {
|
||||
ItclClass *classDefn; /* class definition */
|
||||
Itcl_CallFrame frame; /* call frame for object context */
|
||||
Var *compiledLocals; /* points to storage for compiled locals */
|
||||
Var localStorage[20]; /* default storage for compiled locals */
|
||||
} ItclContext;
|
||||
|
||||
/*
|
||||
* Compatibility flags. Used to support small "hacks". These are stored
|
||||
* in the global variable named itclCompatFlags.
|
||||
*/
|
||||
|
||||
extern int itclCompatFlags;
|
||||
|
||||
#define ITCL_COMPAT_USE_ISTATE_API 0x2 /* Tcl 8.5a2 added interp state APIs */
|
||||
|
||||
#include "itclIntDecls.h"
|
||||
|
||||
/*
|
||||
* Since the Tcl/Tk distribution doesn't perform any asserts,
|
||||
* dynamic loading can fail to find the __assert function.
|
||||
* As a workaround, we'll include our own.
|
||||
*/
|
||||
|
||||
#undef assert
|
||||
#ifndef DEBUG
|
||||
#define assert(EX) ((void)0)
|
||||
#else
|
||||
#define assert(EX) (void)((EX) || (Itcl_Assert(STRINGIFY(EX), __FILE__, __LINE__), 0))
|
||||
#endif /* DEBUG */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* ITCLINT_H */
|
||||
File diff suppressed because it is too large
Load Diff
+48
-3330
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -1,5 +1,4 @@
|
||||
# jpeg is needed by GDAL, which is used by libgcv. TODO: Probably ought to
|
||||
# wire this into libicv as well if we're going to have it along for the ride...
|
||||
# libgcv uses GDAL, which pulls in libjpeg
|
||||
cad_enable(JPEG "libgcv;libicv")
|
||||
|
||||
bext_enable(JPEG)
|
||||
|
||||
+1
-1
Submodule jpeg/libjpeg-turbo updated: 7fa4b5b762...af9c1c2685
@@ -15,7 +15,6 @@ if (ENABLE_LEMON)
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/lemon"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lemon_cmake.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lemon_brlcad.patch
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
|
||||
+1
-1
Submodule lemon/lemon updated: 6cf51b074f...b0e459f6fe
File diff suppressed because it is too large
Load Diff
+9
-5
@@ -1,9 +1,8 @@
|
||||
# LIEF is a cross platform library which can parse, modify and abstract ELF, PE
|
||||
# and MachO binary formats. We use it to define a tool for rpath manipulation.
|
||||
|
||||
# We only need LIEF on some platforms - don't worry about trying to build it
|
||||
# everywhere
|
||||
if (NOT MSVC AND NOT APPLE)
|
||||
# Untested on Windows
|
||||
if (NOT MSVC)
|
||||
|
||||
bext_enable(LIEF)
|
||||
|
||||
@@ -16,7 +15,10 @@ if (NOT MSVC AND NOT APPLE)
|
||||
ExternalProject_Add(LIEF_BLD
|
||||
URL "${CMAKE_CURRENT_SOURCE_DIR}/LIEF"
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief.patch
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_cmake.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_elf_symbol_demangle_guard.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_fscale_macro_fix.patch
|
||||
COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/lief_gnuhash_debug_fix.patch
|
||||
CMAKE_ARGS
|
||||
${BUILD_TYPE_SPECIFIER}
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
@@ -27,9 +29,11 @@ if (NOT MSVC AND NOT APPLE)
|
||||
-DCMAKE_INSTALL_PREFIX=${CMAKE_NOBUNDLE_INSTALL_PREFIX}
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_NOBUNDLE_INSTALL_PREFIX}/${LIB_DIR}
|
||||
-DLIEF_USE_CCACHE=OFF
|
||||
-DLIEF_ART=OFF
|
||||
-DLIEF_ASAN=OFF
|
||||
-DLIEF_C_API=OFF
|
||||
-DLIEF_COFF=OFF
|
||||
-DLIEF_DEX=OFF
|
||||
-DLIEF_DOC=OFF
|
||||
-DLIEF_ENABLE_JSON=OFF
|
||||
@@ -55,7 +59,7 @@ if (NOT MSVC AND NOT APPLE)
|
||||
TargetInstallDeps(LIEF LIEF_DEPENDS)
|
||||
|
||||
endif (ENABLE_LIEF)
|
||||
endif (NOT MSVC AND NOT APPLE)
|
||||
endif (NOT MSVC)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
|
||||
+1
-1
Submodule lief/LIEF updated: c82f9c64f2...b16f99f9d2
@@ -1,20 +0,0 @@
|
||||
diff -Naur LIEF/CMakeLists.txt LIEF_BLD/CMakeLists.txt
|
||||
--- LIEF/CMakeLists.txt 2024-09-09 14:00:50.787850311 -0400
|
||||
+++ LIEF_BLD/CMakeLists.txt 2024-09-09 14:01:39.566078344 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.24)
|
||||
+cmake_minimum_required(VERSION 3.18)
|
||||
enable_language(C)
|
||||
enable_language(CXX)
|
||||
|
||||
diff -Naur LIEF/include/LIEF/Abstract/Header.hpp LIEF_BLD/include/LIEF/Abstract/Header.hpp
|
||||
--- LIEF/include/LIEF/Abstract/Header.hpp 2024-09-09 14:00:50.813849896 -0400
|
||||
+++ LIEF_BLD/include/LIEF/Abstract/Header.hpp 2024-09-09 13:41:11.933077938 -0400
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifndef LIEF_ABSTRACT_HEADER_H
|
||||
#define LIEF_ABSTRACT_HEADER_H
|
||||
|
||||
+#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
diff -Naur LIEF/CMakeLists.txt LIEF_BLD/CMakeLists.txt
|
||||
--- LIEF/CMakeLists.txt 2026-02-05 12:03:01.774599713 -0500
|
||||
+++ LIEF_BLD/CMakeLists.txt 2026-02-05 12:03:42.945448427 -0500
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmake_minimum_required(VERSION 3.24)
|
||||
+cmake_minimum_required(VERSION 3.22)
|
||||
project(LIEF LANGUAGES C CXX)
|
||||
|
||||
enable_language(C)
|
||||
@@ -0,0 +1,26 @@
|
||||
diff -Naur LIEF/src/ELF/Symbol.cpp LIEF_BLD/src/ELF/Symbol.cpp
|
||||
--- LIEF/src/ELF/Symbol.cpp 2026-07-01 09:26:59.559741917 -0400
|
||||
+++ LIEF_BLD/src/ELF/Symbol.cpp 2026-07-01 09:28:31.414010111 -0400
|
||||
@@ -90,15 +90,20 @@
|
||||
} else {
|
||||
#if defined(__unix__)
|
||||
int status;
|
||||
- const std::string& name = this->name().c_str();
|
||||
+ const std::string& name = this->name();
|
||||
+ if (name.rfind("_Z", 0) != 0) {
|
||||
+ return name;
|
||||
+ }
|
||||
+
|
||||
char* demangled_name = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status);
|
||||
|
||||
- if (status == 0) {
|
||||
+ if (status == 0 && demangled_name != nullptr) {
|
||||
std::string realname = demangled_name;
|
||||
free(demangled_name);
|
||||
return realname;
|
||||
}
|
||||
|
||||
+ free(demangled_name); // NOLINT(cppcoreguidelines-no-malloc)
|
||||
return name;
|
||||
#else
|
||||
return "";
|
||||
@@ -0,0 +1,32 @@
|
||||
diff --git a/include/LIEF/asm/x86/opcodes.hpp b/include/LIEF/asm/x86/opcodes.hpp
|
||||
index 451c036..2a4fa25 100644
|
||||
--- a/include/LIEF/asm/x86/opcodes.hpp
|
||||
+++ b/include/LIEF/asm/x86/opcodes.hpp
|
||||
@@ -17,6 +17,17 @@
|
||||
|
||||
/* Generated from LLVM: 22.1.6 */
|
||||
|
||||
+// FreeBSD's <sys/param.h> defines FSCALE as a macro. This generated opcode
|
||||
+// list also has an FSCALE enumerator, so keep the macro out of the enum body
|
||||
+// without permanently changing the includer's macro state.
|
||||
+#if defined(FSCALE)
|
||||
+ #if defined(_MSC_VER) || defined(__clang__) || defined(__GNUC__)
|
||||
+ #pragma push_macro("FSCALE")
|
||||
+ #define LIEF_ASM_X86_RESTORE_FSCALE
|
||||
+ #endif
|
||||
+ #undef FSCALE
|
||||
+#endif
|
||||
+
|
||||
namespace LIEF {
|
||||
namespace assembly {
|
||||
namespace x86 {
|
||||
@@ -22321,4 +22332,9 @@ enum class OPCODE {
|
||||
}
|
||||
}
|
||||
}
|
||||
+#if defined(LIEF_ASM_X86_RESTORE_FSCALE)
|
||||
+ #pragma pop_macro("FSCALE")
|
||||
+ #undef LIEF_ASM_X86_RESTORE_FSCALE
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
diff -Naur LIEF/src/ELF/ExeLayout.hpp LIEF_BLD/src/ELF/ExeLayout.hpp
|
||||
--- LIEF/src/ELF/ExeLayout.hpp 2026-07-01 09:31:32.857666677 -0400
|
||||
+++ LIEF_BLD/src/ELF/ExeLayout.hpp 2026-07-01 09:32:35.642528989 -0400
|
||||
@@ -380,7 +380,11 @@
|
||||
std::vector<uint32_t> hash_values(dynamic_symbols.size() - symndx, 0);
|
||||
|
||||
for (size_t i = symndx; i < dynamic_symbols.size(); ++i) {
|
||||
- LIEF_DEBUG("Dealing with symbol {}", to_string(dynamic_symbols[i]));
|
||||
+ // Avoid stringifying the symbol here: Symbol::operator<< demangles
|
||||
+ // names, and this debug argument is evaluated even when debug logging
|
||||
+ // is disabled. The GNU hash rebuild only needs the raw symbol name.
|
||||
+ // Causes a crash with QtCore-style malformed symbols.
|
||||
+ LIEF_DEBUG("Dealing with symbol {}", dynamic_symbols[i].name());
|
||||
const uint32_t hash = dl_new_hash(dynamic_symbols[i].name().c_str());
|
||||
int bucket = hash % nb_buckets;
|
||||
|
||||
+24
-3
@@ -35,6 +35,7 @@ if (ENABLE_LLVM)
|
||||
SOURCE_SUBDIR llvm
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i "${CMAKE_CURRENT_SOURCE_DIR}/llvm_no_ast_introspection.patch"
|
||||
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/Modules/FindZLIB.cmake
|
||||
${Z_BRL_PATCH_CMD}
|
||||
CMAKE_ARGS
|
||||
-C ${CMAKE_CURRENT_SOURCE_DIR}/llvm_targets.cmake
|
||||
@@ -45,12 +46,19 @@ if (ENABLE_LLVM)
|
||||
-DLLVM_BUILD_DOCS=OFF
|
||||
-DLLVM_BUILD_EXAMPLES=OFF
|
||||
-DLLVM_ENABLE_LIBEDIT=OFF
|
||||
-DLLVM_ENABLE_LIBPFM=OFF
|
||||
-DLLVM_ENABLE_PROJECTS=clang
|
||||
-DLLVM_ENABLE_RUNTIMES=
|
||||
-DLLVM_ENABLE_ZSTD=OFF
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF
|
||||
-DLLVM_PARALLEL_LINK_JOBS=1 # llvm/clang linking is memory hungry
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
-DLLVM_BUILD_LLVM_DYLIB=OFF
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
|
||||
-DLLVM_INCLUDE_TESTS=OFF
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF
|
||||
-DLLVM_INCLUDE_DOCS=OFF
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
@@ -59,8 +67,14 @@ if (ENABLE_LLVM)
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
|
||||
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
|
||||
# we don't need LLVM itself to be debuggable. Prevents .pdb and .ilk bloat.
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="$<$<CONFIG:Debug>:/DEBUG:NONE>"
|
||||
-DCMAKE_EXE_LINKER_FLAGS_DEBUG="$<$<CONFIG:Debug>:/DEBUG:NONE /INCREMENTAL:NO>"
|
||||
# NOTE: the quotes must wrap the entire -D argument, not just the value.
|
||||
# Writing -DVAR="..." leaves the double-quotes as literal characters in the
|
||||
# generated configure command; on Windows Debug builds those literal quotes
|
||||
# (plus the embedded space in the linker flags) corrupt child-process argv
|
||||
# parsing and bleed a stray quote onto the following -B path. Wrapping the
|
||||
# whole argument lets CMake consume the quotes as delimiters.
|
||||
"-DCMAKE_CXX_FLAGS_DEBUG=$<$<CONFIG:Debug>:/DEBUG:NONE>"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=$<$<CONFIG:Debug>:/DEBUG:NONE /INCREMENTAL:NO>"
|
||||
LOG_CONFIGURE ${EXT_BUILD_QUIET}
|
||||
LOG_BUILD ${EXT_BUILD_QUIET}
|
||||
LOG_INSTALL ${EXT_BUILD_QUIET}
|
||||
@@ -78,6 +92,7 @@ if (ENABLE_LLVM)
|
||||
SOURCE_SUBDIR llvm
|
||||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
|
||||
PATCH_COMMAND ${PATCH_EXECUTABLE} -E -p1 ${PATCH_OPTIONS} -i "${CMAKE_CURRENT_SOURCE_DIR}/llvm_no_ast_introspection.patch"
|
||||
COMMAND ${CMAKE_COMMAND};-E;copy;${PROJECT_SOURCE_DIR}/CMake/FindZLIB.cmake;<SOURCE_DIR>/cmake/Modules/FindZLIB.cmake
|
||||
${Z_BRL_PATCH_CMD}
|
||||
CMAKE_ARGS
|
||||
-C ${CMAKE_CURRENT_SOURCE_DIR}/llvm_targets.cmake
|
||||
@@ -88,12 +103,19 @@ if (ENABLE_LLVM)
|
||||
-DLLVM_BUILD_DOCS=OFF
|
||||
-DLLVM_BUILD_EXAMPLES=OFF
|
||||
-DLLVM_ENABLE_LIBEDIT=OFF
|
||||
-DLLVM_ENABLE_LIBPFM=OFF
|
||||
-DLLVM_ENABLE_PROJECTS=clang
|
||||
-DLLVM_ENABLE_RUNTIMES=
|
||||
-DLLVM_ENABLE_ZSTD=OFF
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF
|
||||
-DLLVM_PARALLEL_LINK_JOBS=1 # llvm/clang linking is memory hungry
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
-DLLVM_BUILD_LLVM_DYLIB=OFF
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
|
||||
-DLLVM_INCLUDE_TESTS=OFF
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF
|
||||
-DLLVM_INCLUDE_DOCS=OFF
|
||||
-DBIN_DIR=${BIN_DIR}
|
||||
-DLIB_DIR=${LIB_DIR}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
@@ -126,4 +148,3 @@ endif (ENABLE_LLVM)
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -97,133 +97,6 @@ diff -Naur llvm-project/clang-tools-extra/clangd/index/Serialization.cpp LLVM_BL
|
||||
llvm::arrayRefFromStringRef(R.rest()), UncompressedStorage,
|
||||
UncompressedSize))
|
||||
return std::move(E);
|
||||
diff -Naur llvm-project/cmake/Modules/FindZLIB.cmake LLVM_BLD/cmake/Modules/FindZLIB.cmake
|
||||
--- llvm-project/cmake/Modules/FindZLIB.cmake 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ LLVM_BLD/cmake/Modules/FindZLIB.cmake 2024-06-26 12:24:45.706526084 -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 llvm-project/compiler-rt/test/fuzzer/CompressedTest.cpp LLVM_BLD/compiler-rt/test/fuzzer/CompressedTest.cpp
|
||||
--- llvm-project/compiler-rt/test/fuzzer/CompressedTest.cpp 2024-06-26 14:02:57.008003863 -0400
|
||||
+++ LLVM_BLD/compiler-rt/test/fuzzer/CompressedTest.cpp 2024-06-26 12:24:45.706526084 -0400
|
||||
|
||||
+1
-1
Submodule lmdb/lmdb updated: 9c9d34558c...1e4cd2d792
+3
-1
@@ -1,7 +1,7 @@
|
||||
diff -Naur lmdb/CMakeLists.txt LMDB_BLD/CMakeLists.txt
|
||||
--- lmdb/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ LMDB_BLD/CMakeLists.txt 2024-07-12 10:57:50.320556893 -0400
|
||||
@@ -0,0 +1,118 @@
|
||||
@@ -0,0 +1,120 @@
|
||||
+# C M A K E L I S T S . T X T
|
||||
+# BRL-CAD
|
||||
+#
|
||||
@@ -48,6 +48,8 @@ diff -Naur lmdb/CMakeLists.txt LMDB_BLD/CMakeLists.txt
|
||||
+# Set CMake project name
|
||||
+project(LMDB)
|
||||
+
|
||||
+set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
+
|
||||
+include_directories(
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
+ )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user