-
Notifications
You must be signed in to change notification settings - Fork 54
Added Proj integration #373
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,3 +70,5 @@ imgui.ini | |
| /out_old/install | ||
|
|
||
| /.gitmodules | ||
| /build2 | ||
| /build3 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| cmake_minimum_required(VERSION 3.28) | ||
|
|
||
| # ============================================================ | ||
| # PROJ setup | ||
| # ============================================================ | ||
|
|
||
|
|
||
|
|
||
| # ---------------------------- | ||
| # Linux / Unix | ||
| # ---------------------------- | ||
| if(UNIX AND NOT WIN32) | ||
|
|
||
| find_package(PROJ CONFIG QUIET) | ||
|
|
||
| # Some distros expose lowercase target | ||
| if(TARGET PROJ::proj) | ||
| set(PROJ_TARGET PROJ::proj) | ||
|
|
||
| elseif(TARGET proj) | ||
| set(PROJ_TARGET proj) | ||
|
|
||
| else() | ||
| message(FATAL_ERROR | ||
| "PROJ not found.\n" | ||
| "libproj-dev is installed but CMake could not locate the config package.\n" | ||
| "Check CMAKE_PREFIX_PATH or PROJ_DIR." | ||
| ) | ||
| endif() | ||
|
|
||
| endif() | ||
|
|
||
| # ---------------------------- | ||
| # Windows – download prebuilt | ||
| # ---------------------------- | ||
| if(WIN32) | ||
| set(PROJ_FILENAME "proj-windows.zip") | ||
| set(PROJ_URL | ||
| "https://github.com/MapsHD/proj_win_deploy/releases/download/v9.3.0-5/proj-windows.zip" | ||
| ) | ||
|
|
||
|
|
||
| set(PROJ_SHA256 | ||
| "2d0cef6a07ca4d3e83cb6ca89637fb62db1650006876305e8d6a2af21468ae48" | ||
| ) | ||
|
|
||
| set(PROJ_DOWNLOAD_PATH "${CMAKE_BINARY_DIR}/${PROJ_FILENAME}") | ||
| set(PROJ_EXTRACT_DIR "${CMAKE_BINARY_DIR}/3rd_binary/PROJ") | ||
|
|
||
| # ---------------------------- | ||
| # Download | ||
| # ---------------------------- | ||
| if(NOT EXISTS "${PROJ_DOWNLOAD_PATH}") | ||
| message(STATUS "Downloading PROJ ${PROJ_VERSION}...") | ||
| file(DOWNLOAD | ||
| "${PROJ_URL}" | ||
| "${PROJ_DOWNLOAD_PATH}" | ||
| EXPECTED_HASH SHA256=${PROJ_SHA256} | ||
| SHOW_PROGRESS | ||
| TLS_VERIFY ON | ||
| ) | ||
| endif() | ||
|
|
||
| # ---------------------------- | ||
| # Extract | ||
| # ---------------------------- | ||
| if(NOT EXISTS "${PROJ_EXTRACT_DIR}/include") | ||
| message(STATUS "Extracting PROJ...") | ||
| file(ARCHIVE_EXTRACT | ||
| INPUT "${PROJ_DOWNLOAD_PATH}" | ||
| DESTINATION "${PROJ_EXTRACT_DIR}" | ||
| ) | ||
| endif() | ||
| set(PROJ_VERSION v9.3.0) | ||
| set(PROJ_ROOT "${PROJ_EXTRACT_DIR}/install_proj") | ||
| set (PROJ_INCLUDE_DIR "${PROJ_ROOT}/include") | ||
| set (PROJ_LIBRARY "${PROJ_ROOT}/bin/proj_9_3.dll") | ||
| set (PROJ_IMPLIB "${PROJ_ROOT}/lib/proj.lib") | ||
| set (PROJ_DB "${PROJ_ROOT}/share/proj/proj.db") | ||
|
|
||
| # ---------------------------- | ||
| # Create imported target | ||
| # ---------------------------- | ||
| add_library(PROJ::proj SHARED IMPORTED) | ||
|
|
||
| set_target_properties(PROJ::proj PROPERTIES | ||
| IMPORTED_LOCATION "${PROJ_ROOT}/bin/proj_9_3.dll" | ||
| IMPORTED_IMPLIB "${PROJ_ROOT}/lib/proj.lib" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${PROJ_ROOT}/include" | ||
| ) | ||
| add_library(PROJ::ZLIB SHARED IMPORTED) | ||
| set_target_properties(PROJ::ZLIB PROPERTIES | ||
| IMPORTED_LOCATION "${PROJ_ROOT}/bin/z.dll" | ||
| IMPORTED_IMPLIB "${PROJ_ROOT}/lib/zs.lib" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${PROJ_ROOT}/include" | ||
| ) | ||
|
|
||
| set_property(TARGET PROJ::proj APPEND PROPERTY | ||
| INTERFACE_LINK_LIBRARIES PROJ::ZLIB | ||
| ) | ||
|
|
||
| endif() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.