Skip to content

Commit f30c6a4

Browse files
authored
Merge pull request #4373 from rouault/EMBED_RESOURCE_DIRECTORY
Rename EMBED_GRIDS_DIRECTORY to EMBED_RESOURCE_DIRECTORY, and also embed .pol files
2 parents 081d12a + f509b3f commit f30c6a4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.github/workflows/fedora_rawhide/start.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ CC=clang CXX=clang++ cmake .. \
2424
make -j$(nproc)
2525
ctest -j$(nproc)
2626

27-
# Try EMBED_GRIDS_DIRECTORY option
27+
# Try EMBED_RESOURCE_DIRECTORY option
2828
wget https://raw.githubusercontent.com/OSGeo/PROJ-data/refs/heads/master/us_nga/us_nga_egm96_15.tif
2929
mkdir grids
3030
mv us_nga_egm96_15.tif grids
31-
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_GRIDS_DIRECTORY=$PWD/grids"
32-
CC=clang CXX=clang++ cmake .. -DEMBED_GRIDS_DIRECTORY=$PWD/grids
31+
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_RESOURCE_DIRECTORY=$PWD/grids"
32+
CC=clang CXX=clang++ cmake .. -DEMBED_RESOURCE_DIRECTORY=$PWD/grids
3333
make -j$(nproc)
3434
rm -rf data
3535
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979
3636
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979 | grep 44.643 >/dev/null || (echo "Expected 49dN 2dE 44.643 as a result" && /bin/false)
3737
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96
3838
echo 0 0 0 | bin/cct +init=ITRF2000:ITRF96 | grep 0.0067 >/dev/null || (echo "Expected 0.0067 0.0061 -0.0185 as a result" && /bin/false)
3939

40-
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_GRIDS_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON"
41-
CC=clang CXX=clang++ cmake .. -DEMBED_GRIDS_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON
40+
echo "Build with -DEMBED_RESOURCE_FILES=ON -DEMBED_RESOURCE_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON"
41+
CC=clang CXX=clang++ cmake .. -DEMBED_RESOURCE_DIRECTORY=$PWD/grids -DUSE_ONLY_EMBEDDED_RESOURCE_FILES=ON
4242
make -j$(nproc)
4343
rm -rf data
4444
echo 49 2 0 | bin/cs2cs "WGS84 + EGM96 height" EPSG:4979

docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ All cached entries can be viewed using ``cmake -LAH`` from a build directory.
455455
Default is OFF for shared library builds (BUILD_SHARED_LIBS=ON), and ON
456456
for static library builds (BUILD_SHARED_LIBS=OFF).
457457

458-
.. option:: EMBED_GRIDS_DIRECTORY=<directory>
458+
.. option:: EMBED_RESOURCE_DIRECTORY=<directory>
459459

460460
.. versionadded:: 9.6
461461

462-
Embed files from <directory> ending with .tif or .json in the PROJ library itself.
462+
Embed files from <directory> ending with .tif, .json or .pol in the PROJ library itself.
463463

464464
The pointed directory can potentially be the full PROJ-data package (uncompressed).
465465
In that case, about 6 GB of free disk and 16 GB of RAM are required to build PROJ.

src/lib_proj.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,20 @@ if (EMBED_RESOURCE_FILES)
430430
endif()
431431
endif()
432432

433-
set(EMBED_GRIDS_DIRECTORY "" CACHE PATH "Directory that contains .tif and .json files to embed into libproj")
433+
set(EMBED_RESOURCE_DIRECTORY "" CACHE PATH "Directory that contains .tif, .json or .pol files to embed into libproj")
434434
set(FILES_TO_EMBED)
435-
if (EMBED_GRIDS_DIRECTORY)
435+
if (EMBED_RESOURCE_DIRECTORY)
436436
if (NOT EMBED_RESOURCE_FILES)
437-
message(FATAL_ERROR "EMBED_RESOURCE_FILES should be set to ON when EMBED_GRIDS_DIRECTORY is set")
437+
message(FATAL_ERROR "EMBED_RESOURCE_FILES should be set to ON when EMBED_RESOURCE_DIRECTORY is set")
438438
endif()
439439

440-
if (NOT IS_DIRECTORY ${EMBED_GRIDS_DIRECTORY})
441-
message(FATAL_ERROR "${EMBED_GRIDS_DIRECTORY} is not a valid directory")
440+
if (NOT IS_DIRECTORY ${EMBED_RESOURCE_DIRECTORY})
441+
message(FATAL_ERROR "${EMBED_RESOURCE_DIRECTORY} is not a valid directory")
442442
endif()
443443

444-
file(GLOB FILES_TO_EMBED "${EMBED_GRIDS_DIRECTORY}/*.tif" "${EMBED_GRIDS_DIRECTORY}/*.json")
444+
file(GLOB FILES_TO_EMBED "${EMBED_RESOURCE_DIRECTORY}/*.tif" "${EMBED_RESOURCE_DIRECTORY}/*.json" "${EMBED_RESOURCE_DIRECTORY}/*.pol")
445445
if (NOT FILES_TO_EMBED)
446-
message(FATAL_ERROR "No .tif or .json files found in ${EMBED_GRIDS_DIRECTORY}")
446+
message(FATAL_ERROR "No .tif, .json or .pol files found in ${EMBED_RESOURCE_DIRECTORY}")
447447
endif()
448448
endif()
449449

0 commit comments

Comments
 (0)