mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
kealib update to 1.4.11 and correctly include hdf5
This commit is contained in:
parent
49f59fd081
commit
4de9cb0f1b
@ -1,5 +1,5 @@
|
||||
Source: kealib
|
||||
Version: 1.4.7-1
|
||||
Version: 1.4.11
|
||||
Build-Depends: hdf5[cpp], zlib, szip
|
||||
Description: kealib is gdal model using HDF5 standard.
|
||||
|
||||
|
@ -1,122 +0,0 @@
|
||||
diff --git a/trunk/CMakeLists.txt b/trunk/CMakeLists.txt
|
||||
index 464fb13..dc8e26f 100644
|
||||
--- a/trunk/CMakeLists.txt
|
||||
+++ b/trunk/CMakeLists.txt
|
||||
@@ -8,6 +8,7 @@
|
||||
# which were derived from those used by libLAS (http://liblas.org/)
|
||||
#
|
||||
# History
|
||||
+# 2018/01/25 - updated by Hiroshi Miura
|
||||
# 2012/07/02 - Created by Peter Bunting
|
||||
#
|
||||
###############################################################################
|
||||
@@ -50,13 +51,10 @@ endif()
|
||||
|
||||
option (BUILD_SHARED_LIBS "Build with shared library" ON)
|
||||
|
||||
-set(HDF5_INCLUDE_DIR /usr/local/include CACHE PATH "Include PATH for HDF5")
|
||||
-set(HDF5_LIB_PATH /usr/local/lib CACHE PATH "Library PATH for HDF5")
|
||||
|
||||
set(GDAL_INCLUDE_DIR "NOTFOUND" CACHE PATH "Include PATH for GDAL")
|
||||
set(GDAL_LIB_PATH "NOTFOUND" CACHE PATH "Library PATH for GDAL")
|
||||
|
||||
-set(HDF5_STATIC_LIBS FALSE CACHE BOOL "On Windows, link against static HDF5 libs")
|
||||
|
||||
IF(GDAL_INCLUDE_DIR AND GDAL_LIB_PATH)
|
||||
# by default, only build if paths are set
|
||||
@@ -65,6 +63,8 @@ ELSE()
|
||||
set(LIBKEA_WITH_GDAL FALSE CACHE BOOL "Choose if .kea GDAL driver should be built")
|
||||
ENDIF()
|
||||
|
||||
+find_package(hdf5 COMPONENTS CXX HL REQUIRED)
|
||||
+link_libraries(hdf5::hdf5_cpp-shared)
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
@@ -141,14 +141,7 @@ endif(APPLE)
|
||||
# Check the required libraries are present
|
||||
|
||||
if (MSVC)
|
||||
- if(HDF5_STATIC_LIBS)
|
||||
- set(HDF5_LIBRARIES -LIBPATH:"${HDF5_LIB_PATH}" hdf5_cpp.lib hdf5.lib zlibstatic.lib)
|
||||
- else()
|
||||
- set(HDF5_LIBRARIES -LIBPATH:"${HDF5_LIB_PATH}" hdf5_cpp.lib hdf5.lib)
|
||||
- set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB)
|
||||
- endif()
|
||||
else()
|
||||
- set(HDF5_LIBRARIES "-L${HDF5_LIB_PATH} -lhdf5 -lhdf5_hl -lhdf5_cpp")
|
||||
endif(MSVC)
|
||||
|
||||
if (MSVC)
|
||||
@@ -160,21 +153,19 @@ endif(MSVC)
|
||||
|
||||
###############################################################################
|
||||
# Setup configure file
|
||||
-configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${PROJECT_HEADER_DIR}/libkea/kea-config.h" )
|
||||
-configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${PROJECT_BINARY_DIR}/kea-config" )
|
||||
+configure_file ( "${PROJECT_HEADER_DIR}/kea-config.h.in" "${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}/libkea/kea-config.h" )
|
||||
+configure_file ( "${PROJECT_TOOLS_DIR}/kea-config.in" "${CMAKE_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" )
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Documentation
|
||||
-file(READ "doc/index.txt" README )
|
||||
-file(WRITE "README.txt" "${README}")
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Build library
|
||||
|
||||
include_directories ("${PROJECT_HEADER_DIR}")
|
||||
-include_directories(${HDF5_INCLUDE_DIR})
|
||||
+include_directories ("${CMAKE_BINARY_DIR}/${PROJECT_HEADER_DIR}")
|
||||
add_subdirectory ("${PROJECT_SOURCE_DIR}")
|
||||
if (LIBKEA_WITH_GDAL)
|
||||
add_subdirectory ("${PROJECT_GDAL_DIR}")
|
||||
@@ -185,13 +176,11 @@ endif(LIBKEA_WITH_GDAL)
|
||||
# Tests
|
||||
enable_testing()
|
||||
add_test(NAME test1 COMMAND src/test1)
|
||||
-
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Installation
|
||||
-
|
||||
-install (FILES "${PROJECT_BINARY_DIR}/kea-config" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
+install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_BINARY_DIR}/kea-config" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
diff --git a/trunk/src/CMakeLists.txt b/trunk/src/CMakeLists.txt
|
||||
index 84456c4..b804e74 100644
|
||||
--- a/trunk/src/CMakeLists.txt
|
||||
+++ b/trunk/src/CMakeLists.txt
|
||||
@@ -37,6 +37,7 @@ target_link_libraries(${LIBKEA_LIB_NAME} ${HDF5_LIBRARIES} )
|
||||
|
||||
###############################################################################
|
||||
# Testing
|
||||
+if(NOT DISABLE_TESTS)
|
||||
# exe needs to be in 'src' otherwise it doesn't work
|
||||
add_executable (test1 ${PROJECT_TEST_DIR}/test1.cpp)
|
||||
target_link_libraries (test1 ${LIBKEA_LIB_NAME})
|
||||
@@ -53,6 +54,7 @@ if(NOT WIN32)
|
||||
# probably should match other compilers, but since this is a Conda
|
||||
# specific hack I'm not going to bother
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
###############################################################################
|
||||
# Set target properties
|
||||
@@ -67,6 +69,9 @@ PROPERTIES
|
||||
|
||||
###############################################################################
|
||||
# Installation
|
||||
-install (TARGETS ${LIBKEA_LIB_NAME} DESTINATION lib)
|
||||
+install (TARGETS ${LIBKEA_LIB_NAME}
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
install (FILES ${LIBKEA_H} DESTINATION include/libkea)
|
||||
###############################################################################
|
||||
\ No newline at end of file
|
62
ports/kealib/hdf5_include.patch
Normal file
62
ports/kealib/hdf5_include.patch
Normal file
@ -0,0 +1,62 @@
|
||||
index 1f4b1474..40a0f55d 100644
|
||||
--- a/include/libkea/KEAAttributeTable.h
|
||||
+++ b/include/libkea/KEAAttributeTable.h
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <map>
|
||||
#include <math.h>
|
||||
|
||||
-#include "H5Cpp.h"
|
||||
+#include <H5Cpp.h>
|
||||
|
||||
#include "libkea/KEACommon.h"
|
||||
#include "libkea/KEAException.h"
|
||||
|
||||
--- a/include/libkea/KEAAttributeTableFile.h
|
||||
+++ b/include/libkea/KEAAttributeTableFile.h
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#include "H5Cpp.h"
|
||||
+#include <H5Cpp.h>
|
||||
|
||||
#include "libkea/KEACommon.h"
|
||||
#include "libkea/KEAException.h"
|
||||
|
||||
--- a/include/libkea/KEACommon.h
|
||||
+++ b/include/libkea/KEACommon.h
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#include "H5Cpp.h"
|
||||
+#include <H5Cpp.h>
|
||||
|
||||
// mark all exported classes/functions with DllExport to have
|
||||
// them exported by Visual Studio
|
||||
|
||||
--- a/include/libkea/KEAAttributeTableInMem.h
|
||||
+++ b/include/libkea/KEAAttributeTableInMem.h
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#include "H5Cpp.h"
|
||||
+#include <H5Cpp.h>
|
||||
|
||||
#include "libkea/KEACommon.h"
|
||||
#include "libkea/KEAException.h"
|
||||
|
||||
--- a/include/libkea/KEAImageIO.h
|
||||
+++ b/include/libkea/KEAImageIO.h
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#include "H5Cpp.h"
|
||||
+#include <H5Cpp.h>
|
||||
|
||||
#include "libkea/KEACommon.h"
|
||||
#include "libkea/KEAException.h"
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/kealib-1.4.7)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/kealib-1.4.11)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://bitbucket.org/chchrsc/kealib/downloads/kealib-1.4.7.tar.gz"
|
||||
FILENAME "kealib-1.4.7.tar.gz"
|
||||
SHA512 2d58d7d08943d028e19a24f3ad3316a13b4db59be8697cebf30ee621e6bf0a6a47bf61abadd972d6ea7af1c8eed28bba7edf40fb8709fcccc1effbc90ae6e244
|
||||
URLS "https://bitbucket.org/chchrsc/kealib/downloads/kealib-1.4.11.tar.gz"
|
||||
FILENAME "kealib-1.4.11.tar.gz"
|
||||
SHA512 e080dfd51111f85ddf8ab1bd71aaf7ec6cbe814db29ed62806362ef83718f777935347d9063cf29085f21bf09d4277fd88f5269af6555304130f50d093d28f63
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES
|
||||
${CMAKE_CURRENT_LIST_DIR}/fix-cmake.patch
|
||||
hdf5_include.patch
|
||||
)
|
||||
|
||||
if ("parallel" IN_LIST FEATURES)
|
||||
@ -19,20 +19,25 @@ else()
|
||||
set(ENABLE_PARALLEL OFF)
|
||||
endif()
|
||||
|
||||
if(${VCPKG_LIBRARY_LINKAGE} MATCHES "static")
|
||||
set(HDF5_USE_STATIC_LIBRARIES ON)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}/trunk
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DHDF5_PREFER_PARALLEL=${ENABLE_PARALLEL}
|
||||
-DLIBKEA_WITH_GDAL=OFF
|
||||
-DDISABLE_TESTS=ON
|
||||
-DHDF5_USE_STATIC_LIBRARIES=${HDF5_USE_STATIC_LIBRARIES}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(INSTALL ${SOURCE_PATH}/trunk/python/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/kealib RENAME copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/python/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/kealib RENAME copyright)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user