- mkdir submodules
- git submodules add https://github.com/OSGeo/gdal.git
- cd submodules/gdal/
- mkdir build && cd build
- cmake ..
- cmake --build . -- -j24
- See use_gdal CMakeLists.txt example
- Use C++ 17: set(CMAKE_CXX_STANDARD 17)
- Include target directories
- gdal/gcore/
- gdal/port/
- gdal/ogr/h
- gdal/build/gcore/
- gdal/build/port/
- Link Library
- gdal/build/libgdal.so
- #include <gdal.h>
- #include <gdal_priv.h>