Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: add option EMBED_PROJ_DATA_PATH #4207

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ endif()

################################################################################

option(EMBED_PROJ_DATA_PATH "Whether the PROJ_DATA_PATH should be embedded" ON)

if(DEFINED PROJ_LIB_ENV_VAR_TRIED_LAST)
set(PROJ_DATA_ENV_VAR_TRIED_LAST ${PROJ_LIB_ENV_VAR_TRIED_LAST})
message(WARNING "PROJ_LIB_ENV_VAR_TRIED_LAST option has been renamed to PROJ_DATA_ENV_VAR_TRIED_LAST. PROJ_LIB_ENV_VAR_TRIED_LAST is still working for now, but may be completely replaced by PROJ_DATA_ENV_VAR_TRIED_LAST in a future release")
Expand Down
8 changes: 8 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,14 @@ All cached entries can be viewed using ``cmake -LAH`` from a build directory.
Path to an existing directory used to cache :file:`proj.db` to speed-up
subsequent builds without modifications to source SQL files.

.. option:: EMBED_PROJ_DATA_PATH

.. versionadded:: 9.5

Embed ``PROJ_DATA_PATH`` data files location as an alternative paths for
WangWeiLin-MV marked this conversation as resolved.
Show resolved Hide resolved
external libraries. Disable to avoid setting this non-relocatable hardcoded
paths. Default ON.
rouault marked this conversation as resolved.
Show resolved Hide resolved


Building on Windows with vcpkg and Visual Studio 2017 or 2019
--------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion src/lib_proj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
source_group("CMake Files" FILES CMakeLists.txt)

# Embed PROJ_DATA data files location
add_definitions(-DPROJ_DATA="${PROJ_DATA_PATH}")
if(EMBED_PROJ_DATA_PATH)
add_definitions(-DPROJ_DATA="${PROJ_DATA_PATH}")
endif()


###########################################################
Expand Down