diff options
Diffstat (limited to 'vcpkg/ports/vxl')
| -rw-r--r-- | vcpkg/ports/vxl/cmake-package.diff | 33 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/devendor.diff | 55 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/disable-tests.diff | 15 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/file_formats.diff | 41 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/limits.diff | 12 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/mingw.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/openjpeg.diff | 25 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/portfile.cmake | 98 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/usage | 6 | ||||
| -rw-r--r-- | vcpkg/ports/vxl/vcpkg.json | 46 |
10 files changed, 344 insertions, 0 deletions
diff --git a/vcpkg/ports/vxl/cmake-package.diff b/vcpkg/ports/vxl/cmake-package.diff new file mode 100644 index 0000000..9cb3cc2 --- /dev/null +++ b/vcpkg/ports/vxl/cmake-package.diff @@ -0,0 +1,33 @@ +diff --git a/config/cmake/Modules/UseVXL.cmake b/config/cmake/Modules/UseVXL.cmake +index fba90e4..e7b3b62 100644 +--- a/config/cmake/Modules/UseVXL.cmake ++++ b/config/cmake/Modules/UseVXL.cmake +@@ -77,7 +77,7 @@ if(VXL_CONFIG_CMAKE) + include_directories(SYSTEM ${VXL_VCL_INCLUDE_DIRS} ${VXL_CORE_INCLUDE_DIRS}) + + # Add link directories needed to use VXL. +- link_directories(${VXL_LIBRARY_DIR}) ++ # [vcpkg skip] link_directories(${VXL_LIBRARY_DIR}) + + if(VXL_CMAKE_DOXYGEN_DIR) + # Allow use of VXL's cmake/doxygen framework +diff --git a/config/cmake/Modules/VXLConfig_export.cmake.in b/config/cmake/Modules/VXLConfig_export.cmake.in +index 78eaf51..c69b7d8 100644 +--- a/config/cmake/Modules/VXLConfig_export.cmake.in ++++ b/config/cmake/Modules/VXLConfig_export.cmake.in +@@ -1,6 +1,4 @@ + # vxl/config/cmake/VXLConfig_export.cmake.in +-# also configured by CMake to +-# @PROJECT_BINARY_DIR@/config/cmake/export/VXLConfig.cmake + # + # This CMake module is configured by VXL's build process to export the + # project settings for use by client projects. A client project may +@@ -33,7 +31,7 @@ set(VXL_LIBRARY_DIR "@CMAKE_INSTALL_PREFIX@/lib") + + # The VXL CMake support directory. + # Clients projects should not use the Find*.cmake files in this directory. +-set(VXL_CMAKE_DIR "@CMAKE_INSTALL_PREFIX@/share/vxl/cmake") ++set(VXL_CMAKE_DIR "@CMAKE_INSTALL_PREFIX@/share/vxl") + + # VXL Configuration options. You don't have to build with the same options as VXL, but it often helps. + set(BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") diff --git a/vcpkg/ports/vxl/devendor.diff b/vcpkg/ports/vxl/devendor.diff new file mode 100644 index 0000000..99779b4 --- /dev/null +++ b/vcpkg/ports/vxl/devendor.diff @@ -0,0 +1,55 @@ +diff --git a/config/cmake/Modules/FindGEOTIFF.cmake b/config/cmake/Modules/FindGEOTIFF.cmake +index bcc8fc5..ed9420e 100644 +--- a/config/cmake/Modules/FindGEOTIFF.cmake ++++ b/config/cmake/Modules/FindGEOTIFF.cmake +@@ -18,7 +18,7 @@ if (${VXL_USE_GEOTIFF}) + + # If this FORCE variable is unset or is FALSE, try to find a native library. + if( NOT VXL_FORCE_V3P_GEOTIFF ) +- include( ${MODULE_PATH}/NewCMake/FindGEOTIFF.cmake ) ++ find_package(GeoTIFF CONFIG REQUIRED) + if( GEOTIFF_FOUND ) + set(VXL_USING_NATIVE_GEOTIFF "YES") + endif() +diff --git a/config/cmake/Modules/VXLConfig_export.cmake.in b/config/cmake/Modules/VXLConfig_export.cmake.in +index 86bb564..c69b7d8 100644 +--- a/config/cmake/Modules/VXLConfig_export.cmake.in ++++ b/config/cmake/Modules/VXLConfig_export.cmake.in +@@ -152,6 +152,10 @@ set(VXL_TIFF_INCLUDE_DIR "@TIFF_INCLUDE_DIR@") + set(VXL_TIFF_LIBRARIES "@TIFF_LIBRARIES@") + + set(VXL_GEOTIFF_FOUND "@GEOTIFF_FOUND@") ++if(VXL_GEOTIFF_FOUND) ++ include(CMakeFindDependencyMacro) ++ find_dependency(GeoTIFF CONFIG) ++endif() + set(VXL_GEOTIFF_INCLUDE_DIR "@GEOTIFF_INCLUDE_DIR@") + set(VXL_GEOTIFF_LIBRARIES "@GEOTIFF_LIBRARIES@") + +diff --git a/core/vgl/vgl_clip.hxx b/core/vgl/vgl_clip.hxx +index 9ff64f8..10c986a 100644 +--- a/core/vgl/vgl_clip.hxx ++++ b/core/vgl/vgl_clip.hxx +@@ -144,7 +144,7 @@ namespace { + + #elif HAS_CLIPPER + +-#include <clipper.hxx> ++#include <clipper.hpp> + + namespace { + //: Creates a Clipper polygon from a vgl_polygon. +diff --git a/v3p/CMakeLists.txt b/v3p/CMakeLists.txt +index 251ef9a..78a84fc 100644 +--- a/v3p/CMakeLists.txt ++++ b/v3p/CMakeLists.txt +@@ -48,6 +48,9 @@ CMAKE_DEPENDENT_OPTION( VXL_FORCE_V3P_RPLY "Use V3P instead of any native RPLY l + mark_as_advanced( VXL_FORCE_V3P_RPLY ) + + if(VXL_BUILD_CORE_IMAGING) ++ add_subdirectory(openjpeg2) ++elseif(0) ++ # not used by core and vcl + include(${VXL_CMAKE_DIR}/FindZLIB.cmake) + if (VXL_FORCE_V3P_ZLIB OR ( NOT VXL_USING_NATIVE_ZLIB ) AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/zlib) + add_subdirectory(zlib) diff --git a/vcpkg/ports/vxl/disable-tests.diff b/vcpkg/ports/vxl/disable-tests.diff new file mode 100644 index 0000000..cc94aec --- /dev/null +++ b/vcpkg/ports/vxl/disable-tests.diff @@ -0,0 +1,15 @@ +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 581d00b..336f170 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -135,7 +135,9 @@ else() + endif () + + # common test executable +-add_subdirectory(testlib) ++if(BUILD_TESTING) ++ add_subdirectory(testlib) ++endif() + + # Tests that check and output the vxl configuration + # NOTE: some external projects remove the tests directory (aka ITK) diff --git a/vcpkg/ports/vxl/file_formats.diff b/vcpkg/ports/vxl/file_formats.diff new file mode 100644 index 0000000..6945515 --- /dev/null +++ b/vcpkg/ports/vxl/file_formats.diff @@ -0,0 +1,41 @@ +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 88daf27..a47c183 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -60,6 +60,10 @@ if(VXL_BUILD_CORE_IMAGING) + if(VXL_BUILD_CORE_NUMERICS) + add_subdirectory (vil/algo) + endif() ++else() ++ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/vil) ++ file(WRITE ${PROJECT_BINARY_DIR}/vil/vil_config.h "/* core imaging disabled */") ++ install(FILES ${PROJECT_BINARY_DIR}/vil/vil_config.h DESTINATION include/vxl/core/vil) + endif() + + +diff --git a/core/vpgl/algo/CMakeLists.txt b/core/vpgl/algo/CMakeLists.txt +index 9ec767a..fda53dc 100644 +--- a/core/vpgl/algo/CMakeLists.txt ++++ b/core/vpgl/algo/CMakeLists.txt +@@ -32,7 +32,7 @@ set( vpgl_algo_sources + vpgl_equi_rectification.h vpgl_equi_rectification.cxx + ) + include(${VXL_CMAKE_DIR}/FindTIFF.cmake) +-if(TIFF_FOUND) ++if(VXL_BUILD_CORE_IMAGING) + include_directories(${TIFF_INCLUDE_DIR}) + include( ${VXL_CMAKE_DIR}/FindGEOTIFF.cmake) + if(GEOTIFF_FOUND) +diff --git a/core/vpgl/file_formats/CMakeLists.txt b/core/vpgl/file_formats/CMakeLists.txt +index d23a2f2..6c933f0 100644 +--- a/core/vpgl/file_formats/CMakeLists.txt ++++ b/core/vpgl/file_formats/CMakeLists.txt +@@ -9,7 +9,7 @@ set( vpgl_file_formats_sources + ) + + include(${VXL_CMAKE_DIR}/FindTIFF.cmake) +-if(TIFF_FOUND) ++if(VXL_BUILD_CORE_IMAGING) + include_directories(${TIFF_INCLUDE_DIR}) + include( ${VXL_CMAKE_DIR}/FindGEOTIFF.cmake) + if(GEOTIFF_FOUND) diff --git a/vcpkg/ports/vxl/limits.diff b/vcpkg/ports/vxl/limits.diff new file mode 100644 index 0000000..3299f4f --- /dev/null +++ b/vcpkg/ports/vxl/limits.diff @@ -0,0 +1,12 @@ +diff --git a/core/vnl/vnl_bignum.cxx b/core/vnl/vnl_bignum.cxx +index b615a9b..741bd43 100644 +--- a/core/vnl/vnl_bignum.cxx ++++ b/core/vnl/vnl_bignum.cxx +@@ -6,6 +6,7 @@ + #include <algorithm> + #include <vector> + #include <iostream> ++#include <limits> + #include "vnl_bignum.h" + //: + // \file diff --git a/vcpkg/ports/vxl/mingw.diff b/vcpkg/ports/vxl/mingw.diff new file mode 100644 index 0000000..134c96f --- /dev/null +++ b/vcpkg/ports/vxl/mingw.diff @@ -0,0 +1,13 @@ +diff --git a/core/vul/vul_temp_filename.cxx b/core/vul/vul_temp_filename.cxx +index 4921a04..731fee0 100644 +--- a/core/vul/vul_temp_filename.cxx ++++ b/core/vul/vul_temp_filename.cxx +@@ -11,7 +11,7 @@ + + #if defined(_MSC_VER) || defined(__MINGW32__) + +-# include <Windows.h> ++# include <windows.h> + #else + # if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) + // Helper functions for Unix diff --git a/vcpkg/ports/vxl/openjpeg.diff b/vcpkg/ports/vxl/openjpeg.diff new file mode 100644 index 0000000..af2d15f --- /dev/null +++ b/vcpkg/ports/vxl/openjpeg.diff @@ -0,0 +1,25 @@ +diff --git a/config/cmake/Modules/FindOpenJPEG2.cmake b/config/cmake/Modules/FindOpenJPEG2.cmake +index c76bc44..41dc198 100644 +--- a/config/cmake/Modules/FindOpenJPEG2.cmake ++++ b/config/cmake/Modules/FindOpenJPEG2.cmake +@@ -62,6 +62,8 @@ set(OPENJPEG2_DEFINITIONS "") + + if(OPENJPEG2_FOUND) + set(VXL_USING_NATIVE_OPENJPEG2 "YES") ++elseif(NOT ENABLE_OPENJPEG) ++ set(VXL_USING_NATIVE_OPENJPEG2 "YES") # to disable internal lib, too + else() + if( EXISTS ${VXL_ROOT_SOURCE_DIR}/v3p/openjpeg2/openjpeg.h) + set(OPENJPEG2_FOUND TRUE) +diff --git a/v3p/openjpeg2/CMakeLists.txt b/v3p/openjpeg2/CMakeLists.txt +index 67b184e..354180b 100644 +--- a/v3p/openjpeg2/CMakeLists.txt ++++ b/v3p/openjpeg2/CMakeLists.txt +@@ -49,6 +49,7 @@ if(VXL_MATH_LIBRARY_FOUND) + endif() + mark_as_advanced(VXL_MATH_LIBRARY_FOUND) + set_target_properties(openjpeg2 PROPERTIES ++ OUTPUT_NAME vxl_openjpeg + VERSION 2.0.0 + DEFINE_SYMBOL OPJ_EXPORTS) + endif() diff --git a/vcpkg/ports/vxl/portfile.cmake b/vcpkg/ports/vxl/portfile.cmake new file mode 100644 index 0000000..baabb93 --- /dev/null +++ b/vcpkg/ports/vxl/portfile.cmake @@ -0,0 +1,98 @@ +if(VCPKG_TARGET_IS_WINDOWS) + # Cf. https://vxl.github.io/vxl-users-faq.html + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO vxl/vxl + REF v${VERSION} + SHA512 0b33e12557315058e7786c2049af3b01f1208e50660ccbc45f4d9a4dba4eeadfa5e3125380d8781eed2a9abf1d153ffb71c416ed2d196ab4194f5b3722fe6f2b + HEAD_REF master + PATCHES + cmake-package.diff + devendor.diff + disable-tests.diff + file_formats.diff + limits.diff + mingw.diff + openjpeg.diff +) +file(GLOB_RECURSE vendored_sources "${SOURCE_PATH}/v3p/*.c" "${SOURCE_PATH}/v3p/*.cpp" "${SOURCE_PATH}/v3p/*.cxx") +list(FILTER vendored_sources EXCLUDE REGEX "/(netlib|openjpeg2)/") +file(REMOVE_RECURSE ${vendored_sources}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + core-imaging VXL_BUILD_CORE_IMAGING + openjpeg ENABLE_OPENJPEG +) + +if(VCPKG_TARGET_IS_MINGW) + list(APPEND options -DVXL_HAS_DBGHELP_H=FALSE) # needs patches +endif() + +set(USE_WIN_WCHAR_T OFF) +if(VCPKG_TARGET_IS_WINDOWS) + set(USE_WIN_WCHAR_T ON) +endif() + +# Avoid try-run which doesn't work for cross-builds. +# Users may override with VCPKG_CMAKE_CONFIGURE_OPTIONS. +string(COMPARE EQUAL "${VCPKG_TARGET_ARCHITECTURE}" "x64" VXL_HAS_SSE2_HARDWARE_SUPPORT) +set(VCL_HAS_LFS ON) +if(VCPKG_TARGET_IS_WINDOWS) + set(VCL_HAS_LFS OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + -DBUILD_TESTING=OFF + -DCMAKE_POLICY_DEFAULT_CMP0120=OLD # vxl needs WriteCompilerDetectionHeader + -DVCL_HAS_LFS=${VCL_HAS_LFS} + -DVXL_BUILD_CONTRIB=OFF + -DVXL_BUILD_EXAMPLES=OFF + -DVXL_HAS_SSE2_HARDWARE_SUPPORT=${VXL_HAS_SSE2_HARDWARE_SUPPORT} + -DVXL_FORCE_V3P_BZLIB2=OFF + -DVXL_FORCE_V3P_CLIPPER=OFF + -DVXL_FORCE_V3P_DCMTK=OFF + -DVXL_FORCE_V3P_GEOTIFF=OFF + -DVXL_FORCE_V3P_J2K=OFF + -DVXL_FORCE_V3P_JPEG=OFF + -DVXL_FORCE_V3P_OPENJPEG2=ON # vendored 1.2; vxl needs old API. + -DVXL_FORCE_V3P_PNG=OFF + -DVXL_FORCE_V3P_TIFF=OFF + -DVXL_FORCE_V3P_ZLIB=OFF + -DVXL_USE_DCMTK=OFF + -DVXL_USE_GEOTIFF=ON + -DVXL_USE_WIN_WCHAR_T=${USE_WIN_WCHAR_T} + MAYBE_UNUSED_VARIABLES + ENABLE_OPENJPEG + VXL_USE_DCMTK +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH share/vxl/cmake) +vcpkg_copy_pdbs() + +file(COPY "${SOURCE_PATH}/vcl/vcl_msvc_warnings.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vxl/vcl") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +# Don't provide source dir; test lib not installed. +file(REMOVE "${CURRENT_PACKAGES_DIR}/include/vxl/vcl/vcl_where_root_dir.h") + +file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +set(file_list "${SOURCE_PATH}/core/vxl_copyright.h") +if("openjpeg" IN_LIST FEATURES) + file(COPY_FILE "${SOURCE_PATH}/v3p/openjpeg2/license.txt" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openjpeg2 license.txt") + vcpkg_list(APPEND file_list "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/openjpeg2 license.txt") +endif() +vcpkg_install_copyright(FILE_LIST ${file_list} COMMENT [[ +vcl includes Netlib software from https://www.netlib.org/. Most netlib software +packages have no restrictions on their use but it is recommended to check with +the authors to be sure. (https://www.netlib.org/misc/faq.html#2.3) +]]) diff --git a/vcpkg/ports/vxl/usage b/vcpkg/ports/vxl/usage new file mode 100644 index 0000000..137f497 --- /dev/null +++ b/vcpkg/ports/vxl/usage @@ -0,0 +1,6 @@ +vxl provides CMake targets: + + find_package(VXL CONFIG REQUIRED) + include("${VXL_CMAKE_DIR}/UseVXL.cmake") + # Example: numerics library 'vnl'. + target_link_libraries(main PRIVATE $<TARGET_NAME:vnl>) diff --git a/vcpkg/ports/vxl/vcpkg.json b/vcpkg/ports/vxl/vcpkg.json new file mode 100644 index 0000000..89ef75c --- /dev/null +++ b/vcpkg/ports/vxl/vcpkg.json @@ -0,0 +1,46 @@ +{ + "name": "vxl", + "version": "3.5.0", + "description": "A multi-platform collection of C++ software libraries for Computer Vision and Image Understanding.", + "homepage": "https://vxl.github.io/", + "license": null, + "supports": "!uwp", + "dependencies": [ + "libgeotiff", + "libjpeg-turbo", + "libpng", + "polyclipping", + { + "name": "tiff", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "core-imaging": { + "description": "core-imaging support for vxl" + }, + "openjpeg": { + "description": [ + "OpenJPEG support", + "This feature uses vendored copy of openjpeg 1.2.0 and cannot be used together with port 'openjpeg'." + ], + "license": "BSD-2-Clause", + "dependencies": [ + { + "name": "vxl", + "features": [ + "core-imaging" + ] + } + ] + } + } +} |