diff --git a/docs/maintainers/vcpkg_configure_cmake.md b/docs/maintainers/vcpkg_configure_cmake.md index fd434cf220bc81..54f09f825cf376 100644 --- a/docs/maintainers/vcpkg_configure_cmake.md +++ b/docs/maintainers/vcpkg_configure_cmake.md @@ -11,6 +11,9 @@ Configure CMake for Debug and Release builds of a project. vcpkg_configure_cmake( SOURCE_PATH <${SOURCE_PATH}> [PREFER_NINJA] + [REQUIRE_ALL_PACKAGES] + [OPTIONAL_PACKAGES ...] + [DISABLE_PACKAGES ...] [DISABLE_PARALLEL_CONFIGURE] [NO_CHARSET_FLAG] [GENERATOR <"NMake Makefiles">] diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL deleted file mode 100644 index d903f6472ed481..00000000000000 --- a/ports/armadillo/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: armadillo -Version: 10.2.0 -Homepage: http://arma.sourceforge.net -Description: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use -Build-Depends: blas, lapack diff --git a/ports/armadillo/portfile.cmake b/ports/armadillo/portfile.cmake index bc275cb66a478c..b294d5fb5274d9 100644 --- a/ports/armadillo/portfile.cmake +++ b/ports/armadillo/portfile.cmake @@ -18,15 +18,11 @@ file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindOpenBLAS.cmake) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES SuperLU ACML ACMLMP ARPACK ATLAS MKL PkgConfig PREFER_NINJA OPTIONS -DDETECT_HDF5=false - -DCMAKE_DISABLE_FIND_PACKAGE_SuperLU=ON - -DCMAKE_DISABLE_FIND_PACKAGE_ACML=ON - -DCMAKE_DISABLE_FIND_PACKAGE_ACMLMP=ON - -DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON - -DCMAKE_DISABLE_FIND_PACKAGE_ATLAS=ON - -DCMAKE_DISABLE_FIND_PACKAGE_MKL=ON ) vcpkg_install_cmake() diff --git a/ports/armadillo/vcpkg.json b/ports/armadillo/vcpkg.json new file mode 100644 index 00000000000000..c029f730890df9 --- /dev/null +++ b/ports/armadillo/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "armadillo", + "version": "10.2.0", + "port-version": 1, + "description": "Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use", + "homepage": "http://arma.sourceforge.net", + "dependencies": [ + "blas", + "lapack" + ] +} diff --git a/ports/cppkafka/CONTROL b/ports/cppkafka/CONTROL deleted file mode 100644 index 5dec433ef6ea4d..00000000000000 --- a/ports/cppkafka/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: cppkafka -Version: 0.3.1-2 -Homepage: https://github.com/mfontanini/cppkafka -Description: cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum. -Build-Depends: boost-program-options, librdkafka diff --git a/ports/cppkafka/portfile.cmake b/ports/cppkafka/portfile.cmake index ccaee4ed4dcc48..55bdbc47f5f083 100644 --- a/ports/cppkafka/portfile.cmake +++ b/ports/cppkafka/portfile.cmake @@ -16,7 +16,9 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES Doxygen + OPTIONS -DCPPKAFKA_BUILD_SHARED=${CPPKAFKA_BUILD_SHARED} -DCPPKAFKA_DISABLE_TESTS=ON -DCPPKAFKA_DISABLE_EXAMPLES=ON diff --git a/ports/cppkafka/vcpkg.json b/ports/cppkafka/vcpkg.json new file mode 100644 index 00000000000000..8769a03085bbfe --- /dev/null +++ b/ports/cppkafka/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "cppkafka", + "version": "0.3.1", + "port-version": 3, + "description": "cppkafka allows C++ applications to consume and produce messages using the Apache Kafka protocol. The library is built on top of librdkafka, and provides a high level API that uses modern C++ features to make it easier to write code while keeping the wrapper's performance overhead to a minimum.", + "homepage": "https://github.com/mfontanini/cppkafka", + "dependencies": [ + "boost-program-options", + "librdkafka" + ] +} diff --git a/ports/gdal/gdal-config.in.cmake b/ports/gdal/gdal-config.in.cmake new file mode 100644 index 00000000000000..ca2b954a8ca420 --- /dev/null +++ b/ports/gdal/gdal-config.in.cmake @@ -0,0 +1,45 @@ +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" DIRECTORY) + +add_library(GDAL::GDAL UNKNOWN IMPORTED) + +set(GDAL_INCLUDE_DIRS "${_IMPORT_PREFIX}/include") +set(GDAL_INCLUDE_DIR "${GDAL_INCLUDE_DIRS}" CACHE STRING "") + +find_library(GDAL_LIBRARY_RELEASE NAMES gdal_i gdal PATHS "${_IMPORT_PREFIX}/lib" NO_DEFAULT_PATH REQUIRED) +set(GDAL_LIBRARIES optimized "${GDAL_LIBRARY_RELEASE}") +set_property(TARGET GDAL::GDAL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties( + GDAL::GDAL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIRS}" + IMPORTED_LOCATION_RELEASE "${GDAL_LIBRARY_RELEASE}" +) + +find_library(GDAL_LIBRARY_DEBUG NAMES gdal_i_d gdal_d gdal_i gdal PATHS "${_IMPORT_PREFIX}/debug/lib" NO_DEFAULT_PATH) +if(GDAL_LIBRARY_DEBUG) + set_property(TARGET GDAL::GDAL APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties( + GDAL::GDAL PROPERTIES + IMPORTED_LOCATION_DEBUG "${GDAL_LIBRARY_DEBUG}" + ) + list(APPEND GDAL_LIBRARIES debug "${GDAL_LIBRARY_DEBUG}") +endif() + +include(CMakeFindDependencyMacro) + +find_dependency(geos CONFIG) +set_property(TARGET GDAL::GDAL APPEND PROPERTY INTERFACE_LINK_LIBRARIES GEOS::geos_c GEOS::geos) + +find_dependency(OpenJPEG CONFIG) +set_property(TARGET GDAL::GDAL APPEND PROPERTY INTERFACE_LINK_LIBRARIES openjp2) + +if(@DEPENDENCY_TIFF@) + find_dependency(TIFF) + set_property(TARGET GDAL::GDAL APPEND PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF) +endif() + +find_dependency(geotiff CONFIG) +set_property(TARGET GDAL::GDAL APPEND PROPERTY INTERFACE_LINK_LIBRARIES geotiff_library) + +find_dependency(LibXml2) +set_property(TARGET GDAL::GDAL APPEND PROPERTY INTERFACE_LINK_LIBRARIES LibXml2::LibXml2) diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 2f2cae4bb8aeeb..31f0d25c0eb211 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -27,6 +27,8 @@ vcpkg_extract_source_archive_ex( PATCHES ${GDAL_PATCHES} ) +set(DEPENDENCY_TIFF OFF) + if (VCPKG_TARGET_IS_WINDOWS) set(NATIVE_DATA_DIR "${CURRENT_PACKAGES_DIR}/share/gdal") set(NATIVE_HTML_DIR "${CURRENT_PACKAGES_DIR}/share/gdal/html") @@ -183,32 +185,140 @@ else() set(BUILD_DYNAMIC no) set(BUILD_STATIC yes) endif() - - set(CONF_OPTS --enable-shared=${BUILD_DYNAMIC} --enable-static=${BUILD_STATIC}) - list(APPEND CONF_OPTS --with-proj=${CURRENT_INSTALLED_DIR} --with-libjson-c=${CURRENT_INSTALLED_DIR} --without-freexl) - list(APPEND CONF_OPTS --without-jasper) - + + vcpkg_find_acquire_program(PKGCONFIG) + + set(backup_PKG_CONFIG_PATH "$ENV{PKG_CONFIG_PATH}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + execute_process( + COMMAND "${PKGCONFIG}" --libs libtiff-4 libxml-2.0 libpng json-c netcdf libopenjp2 geos expat cfitsio + OUTPUT_VARIABLE release_libs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig${VCPKG_HOST_PATH_SEPARATOR}${backup_PKG_CONFIG_PATH}") + execute_process( + COMMAND "${PKGCONFIG}" --libs libtiff-4 libxml-2.0 libpng json-c netcdf libopenjp2 geos expat cfitsio + OUTPUT_VARIABLE debug_libs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(ENV{PKG_CONFIG_PATH} "${backup_PKG_CONFIG_PATH}") + + # This is required to link proj4 statically. + if(VCPKG_TARGET_IS_OSX) + set(cppstdlib c++) + else() + set(cppstdlib stdc++) + endif() + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG COPY_SOURCE - OPTIONS ${CONF_OPTS} + OPTIONS_RELEASE + "LIBS=${release_libs} -l${cppstdlib} -lm -lpthread" OPTIONS_DEBUG --enable-debug - --without-fit # Disable cfitsio temporary + "LIBS=${debug_libs} -l${cppstdlib} -lm -lpthread" + OPTIONS + HAVE_GEOS=yes + HAVE_EXPAT=yes + --enable-shared=${BUILD_DYNAMIC} + --enable-static=${BUILD_STATIC} + --with-proj=${CURRENT_INSTALLED_DIR} + --with-liblzma=${CURRENT_INSTALLED_DIR} + --without-zstd + --without-pg + --without-grass + --without-libgrass + --with-cfitsio=${CURRENT_INSTALLED_DIR} + --with-pcraster=internal + --with-png=${CURRENT_INSTALLED_DIR} + --without-dds + --without-gta + --with-pcidsk=internal + --with-libtiff=${CURRENT_INSTALLED_DIR} + --with-geotiff=${CURRENT_INSTALLED_DIR} + --with-jpeg=${CURRENT_INSTALLED_DIR} + --without-charls + --without-jpeg12 + --with-gif=internal + --without-ogdi + --without-fme + --without-sosi + --without-mongocxx + --without-boost-lib-path + --without-mongocxxv3 + --without-hdf4 + --without-hdf5 + --without-kea + --with-netcdf=${CURRENT_INSTALLED_DIR} + --without-jasper + --with-openjpeg=${CURRENT_INSTALLED_DIR} + --without-fgdb + --without-ecw + --without-kakadu + --without-mrsid + --without-jp2mrsid + --without-mrsid_lidar + --without-j2lua + --without-msg + --without-oci + --without-mysql + --without-ingres + --without-xerces + --with-expat + --without-libkml + --without-odbc + --without-dods-root + --without-curl + --with-xml2=yes + --without-spatialite + --with-sqlite3=yes + --without-rasterlite2 + --without-pcre + --without-teigha + --without-idb + --without-sde + --without-epsilon + --without-webp + --with-geos=yes + --without-qhull + --without-opencl + --without-freexl + --with-libjson-c=${CURRENT_INSTALLED_DIR} + --without-pam + --without-poppler + --without-podofo + --without-pdfium + --without-perl + --without-python + --without-java + --without-hdfs + --without-tiledb + --without-mdb + --without-rasdaman + --without-rdb + --without-armadillo + --without-cryptopp + --with-cypto=no + --without-lerc + --without-exr ) - + vcpkg_install_make(MAKEFILE GNUmakefile) - + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/gdalplugins ${CURRENT_PACKAGES_DIR}/debug/lib/gdalplugins ${CURRENT_PACKAGES_DIR}/debug/share ) + + set(DEPENDENCY_TIFF ON) endif() file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +configure_file(${CMAKE_CURRENT_LIST_DIR}/gdal-config.in.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/gdal-config.cmake @ONLY) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/gdal/usage b/ports/gdal/usage index 63a67bc07d0748..9540d06e8bb95a 100644 --- a/ports/gdal/usage +++ b/ports/gdal/usage @@ -1,5 +1,4 @@ -The package GDAL provides CMake targets: +The package gdal:@TARGET_TRIPLET@ is compatible with built-in CMake Targets: find_package(GDAL REQUIRED) - target_include_directories(main PRIVATE ${GDAL_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${GDAL_LIBRARIES}) + target_link_libraries(main PRIVATE GDAL::GDAL) diff --git a/ports/gdal/vcpkg-cmake-wrapper.cmake b/ports/gdal/vcpkg-cmake-wrapper.cmake index 30c3b5a6675254..94af00a4cfe24f 100644 --- a/ports/gdal/vcpkg-cmake-wrapper.cmake +++ b/ports/gdal/vcpkg-cmake-wrapper.cmake @@ -1,12 +1 @@ -include(FindPackageHandleStandardArgs) -include(SelectLibraryConfigurations) - -find_path(GDAL_INCLUDE_DIR NAMES gdal.h HINTS ${CURRENT_INSTALLED_DIR}) - -find_library(GDAL_LIBRARY_DEBUG NAMES gdal_d gdal_i_d gdal NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) -find_library(GDAL_LIBRARY_RELEASE NAMES gdal_i gdal NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) - -select_library_configurations(GDAL) - -set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR}) -set(GDAL_LIBRARIES ${GDAL_LIBRARY}) +_find_package(${ARGS} CONFIG) diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index f04c0356296cd3..86b0ced805ec63 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,29 +1,51 @@ { "name": "gdal", - "version-string": "3.1.3", - "port-version": 3, + "version-semver": "3.1.3", + "port-version": 4, "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data.", - "homepage": "hhttps://gdal.org/", + "homepage": "https://gdal.org/", "dependencies": [ - "cfitsio", - "curl", - "expat", + { + "name": "curl", + "platform": "windows" + }, + { + "name": "expat", + "platform": "windows" + }, "geos", - "hdf5", + { + "name": "hdf5", + "platform": "windows" + }, { "name": "json-c", "platform": "!windows" }, "libgeotiff", + { + "name": "libjpeg-turbo", + "platform": "!windows" + }, "liblzma", "libpng", - "libpq", - "libwebp", + { + "name": "libpq", + "platform": "windows" + }, + { + "name": "libwebp", + "platform": "windows" + }, "libxml2", "netcdf-c", "openjpeg", "proj4", "sqlite3", + { + "name": "tiff", + "platform": "!windows" + }, "zlib" ], "features": { diff --git a/ports/geos/CONTROL b/ports/geos/CONTROL deleted file mode 100644 index c3ed21e0f5d4e8..00000000000000 --- a/ports/geos/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: geos -Version: 3.9.1 -Homepage: https://www.osgeo.org/projects/geos/ -Description: Geometry Engine Open Source diff --git a/ports/geos/pc.patch b/ports/geos/pc.patch new file mode 100644 index 00000000000000..086dce5ed28916 --- /dev/null +++ b/ports/geos/pc.patch @@ -0,0 +1,23 @@ +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 8a81a2a..b3e3da1 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -12,7 +12,7 @@ + ################################################################################# + + +-if(NOT MSVC) ++if(TRUE) + # Consider CMAKE_INSTALL_PREFIX with spaces + string(REPLACE " " "\\ " ESCAPED_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + configure_file( +diff --git a/tools/geos.pc.cmake b/tools/geos.pc.cmake +index 0a9df7f..443b770 100644 +--- a/tools/geos.pc.cmake ++++ b/tools/geos.pc.cmake +@@ -8,4 +8,4 @@ Description: Geometry Engine, Open Source - C API + Requires: + Version: @GEOS_VERSION@ + Cflags: -I${includedir} +-Libs: -L${libdir} -lgeos_c ++Libs: -L${libdir} -lgeos_c@CMAKE_DEBUG_POSTFIX@ -lgeos@CMAKE_DEBUG_POSTFIX@ diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake index f5b9c21ac2f6af..0425eb4f20b804 100644 --- a/ports/geos/portfile.cmake +++ b/ports/geos/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_extract_source_archive_ex( PATCHES dont-build-docs.patch dont-build-astyle.patch + pc.patch ) # NOTE: GEOS provides CMake as optional build configuration, it might not be actively @@ -27,25 +28,25 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCMAKE_DEBUG_POSTFIX=d -DBUILD_TESTING=OFF ${_CMAKE_EXTRA_OPTIONS} + OPTIONS_DEBUG + -DCMAKE_DEBUG_POSTFIX=d ) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GEOS) +vcpkg_fixup_pkgconfig() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/geos) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/geos-config ${CURRENT_PACKAGES_DIR}/share/geos/geos-config) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/geos-config) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/geos-config) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/geos) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/geos-config ${CURRENT_PACKAGES_DIR}/share/geos/geos-config) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/geos-config) -endif() - # Handle copyright configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/geos/copyright COPYONLY) diff --git a/ports/geos/vcpkg.json b/ports/geos/vcpkg.json new file mode 100644 index 00000000000000..5a4b98d3118b61 --- /dev/null +++ b/ports/geos/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "geos", + "version-semver": "3.9.1", + "port-version": 1, + "description": "Geometry Engine Open Source", + "homepage": "https://www.osgeo.org/projects/geos/" +} diff --git a/ports/libsndfile/portfile.cmake b/ports/libsndfile/portfile.cmake index ad84e3315b43ad..5bcb6767f20ab3 100644 --- a/ports/libsndfile/portfile.cmake +++ b/ports/libsndfile/portfile.cmake @@ -14,9 +14,16 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES external-libs ENABLE_EXTERNAL_LIBS ) +set(DISABLE_PACKAGES) +if(NOT "external-libs" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Ogg Vorbis FLAC Opus) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES Speex SQLite3 ALSA Sndio ${DISABLE_PACKAGES} OPTIONS -DBUILD_EXAMPLES=OFF -DBUILD_REGTEST=OFF diff --git a/ports/libsndfile/vcpkg.json b/ports/libsndfile/vcpkg.json index e0d0acc68c3ae2..dbfa047e7e08f7 100644 --- a/ports/libsndfile/vcpkg.json +++ b/ports/libsndfile/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libsndfile", - "version-string": "1.0.31", + "version": "1.0.31", + "port-version": 1, "description": "Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo", "homepage": "https://github.com/erikd/libsndfile", "license": "LGPL-2.1", diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index 8130761ece9813..7d5b6562525d45 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -30,6 +30,20 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(LINK_ICONV "-liconv") +else() + set(LINK_ICONV) +endif() + +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libxml-2.0.pc "Requires:" "Requires: liblzma zlib") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libxml-2.0.pc " -lxml2" " -lxml2 ${LINK_ICONV} -lm") +endif() +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libxml-2.0.pc "Requires:" "Requires: liblzma zlib") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libxml-2.0.pc " -lxml2" " -lxml2 ${LINK_ICONV} -lm") +endif() vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() diff --git a/ports/libxml2/usage b/ports/libxml2/usage index fd94c4b4e442da..c7a4878e9b9601 100644 --- a/ports/libxml2/usage +++ b/ports/libxml2/usage @@ -1,5 +1,4 @@ The package libxml2 is compatible with built-in CMake targets: find_package(LibXml2 REQUIRED) - target_include_directories(main PRIVATE ${LIBXML2_INCLUDE_DIR}) - target_link_libraries(main PRIVATE ${LIBXML2_LIBRARIES}) + target_link_libraries(main PRIVATE LibXml2::LibXml2) diff --git a/ports/libxml2/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake index 405b94670762ea..f7f76c6be23552 100644 --- a/ports/libxml2/vcpkg-cmake-wrapper.cmake +++ b/ports/libxml2/vcpkg-cmake-wrapper.cmake @@ -30,4 +30,7 @@ if(LibXml2_FOUND) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") list(APPEND LIBXML2_LIBRARIES ws2_32) endif() + if(TARGET LibXml2::LibXml2) + target_link_libraries(LibXml2::LibXml2 INTERFACE LibLZMA::LibLZMA ZLIB::ZLIB) + endif() endif() diff --git a/ports/libxml2/vcpkg.json b/ports/libxml2/vcpkg.json index c5ac7c0fd32aa1..02791cc416ddf6 100644 --- a/ports/libxml2/vcpkg.json +++ b/ports/libxml2/vcpkg.json @@ -1,8 +1,8 @@ { "name": "libxml2", "version-semver": "2.9.10", - "port-version": 3, - "description": "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform).", + "port-version": 4, + "description": "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform)", "homepage": "https://xmlsoft.org/", "dependencies": [ "libiconv", diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL deleted file mode 100644 index e424e6cad08e57..00000000000000 --- a/ports/mlpack/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: mlpack -Version: 3.4.1 -Homepage: https://github.com/mlpack/mlpack -Description: mlpack is a fast, flexible machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms. -Build-Depends: boost, armadillo, ensmallen, stb -Supports: !uwp - -Feature: tools -Description: Build command-line executables. diff --git a/ports/mlpack/portfile.cmake b/ports/mlpack/portfile.cmake index bfc30ace794be9..5f958d48126fc9 100644 --- a/ports/mlpack/portfile.cmake +++ b/ports/mlpack/portfile.cmake @@ -23,15 +23,24 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS tools BUILD_CLI_EXECUTABLES ) +if(VCPKG_TARGET_IS_OSX) + # find_package(OpenMP) fails on OSX + set(USE_OPENMP OFF) +else() + set(USE_OPENMP ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES Julia Go Gonum R Doxygen Git PkgConfig PREFER_NINJA OPTIONS + -DUSE_OPENMP=${USE_OPENMP} -DBUILD_TESTS=OFF -DDOWNLOAD_STB_IMAGE=OFF -DDOWNLOAD_ENSMALLEN=OFF -DBUILD_PYTHON_BINDINGS=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON ${FEATURE_OPTIONS} ) vcpkg_install_cmake() diff --git a/ports/mlpack/vcpkg.json b/ports/mlpack/vcpkg.json new file mode 100644 index 00000000000000..114f5856b4f804 --- /dev/null +++ b/ports/mlpack/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "mlpack", + "version": "3.4.1", + "port-version": 1, + "description": "mlpack is a fast, flexible machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms.", + "homepage": "https://github.com/mlpack/mlpack", + "supports": "!uwp", + "dependencies": [ + "armadillo", + "boost", + "ensmallen", + "stb" + ], + "features": { + "tools": { + "description": "Build command-line executables." + } + } +} diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 6885513baf36b9..4fcd9aff825ff8 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -42,7 +42,13 @@ vcpkg_fixup_cmake_targets() if(VCPKG_TARGET_IS_WINDOWS) # TODO: remove -lm from *.pc files endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libopenjp2.pc " -lm" " -lm -lpthread") +endif() +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libopenjp2.pc " -lm" " -lm -lpthread") +endif() +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/openjpeg/vcpkg.json b/ports/openjpeg/vcpkg.json index d54e271dc259ff..f910c2cc4d62ad 100644 --- a/ports/openjpeg/vcpkg.json +++ b/ports/openjpeg/vcpkg.json @@ -1,7 +1,7 @@ { "name": "openjpeg", "version-semver": "2.3.1", - "port-version": 3, + "port-version": 4, "description": "OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, a still-image compression standard from the Joint Photographic Experts Group (JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference Software.", "homepage": "https://github.com/uclouvain/openjpeg", "features": { diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index a05f5abe7116e1..82fb5448e1fa07 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -2,8 +2,10 @@ Source: osg Version: 3.6.5 Port-Version: 7 Homepage: https://github.com/openscenegraph/OpenSceneGraph -Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. -Build-Depends: zlib, fontconfig (!windows), expat (windows), openimageio (osx) +Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. +Build-Depends: zlib, openimageio (osx), opengl +Default-Features: default-features +Supports: !uwp Feature: collada Description: Support for Collada (.dae) files @@ -11,15 +13,47 @@ Build-Depends: collada-dom Feature: tools Description: Enable to build OSG Applications (e.g. osgviewer) -Build-Depends: freetype, sdl1, curl, libjpeg-turbo, libpng, libiconv (windows) +Build-Depends: osg[core,freetype,sdl1,curl,jpeg,png], expat (windows), libiconv (windows) Feature: examples Description: Enable to build OSG Examples -Build-Depends: freetype, sdl1, sdl2, libiconv (windows) +Build-Depends: osg[core,freetype,sdl1], sdl2 Feature: plugins Description: Build OSG Plugins - Disable for compile testing examples on a time limit -Build-Depends: freetype, sdl1, curl, openexr, ilmbase, gdal, giflib (windows), jasper, libjpeg-turbo, libpng, tiff, libxml2 (windows), libiconv (windows), libgta, liblas, nvtt (!x86), coin, boost-asio (!windows), boost-core (!windows), boost-logic (!windows), boost-lexical-cast (!windows), boost-smart-ptr (!windows), boost-tuple (!windows), boost-bind (!windows) +Build-Depends: osg[core,freetype,sdl1,curl,jpeg,png], openexr, ilmbase, gdal, giflib (windows), jasper, tiff, libxml2 (windows), libgta, coin + +Feature: default-features +Description: Set of default features for osg +Build-Depends: osg[core,fontconfig] (linux) + +Feature: fontconfig +Description: Build with fontconfig support +Build-Depends: fontconfig + +Feature: freetype +Description: Build with freetype support +Build-Depends: freetype + +Feature: sdl1 +Description: Build with SDL1 support +Build-Depends: sdl1 + +Feature: curl +Description: Build with curl support +Build-Depends: curl + +Feature: jpeg +Description: Build with libjpeg-turbo support +Build-Depends: libjpeg-turbo + +Feature: png +Description: Build with libpng support +Build-Depends: libpng + +Feature: nvtt +Description: Build with NVTT support +Build-Depends: nvtt Feature: packages Description: Set to ON to generate CPack configuration files and packaging targets diff --git a/ports/osg/crosscompile.patch b/ports/osg/crosscompile.patch new file mode 100644 index 00000000000000..65c2625ef88183 --- /dev/null +++ b/ports/osg/crosscompile.patch @@ -0,0 +1,53 @@ +diff --git a/CMakeModules/CheckAtomicOps.cmake b/CMakeModules/CheckAtomicOps.cmake +index 11ddae5..913b127 100644 +--- a/CMakeModules/CheckAtomicOps.cmake ++++ b/CMakeModules/CheckAtomicOps.cmake +@@ -26,10 +26,10 @@ ELSE() + SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1) + + ELSE() +- INCLUDE(CheckCXXSourceRuns) ++ INCLUDE(CheckCXXSourceCompiles) + + # Do step by step checking, +- CHECK_CXX_SOURCE_RUNS(" ++ check_cxx_source_compiles(" + #include + + int main() +@@ -49,7 +49,7 @@ ELSE() + } + " _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS) + +- CHECK_CXX_SOURCE_RUNS(" ++ check_cxx_source_compiles(" + #include + + int main(int, const char**) +@@ -69,7 +69,7 @@ ELSE() + } + " _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS) + +- CHECK_CXX_SOURCE_RUNS(" ++ check_cxx_source_compiles(" + #include + #include + +@@ -90,7 +90,7 @@ ELSE() + } + " _OPENTHREADS_ATOMIC_USE_SUN) + +- CHECK_CXX_SOURCE_RUNS(" ++ check_cxx_source_compiles(" + #include + #include + #include +@@ -119,7 +119,7 @@ ELSE() + } + " _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) + +- CHECK_CXX_SOURCE_RUNS(" ++ check_cxx_source_compiles(" + #include + + int main() diff --git a/ports/osg/disable-install-pdb.patch b/ports/osg/disable-install-pdb.patch new file mode 100644 index 00000000000000..fe2dc7f18be9e9 --- /dev/null +++ b/ports/osg/disable-install-pdb.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeModules/ModuleInstall.cmake b/CMakeModules/ModuleInstall.cmake +index f6714c5..84aee67 100644 +--- a/CMakeModules/ModuleInstall.cmake ++++ b/CMakeModules/ModuleInstall.cmake +@@ -32,7 +32,7 @@ INSTALL( + ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev + ) + +-IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) ++IF(MSVC AND DYNAMIC_OPENSCENEGRAPH AND 0) + GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) + IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names + SET(PREFIX "") +diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake +index dcc1fe3..87960a9 100644 +--- a/CMakeModules/OsgMacroUtils.cmake ++++ b/CMakeModules/OsgMacroUtils.cmake +@@ -348,10 +348,10 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME) + RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} + ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev + LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT}) +- IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) ++ IF(MSVC AND DYNAMIC_OPENSCENEGRAPH AND 0) + INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug) +- ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) ++ ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH AND 0) + ELSE(WIN32) + INSTALL(TARGETS ${TARGET_TARGETNAME} + RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index b8aeaa71227085..b9909c965e45ae 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -1,11 +1,11 @@ set(OSG_VER 3.6.5) vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO openscenegraph/OpenSceneGraph - REF OpenSceneGraph-${OSG_VER} - SHA512 7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b - HEAD_REF master + OUT_SOURCE_PATH SOURCE_PATH + REPO openscenegraph/OpenSceneGraph + REF OpenSceneGraph-${OSG_VER} + SHA512 7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b + HEAD_REF master PATCHES collada.patch static.patch @@ -16,9 +16,11 @@ vcpkg_from_github( remove-prefix.patch # Remove this patch when cmake fix Findosg_functions.cmake fix-liblas.patch fix-nvtt.patch - use-boost-asio.patch + #use-boost-asio.patch fix-dependency-coin.patch osgdb_zip_nozip.patch # This is fix symbol clashes with other libs when built in static-lib mode + disable-install-pdb.patch + crosscompile.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -37,15 +39,6 @@ if (NOT VCPKG_TARGET_IS_WINDOWS) endif() set(OPTIONS) -if(NOT "collada" IN_LIST FEATURES) - list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_COLLADA=ON) -endif() -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_FFmpeg=ON) -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_DCMTK=ON) -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_GStreamer=ON) -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_GLIB=ON) -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_SDL=ON) -list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_LIBLAS=ON) # Due to nvtt CRT linkage error, we can only enable static builds here set(ENABLE_NVTT ON) @@ -55,7 +48,6 @@ endif() list(APPEND OPTIONS -DENABLE_NVTT=${ENABLE_NVTT}) if (VCPKG_TARGET_IS_WINDOWS) - list(APPEND OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_FONTCONFIG=ON) list(APPEND OPTIONS -DOSG_TEXT_USE_FONTCONFIG=OFF) endif() @@ -67,16 +59,61 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS docs BUILD_DOCUMENTATION docs BUILD_REF_DOCS_SEARCHENGINE docs BUILD_REF_DOCS_TAGFILE + fontconfig OSG_TEXT_USE_FONTCONFIG + nvtt ENABLE_NVTT ) +set(DISABLE_PACKAGES) +if(NOT "collada" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES COLLADA) +endif() +if(NOT "tools" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES EXPAT Iconv) +endif() +if(NOT "plugins" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Boost coin SDL Jasper GDAL TIFF) +endif() +if(NOT "examples" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES SDL2) +endif() +if(NOT "freetype" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Freetype) +endif() +if(NOT "curl" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES CURL) +endif() +if(NOT "sdl1" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES SDL) +endif() +if(NOT "jpeg" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES JPEG) +endif() +if(NOT "png" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES PNG) +endif() +if(NOT "nvtt" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES NVTT) +endif() +if(NOT "fontconfig" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Fontconfig) +endif() + +# pkg-config is required by FindFontconfig +vcpkg_find_acquire_program(PKGCONFIG) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - OPTIONS ${FEATURE_OPTIONS} + PREFER_NINJA + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES wxWidgets liblas EGL FLTK GLIB Asio GtkGl DirectShow Poppler-glib GStreamer DCMTK FFmpeg ${DISABLE_PACKAGES} + OPTIONS + ${FEATURE_OPTIONS} -DOSG_USE_UTF8_FILENAME=${OSG_USE_UTF8_FILENAME} -DDYNAMIC_OPENSCENEGRAPH=${OSG_DYNAMIC} -DDYNAMIC_OPENTHREADS=${OSG_DYNAMIC} -DBUILD_DASHBOARD_REPORTS=OFF -DCMAKE_CXX_STANDARD=11 + -DPKG_CONFIG_EXECUTABLE=${PKGCONFIG} ${OPTIONS} ) @@ -103,43 +140,44 @@ if (OSG_TOOLS) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/OpenSceneGraph) endif() - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/*) - if (OSG_PLUGINS_DBG) - file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) - endif() - file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/*) - if (OSG_PLUGINS_REL) - if (NOT EXISTS ${OSG_TOOL_PATH}) - file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) - endif() - file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) - endif() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/ ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/) -endif() - -file(GLOB OSG_PLUGINS_DBG ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/*) +file(GLOB OSG_PLUGINS_DBG + ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/* + ${CURRENT_PACKAGES_DIR}/debug/lib/osgPlugins-${OSG_VER}/* +) if (OSG_PLUGINS_DBG) file(COPY ${OSG_PLUGINS_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/osgPlugins-${OSG_VER}) endif() -file(GLOB OSG_PLUGINS_REL ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/*) +file(GLOB OSG_PLUGINS_REL + ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/* + ${CURRENT_PACKAGES_DIR}/lib/osgPlugins-${OSG_VER}/* +) if (OSG_PLUGINS_REL) if (NOT EXISTS ${OSG_TOOL_PATH}) file(MAKE_DIRECTORY ${OSG_TOOL_PATH}) endif() file(COPY ${OSG_PLUGINS_REL} DESTINATION ${OSG_TOOL_PATH}/osgPlugins-${OSG_VER}) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/ ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/ + ${CURRENT_PACKAGES_DIR}/lib/osgPlugins-${OSG_VER}/ + ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-${OSG_VER}/ + ${CURRENT_PACKAGES_DIR}/debug/lib/osgPlugins-${OSG_VER}/ +) #Cleanup file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-${OSG_VER}/) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(GLOB_RECURSE HEADERS ${CURRENT_PACKAGES_DIR}/include/*) + foreach(HEADER IN LISTS HEADERS) + vcpkg_replace_string("${HEADER}" "__declspec(dllimport)" "") + endforeach() +endif() # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/osg/use-boost-asio.patch b/ports/osg/use-boost-asio.patch index 4d804973c0b45a..036d1c2ce00ae4 100644 --- a/ports/osg/use-boost-asio.patch +++ b/ports/osg/use-boost-asio.patch @@ -24,7 +24,7 @@ index 433d5c7..04a0edf 100644 - IF(Boost_FOUND) - SET(ASIO_FOUND "YES") - ENDIF() -+FIND_PACKAGE( Boost 1.37 COMPONENTS asio ) ++FIND_PACKAGE( Boost 1.37 ) +IF(Boost_FOUND) + SET(ASIO_FOUND "YES") ENDIF() diff --git a/ports/osgearth/make-all-find-packages-required.patch b/ports/osgearth/make-all-find-packages-required.patch deleted file mode 100644 index f5ea6793f72114..00000000000000 --- a/ports/osgearth/make-all-find-packages-required.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 049e37e..c78bd16 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -121,9 +121,9 @@ option(OSGEARTH_ENABLE_GEOCODER "Enable the geocoder (GDAL/OGR must be built wit - - # Mobile/GLES: - IF (OSGEARTH_USE_GLES) -- find_package(OpenGLES) -+ find_package(OpenGLES REQUIRED) - ELSE () -- find_package(OpenGL) -+ find_package(OpenGL REQUIRED) - ENDIF (OSGEARTH_USE_GLES) - - # required -@@ -132,28 +132,28 @@ find_package(CURL REQUIRED) - find_package(GDAL REQUIRED) - - # optional --find_package(GEOS) --find_package(Sqlite3) --find_package(Draco) --find_package(BASISU) --find_package(GLEW) --find_package(Protobuf) --find_package(WEBP) -+find_package(GEOS REQUIRED) -+find_package(Sqlite3 REQUIRED) -+find_package(Draco REQUIRED) -+find_package(BASISU REQUIRED) -+find_package(GLEW REQUIRED) -+find_package(Protobuf REQUIRED) -+find_package(WEBP REQUIRED) - - if(OSGEARTH_ENABLE_PROFILING) -- find_package(Tracy) -+ find_package(Tracy REQUIRED) - endif() - - if(OSGEARTH_BUILD_ZIP_PLUGIN) -- find_package(LIBZIP) -+ find_package(LIBZIP REQUIRED) - endif() - - if(OSGEARTH_BUILD_TRITON_NODEKIT) -- find_package(Triton QUIET) -+ find_package(Triton QUIET REQUIRED) - endif() - - if(OSGEARTH_BUILD_SILVERLINING_NODEKIT) -- find_package(SilverLining QUIET) -+ find_package(SilverLining QUIET REQUIRED) - endif() - - # Sqlite enables the MBTiles format: -@@ -182,18 +182,18 @@ SET (PROTOBUF_USE_DLLS FALSE CACHE BOOL "Set this to true if Protobuf is compile - # Duktape is the JavaScript interpreter - SET (WITH_EXTERNAL_DUKTAPE FALSE CACHE BOOL "Use bundled or system wide version of Duktape") - IF (WITH_EXTERNAL_DUKTAPE) -- find_package(Duktape) -+ find_package(Duktape REQUIRED) - ENDIF (WITH_EXTERNAL_DUKTAPE) - - # Whether to install shaders (glsl files). --# If true, shaders install into a resources folder. If false, they are inlined in the -+# If true, shaders install into a resources folder. If false, they are inlined in the - # code and you cannot tweak them after install. - OPTION(OSGEARTH_INSTALL_SHADERS "Whether to deploy GLSL shaders when doing a Make INSTALL" OFF) - - # TinyXML is an XML parsing library - SET (WITH_EXTERNAL_TINYXML FALSE CACHE BOOL "Use bundled or system wide version of TinyXML") - IF (WITH_EXTERNAL_TINYXML) -- find_package(TinyXML) -+ find_package(TinyXML REQUIRED) - ENDIF (WITH_EXTERNAL_TINYXML) - - # postfix settings for various configs -@@ -272,4 +272,4 @@ ADD_SUBDIRECTORY(src) - - if (OSGEARTH_BUILD_DOCS) - ADD_SUBDIRECTORY(docs) --endif() -+endif() diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 4a7270469740a5..b340bb44e3c389 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -14,17 +14,25 @@ vcpkg_from_github( REF 342fcadf4c8892ba84841cb5b4162bdc51519e3c #version 3.1 SHA512 03378a918306846d2144e545785c783b01e33fa2dd5c77d16d390a275217b6ce7a3a743c35ae99a497b272a7516b055442c0a891bd312cce727a5538b40364f5 HEAD_REF master - PATCHES + PATCHES StaticOSG.patch # Fix port compilation in static-md module deprecated_cpp_fix.patch # Fix port headers to not use classes deprecated in c++17. Gives errors when using the installed port headers - make-all-find-packages-required.patch fix-dependencies.patch fix-dependency-osg.patch remove-tool-debug-suffix.patch ) +# Remove embedded tinyxml to ensure our copy is used +file(REMOVE + ${SOURCE_PATH}/src/osgEarth/tinyxml.h + ${SOURCE_PATH}/src/osgEarth/tinystr.h + ${SOURCE_PATH}/src/osgEarth/tinystr.cpp + ${SOURCE_PATH}/src/osgEarth/tinyxml.cpp + ${SOURCE_PATH}/src/osgEarth/tinyxmlerror.cpp + ${SOURCE_PATH}/src/osgEarth/tinyxmlparser.cpp +) -# Upstream bug, see https://github.com/gwaldron/osgearth/issues/1002 -file(REMOVE ${SOURCE_PATH}/src/osgEarth/tinyxml.h) +# pkg-config is required by FindFontconfig +vcpkg_find_acquire_program(PKGCONFIG) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) @@ -36,8 +44,13 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES SilverLining Triton Tracy + # Using "WITH_EXTERNAL_DUKTAPE=ON" and then disabling the "find_package()" is the only way to disable the duktape feature + Duktape OPTIONS ${FEATURE_OPTIONS} -DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED} + # TODO: This is incorrect; dependencies could be static or dynamic independently of BUILD_STATIC -DNRL_STATIC_LIBRARIES=${BUILD_STATIC} -DOSG_IS_STATIC=${BUILD_STATIC} -DGEOS_IS_STATIC=${BUILD_STATIC} @@ -49,6 +62,9 @@ vcpkg_configure_cmake( -DOSGEARTH_BUILD_TRITON_NODEKIT=OFF -DOSGEARTH_BUILD_SILVERLINING_NODEKIT=OFF -DWITH_EXTERNAL_TINYXML=ON + -DWITH_EXTERNAL_DUKTAPE=ON + -DPKG_CONFIG_EXECUTABLE=${PKGCONFIG} + "-DLIB_POSTFIX:STRING=" ) vcpkg_install_cmake() diff --git a/ports/osgearth/vcpkg.json b/ports/osgearth/vcpkg.json index 1a84d6aa8362d1..41c383bf2eb4ba 100644 --- a/ports/osgearth/vcpkg.json +++ b/ports/osgearth/vcpkg.json @@ -7,7 +7,10 @@ "supports": "!(x86 | wasm32)", "dependencies": [ "basisu", + "curl", "draco", + "fontconfig", + "gdal", "geos", "glew", "libwebp", @@ -15,9 +18,7 @@ "opengl", { "name": "osg", - "features": [ - "plugins" - ] + "default-features": false }, "protobuf", "sqlite3", diff --git a/ports/pangolin/portfile.cmake b/ports/pangolin/portfile.cmake index df9c5bad806029..ca82706e13155c 100644 --- a/ports/pangolin/portfile.cmake +++ b/ports/pangolin/portfile.cmake @@ -23,22 +23,28 @@ string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" MSVC_USE_STATIC_CRT) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES Doxygen OPTIONS -DBUILD_EXTERN_GLEW=OFF -DBUILD_EXTERN_LIBPNG=OFF -DBUILD_EXTERN_LIBJPEG=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_TooN=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_DC1394=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_LibRealSense=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_OpenNI=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_OpenNI2=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_uvc=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_DepthSense=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_TeliCam=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_Pleora=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_TIFF=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_OpenEXR=OFF + -DBUILD_PANGOLIN_PYTHON=OFF + -DBUILD_PANGOLIN_TOON=OFF + -DBUILD_PANGOLIN_LIBDC1394=OFF + -DBUILD_PANGOLIN_LIBREALSENSE=OFF + -DBUILD_PANGOLIN_LIBREALSENSE2=OFF + -DBUILD_PANGOLIN_OPENNI=OFF + -DBUILD_PANGOLIN_OPENNI2=OFF + -DBUILD_PANGOLIN_LIBUVC=OFF + -DBUILD_PANGOLIN_UVC_MEDIAFOUNDATION=OFF + -DBUILD_PANGOLIN_DEPTHSENSE=OFF + -DBUILD_PANGOLIN_TELICAM=OFF + -DBUILD_PANGOLIN_PLEORA=OFF + -DBUILD_PANGOLIN_LIBTIFF=OFF + -DBUILD_PANGOLIN_LIBOPENEXR=OFF + -DBUILD_PANGOLIN_ZSTD=OFF + -DBUILD_PANGOLIN_LZ4=OFF -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT} ) diff --git a/ports/pangolin/usage b/ports/pangolin/usage index 93db9b75b2082e..19a6dc3b48fb84 100644 --- a/ports/pangolin/usage +++ b/ports/pangolin/usage @@ -1,4 +1,4 @@ -The package pangolin is compatible with built-in CMake targets: +The package pangolin provides CMake integration: find_package(Pangolin CONFIG REQUIRED) target_link_libraries(main PRIVATE pangolin) diff --git a/ports/pangolin/vcpkg.json b/ports/pangolin/vcpkg.json index 32b6ba79695278..cec9525a01658d 100644 --- a/ports/pangolin/vcpkg.json +++ b/ports/pangolin/vcpkg.json @@ -1,7 +1,7 @@ { "name": "pangolin", "version-string": "0.5", - "port-version": 13, + "port-version": 14, "description": "Lightweight GUI Library", "homepage": "https://github.com/stevenlovegrove/Pangolin", "supports": "!uwp & !osx", @@ -9,11 +9,15 @@ "eigen3", { "name": "ffmpeg", + "default-features": false, "features": [ "avformat" ] }, - "glew", + { + "name": "glew", + "platform": "!android & !ios" + }, "libjpeg-turbo", "libpng" ] diff --git a/ports/pdal/CONTROL b/ports/pdal/CONTROL deleted file mode 100644 index 99643803d3173b..00000000000000 --- a/ports/pdal/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: pdal -Version: 1.7.1 -Port-Version: 11 -Description: PDAL - Point Data Abstraction Library is a library for manipulating point cloud data. -Build-Depends: gdal, geos, jsoncpp, libgeotiff, laszip, boost-system, boost-filesystem diff --git a/ports/pdal/dep-versions.patch b/ports/pdal/dep-versions.patch new file mode 100644 index 00000000000000..483ab42639b45a --- /dev/null +++ b/ports/pdal/dep-versions.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/gdal.cmake b/cmake/gdal.cmake +index b7be79b..f5a4757 100644 +--- a/cmake/gdal.cmake ++++ b/cmake/gdal.cmake +@@ -1,7 +1,7 @@ + # + # GDAL/OGR support (required) + # +-find_package(GDAL 1.9.0) ++find_package(GDAL) + set_package_properties(GDAL PROPERTIES TYPE REQUIRED + PURPOSE "Provides general purpose raster, vector, and reference system support") + if (GDAL_FOUND) diff --git a/ports/pdal/fix-dependency.patch b/ports/pdal/fix-dependency.patch index ea2bcf8f844bd9..f404564df4d97b 100644 --- a/ports/pdal/fix-dependency.patch +++ b/ports/pdal/fix-dependency.patch @@ -48,7 +48,7 @@ diff --git a/PDALConfig.cmake.in b/PDALConfig.cmake.in index a03ef14..9d073e6 100644 --- a/PDALConfig.cmake.in +++ b/PDALConfig.cmake.in -@@ -15,6 +15,11 @@ foreach(_dir @PDAL_CONFIG_LIBRARY_DIRS@) +@@ -15,6 +15,12 @@ foreach(_dir @PDAL_CONFIG_LIBRARY_DIRS@) list(APPEND PDAL_LIBRARY_DIRS ${_foo}) endforeach(_dir) @@ -57,6 +57,7 @@ index a03ef14..9d073e6 100644 +find_dependency(CURL) +find_dependency(Boost COMPONENTS system filesystem) +find_dependency(geos CONFIG) ++find_dependency(GDAL) include("${CMAKE_CURRENT_LIST_DIR}/PDALTargets.cmake") if (WIN32) diff --git a/ports/pdal/gdal-target.patch b/ports/pdal/gdal-target.patch new file mode 100644 index 00000000000000..3cc6d836a8bd4f --- /dev/null +++ b/ports/pdal/gdal-target.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6845ec3..36550fc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -265,7 +265,7 @@ target_include_directories(${PDAL_BASE_LIB_NAME} + target_link_libraries(${PDAL_BASE_LIB_NAME} + PUBLIC + ${CMAKE_THREAD_LIBS_INIT} +- ${GDAL_LIBRARY} ++ GDAL::GDAL + ${GEOS_LIBRARY} + ${GEOTIFF_LIBRARY} + ${LASZIP_LIBRARY} diff --git a/ports/pdal/no-git.patch b/ports/pdal/no-git.patch new file mode 100644 index 00000000000000..6305f2e5534c2e --- /dev/null +++ b/ports/pdal/no-git.patch @@ -0,0 +1,14 @@ +diff --git a/cmake/modules/GetGitRevisionDescription.cmake b/cmake/modules/GetGitRevisionDescription.cmake +index 2e61f4f..b2a16f1 100644 +--- a/cmake/modules/GetGitRevisionDescription.cmake ++++ b/cmake/modules/GetGitRevisionDescription.cmake +@@ -40,6 +40,9 @@ set(__get_git_revision_description YES) + get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) + + function(get_git_head_revision _refspecvar _hashvar) ++ set(${_refspecvar} "Release" PARENT_SCOPE) ++ set(${_hashvar} "Release" PARENT_SCOPE) ++ return() + set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories diff --git a/ports/pdal/no-werror.patch b/ports/pdal/no-werror.patch new file mode 100644 index 00000000000000..f93236b4cdf934 --- /dev/null +++ b/ports/pdal/no-werror.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/unix_compiler_options.cmake b/cmake/unix_compiler_options.cmake +index 035a2b9..650de8f 100644 +--- a/cmake/unix_compiler_options.cmake ++++ b/cmake/unix_compiler_options.cmake +@@ -24,7 +24,6 @@ function(PDAL_TARGET_COMPILE_SETTINGS target) + ${PDAL_CXX_STANDARD} + -Wextra + -Wpedantic +- -Werror + -Wall + -Wno-unused-parameter + -Wno-unused-variable diff --git a/ports/pdal/portfile.cmake b/ports/pdal/portfile.cmake index 18d27a4c4b1cd2..902cf72daf419a 100644 --- a/ports/pdal/portfile.cmake +++ b/ports/pdal/portfile.cmake @@ -18,6 +18,10 @@ vcpkg_extract_source_archive_ex( fix-CPL_DLL.patch 0004-fix-const-overloaded.patch geotiff.patch + dep-versions.patch + no-werror.patch + no-git.patch + gdal-target.patch ) file(REMOVE "${SOURCE_PATH}/pdal/gitsha.cpp") diff --git a/ports/pdal/vcpkg.json b/ports/pdal/vcpkg.json new file mode 100644 index 00000000000000..5b2bad5a3c7380 --- /dev/null +++ b/ports/pdal/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "pdal", + "version-semver": "1.7.1", + "port-version": 12, + "description": "PDAL - Point Data Abstraction Library is a library for manipulating point cloud data.", + "dependencies": [ + "boost-filesystem", + "boost-system", + "gdal", + "geos", + "jsoncpp", + "laszip", + "libgeotiff" + ] +} diff --git a/ports/physx/CONTROL b/ports/physx/CONTROL deleted file mode 100644 index c35db5c1bf132c..00000000000000 --- a/ports/physx/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: physx -Version: 4.1.1 -Port-Version: 7 -Homepage: https://github.com/NVIDIAGameWorks/PhysX -Description: The NVIDIA PhysX SDK is a scalable multi-platform physics solution supporting a wide range of devices, from smartphones to high-end multicore CPUs and GPUs diff --git a/ports/physx/portfile.cmake b/ports/physx/portfile.cmake index 2d4d627fb76030..1909582d8e03d5 100644 --- a/ports/physx/portfile.cmake +++ b/ports/physx/portfile.cmake @@ -14,11 +14,6 @@ vcpkg_from_github( fix-compiler-flag.patch ) -if(NOT DEFINED RELEASE_CONFIGURATION) - set(RELEASE_CONFIGURATION "release") -endif() -set(DEBUG_CONFIGURATION "debug") - set(OPTIONS "-DPHYSX_ROOT_DIR=${SOURCE_PATH}/physx" "-DPXSHARED_PATH=${SOURCE_PATH}/pxshared" @@ -82,6 +77,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH "${SOURCE_PATH}/physx/compiler/public" PREFER_NINJA + REQUIRE_ALL_PACKAGES DISABLE_PARALLEL_CONFIGURE OPTIONS ${OPTIONS} OPTIONS_DEBUG ${OPTIONS_DEBUG} diff --git a/ports/physx/vcpkg.json b/ports/physx/vcpkg.json new file mode 100644 index 00000000000000..e23c76b2c58393 --- /dev/null +++ b/ports/physx/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "physx", + "version": "4.1.1", + "port-version": 8, + "description": "The NVIDIA PhysX SDK is a scalable multi-platform physics solution supporting a wide range of devices, from smartphones to high-end multicore CPUs and GPUs" +} diff --git a/ports/sail/portfile.cmake b/ports/sail/portfile.cmake index 490951bc1c0a06..38ee444231636d 100644 --- a/ports/sail/portfile.cmake +++ b/ports/sail/portfile.cmake @@ -13,6 +13,7 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SAIL_STATIC) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + REQUIRE_ALL_PACKAGES OPTIONS -DSAIL_STATIC=${SAIL_STATIC} -DSAIL_COMBINE_CODECS=ON diff --git a/ports/simage/CONTROL b/ports/simage/CONTROL deleted file mode 100644 index e25840834342e1..00000000000000 --- a/ports/simage/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: simage -Version: 1.8.0 -Port-Version: 1 -Description: Image file format library abstraction layer -Build-Depends: giflib (!windows&!osx), libjpeg-turbo (!windows&!osx), libpng (!windows&!osx), libsndfile, tiff (!windows&!osx), libvorbis, zlib (!windows&!osx) -Homepage: https://github.com/coin3d/simage diff --git a/ports/simage/portfile.cmake b/ports/simage/portfile.cmake index 6b890c8a5c75b3..69892bddc9e488 100644 --- a/ports/simage/portfile.cmake +++ b/ports/simage/portfile.cmake @@ -20,9 +20,10 @@ else() set(SIMAGE_BUILD_SHARED_LIBS ON) endif() -set(OSX_OR_WINDOWS OFF) -if((VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) OR VCPKG_TARGET_IS_OSX) - set(OSX_OR_WINDOWS ON) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_UWP) + set(DISABLE_PACKAGES) +else() + set(DISABLE_PACKAGES ZLIB GIF JPEG PNG TIFF) endif() if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) @@ -33,21 +34,32 @@ else() set(SIMAGE_USE_GDIPLUS OFF) endif() +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + libvorbis SIMAGE_OGGVORBIS_SUPPORT + libsndfile SIMAGE_LIBSNDFILE_SUPPORT +) + +if(NOT "libvorbis" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Ogg Vorbis OggVorbis) +endif() + +if(NOT "libsndfile" IN_LIST FEATURES) + list(APPEND DISABLE_PACKAGES Sndfile FLAC) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + REQUIRE_ALL_PACKAGES + DISABLE_PACKAGES Jasper Doxygen QuickTime Opus ${DISABLE_PACKAGES} PREFER_NINJA OPTIONS -DSIMAGE_BUILD_SHARED_LIBS=${SIMAGE_BUILD_SHARED_LIBS} -DSIMAGE_USE_AVIENC=${SIMAGE_USE_AVIENC} -DSIMAGE_USE_GDIPLUS=${SIMAGE_USE_GDIPLUS} - -DCMAKE_DISABLE_FIND_PACKAGE_FLAC=ON - -DCMAKE_DISABLE_FIND_PACKAGE_Jasper=ON - -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON - -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=${OSX_OR_WINDOWS} - -DCMAKE_DISABLE_FIND_PACKAGE_GIF=${OSX_OR_WINDOWS} - -DCMAKE_DISABLE_FIND_PACKAGE_JPEG=${OSX_OR_WINDOWS} - -DCMAKE_DISABLE_FIND_PACKAGE_PNG=${OSX_OR_WINDOWS} - -DCMAKE_DISABLE_FIND_PACKAGE_TIFF=${OSX_OR_WINDOWS} + -DSIMAGE_LIBJASPER_SUPPORT=OFF + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() diff --git a/ports/simage/vcpkg.json b/ports/simage/vcpkg.json new file mode 100644 index 00000000000000..da2483773a7bcb --- /dev/null +++ b/ports/simage/vcpkg.json @@ -0,0 +1,44 @@ +{ + "name": "simage", + "version": "1.8.0", + "port-version": 2, + "description": "Image file format library abstraction layer", + "homepage": "https://github.com/coin3d/simage", + "dependencies": [ + { + "name": "giflib", + "platform": "linux | uwp" + }, + { + "name": "libjpeg-turbo", + "platform": "linux | uwp" + }, + { + "name": "libpng", + "platform": "linux | uwp" + }, + { + "name": "tiff", + "platform": "linux | uwp" + } + ], + "features": { + "libsndfile": { + "description": "Build libsndfile support", + "dependencies": [ + "libflac", + { + "name": "libsndfile", + "default-features": false + } + ] + }, + "libvorbis": { + "description": "Build Ogg Vorbis support", + "dependencies": [ + "libogg", + "libvorbis" + ] + } + } +} diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 9bdf6573e30608..4b4bdd2d58ec93 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -810,6 +810,23 @@ function("${VCPKG_OVERRIDE_FIND_PACKAGE_NAME}") set(VCPKG_CMAKE_WRAPPER_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${LOWERCASE_PACKAGE_NAME}/vcpkg-cmake-wrapper.cmake") + # These if() conditions are split to avoid exposing lower CMake versions to IN_LIST + set(ARGS "${ARGV}") + cmake_policy(PUSH) + if(DEFINED Z_VCPKG_DISABLE_PACKAGES) + cmake_policy(SET CMP0057 NEW) + if("${PACKAGE_NAME}" IN_LIST Z_VCPKG_DISABLE_PACKAGES) + set(CMAKE_DISABLE_FIND_PACKAGE_${PACKAGE_NAME} 1) + endif() + endif() + if(DEFINED Z_VCPKG_REQUIRE_ALL_PACKAGES) + cmake_policy(SET CMP0057 NEW) + if(NOT CMAKE_DISABLE_FIND_PACKAGE_${PACKAGE_NAME} AND NOT "REQUIRED" IN_LIST ARGS AND NOT "${PACKAGE_NAME}" IN_LIST Z_VCPKG_OPTIONAL_PACKAGES) + list(APPEND ARGS REQUIRED) + endif() + endif() + cmake_policy(POP) + z_vcpkg_start_parent_scope_export() if(EXISTS "${VCPKG_CMAKE_WRAPPER_PATH}") include("${VCPKG_CMAKE_WRAPPER_PATH}") diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 1cac9f01587467..d73cc45635d9d6 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -10,6 +10,9 @@ Configure CMake for Debug and Release builds of a project. vcpkg_configure_cmake( SOURCE_PATH <${SOURCE_PATH}> [PREFER_NINJA] + [REQUIRE_ALL_PACKAGES] + [OPTIONAL_PACKAGES ...] + [DISABLE_PACKAGES ...] [DISABLE_PARALLEL_CONFIGURE] [NO_CHARSET_FLAG] [GENERATOR <"NMake Makefiles">] @@ -74,9 +77,9 @@ function(vcpkg_configure_cmake) endif() cmake_parse_arguments(PARSE_ARGV 0 arg - "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;NO_CHARSET_FLAG" + "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;NO_CHARSET_FLAG;REQUIRE_ALL_PACKAGES" "SOURCE_PATH;GENERATOR;LOGNAME" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;DISABLE_PACKAGES;OPTIONAL_PACKAGES" ) if(NOT VCPKG_PLATFORM_TOOLSET) @@ -186,6 +189,17 @@ function(vcpkg_configure_cmake) if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") endif() + if(arg_REQUIRE_ALL_PACKAGES) + list(APPEND arg_OPTIONS "-DZ_VCPKG_REQUIRE_ALL_PACKAGES=ON") + endif() + if(arg_OPTIONAL_PACKAGES) + list(APPEND arg_OPTIONS "-DZ_VCPKG_OPTIONAL_PACKAGES=${arg_OPTIONAL_PACKAGES}") + endif() + if(arg_DISABLE_PACKAGES) + set(X "-DZ_VCPKG_DISABLE_PACKAGES=${arg_DISABLE_PACKAGES}") + string(REPLACE ";" "\\;" X "${X}") + list(APPEND arg_OPTIONS "${X}") + endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") list(APPEND arg_OPTIONS -DBUILD_SHARED_LIBS=ON)