Skip to content

Commit

Permalink
(#23731) Update laszip to v3.4.4
Browse files Browse the repository at this point in the history
* Update laszip to v3.4.4

* Set proper license based on version

* Remove hardcoded mincppstd

* typo

* newline at eof of patch

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
  • Loading branch information
tbeu and AbrilRBS committed Jun 11, 2024
1 parent c4a71fa commit 5f63641
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
9 changes: 9 additions & 0 deletions recipes/laszip/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ sources:
"3.4.3":
url: "https://github.com/LASzip/LASzip/releases/download/3.4.3/laszip-src-3.4.3.tar.bz2"
sha256: "5775eb0b97de1b77514d47534cc65c6cfb5bebdd8aed0e47a23af8e75b7ea887"
"3.4.4":
url: "https://github.com/LASzip/LASzip/archive/refs/tags/3.4.4.tar.gz"
sha256: "6d034bf3a400f81317a5dbad59d1b7ce82d971e887ca22d15813b914f0a5c281"
patches:
"3.4.3":
- patch_file: "patches/0001-no-build-laszip-api.patch"
- patch_file: "patches/0002-no-rpath-and-relocatable-macos.patch"
"3.4.4":
- patch_file: "patches/0001-3.4.4-no-build-laszip-api.patch"
- patch_file: "patches/0002-3.4.4-no-rpath-and-relocatable-macos.patch"
- patch_file: "patches/0003-3.4.4-remove-cppstd-hardcode.patch"
patch_type: "conan"
patch_description: "Let Conan set the cppstd, instead of forcing it (In this version it's incorreclty set to C++17 instead of the supported C++14)"
12 changes: 11 additions & 1 deletion recipes/laszip/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.build import stdcpp_library
from conan.tools.build import stdcpp_library, check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.scm import Version
Expand Down Expand Up @@ -27,6 +27,10 @@ class LaszipConan(ConanFile):
"fPIC": True,
}

@property
def _min_cppstd(self):
return 14

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -35,8 +39,14 @@ def config_options(self):
del self.options.fPIC

def configure(self):
if Version(self.version) >= "3.4.4":
self.license = "Apache-2.0"
if self.options.shared:
self.options.rm_safe("fPIC")

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--- a/dll/CMakeLists.txt
+++ b/dll/CMakeLists.txt
@@ -2,5 +2,4 @@ set(LASZIP_API_SOURCES
laszip_api.c
)

-LASZIP_ADD_LIBRARY(${LASZIP_API_LIB_NAME} ${LASZIP_API_SOURCES})
LASZIP_ADD_INCLUDES("laszip" "${CMAKE_CURRENT_SOURCE_DIR}/laszip_api.h" ${LASZIP_API_VERSION_H})
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,15 +81,11 @@ file(MAKE_DIRECTORY "${LASZIP_OUTPUT_BIN_DIR}")
# per http://www.cmake.org/Wiki/CMake_RPATH_handling
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
IF (APPLE)
SET(MACOSX_RPATH ON)
endif()
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}" isSystemDir)
-IF("${isSystemDir}" STREQUAL "-1")
- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LASZIP_LIB_INSTALL_DIR}")
-ENDIF("${isSystemDir}" STREQUAL "-1")

# wipe lib/ drectory on clean. It will have plugins that could be out of date
# in the next build
--- a/cmake/macros.cmake
+++ b/cmake/macros.cmake
@@ -71,8 +71,6 @@ macro(LASZIP_ADD_LIBRARY _name)
LIBRARY DESTINATION ${LASZIP_LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LASZIP_LIB_INSTALL_DIR})
if (APPLE)
- set_target_properties(${_name} PROPERTIES INSTALL_NAME_DIR
- "@executable_path/../lib")
endif()
endmacro(LASZIP_ADD_LIBRARY)

12 changes: 12 additions & 0 deletions recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b0a02b..a9cc6b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(LASZIP CXX C)
-set(CMAKE_CXX_STANDARD 17)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

set(ROOT_DIR "${PROJECT_SOURCE_DIR}")
2 changes: 2 additions & 0 deletions recipes/laszip/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"3.4.4":
folder: all
"3.4.3":
folder: all

0 comments on commit 5f63641

Please sign in to comment.