Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 14 additions & 8 deletions cmake/SetupGDAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,35 @@ if(NOT COMMAND alp_setup_cmake_project)
endif()

function(alp_setup_gdal)
set(oneValueArgs GDAL_VERSION GEOS_VERSION PROJ_VERSION)
set(oneValueArgs GDAL_VERSION GDAL_SHA256 GEOS_VERSION GEOS_SHA256 PROJ_VERSION PROJ_SHA256)
cmake_parse_arguments(ARG "" "${oneValueArgs}" "" ${ARGN})

if(NOT ARG_GDAL_VERSION OR NOT ARG_GEOS_VERSION OR NOT ARG_PROJ_VERSION)
message(FATAL_ERROR "alp_setup_gdal() needs: GDAL_VERSION <tag> GEOS_VERSION <tag> PROJ_VERSION <tag>")
if(NOT ARG_GDAL_VERSION OR NOT ARG_GDAL_SHA256
OR NOT ARG_GEOS_VERSION OR NOT ARG_GEOS_SHA256
OR NOT ARG_PROJ_VERSION OR NOT ARG_PROJ_SHA256)
message(FATAL_ERROR "alp_setup_gdal() needs VERSION and SHA256 arguments for GDAL, GEOS and PROJ")
endif()

alp_setup_cmake_project(proj URL https://github.com/OSGeo/PROJ.git COMMITISH ${ARG_PROJ_VERSION} CMAKE_ARGUMENTS -DBUILD_TESTING=OFF -DBUILD_APPS=OFF)
alp_setup_cmake_project(proj
URL https://download.osgeo.org/proj/proj-${ARG_PROJ_VERSION}.tar.gz
SHA256 ${ARG_PROJ_SHA256}
CMAKE_ARGUMENTS -DBUILD_TESTING=OFF -DBUILD_APPS=OFF)
find_package(PROJ CONFIG REQUIRED)

alp_setup_cmake_project(geos
URL https://github.com/libgeos/geos.git
COMMITISH ${ARG_GEOS_VERSION}
URL https://download.osgeo.org/geos/geos-${ARG_GEOS_VERSION}.tar.bz2
SHA256 ${ARG_GEOS_SHA256}
CMAKE_ARGUMENTS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DGEOS_BUILD_DEVELOPER=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
)

string(REGEX REPLACE "^v" "" _gdal_version "${ARG_GDAL_VERSION}")
alp_setup_cmake_project(gdal
URL https://github.com/OSGeo/gdal.git
COMMITISH ${ARG_GDAL_VERSION}
URL https://github.com/OSGeo/gdal/releases/download/v${_gdal_version}/gdal-${_gdal_version}.tar.gz
SHA256 ${ARG_GDAL_SHA256}
CMAKE_ARGUMENTS
-DGDAL_BUILD_OPTIONAL_DRIVERS=OFF
-DGDAL_ENABLE_DRIVER_HFA=ON
Expand Down
5 changes: 3 additions & 2 deletions cmake/SetupOpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ if(NOT COMMAND alp_setup_cmake_project)
include(${CMAKE_CURRENT_LIST_DIR}/SetupCMakeProject.cmake)
endif()

function(alp_setup_opencv version)
function(alp_setup_opencv version sha256)
set(_alp_opencv_sanitizer_arguments)
if(ALP_ENABLE_ADDRESS_SANITIZER OR ALP_ENABLE_THREAD_SANITIZER)
list(APPEND _alp_opencv_sanitizer_arguments -DOPENCV_SKIP_LINK_NO_UNDEFINED=ON)
endif()

alp_setup_cmake_project(opencv
URL https://github.com/opencv/opencv.git COMMITISH ${version}
URL https://github.com/opencv/opencv/archive/refs/tags/${version}.tar.gz
SHA256 ${sha256}
CMAKE_ARGUMENTS
${_alp_opencv_sanitizer_arguments}
-DBUILD_TESTS=OFF
Expand Down
6 changes: 3 additions & 3 deletions misc/suppression/ubsan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ bool:CGAL::Trapezoidal_decomposition_2<*::set_with_guarantees(bool)

# OpenCV's random-number dispatch casts typed functions to a common signature.
# Suppress only function-type diagnostics in that implementation.
function:*opencv/modules/core/src/rand.cpp
function:*opencv*/modules/core/src/rand.cpp

# OpenCV's IPP color conversion dispatch casts typed functions to a common signature.
# Suppress only function-type diagnostics in that implementation.
function:*opencv/modules/imgproc/src/color.hpp
function:*opencv*/modules/imgproc/src/color.hpp

# OpenCV's IPP resize fallback uses -1 as an unsupported-interpolation sentinel.
# Suppress only enum diagnostics in that implementation.
enum:*opencv/modules/imgproc/src/resize.cpp
enum:*opencv*/modules/imgproc/src/resize.cpp
34 changes: 23 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ find_package(ZLIB REQUIRED)

alp_add_git_repository(fmt URL https://github.com/fmtlib/fmt COMMITISH 12.2.0)

alp_add_git_repository(eigen URL https://gitlab.com/libeigen/eigen.git COMMITISH 3.4.0 DO_NOT_ADD_SUBPROJECT)
alp_setup_cmake_project(eigen
URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
SHA256 8586084f71f9bde545ee7fa6d00288b264a2b7ac3607b974e54d13e7162c1c72
CMAKE_ARGUMENTS -DBUILD_TESTING=OFF -DEIGEN_BUILD_DOC=OFF)
find_package(Eigen3 CONFIG REQUIRED)
add_library(Eigen3 INTERFACE)
target_include_directories(Eigen3 SYSTEM INTERFACE ${eigen_SOURCE_DIR})
target_link_libraries(Eigen3 INTERFACE Eigen3::Eigen)

alp_setup_cmake_project(boost
URL https://github.com/boostorg/boost/releases/download/boost-1.88.0/boost-1.88.0-cmake.tar.xz
Expand All @@ -40,17 +44,29 @@ alp_setup_cmake_project(boost
"-DBOOST_INCLUDE_LIBRARIES=graph\;multiprecision\;heap\;format\;logic")
find_package(Boost CONFIG REQUIRED)

alp_setup_cmake_project(tbb URL https://github.com/uxlfoundation/oneTBB.git COMMITISH v2023.1.0 CMAKE_ARGUMENTS -DTBB_TEST=OFF -DTBBMALLOC_BUILD=OFF)
alp_setup_cmake_project(tbb
URL https://github.com/uxlfoundation/oneTBB/archive/refs/tags/v2023.1.0.tar.gz
SHA256 191288b52e1e6b17198000b64d77d194bb65e791be46ebc606e9b091781e2070
CMAKE_ARGUMENTS -DTBB_TEST=OFF -DTBBMALLOC_BUILD=OFF)
find_package(TBB REQUIRED)

include(../cmake/SetupGDAL.cmake)
alp_setup_gdal(GDAL_VERSION v3.10.3 GEOS_VERSION 3.13.1 PROJ_VERSION 9.6.0)

alp_setup_cmake_project(cgal URL https://github.com/CGAL/cgal.git COMMITISH "v6.0.1" CMAKE_ARGUMENTS -DBUILD_TESTING=OFF -DWITH_examples=OFF)
alp_setup_gdal(
GDAL_VERSION v3.10.3
GDAL_SHA256 e4bf7f104acbcb3e2d16c97fd1af2b92b28d0ba59d17d976e3ef08b794f4153b
GEOS_VERSION 3.13.1
GEOS_SHA256 df2c50503295f325e7c8d7b783aca8ba4773919cde984193850cf9e361dfd28c
PROJ_VERSION 9.6.0
PROJ_SHA256 d8cae521c311c39513193657e75767f7cfbf2f91bd202fcd4a200028d3b57e14)

alp_setup_cmake_project(cgal
URL https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1-library.tar.xz
SHA256 c752737f91d1af71fa96038f0e37945ce82a5f1fffb6200172cfcdd77755a356
CMAKE_ARGUMENTS -DBUILD_TESTING=OFF -DWITH_examples=OFF)
find_package(CGAL REQUIRED)

include(../cmake/SetupOpenCV.cmake)
alp_setup_opencv(4.11.0)
alp_setup_opencv(4.11.0 9a7c11f924eff5f8d8070e297b322ee68b9227e003fd600d4b8122198091665f)

include(../cmake/SetupJpegXL.cmake)
alp_setup_jpegxl(v0.12.0)
Expand Down Expand Up @@ -98,10 +114,6 @@ alp_add_git_repository(meshoptimizer URL https://github.com/zeux/meshoptimizer.g

alp_add_git_repository(wideinteger URL https://github.com/ckormanyos/wide-integer.git COMMITISH 719cbbd557fe974f48b055568e2b149b2444bee9)

set(LIBIGL_COPYLEFT_CORE ON)
set(LIBIGL_RESTRICTED_TRIANGLE ON)
alp_add_git_repository(libigl URL https://github.com/libigl/libigl.git COMMITISH v2.6.0)

alp_add_git_repository(radix URL https://github.com/AlpineMapsOrg/radix.git COMMITISH 799db1af54a1f58454800e899bfc7fc544711834 NOT_SYSTEM)

set(ALP_CLI_COMPONENT_OPTIONS
Expand Down
9 changes: 0 additions & 9 deletions src/terrainlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ add_library(terrainlib
mesh/encode.h
mesh/geometry.h mesh/geometry.cpp
mesh/holes.h mesh/holes.cpp
mesh/igl/convert.h
mesh/igl/cut.h
mesh/igl/cut_to_disk.h
mesh/igl/igl.cpp
mesh/igl/manifold.h
mesh/igl/orient.h
mesh/io.h mesh/io.cpp
mesh/io/gltf.h mesh/io/gltf.cpp
mesh/io/options.h
Expand Down Expand Up @@ -246,7 +240,6 @@ add_library(terrainlib
uv/unwrap.h uv/unwrap.cpp
)
set_source_files_properties(
mesh/igl/igl.cpp
mesh/io/gltf.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
)
Expand Down Expand Up @@ -280,8 +273,6 @@ target_link_libraries(terrainlib PUBLIC
magic_enum::magic_enum
meshoptimizer
WideInteger
igl::core
igl_restricted::triangle
xatlas
)

Expand Down
Loading