Skip to content

Commit 041a367

Browse files
committed
Utilities: Add GDAL
1 parent 03b8b34 commit 041a367

File tree

5 files changed

+79
-1
lines changed

5 files changed

+79
-1
lines changed

src/Utilities/Shape/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
target_sources(${CMAKE_PROJECT_NAME}
22
PRIVATE
3+
GDALHelper.cc
4+
GDALHelper.h
35
KMLDomDocument.cc
46
KMLDomDocument.h
57
KMLHelper.cc
@@ -25,3 +27,40 @@ CPMAddPackage(
2527
)
2628

2729
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE shp)
30+
31+
#===========================================================================#
32+
33+
CPMAddPackage(
34+
NAME PROJ
35+
VERSION 9.6.2
36+
GITHUB_REPOSITORY OSGeo/PROJ
37+
GIT_TAG 9.6.2
38+
OPTIONS
39+
"BUILD_EXAMPLES OFF"
40+
"BUILD_SHARED_LIBS OFF"
41+
"BUILD_TESTING OFF"
42+
"EMBED_RESOURCE_FILES ON"
43+
)
44+
45+
# find_package(PROJ REQUIRED CONFIG)
46+
# target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE PROJ::proj)
47+
# list(APPEND CMAKE_PREFIX_PATH "${proj_BINARY_DIR}")
48+
49+
#===========================================================================#
50+
51+
CPMAddPackage(
52+
NAME GDAL
53+
GITHUB_REPOSITORY OSGeo/gdal
54+
VERSION 3.11.1
55+
OPTIONS
56+
"BUILD_APPS OFF"
57+
"BUILD_SHARED_LIBS OFF"
58+
"BUILD_TESTING OFF"
59+
"GDAL_BUILD_OPTIONAL_DRIVERS OFF"
60+
"OGR_BUILD_OPTIONAL_DRIVERS OFF"
61+
"GDAL_USE_HDFS OFF"
62+
"CMAKE_DISABLE_FIND_PACKAGE_HDFS ON"
63+
"GDAL_USE_ZLIB_INTERNAL ON"
64+
)
65+
66+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE GDAL::GDAL)

src/Utilities/Shape/GDALHelper.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/****************************************************************************
2+
*
3+
* (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4+
*
5+
* QGroundControl is licensed according to the terms in the file
6+
* COPYING.md in the root of the source code directory.
7+
*
8+
****************************************************************************/
9+
10+
#include "GDALHelper.h"
11+
12+
#include "gdal/gdal.h"
13+
14+
namespace GDALHelper
15+
{
16+
17+
}

src/Utilities/Shape/GDALHelper.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/****************************************************************************
2+
*
3+
* (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4+
*
5+
* QGroundControl is licensed according to the terms in the file
6+
* COPYING.md in the root of the source code directory.
7+
*
8+
****************************************************************************/
9+
10+
#pragma once
11+
12+
namespace GDALHelper
13+
{
14+
15+
}

tools/setup/install-dependencies-debian.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ if apt-cache show gstreamer1.0-qt6 >/dev/null 2>&1; then
110110
apt-get install -y -qq --no-install-recommends gstreamer1.0-qt6
111111
fi
112112

113+
# --------------------------------------------------------------------
114+
# GDAL
115+
# --------------------------------------------------------------------
116+
apt-get install -y -qq --no-install-recommends \
117+
libproj-dev \
118+
proj-bin
119+
113120
# --------------------------------------------------------------------
114121
# Clean‑up
115122
# --------------------------------------------------------------------

tools/setup/install-dependencies-osx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ then
88
fi
99

1010
brew update
11-
brew install cmake ninja ccache git pkgconf create-dmg mold
11+
brew install cmake ninja ccache git pkgconf create-dmg mold proj
1212

1313
# Install GStreamer
1414
GST_URL=https://gstreamer.freedesktop.org/data/pkg/osx

0 commit comments

Comments
 (0)