Skip to content

Replace PROJ_DATA_PATH with ${CMAKE_INSTALL_DATADIR}/proj - #4843

Merged
mwtoews merged 1 commit into
OSGeo:masterfrom
mwtoews:fix-cmake-install-destination-relative
Sep 7, 2026
Merged

Replace PROJ_DATA_PATH with ${CMAKE_INSTALL_DATADIR}/proj#4843
mwtoews merged 1 commit into
OSGeo:masterfrom
mwtoews:fix-cmake-install-destination-relative

Conversation

@mwtoews

@mwtoews mwtoews commented Sep 7, 2026

Copy link
Copy Markdown
Member

This replaces the CMake variable PROJ_DATA_PATH from an absolute path (e.g. /usr/local/share/proj) to a relative path ${CMAKE_INSTALL_DATADIR}/proj (e.g. share/proj).

This is because install(FILES <file> ... [...]) expects that DESTINATION <dir> is a relative path, and CMake 4.4 and later will show a warning for this with -Wauthor. Furthermore, "it is strongly recommended that [packages] use a path that begins with the appropriate relative GNUInstallDirs variable", as done in this PR. I believe this allows the prefix to be adjusted at install time (which is not fully supported in this project, yet.)

When EMBED_PROJ_DATA_PATH=ON is used (default), the absolute path is stored for the PROJ_DATA define (not sure what happens at install time with this one).

The primary change in this PR was suggested in #3742 which @rouault was "not a big fan of" at the time.

Also, related to #4730

@kbevers

kbevers commented Sep 7, 2026

Copy link
Copy Markdown
Member

@mwtoews are you happy with this PR as is?

@mwtoews
mwtoews merged commit b834d1f into OSGeo:master Sep 7, 2026
30 checks passed
@mwtoews
mwtoews deleted the fix-cmake-install-destination-relative branch September 7, 2026 20:06
@mwtoews mwtoews linked an issue Sep 8, 2026 that may be closed by this pull request
@mwtoews mwtoews added this to the 9.9.0 milestone Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

patch for data/CMakeLists.txt

3 participants