aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/liblas
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/liblas
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/liblas')
-rw-r--r--vcpkg/ports/liblas/fix-boost-headers.patch55
-rw-r--r--vcpkg/ports/liblas/fix-cmake-config.patch14
-rw-r--r--vcpkg/ports/liblas/fix-cmake4.patch14
-rw-r--r--vcpkg/ports/liblas/fix-crosscompiling.diff13
-rw-r--r--vcpkg/ports/liblas/force-cpp11.patch27
-rw-r--r--vcpkg/ports/liblas/misc-fixes.patch59
-rw-r--r--vcpkg/ports/liblas/portfile.cmake68
-rw-r--r--vcpkg/ports/liblas/remove_unnecessary_boost_dependency.diff22
-rw-r--r--vcpkg/ports/liblas/usage11
-rw-r--r--vcpkg/ports/liblas/vcpkg.json37
10 files changed, 320 insertions, 0 deletions
diff --git a/vcpkg/ports/liblas/fix-boost-headers.patch b/vcpkg/ports/liblas/fix-boost-headers.patch
new file mode 100644
index 0000000..4725a6c
--- /dev/null
+++ b/vcpkg/ports/liblas/fix-boost-headers.patch
@@ -0,0 +1,55 @@
+diff --git a/include/liblas/detail/binary.hpp b/include/liblas/detail/binary.hpp
+index d3116a1..ab20e06 100644
+--- a/include/liblas/detail/binary.hpp
++++ b/include/liblas/detail/binary.hpp
+@@ -17,6 +17,8 @@
+ #ifndef LIBLAS_DETAIL_BINARY_HPP_INCLUDED
+ #define LIBLAS_DETAIL_BINARY_HPP_INCLUDED
+
++#include <liblas/detail/endian.hpp>
++
+ #include <cassert>
+ #include <climits>
+ #include <cstring>
+@@ -25,7 +27,6 @@
+
+ #include <boost/config.hpp>
+ #include <boost/static_assert.hpp>
+-#include <boost/detail/endian.hpp>
+ #include <boost/type_traits/is_signed.hpp>
+
+ #if CHAR_BIT != 8
+@@ -43,7 +44,7 @@ namespace detail { namespace binary {
+ struct big_endian_tag {};
+ struct little_endian_tag {};
+
+-#ifdef BOOST_BIG_ENDIAN
++#ifdef LIBLAS_BIG_ENDIAN
+ typedef big_endian_tag native_endian_tag;
+ #else
+ typedef little_endian_tag native_endian_tag;
+diff --git a/src/c_api.cpp b/src/c_api.cpp
+index a70fe74..e8be785 100644
+--- a/src/c_api.cpp
++++ b/src/c_api.cpp
+@@ -96,6 +96,7 @@ using namespace liblas;
+ #endif
+
+ #include <boost/lambda/lambda.hpp>
++#include <boost/bind.hpp>
+
+ bool IsReprojectionTransform(liblas::TransformPtr const& p)
+ {
+diff --git a/src/header.cpp b/src/header.cpp
+index 9987ce1..a5c8f7d 100644
+--- a/src/header.cpp
++++ b/src/header.cpp
+@@ -54,7 +54,7 @@
+ // boost
+ #include <boost/cstdint.hpp>
+ #include <boost/lambda/lambda.hpp>
+-
++#include <boost/bind.hpp>
+ //std
+ #include <algorithm>
+ #include <fstream>
diff --git a/vcpkg/ports/liblas/fix-cmake-config.patch b/vcpkg/ports/liblas/fix-cmake-config.patch
new file mode 100644
index 0000000..46eb9eb
--- /dev/null
+++ b/vcpkg/ports/liblas/fix-cmake-config.patch
@@ -0,0 +1,14 @@
+diff --git a/cmake/liblas-config.cmake.in b/cmake/liblas-config.cmake.in
+index 175e997..8a55804 100644
+--- a/cmake/liblas-config.cmake.in
++++ b/cmake/liblas-config.cmake.in
+@@ -19,6 +19,8 @@ set (libLAS_INCLUDE_DIRS "${PROJECT_ROOT_DIR}/include")
+ set (libLAS_LIBRARY_DIRS "${PROJECT_ROOT_DIR}/lib")
+ set (libLAS_BINARY_DIRS "${PROJECT_ROOT_DIR}/bin")
+
++include(CMakeFindDependencyMacro)
++find_dependency(GeoTIFF CONFIG)
+-include ("${_DIR}/liblas-depends.cmake")
++include ("${CMAKE_CURRENT_LIST_DIR}/liblas-depends.cmake")
+ if(WIN32)
+ set (libLAS_LIBRARIES liblas liblas_c)
diff --git a/vcpkg/ports/liblas/fix-cmake4.patch b/vcpkg/ports/liblas/fix-cmake4.patch
new file mode 100644
index 0000000..0ee3aa9
--- /dev/null
+++ b/vcpkg/ports/liblas/fix-cmake4.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5af9ac21a5..5cc6f88939 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -75,9 +75,6 @@ mark_as_advanced(CMAKE_VERBOSE_MAKEFILE)
+
+ # Path to additional CMake modules
+ set(CMAKE_MODULE_PATH "${libLAS_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
+-if (CMAKE_MAJOR_VERSION GREATER 2)
+- cmake_policy(SET CMP0042 OLD)
+-endif()
+
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+ set(CMAKE_SKIP_RPATH ON)
diff --git a/vcpkg/ports/liblas/fix-crosscompiling.diff b/vcpkg/ports/liblas/fix-crosscompiling.diff
new file mode 100644
index 0000000..4d9eb5a
--- /dev/null
+++ b/vcpkg/ports/liblas/fix-crosscompiling.diff
@@ -0,0 +1,13 @@
+diff --git a/cmake/liblas-config-version.cmake.in b/cmake/liblas-config-version.cmake.in
+index f9b7c7cb..5dd2aba1 100644
+--- a/cmake/liblas-config-version.cmake.in
++++ b/cmake/liblas-config-version.cmake.in
+@@ -22,7 +22,7 @@ elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@")
+ # Reject if there's a mismatch in MSVC compiler versions
+ set (REASON "_MSC_VER = @MSVC_VERSION@")
+ set (PACKAGE_VERSION_UNSUITABLE TRUE)
+-elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@")
++elseif (0)
+ # Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}
+ set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
+ set (PACKAGE_VERSION_UNSUITABLE TRUE)
diff --git a/vcpkg/ports/liblas/force-cpp11.patch b/vcpkg/ports/liblas/force-cpp11.patch
new file mode 100644
index 0000000..d5f44a8
--- /dev/null
+++ b/vcpkg/ports/liblas/force-cpp11.patch
@@ -0,0 +1,27 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9732bcb..5af9ac2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -66,6 +66,8 @@ set(WITH_ENDIANAWARE FALSE CACHE BOOL "Choose whether or not libLAS should do ru
+ ###############################################################################
+ # CMake settings
+
++set(CMAKE_CXX_STANDARD 11) # Boost v1.84.0 libraries require C++11
++
+ set(CMAKE_COLOR_MAKEFILE ON)
+
+ # Allow advanced users to generate Makefiles printing detailed commands
+@@ -149,12 +151,7 @@ else()
+ " -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long")
+
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+-
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBLAS_COMMON_CXX_FLAGS}")
+- if (CMAKE_COMPILER_IS_GNUCXX)
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -ansi")
+- endif()
+-
+ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER}" MATCHES "clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBLAS_COMMON_CXX_FLAGS}")
+ endif()
+
diff --git a/vcpkg/ports/liblas/misc-fixes.patch b/vcpkg/ports/liblas/misc-fixes.patch
new file mode 100644
index 0000000..14f5ff6
--- /dev/null
+++ b/vcpkg/ports/liblas/misc-fixes.patch
@@ -0,0 +1,59 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d246a88..3da2106 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,7 @@
+ #
+ ###############################################################################
+ # libLAS general settings
++cmake_minimum_required(VERSION 3.7.0)
+ project(libLAS)
+
+
+@@ -64,7 +65,6 @@ set(WITH_ENDIANAWARE FALSE CACHE BOOL "Choose whether or not libLAS should do ru
+
+ ###############################################################################
+ # CMake settings
+-cmake_minimum_required(VERSION 2.6.0)
+
+ set(CMAKE_COLOR_MAKEFILE ON)
+
+@@ -107,7 +107,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBLAS_BUILD_OUTPUT_DIRECTORY})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBLAS_BUILD_OUTPUT_DIRECTORY})
+
+ file(READ "doc/index.txt" README )
+-file(WRITE "README.txt" "${README}")
+
+ ###############################################################################
+ # Platform and compiler specific settings
+@@ -138,8 +137,6 @@ if(WIN32)
+
+ endif()
+
+- set(CMAKE_INCLUDE_PATH c:/osgeo4w64/include;$ENV{CMAKE_INCLUDE_PATH})
+- set(CMAKE_LIBRARY_PATH c:/osgeo4w64/lib;$ENV{CMAKE_LIBRARY_PATH})
+ else()
+
+ # Recommended C++ compilation flags
+@@ -337,8 +334,6 @@ set(LIBLAS_DATA_DIR ${LIBLAS_DATA_SUBDIR})
+ ###############################################################################
+ # Installation commands
+
+-install(FILES AUTHORS COPYING INSTALL LICENSE.txt README.txt
+- DESTINATION ${LIBLAS_DATA_DIR}/doc)
+
+ ###############################################################################
+ # Processing of project directories
+diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
+index beb83e2..e328c95 100644
+--- a/apps/CMakeLists.txt
++++ b/apps/CMakeLists.txt
+@@ -160,7 +160,7 @@ install(TARGETS ${LIBLAS_UTILITIES}
+ ARCHIVE DESTINATION ${LIBLAS_LIB_DIR})
+
+
+-if(UNIX)
++if(0)
+
+ set(LIBLAS_UTILS_RPATH ${CMAKE_INSTALL_PREFIX}/lib ${Boost_LIBRARY_DIRS})
+ if(LASZIP_FOUND)
diff --git a/vcpkg/ports/liblas/portfile.cmake b/vcpkg/ports/liblas/portfile.cmake
new file mode 100644
index 0000000..ac41485
--- /dev/null
+++ b/vcpkg/ports/liblas/portfile.cmake
@@ -0,0 +1,68 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+set(VERSION 1.8.1)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://download.osgeo.org/liblas/libLAS-${VERSION}.tar.bz2"
+ FILENAME "libLAS-${VERSION}-src.tar.bz2"
+ SHA512 1cb39c557af0006c54f1100d0d409977fcc1886abd155c1b144d806c47f8675a9f2125d3a9aca16bae65d2aabba84d5e5e322b42085e7db312f3d53f92342acf
+ HEAD_REF master
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ fix-boost-headers.patch
+ fix-cmake-config.patch
+ fix-crosscompiling.diff
+ misc-fixes.patch
+ remove_unnecessary_boost_dependency.diff
+ force-cpp11.patch
+ fix-cmake4.patch
+)
+
+file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/modules")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tools WITH_UTILITIES
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DBUILD_OSGEO4W=OFF
+ -DWITH_TESTS=OFF
+ OPTIONS_DEBUG
+ -DWITH_UTILITIES=OFF
+)
+
+vcpkg_cmake_install()
+
+if (VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
+else()
+ vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/libLAS)
+endif()
+
+vcpkg_replace_string ("${CURRENT_PACKAGES_DIR}/share/liblas/liblas-config.cmake" "_DIR}/.." "_DIR}/../..")
+vcpkg_replace_string ("${CURRENT_PACKAGES_DIR}/share/liblas/liblas-config.cmake" "\${PROJECT_ROOT_DIR}/lib" "\${PROJECT_ROOT_DIR}/$<$<CONFIG:DEBUG>:/debug>/lib")
+vcpkg_replace_string ("${CURRENT_PACKAGES_DIR}/share/liblas/liblas-config.cmake" "\${PROJECT_ROOT_DIR}/bin" "\${PROJECT_ROOT_DIR}/tools/${PORT}")
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+
+if(WITH_UTILITIES)
+ set(tools lasinfo lasblock las2las las2txt txt2las ts2las)
+ if(NOT VCPKG_TARGET_IS_WINDOWS)
+ list(APPEND tools las2col las2pg)
+ endif()
+ vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/liblas/remove_unnecessary_boost_dependency.diff b/vcpkg/ports/liblas/remove_unnecessary_boost_dependency.diff
new file mode 100644
index 0000000..9c36bec
--- /dev/null
+++ b/vcpkg/ports/liblas/remove_unnecessary_boost_dependency.diff
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d246a88d..634157c0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -190,11 +190,13 @@ if(WIN32)
+ endif(WIN32)
+
+ find_package(Threads)
+-find_package(Boost 1.42 COMPONENTS program_options thread system iostreams filesystem REQUIRED)
++find_package(Boost 1.42 COMPONENTS iostreams program_options serialization thread REQUIRED)
++
++# The following header-only and their dependencies are additionally required,
++# but cannot be explicitly requested via find_package, so make sure they exists:
++# - foreach interprocess lambda property_tree uuid
+
+-if(Boost_FOUND AND Boost_PROGRAM_OPTIONS_FOUND)
+- include_directories(${Boost_INCLUDE_DIRS})
+-endif()
++include_directories(${Boost_INCLUDE_DIRS})
+
+ # make these available for the user to set.
+ mark_as_advanced(CLEAR Boost_INCLUDE_DIR)
diff --git a/vcpkg/ports/liblas/usage b/vcpkg/ports/liblas/usage
new file mode 100644
index 0000000..8626d5a
--- /dev/null
+++ b/vcpkg/ports/liblas/usage
@@ -0,0 +1,11 @@
+liblas provides CMake targets:
+
+ # C API
+ find_package(libLAS CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE $<$<PLATFORM_ID:Windows>:lib>las_c)
+ target_include_directories(main SYSTEM PRIVATE ${libLAS_INCLUDE_DIRS})
+
+ # C++ API
+ find_package(libLAS CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE $<$<PLATFORM_ID:Windows>:lib>las)
+ target_include_directories(main SYSTEM PRIVATE ${libLAS_INCLUDE_DIRS})
diff --git a/vcpkg/ports/liblas/vcpkg.json b/vcpkg/ports/liblas/vcpkg.json
new file mode 100644
index 0000000..fd0221e
--- /dev/null
+++ b/vcpkg/ports/liblas/vcpkg.json
@@ -0,0 +1,37 @@
+{
+ "name": "liblas",
+ "version": "1.8.1",
+ "port-version": 16,
+ "description": "A C/C++ library for reading and writing the very common LAS LiDAR format.",
+ "license": null,
+ "supports": "!arm & !staticcrt",
+ "dependencies": [
+ "boost-foreach",
+ "boost-interprocess",
+ "boost-iostreams",
+ "boost-lambda",
+ "boost-program-options",
+ "boost-property-tree",
+ "boost-uuid",
+ "libgeotiff",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "jpeg": {
+ "description": "This feature does nothing. It is retained for compatibility."
+ },
+ "tools": {
+ "description": "Build utilities."
+ },
+ "zlib": {
+ "description": "This feature does nothing. It is retained for compatibility."
+ }
+ }
+}