From 0ab169d7214e915d23d3c3c4991c8cdb274d101f Mon Sep 17 00:00:00 2001 From: Gehweiler Date: Thu, 23 Jul 2020 21:53:34 +0200 Subject: [PATCH 01/95] fix build issues occurring from default bazel config being used because customized bazel config is stored in wrong directory --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8d2c187b057b86..fb581181b6018f 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -79,7 +79,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) message(STATUS "Configuring TensorFlow") vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) From 543e19dba82ab9a506cfc14c77235c756456dbc5 Mon Sep 17 00:00:00 2001 From: wangli28 Date: Fri, 24 Jul 2020 02:36:50 +0000 Subject: [PATCH 02/95] [tensorflow-cc] Update CONTROL and ci.baseline.txt --- ports/tensorflow-cc/CONTROL | 3 ++- scripts/ci.baseline.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index a9830adb24f719..6fa024164b5297 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,6 @@ Source: tensorflow-cc -Version: 1.14-3 +Version: 1.14 +Port-Version: 4 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 5546c1f1ae9aec..05613d755a2f44 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1712,7 +1712,6 @@ telnetpp:x64-uwp=fail tensorflow-cc:arm64-windows=fail tensorflow-cc:x64-linux=skip tensorflow-cc:x64-osx=skip -tensorflow-cc:x64-windows=fail tensorflow-cc:x64-windows-static=fail tensorflow-cc:x86-windows=fail tesseract:x64-windows=fail From 820c45520265ddd233cf2709ea904b532efa562a Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 24 Jul 2020 15:23:18 +0200 Subject: [PATCH 03/95] fix also applies to windows static build --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 05613d755a2f44..12e226ef60ccbc 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1712,7 +1712,6 @@ telnetpp:x64-uwp=fail tensorflow-cc:arm64-windows=fail tensorflow-cc:x64-linux=skip tensorflow-cc:x64-osx=skip -tensorflow-cc:x64-windows-static=fail tensorflow-cc:x86-windows=fail tesseract:x64-windows=fail tesseract:x64-windows-static=fail From 96435481cc385855019e7ea46c1651a251596df3 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 11 Aug 2020 14:08:14 +0200 Subject: [PATCH 04/95] fix debug and static builds as well as library naming for non-linux - add patch to fix debug builds - add patch to fix exports for static linking - really build debug (instead of cloning release) - override bazel build options for debug (work around bazel bug) - bazel doesn't support static libraries: work around by building dynamic library and constructing static linkage commands from build log - Windows .pdb file can't be >4GB even on x64: work around using reduced debug information - Windows doesn't support .lib files >4GB even on x64, so split into multiple libs - vcpkg requires equal amount of libs for debug and release: work around using handcrafted empty dummy libs - fix naming of libs (.dll on Windows and .dylib on macOS) --- ports/tensorflow-cc/CONTROL | 2 +- ports/tensorflow-cc/TensorflowCCConfig.cmake | 94 +++++- .../change-macros-for-static-lib.patch | 132 +++++++++ .../tensorflow-cc/convert_lib_params_linux.py | 9 + .../tensorflow-cc/convert_lib_params_macos.py | 9 + .../convert_lib_params_windows.py | 25 ++ .../tensorflow-cc/fix-dbg-build-errors.patch | 104 +++++++ .../generate_static_link_cmd_linux.py | 38 +++ .../generate_static_link_cmd_macos.py | 38 +++ .../generate_static_link_cmd_windows.py | 41 +++ ports/tensorflow-cc/handcrafted_dummy.lib | Bin 0 -> 260 bytes ports/tensorflow-cc/portfile.cmake | 278 ++++++++++++++---- 12 files changed, 691 insertions(+), 79 deletions(-) create mode 100644 ports/tensorflow-cc/change-macros-for-static-lib.patch create mode 100644 ports/tensorflow-cc/convert_lib_params_linux.py create mode 100644 ports/tensorflow-cc/convert_lib_params_macos.py create mode 100644 ports/tensorflow-cc/convert_lib_params_windows.py create mode 100644 ports/tensorflow-cc/fix-dbg-build-errors.patch create mode 100644 ports/tensorflow-cc/generate_static_link_cmd_linux.py create mode 100644 ports/tensorflow-cc/generate_static_link_cmd_macos.py create mode 100644 ports/tensorflow-cc/generate_static_link_cmd_windows.py create mode 100644 ports/tensorflow-cc/handcrafted_dummy.lib diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 6fa024164b5297..2d0ff50073eb4a 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,6 +1,6 @@ Source: tensorflow-cc Version: 1.14 -Port-Version: 4 +Port-Version: 5 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/TensorflowCCConfig.cmake b/ports/tensorflow-cc/TensorflowCCConfig.cmake index db12811d5cdb49..d86f82c6d0a7e8 100644 --- a/ports/tensorflow-cc/TensorflowCCConfig.cmake +++ b/ports/tensorflow-cc/TensorflowCCConfig.cmake @@ -10,19 +10,81 @@ set(tensorflow_cc_INCLUDE_DIRS ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/external/protobuf_archive/src/ ) -add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.so.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" -) - -add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_cc.so.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" -) - -set(tensorflow_cc_FOUND TRUE) -set(tensorflow_framework_FOUND TRUE) \ No newline at end of file +if(CMAKE_HOST_WIN32) + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../bin/tensorflow.dll + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + else() + add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/tensorflow.lib + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + endif() + set(tensorflow_cc_FOUND TRUE) +elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.1.14.0.dylib + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.1.14.0.dylib + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + else() + add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.1.14.0.a + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + add_library(tensorflow_cc::tensorflow_framework STATIC IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.1.14.0.a + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + endif() + set(tensorflow_cc_FOUND TRUE) + set(tensorflow_framework_FOUND TRUE) +else() + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.so.1.14.0 + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.so.1.14.0 + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + else() + add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.a.1.14.0 + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + add_library(tensorflow_cc::tensorflow_framework STATIC IMPORTED) + set_target_properties(tensorflow_cc::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.a.1.14.0 + INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" + ) + endif() + set(tensorflow_cc_FOUND TRUE) + set(tensorflow_framework_FOUND TRUE) +endif() diff --git a/ports/tensorflow-cc/change-macros-for-static-lib.patch b/ports/tensorflow-cc/change-macros-for-static-lib.patch new file mode 100644 index 00000000000000..446f9c0c93b7c5 --- /dev/null +++ b/ports/tensorflow-cc/change-macros-for-static-lib.patch @@ -0,0 +1,132 @@ +diff --git a/tensorflow/core/platform/macros.h b/tensorflow/core/platform/macros.h +--- a/tensorflow/core/platform/macros.h ++++ b/tensorflow/core/platform/macros.h +@@ -57,16 +57,7 @@ + #define TF_SCANF_ATTRIBUTE(string_index, first_to_check) + #endif + +-// Control visiblity outside .so +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_EXPORT __declspec(dllexport) +-#else +-#define TF_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 ++#define TF_EXPORT + + #ifdef __has_builtin + #define TF_HAS_BUILTIN(x) __has_builtin(x) + +diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h +--- a/tensorflow/c/c_api.h ++++ b/tensorflow/c/c_api.h +@@ -67,24 +67,7 @@ + // and the API just provides high level controls over the number of + // devices of each type. + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes.$a +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + +diff --git a/tensorflow/c/c_api_experimental.h b/tensorflow/c/c_api_experimental.h +--- a/tensorflow/c/c_api_experimental.h ++++ b/tensorflow/c/c_api_experimental.h +@@ -28,24 +28,7 @@ + // The API here is subject to changes in the future. + // -------------------------------------------------------------------------- + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes.$a +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + +diff --git a/tensorflow/c/ops.h b/tensorflow/c/ops.h +--- a/tensorflow/c/ops.h ++++ b/tensorflow/c/ops.h +@@ -75,19 +75,7 @@ + + #include "tensorflow/c/c_api.h" + +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + +diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h +--- a/tensorflow/c/eager/c_api.h ++++ b/tensorflow/c/eager/c_api.h +@@ -22,24 +22,7 @@ + + #include "tensorflow/c/c_api.h" + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes.$a +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py new file mode 100644 index 00000000000000..37222499ef3790 --- /dev/null +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -0,0 +1,9 @@ +for sub in ("cc", "framework"): + with open("libtensorflow_" + sub + ".so.1.14.0-2.params", "r") as f_in: + with open("libtensorflow_" + sub + ".a.1.14.0-2.params", "w") as f_out: + for line in f_in: + if line.startswith("-o "): + line = line.replace(".so", ".a") + f_out.write(line) + elif line.startswith("bazel-out"): + f_out.write(line) diff --git a/ports/tensorflow-cc/convert_lib_params_macos.py b/ports/tensorflow-cc/convert_lib_params_macos.py new file mode 100644 index 00000000000000..5cad8b9af0bf6b --- /dev/null +++ b/ports/tensorflow-cc/convert_lib_params_macos.py @@ -0,0 +1,9 @@ +for sub in ("cc", "framework"): + with open("libtensorflow_" + sub + ".1.14.0.dylib-2.params", "r") as f_in: + with open("libtensorflow_" + sub + ".1.14.0.a-2.params", "w") as f_out: + for line in f_in: + if line.startswith("-o "): + line = line.replace(".dylib", ".a") + f_out.write(line) + elif line.startswith("bazel-out"): + f_out.write(line) diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py new file mode 100644 index 00000000000000..6b7fd828f395aa --- /dev/null +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -0,0 +1,25 @@ +import os + +with open("tensorflow_cc.dll-2.params", "r") as f_in: + lib_name = None + acc_size = 0 + file_no = 1 + f_out = open("tensorflow_cc.lib-2.params", "w") + for line in f_in: + if line.startswith("/OUT:"): + lib_name = line + line = line.replace(".dll", ".lib") + f_out.write(line) + elif line.startswith("/WHOLEARCHIVE:"): + line = line[len("/WHOLEARCHIVE:"):] + size = os.stat("../../" + line.strip()).st_size + if acc_size + size > 0xFFFFFFFF: + # we need to split the library if it is >4GB, because it's not supported even on x64 Windows + f_out.close() + file_no += 1 + f_out = open("tensorflow_cc.lib-2.params-part%d" % file_no, "w") + acc_size = 0 + f_out.write(lib_name.replace(".dll", "-part%d.lib" % file_no)) + acc_size += size + f_out.write(line) + f_out.close() diff --git a/ports/tensorflow-cc/fix-dbg-build-errors.patch b/ports/tensorflow-cc/fix-dbg-build-errors.patch new file mode 100644 index 00000000000000..7192e0cdb0761e --- /dev/null +++ b/ports/tensorflow-cc/fix-dbg-build-errors.patch @@ -0,0 +1,104 @@ +diff --git a/tensorflow/core/lib/io/path.cc b/tensorflow/core/lib/io/path.cc +--- a/tensorflow/core/lib/io/path.cc ++++ b/tensorflow/core/lib/io/path.cc +@@ -287,6 +287,7 @@ + } + LOG(FATAL) << "No temp directory found."; + #endif ++ return ""; + } + + } // namespace io + +diff --git a/tensorflow/core/framework/device_base.cc b/tensorflow/core/framework/device_base.cc +--- a/tensorflow/core/framework/device_base.cc ++++ b/tensorflow/core/framework/device_base.cc +@@ -27,10 +27,12 @@ + + const DeviceAttributes& DeviceBase::attributes() const { + LOG(FATAL) << "Device does not implement attributes()"; ++ return *((DeviceAttributes*)this); // nonsense that will crash if ever invoked -- just to make it compile + } + + const string& DeviceBase::name() const { + LOG(FATAL) << "Device does not implement name()"; ++ return ""; + } + + void DeviceBase::set_eigen_cpu_device(Eigen::ThreadPoolDevice* d) { + +diff --git a/tensorflow/core/kernels/depthtospace_op.cc b/tensorflow/core/kernels/depthtospace_op.cc +--- a/tensorflow/core/kernels/depthtospace_op.cc ++++ b/tensorflow/core/kernels/depthtospace_op.cc +@@ -117,13 +117,13 @@ + // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32. + auto Tinput_v = input.template reinterpret_last_dimension(); + auto Toutput_v = outputs_tensor->reinterpret_last_dimension(); +- functor::DepthToSpaceOpFunctor functor; +- functor(context->eigen_device(), Tinput_v, block_size_, ++ functor::DepthToSpaceOpFunctor functor; ++ functor(context->eigen_device(), Tinput_v, block_size_, + Toutput_v); + return; + } else if (data_format_ == FORMAT_NCHW) { +- functor::DepthToSpaceOpFunctor functor; +- functor(context->eigen_device(), Tinput, block_size_, ++ functor::DepthToSpaceOpFunctor functor; ++ functor(context->eigen_device(), Tinput, block_size_, + Toutput); + return; + } +@@ -173,6 +173,15 @@ + } + } + }; ++#ifdef WIN32 ++template ++struct DepthToSpaceOpFunctor { ++ void operator()(const CPUDevice& d, typename TTypes::ConstTensor input, ++ int block_size, typename TTypes::Tensor output) { ++ LOG(FATAL) << "dummy implementation to make debug build compile"; ++ } ++}; ++#endif + } // namespace functor + + #define REGISTER(type) \ + +diff --git a/tensorflow/core/kernels/spacetodepth_op.cc b/tensorflow/core/kernels/spacetodepth_op.cc +--- a/tensorflow/core/kernels/spacetodepth_op.cc ++++ b/tensorflow/core/kernels/spacetodepth_op.cc +@@ -119,13 +119,13 @@ + // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32. + auto Tinput_v = input.template reinterpret_last_dimension(); + auto Toutput_v = outputs_tensor->reinterpret_last_dimension(); +- functor::SpaceToDepthOpFunctor functor; +- functor(context->eigen_device(), Tinput_v, block_size_, ++ functor::SpaceToDepthOpFunctor functor; ++ functor(context->eigen_device(), Tinput_v, block_size_, + Toutput_v); + return; + } else if (data_format_ == FORMAT_NCHW) { +- functor::SpaceToDepthOpFunctor functor; +- functor(context->eigen_device(), Tinput, block_size_, ++ functor::SpaceToDepthOpFunctor functor; ++ functor(context->eigen_device(), Tinput, block_size_, + Toutput); + return; + } +@@ -173,6 +173,15 @@ + } + } + }; ++#ifdef WIN32 ++template ++struct SpaceToDepthOpFunctor { ++ void operator()(const CPUDevice& d, typename TTypes::ConstTensor input, ++ int block_size, typename TTypes::Tensor output) { ++ LOG(FATAL) << "dummy implementation to make debug build compile"; ++ } ++}; ++#endif + } // namespace functor + + #define REGISTER(type) \ diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py new file mode 100644 index 00000000000000..2542e085877e57 --- /dev/null +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -0,0 +1,38 @@ +import re +import sys + +with open(sys.argv[1], "r") as f_in: + with open("static_link.sh", "w") as f_out: + p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.so\\.1\\.14\\.0).+(@bazel-out\\S+libtensorflow_cc\\.so\\.1\\.14\\.0-2\\.params).*") + p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.so\\.1\\.14\\.0).+(@bazel-out\\S+libtensorflow_framework\\.so\\.1\\.14\\.0-2\\.params).*") + f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") + env = [] + found1 = False + found2 = False + for line in f_in: + if line.startswith("(cd"): + # new command, reset + env = [line] + else: + m1 = p_linker1.match(line) + m2 = p_linker2.match(line) + if m1: + for e in env: + f_out.write(e) + tokens = line.split() + line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2).replace(".so", ".a") + " " + m1.group(3).replace(".so", ".a") + ")" + f_out.write(line + "\n") + found1 = True + if found2: + break + elif m2 and len(env) > 4: + for e in env: + f_out.write(e) + tokens = line.split() + line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2).replace(".so", ".a") + " " + m2.group(3).replace(".so", ".a") + ")" + f_out.write(line + "\n") + found2 = True + if found1: + break + else: + env.append(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py new file mode 100644 index 00000000000000..707acb9b2c283e --- /dev/null +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -0,0 +1,38 @@ +import re +import sys + +with open(sys.argv[1], "r") as f_in: + with open("static_link.sh", "w") as f_out: + p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.1\\.14\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_cc\\.1\\.14\\.0\\.dylib-2\\.params).*") + p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.1\\.14\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_framework\\.1\\.14\\.0\\.dylib-2\\.params).*") + f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") + env = [] + found1 = False + found2 = False + for line in f_in: + if line.startswith("(cd"): + # new command, reset + env = [line] + else: + m1 = p_linker1.match(line) + m2 = p_linker2.match(line) + if m1: + for e in env: + f_out.write(e) + tokens = line.split() + line = "\"" + m1.group(1) + "ar\" -rcs " + m1.group(2).replace(".dylib", ".a") + " " + m1.group(3).replace(".dylib", ".a") + ")" + f_out.write(line + "\n") + found1 = True + if found2: + break + elif m2 and len(env) > 4: + for e in env: + f_out.write(e) + tokens = line.split() + line = "\"" + m2.group(1) + "ar\" -rcs " + m2.group(2).replace(".dylib", ".a") + " " + m2.group(3).replace(".dylib", ".a") + ")" + f_out.write(line + "\n") + found2 = True + if found1: + break + else: + env.append(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_windows.py b/ports/tensorflow-cc/generate_static_link_cmd_windows.py new file mode 100644 index 00000000000000..b3c01d2d218772 --- /dev/null +++ b/ports/tensorflow-cc/generate_static_link_cmd_windows.py @@ -0,0 +1,41 @@ +import os.path +import re +import sys + +with open(sys.argv[1], "r") as f_in: + with open("static_link.bat", "w") as f_out: + p_setenv = re.compile("^\s*(SET .+=.*)$") + p_linker = re.compile(".+link\\.exe.+tensorflow_cc\\.dll-2\\.params.*") + env = [] + for line in f_in: + if line.startswith("cd"): + # new command, reset + env = [] + else: + m = p_setenv.match(line) + if m: + env.append(m.group(1)) + else: + m = p_linker.match(line) + if m: + for e in env: + f_out.write(e + "\n") + tokens = line.split() + line = "\"" + params_file = None + for t in tokens: + if t.endswith("link.exe"): + t = t[:-len("link.exe")] + "lib.exe\"" + elif t == "/DLL" or t.lower()[1:].startswith("defaultlib:") or t.lower()[1:].startswith("ignore") or t.startswith("/OPT:") or t.startswith("/DEF:") or t.startswith("/DEBUG:") or t.startswith("/INCREMENTAL:"): + continue + elif t[0] == '@' and t.endswith("tensorflow_cc.dll-2.params"): + t = t[:-len("dll-2.params")] + "lib-2.params" + params_file = t[1:] + line += t + " " + f_out.write(line + "\n") + # check for more parts if library needs to be split + file_no = 2 + while os.path.isfile(params_file + "-part%d" % file_no): + f_out.write(line.replace("lib-2.params", "lib-2.params-part%d" % file_no) + "\n") + file_no += 1 + break diff --git a/ports/tensorflow-cc/handcrafted_dummy.lib b/ports/tensorflow-cc/handcrafted_dummy.lib new file mode 100644 index 0000000000000000000000000000000000000000..5d4d05f76c6783cd5d6e0c464786d66629e2f7e3 GIT binary patch literal 260 zcmY$iNi0gvu;bEKKm~@TmgWX#CZ>kQsNx1tt_fT?fr|kMNY!tFrXOqunjwVT0CS6i OLIRgQf&(_06ukgYL?rhB literal 0 HcmV?d00001 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index fb581181b6018f..9205f3471543df 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,21 +1,36 @@ -message(WARNING "This tensorflow port currently is experimental on Windows and Linux platforms.") +message(STATUS "This TensorFlow port currently is experimental.") -if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - message(FATAL_ERROR "TensorFlow does not support 32bit systems.") +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + message(FATAL_ERROR "TensorFlow does not support 32bit systems.") +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tensorflow/tensorflow + REF v1.14.0 + SHA512 ac9ea5a2d1c761aaafbdc335259e29c128127b8d069ec5b206067935180490aa95e93c7e13de57f7f54ce4ba4f34a822face22b4a028f60185edb380e5cd4787 + HEAD_REF master + PATCHES + file-exists.patch # required or otherwise it cant find python lib path on windows + fix-build-error.patch # Fix namespace error + fix-dbg-build-errors.patch # Fix no return statement + ) +else() + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tensorflow/tensorflow + REF v1.14.0 + SHA512 ac9ea5a2d1c761aaafbdc335259e29c128127b8d069ec5b206067935180490aa95e93c7e13de57f7f54ce4ba4f34a822face22b4a028f60185edb380e5cd4787 + HEAD_REF master + PATCHES + file-exists.patch # required or otherwise it cant find python lib path on windows + fix-build-error.patch # Fix namespace error + fix-dbg-build-errors.patch # Fix no return statement + change-macros-for-static-lib.patch # there is no static build option - change macros via patch and link library manually at the end + ) endif() -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO tensorflow/tensorflow - REF v1.14.0 - SHA512 ac9ea5a2d1c761aaafbdc335259e29c128127b8d069ec5b206067935180490aa95e93c7e13de57f7f54ce4ba4f34a822face22b4a028f60185edb380e5cd4787 - HEAD_REF master - PATCHES - file-exists.patch # required or otherwise it cant find python lib path on windows - fix-build-error.patch # Fix namespace error -) - -# due to https://github.com/bazelbuild/bazel/issues/8028, bazel must be version 25.0 or higher vcpkg_find_acquire_program(BAZEL) get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) @@ -27,26 +42,19 @@ vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) - file(REMOVE_RECURSE ${PATH_TO_REMOVE}) - if (EXISTS "${PATH_TO_REMOVE}") - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) - file(REMOVE_RECURSE ${PATH_TO_REMOVE}) - endif() + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + if(EXISTS "${PATH_TO_REMOVE}") + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) + file(REMOVE_RECURSE ${PATH_TO_REMOVE}) + endif() endfunction() -# we currently only support the release version -tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -file(GLOB SOURCES ${SOURCE_PATH}/*) -file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) - set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) - set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) - - set(ENV{BAZEL_VS} $ENV{VSInstallDir}) - set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) + set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) + set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) + set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() # tensorflow has long file names, which will not work on windows @@ -76,41 +84,187 @@ set(ENV{CC_OPT_FLAGS} "/arch:AVX") set(ENV{TF_NEED_CUDA} 0) set(ENV{TF_CONFIGURE_IOS} 0) -message(STATUS "Configuring TensorFlow") +file(GLOB SOURCES ${SOURCE_PATH}/*) -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel -) -message(STATUS "Warning: Building TensorFlow can take an hour or more.") +foreach(BUILD_TYPE dbg rel) + message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") + tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) -if(CMAKE_HOST_WIN32) - vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures -c opt --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true ///tensorflow:libtensorflow_cc.so ///tensorflow:install_headers" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel - ) -else() - vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures -c opt --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel - ) -endif() + vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME config-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + + message(STATUS "Warning: Building TensorFlow can take an hour or more.") + if(BUILD_TYPE STREQUAL dbg) + if(CMAKE_HOST_WIN32) + set(BUILD_OPTS "--compilation_mode=fastbuild") # link with /DEBUG:FASTBUILD instead of /DEBUG:FULL to avoid .pdb >4GB error + else() + set(BUILD_OPTS "--compilation_mode=dbg") + endif() + else() + set(BUILD_OPTS "--compilation_mode=opt") + endif() + + if(CMAKE_HOST_WIN32) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_execute_build_process( + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + else() + if(BUILD_TYPE STREQUAL dbg) + set(CRT_OPT "-MTd") + else() + set(CRT_OPT "-MT") + endif() + vcpkg_execute_build_process( + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt=${CRT_OPT} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_windows.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND static_link.bat + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_execute_build_process( + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + else() + vcpkg_execute_build_process( + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_macos.py" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_macos.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND sh static_link.sh + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() + else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_execute_build_process( + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + else() + vcpkg_execute_build_process( + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_linux.py" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_linux.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND sh static_link.sh + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() + endif() + + if(BUILD_TYPE STREQUAL dbg) + set(DIR_PREFIX "/debug") + else() + set(DIR_PREFIX "") + endif() + + if(CMAKE_HOST_WIN32) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.dll DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) + # rename before copy because after copy the file might be locked by anti-malware scanners for some time so that renaming fails + file(RENAME ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.dll.if.lib ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + if(BUILD_TYPE STREQUAL dbg) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.pdb DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) + message(STATUS "Warning: debug information tensorflow_cc.pdb will be of limited use because only reduced set could be produced due to 4GB internal pdb limit") + endif() + else() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + # library might have been split because no more than 4GB are supported even on x64 Windows + foreach(PART_NO RANGE 2 100) + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + else() + if(BUILD_TYPE STREQUAL dbg) + break() + else() + # vcpkg postbuild checks require the same number of libs for debug and release => copy dummy libs in release case + # dummy libs must be empty so that no symbol redefinition conflicts occur + # empty handcrafted_dummy.lib built using reverse-engineered .lib format using ArHandler.cpp from 7zip sources + if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/tensorflow_cc-part${PART_NO}.lib) + # misuse configure_file to achieve atomic copy+rename to avoid anti-malware scanners blocking file after copy and making rename fail + configure_file(${CMAKE_CURRENT_LIST_DIR}/handcrafted_dummy.lib ${CURRENT_PACKAGES_DIR}/lib/tensorflow_cc-part${PART_NO}.lib COPYONLY) + else() + break() + endif() + endif() + endif() + endforeach() + endif() + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.1.14.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.1.14.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + else() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.1.14.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.1.14.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + endif() + else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + else() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.a.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.a.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + endif() + endif() +endforeach() file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-genfiles/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) -if(CMAKE_HOST_WIN32) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0.if.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0.if.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_framework.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/libtensorflow_framework.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) From 4860a011f941cfd3bf7930410b4cea765599db9d Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 15 Aug 2020 22:41:53 +0200 Subject: [PATCH 05/95] upgrade tensorflow from v1.14 to v2.3 - adapt patch files to tensorflow code changes - update bazel from v0.25.2 to v3.1 - on Windows use python installed on the host instead of embedded python obtained via vcpkg because embedded python lacks pip, which we need to obtain numpy - on Windows add MSYS2 to the PATH so that bazel tools can access MSYS2 GIT - add support for custom CA certificates when using HTTPS_PROXY --- ports/tensorflow-cc/CONTROL | 4 +- .../change-macros-for-static-lib.patch | 115 +++++++++++++++++- .../tensorflow-cc/fix-dbg-build-errors.patch | 37 +++--- ports/tensorflow-cc/portfile.cmake | 50 ++++++-- .../cmake/vcpkg_find_acquire_program.cmake | 8 +- 5 files changed, 177 insertions(+), 37 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 2d0ff50073eb4a..89cdcdeba1679f 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,6 +1,6 @@ Source: tensorflow-cc -Version: 1.14 -Port-Version: 5 +Version: 2.3 +Port-Version: 1 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/change-macros-for-static-lib.patch b/ports/tensorflow-cc/change-macros-for-static-lib.patch index 446f9c0c93b7c5..e338c0b378a5df 100644 --- a/ports/tensorflow-cc/change-macros-for-static-lib.patch +++ b/ports/tensorflow-cc/change-macros-for-static-lib.patch @@ -5,7 +5,7 @@ diff --git a/tensorflow/core/platform/macros.h b/tensorflow/core/platform/macros #define TF_SCANF_ATTRIBUTE(string_index, first_to_check) #endif --// Control visiblity outside .so +-// Control visibility outside .so -#if defined(_WIN32) -#ifdef TF_COMPILE_LIBRARY -#define TF_EXPORT __declspec(dllexport) @@ -23,7 +23,7 @@ diff --git a/tensorflow/core/platform/macros.h b/tensorflow/core/platform/macros diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h --- a/tensorflow/c/c_api.h +++ b/tensorflow/c/c_api.h -@@ -67,24 +67,7 @@ +@@ -70,24 +70,7 @@ // and the API just provides high level controls over the number of // devices of each type. @@ -31,7 +31,7 @@ diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h -// .dylib, .dll). -// This duplicates the TF_EXPORT macro definition in -// tensorflow/core/platform/macros.h in order to keep this .h file independent --// of any other includes.$a +-// of any other includes. -#ifdef SWIG #define TF_CAPI_EXPORT -#else @@ -78,12 +78,117 @@ diff --git a/tensorflow/c/c_api_experimental.h b/tensorflow/c/c_api_experimental #ifdef __cplusplus extern "C" { +diff --git a/tensorflow/c/c_api_macros.h b/tensorflow/c/c_api_macros.h +--- a/tensorflow/c/c_api_macros.h ++++ b/tensorflow/c/c_api_macros.h +@@ -16,18 +16,6 @@ + #ifndef TENSORFLOW_C_C_API_MACROS_H_ + #define TENSORFLOW_C_C_API_MACROS_H_ + +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #endif // TENSORFLOW_C_C_API_MACROS_H_ + +diff --git a/tensorflow/c/kernels.h b/tensorflow/c/kernels.h +--- a/tensorflow/c/kernels.h ++++ b/tensorflow/c/kernels.h +@@ -21,24 +21,7 @@ + #include "tensorflow/c/tf_datatype.h" + #include "tensorflow/c/tf_status.h" + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes. +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + diff --git a/tensorflow/c/ops.h b/tensorflow/c/ops.h --- a/tensorflow/c/ops.h +++ b/tensorflow/c/ops.h -@@ -75,19 +75,7 @@ +@@ -76,19 +76,7 @@ + #include "tensorflow/c/tf_datatype.h" + #include "tensorflow/c/tf_status.h" - #include "tensorflow/c/c_api.h" +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + +diff --git a/tensorflow/c/tf_datatype.h b/tensorflow/c/tf_datatype.h +--- a/tensorflow/c/tf_datatype.h ++++ b/tensorflow/c/tf_datatype.h +@@ -18,24 +18,7 @@ + + #include + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes. +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + +diff --git a/tensorflow/c/tf_status.h b/tensorflow/c/tf_status.h +--- a/tensorflow/c/tf_status.h ++++ b/tensorflow/c/tf_status.h +@@ -16,19 +16,7 @@ + #ifndef TENSORFLOW_C_TF_STATUS_H_ + #define TENSORFLOW_C_TF_STATUS_H_ -#ifdef SWIG #define TF_CAPI_EXPORT diff --git a/ports/tensorflow-cc/fix-dbg-build-errors.patch b/ports/tensorflow-cc/fix-dbg-build-errors.patch index 7192e0cdb0761e..ee2f9bad2afa79 100644 --- a/ports/tensorflow-cc/fix-dbg-build-errors.patch +++ b/ports/tensorflow-cc/fix-dbg-build-errors.patch @@ -1,19 +1,19 @@ -diff --git a/tensorflow/core/lib/io/path.cc b/tensorflow/core/lib/io/path.cc ---- a/tensorflow/core/lib/io/path.cc -+++ b/tensorflow/core/lib/io/path.cc -@@ -287,6 +287,7 @@ +diff --git a/tensorflow/core/platform/path.cc b/tensorflow/core/platform/path.cc +--- a/tensorflow/core/platform/path.cc ++++ b/tensorflow/core/platform/path.cc +@@ -329,6 +329,7 @@ } LOG(FATAL) << "No temp directory found."; #endif + return ""; } - } // namespace io + bool GetTestUndeclaredOutputsDir(string* dir) { diff --git a/tensorflow/core/framework/device_base.cc b/tensorflow/core/framework/device_base.cc --- a/tensorflow/core/framework/device_base.cc +++ b/tensorflow/core/framework/device_base.cc -@@ -27,10 +27,12 @@ +@@ -65,10 +65,12 @@ const DeviceAttributes& DeviceBase::attributes() const { LOG(FATAL) << "Device does not implement attributes()"; @@ -68,7 +68,7 @@ diff --git a/tensorflow/core/kernels/depthtospace_op.cc b/tensorflow/core/kernel diff --git a/tensorflow/core/kernels/spacetodepth_op.cc b/tensorflow/core/kernels/spacetodepth_op.cc --- a/tensorflow/core/kernels/spacetodepth_op.cc +++ b/tensorflow/core/kernels/spacetodepth_op.cc -@@ -119,13 +119,13 @@ +@@ -132,18 +132,18 @@ // NCHW_VECT_C with 4 x qint8 can be treated as NCHW int32. auto Tinput_v = input.template reinterpret_last_dimension(); auto Toutput_v = outputs_tensor->reinterpret_last_dimension(); @@ -77,16 +77,23 @@ diff --git a/tensorflow/core/kernels/spacetodepth_op.cc b/tensorflow/core/kernel + functor::SpaceToDepthOpFunctor functor; + functor(context->eigen_device(), Tinput_v, block_size_, Toutput_v); - return; } else if (data_format_ == FORMAT_NCHW) { -- functor::SpaceToDepthOpFunctor functor; -- functor(context->eigen_device(), Tinput, block_size_, -+ functor::SpaceToDepthOpFunctor functor; -+ functor(context->eigen_device(), Tinput, block_size_, - Toutput); - return; + CHECK((std::is_same::value)); +- functor::SpaceToDepthOpFunctor functor; +- functor(context->eigen_device(), input.tensor(), ++ functor::SpaceToDepthOpFunctor functor; ++ functor(context->eigen_device(), input.tensor(), + block_size_, outputs_tensor->tensor()); + } else { + CHECK((std::is_same::value)); +- functor::SpaceToDepthOpFunctor functor; +- functor(context->eigen_device(), input.tensor(), ++ functor::SpaceToDepthOpFunctor functor; ++ functor(context->eigen_device(), input.tensor(), + block_size_, outputs_tensor->tensor()); } -@@ -173,6 +173,15 @@ + } else { +@@ -188,6 +188,15 @@ } } }; diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 9205f3471543df..cce74b60f9ebad 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -8,8 +8,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow - REF v1.14.0 - SHA512 ac9ea5a2d1c761aaafbdc335259e29c128127b8d069ec5b206067935180490aa95e93c7e13de57f7f54ce4ba4f34a822face22b4a028f60185edb380e5cd4787 + REF v2.3.0 + SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac HEAD_REF master PATCHES file-exists.patch # required or otherwise it cant find python lib path on windows @@ -20,8 +20,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow - REF v1.14.0 - SHA512 ac9ea5a2d1c761aaafbdc335259e29c128127b8d069ec5b206067935180490aa95e93c7e13de57f7f54ce4ba4f34a822face22b4a028f60185edb380e5cd4787 + REF v2.3.0 + SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac HEAD_REF master PATCHES file-exists.patch # required or otherwise it cant find python lib path on windows @@ -36,7 +36,16 @@ get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) set(ENV{BAZEL_BIN_PATH} "${BAZEL}") -vcpkg_find_acquire_program(PYTHON3) +if(CMAKE_HOST_WIN32) + # vcpkg_find_acquire_program not suitable on Windows because it only installs python embedded, but we need full python + find_package(Python3 COMPONENTS Interpreter) + if(NOT Python3_Interpreter_FOUND) + message(FATAL_ERROR "Python3 not found. Please install and add to PATH.") + endif() + set(PYTHON3 "${Python3_EXECUTABLE}") +else() + vcpkg_find_acquire_program(PYTHON3) +endif() get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") @@ -51,6 +60,7 @@ endfunction() if(CMAKE_HOST_WIN32) vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) + vcpkg_add_to_path(PREPEND ${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) @@ -86,6 +96,8 @@ set(ENV{TF_CONFIGURE_IOS} 0) file(GLOB SOURCES ${SOURCE_PATH}/*) +vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" LOGNAME prerequesits-${TARGET_TRIPLET}) + foreach(BUILD_TYPE dbg rel) message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) @@ -98,6 +110,22 @@ foreach(BUILD_TYPE dbg rel) LOGNAME config-${TARGET_TRIPLET}-${BUILD_TYPE} ) + if(DEFINED ENV{BAZEL_CUSTOM_CACERTS}) + file(APPEND ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/.bazelrc "startup --host_jvm_args=-Djavax.net.ssl.trustStore='$ENV{BAZEL_CUSTOM_CACERTS}'\n") + message(STATUS "Using custom CA certificate store at: $ENV{BAZEL_CUSTOM_CACERTS}") + if(DEFINED ENV{BAZEL_CUSTOM_CACERTS_PASSWORD}) + file(APPEND ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/.bazelrc "startup --host_jvm_args=-Djavax.net.ssl.trustStorePassword='$ENV{BAZEL_CUSTOM_CACERTS_PASSWORD}'\n") + message(STATUS "Using supplied custom CA certificate store password.") + endif() + else() + if(DEFINED ENV{HTTPS_PROXY}) + message(STATUS "You are using HTTPS_PROXY. In case you encounter bazel certificate errors, you might want to set: BAZEL_CUSTOM_CACERTS=/path/to/trust.store (and optionally BAZEL_CUSTOM_CACERTS_PASSWORD), and to enable vcpkg to actually use it: VCPKG_KEEP_ENV_VARS=BAZEL_CUSTOM_CACERTS;BAZEL_CUSTOM_CACERTS_PASSWORD") + if(CMAKE_HOST_WIN32) + message(STATUS "(For BAZEL_CUSTOM_CACERTS please use forward slashes instead of backslashes on Windows systems.") + endif() + endif() + endif() + message(STATUS "Warning: Building TensorFlow can take an hour or more.") if(BUILD_TYPE STREQUAL dbg) if(CMAKE_HOST_WIN32) @@ -112,7 +140,7 @@ foreach(BUILD_TYPE dbg rel) if(CMAKE_HOST_WIN32) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -123,7 +151,7 @@ foreach(BUILD_TYPE dbg rel) set(CRT_OPT "-MT") endif() vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt=${CRT_OPT} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt=${CRT_OPT} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -146,13 +174,13 @@ foreach(BUILD_TYPE dbg rel) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -175,13 +203,13 @@ foreach(BUILD_TYPE dbg rel) else() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --incompatible_disable_deprecated_attr_params=false --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index a5aefdc29297cd..6717afd4418fc6 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -317,7 +317,7 @@ function(vcpkg_find_acquire_program VAR) set(HASH 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b) elseif(VAR MATCHES "BAZEL") set(PROGNAME bazel) - set(BAZEL_VERSION 0.25.2) + set(BAZEL_VERSION 3.1.0) set(SUBDIR ${BAZEL_VERSION}) set(PATHS ${DOWNLOADS}/tools/bazel/${SUBDIR}) set(_vfa_RENAME "bazel") @@ -326,17 +326,17 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64") set(ARCHIVE "bazel-${BAZEL_VERSION}-linux-x86_64") set(NOEXTRACT ON) - set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1) + set(HASH 605118766dbe07d04f4f15a809b231247eef3f302c431dcb712a514244662a47d3eb784add3b20d69d415954f7a95f9988215560911079289170a383343398d1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(_vfa_SUPPORTED ON) set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64") set(NOEXTRACT ON) - set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c) + set(HASH 8b21ee801a84009455ab6668c9b1f3225fffc517ffa6af5e8112e64a40558210a7a6384c6c30edabb320532d5c6d71bb476b001b6b07fb65e5378bfa3a9de082) else() set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip") - set(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53) + set(HASH a17fdc04e9ae12a06366a7a96c89240f95debc428ff8efba6b6d8ea160bfd25fed76b2d14cc49c07ec68d4e6bd8dd5ef3872ecc3f35dba3824e70a78245ec40a) endif() # Download Tools elseif(VAR MATCHES "ARIA2") From dd6d89f51c8eb4e8332c6ff3b28c6810ea4bd290 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 15 Aug 2020 23:02:46 +0200 Subject: [PATCH 06/95] fix execute process macro The existing implementation totally screwed up commands if the command's arguments contained semicolons (this is the case, e.g., in the FindPython modules of the cmake distribution). --- scripts/cmake/execute_process.cmake | 43 +++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake index 51f6ad160348ea..779392f9825d92 100644 --- a/scripts/cmake/execute_process.cmake +++ b/scripts/cmake/execute_process.cmake @@ -13,8 +13,45 @@ if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) message(FATAL_ERROR "This command cannot be executed in Download Mode.\nHalting portfile execution.\n") endmacro() else() - macro(execute_process) - _execute_process(${ARGV}) - endmacro() + function(execute_process) + # check that COMMAND is not supplied more than once; if there's ever a use case for this, the implementation below needs to be extended + set(command_count 0) + foreach(arg ${ARGV}) + if(arg STREQUAL COMMAND) + math(EXPR command_count "${command_count} + 1") + endif() + endforeach() + if(NOT command_count EQUAL 1) + message(FATAL_ERROR "Overriden execute_process() function only supports 1 COMMAND parameter.\n") + endif() + + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 overriden_execute_process + "OUTPUT_QUIET;ERROR_QUIET;OUTPUT_STRIP_TRAILING_WHITESPACE;ERROR_STRIP_TRAILING_WHITESPACE" + "WORKING_DIRECTORY;TIMEOUT;RESULT_VARIABLE;RESULTS_VARIABLE;OUTPUT_VARIABLE;ERROR_VARIABLE;INPUT_FILE;OUTPUT_FILE;ERROR_FILE;ENCODING" + "COMMAND") + + # collect all other present parameters + set(other_args "") + foreach(arg OUTPUT_QUIET ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) + if(overriden_execute_process_${arg}) + list(APPEND other_args ${arg}) + endif() + endforeach() + foreach(arg WORKING_DIRECTORY TIMEOUT RESULT_VARIABLE RESULTS_VARIABLE OUTPUT_VARIABLE ERROR_VARIABLE INPUT_FILE OUTPUT_FILE ERROR_FILE ENCODING) + if(overriden_execute_process_${arg}) + list(APPEND other_args ${arg} ${overriden_execute_process_${arg}}) + endif() + endforeach() + + _execute_process(COMMAND ${overriden_execute_process_COMMAND} ${other_args}) + + # pass output parameters back to caller's scope + foreach(arg RESULT_VARIABLE RESULTS_VARIABLE OUTPUT_VARIABLE ERROR_VARIABLE) + if(overriden_execute_process_${arg}) + set(${overriden_execute_process_${arg}} ${${overriden_execute_process_${arg}}} PARENT_SCOPE) + endif() + endforeach() + endfunction() endif() endif() \ No newline at end of file From 0d611be2e20f8d48f7b09a29a3809a1e78015d0f Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 17 Aug 2020 15:07:32 +0200 Subject: [PATCH 07/95] extend overriden execute_process to more than one COMMAND as there actually are use cases for this --- scripts/cmake/execute_process.cmake | 56 ++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake index 779392f9825d92..992e5f1b2fb302 100644 --- a/scripts/cmake/execute_process.cmake +++ b/scripts/cmake/execute_process.cmake @@ -14,23 +14,53 @@ if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) endmacro() else() function(execute_process) - # check that COMMAND is not supplied more than once; if there's ever a use case for this, the implementation below needs to be extended - set(command_count 0) - foreach(arg ${ARGV}) - if(arg STREQUAL COMMAND) - math(EXPR command_count "${command_count} + 1") - endif() - endforeach() - if(NOT command_count EQUAL 1) - message(FATAL_ERROR "Overriden execute_process() function only supports 1 COMMAND parameter.\n") - endif() - - # parse parameters such that semicolons in options arguments to COMMAND don't get erased + # parse parameters such that semicolons in arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 overriden_execute_process "OUTPUT_QUIET;ERROR_QUIET;OUTPUT_STRIP_TRAILING_WHITESPACE;ERROR_STRIP_TRAILING_WHITESPACE" "WORKING_DIRECTORY;TIMEOUT;RESULT_VARIABLE;RESULTS_VARIABLE;OUTPUT_VARIABLE;ERROR_VARIABLE;INPUT_FILE;OUTPUT_FILE;ERROR_FILE;ENCODING" "COMMAND") + # overriden_execute_process_COMMAND contains all commands' arguments concatenated together (yes, there can be multiple COMMANDs) + # - we need to separate the commands and prepend COMMAND to each command's arguments + # - to find out where the next command's arguments begin, we need to iterate over the original input (ARGV) + # - as ARGV however is screwed up, we won't find the same elements as in correctly parsed overriden_execute_process_COMMAND, + # so we need to search elements of overriden_execute_process_COMMAND that start with the fractional element found in ARGV after COMMAND + # - we can't use list(INSERT ...) as this breaks escaped semicolons; thus, we iterate and rebuild overriden_execute_process_COMMAND with COMMANDs added + set(rebuilt_commands "") + # search first command's first argument + math(EXPR last_idx "${ARGC} - 1") + set(first_arg_idx 0) + set(more_commands_following 0) + foreach(idx RANGE ${first_arg_idx} ${last_idx}) + list(GET ARGV ${idx} arg) + if(arg STREQUAL COMMAND) + set(more_commands_following 1) + math(EXPR first_arg_idx "${idx} + 1") + list(GET ARGV ${first_arg_idx} first_fractional_arg) + break() + endif() + endforeach() + # iterate and rebuild overriden_execute_process_COMMAND + foreach(arg2 ${overriden_execute_process_COMMAND}) + if(more_commands_following AND arg2 MATCHES "^${first_fractional_arg}") + list(APPEND rebuilt_commands COMMAND) + # search next command's first argument + set(more_commands_following 0) + foreach(idx RANGE ${first_arg_idx} ${last_idx}) + list(GET ARGV ${idx} arg) + if(arg STREQUAL COMMAND) + set(more_commands_following 1) + math(EXPR first_arg_idx "${idx} + 1") + list(GET ARGV ${first_arg_idx} first_fractional_arg) + break() + endif() + endforeach() + endif() + # double escape argument so that list finally contains once escaped argument + string(REPLACE ";" "\\\\;" escaped_arg "${arg2}") + list(APPEND rebuilt_commands ${escaped_arg}) + endforeach() + # collect all other present parameters set(other_args "") foreach(arg OUTPUT_QUIET ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) @@ -44,7 +74,7 @@ if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) endif() endforeach() - _execute_process(COMMAND ${overriden_execute_process_COMMAND} ${other_args}) + _execute_process(${rebuilt_commands} ${other_args}) # pass output parameters back to caller's scope foreach(arg RESULT_VARIABLE RESULTS_VARIABLE OUTPUT_VARIABLE ERROR_VARIABLE) From ad5ca5f0a16f3b098f549c67c8710052ae3698b0 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 18 Aug 2020 11:05:28 +0200 Subject: [PATCH 08/95] added another patch required for tensorflow v2.3, fixed path and working directory --- ports/tensorflow-cc/fix-more-build-errors.patch | 11 +++++++++++ ports/tensorflow-cc/portfile.cmake | 8 ++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 ports/tensorflow-cc/fix-more-build-errors.patch diff --git a/ports/tensorflow-cc/fix-more-build-errors.patch b/ports/tensorflow-cc/fix-more-build-errors.patch new file mode 100644 index 00000000000000..32ab019b69a5f1 --- /dev/null +++ b/ports/tensorflow-cc/fix-more-build-errors.patch @@ -0,0 +1,11 @@ +diff --git a/tensorflow/core/distributed_runtime/remote_device.cc b/tensorflow/core/distributed_runtime/remote_device.cc +--- a/tensorflow/core/distributed_runtime/remote_device.cc ++++ b/tensorflow/core/distributed_runtime/remote_device.cc +@@ -45,6 +45,7 @@ + ResourceMgr* resource_manager() override { + LOG(FATAL) << "Accessing the resource manager of a remote device is not " + << "supported."; ++ return nullptr; + } + + bool IsLocal() const override { return false; } diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index cce74b60f9ebad..8dc269f93c0299 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -15,6 +15,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file-exists.patch # required or otherwise it cant find python lib path on windows fix-build-error.patch # Fix namespace error fix-dbg-build-errors.patch # Fix no return statement + fix-more-build-errors.patch # Fix no return statement ) else() vcpkg_from_github( @@ -27,6 +28,7 @@ else() file-exists.patch # required or otherwise it cant find python lib path on windows fix-build-error.patch # Fix namespace error fix-dbg-build-errors.patch # Fix no return statement + fix-more-build-errors.patch # Fix no return statement change-macros-for-static-lib.patch # there is no static build option - change macros via patch and link library manually at the end ) endif() @@ -96,7 +98,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) file(GLOB SOURCES ${SOURCE_PATH}/*) -vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" LOGNAME prerequesits-${TARGET_TRIPLET}) +vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-${TARGET_TRIPLET}) foreach(BUILD_TYPE dbg rel) message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") @@ -289,7 +291,7 @@ foreach(BUILD_TYPE dbg rel) endif() endforeach() -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-genfiles/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") @@ -300,3 +302,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAG file(COPY ${CMAKE_CURRENT_LIST_DIR}/TensorflowCCConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/TensorflowCCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + +message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${CURRENT_BUILDTREES_DIR}/../.bzl to free diskspace.") From c743e49311bab2eb3b25274924aac641d3fd3066 Mon Sep 17 00:00:00 2001 From: jgehw <44170764+jgehw@users.noreply.github.com> Date: Tue, 18 Aug 2020 19:14:41 +0200 Subject: [PATCH 09/95] Revert "incorporate changes from microsoft:master" --- .gitattributes | 4 - .gitignore | 56 +- README.md | 2 +- .../examples/installing-and-using-packages.md | 8 +- .../overlay-triplets-linux-dynamic.md | 8 +- docs/maintainers/maintainer-guide.md | 28 - docs/maintainers/vcpkg_check_linkage.md | 4 +- docs/users/config-environment.md | 10 +- ports/3fd/vcpkg.json | 4 +- .../abseil/fix-cmake-threads-dependency.patch | 13 - ports/abseil/portfile.cmake | 5 +- ports/abseil/vcpkg.json | 4 +- ports/akali/CONTROL | 3 +- ports/alembic/CONTROL | 2 +- ports/alembic/fix-C1083.patch | 49 + ports/alembic/fix-find-openexr-ilmbase.patch | 351 ++- ports/alembic/portfile.cmake | 20 +- ports/apr/CONTROL | 3 +- ports/apr/portfile.cmake | 2 +- ports/argparse/vcpkg.json | 4 +- ports/argtable3/CONTROL | 4 + ports/argtable3/fix-cmake.patch | 98 + ports/argtable3/portfile.cmake | 25 +- ports/argtable3/vcpkg.json | 6 - ports/armadillo/CONTROL | 5 +- ports/arrow/CONTROL | 4 +- ports/arrow/all.patch | 146 +- ports/arrow/portfile.cmake | 14 +- ports/asiosdk/CONTROL | 2 +- ports/asiosdk/vcpkg-cmake-wrapper.cmake | 4 +- ports/asmjit/CONTROL | 2 +- ports/asmjit/portfile.cmake | 20 +- ports/audiofile/portfile.cmake | 13 - ports/audiofile/vcpkg.json | 7 - ports/avisynthplus/vcpkg.json | 2 +- ports/avro-cpp/CONTROL | 9 - ports/avro-cpp/install.patch | 100 - ports/avro-cpp/portfile.cmake | 35 - ports/azure-c-shared-utility/CONTROL | 4 +- ports/azure-c-shared-utility/portfile.cmake | 4 +- ports/azure-iot-sdk-c/CONTROL | 3 +- ports/azure-iot-sdk-c/portfile.cmake | 6 +- ports/azure-uamqp-c/CONTROL | 2 +- ports/azure-uamqp-c/portfile.cmake | 4 +- ports/azure-uhttp-c/CONTROL | 2 +- ports/azure-uhttp-c/portfile.cmake | 4 +- ports/azure-umqtt-c/CONTROL | 2 +- ports/azure-umqtt-c/portfile.cmake | 4 +- ports/blaze/CONTROL | 3 +- ports/blend2d/portfile.cmake | 8 +- ports/blend2d/vcpkg.json | 17 +- ports/bond/CONTROL | 2 +- ports/bond/fix-install-path.patch | 6 +- ports/bond/portfile.cmake | 6 +- ports/boost-asio/CONTROL | 3 +- ports/boost-build/CONTROL | 3 +- ports/boost-build/portfile.cmake | 2 +- ports/boost-context/CONTROL | 4 +- ports/boost-coroutine/CONTROL | 2 - ports/boost-fiber/CONTROL | 2 - ports/boost-filesystem/CONTROL | 2 - ports/boost-graph-parallel/CONTROL | 3 +- ports/boost-iostreams/CONTROL | 2 - ports/boost-locale/CONTROL | 4 +- ports/boost-log/CONTROL | 2 - .../boost-modular-build-helper/CMakeLists.txt | 13 +- ports/boost-modular-build-helper/CONTROL | 2 +- ports/boost-modular-build-helper/Jamroot.jam | 33 +- .../boost-modular-build.cmake | 39 +- ports/boost-mpi/CONTROL | 3 +- ports/boost-parameter-python/CONTROL | 3 +- ports/boost-poly-collection/CONTROL | 3 +- ports/boost-python/CONTROL | 2 - ports/boost-safe-numerics/CONTROL | 3 +- ports/boost-stacktrace/CONTROL | 2 - ports/boost-test/CONTROL | 2 - ports/boost-wave/CONTROL | 2 - ports/boost/CONTROL | 4 +- ports/brotli/CONTROL | 3 +- ports/brotli/pkgconfig.patch | 73 - ports/brotli/portfile.cmake | 3 - ports/brpc/CONTROL | 6 - ports/brpc/fix_boost_ptr.patch | 14 - ports/brpc/fix_thrift.patch | 28 - ports/brpc/portfile.cmake | 31 - ports/bzip2/CONTROL | 9 +- ports/bzip2/bzip2.pc.in | 11 - ports/bzip2/portfile.cmake | 95 +- ports/cairo/CMakeLists.txt | 2 +- ports/cairo/CONTROL | 3 +- ports/cairomm/CMakeLists.txt | 3 +- ports/cairomm/CONTROL | 3 +- ports/ceres/CONTROL | 5 +- ports/cgal/CONTROL | 2 +- ports/cgal/portfile.cmake | 4 +- ports/clapack/CONTROL | 3 +- ports/{lapack => }/clapack/FindLAPACK.cmake | 0 ports/clapack/portfile.cmake | 6 +- .../clapack/vcpkg-cmake-wrapper.cmake | 0 ports/colmap/portfile.cmake | 89 - ports/colmap/usage | 10 - ports/colmap/vcpkg.json | 55 - ports/constexpr-contracts/CONTROL | 4 - ports/constexpr-contracts/portfile.cmake | 20 - ports/coroutine/CONTROL | 6 + ports/coroutine/fix-errorC7651.patch | 68 - ports/coroutine/portfile.cmake | 1 - ports/coroutine/vcpkg.json | 11 - ports/cppad/CONTROL | 5 - ports/cppad/pkgconfig-fix.patch | 63 - ports/cppad/portfile.cmake | 42 - ports/cppad/windows-fix.patch | 105 - ...001-add-install-target-and-find-deps.patch | 809 ------- ports/crashrpt/CONTROL | 16 - ports/crashrpt/portfile.cmake | 53 - ports/cudnn/CONTROL | 1 - ports/cudnn/FindCUDNN.cmake | 5 - ports/cudnn/vcpkg-cmake-wrapper.cmake | 4 +- ports/curl/0002_fix_uwp.patch | 10 +- ports/curl/0008_fix_tools_path.patch | 13 + ports/curl/0011_fix_static_build.patch | 13 - ports/curl/CONTROL | 1 - ports/curl/portfile.cmake | 4 +- ports/darknet/CONTROL | 2 +- ports/darknet/fix_shared_static.patch | 20 - ports/darknet/portfile.cmake | 46 +- ports/date/0003-find-dependency-pthread.patch | 15 - ports/date/CONTROL | 1 - ports/date/portfile.cmake | 7 +- ports/date/usage | 4 + ports/date/vcpkg-cmake-wrapper.cmake | 11 + ports/dbghelp/CONTROL | 4 - ports/dbghelp/portfile.cmake | 27 - ports/directxsdk/portfile.cmake | 60 - ports/directxsdk/vcpkg.json | 7 - ports/dlib/CONTROL | 5 +- ports/embree3/CONTROL | 2 +- ports/embree3/fix-InstallPath.patch | 15 + ports/embree3/fix-cmake-path.patch | 163 ++ ports/embree3/fix-embree-path.patch | 26 + ports/embree3/fix-path.patch | 117 - ports/embree3/portfile.cmake | 48 +- ports/embree3/usage | 4 - ports/ensmallen/CONTROL | 3 +- ports/evpp/CONTROL | 3 +- ports/evpp/fix-linux-build.patch | 20 +- ports/farmhash/CONTROL | 3 +- ports/farmhash/portfile.cmake | 1 - ports/ffmpeg/CONTROL | 23 +- ports/ffmpeg/FindFFMPEG.cmake.in | 78 +- ports/ffmpeg/portfile.cmake | 50 - ports/ffmpeg/vcpkg-cmake-wrapper.cmake | 4 +- ports/field3d/0001_fix_build_errors.patch | 148 -- .../0002_improve_win_compatibility.patch | 43 - ports/field3d/0003_hdf5_api.patch | 12 - ports/field3d/CONTROL | 5 +- ports/field3d/fix-build_error.patch | 13 + ports/field3d/hdf5.api.patch | 14 + ports/field3d/portfile.cmake | 22 +- ports/fizz/CONTROL | 3 +- ports/fizz/fix-build_error.patch | 13 + ports/fizz/portfile.cmake | 4 +- ports/fltk/CONTROL | 3 +- ports/fltk/config-path.patch | 13 - ports/fltk/include.patch | 13 - ports/fltk/portfile.cmake | 60 +- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 26 +- ports/freeimage/CMakeLists.txt | 7 +- ports/freeimage/CONTROL | 3 +- ports/freetype-gl/CONTROL | 3 +- ports/freetype-gl/glew.patch | 13 - ports/freetype-gl/portfile.cmake | 1 - .../0002-Add-CONFIG_INSTALL_PATH-option.patch | 22 + ports/freetype/CONTROL | 4 +- ports/freetype/brotli-static.patch | 21 - ports/freetype/pkgconfig.patch | 20 - ports/freetype/portfile.cmake | 48 +- ports/freetype/vcpkg-cmake-wrapper.cmake | 11 - ports/freexl/CONTROL | 3 +- ports/freexl/portfile.cmake | 1 - ports/fribidi/CONTROL | 2 +- ports/fribidi/fix-win-static-suffix.patch | 42 +- ports/fribidi/portfile.cmake | 23 +- ports/g2o/CONTROL | 3 +- ports/gamedev-framework/CONTROL | 7 - ports/gamedev-framework/portfile.cmake | 48 - ports/geogram/CONTROL | 4 +- .../fix-cmake-config-and-install.patch | 26 +- ports/geogram/portfile.cmake | 43 +- ports/geographiclib/vcpkg.json | 2 +- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 2 +- ports/gmp/CONTROL | 5 + ports/gmp/portfile.cmake | 15 +- ports/gmp/vcpkg.json | 13 - ports/google-cloud-cpp/CONTROL | 2 +- ports/google-cloud-cpp/portfile.cmake | 4 +- ports/grpc/00011-fix-csharp_plugin.patch | 33 - ports/grpc/CONTROL | 1 - ports/grpc/portfile.cmake | 1 - ports/gsoap/CONTROL | 4 +- ports/gsoap/portfile.cmake | 7 +- ports/gtkmm/CONTROL | 3 +- ports/gtkmm/fix_treeviewcolumn.patch | 15 - ports/gtkmm/portfile.cmake | 1 - ports/healpix/CONTROL | 3 +- ports/healpix/portfile.cmake | 1 - ports/ignition-modularscripts/CONTROL | 1 - .../ignition_modular_library.cmake | 5 +- ports/ignition-msgs5/CONTROL | 1 - ports/ignition-msgs5/portfile.cmake | 2 +- ports/imgui/CMakeLists.txt | 8 +- ports/imgui/CONTROL | 2 +- ports/imgui/portfile.cmake | 4 - ports/implot/CONTROL | 2 +- ports/implot/portfile.cmake | 4 +- ports/itk/CONTROL | 34 +- ports/itk/cufftw.patch | 58 - ports/itk/double-conversion.patch | 16 - ports/itk/fix_libminc_config_path.patch | 13 + ports/itk/fix_openjpeg_search.patch | 13 + ports/itk/hdf5.patch | 20 - ports/itk/opencl.patch | 176 -- ports/itk/openjpeg.patch | 548 ----- ports/itk/openjpeg2.patch | 58 - ports/itk/portfile.cmake | 194 +- ports/itk/python_gpu_wrapping.patch | 178 -- ports/itk/rtk/already_defined.patch | 100 - ports/itk/rtk/unresolved.patch | 213 -- ports/itk/var_libraries.patch | 27 - ports/itk/wrapping.patch | 19 - ports/josuttis-jthread/CONTROL | 4 - ports/josuttis-jthread/portfile.cmake | 15 - ports/jsoncons/CONTROL | 4 +- ports/jsoncons/portfile.cmake | 4 +- ports/jxrlib/CONTROL | 2 +- ports/jxrlib/vcpkg-cmake-wrapper.cmake | 4 +- ports/kf5archive/CONTROL | 1 - ports/kf5archive/portfile.cmake | 12 +- ports/kf5completion/CONTROL | 5 - .../add-qdbus-to-required-libraries.patch | 13 - ports/kf5completion/portfile.cmake | 33 - ports/kf5config/CONTROL | 5 - ports/kf5config/portfile.cmake | 53 - ports/kf5coreaddons/CONTROL | 5 - ports/kf5coreaddons/portfile.cmake | 42 - ports/kf5crash/CONTROL | 6 - ports/kf5crash/add_x11extras.patch | 13 - ports/kf5crash/portfile.cmake | 31 - ports/kf5guiaddons/CONTROL | 5 - ports/kf5guiaddons/portfile.cmake | 29 - ports/kf5i18n/CONTROL | 5 - ports/kf5i18n/portfile.cmake | 35 - ports/kf5itemmodels/CONTROL | 5 - ports/kf5itemmodels/portfile.cmake | 28 - ports/kf5itemviews/CONTROL | 5 - ports/kf5itemviews/portfile.cmake | 29 - ports/kf5widgetsaddons/CONTROL | 5 - ports/kf5widgetsaddons/portfile.cmake | 30 - ports/kf5windowsystem/CONTROL | 5 - ports/kf5windowsystem/portfile.cmake | 29 - ports/lapack-reference/CONTROL | 16 - ports/lapack-reference/FindLAPACK.cmake | 568 ----- ports/lapack-reference/portfile.cmake | 123 - .../vcpkg-cmake-wrapper.cmake | 2 - ports/lapack/CMakeLists.txt | 5 - ports/lapack/CONTROL | 4 - ports/lapack/portfile.cmake | 10 - ports/libass/CMakeLists.txt | 44 +- ports/libass/CONTROL | 4 + ports/libass/portfile.cmake | 11 +- ports/libass/vcpkg.json | 16 - ports/libb2/portfile.cmake | 1 - ports/libb2/vcpkg.json | 2 +- ports/libcrafter/CONTROL | 5 +- ports/libcrafter/portfile.cmake | 1 - ports/libde265/CONTROL | 5 - ports/libde265/portfile.cmake | 24 - ports/libepoxy/CONTROL | 1 - ports/libepoxy/portfile.cmake | 19 +- ports/libevent/CONTROL | 2 +- .../fix-LibeventConfig_cmake_in_path.patch | 18 +- ports/libevent/fix-crt_linkage.patch | 13 + ports/libevent/fix-file_path.patch | 42 +- ports/libevent/portfile.cmake | 32 +- ports/libffi/CONTROL | 3 +- ports/libffi/portfile.cmake | 3 - .../win32-disable-stackframe-check.patch | 50 - .../win64-disable-stackframe-check.patch | 43 - ports/libflac/CONTROL | 3 +- ports/libflac/portfile.cmake | 41 +- ports/libftdi1/CONTROL | 2 +- ports/libftdi1/portfile.cmake | 10 +- ports/libgpod/CMakeLists.txt | 4 +- ports/libgpod/CONTROL | 1 - ports/libheif/CONTROL | 6 - .../dont_build_examples_and_gdk_pixbuf.patch | 13 - ports/libheif/install-extra-headers.patch | 12 - ports/libheif/portfile.cmake | 21 - ports/libheif/remove_finding_pkgconfig.patch | 18 - ports/libigl/CONTROL | 15 +- ports/libigl/fix-dependency.patch | 128 +- ports/libigl/portfile.cmake | 23 +- ports/liblzma/CONTROL | 1 - ports/liblzma/portfile.cmake | 8 +- ports/libmagic/CONTROL | 5 +- ports/libmagic/portfile.cmake | 1 - ports/libmariadb/CONTROL | 12 +- ports/libmariadb/portfile.cmake | 9 +- ports/libmodbus/CMakeLists.txt | 3 +- ports/libmodbus/CONTROL | 3 + ports/libmodbus/fix-static-linkage.patch | 13 - ports/libmodbus/portfile.cmake | 29 +- ports/libmodbus/vcpkg.json | 8 - ports/libmodman/CONTROL | 2 +- ports/libmodman/vcpkg-cmake-wrapper.cmake | 4 +- ports/libodb-sqlite/CMakeLists.txt | 4 +- ports/libodb-sqlite/CONTROL | 3 +- ports/libpng/CONTROL | 3 +- ports/libpng/pkgconfig.2.patch | 48 - ports/libpng/pkgconfig.patch | 24 - ports/libpng/portfile.cmake | 66 +- ports/libpq/CONTROL | 2 +- ports/libpq/portfile.cmake | 6 +- ports/libproxy/CONTROL | 2 +- ports/libproxy/vcpkg-cmake-wrapper.cmake | 4 +- ports/libraqm/CMakeLists.txt | 2 +- ports/libraqm/CONTROL | 3 +- ports/librdkafka/CONTROL | 2 +- ports/librdkafka/portfile.cmake | 9 +- ports/libressl/CONTROL | 3 +- ports/libressl/portfile.cmake | 31 +- ports/libsndfile/CONTROL | 3 +- ports/libsndfile/portfile.cmake | 4 + ports/libtorrent/CONTROL | 4 +- ports/libtorrent/portfile.cmake | 4 +- ports/libu2f-server/CONTROL | 3 - ports/libu2f-server/portfile.cmake | 6 - ports/libusb/CONTROL | 2 - ports/libusb/portfile.cmake | 82 +- ports/libvpx/CONTROL | 2 +- ports/libvpx/portfile.cmake | 9 +- ports/libwandio/CONTROL | 6 +- ports/libwandio/configure.lib.patch | 18 + ports/libwandio/configure.patch | 14 - ports/libwandio/curl.patch | 22 - ports/libwandio/openssl.patch | 22 - ports/libwandio/portfile.cmake | 11 - ports/libzip/CONTROL | 1 - ports/libzip/fix-findpackage.patch | 35 - ports/libzip/portfile.cmake | 1 - ports/log4cpp/CONTROL | 3 +- ports/log4cpp/fix-includepath.patch | 31 - ports/log4cpp/portfile.cmake | 10 +- ports/lzokay/portfile.cmake | 23 - ports/lzokay/vcpkg.json | 6 - ports/marble/CONTROL | 6 - ports/marble/portfile.cmake | 45 - ports/marble/qtfix.patch | 97 - ports/minc/CONTROL | 9 - ports/minc/build.patch | 67 - ports/minc/config.patch | 15 - ports/minc/portfile.cmake | 47 - ports/mlpack/CONTROL | 5 +- ports/mlpack/cmakelists.patch | 18 +- ports/monkeys-audio/CONTROL | 2 +- ports/monkeys-audio/portfile.cmake | 4 +- ports/mosquitto/CONTROL | 6 + ports/mosquitto/portfile.cmake | 5 +- ports/mosquitto/usage | 5 - ports/mosquitto/vcpkg-cmake-wrapper.cmake | 15 - ports/mosquitto/vcpkg.json | 13 - ports/mozjpeg/CONTROL | 3 +- ports/mozjpeg/fix-install-error.patch | 117 +- ports/mozjpeg/portfile.cmake | 33 +- ports/mpg123/CONTROL | 3 +- ports/mpg123/portfile.cmake | 111 +- ports/mpir/CONTROL | 5 + ports/mpir/portfile.cmake | 128 +- ports/mpir/vcpkg.json | 8 - ports/nana/CMakeLists.txt | 4 +- ports/nana/CONTROL | 3 +- ports/neargye-semver/CONTROL | 4 - ports/neargye-semver/portfile.cmake | 13 - ports/netcdf-c/CONTROL | 3 +- ports/netcdf-c/fix-dependency-libmath.patch | 13 - ports/netcdf-c/portfile.cmake | 1 - ports/netcdf-c/usage | 2 +- ports/netcdf-cxx4/CONTROL | 1 - ports/netcdf-cxx4/fix-dependecy-hdf5.patch | 43 +- ports/netcdf-cxx4/portfile.cmake | 4 +- ports/nettle/CONTROL | 2 +- ports/ngspice/CONTROL | 5 - ports/ngspice/portfile.cmake | 50 - ports/ngspice/use-winbison-global.patch | 13 - ports/nifticlib/CONTROL | 25 - ports/nifticlib/portfile.cmake | 48 - ports/nifticlib/zlib_include.patch | 12 - ports/nlohmann-json/CONTROL | 3 +- ports/nlohmann-json/portfile.cmake | 7 +- ports/ocilib/CONTROL | 3 +- ports/ocilib/portfile.cmake | 74 +- ports/ogre/CONTROL | 18 + ports/ogre/fix-dependency.patch | 45 - ports/ogre/fix-findimgui.patch | 35 - ports/ogre/portfile.cmake | 6 +- ports/ogre/toolchain_fixes.patch | 40 +- ports/ogre/vcpkg.json | 41 - ports/ompl/CONTROL | 3 +- ports/ompl/portfile.cmake | 1 - ports/openal-soft/CONTROL | 2 +- ports/openal-soft/fix-mingw-build.patch | 14 - ports/openal-soft/portfile.cmake | 1 - ports/openblas/CONTROL | 5 +- ports/openblas/portfile.cmake | 32 +- ports/opencl/CONTROL | 3 +- ports/opencl/vcpkg-cmake-wrapper.cmake | 3 - .../0001-lcms-dependency-search.patch | 40 - .../0002-msvc-cpluscplus.patch | 84 - .../0003-osx-self-assign-field.patch | 13 - .../0004-yaml-dependency-search.patch | 108 - .../0005-tinyxml-dependency-search.patch | 18 - .../0006-oiio-dependency-search.patch | 14 - ports/opencolorio-tools/CONTROL | 5 - ports/opencolorio-tools/portfile.cmake | 68 - .../0001-lcms-dependency-search.patch | 5 +- .../0006-oiio-dependency-search.patch | 14 - ports/opencolorio/CONTROL | 9 +- ports/opencolorio/portfile.cmake | 36 +- ports/opencv/CONTROL | 204 +- ports/opencv2/CONTROL | 3 +- ports/opencv2/FindCUDA.cmake | 2026 ----------------- ports/opencv2/portfile.cmake | 10 +- ports/opencv3/0001-disable-downloading.patch | 11 +- ports/opencv3/0002-install-options.patch | 134 +- .../0003-force-package-requirements.patch | 40 +- .../0004-add-missing-stdexcept-include.patch | 12 - ports/opencv3/0009-fix-uwp.patch | 74 +- ports/opencv3/CONTROL | 14 +- ports/opencv3/FindCUDA.cmake | 2026 ----------------- ports/opencv3/portfile.cmake | 102 +- ports/opencv4/0001-disable-downloading.patch | 11 +- ports/opencv4/0002-install-options.patch | 34 +- .../0003-force-package-requirements.patch | 27 +- ports/opencv4/0004-fix-policy-CMP0057.patch | 2 +- .../0005-add-missing-stdexcept-include.patch | 12 - ports/opencv4/0009-fix-uwp.patch | 48 +- ports/opencv4/CONTROL | 18 +- ports/opencv4/FindCUDA.cmake | 2026 ----------------- ports/opencv4/portfile.cmake | 102 +- ports/openexr/CONTROL | 7 +- ports/openexr/FindOpenEXR.cmake | 94 + ...x_clang_not_setting_modern_cplusplus.patch | 13 + ports/openexr/fix_install_ilmimf.patch | 19 + .../fix_linux_static_library_names.patch | 109 + ports/openexr/fixup_cmake_exports_path.patch | 78 - ports/openexr/portfile.cmake | 78 +- ports/openexr/remove_find_package_macro.patch | 87 - ports/openexr/remove_symlinks.patch | 40 - ports/openexr/vcpkg-cmake-wrapper.cmake | 40 +- ports/openimageio/CONTROL | 3 +- ports/openimageio/portfile.cmake | 6 +- ports/openimageio/vcpkg-cmake-wrapper.cmake | 4 +- ports/openjpeg/CONTROL | 15 +- ports/openjpeg/dll.location.patch | 32 - ports/openjpeg/portfile.cmake | 49 +- ports/openmpi/CONTROL | 1 - ports/openmpi/portfile.cmake | 1 - ports/openssl-unix/CMakeLists.txt | 23 - ports/openssl-unix/CONTROL | 1 - ports/openssl-unix/portfile.cmake | 4 +- ports/openssl-windows/CONTROL | 1 - ports/openssl-windows/portfile.cmake | 34 +- ports/orocos-kdl/CONTROL | 3 +- ports/orocos-kdl/portfile.cmake | 7 +- ports/osg/CONTROL | 4 +- ports/osg/portfile.cmake | 4 +- ports/osg/remove-prefix.patch | 9 + ports/osgearth/CONTROL | 3 +- ports/osgearth/RocksDB.patch | 163 +- ports/osgearth/portfile.cmake | 15 +- ports/outcome/CONTROL | 4 +- ports/outcome/portfile.cmake | 13 +- ports/pango/CMakeLists.txt | 8 +- ports/pango/CONTROL | 3 +- ports/pangolin/CONTROL | 4 +- ports/pangolin/fix-dependency-python.patch | 14 - ports/pangolin/fix-dependeny-ffmpeg.patch | 50 - ports/pangolin/portfile.cmake | 34 +- ports/paraview/CONTROL | 5 +- ports/paraview/portfile.cmake | 16 +- ports/pbc/CONTROL | 7 +- ports/pbc/portfile.cmake | 45 +- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 62 +- ports/physx/CONTROL | 3 +- ports/physx/internalMBP_symbols.patch | 49 - ports/physx/portfile.cmake | 39 +- ports/pngpp/portfile.cmake | 15 - ports/pngpp/vcpkg.json | 8 - ports/podofo/CONTROL | 3 +- ports/podofo/freetype.patch | 18 - ports/podofo/portfile.cmake | 1 - ports/polyhook2/CONTROL | 2 +- ports/polyhook2/portfile.cmake | 4 +- ports/proj4/CONTROL | 5 +- .../proj4/fix-sqlite-dependency-export.patch | 2 +- ports/proj4/portfile.cmake | 1 - ports/proj4/use-sqlite3-config.patch | 57 - ports/protobuf/CONTROL | 1 - ports/protobuf/portfile.cmake | 17 +- ports/qt5-base/CONTROL | 3 +- ports/qt5-base/cmake/install_qt.cmake | 4 +- ports/qt5-base/portfile.cmake | 15 +- ports/qt5-connectivity/CONTROL | 1 - ports/qt5-imageformats/CONTROL | 1 - ports/qt5-location/CONTROL | 1 - ports/qt5-webengine/CONTROL | 1 - ports/qt5-webengine/portfile.cmake | 7 +- ports/qt5-webengine/vs2017.patch | 12 - ports/qt5/CONTROL | 75 +- ports/quazip/CONTROL | 5 - ports/quazip/portfile.cmake | 20 - ports/quazip/vcpkg_remove_extra_static.patch | 30 - ports/quill/CONTROL | 2 +- ports/quill/portfile.cmake | 4 +- ports/qwt/CONTROL | 1 - ports/qwt/portfile.cmake | 2 +- ports/qwtw/CONTROL | 7 - ports/qwtw/portfile.cmake | 19 - ports/raylib/CONTROL | 10 +- ports/raylib/portfile.cmake | 18 +- ports/raylib/usage | 4 +- ports/raylib/vcpkg-cmake-wrapper.cmake | 17 +- ports/restinio/CONTROL | 2 +- ports/restinio/portfile.cmake | 4 +- ports/robin-hood-hashing/CONTROL | 2 +- ports/robin-hood-hashing/portfile.cmake | 4 +- ports/rsocket/CONTROL | 6 - ports/rsocket/fix-cmake-config.patch | 26 - ports/rsocket/fix-find-dependencies.patch | 94 - ports/rsocket/portfile.cmake | 44 - ports/rtmidi/CMakeLists.txt | 27 + ports/rtmidi/CONTROL | 2 - ports/rtmidi/portfile.cmake | 21 +- ports/sdl1/CONTROL | 3 +- ports/sdl1/portfile.cmake | 6 +- ports/sdl2-mixer/CMakeLists.txt | 2 +- ports/sdl2-mixer/CONTROL | 7 +- ports/sdl2-mixer/portfile.cmake | 1 - ports/secp256k1/CMakeLists.txt | 21 +- ports/secp256k1/CONTROL | 3 +- ports/secp256k1/portfile.cmake | 8 +- ports/secp256k1/secp256k1-config.cmake | 1 - ports/sfml/CONTROL | 3 +- ports/sfml/portfile.cmake | 1 - ports/sfml/stb_include.patch | 14 - ports/shapelib/CONTROL | 2 +- ports/shapelib/portfile.cmake | 9 +- ports/simple-fft/CONTROL | 4 - ports/simple-fft/portfile.cmake | 20 - ports/spdlog/CONTROL | 2 +- ports/spdlog/portfile.cmake | 4 +- ports/sqlite3/CMakeLists.txt | 13 +- ports/sqlite3/CONTROL | 7 - ports/sqlite3/portfile.cmake | 7 +- ports/sqlite3/sqlite3-config.in.cmake | 2 +- .../0001-Find-external-sqlite3.patch | 4 +- ports/sqlitecpp/CONTROL | 1 - ports/stb/CONTROL | 2 +- ports/stb/vcpkg-cmake-wrapper.cmake | 4 +- ports/stx/CMakeLists.patch | 71 - ports/stx/CONTROL | 8 - ports/stx/portfile.cmake | 35 - ports/suitesparse/CONTROL | 5 +- ports/teemo/CONTROL | 4 +- ports/teemo/portfile.cmake | 4 +- ports/tensorflow-cc/CONTROL | 3 +- ports/tensorflow-cc/portfile.cmake | 3 +- ports/tiff/CONTROL | 2 +- ports/tiff/cmakelists.patch | 15 + ports/tiff/portfile.cmake | 8 +- ports/tlx/CONTROL | 4 - ports/tlx/portfile.cmake | 38 - ports/tomlplusplus/CONTROL | 5 - ports/tomlplusplus/portfile.cmake | 25 - ports/treehopper/CONTROL | 2 +- ports/treehopper/portfile.cmake | 7 +- ports/vc/CONTROL | 5 - ports/vc/correct_cmake_config_path.patch | 22 - ports/vc/portfile.cmake | 26 - ports/vcpkg-gfortran/CONTROL | 4 - ports/vcpkg-gfortran/portfile.cmake | 53 - ports/vtk/6811.patch | 26 - ports/vtk/portfile.cmake | 1 - ports/vxl/CONTROL | 3 +- ports/vxl/fix_dependency.patch | 26 +- ports/vxl/portfile.cmake | 17 +- ports/wavpack/CONTROL | 4 +- ports/wavpack/portfile.cmake | 11 +- ports/winpcap/CONTROL | 3 +- ports/winpcap/portfile.cmake | 53 +- ports/wpilib/CONTROL | 3 +- ports/wpilib/portfile.cmake | 56 +- ports/wtl/CONTROL | 2 +- ports/wtl/portfile.cmake | 6 +- ports/wxwidgets/CONTROL | 5 +- .../wxwidgets/disable-platform-lib-dir.patch | 8 +- ports/wxwidgets/fix-macos-clipboard.patch | 26 + .../wxwidgets/fix-stl-build-vs2019-16.6.patch | 202 -- ports/wxwidgets/portfile.cmake | 19 +- ports/x264/CONTROL | 5 +- ports/x264/portfile.cmake | 31 +- ports/xbyak/CONTROL | 2 +- ports/xbyak/portfile.cmake | 4 +- ports/xeus/Fix-Compile-nlohmann-json.patch | 12 - ports/xeus/portfile.cmake | 4 +- ports/xframe/CONTROL | 5 - ports/xframe/portfile.cmake | 22 - ports/zlib/CONTROL | 2 +- ports/zlib/add_debug_postfix_on_mingw.patch | 13 - ports/zlib/portfile.cmake | 1 - scripts/azure-pipelines/azure-pipelines.yml | 5 +- scripts/azure-pipelines/end-to-end-tests.ps1 | 21 +- .../azure-pipelines/linux/azure-pipelines.yml | 16 +- scripts/azure-pipelines/osx/README.md | 2 +- .../osx/Setup-VagrantMachines.ps1 | 4 +- scripts/azure-pipelines/osx/Utilities.psm1 | 3 +- .../azure-pipelines/osx/azure-pipelines.yml | 23 +- .../osx/configuration/VagrantFile | 24 +- .../vagrant-configuration.schema.json | 4 +- .../azure-pipelines/test-modified-ports.ps1 | 3 +- .../windows/Check-CxxFormatting.ps1 | 4 +- .../windows/Check-ManifestFormatting.ps1 | 16 +- .../windows/azure-pipelines.yml | 24 +- scripts/boost/generate-ports.ps1 | 137 +- scripts/bootstrap.ps1 | 12 +- scripts/buildsystems/msbuild/vcpkg.targets | 4 +- scripts/buildsystems/vcpkg.cmake | 28 +- scripts/ci.baseline.txt | 103 +- scripts/cmake/vcpkg_acquire_msys.cmake | 31 +- scripts/cmake/vcpkg_build_make.cmake | 112 +- scripts/cmake/vcpkg_build_qmake.cmake | 3 +- scripts/cmake/vcpkg_common_definitions.cmake | 4 +- scripts/cmake/vcpkg_configure_make.cmake | 397 ++-- .../cmake/vcpkg_copy_tool_dependencies.cmake | 17 +- .../cmake/vcpkg_execute_build_process.cmake | 5 +- .../cmake/vcpkg_find_acquire_program.cmake | 117 +- scripts/cmake/vcpkg_find_fortran.cmake | 61 - scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 10 +- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 388 ++-- scripts/cmake/vcpkg_from_gitlab.cmake | 25 +- scripts/cmake/vcpkg_prettify_command.cmake | 6 +- scripts/test_ports/cmake/CONTROL | 5 - scripts/test_ports/cmake/portfile.cmake | 53 - scripts/test_ports/vcpkg-ci-paraview/CONTROL | 6 - .../vcpkg-ci-paraview/portfile.cmake | 1 - scripts/toolchains/android.cmake | 32 +- toolsrc/CMakeLists.txt | 333 ++- toolsrc/cmake/utilities.cmake | 70 +- toolsrc/{windows-bootstrap => }/dirs.proj | 0 toolsrc/include/vcpkg-test/util.h | 24 +- toolsrc/include/vcpkg/base/json.h | 44 +- toolsrc/include/vcpkg/base/strings.h | 2 - toolsrc/include/vcpkg/base/stringview.h | 3 - toolsrc/include/vcpkg/base/system.h | 1 - toolsrc/include/vcpkg/base/system.process.h | 6 - toolsrc/include/vcpkg/binaryparagraph.h | 2 +- toolsrc/include/vcpkg/build.h | 8 - toolsrc/include/vcpkg/commands.autocomplete.h | 13 - .../include/vcpkg/commands.buildexternal.h | 15 - toolsrc/include/vcpkg/commands.cache.h | 13 - toolsrc/include/vcpkg/commands.ci.h | 16 - toolsrc/include/vcpkg/commands.ciclean.h | 13 - toolsrc/include/vcpkg/commands.contact.h | 15 - toolsrc/include/vcpkg/commands.create.h | 15 - toolsrc/include/vcpkg/commands.dependinfo.h | 16 - toolsrc/include/vcpkg/commands.edit.h | 14 - toolsrc/include/vcpkg/commands.env.h | 16 - toolsrc/include/vcpkg/commands.fetch.h | 13 - .../include/vcpkg/commands.format-manifest.h | 14 - toolsrc/include/vcpkg/commands.h | 167 +- toolsrc/include/vcpkg/commands.hash.h | 13 - toolsrc/include/vcpkg/commands.info.h | 13 - toolsrc/include/vcpkg/commands.integrate.h | 17 - toolsrc/include/vcpkg/commands.interface.h | 33 - toolsrc/include/vcpkg/commands.list.h | 14 - toolsrc/include/vcpkg/commands.owns.h | 14 - toolsrc/include/vcpkg/commands.porthistory.h | 13 - toolsrc/include/vcpkg/commands.portsdiff.h | 13 - toolsrc/include/vcpkg/commands.search.h | 14 - toolsrc/include/vcpkg/commands.setinstalled.h | 26 - toolsrc/include/vcpkg/commands.upgrade.h | 16 - toolsrc/include/vcpkg/commands.version.h | 16 - toolsrc/include/vcpkg/commands.xvsinstances.h | 14 - toolsrc/include/vcpkg/dependencies.h | 6 - toolsrc/include/vcpkg/export.h | 9 +- toolsrc/include/vcpkg/help.h | 8 +- toolsrc/include/vcpkg/install.h | 18 - toolsrc/include/vcpkg/packagespec.h | 18 +- toolsrc/include/vcpkg/paragraphparseresult.h | 36 + toolsrc/include/vcpkg/platform-expression.h | 25 - toolsrc/include/vcpkg/remove.h | 10 +- toolsrc/include/vcpkg/sourceparagraph.h | 18 +- toolsrc/include/vcpkg/statusparagraph.h | 2 - toolsrc/include/vcpkg/tools.h | 15 - toolsrc/include/vcpkg/triplet.h | 17 +- toolsrc/include/vcpkg/update.h | 8 +- toolsrc/include/vcpkg/vcpkgcmdarguments.h | 5 - toolsrc/include/vcpkg/vcpkgpaths.h | 26 +- toolsrc/src/pch.cpp | 3 +- toolsrc/src/vcpkg-test/binarycaching.cpp | 8 +- toolsrc/src/vcpkg-test/commands.cpp | 69 - toolsrc/src/vcpkg-test/commands.create.cpp | 2 +- toolsrc/src/vcpkg-test/dependencies.cpp | 68 +- toolsrc/src/vcpkg-test/json.cpp | 43 - toolsrc/src/vcpkg-test/manifests.cpp | 83 +- toolsrc/src/vcpkg-test/paragraph.cpp | 12 +- toolsrc/src/vcpkg-test/plan.cpp | 184 +- toolsrc/src/vcpkg-test/specifier.cpp | 19 +- toolsrc/src/vcpkg-test/statusparagraphs.cpp | 10 +- toolsrc/src/vcpkg-test/strings.cpp | 4 - toolsrc/src/vcpkg-test/system.cpp | 4 - toolsrc/src/vcpkg-test/util.cpp | 6 - toolsrc/src/vcpkg.cpp | 18 +- toolsrc/src/vcpkg/archives.cpp | 3 +- toolsrc/src/vcpkg/base/checks.cpp | 2 + toolsrc/src/vcpkg/base/chrono.cpp | 2 + toolsrc/src/vcpkg/base/cofffilereader.cpp | 2 + toolsrc/src/vcpkg/base/downloads.cpp | 2 + toolsrc/src/vcpkg/base/enums.cpp | 2 + toolsrc/src/vcpkg/base/files.cpp | 11 +- toolsrc/src/vcpkg/base/hash.cpp | 2 + toolsrc/src/vcpkg/base/json.cpp | 187 +- toolsrc/src/vcpkg/base/machinetype.cpp | 2 + toolsrc/src/vcpkg/base/parse.cpp | 129 ++ toolsrc/src/vcpkg/base/strings.cpp | 9 +- toolsrc/src/vcpkg/base/stringview.cpp | 2 + toolsrc/src/vcpkg/base/system.cpp | 8 +- toolsrc/src/vcpkg/base/system.print.cpp | 2 + toolsrc/src/vcpkg/base/system.process.cpp | 2 + toolsrc/src/vcpkg/base/unicode.cpp | 2 + toolsrc/src/vcpkg/binarycaching.cpp | 25 +- toolsrc/src/vcpkg/binaryparagraph.cpp | 2 + toolsrc/src/vcpkg/build.cpp | 11 +- toolsrc/src/vcpkg/buildenvironment.cpp | 3 +- toolsrc/src/vcpkg/cmakevars.cpp | 2 + toolsrc/src/vcpkg/commands.autocomplete.cpp | 12 +- toolsrc/src/vcpkg/commands.buildexternal.cpp | 11 +- toolsrc/src/vcpkg/commands.cache.cpp | 9 +- toolsrc/src/vcpkg/commands.ci.cpp | 11 +- toolsrc/src/vcpkg/commands.ciclean.cpp | 9 +- toolsrc/src/vcpkg/commands.contact.cpp | 9 +- toolsrc/src/vcpkg/commands.cpp | 182 +- toolsrc/src/vcpkg/commands.create.cpp | 9 +- toolsrc/src/vcpkg/commands.dependinfo.cpp | 11 +- toolsrc/src/vcpkg/commands.edit.cpp | 9 +- toolsrc/src/vcpkg/commands.env.cpp | 11 +- ...{export.ifw.cpp => commands.exportifw.cpp} | 3 +- toolsrc/src/vcpkg/commands.fetch.cpp | 29 - .../src/vcpkg/commands.format-manifest.cpp | 266 +-- toolsrc/src/vcpkg/commands.hash.cpp | 38 - toolsrc/src/vcpkg/commands.info.cpp | 146 -- toolsrc/src/vcpkg/commands.integrate.cpp | 10 +- toolsrc/src/vcpkg/commands.list.cpp | 17 +- toolsrc/src/vcpkg/commands.owns.cpp | 9 +- toolsrc/src/vcpkg/commands.porthistory.cpp | 10 +- toolsrc/src/vcpkg/commands.portsdiff.cpp | 10 +- toolsrc/src/vcpkg/commands.search.cpp | 9 +- toolsrc/src/vcpkg/commands.setinstalled.cpp | 38 +- toolsrc/src/vcpkg/commands.upgrade.cpp | 11 +- toolsrc/src/vcpkg/commands.version.cpp | 9 +- toolsrc/src/vcpkg/commands.xvsinstances.cpp | 9 +- toolsrc/src/vcpkg/dependencies.cpp | 70 +- toolsrc/src/vcpkg/export.chocolatey.cpp | 151 +- toolsrc/src/vcpkg/export.cpp | 80 +- toolsrc/src/vcpkg/export.prefab.cpp | 3 +- toolsrc/src/vcpkg/globalstate.cpp | 2 + toolsrc/src/vcpkg/help.cpp | 16 +- toolsrc/src/vcpkg/input.cpp | 2 + toolsrc/src/vcpkg/install.cpp | 140 +- toolsrc/src/vcpkg/metrics.cpp | 15 +- toolsrc/src/vcpkg/packagespec.cpp | 15 +- toolsrc/src/vcpkg/paragraphparseresult.cpp | 35 + toolsrc/src/vcpkg/paragraphs.cpp | 133 +- toolsrc/src/vcpkg/platform-expression.cpp | 121 +- toolsrc/src/vcpkg/portfileprovider.cpp | 5 +- toolsrc/src/vcpkg/postbuildlint.buildtype.cpp | 2 + toolsrc/src/vcpkg/postbuildlint.cpp | 2 + toolsrc/src/vcpkg/remove.cpp | 9 +- toolsrc/src/vcpkg/sourceparagraph.cpp | 384 +--- toolsrc/src/vcpkg/statusparagraph.cpp | 2 + toolsrc/src/vcpkg/statusparagraphs.cpp | 42 +- toolsrc/src/vcpkg/tools.cpp | 10 +- toolsrc/src/vcpkg/triplet.cpp | 31 +- toolsrc/src/vcpkg/update.cpp | 7 +- toolsrc/src/vcpkg/userconfig.cpp | 2 + toolsrc/src/vcpkg/vcpkgcmdarguments.cpp | 21 +- toolsrc/src/vcpkg/vcpkglib.cpp | 3 + toolsrc/src/vcpkg/vcpkgpaths.cpp | 7 +- toolsrc/src/vcpkg/versiont.cpp | 2 + toolsrc/src/vcpkg/visualstudio.cpp | 2 + toolsrc/vcpkg.sln | 105 + .../vcpkg/vcpkg.vcxproj | 12 +- .../vcpkg/vcpkg.vcxproj.filters | 4 +- toolsrc/vcpkglib/vcpkglib.vcxproj | 301 +++ toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 462 ++++ .../vcpkgmetricsuploader.vcxproj | 10 +- .../vcpkgmetricsuploader.vcxproj.filters | 2 +- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 189 ++ toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters | 69 + toolsrc/windows-bootstrap/vcpkg.sln | 56 - .../vcpkglib/vcpkglib.vcxproj | 331 --- .../vcpkglib/vcpkglib.vcxproj.filters | 540 ----- triplets/community/arm64-osx.cmake | 1 - triplets/community/s390x-linux.cmake | 5 - 817 files changed, 6714 insertions(+), 21997 deletions(-) delete mode 100644 ports/abseil/fix-cmake-threads-dependency.patch create mode 100644 ports/alembic/fix-C1083.patch create mode 100644 ports/argtable3/CONTROL create mode 100644 ports/argtable3/fix-cmake.patch delete mode 100644 ports/argtable3/vcpkg.json delete mode 100644 ports/audiofile/portfile.cmake delete mode 100644 ports/audiofile/vcpkg.json delete mode 100644 ports/avro-cpp/CONTROL delete mode 100644 ports/avro-cpp/install.patch delete mode 100644 ports/avro-cpp/portfile.cmake delete mode 100644 ports/brotli/pkgconfig.patch delete mode 100644 ports/brpc/CONTROL delete mode 100644 ports/brpc/fix_boost_ptr.patch delete mode 100644 ports/brpc/fix_thrift.patch delete mode 100644 ports/brpc/portfile.cmake delete mode 100644 ports/bzip2/bzip2.pc.in rename ports/{lapack => }/clapack/FindLAPACK.cmake (100%) rename ports/{lapack => }/clapack/vcpkg-cmake-wrapper.cmake (100%) delete mode 100644 ports/colmap/portfile.cmake delete mode 100644 ports/colmap/usage delete mode 100644 ports/colmap/vcpkg.json delete mode 100644 ports/constexpr-contracts/CONTROL delete mode 100644 ports/constexpr-contracts/portfile.cmake create mode 100644 ports/coroutine/CONTROL delete mode 100644 ports/coroutine/fix-errorC7651.patch delete mode 100644 ports/coroutine/vcpkg.json delete mode 100644 ports/cppad/CONTROL delete mode 100644 ports/cppad/pkgconfig-fix.patch delete mode 100644 ports/cppad/portfile.cmake delete mode 100644 ports/cppad/windows-fix.patch delete mode 100644 ports/crashrpt/001-add-install-target-and-find-deps.patch delete mode 100644 ports/crashrpt/CONTROL delete mode 100644 ports/crashrpt/portfile.cmake create mode 100644 ports/curl/0008_fix_tools_path.patch delete mode 100644 ports/curl/0011_fix_static_build.patch delete mode 100644 ports/darknet/fix_shared_static.patch delete mode 100644 ports/date/0003-find-dependency-pthread.patch create mode 100644 ports/date/usage create mode 100644 ports/date/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/dbghelp/CONTROL delete mode 100644 ports/dbghelp/portfile.cmake delete mode 100644 ports/directxsdk/portfile.cmake delete mode 100644 ports/directxsdk/vcpkg.json mode change 100755 => 100644 ports/embree3/CONTROL create mode 100644 ports/embree3/fix-InstallPath.patch create mode 100644 ports/embree3/fix-cmake-path.patch create mode 100644 ports/embree3/fix-embree-path.patch delete mode 100755 ports/embree3/fix-path.patch mode change 100755 => 100644 ports/embree3/portfile.cmake delete mode 100755 ports/embree3/usage delete mode 100644 ports/field3d/0001_fix_build_errors.patch delete mode 100644 ports/field3d/0002_improve_win_compatibility.patch delete mode 100644 ports/field3d/0003_hdf5_api.patch create mode 100644 ports/field3d/fix-build_error.patch create mode 100644 ports/field3d/hdf5.api.patch create mode 100644 ports/fizz/fix-build_error.patch delete mode 100644 ports/fltk/config-path.patch delete mode 100644 ports/fltk/include.patch delete mode 100644 ports/freetype-gl/glew.patch create mode 100644 ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch delete mode 100644 ports/freetype/brotli-static.patch delete mode 100644 ports/freetype/pkgconfig.patch delete mode 100644 ports/gamedev-framework/CONTROL delete mode 100644 ports/gamedev-framework/portfile.cmake create mode 100644 ports/gmp/CONTROL delete mode 100644 ports/gmp/vcpkg.json delete mode 100644 ports/grpc/00011-fix-csharp_plugin.patch delete mode 100644 ports/gtkmm/fix_treeviewcolumn.patch delete mode 100644 ports/itk/cufftw.patch delete mode 100644 ports/itk/double-conversion.patch create mode 100644 ports/itk/fix_libminc_config_path.patch create mode 100644 ports/itk/fix_openjpeg_search.patch delete mode 100644 ports/itk/hdf5.patch delete mode 100644 ports/itk/opencl.patch delete mode 100644 ports/itk/openjpeg.patch delete mode 100644 ports/itk/openjpeg2.patch delete mode 100644 ports/itk/python_gpu_wrapping.patch delete mode 100644 ports/itk/rtk/already_defined.patch delete mode 100644 ports/itk/rtk/unresolved.patch delete mode 100644 ports/itk/var_libraries.patch delete mode 100644 ports/itk/wrapping.patch delete mode 100644 ports/josuttis-jthread/CONTROL delete mode 100644 ports/josuttis-jthread/portfile.cmake delete mode 100644 ports/kf5completion/CONTROL delete mode 100644 ports/kf5completion/add-qdbus-to-required-libraries.patch delete mode 100644 ports/kf5completion/portfile.cmake delete mode 100644 ports/kf5config/CONTROL delete mode 100644 ports/kf5config/portfile.cmake delete mode 100644 ports/kf5coreaddons/CONTROL delete mode 100644 ports/kf5coreaddons/portfile.cmake delete mode 100644 ports/kf5crash/CONTROL delete mode 100644 ports/kf5crash/add_x11extras.patch delete mode 100644 ports/kf5crash/portfile.cmake delete mode 100644 ports/kf5guiaddons/CONTROL delete mode 100644 ports/kf5guiaddons/portfile.cmake delete mode 100644 ports/kf5i18n/CONTROL delete mode 100644 ports/kf5i18n/portfile.cmake delete mode 100644 ports/kf5itemmodels/CONTROL delete mode 100644 ports/kf5itemmodels/portfile.cmake delete mode 100644 ports/kf5itemviews/CONTROL delete mode 100644 ports/kf5itemviews/portfile.cmake delete mode 100644 ports/kf5widgetsaddons/CONTROL delete mode 100644 ports/kf5widgetsaddons/portfile.cmake delete mode 100644 ports/kf5windowsystem/CONTROL delete mode 100644 ports/kf5windowsystem/portfile.cmake delete mode 100644 ports/lapack-reference/CONTROL delete mode 100644 ports/lapack-reference/FindLAPACK.cmake delete mode 100644 ports/lapack-reference/portfile.cmake delete mode 100644 ports/lapack-reference/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/lapack/CMakeLists.txt delete mode 100644 ports/lapack/CONTROL delete mode 100644 ports/lapack/portfile.cmake create mode 100644 ports/libass/CONTROL delete mode 100644 ports/libass/vcpkg.json delete mode 100644 ports/libde265/CONTROL delete mode 100644 ports/libde265/portfile.cmake create mode 100644 ports/libevent/fix-crt_linkage.patch delete mode 100644 ports/libffi/win32-disable-stackframe-check.patch delete mode 100644 ports/libffi/win64-disable-stackframe-check.patch delete mode 100644 ports/libheif/CONTROL delete mode 100644 ports/libheif/dont_build_examples_and_gdk_pixbuf.patch delete mode 100644 ports/libheif/install-extra-headers.patch delete mode 100644 ports/libheif/portfile.cmake delete mode 100644 ports/libheif/remove_finding_pkgconfig.patch create mode 100644 ports/libmodbus/CONTROL delete mode 100644 ports/libmodbus/fix-static-linkage.patch delete mode 100644 ports/libmodbus/vcpkg.json delete mode 100644 ports/libpng/pkgconfig.2.patch delete mode 100644 ports/libpng/pkgconfig.patch delete mode 100644 ports/libwandio/configure.patch delete mode 100644 ports/libwandio/curl.patch delete mode 100644 ports/libwandio/openssl.patch delete mode 100644 ports/libzip/fix-findpackage.patch delete mode 100644 ports/log4cpp/fix-includepath.patch delete mode 100644 ports/lzokay/portfile.cmake delete mode 100644 ports/lzokay/vcpkg.json delete mode 100644 ports/marble/CONTROL delete mode 100644 ports/marble/portfile.cmake delete mode 100644 ports/marble/qtfix.patch delete mode 100644 ports/minc/CONTROL delete mode 100644 ports/minc/build.patch delete mode 100644 ports/minc/config.patch delete mode 100644 ports/minc/portfile.cmake create mode 100644 ports/mosquitto/CONTROL delete mode 100644 ports/mosquitto/usage delete mode 100644 ports/mosquitto/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/mosquitto/vcpkg.json create mode 100644 ports/mpir/CONTROL delete mode 100644 ports/mpir/vcpkg.json delete mode 100644 ports/neargye-semver/CONTROL delete mode 100644 ports/neargye-semver/portfile.cmake delete mode 100644 ports/netcdf-c/fix-dependency-libmath.patch delete mode 100644 ports/ngspice/CONTROL delete mode 100644 ports/ngspice/portfile.cmake delete mode 100644 ports/ngspice/use-winbison-global.patch delete mode 100644 ports/nifticlib/CONTROL delete mode 100644 ports/nifticlib/portfile.cmake delete mode 100644 ports/nifticlib/zlib_include.patch create mode 100644 ports/ogre/CONTROL delete mode 100644 ports/ogre/fix-dependency.patch delete mode 100644 ports/ogre/fix-findimgui.patch delete mode 100644 ports/ogre/vcpkg.json delete mode 100644 ports/openal-soft/fix-mingw-build.patch delete mode 100644 ports/opencolorio-tools/0001-lcms-dependency-search.patch delete mode 100644 ports/opencolorio-tools/0002-msvc-cpluscplus.patch delete mode 100644 ports/opencolorio-tools/0003-osx-self-assign-field.patch delete mode 100644 ports/opencolorio-tools/0004-yaml-dependency-search.patch delete mode 100644 ports/opencolorio-tools/0005-tinyxml-dependency-search.patch delete mode 100644 ports/opencolorio-tools/0006-oiio-dependency-search.patch delete mode 100644 ports/opencolorio-tools/CONTROL delete mode 100644 ports/opencolorio-tools/portfile.cmake delete mode 100644 ports/opencolorio/0006-oiio-dependency-search.patch delete mode 100644 ports/opencv2/FindCUDA.cmake delete mode 100644 ports/opencv3/0004-add-missing-stdexcept-include.patch delete mode 100644 ports/opencv3/FindCUDA.cmake delete mode 100644 ports/opencv4/0005-add-missing-stdexcept-include.patch delete mode 100644 ports/opencv4/FindCUDA.cmake create mode 100644 ports/openexr/FindOpenEXR.cmake create mode 100644 ports/openexr/fix_clang_not_setting_modern_cplusplus.patch create mode 100644 ports/openexr/fix_install_ilmimf.patch create mode 100644 ports/openexr/fix_linux_static_library_names.patch delete mode 100644 ports/openexr/fixup_cmake_exports_path.patch delete mode 100644 ports/openexr/remove_find_package_macro.patch delete mode 100644 ports/openexr/remove_symlinks.patch delete mode 100644 ports/openjpeg/dll.location.patch delete mode 100644 ports/pangolin/fix-dependency-python.patch delete mode 100644 ports/pangolin/fix-dependeny-ffmpeg.patch delete mode 100644 ports/physx/internalMBP_symbols.patch delete mode 100644 ports/pngpp/portfile.cmake delete mode 100644 ports/pngpp/vcpkg.json delete mode 100644 ports/podofo/freetype.patch delete mode 100644 ports/proj4/use-sqlite3-config.patch delete mode 100644 ports/qt5-webengine/vs2017.patch delete mode 100644 ports/quazip/CONTROL delete mode 100644 ports/quazip/portfile.cmake delete mode 100644 ports/quazip/vcpkg_remove_extra_static.patch delete mode 100644 ports/qwtw/CONTROL delete mode 100644 ports/qwtw/portfile.cmake delete mode 100644 ports/rsocket/CONTROL delete mode 100644 ports/rsocket/fix-cmake-config.patch delete mode 100644 ports/rsocket/fix-find-dependencies.patch delete mode 100644 ports/rsocket/portfile.cmake create mode 100644 ports/rtmidi/CMakeLists.txt delete mode 100644 ports/secp256k1/secp256k1-config.cmake delete mode 100644 ports/sfml/stb_include.patch delete mode 100644 ports/simple-fft/CONTROL delete mode 100644 ports/simple-fft/portfile.cmake delete mode 100644 ports/stx/CMakeLists.patch delete mode 100644 ports/stx/CONTROL delete mode 100644 ports/stx/portfile.cmake delete mode 100644 ports/tlx/CONTROL delete mode 100644 ports/tlx/portfile.cmake delete mode 100644 ports/tomlplusplus/CONTROL delete mode 100644 ports/tomlplusplus/portfile.cmake delete mode 100644 ports/vc/CONTROL delete mode 100644 ports/vc/correct_cmake_config_path.patch delete mode 100644 ports/vc/portfile.cmake delete mode 100644 ports/vcpkg-gfortran/CONTROL delete mode 100644 ports/vcpkg-gfortran/portfile.cmake delete mode 100644 ports/vtk/6811.patch create mode 100644 ports/wxwidgets/fix-macos-clipboard.patch delete mode 100644 ports/wxwidgets/fix-stl-build-vs2019-16.6.patch delete mode 100644 ports/xeus/Fix-Compile-nlohmann-json.patch delete mode 100644 ports/xframe/CONTROL delete mode 100644 ports/xframe/portfile.cmake delete mode 100644 ports/zlib/add_debug_postfix_on_mingw.patch delete mode 100644 scripts/cmake/vcpkg_find_fortran.cmake delete mode 100644 scripts/test_ports/cmake/CONTROL delete mode 100644 scripts/test_ports/cmake/portfile.cmake delete mode 100644 scripts/test_ports/vcpkg-ci-paraview/CONTROL delete mode 100644 scripts/test_ports/vcpkg-ci-paraview/portfile.cmake rename toolsrc/{windows-bootstrap => }/dirs.proj (100%) delete mode 100644 toolsrc/include/vcpkg/commands.autocomplete.h delete mode 100644 toolsrc/include/vcpkg/commands.buildexternal.h delete mode 100644 toolsrc/include/vcpkg/commands.cache.h delete mode 100644 toolsrc/include/vcpkg/commands.ci.h delete mode 100644 toolsrc/include/vcpkg/commands.ciclean.h delete mode 100644 toolsrc/include/vcpkg/commands.contact.h delete mode 100644 toolsrc/include/vcpkg/commands.create.h delete mode 100644 toolsrc/include/vcpkg/commands.dependinfo.h delete mode 100644 toolsrc/include/vcpkg/commands.edit.h delete mode 100644 toolsrc/include/vcpkg/commands.env.h delete mode 100644 toolsrc/include/vcpkg/commands.fetch.h delete mode 100644 toolsrc/include/vcpkg/commands.format-manifest.h delete mode 100644 toolsrc/include/vcpkg/commands.hash.h delete mode 100644 toolsrc/include/vcpkg/commands.info.h delete mode 100644 toolsrc/include/vcpkg/commands.integrate.h delete mode 100644 toolsrc/include/vcpkg/commands.interface.h delete mode 100644 toolsrc/include/vcpkg/commands.list.h delete mode 100644 toolsrc/include/vcpkg/commands.owns.h delete mode 100644 toolsrc/include/vcpkg/commands.porthistory.h delete mode 100644 toolsrc/include/vcpkg/commands.portsdiff.h delete mode 100644 toolsrc/include/vcpkg/commands.search.h delete mode 100644 toolsrc/include/vcpkg/commands.setinstalled.h delete mode 100644 toolsrc/include/vcpkg/commands.upgrade.h delete mode 100644 toolsrc/include/vcpkg/commands.version.h delete mode 100644 toolsrc/include/vcpkg/commands.xvsinstances.h create mode 100644 toolsrc/include/vcpkg/paragraphparseresult.h delete mode 100644 toolsrc/src/vcpkg-test/commands.cpp rename toolsrc/src/vcpkg/{export.ifw.cpp => commands.exportifw.cpp} (99%) delete mode 100644 toolsrc/src/vcpkg/commands.fetch.cpp delete mode 100644 toolsrc/src/vcpkg/commands.hash.cpp delete mode 100644 toolsrc/src/vcpkg/commands.info.cpp create mode 100644 toolsrc/src/vcpkg/paragraphparseresult.cpp create mode 100644 toolsrc/vcpkg.sln rename toolsrc/{windows-bootstrap => }/vcpkg/vcpkg.vcxproj (92%) rename toolsrc/{windows-bootstrap => }/vcpkg/vcpkg.vcxproj.filters (88%) create mode 100644 toolsrc/vcpkglib/vcpkglib.vcxproj create mode 100644 toolsrc/vcpkglib/vcpkglib.vcxproj.filters rename toolsrc/{windows-bootstrap => }/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj (93%) rename toolsrc/{windows-bootstrap => }/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters (90%) create mode 100644 toolsrc/vcpkgtest/vcpkgtest.vcxproj create mode 100644 toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters delete mode 100644 toolsrc/windows-bootstrap/vcpkg.sln delete mode 100644 toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj delete mode 100644 toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters delete mode 100644 triplets/community/s390x-linux.cmake diff --git a/.gitattributes b/.gitattributes index d0c3b3e9ccf66d..fa1385d99a319b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1 @@ * -text -ports/** -linguist-detectable - -# Declare files that will always have LF line endings on checkout. -scripts/ci.baseline.txt text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index b971df79de29c6..d3be89f6075413 100644 --- a/.gitignore +++ b/.gitignore @@ -289,25 +289,47 @@ __pycache__/ /packages/ /scripts/buildsystems/tmp/ /toolsrc/build.rel/ -/toolsrc/windows-bootstrap/msbuild.x86.debug/ -/toolsrc/windows-bootstrap/msbuild.x86.release/ -/toolsrc/windows-bootstrap/msbuild.x64.debug/ -/toolsrc/windows-bootstrap/msbuild.x64.release/ -#ignore custom triplets +/toolsrc/msbuild.x86.debug/ +/toolsrc/msbuild.x86.release/ +/toolsrc/msbuild.x64.debug/ +/toolsrc/msbuild.x64.release/ /triplets/* #add vcpkg-designed triplets back in -!/triplets/arm-uwp.cmake -!/triplets/arm64-windows.cmake -!/triplets/x64-linux.cmake -!/triplets/x64-osx.cmake -!/triplets/x64-uwp.cmake -!/triplets/x64-windows-static.cmake -!/triplets/x64-windows.cmake -!/triplets/x86-windows.cmake - -!/triplets/community -!/triplets/community/** - +!triplets/community/arm64-mingw-dynamic.cmake +!triplets/community/arm64-mingw-static.cmake +!triplets/community/arm64-uwp.cmake +!triplets/community/arm64-windows-static.cmake +!triplets/community/arm-mingw-dynamic.cmake +!triplets/community/arm-mingw-static.cmake +!triplets/community/arm-windows.cmake +!triplets/community/x64-mingw-dynamic.cmake +!triplets/community/x64-mingw-static.cmake +!triplets/community/x64-windows-static-md.cmake +!triplets/community/x86-mingw-dynamic.cmake +!triplets/community/x86-mingw-static.cmake +!triplets/community/x86-uwp.cmake +!triplets/community/x86-windows-static.cmake +!triplets/community/x86-windows-static-md.cmake +!triplets/community/x64-osx-dynamic.cmake +!triplets/community/x64-android.cmake +!triplets/community/x86-android.cmake +!triplets/community/arm-android.cmake +!triplets/community/arm64-android.cmake +!triplets/community/arm64-ios.cmake +!triplets/community/arm-ios.cmake +!triplets/community/x64-ios.cmake +!triplets/community/x86-ios.cmake +!triplets/community/wasm32-emscripten.cmake +!triplets/community/arm64-osx.cmake +!triplets/arm-uwp.cmake +!triplets/x64-uwp.cmake +!triplets/x64-windows.cmake +!triplets/x64-windows-static.cmake +!triplets/x86-windows.cmake +!triplets/arm64-windows.cmake +!triplets/x64-linux.cmake +!triplets/x64-osx.cmake +#ignore custom triplets *.exe *.zip diff --git a/README.md b/README.md index f3e19058477270..1764b5a1137a9b 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ you may use a simple `vcpkg install --feature-flags=manifests` For more information, check out the [manifest][getting-started:manifest-spec] specification. -[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md +[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md [getting-started:integration]: docs/users/integration.md [getting-started:git]: https://git-scm.com/downloads [getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools diff --git a/docs/examples/installing-and-using-packages.md b/docs/examples/installing-and-using-packages.md index 011df93a4cc9f9..f98de78ab14917 100644 --- a/docs/examples/installing-and-using-packages.md +++ b/docs/examples/installing-and-using-packages.md @@ -47,8 +47,8 @@ Total elapsed time: 12.04 s The package sqlite3:x86-windows provides CMake targets: - find_package(unofficial-sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)) + find_package(sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE sqlite3) ``` @@ -118,11 +118,11 @@ Now let's make a simple CMake project with a main file. cmake_minimum_required(VERSION 3.0) project(test) -find_package(unofficial-sqlite3 CONFIG REQUIRED) +find_package(sqlite3 CONFIG REQUIRED) add_executable(main main.cpp) -target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) +target_link_libraries(main PRIVATE sqlite3) ``` ```cpp // main.cpp diff --git a/docs/examples/overlay-triplets-linux-dynamic.md b/docs/examples/overlay-triplets-linux-dynamic.md index 5d79013377afb1..7d0540927d4c49 100644 --- a/docs/examples/overlay-triplets-linux-dynamic.md +++ b/docs/examples/overlay-triplets-linux-dynamic.md @@ -55,8 +55,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux-dynamic provides CMake targets: - find_package(unofficial-sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) + find_package(sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE sqlite3) ``` Overlay triplets enables your custom triplet files when using `vcpkg install`, `vcpkg update`, `vcpkg upgrade`, and `vcpkg remove`. @@ -115,8 +115,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux provides CMake targets: - find_package(unofficial-sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) + find_package(sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE sqlite3) ``` Note that the default triplet is masked by your custom triplet: diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index e0fde7e6885c63..0b653225802bfd 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -208,34 +208,6 @@ Note that if a library generates CMake integration files (`foo-config.cmake`), r Finally, DLL files on Windows should never be renamed post-build because it breaks the generated LIBs. -## Code format - -### Vcpkg internal code - -We require the c/c++ code inside vcpkg to follow the clang-format, if you change them. Please perform the following steps after modification: - -- Use Visual Studio: -1. Configure your [clang-format tools](https://devblogs.microsoft.com/cppblog/clangformat-support-in-visual-studio-2017-15-7-preview-1/). -2. Open the modified file. -3. Use shortcut keys Ctrl+K, Ctrl+D to format the current file. - -- Use tools: -1. Install [llvm clang-format](https://releases.llvm.org/download.html#10.0.0) -2. Run command: -```cmd -> LLVM_PATH/bin/clang-format.exe -style=file -i changed_file.cpp -``` - -### Manifest - -We require that the manifest file needs to be formatted, perform the following steps to solve this issue: - -1. Format all changed manifest files. -```cmd -> vcpkg x-format-manifest --all -``` -2. Commit changes to your branch. - ## Useful implementation notes ### Portfiles are run in Script Mode diff --git a/docs/maintainers/vcpkg_check_linkage.md b/docs/maintainers/vcpkg_check_linkage.md index eb20e97c861919..406325dba08f84 100644 --- a/docs/maintainers/vcpkg_check_linkage.md +++ b/docs/maintainers/vcpkg_check_linkage.md @@ -28,7 +28,7 @@ This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail, ## Examples -* [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake) +* [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake) ## Source -[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) +[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) diff --git a/docs/users/config-environment.md b/docs/users/config-environment.md index 22f7ff84a2d3e1..ffa988cbc38346 100644 --- a/docs/users/config-environment.md +++ b/docs/users/config-environment.md @@ -38,19 +38,11 @@ Example: `D:\2017` This environment variable can be set to a triplet name which will be used for unqualified triplet references in command lines. -#### VCPKG_OVERLAY_PORTS - -This environment variable allows users to override ports with alternate versions according to the -[ports overlay](../specifications/ports-overlay.md) specification. List paths to overlays using -the platform dependent PATH seperator (Windows `;` | others `:`) - -Example (Windows): `C:\custom-ports\boost;C:\custom-ports\sqlite3` - #### VCPKG_FORCE_SYSTEM_BINARIES This environment variable, if set, suppresses the downloading of CMake and Ninja and forces the use of the system binaries. -#### VCPKG_KEEP_ENV_VARS +### VCPKG_KEEP_ENV_VARS This environment variable can be set to a list of environment variables, separated by `;`, which will be propagated to the build environment. diff --git a/ports/3fd/vcpkg.json b/ports/3fd/vcpkg.json index 92c53d327f5a79..f183916e6613ff 100644 --- a/ports/3fd/vcpkg.json +++ b/ports/3fd/vcpkg.json @@ -16,7 +16,7 @@ "name": "poco", "platform": "windows" }, - "rapidxml", - "sqlite3" + "sqlite3", + "rapidxml" ] } diff --git a/ports/abseil/fix-cmake-threads-dependency.patch b/ports/abseil/fix-cmake-threads-dependency.patch deleted file mode 100644 index 0dda75e36ab3d4..00000000000000 --- a/ports/abseil/fix-cmake-threads-dependency.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMake/abslConfig.cmake.in b/CMake/abslConfig.cmake.in -index 60847fa77..6d23f63d3 100644 ---- a/CMake/abslConfig.cmake.in -+++ b/CMake/abslConfig.cmake.in -@@ -1,6 +1,7 @@ - # absl CMake configuration file. - --include(FindThreads) -+include(CMakeFindDependencyMacro) -+find_dependency(Threads) - - @PACKAGE_INIT@ - diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 0b62c6c2e25407..8fcf0bb7630b42 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -7,12 +7,9 @@ set(ABSEIL_PATCHES # This patch is an upstream commit, the related PR: https://github.com/abseil/abseil-cpp/pull/637 fix-MSVCbuildfail.patch - + # Remove this patch in next update, see https://github.com/google/cctz/pull/145 fix-arm-build.patch - - # This patch is an upstream commit: https://github.com/abseil/abseil-cpp/commit/68494aae959dfbbf781cdf03a988d2f5fc7e4802 - fix-cmake-threads-dependency.patch ) if("cxx17" IN_LIST FEATURES) diff --git a/ports/abseil/vcpkg.json b/ports/abseil/vcpkg.json index 79e6c308b5d097..cfc1022ea4f9cc 100644 --- a/ports/abseil/vcpkg.json +++ b/ports/abseil/vcpkg.json @@ -1,14 +1,14 @@ { "name": "abseil", "version-string": "2020-03-03", - "port-version": 8, + "port-version": 7, + "homepage": "https://github.com/abseil/abseil-cpp", "description": [ "an open-source collection designed to augment the C++ standard library.", "Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.", "In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.", "Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole." ], - "homepage": "https://github.com/abseil/abseil-cpp", "features": [ { "name": "cxx17", diff --git a/ports/akali/CONTROL b/ports/akali/CONTROL index 35f86f28ce02e9..a7acd59194766c 100644 --- a/ports/akali/CONTROL +++ b/ports/akali/CONTROL @@ -1,5 +1,4 @@ Source: akali Version: 1.41 -Port-Version: 1 Description: C++ Common Library. -Homepage: https://github.com/winsoft666/akali +Homepage: https://github.com/winsoft666/akali \ No newline at end of file diff --git a/ports/alembic/CONTROL b/ports/alembic/CONTROL index 9c2b40ff63460b..54442f2e444166 100644 --- a/ports/alembic/CONTROL +++ b/ports/alembic/CONTROL @@ -1,5 +1,5 @@ Source: alembic -Version: 1.7.13 +Version: 1.7.12-1 Build-Depends: ilmbase, hdf5 Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications. Homepage: https://alembic.io/ diff --git a/ports/alembic/fix-C1083.patch b/ports/alembic/fix-C1083.patch new file mode 100644 index 00000000000000..15de9f514f9f26 --- /dev/null +++ b/ports/alembic/fix-C1083.patch @@ -0,0 +1,49 @@ +diff --git a/lib/Alembic/Abc/Foundation.h b/lib/Alembic/Abc/Foundation.h +index 9760c49..fbab6a0 100644 +--- a/lib/Alembic/Abc/Foundation.h ++++ b/lib/Alembic/Abc/Foundation.h +@@ -40,11 +40,11 @@ + #include + #include + +-#include +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include ++#include + + #include + #include +diff --git a/lib/Alembic/AbcGeom/Foundation.h b/lib/Alembic/AbcGeom/Foundation.h +index 301efc3..2bb0f6b 100644 +--- a/lib/Alembic/AbcGeom/Foundation.h ++++ b/lib/Alembic/AbcGeom/Foundation.h +@@ -39,8 +39,8 @@ + + #include + +-#include +-#include ++#include ++#include + + + namespace Alembic { +diff --git a/lib/Alembic/Util/Foundation.h b/lib/Alembic/Util/Foundation.h +index d7f40dd..a41bb97 100644 +--- a/lib/Alembic/Util/Foundation.h ++++ b/lib/Alembic/Util/Foundation.h +@@ -63,7 +63,7 @@ + + #include + +-#include ++#include + + #include + #include diff --git a/ports/alembic/fix-find-openexr-ilmbase.patch b/ports/alembic/fix-find-openexr-ilmbase.patch index f35f17df35ec4f..6a72711f425964 100644 --- a/ports/alembic/fix-find-openexr-ilmbase.patch +++ b/ports/alembic/fix-find-openexr-ilmbase.patch @@ -2,7 +2,7 @@ diff --git a/cmake/AlembicIlmBase.cmake b/cmake/AlembicIlmBase.cmake index cd00d70..0e50512 100644 --- a/cmake/AlembicIlmBase.cmake +++ b/cmake/AlembicIlmBase.cmake -@@ -33,11 +33,17 @@ +@@ -33,11 +33,25 @@ ## ##-***************************************************************************** @@ -16,9 +16,17 @@ index cd00d70..0e50512 100644 + set(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${OpenEXR_INCLUDE_DIRS}/OpenEXR) + set(ALEMBIC_ILMBASE_HALF_LIB ${OPENEXR_HALF_LIBRARY}) + set(ALEMBIC_ILMBASE_IEX_LIB ${OPENEXR_IEX_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IMATH_LIBRARY}) ++ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OpenEXR_IEXMATH_LIBRARY}) + set(ALEMBIC_ILMBASE_ILMTHREAD_LIB ${OPENEXR_ILMTHREAD_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) ++ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) ++ ++ MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) ++ MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) ++ MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) ++ MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) ++ MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) ++ MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) ++ SET(ALEMBIC_ILMBASE_LIBS ${ALEMBIC_ILMBASE_IMATH_LIB} ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} @@ -38,13 +46,348 @@ diff --git a/cmake/AlembicOpenEXR.cmake b/cmake/AlembicOpenEXR.cmake index 0833b32..a9180cd 100644 --- a/cmake/AlembicOpenEXR.cmake +++ b/cmake/AlembicOpenEXR.cmake -@@ -38,8 +38,8 @@ +@@ -38,8 +38,12 @@ FIND_PACKAGE( OpenEXR ) IF( OPENEXR_FOUND ) - SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS} ) + SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS}/OpenEXR ) SET( ALEMBIC_OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ) ++ ++ MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) ++ MESSAGE( STATUS "OPENEXR LIB: ${ALEMBIC_OPENEXR_LIBRARIES}" ) ++ # SET( ALEMBIC_OPENEXR_DEFINITIONS ${OPENEXR_DEFINITIONS} ) SET( ALEMBIC_OPENEXR_FOUND 1 CACHE STRING "Set to 1 if OpenEXR is found, 0 otherwise" ) +diff --git a/cmake/Modules/FindIlmBase.cmake b/cmake/Modules/FindIlmBase.cmake +deleted file mode 100644 +index 679a02f..0000000 +--- a/cmake/Modules/FindIlmBase.cmake ++++ /dev/null +@@ -1,190 +0,0 @@ +-##-***************************************************************************** +-## +-## Copyright (c) 2009-2016, +-## Sony Pictures Imageworks Inc. and +-## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. +-## +-## All rights reserved. +-## +-## Redistribution and use in source and binary forms, with or without +-## modification, are permitted provided that the following conditions are +-## met: +-## * Redistributions of source code must retain the above copyright +-## notice, this list of conditions and the following disclaimer. +-## * Redistributions in binary form must reproduce the above +-## copyright notice, this list of conditions and the following disclaimer +-## in the documentation and/or other materials provided with the +-## distribution. +-## * Neither the name of Industrial Light & Magic nor the names of +-## its contributors may be used to endorse or promote products derived +-## from this software without specific prior written permission. +-## +-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-## +-##-***************************************************************************** +- +-#-****************************************************************************** +-#-****************************************************************************** +-# FIRST, ILMBASE STUFF +-#-****************************************************************************** +-#-****************************************************************************** +- +-# If ILMBASE_ROOT was defined in the environment, use it. +-IF(NOT ILMBASE_ROOT AND NOT $ENV{ILMBASE_ROOT} STREQUAL "") +- SET(ILMBASE_ROOT $ENV{ILMBASE_ROOT}) +-ENDIF() +- +-IF(NOT DEFINED ILMBASE_ROOT) +- MESSAGE(STATUS "ILMBASE_ROOT is undefined" ) +- IF ( ${CMAKE_HOST_UNIX} ) +- IF( ${DARWIN} ) +- # TODO: set to default install path when shipping out +- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) +- ELSE() +- # TODO: set to default install path when shipping out +- SET( ALEMBIC_ILMBASE_ROOT "/usr/local/ilmbase-1.0.1/" ) +- ENDIF() +- ELSE() +- IF ( ${WINDOWS} ) +- # TODO: set to 32-bit or 64-bit path +- SET( ALEMBIC_ILMBASE_ROOT "C:/Program Files (x86)/ilmbase-1.0.1/" ) +- ELSE() +- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) +- ENDIF() +- ENDIF() +-ELSE() +- SET( ALEMBIC_ILMBASE_ROOT ${ILMBASE_ROOT} ) +-ENDIF() +- +-SET(_ilmbase_FIND_COMPONENTS +- Half +- Iex +- IexMath +- IlmThread +- Imath +-) +- +-SET(_ilmbase_SEARCH_DIRS +- ${ALEMBIC_ILMBASE_ROOT} +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local +- /usr +- /sw +- /opt/local +- /opt/csw +- /opt +- /usr/freeware +-) +- +-FIND_PATH(ILMBASE_INCLUDE_DIR +- NAMES +- IlmBaseConfig.h +- HINTS +- ${_ilmbase_SEARCH_DIRS} +- PATH_SUFFIXES +- include +- include/OpenEXR +-) +- +-# If the headers were found, get the version from config file, if not already set. +-IF(ILMBASE_INCLUDE_DIR) +- SET(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${ILMBASE_INCLUDE_DIR}) +- IF(NOT ILMBASE_VERSION) +- +- FIND_FILE(_ilmbase_CONFIG +- NAMES +- IlmBaseConfig.h +- PATHS +- "${ILMBASE_INCLUDE_DIR}" +- "${ILMBASE_INCLUDE_DIR}/OpenEXR" +- ) +- +- IF(_ilmbase_CONFIG) +- FILE(STRINGS "${_ilmbase_CONFIG}" ILMBASE_BUILD_SPECIFICATION +- REGEX "^[ \t]*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"[.0-9]+\".*$") +- ELSE() +- MESSAGE(WARNING "Could not find \"OpenEXRConfig.h\" in \"${ILMBASE_INCLUDE_DIR}\"") +- ENDIF() +- +- IF(ILMBASE_BUILD_SPECIFICATION) +- STRING(REGEX REPLACE ".*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"([.0-9]+)\".*" +- "\\2" _ilmbase_libs_ver_init ${ILMBASE_BUILD_SPECIFICATION}) +- ELSE() +- MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_ilmbase_libs_ver_init}.") +- ENDIF() +- +- UNSET(_ilmbase_CONFIG CACHE) +- +- ENDIF() +- +- SET("ILMBASE_VERSION" ${_ilmbase_libs_ver_init} CACHE STRING "Version of OpenEXR lib") +- UNSET(_ilmbase_libs_ver_init) +- +- STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION}) +-ENDIF() +- +- +-SET(_ilmbase_LIBRARIES) +-FOREACH(COMPONENT ${_ilmbase_FIND_COMPONENTS}) +- STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) +- +- FIND_LIBRARY(ALEMBIC_ILMBASE_${UPPERCOMPONENT}_LIB +- NAMES +- ${COMPONENT}-${_ilmbase_libs_ver} ${COMPONENT} +- HINTS +- ${_ilmbase_SEARCH_DIRS} +- PATH_SUFFIXES +- lib64 lib +- ) +- LIST(APPEND _ilmbase_LIBRARIES "${ILMBASE_${UPPERCOMPONENT}_LIBRARY}") +-ENDFOREACH() +- +-UNSET(_ilmbase_libs_ver) +- +-IF ( ${ALEMBIC_ILMBASE_HALF_LIB} STREQUAL "ALEMBIC_ILMBASE_HALF_LIB-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) +-ENDIF() +- +-IF ( ${ALEMBIC_ILMBASE_IEX_LIB} STREQUAL "ALEMBIC_ILMBASE_IEX_LIB-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) +-ENDIF() +- +-IF ( DEFINED USE_IEXMATH AND USE_IEXMATH ) +- IF ( ${ALEMBIC_ILMBASE_IEXMATH_LIB} STREQUAL +- "ALEMBIC_ILMBASE_IEXMATH_LIB-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IexMath, IlmThread, Imath) not found, required" ) +- ENDIF() +-ENDIF() +- +-IF ( ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} STREQUAL "ALEMBIC_ILMBASE_ILMTHREAD_LIB-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) +-ENDIF() +- +-IF ( ${ALEMBIC_ILMBASE_IMATH_LIB} STREQUAL "ALEMBIC_ILMBASE_IMATH_LIB-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) +-ENDIF() +- +-IF ( ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY} STREQUAL "ALEMBIC_ILMBASE_INCLUDE_DIRECTORY-NOTFOUND" ) +- MESSAGE( FATAL_ERROR "ilmbase header files not found, required: ALEMBIC_ILMBASE_ROOT: ${ALEMBIC_ILMBASE_ROOT}" ) +-ENDIF() +- +- +-MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) +-MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) +-MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) +-MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) +-MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) +-MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) +- +-SET( ILMBASE_FOUND TRUE ) +diff --git a/cmake/Modules/FindOpenEXR.cmake b/cmake/Modules/FindOpenEXR.cmake +deleted file mode 100644 +index 935fe6f..0000000 +--- a/cmake/Modules/FindOpenEXR.cmake ++++ /dev/null +@@ -1,129 +0,0 @@ +-##-***************************************************************************** +-## +-## Copyright (c) 2009-2011, +-## Sony Pictures Imageworks Inc. and +-## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. +-## +-## All rights reserved. +-## +-## Redistribution and use in source and binary forms, with or without +-## modification, are permitted provided that the following conditions are +-## met: +-## * Redistributions of source code must retain the above copyright +-## notice, this list of conditions and the following disclaimer. +-## * Redistributions in binary form must reproduce the above +-## copyright notice, this list of conditions and the following disclaimer +-## in the documentation and/or other materials provided with the +-## distribution. +-## * Neither the name of Industrial Light & Magic nor the names of +-## its contributors may be used to endorse or promote products derived +-## from this software without specific prior written permission. +-## +-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-## +-##-***************************************************************************** +- +- +-# We shall worry about windowsification later. +- +-#-****************************************************************************** +-#-****************************************************************************** +-# NOW, OPENEXR STUFF. EXR IS OPTIONAL, WHERASE ILMBASE IS NOT +-#-****************************************************************************** +-#-****************************************************************************** +- +-IF(NOT DEFINED OPENEXR_ROOT) +- IF ( ${CMAKE_HOST_UNIX} ) +- IF( ${DARWIN} ) +- # TODO: set to default install path when shipping out +- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) +- ELSE() +- # TODO: set to default install path when shipping out +- SET( ALEMBIC_OPENEXR_ROOT "/usr/local/openexr-1.6.1/" ) +- ENDIF() +- ELSE() +- IF ( ${WINDOWS} ) +- # TODO: set to 32-bit or 64-bit path +- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) +- ELSE() +- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) +- ENDIF() +- ENDIF() +-ELSE() +- SET( ALEMBIC_OPENEXR_ROOT ${OPENEXR_ROOT} ) +-ENDIF() +- +-IF(NOT $ENV{OPENEXR_ROOT}x STREQUAL "x") +- SET( ALEMBIC_OPENEXR_ROOT $ENV{OPENEXR_ROOT}) +-ELSE() +- SET( ENV{OPENEXR_ROOT} ${OPENEXR_ROOT} ) +-ENDIF() +- +- +-SET(LIBRARY_PATHS +- ${ALEMBIC_OPENEXR_ROOT}/lib +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local/lib +- /usr/lib +- /sw/lib +- /opt/local/lib +- /opt/csw/lib +- /opt/lib +- /usr/freeware/lib64 +-) +- +-SET(INCLUDE_PATHS +- ${ALEMBIC_OPENEXR_ROOT}/include/OpenEXR/ +- ~/Library/Frameworks +- /Library/Frameworks +- /usr/local/include/OpenEXR/ +- /usr/local/include +- /usr/include +- /sw/include # Fink +- /opt/local/include # DarwinPorts +- /opt/csw/include # Blastwave +- /opt/include +- /usr/freeware/include +-) +- +-FIND_PATH( ALEMBIC_OPENEXR_INCLUDE_PATH ImfRgba.h +- PATHS +- ${INCLUDE_PATHS} +- DOC "The directory where ImfRgba.h resides" ) +- +-FIND_LIBRARY( ALEMBIC_OPENEXR_ILMIMF_LIB IlmImf +- PATHS +- ${LIBRARY_PATHS} +- DOC "The IlmImf library" ) +- +- +-SET( OPENEXR_FOUND TRUE ) +- +-IF ( ${ALEMBIC_OPENEXR_INCLUDE_PATH} STREQUAL "ALEMBIC_OPENEXR_INCLUDE_PATH-NOTFOUND" ) +- MESSAGE( STATUS "OpenEXR include path not found, disabling" ) +- SET( OPENEXR_FOUND FALSE ) +-ENDIF() +- +-IF ( ${ALEMBIC_OPENEXR_ILMIMF_LIB} STREQUAL "ALEMBIC_OPENEXR_ILMIMF_LIB-NOTFOUND" ) +- MESSAGE( STATUS "OpenEXR libraries not found, disabling" ) +- SET( OPENEXR_FOUND FALSE ) +- SET( ALEMBIC_OPENEXR_LIBS NOTFOUND ) +-ENDIF() +- +-IF (OPENEXR_FOUND) +- MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) +- SET( ALEMBIC_OPENEXR_LIBS ${ALEMBIC_OPENEXR_ILMIMF_LIB} ) +-ENDIF() +- +- diff --git a/ports/alembic/portfile.cmake b/ports/alembic/portfile.cmake index 58ad015dba5085..ecd1974940e0a3 100644 --- a/ports/alembic/portfile.cmake +++ b/ports/alembic/portfile.cmake @@ -5,16 +5,14 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO alembic/alembic - REF cfe114639ef7ad084d61e71ab86a17e708d838ae #v1.7.13 - SHA512 38b797c1179e759870f10afc4a2182bc3e874eacecc9627c879d3a5cf35e49c83cae80600678427e5c22d6576d0e6280ce3cf0a2ac505f1df74ec4a8bdb083b5 + REF 1.7.12 + SHA512 e05e0b24056c17f01784ced1f9606a269974de195f1aca8a6fce2123314e7ee609f70df77ac7fe18dc7f0c04fb883d38cc7de9b963caacf9586aaa24d4ac6210 HEAD_REF master PATCHES + fix-C1083.patch fix-find-openexr-ilmbase.patch ) -file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindIlmBase.cmake) -file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindOpenEXR.cmake) - if(NOT VCPKG_TARGET_IS_WINDOWS) # In debug mode with g++, alembic defines -Werror # so we need to disable some warnings to avoid build errors @@ -51,20 +49,20 @@ if(VCPKG_TARGET_IS_WINDOWS) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/bin/Alembic.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/debug/bin/Alembic.dll) - file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake DEBUG_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake DEBUG_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/Alembic.dll" "\${_IMPORT_PREFIX}/debug/bin/Alembic.dll" DEBUG_CONFIG "${DEBUG_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") - file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake RELEASE_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake RELEASE_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/lib/Alembic.dll" "\${_IMPORT_PREFIX}/bin/Alembic.dll" RELEASE_CONFIG "${RELEASE_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake "${RELEASE_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake "${RELEASE_CONFIG}") else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/alembic) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/alembic RENAME copyright) diff --git a/ports/apr/CONTROL b/ports/apr/CONTROL index 2c9c0c691cae7c..607f6c4d4abbe2 100644 --- a/ports/apr/CONTROL +++ b/ports/apr/CONTROL @@ -1,6 +1,5 @@ Source: apr -Version: 1.7.0 -Port-Version: 2 +Version: 1.7.0-1 Homepage: https://apr.apache.org/ Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. Supports: !uwp diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index 39f2370018299a..b3ede1a1da2243 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -82,7 +82,7 @@ else() vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/apr-1.pc "-lapr-\${APR_MAJOR_VERSION}" "-lapr-1" ) - vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl uuid crypt) + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl) endif() # Handle copyright diff --git a/ports/argparse/vcpkg.json b/ports/argparse/vcpkg.json index 438522292049c3..9137c655f6866d 100644 --- a/ports/argparse/vcpkg.json +++ b/ports/argparse/vcpkg.json @@ -2,6 +2,6 @@ "name": "argparse", "version-string": "2.1", "description": "Argument parser for modern C++", - "homepage": "https://github.com/p-ranav/argparse", - "license": "MIT" + "license": "MIT", + "homepage": "https://github.com/p-ranav/argparse" } diff --git a/ports/argtable3/CONTROL b/ports/argtable3/CONTROL new file mode 100644 index 00000000000000..f894b4fc5ba7f9 --- /dev/null +++ b/ports/argtable3/CONTROL @@ -0,0 +1,4 @@ +Source: argtable3 +Version: 2019-08-21 +Description: A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options +Homepage: www.argtable.org diff --git a/ports/argtable3/fix-cmake.patch b/ports/argtable3/fix-cmake.patch new file mode 100644 index 00000000000000..320e6385e939a3 --- /dev/null +++ b/ports/argtable3/fix-cmake.patch @@ -0,0 +1,98 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 57bd7a1..e19e677 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -65,10 +65,6 @@ if(ARGTABLE3_ENABLE_CONAN AND EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${LINK_FLAGS}") + endif() + +-if(ARGTABLE3_ENABLE_TESTS) +- enable_testing() +-endif() +- + set(ARGTABLE3_AMALGAMATION_SRC_FILE ${PROJECT_SOURCE_DIR}/dist/argtable3.c) + set(ARGTABLE3_SRC_FILES + ${PROJECT_SOURCE_DIR}/src/arg_cmd.c +@@ -88,18 +84,11 @@ set(ARGTABLE3_SRC_FILES + ${PROJECT_SOURCE_DIR}/src/getopt_long.c + ) + +-# Platform specific settings for installation +-if(UNIX) +- include(GNUInstallDirs) +- set(ARGTABLE3_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) +- set(ARGTABLE3_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) +- set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) +-elseif(WIN32) +- set(ARGTABLE3_INSTALL_LIBDIR "lib") +- set(ARGTABLE3_INSTALL_INCLUDEDIR "include") +- set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") +-endif(UNIX) +- + add_subdirectory(src) +-add_subdirectory(tests) ++ ++if(ARGTABLE3_ENABLE_TESTS) ++ enable_testing() ++ add_subdirectory(tests) ++endif() ++ + add_subdirectory(examples) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 429b143..f45c071 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -28,9 +28,19 @@ + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ################################################################################ + +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") ++include(GNUInstallDirs) ++ ++if(UNIX) ++ set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) ++elseif(WIN32) ++ set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") ++endif(UNIX) ++ ++if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") ++endif() + + add_definitions(-D_XOPEN_SOURCE=700) + +@@ -46,6 +56,7 @@ if(WIN32) + "${PROJECT_BINARY_DIR}/src/version.rc" + ) + add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES} "${PROJECT_BINARY_DIR}/src/version.rc") ++ target_compile_definitions(argtable3 INTERFACE argtable3_IMPORTS) + else() + add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES}) + endif() +@@ -57,8 +68,18 @@ target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) + set_target_properties(argtable3 argtable3_static PROPERTIES + VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) +- +-install(TARGETS argtable3 EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) +-install(TARGETS argtable3_static EXPORT ${ARGTABLE3_PACKAGE_NAME}Config ARCHIVE DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) +-install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${ARGTABLE3_INSTALL_INCLUDEDIR}) ++if(BUILD_SHARED_LIBS) ++install(TARGETS argtable3 ++ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++else() ++install(TARGETS argtable3_static ++ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++endif() ++install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_CMAKEDIR}) diff --git a/ports/argtable3/portfile.cmake b/ports/argtable3/portfile.cmake index 4e90c02e07b737..18d994cc540973 100644 --- a/ports/argtable3/portfile.cmake +++ b/ports/argtable3/portfile.cmake @@ -1,9 +1,13 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO argtable/argtable3 - REF 1c1bb23b305c8cf349328fc0cacd7beb7a575ff4 # v3.1.5 - SHA512 13150c8adc1eda107b6df65a2e276510a66bd912f6067d7cc72951735a4c20307144b04cda959cdd24f160da3810ba8bb35e48992ff4281e44ed2331d030fb1d + REF bbc4ec20991e87ecf8dcf288aef777b55b78daa7 + SHA512 050f54ead2d029715d8f10e63ff555027ead61fbfa18bd955e3b99e080f9178ad5c41937c5d62477885143f27bb9e7e505a7120b95bfcd899a60719584191f1c HEAD_REF master + PATCHES + fix-cmake.patch ) vcpkg_configure_cmake( @@ -25,9 +29,14 @@ elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY + ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} +) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include +) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_replace_string( @@ -37,8 +46,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - +# Handle copyright configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +# CMake integration test +vcpkg_test_cmake(PACKAGE_NAME ${PORT}) diff --git a/ports/argtable3/vcpkg.json b/ports/argtable3/vcpkg.json deleted file mode 100644 index 37c2ec78b4bf3b..00000000000000 --- a/ports/argtable3/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "argtable3", - "version-string": "3.1.5", - "description": "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options", - "homepage": "www.argtable.org" -} diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL index c266b9112f2711..463b8e670cf805 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -1,5 +1,4 @@ Source: armadillo -Version: 2019-04-16 -Port-Version: 9 +Version: 2019-04-16-8 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: openblas (!osx), lapack +Build-Depends: openblas (!osx), clapack (!osx) diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index dc7ea8c81e3bd8..0b171b34f919bd 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -1,6 +1,6 @@ Source: arrow -Version: 1.0.0 -Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl, utf8proc +Version: 0.17.1 +Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl Homepage: https://github.com/apache/arrow Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations. Supports: x64 diff --git a/ports/arrow/all.patch b/ports/arrow/all.patch index a566e2a0503b3f..4116a1e5f5b1a8 100644 --- a/ports/arrow/all.patch +++ b/ports/arrow/all.patch @@ -102,105 +102,65 @@ index bb3eb5608..0b03d37d3 100644 find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include") find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin") diff --git a/cpp/cmake_modules/FindZSTD.cmake b/cpp/cmake_modules/FindZSTD.cmake -index 84d21d2b5..971a9dec3 100644 +index 8e47086e8..d87906a25 100644 --- a/cpp/cmake_modules/FindZSTD.cmake +++ b/cpp/cmake_modules/FindZSTD.cmake -@@ -24,11 +24,11 @@ if(ARROW_ZSTD_USE_SHARED) - list(APPEND ZSTD_LIB_NAMES - "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}") - else() -- if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) -- set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") -+ if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(ZSTD_MSVC_DEBUG_LIB_SUFFIX d) - endif() - set(ZSTD_STATIC_LIB_SUFFIX -- "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+ "${ZSTD_MSVC_DEBUG_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) - set(ZSTD_LIB_NAMES "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}") +@@ -19,14 +19,18 @@ if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) + set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") endif() -@@ -49,8 +49,8 @@ if(ZSTD_ROOT) - + +-set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(ZSTD_LIB_NAME_DEBUG_SUFFIX d) ++endif() ++ ++set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${ZSTD_LIB_NAME_DEBUG_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) + + # First, find via if specified ZTD_ROOT + if(ZSTD_ROOT) + message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}") + find_library(ZSTD_LIB +- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" ++ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" + "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" + PATHS ${ZSTD_ROOT} + PATH_SUFFIXES ${LIB_PATH_SUFFIXES} +@@ -39,19 +43,18 @@ if(ZSTD_ROOT) + else() # Second, find via pkg_check_modules - pkg_check_modules(ZSTD_PC libzstd) - if(ZSTD_PC_FOUND) -+ #pkg_check_modules(ZSTD_PC libzstd) -+ if(0) #(ZSTD_PC_FOUND) # Disabled as sometimes incompatible with vcpkg on Linux and OSX ++ if(0) # Disabled as incompatible with vcpkg set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}") - - list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") -diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake -index 3b229846c..da2c6d551 100644 ---- a/cpp/cmake_modules/DefineOptions.cmake -+++ b/cpp/cmake_modules/DefineOptions.cmake -@@ -297,6 +297,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - define_option(ARROW_PROTOBUF_USE_SHARED - "Rely on Protocol Buffers shared libraries where relevant" ON) - -+ define_option(ARROW_UTF8PROC_USE_SHARED -+ "Rely on utf8proc shared libraries where relevant" ON) -+ - define_option(ARROW_ZSTD_USE_SHARED "Rely on zstd shared libraries where relevant" ON) - define_option(ARROW_WITH_BACKTRACE "Build with backtrace support" ON) -diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake -index ab9ae9f98..d3063827a 100644 ---- a/cpp/cmake_modules/Findutf8proc.cmake -+++ b/cpp/cmake_modules/Findutf8proc.cmake -@@ -15,11 +15,28 @@ - # specific language governing permissions and limitations - # under the License. - -+if(ARROW_UTF8PROC_USE_SHARED) -+ set(UTF8PROC_LIB_NAMES) -+ if(CMAKE_IMPORT_LIBRARY_SUFFIX) -+ list(APPEND UTF8PROC_LIB_NAMES -+ "${CMAKE_IMPORT_LIBRARY_PREFIX}utf8proc${CMAKE_IMPORT_LIBRARY_SUFFIX}") -+ endif() -+ list(APPEND UTF8PROC_LIB_NAMES -+ "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}") -+else() -+ if(MSVC AND NOT DEFINED UTF8PROC_MSVC_STATIC_LIB_SUFFIX) -+ set(UTF8PROC_MSVC_STATIC_LIB_SUFFIX "_static") -+ endif() -+ set(UTF8PROC_STATIC_LIB_SUFFIX -+ "${UTF8PROC_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+ set(UTF8PROC_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}utf8proc${UTF8PROC_STATIC_LIB_SUFFIX}) -+ set(UTF8PROC_LIB_NAMES "${UTF8PROC_STATIC_LIB_NAME}" "lib${UTF8PROC_STATIC_LIB_NAME}") -+endif() -+ - if(utf8proc_ROOT) - find_library( - UTF8PROC_LIB -- NAMES utf8proc -- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" -+ NAMES ${UTF8PROC_LIB_NAMES} - PATHS ${utf8proc_ROOT} - PATH_SUFFIXES ${LIB_PATH_SUFFIXES} - NO_DEFAULT_PATH) -@@ -28,12 +45,10 @@ if(utf8proc_ROOT) - PATHS ${utf8proc_ROOT} - NO_DEFAULT_PATH - PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) -- - else() - find_library( - UTF8PROC_LIB -- NAMES utf8proc -- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" -+ NAMES ${UTF8PROC_LIB_NAMES} - PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - find_path(UTF8PROC_INCLUDE_DIR NAMES utf8proc.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) - endif() -@@ -47,5 +62,8 @@ if(UTF8PROC_FOUND OR utf8proc_FOUND) - set_target_properties(utf8proc::utf8proc - PROPERTIES IMPORTED_LOCATION "${UTF8PROC_LIB}" - INTERFACE_INCLUDE_DIRECTORIES "${UTF8PROC_INCLUDE_DIR}") -+ if(NOT ARROW_UTF8PROC_USE_SHARED) -+ set_target_properties(utf8proc::utf8proc -+ PROPERTIES INTERFACE_COMPILER_DEFINITIONS "UTF8PROC_STATIC") -+ endif() - endif() -- + list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") +- find_library(ZSTD_LIB zstd ++ find_library(ZSTD_LIB zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} + PATHS ${ZSTD_PC_LIBRARY_DIRS} + NO_DEFAULT_PATH + PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) + # Third, check all other CMake paths + else() + find_library(ZSTD_LIB +- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" ++ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" + "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" + PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) + find_path(ZSTD_INCLUDE_DIR NAMES zstd.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) +diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake +index 6110a5aa5..3270d74a9 100644 +--- a/cpp/cmake_modules/SetupCxxFlags.cmake ++++ b/cpp/cmake_modules/SetupCxxFlags.cmake +@@ -163,7 +163,9 @@ macro(arrow_add_werror_if_debug) + if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") + # Treat all compiler warnings as errors + if(MSVC) +- set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") ++ if(MSVC_VERSION VERSION_LESS 1900) ++ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") ++ endif() + else() + set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror") + endif() diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index dcb1d966492cfa..42227dc9417c2c 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/arrow - REF apache-arrow-1.0.0 - SHA512 cfbe22a7987658cce15f83c3be50435567f2b8156fa50007ae103418b969c6075dbf2858c25787a40feb391e84075905dd045300beb7fcedf4344823f8c4be20 + REF apache-arrow-0.17.1 + SHA512 2a1a637d6df08e19d0c8313c51e1baf8902db677b072f8787c4f9faf8bdec94357ac8af839718d449377b508fe4f6e31b011cbdc6ccf029b6a66f567172569aa HEAD_REF master PATCHES all.patch @@ -26,15 +26,12 @@ vcpkg_configure_cmake( OPTIONS -DARROW_DEPENDENCY_SOURCE=SYSTEM -Duriparser_SOURCE=SYSTEM - -DARROW_BUILD_TESTS=OFF + -DARROW_BUILD_TESTS=off ${FEATURE_OPTIONS} -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC} -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED} - -DARROW_BROTLI_USE_SHARED=${ARROW_BUILD_SHARED} - -DARROW_GFLAGS_USE_SHARED=${ARROW_BUILD_SHARED} - -DARROW_UTF8PROC_USE_SHARED=${ARROW_BUILD_SHARED} - -DARROW_ZSTD_USE_SHARED=${ARROW_BUILD_SHARED} - -DARROW_JEMALLOC=OFF + -DARROW_GFLAGS_USE_SHARED=off + -DARROW_JEMALLOC=off -DARROW_BUILD_UTILITIES=OFF -DARROW_WITH_BZ2=ON -DARROW_WITH_ZLIB=ON @@ -42,7 +39,6 @@ vcpkg_configure_cmake( -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON - -DARROW_WITH_UTF8PROC=ON -DPARQUET_REQUIRE_ENCRYPTION=ON ) diff --git a/ports/asiosdk/CONTROL b/ports/asiosdk/CONTROL index b97ebb689d4337..1a8c75628314a3 100644 --- a/ports/asiosdk/CONTROL +++ b/ports/asiosdk/CONTROL @@ -1,4 +1,4 @@ Source: asiosdk -Version: 2.3.3-1 +Version: 2.3.3 Homepage: https://www.steinberg.net/en/company/developers.html Description: ASIO is a low latency audio API from Steinberg. diff --git a/ports/asiosdk/vcpkg-cmake-wrapper.cmake b/ports/asiosdk/vcpkg-cmake-wrapper.cmake index df14d7c827e016..2fbe9725f536ec 100644 --- a/ports/asiosdk/vcpkg-cmake-wrapper.cmake +++ b/ports/asiosdk/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(ASIOSDK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT ASIOSDK_INCLUDE_DIR) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${ASIOSDK_PREV_MODULE_PATH}) diff --git a/ports/asmjit/CONTROL b/ports/asmjit/CONTROL index d4b46b6a5c4007..5ec779ce70fb24 100644 --- a/ports/asmjit/CONTROL +++ b/ports/asmjit/CONTROL @@ -1,5 +1,5 @@ Source: asmjit -Version: 2020-07-22 +Version: 2020-05-08 Homepage: https://github.com/asmjit/asmjit Description: Complete x86/x64 JIT and Remote Assembler for C++ Supports: !arm diff --git a/ports/asmjit/portfile.cmake b/ports/asmjit/portfile.cmake index 812083b6d919ca..d95645d7e21642 100644 --- a/ports/asmjit/portfile.cmake +++ b/ports/asmjit/portfile.cmake @@ -3,23 +3,23 @@ vcpkg_fail_port_install(ON_ARCH "arm") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO asmjit/asmjit - REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 - SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 + REF 80645e66a8ae85749937bda3b329388c8a76ea4c + SHA512 8e7b0aed14e8ce05e6e6b2eed77be23a81b9548a146aef187ac6beced3bc2a6cba92835718adb901a1ab983fab32f3e9f18061b157b2276bb1451a71ca1195b8 HEAD_REF master ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(ASMJIT_STATIC 1) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DASMJIT_STATIC=1 + ) else() - set(ASMJIT_STATIC 0) -endif() - -vcpkg_configure_cmake( + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DASMJIT_STATIC=${ASMJIT_STATIC} - ) - + ) +endif() vcpkg_install_cmake() vcpkg_copy_pdbs() diff --git a/ports/audiofile/portfile.cmake b/ports/audiofile/portfile.cmake deleted file mode 100644 index 49f9a67d279426..00000000000000 --- a/ports/audiofile/portfile.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# header-only library - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO adamstark/AudioFile - REF ccb64bd86881099e65a329f104733679ae03f63e # 1.0.7 - SHA512 f172f9df95a028c9c3da29cd530dd4b55acad76ee7503000f96ba10c5d014abd219fcd145cea4b7ca7a902c38d968518b39de285d25f7e3ccc56d1ba3769d7b8 - HEAD_REF master -) - -file(COPY ${SOURCE_PATH}/AudioFile.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/audiofile/vcpkg.json b/ports/audiofile/vcpkg.json deleted file mode 100644 index d779642030d20b..00000000000000 --- a/ports/audiofile/vcpkg.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "audiofile", - "version-string": "1.0.7", - "description": "A simple header-only C++ library for reading and writing audio files.", - "homepage": "https://github.com/adamstark/AudioFile", - "license": "GPL-3.0" -} diff --git a/ports/avisynthplus/vcpkg.json b/ports/avisynthplus/vcpkg.json index c8a8d77b0de7ed..1af0142ea4d4bb 100644 --- a/ports/avisynthplus/vcpkg.json +++ b/ports/avisynthplus/vcpkg.json @@ -1,7 +1,7 @@ { "name": "avisynthplus", "version-string": "3.6.0", - "description": "An improved version of the AviSynth frameserver, with improved features and developer friendliness", "homepage": "http://avs-plus.net/", + "description": "An improved version of the AviSynth frameserver, with improved features and developer friendliness", "supports": "!(uwp | arm | static)" } diff --git a/ports/avro-cpp/CONTROL b/ports/avro-cpp/CONTROL deleted file mode 100644 index 0f75d7e24cdd2e..00000000000000 --- a/ports/avro-cpp/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: avro-cpp -Version: 1.9.2 -Homepage: https://github.com/apache/avro -Description: Apache Avro is a data serialization system -Build-Depends: boost-format, boost-thread, boost-filesystem, boost-iostreams, boost-program-options, boost-random, boost-crc, boost-test, libzip, bzip2, liblzma, zlib, zstd - -Feature: snappy -Build-Depends: snappy -Description: Support Snappy for compression diff --git a/ports/avro-cpp/install.patch b/ports/avro-cpp/install.patch deleted file mode 100644 index 12ead28612157d..00000000000000 --- a/ports/avro-cpp/install.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt -index 30a5d66..f7f2b94 100644 ---- a/lang/c++/CMakeLists.txt -+++ b/lang/c++/CMakeLists.txt -@@ -40,6 +40,8 @@ set (AVRO_VERSION_MINOR "0") - project (Avro-cpp) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}) - -+find_package(ZLIB REQUIRED) -+ - if (WIN32 AND NOT CYGWIN AND NOT MSYS) - add_definitions (/EHa) - add_definitions ( -@@ -118,11 +120,11 @@ set_target_properties (avrocpp PROPERTIES - set_target_properties (avrocpp_s PROPERTIES - VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}) - --target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) -+target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) - - add_executable (precompile test/precompile.cc) - --target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) -+target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) - - macro (gen file ns) - add_custom_command (OUTPUT ${file}.hh -@@ -151,34 +153,40 @@ gen (crossref cr) - gen (primitivetypes pt) - - add_executable (avrogencpp impl/avrogencpp.cc) --target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) -+target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) -+ - --enable_testing() -+if(BUILD_TESTING) -+ enable_testing() -+endif() - - macro (unittest name) - add_executable (${name} test/${name}.cc) -- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) -+ target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) - add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) - endmacro (unittest) - --unittest (buffertest) --unittest (unittest) --unittest (SchemaTests) --unittest (LargeSchemaTests) --unittest (CodecTests) --unittest (StreamTests) --unittest (SpecificTests) --unittest (DataFileTests) --unittest (JsonTests) --unittest (AvrogencppTests) --unittest (CompilerTests) -- --add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh -- tweet_hh -- union_array_union_hh union_map_union_hh union_conflict_hh -- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh -- primitivetypes_hh empty_record_hh) -+if(BUILD_TESTING) -+ unittest (buffertest) -+ unittest (unittest) -+ unittest (SchemaTests) -+ unittest (LargeSchemaTests) -+ unittest (CodecTests) -+ unittest (StreamTests) -+ unittest (SpecificTests) -+ unittest (DataFileTests) -+ unittest (JsonTests) -+ unittest (AvrogencppTests) -+ unittest (CompilerTests) -+ -+ add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh -+ tweet_hh -+ union_array_union_hh union_map_union_hh union_conflict_hh -+ recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh -+ primitivetypes_hh empty_record_hh) -+ -+endif() - - include (InstallRequiredSystemLibraries) - -@@ -189,9 +197,9 @@ include (CPack) - install (TARGETS avrocpp avrocpp_s - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -- RUNTIME DESTINATION lib) -+ RUNTIME DESTINATION bin) - --install (TARGETS avrogencpp RUNTIME DESTINATION bin) -+install (TARGETS avrogencpp RUNTIME DESTINATION tools/bin) - - install (DIRECTORY api/ DESTINATION include/avro - FILES_MATCHING PATTERN *.hh) diff --git a/ports/avro-cpp/portfile.cmake b/ports/avro-cpp/portfile.cmake deleted file mode 100644 index 49f0af20ce77b2..00000000000000 --- a/ports/avro-cpp/portfile.cmake +++ /dev/null @@ -1,35 +0,0 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO apache/avro - REF release-1.9.2 - SHA512 6a6980901eea964c050eb3d61fadf28712e2f02c36985bf8e5176b668bba48985f6a666554a1964435448de29b18d790ab86b787d0288a22fd9cba00746a7846 - HEAD_REF master - PATCHES - install.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH}/lang/c++ - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS - -DBUILD_TESTING=OFF - ${FEATURE_OPTIONS} - OPTIONS_DEBUG - -DAVRO_ADD_PROTECTOR_FLAGS=1 -) - -vcpkg_install_cmake(ADD_BIN_TO_PATH) - -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -file(INSTALL ${SOURCE_PATH}/lang/c++/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/azure-c-shared-utility/CONTROL b/ports/azure-c-shared-utility/CONTROL index 6546575b1f0f68..253ed721c95d1b 100644 --- a/ports/azure-c-shared-utility/CONTROL +++ b/ports/azure-c-shared-utility/CONTROL @@ -1,5 +1,5 @@ Source: azure-c-shared-utility -Version: 2020-07-19 +Version: 2020-06-17-1 Description: Azure C SDKs common code Homepage: https://github.com/Azure/azure-c-shared-utility Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c, umock-c @@ -7,4 +7,4 @@ Supports: !uwp Feature: public-preview Description: Azure C SDKs common code (public preview) -Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] +Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] \ No newline at end of file diff --git a/ports/azure-c-shared-utility/portfile.cmake b/ports/azure-c-shared-utility/portfile.cmake index ccc9b681d10e87..b38a835ce0b550 100644 --- a/ports/azure-c-shared-utility/portfile.cmake +++ b/ports/azure-c-shared-utility/portfile.cmake @@ -16,8 +16,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-c-shared-utility - REF 65c27eb4ab9a8bbe36b4d7c5a0e9ad305becb8b4 - SHA512 48c65111b12e895f9c2087964d7291e6d1629242194fed9b33ead8ca438f16c803786cd55761eabdd12d47c9920542cff0e510bf16f16cac1d60049ba205df0e + REF 30211c742f082082c127c0f284257119131a96ab + SHA512 c46493a82a6879d501a0261ca61fb91594ac554928794ef96fd96570fed2ba5e0533a4e00a02e3826d7dfacc22bff3ac8e0a2696a7b46c766d317f29207ec062 HEAD_REF master PATCHES fix-utilityFunctions-conditions.patch diff --git a/ports/azure-iot-sdk-c/CONTROL b/ports/azure-iot-sdk-c/CONTROL index 6344bdeabad213..0c6aef0a1ead6f 100644 --- a/ports/azure-iot-sdk-c/CONTROL +++ b/ports/azure-iot-sdk-c/CONTROL @@ -1,6 +1,5 @@ Source: azure-iot-sdk-c -Version: 2020-07-19 -Port-Version: 1 +Version: 2020-06-17-2 Build-Depends: azure-uamqp-c, azure-umqtt-c, azure-c-shared-utility, parson, azure-uhttp-c, azure-macro-utils-c, umock-c Description: A C99 SDK for connecting devices to Microsoft Azure IoT services Homepage: https://github.com/Azure/azure-iot-sdk-c diff --git a/ports/azure-iot-sdk-c/portfile.cmake b/ports/azure-iot-sdk-c/portfile.cmake index db460aaecf7547..6d0bec58a192c7 100644 --- a/ports/azure-iot-sdk-c/portfile.cmake +++ b/ports/azure-iot-sdk-c/portfile.cmake @@ -15,8 +15,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-iot-sdk-c - REF f464326f10cbba497b71c4aa263b6a22e1b375fe - SHA512 32dfb2ac697755af3646b07259298fc2f27007ab1a0a27da0be4f597c82dd2f8bbad6f07b4ed01dfbb62d86649d4be913c59e1e76b33efec112beaaba550d375 + REF 989f1dc66c7de53cb14d29eb051003eec0de798e + SHA512 876e846cdef699ee3635e5191a697c56c7c40b2110d2468cfbbe204cff59d42a0d930861fda7229dbba163a329de9d8f06276228bab516ef92c88feebfcfbc13 HEAD_REF master PATCHES improve-external-deps.patch @@ -25,7 +25,6 @@ else() endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - use-prov-client hsm_type_symm_key use-prov-client use_prov_client ) @@ -41,6 +40,7 @@ vcpkg_configure_cmake( -Duse_default_uuid=ON -Dbuild_as_dynamic=OFF -Duse_edge_modules=ON + -Dhsm_type_symm_key=${use_prov_client} ) vcpkg_install_cmake() diff --git a/ports/azure-uamqp-c/CONTROL b/ports/azure-uamqp-c/CONTROL index ddd6fe2da1bb8e..c2a59448dad988 100644 --- a/ports/azure-uamqp-c/CONTROL +++ b/ports/azure-uamqp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uamqp-c -Version: 2020-07-19 +Version: 2020-06-17-1 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: AMQP library for C Homepage: https://github.com/Azure/azure-uamqp-c diff --git a/ports/azure-uamqp-c/portfile.cmake b/ports/azure-uamqp-c/portfile.cmake index e154414fc2d6b6..39b45e8cd18819 100644 --- a/ports/azure-uamqp-c/portfile.cmake +++ b/ports/azure-uamqp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uamqp-c - REF 9e851bd6db08d6d2d08d1ef469d1e6fc4795382d - SHA512 efe0b9ed8a949af67e958b1516f499f57a0838a847e92d6c932058e931d2536038e7d49d63597e21de0a6f2af22bc179a6d99c8b8077451f906118b0b65e1417 + REF cd11c2591ada765f23669bce62dbfaf503b3108e + SHA512 a2879afcc6417ebe81bae0ca12e0ebcae90749637446917168a3356bfdd8fa2f3d73fb1ce2def907b26f7d6c0fcc4f7bd72463ed9dba4d0f8a5a287f4307ae0c HEAD_REF master ) endif() diff --git a/ports/azure-uhttp-c/CONTROL b/ports/azure-uhttp-c/CONTROL index b64573024fb0f7..5f26022c4c7e60 100644 --- a/ports/azure-uhttp-c/CONTROL +++ b/ports/azure-uhttp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uhttp-c -Version: 2020-07-19 +Version: 2020-06-17-1 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: Azure HTTP Library written in C Homepage: https://github.com/Azure/azure-uhttp-c diff --git a/ports/azure-uhttp-c/portfile.cmake b/ports/azure-uhttp-c/portfile.cmake index 1e05b1cfa93c54..ff8c03e90f816d 100644 --- a/ports/azure-uhttp-c/portfile.cmake +++ b/ports/azure-uhttp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uhttp-c - REF ef8ba1591b0f825315b78380331ff9290197db02 - SHA512 3e0434272de684a43189d491c16ab7e20ffcfd08f8addb01f64caa446211faa67e45aa51c403520df6a105cc9ac50b85de1b9e0954510fd4232c0f19d01fea9c + REF 6bf59b9057f653aaa57e6539627085f41c2dfe33 + SHA512 96437df9f249e2a551e9890b4d476ae032384a067d845b86893013138380802592f70139e2b4f4c0d543c464ef98008d0b2f025ce6f0341181e431b53e311dc5 HEAD_REF master ) endif() diff --git a/ports/azure-umqtt-c/CONTROL b/ports/azure-umqtt-c/CONTROL index 755b0160e9bc3f..9f8f637e23b9fd 100644 --- a/ports/azure-umqtt-c/CONTROL +++ b/ports/azure-umqtt-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-umqtt-c -Version: 2020-07-19 +Version: 2020-06-17-1 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: General purpose library for communication over the mqtt protocol Homepage: https://github.com/Azure/azure-umqtt-c diff --git a/ports/azure-umqtt-c/portfile.cmake b/ports/azure-umqtt-c/portfile.cmake index 84fba09b62871a..80779f03e55195 100644 --- a/ports/azure-umqtt-c/portfile.cmake +++ b/ports/azure-umqtt-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-umqtt-c - REF 165f6f52f8b2aec54a28ea5ede41736589726cd0 - SHA512 af56db89ddbae1a8067d3b1c7f85ecf085fb6bf529d01f74dd301e6994b20e6f1a821fd7d5116b53d1a8911ccc463149a53a5611e650c3aeb63893012206ffb8 + REF 349a2bffc1addfdc4b61d30f80adc1e15b336fbd + SHA512 887ece4d9cbb32059c84d776d88ce05fa8474289afb1cd5873a672fc926024a416ac50a829c671fd2aae6b4eaa984f05196a3fff6a56011585d875f116a0a764 HEAD_REF master ) endif() diff --git a/ports/blaze/CONTROL b/ports/blaze/CONTROL index 5f613205c240bd..d9198b970beb8b 100644 --- a/ports/blaze/CONTROL +++ b/ports/blaze/CONTROL @@ -1,6 +1,5 @@ Source: blaze Version: 3.7 -Port-Version: 1 -Build-Depends: lapack, boost-exception +Build-Depends: clapack (!osx), boost-exception Homepage: https://bitbucket.org/blaze-lib/blaze Description: Blaze is an open-source, high-performance C++ math library for dense and sparse arithmetic. diff --git a/ports/blend2d/portfile.cmake b/ports/blend2d/portfile.cmake index 0addc0e0ab056a..8862ba28be0a7e 100644 --- a/ports/blend2d/portfile.cmake +++ b/ports/blend2d/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_ARCH "wasm32" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO blend2d/blend2d - REF ee5c52aa5fcaaf9910dd2ef566a741d998bdfb98 - SHA512 e33e9418be13d239feb2a88d52538e0a86b920b9bcb0473ac21b27fbd54f7c683e23c1f8a6dbcbcf24fdc85bfc1b5884ebea4a9a5e4ec1fcfbfaa006807e3d59 + REF 9e6686c0760135cc54dfd3e9e239ceac07cddb78 + SHA512 475a7fa4de4728e0c41d97e759d5c74fe5d66d28169614a9081a461fdc27e1f1c4db438d7e2a5cd9170489bbb7e352d73ec46d8bde45ff7c4a024c35fdb43e5f HEAD_REF master ) @@ -21,8 +21,8 @@ if(NOT BLEND2D_BUILD_NO_JIT) vcpkg_from_github( OUT_SOURCE_PATH ASMJIT_SOURCE_PATH REPO asmjit/asmjit - REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 - SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 + REF 2de7e742443e23b925b830c415268ce1470341ce + SHA512 40ec1ec5540a20530e795c0e425322ed027d2e6e400f8f1ee1426e256ea0f3cf2e241972cdbda2f2d8e9fad06ba0ba12f0dcff9a09aa5da65cb3d01e19079966 HEAD_REF master ) diff --git a/ports/blend2d/vcpkg.json b/ports/blend2d/vcpkg.json index 163843a0a357c7..e8940a0eeb5c1a 100644 --- a/ports/blend2d/vcpkg.json +++ b/ports/blend2d/vcpkg.json @@ -1,15 +1,10 @@ { "name": "blend2d", - "version-string": "beta_2020-07-31", + "version-string": "beta_2020-07-09", + "port-version": 0, "description": "Beta 2D Vector Graphics Powered by a JIT Compiler", "homepage": "https://github.com/blend2d/blend2d", "documentation": "https://blend2d.com/doc/index.html", - "supports": "!(arm | uwp)", - "default-features": [ - "jit", - "logging", - "tls" - ], "features": [ { "name": "jit", @@ -23,5 +18,11 @@ "name": "tls", "description": "Default feature. Enables use of thread_local feature. Disable for platforms where thread local storage is expensive or not supported." } - ] + ], + "default-features": [ + "jit", + "logging", + "tls" + ], + "supports": "!(arm|uwp)" } diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index 94d5cd3f7a1284..eaf174e23e5962 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,5 +1,5 @@ Source: bond -Version: 9.0.2 +Version: 9.0.0 Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. Homepage: https://github.com/Microsoft/bond Build-Depends: rapidjson, boost-config, boost-utility, boost-assign diff --git a/ports/bond/fix-install-path.patch b/ports/bond/fix-install-path.patch index 643e0cfbfbf0d3..e5fa270c192374 100644 --- a/ports/bond/fix-install-path.patch +++ b/ports/bond/fix-install-path.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f8eaa..1b0c01c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -23,7 +23,7 @@ set (BOND_FIND_RAPIDJSON +@@ -18,7 +18,7 @@ set (BOND_FIND_RAPIDJSON # settings so that we don't apply our settings to third-party code. add_subdirectory (thirdparty) @@ -11,7 +11,7 @@ index f2f8eaa..1b0c01c 100644 set (BOND_IDL ${CMAKE_CURRENT_SOURCE_DIR}/idl) set (BOND_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/cpp/inc) -@@ -85,6 +85,6 @@ if (BOND_GBC_PATH) +@@ -80,6 +80,6 @@ if (BOND_GBC_PATH) install ( FILES ${BOND_GBC_PATH} @@ -35,7 +35,7 @@ index 1dff9d0..9a11575 100644 @@ -130,7 +130,7 @@ endif() install (FILES ${output} - PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - DESTINATION bin) + DESTINATION ${completion_dir}) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 9a1485baca272b..903ca0f462372a 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -set(BOND_VER 9.0.2) +set(BOND_VER 9.0.0) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/bond REF ${BOND_VER} - SHA512 ece636bc06e7bac4208d373610e689f19b394cae4eaa869f32b098924a6e7034e4d804d4831d7f6fd2540a619daf77f4ab43c49aa442a9cd26161b0a8a2db000 + SHA512 b6bed9be8b5dd2a7d50c6bd275b94c62050b83717907522a07279cccc50e209306792c6f3c7f206afcb3226aed21b43b115b63dccc806eff5d9cd4e12b355461 HEAD_REF master PATCHES fix-install-path.patch skip-grpc-compilation.patch ) @@ -15,7 +15,7 @@ if (VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile(GBC_ARCHIVE URLS "https://github.com/microsoft/bond/releases/download/${BOND_VER}/gbc-${BOND_VER}-amd64.zip" FILENAME "gbc-${BOND_VER}-amd64.zip" - SHA512 661d63a82284d3ecbc7b50d5f4972dadeb607f96612108a4a0887c6684a418e8b265516354504ca3440a182d1e31f2eb5861531133b455d8b6c01aec45ade5d3 + SHA512 f4480a3eb7adedfd3da554ef3cdc64b6e7da5c699bde0ccd86b2dd6a159ccacbb1df2b84b6bc80bc8475f30b904cba98085609e42aad929b2b23258eaff52048 ) # Clear the generator to prevent it from updating diff --git a/ports/boost-asio/CONTROL b/ports/boost-asio/CONTROL index 63823d2a448593..641ca4aa91d2c5 100644 --- a/ports/boost-asio/CONTROL +++ b/ports/boost-asio/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-asio Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!arm&!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl +Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl Homepage: https://github.com/boostorg/asio Description: Boost asio module diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index f6ab98cf82b77d..087970deab9dc7 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,5 +1,4 @@ Source: boost-build -Version: 1.73.0 -Port-Version: 2 +Version: 1.73.0-1 Homepage: https://github.com/boostorg/build Description: Boost.Build diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index 9b06d0074eb18a..7633f51aaa1fbf 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") +if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") return() elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") return() diff --git a/ports/boost-context/CONTROL b/ports/boost-context/CONTROL index a6ba3fa04eb571..2180441f3a062d 100644 --- a/ports/boost-context/CONTROL +++ b/ports/boost-context/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-context -Version: 1.73.0 -Port-Version: 1 +Version: 1.73.0-1 Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-modular-build-helper, boost-pool, boost-predef, boost-smart-ptr, boost-thread, boost-vcpkg-helpers Homepage: https://github.com/boostorg/context Description: Boost context module -Supports: !uwp diff --git a/ports/boost-coroutine/CONTROL b/ports/boost-coroutine/CONTROL index 95851da832e5f3..b8a67d5b823c18 100644 --- a/ports/boost-coroutine/CONTROL +++ b/ports/boost-coroutine/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-coroutine Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-context (!uwp), boost-detail, boost-exception, boost-integer, boost-modular-build-helper, boost-move, boost-range, boost-system, boost-thread, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/coroutine Description: Boost coroutine module -Supports: !arm&!uwp diff --git a/ports/boost-fiber/CONTROL b/ports/boost-fiber/CONTROL index 4db73b41e91174..22acacfbe5fb5e 100644 --- a/ports/boost-fiber/CONTROL +++ b/ports/boost-fiber/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-fiber Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-build, boost-config, boost-context (!uwp), boost-core, boost-detail, boost-filesystem (!uwp), boost-format, boost-intrusive, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-vcpkg-helpers Homepage: https://github.com/boostorg/fiber Description: Boost fiber module -Supports: !osx&!uwp&!arm diff --git a/ports/boost-filesystem/CONTROL b/ports/boost-filesystem/CONTROL index 3a2b3239089846..09e2a8e6ce7299 100644 --- a/ports/boost-filesystem/CONTROL +++ b/ports/boost-filesystem/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-filesystem Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-system, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/filesystem Description: Boost filesystem module -Supports: !uwp diff --git a/ports/boost-graph-parallel/CONTROL b/ports/boost-graph-parallel/CONTROL index cd05cb7de8d9f8..d08ab59fb44772 100644 --- a/ports/boost-graph-parallel/CONTROL +++ b/ports/boost-graph-parallel/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph-parallel Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/graph_parallel Description: Boost graph_parallel module diff --git a/ports/boost-iostreams/CONTROL b/ports/boost-iostreams/CONTROL index 7f521ec3476d82..b62a07c060aa07 100644 --- a/ports/boost-iostreams/CONTROL +++ b/ports/boost-iostreams/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-iostreams Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-assert, boost-bind, boost-build, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, bzip2, liblzma, zlib, zstd Homepage: https://github.com/boostorg/iostreams Description: Boost iostreams module -Supports: !uwp diff --git a/ports/boost-locale/CONTROL b/ports/boost-locale/CONTROL index 5260cea4c5aacd..d7c8d7c0fa7097 100644 --- a/ports/boost-locale/CONTROL +++ b/ports/boost-locale/CONTROL @@ -1,11 +1,9 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-locale -Version: 1.73.0 -Port-Version: 1 +Version: 1.73.0-1 Build-Depends: boost-assert, boost-build, boost-config, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-smart-ptr, boost-static-assert, boost-system, boost-thread, boost-type-traits, boost-unordered, boost-vcpkg-helpers, libiconv (!uwp&!windows) Homepage: https://github.com/boostorg/locale Description: Boost locale module -Supports: !uwp Feature: icu Build-Depends: icu diff --git a/ports/boost-log/CONTROL b/ports/boost-log/CONTROL index 33fc046e7b4c35..c4aa6be65d0b2f 100644 --- a/ports/boost-log/CONTROL +++ b/ports/boost-log/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-log Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-align, boost-array, boost-asio, boost-assert, boost-atomic, boost-bind, boost-build, boost-compatibility, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-exception, boost-filesystem (!uwp), boost-function-types, boost-fusion, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iterator, boost-lexical-cast, boost-locale (!uwp), boost-math, boost-modular-build-helper, boost-move, boost-mpl, boost-optional, boost-parameter, boost-phoenix, boost-predef, boost-preprocessor, boost-property-tree, boost-proto, boost-random, boost-range, boost-regex, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-thread, boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi, boost-xpressive Homepage: https://github.com/boostorg/log Description: Boost log module -Supports: !uwp diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index 629e01f6d372d0..05a1762a037b99 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -35,12 +35,6 @@ else() list(APPEND B2_OPTIONS address-model=32) endif() -if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") - list(APPEND B2_OPTIONS architecture=s390x) -else() - list(APPEND B2_OPTIONS architecture=x86) -endif() - if(APPLE) list(APPEND B2_OPTIONS target-os=darwin toolset=clang) elseif(WIN32) @@ -97,11 +91,7 @@ if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET) endif() endif() if(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") - else() - set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") - endif() + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") endif() if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT) set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") @@ -168,6 +158,7 @@ add_custom_target(boost ALL --hash -q + architecture=x86 threading=multi debug-symbols=on diff --git a/ports/boost-modular-build-helper/CONTROL b/ports/boost-modular-build-helper/CONTROL index f1794db5d17cb4..29c1d24c81f078 100644 --- a/ports/boost-modular-build-helper/CONTROL +++ b/ports/boost-modular-build-helper/CONTROL @@ -1,3 +1,3 @@ Source: boost-modular-build-helper Version: 1.73.0 -Port-Version: 3 +Port-Version: 2 diff --git a/ports/boost-modular-build-helper/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam index 8d7d1e35019cf5..884284b499510b 100644 --- a/ports/boost-modular-build-helper/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam @@ -36,7 +36,8 @@ if "@PORT@" != "boost-system" { use-project /boost/system : . ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_system ; use-project /boost : . ; @@ -47,7 +48,8 @@ if "@PORT@" != "boost-chrono" { use-project /boost/chrono : . ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_chrono ; } @@ -55,7 +57,8 @@ if "@PORT@" != "boost-regex" { use-project /boost/regex : . ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_regex ; } @@ -63,7 +66,8 @@ if "@PORT@" != "boost-date-time" { use-project /boost/date_time : . ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_SUFFIX@" @VARIANT@ -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_RELEASE_SUFFIX@" release -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_DEBUG_SUFFIX@" debug -/boost/date_time//boost_date_time ; explicit boost_date_time ; } @@ -71,7 +75,8 @@ if "@PORT@" != "boost-thread" { use-project /boost/thread : . ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/date_time//boost_date_time ; explicit boost_thread ; } @@ -79,7 +84,8 @@ if "@PORT@" != "boost-timer" { use-project /boost/timer : . ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_timer ; } @@ -87,7 +93,8 @@ if "@PORT@" != "boost-filesystem" { use-project /boost/filesystem : . ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/system//boost_system ; explicit boost_filesystem ; } @@ -95,7 +102,8 @@ if "@PORT@" != "boost-atomic" { use-project /boost/atomic : . ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_atomic ; } @@ -106,7 +114,8 @@ if "@PORT@" != "boost-context" use-project /boost/context : . ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_context ; } @@ -114,7 +123,8 @@ if "@PORT@" != "boost-test" { use-project /boost/test : . ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_unit_test_framework ; } @@ -122,7 +132,8 @@ if "@PORT@" != "boost-serialization" { use-project /boost/serialization : . ; - lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_SUFFIX@" @VARIANT@ ; + lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_RELEASE_SUFFIX@" release ; + lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_DEBUG_SUFFIX@" debug ; explicit boost_serialization ; } diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index b77581fa311ad7..1ce6ad1cc72da3 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -4,7 +4,7 @@ function(boost_modular_build) if(NOT DEFINED _bm_SOURCE_PATH) message(FATAL_ERROR "SOURCE_PATH is a required argument to boost_modular_build.") endif() - + # Next CMake variables may be overridden in the file specified in ${_bm_BOOST_CMAKE_FRAGMENT} set(B2_OPTIONS) set(B2_OPTIONS_DBG) @@ -21,7 +21,7 @@ function(boost_modular_build) set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build") elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) - elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") + elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) else() set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/tools/boost-build") @@ -29,7 +29,7 @@ function(boost_modular_build) if(NOT EXISTS "${BOOST_BUILD_PATH}") if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") + message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") else() message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.") endif() @@ -81,20 +81,15 @@ function(boost_modular_build) file(WRITE ${_bm_SOURCE_PATH}/build/Jamfile.v2 "${_contents}") endif() + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-config/checks") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${_bm_SOURCE_PATH}/build/config") # endif() # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-predef/check") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${_bm_SOURCE_PATH}/build/predef") # endif() - - function(unix_build BOOST_LIB_SUFFIX BUILD_TYPE BUILD_LIB_PATH) - message(STATUS "Building ${BUILD_TYPE}...") - set(BOOST_LIB_SUFFIX ${BOOST_LIB_SUFFIX}) - set(VARIANT ${BUILD_TYPE}) - set(BUILD_LIB_PATH ${BUILD_LIB_PATH}) - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) - + + if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(configure_option) if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) list(APPEND configure_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}") @@ -112,16 +107,6 @@ function(boost_modular_build) ${configure_option} ) vcpkg_install_cmake() - endfunction() - - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - unix_build(${BOOST_LIB_RELEASE_SUFFIX} "release" "lib/") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - unix_build(${BOOST_LIB_DEBUG_SUFFIX} "debug" "debug/lib/") - endif() if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/lib) message(FATAL_ERROR "No libraries were produced. This indicates a failure while building the boost library.") @@ -199,7 +184,7 @@ function(boost_modular_build) -sZSTD_BINARY=zstdd "-sZSTD_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib" ) - + set(B2_OPTIONS_REL -sZLIB_BINARY=zlib "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/lib" @@ -267,8 +252,6 @@ function(boost_modular_build) list(APPEND B2_OPTIONS address-model=32 architecture=arm) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") list(APPEND B2_OPTIONS address-model=64 architecture=arm) - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") - list(APPEND B2_OPTIONS address-model=64 architecture=s390x) else() list(APPEND B2_OPTIONS address-model=32 architecture=x86) endif() @@ -310,10 +293,6 @@ function(boost_modular_build) ###################### if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${TARGET_TRIPLET}-rel") - set(BOOST_LIB_SUFFIX ${BOOST_LIB_RELEASE_SUFFIX}) - set(VARIANT "release") - set(BUILD_LIB_PATH "lib/") - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" @@ -332,10 +311,6 @@ function(boost_modular_build) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Building ${TARGET_TRIPLET}-dbg") - set(BOOST_LIB_SUFFIX ${BOOST_LIB_DEBUG_SUFFIX}) - set(VARIANT debug) - set(BUILD_LIB_PATH "debug/lib/") - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index afd55f519a2293..e50c43848c4f46 100644 --- a/ports/boost-mpi/CONTROL +++ b/ports/boost-mpi/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpi Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python (!uwp&!(arm&windows)), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi +Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python, boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi Homepage: https://github.com/boostorg/mpi Description: Boost mpi module diff --git a/ports/boost-parameter-python/CONTROL b/ports/boost-parameter-python/CONTROL index cba56b9e662722..2b33da28798f84 100644 --- a/ports/boost-parameter-python/CONTROL +++ b/ports/boost-parameter-python/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-parameter-python Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python (!uwp&!(arm&windows)), boost-vcpkg-helpers +Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python, boost-vcpkg-helpers Homepage: https://github.com/boostorg/parameter_python Description: Boost parameter_python module diff --git a/ports/boost-poly-collection/CONTROL b/ports/boost-poly-collection/CONTROL index 30d96babe6e14a..9c98aae6cfa3ac 100644 --- a/ports/boost-poly-collection/CONTROL +++ b/ports/boost-poly-collection/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-poly-collection Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure, boost-type-traits, boost-vcpkg-helpers +Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure (!arm), boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/poly_collection Description: Boost poly_collection module diff --git a/ports/boost-python/CONTROL b/ports/boost-python/CONTROL index a8698deaaf6bca..011f68fcde437c 100644 --- a/ports/boost-python/CONTROL +++ b/ports/boost-python/CONTROL @@ -1,11 +1,9 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-python Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-bind, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-property-map, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, python3 Homepage: https://github.com/boostorg/python Description: Boost python module -Supports: !uwp&!(arm&windows) Feature: python2 Build-Depends: python2 (windows) diff --git a/ports/boost-safe-numerics/CONTROL b/ports/boost-safe-numerics/CONTROL index 1cbd56ef8dccc1..ec3fb47d42f988 100644 --- a/ports/boost-safe-numerics/CONTROL +++ b/ports/boost-safe-numerics/CONTROL @@ -1,7 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-safe-numerics Version: 1.73.0 -Port-Version: 1 -Build-Depends: boost-concept-check, boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers +Build-Depends: boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers Homepage: https://github.com/boostorg/safe_numerics Description: Boost safe_numerics module diff --git a/ports/boost-stacktrace/CONTROL b/ports/boost-stacktrace/CONTROL index 17cd4eb40c8cdc..6b726dbad7ff8c 100644 --- a/ports/boost-stacktrace/CONTROL +++ b/ports/boost-stacktrace/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-stacktrace Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-array, boost-build, boost-config, boost-container-hash, boost-core, boost-modular-build-helper, boost-predef, boost-static-assert, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/stacktrace Description: Boost stacktrace module -Supports: !uwp diff --git a/ports/boost-test/CONTROL b/ports/boost-test/CONTROL index 8ef2c2b11236b6..e20a2c343015f0 100644 --- a/ports/boost-test/CONTROL +++ b/ports/boost-test/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-test Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/test Description: Boost test module -Supports: !uwp diff --git a/ports/boost-wave/CONTROL b/ports/boost-wave/CONTROL index 7ed072e39b7179..538e8772caee4f 100644 --- a/ports/boost-wave/CONTROL +++ b/ports/boost-wave/CONTROL @@ -1,8 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-wave Version: 1.73.0 -Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-concept-check, boost-config, boost-core, boost-detail, boost-filesystem (!uwp), boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-multi-index, boost-pool, boost-preprocessor, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/wave Description: Boost wave module -Supports: !uwp diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index fda7b12ced9b32..5094237daa2e0c 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,11 +1,9 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost Version: 1.73.0 -Port-Version: 1 Homepage: https://boost.org Description: Peer-reviewed portable C++ source libraries -Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract, boost-conversion, boost-convert, boost-core, boost-coroutine (!arm&!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (!osx&!uwp&!arm), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python (!uwp&!(arm&windows)), boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure, boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap - +Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract (!arm), boost-conversion, boost-convert, boost-core, boost-coroutine (!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (windows), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python, boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap Feature: mpi Description: Build with MPI support diff --git a/ports/brotli/CONTROL b/ports/brotli/CONTROL index 7db9ffb6c56736..ff152f83bd8274 100644 --- a/ports/brotli/CONTROL +++ b/ports/brotli/CONTROL @@ -1,5 +1,4 @@ Source: brotli -Version: 1.0.7 -Port-Version: 3 +Version: 1.0.7-1 Homepage: https://github.com/google/brotli Description: a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. diff --git a/ports/brotli/pkgconfig.patch b/ports/brotli/pkgconfig.patch deleted file mode 100644 index 8ceafe1b10125a..00000000000000 --- a/ports/brotli/pkgconfig.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2c4b757f9..eed560c1d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -351,7 +351,7 @@ function(generate_pkg_config_path outvar path) - set("${outvar}" "${${outvar}}" PARENT_SCOPE) - endfunction(generate_pkg_config_path) - --function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) -+function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION SHARED_TARGET STATIC_TARGET) - file(READ ${INPUT_FILE} TEXT) - - set(PREFIX "${CMAKE_INSTALL_PREFIX}") -@@ -366,14 +366,21 @@ function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) - - string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT}) - -+ if(BUILD_SHARED_LIBS) -+ set(LIB_NAME "${SHARED_TARGET}") -+ else() -+ set(LIB_NAME "${STATIC_TARGET}") -+ endif() -+ string(REGEX REPLACE "@lib_name@" "${LIB_NAME}" TEXT ${TEXT}) -+ - file(WRITE ${OUTPUT_FILE} ${TEXT}) - endfunction() - --transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}") -+transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}" brotlicommon brotlicommon-static) - --transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}") -+transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}" brotlidec brotlidec-static) - --transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}") -+transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}" brotlienc brotlienc-static) - - if(NOT BROTLI_BUNDLED_MODE) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" -diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in -index 2a8cf7a35..464a21292 100644 ---- a/scripts/libbrotlicommon.pc.in -+++ b/scripts/libbrotlicommon.pc.in -@@ -7,5 +7,5 @@ Name: libbrotlicommon - URL: https://github.com/google/brotli - Description: Brotli common dictionary library - Version: @PACKAGE_VERSION@ --Libs: -L${libdir} -lbrotlicommon -+Libs: -L${libdir} -l@lib_name@ - Cflags: -I${includedir} -diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in -index 6f8ef2e41..f87d3f65f 100644 ---- a/scripts/libbrotlidec.pc.in -+++ b/scripts/libbrotlidec.pc.in -@@ -7,6 +7,6 @@ Name: libbrotlidec - URL: https://github.com/google/brotli - Description: Brotli decoder library - Version: @PACKAGE_VERSION@ --Libs: -L${libdir} -lbrotlidec -+Libs: -L${libdir} -l@lib_name@ - Requires.private: libbrotlicommon >= 1.0.2 - Cflags: -I${includedir} -diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in -index 2098afe2c..7b6371bcb 100644 ---- a/scripts/libbrotlienc.pc.in -+++ b/scripts/libbrotlienc.pc.in -@@ -7,6 +7,6 @@ Name: libbrotlienc - URL: https://github.com/google/brotli - Description: Brotli encoder library - Version: @PACKAGE_VERSION@ --Libs: -L${libdir} -lbrotlienc -+Libs: -L${libdir} -l@lib_name@ - Requires.private: libbrotlicommon >= 1.0.2 - Cflags: -I${includedir} diff --git a/ports/brotli/portfile.cmake b/ports/brotli/portfile.cmake index 81960a9ee83ce7..6fa75937c1fce4 100644 --- a/ports/brotli/portfile.cmake +++ b/ports/brotli/portfile.cmake @@ -7,7 +7,6 @@ vcpkg_from_github( PATCHES install.patch fix-arm-uwp.patch - pkgconfig.patch ) vcpkg_configure_cmake( @@ -22,8 +21,6 @@ vcpkg_copy_pdbs() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/brotli) vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-brotli TARGET_PATH share/unofficial-brotli) -vcpkg_fixup_pkgconfig() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-brotli) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/brpc/CONTROL b/ports/brpc/CONTROL deleted file mode 100644 index 39860698135c2b..00000000000000 --- a/ports/brpc/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: brpc -Version: 0.9.7 -Homepage: https://github.com/apache/incubator-brpc -Description: Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called "baidu-rpc" inside Baidu. -Build-Depends: leveldb, gflags, glog, protobuf[zlib], openssl, thrift -Supports: !windows diff --git a/ports/brpc/fix_boost_ptr.patch b/ports/brpc/fix_boost_ptr.patch deleted file mode 100644 index 4ced79422bc7ce..00000000000000 --- a/ports/brpc/fix_boost_ptr.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/brpc/policy/thrift_protocol.cpp b/src/brpc/policy/thrift_protocol.cpp -index eae081a0..39c92338 100755 ---- a/src/brpc/policy/thrift_protocol.cpp -+++ b/src/brpc/policy/thrift_protocol.cpp -@@ -45,8 +45,7 @@ - #if defined(_THRIFT_STDCXX_H_) - # define THRIFT_STDCXX apache::thrift::stdcxx - #else -- # define THRIFT_STDCXX boost -- # include -+ # define THRIFT_STDCXX std - #endif - #endif - diff --git a/ports/brpc/fix_thrift.patch b/ports/brpc/fix_thrift.patch deleted file mode 100644 index 699f42fb0aa0b9..00000000000000 --- a/ports/brpc/fix_thrift.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3deb7342..737f6a70 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -62,8 +62,10 @@ if(WITH_DEBUG_SYMBOLS) - endif() - - if(WITH_THRIFT) -+ find_package(Thrift CONFIG REQUIRED) -+ # target_link_libraries(main PRIVATE thrift::thrift thriftz::thriftz thriftnb::thriftnb) - set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") -- set(THRIFT_LIB "thrift") -+ set(THRIFT_LIB "thrift::thrift") - endif() - - include(GNUInstallDirs) -@@ -196,9 +198,10 @@ set(DYNAMIC_LIB - ${LEVELDB_LIB} - ${PROTOC_LIB} - ${CMAKE_THREAD_LIBS_INIT} -+ ${OPENSSL_CRYPTO_LIBRARY} -+ ${OPENSSL_SSL_LIBRARY} - ${THRIFT_LIB} - ${THRIFTNB_LIB} -- ${OPENSSL_CRYPTO_LIBRARY} - dl - z) - diff --git a/ports/brpc/portfile.cmake b/ports/brpc/portfile.cmake deleted file mode 100644 index 3a1c1dce73eb00..00000000000000 --- a/ports/brpc/portfile.cmake +++ /dev/null @@ -1,31 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "windows") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO apache/incubator-brpc - REF 1d6510aa50075cade5ed539ee09a11a1b8d7f990 # 0.9.7 - SHA512 9c9dbe2a202e58586010c56634bd371f6a9e3ff0d8c5341abbabd1f1dd204a3aec5e89061fa326b4fc8ae7202f9fc33f93a5acd845d18dab3915a3e2b81cbaf3 - HEAD_REF master - PATCHES - fix_boost_ptr.patch - fix_thrift.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DWITH_THRIFT=ON - -DWITH_MESALINK=OFF - -DWITH_GLOG=ON -) - -vcpkg_install_cmake() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/butil/third_party/superfasthash") - -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL index bdc70fcf4c9edb..695925c073b7c5 100644 --- a/ports/bzip2/CONTROL +++ b/ports/bzip2/CONTROL @@ -1,5 +1,4 @@ -Source: bzip2 -Version: 1.0.6 -Port-Version: 7 -Homepage: http://www.bzip.org/ -Description: High-quality data compressor. +Source: bzip2 +Version: 1.0.6-5 +Homepage: http://www.bzip.org/ +Description: High-quality data compressor. diff --git a/ports/bzip2/bzip2.pc.in b/ports/bzip2/bzip2.pc.in deleted file mode 100644 index 91153c13b532be..00000000000000 --- a/ports/bzip2/bzip2.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@BZIP2_PREFIX@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: bzip2 -Description: bzip2 -Version: 1.0.6 -Requires: -Libs: -L${libdir} -l@bzname@ -Cflags: -I${includedir} \ No newline at end of file diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index d6b70bacb4381a..0462d53eb6f809 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,52 +1,43 @@ -set(BZIP2_VERSION 1.0.6) # TODO: Update to 1.0.8 -vcpkg_download_distfile(ARCHIVE # TODO: switch to vcpkg_from_git with https://sourceware.org/git/?p=bzip2.git;a=summary - URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" - FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" - SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${BZIP2_VERSION} - PATCHES - fix-import-export-macros.patch - fix-windows-include.patch -) - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS_DEBUG - -DBZIP2_SKIP_HEADERS=ON - -DBZIP2_SKIP_TOOLS=ON -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() - -file(READ "${CURRENT_PACKAGES_DIR}/include/bzlib.h" BZLIB_H) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") -else() - string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") -endif() -file(WRITE "${CURRENT_PACKAGES_DIR}/include/bzlib.h" "${BZLIB_H}") - -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}") - set(bzname bz2) - configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/bzip2.pc" @ONLY) -endif() - -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}/debug") - set(bzname bz2d) - configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/bzip2.pc" @ONLY) -endif() - -vcpkg_fixup_pkgconfig() - -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +include(vcpkg_common_functions) +set(BZIP2_VERSION 1.0.6) +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" + FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" + SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${BZIP2_VERSION} + PATCHES + fix-import-export-macros.patch + fix-windows-include.patch +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DBZIP2_SKIP_HEADERS=ON + -DBZIP2_SKIP_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(READ ${CURRENT_PACKAGES_DIR}/include/bzlib.h BZLIB_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") +else() + string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") +endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/bzlib.h "${BZLIB_H}") + +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/share/bzip2/copyright) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index e333f304d23ce6..6470d8d09d5ab8 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -210,7 +210,7 @@ add_library(cairo ${SOURCES}) if (WITH_X11) target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1) endif() -target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS}) + target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig) if(WIN32) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 6c26c77a250d5f..0eda86fac3f26b 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,6 +1,5 @@ Source: cairo -Version: 1.16.0 -Port-Version: 7 +Version: 1.16.0-6 Homepage: https://cairographics.org Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. Build-Depends: zlib, libpng, pixman, freetype, fontconfig diff --git a/ports/cairomm/CMakeLists.txt b/ports/cairomm/CMakeLists.txt index 1cc02978601678..1274a643167533 100644 --- a/ports/cairomm/CMakeLists.txt +++ b/ports/cairomm/CMakeLists.txt @@ -15,7 +15,6 @@ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CAIROMM_MICRO_VERSION ${ message(STATUS "Ciaromm version: ${CAIROMM_MAJOR_VERSION}.${CAIROMM_MINOR_VERSION}.${CAIROMM_MICRO_VERSION}") find_package(Cairo REQUIRED) -find_package(Freetype REQUIRED) find_package(SigC++ REQUIRED) #configure @@ -88,7 +87,7 @@ set(cairomm_rc ${CMAKE_BINARY_DIR}/cairomm.rc) add_library(cairomm-1.0 ${cairomm_cc} ${cairomm_rc}) -target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} Freetype::Freetype) +target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} ) target_include_directories(cairomm-1.0 PRIVATE ${CAIRO_INCLUDE_DIR} ${SIGC++_INCLUDE_DIR} diff --git a/ports/cairomm/CONTROL b/ports/cairomm/CONTROL index 7a89c9ec1de468..e9d9d9b5fd1a7c 100644 --- a/ports/cairomm/CONTROL +++ b/ports/cairomm/CONTROL @@ -1,6 +1,5 @@ Source: cairomm -Version: 1.15.3 -Port-Version: 5 +Version: 1.15.3-4 Homepage: https://www.cairographics.org Description: A C++ wrapper for the cairo graphics library Build-Depends: cairo, libsigcpp diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index ecd8f1de63bc79..a0a7a72e02faf8 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,12 +1,11 @@ Source: ceres -Version: 1.14.0 -Port-Version: 8 +Version: 1.14.0-7 Build-Depends: glog, eigen3 Homepage: https://github.com/ceres-solver/ceres-solver Description: non-linear optimization package Feature: lapack -Build-Depends: lapack +Build-Depends: clapack (!osx) Description: Use Lapack in Ceres Feature: suitesparse diff --git a/ports/cgal/CONTROL b/ports/cgal/CONTROL index 1cb5e38bc9854d..60452db0f2dd46 100644 --- a/ports/cgal/CONTROL +++ b/ports/cgal/CONTROL @@ -1,5 +1,5 @@ Source: cgal -Version: 5.0.3 +Version: 5.0.2-2 Build-Depends: mpfr, mpir, zlib, boost-format, boost-container, boost-ptr-container, boost-iterator, boost-variant, boost-any, boost-unordered, boost-random, boost-foreach, boost-graph, boost-heap, boost-logic, boost-multiprecision, boost-interval Homepage: https://github.com/CGAL/cgal Description: The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry. diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index a7106503876ed5..04e3271361d729 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF releases/CGAL-5.0.3 - SHA512 e163276264d8aeb3a546392f87d898bcbc59a4e2f10c23327f0c8e3d41f0d3d8200f872230da3f077d3a564acfa4b3fa4c6a101db0b3cd8d4a4028fffa8110df + REF releases/CGAL-5.0.2 + SHA512 108f1d6f68674e123fd90143049f30a7e7965827468828f75ba7ae0b7ba174690520bafdf0648853c1b28895d6a9a0c7349c03e678c13395a84ffe7397c97e99 HEAD_REF master ) diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index bbabc6ad89f306..ce3610044aeff6 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,6 +1,5 @@ Source: clapack -Version: 3.2.1 -Port-Version: 14 +Version: 3.2.1-13 Homepage: https://www.netlib.org/clapack Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) diff --git a/ports/lapack/clapack/FindLAPACK.cmake b/ports/clapack/FindLAPACK.cmake similarity index 100% rename from ports/lapack/clapack/FindLAPACK.cmake rename to ports/clapack/FindLAPACK.cmake diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 8fdbe7c42efc24..1de30b1093869a 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -11,7 +11,7 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES remove_internal_blas.patch - fix-ConfigFile.patch + fix-ConfigFile.patch fix-install.patch support-uwp.patch ) @@ -37,6 +37,10 @@ vcpkg_copy_pdbs() #TODO: fix the official exported targets, since they are broken (luckily it seems that no-one uses them for now) vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack) +#we install a cmake wrapper since the official FindLAPACK module in cmake does find clapack easily, unfortunately... +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright diff --git a/ports/lapack/clapack/vcpkg-cmake-wrapper.cmake b/ports/clapack/vcpkg-cmake-wrapper.cmake similarity index 100% rename from ports/lapack/clapack/vcpkg-cmake-wrapper.cmake rename to ports/clapack/vcpkg-cmake-wrapper.cmake diff --git a/ports/colmap/portfile.cmake b/ports/colmap/portfile.cmake deleted file mode 100644 index 6b9bf3284c4af2..00000000000000 --- a/ports/colmap/portfile.cmake +++ /dev/null @@ -1,89 +0,0 @@ -set(COLMAP_REF "3.6") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO colmap/colmap - REF ${COLMAP_REF} - SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632 - HEAD_REF dev -) - -if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES)) - message(FATAL_ERROR "Feature cuda and cuda-redist require x64 triplet.") -endif() - -# set GIT_COMMIT_ID and GIT_COMMIT_DATE -if(DEFINED VCPKG_HEAD_VERSION) - set(GIT_COMMIT_ID "${VCPKG_HEAD_VERSION}") -else() - set(GIT_COMMIT_ID "${COLMAP_REF}") -endif() - -string(TIMESTAMP COLMAP_GIT_COMMIT_DATE "%Y-%m-%d") - -set(CUDA_ENABLED OFF) -set(TESTS_ENABLED OFF) - -if("cuda" IN_LIST FEATURES) - set(CUDA_ENABLED ON) -endif() - -if("cuda-redist" IN_LIST FEATURES) - set(CUDA_ENABLED ON) - set(CUDA_ARCHS "Common") -endif() - -if("tests" IN_LIST FEATURES) - set(TESTS_ENABLED ON) -endif() - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DCUDA_ENABLED=${CUDA_ENABLED} - -DCUDA_ARCHS=${CUDA_ARCHS} - -DTESTS_ENABLED=${TESTS_ENABLED} - -DGIT_COMMIT_ID=${GIT_COMMIT_ID} - -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} -) - -vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets() - -file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*") -foreach(TOOL_FILENAME ${TOOL_FILENAMES}) - get_filename_component(TEST_TOOL_NAME ${TOOL_FILENAME} NAME_WLE) - list(APPEND COLMAP_TOOL_NAMES "${TEST_TOOL_NAME}") -endforeach() - -vcpkg_copy_tools(TOOL_NAMES ${COLMAP_TOOL_NAMES} AUTO_CLEAN) - -# remove empty folders and unused files -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/debug/include/colmap/exe - ${CURRENT_PACKAGES_DIR}/debug/include/colmap/lib/Graclus/multilevelLib - ${CURRENT_PACKAGES_DIR}/debug/include/colmap/tools - ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/media - ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/shaders - ${CURRENT_PACKAGES_DIR}/include/colmap/exe - ${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib - ${CURRENT_PACKAGES_DIR}/include/colmap/tools - ${CURRENT_PACKAGES_DIR}/include/colmap/ui/media - ${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders - ${CURRENT_PACKAGES_DIR}/COLMAP.bat - ${CURRENT_PACKAGES_DIR}/RUN_TESTS.bat - ${CURRENT_PACKAGES_DIR}/debug/COLMAP.bat - ${CURRENT_PACKAGES_DIR}/debug/RUN_TESTS.bat - ${CURRENT_PACKAGES_DIR}/debug/bin -) - -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/COPYING.txt - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} - RENAME copyright -) diff --git a/ports/colmap/usage b/ports/colmap/usage deleted file mode 100644 index b71316b3cf81a3..00000000000000 --- a/ports/colmap/usage +++ /dev/null @@ -1,10 +0,0 @@ -For example, under Windows, execute COLMAP as: - - \packages\colmap_\tools\colmap\colmap.exe gui - \packages\colmap_\tools\colmap\colmap.exe mapper - \packages\colmap_\tools\colmap\colmap.exe ... - -The package colmap provides CMake integration: - - find_package(COLMAP REQUIRED) - target_link_libraries(main ${COLMAP_LIBRARIES}) diff --git a/ports/colmap/vcpkg.json b/ports/colmap/vcpkg.json deleted file mode 100644 index 565e945baba8e5..00000000000000 --- a/ports/colmap/vcpkg.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "colmap", - "version-string": "3.6", - "description": "COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. It offers a wide range of features for reconstruction of ordered and unordered image collections. The software is licensed under the new BSD license.", - "homepage": "https://colmap.github.io/", - "license": "BSD-3-Clause", - "dependencies": [ - "boost-filesystem", - "boost-graph", - "boost-program-options", - "boost-regex", - "boost-system", - "boost-test", - { - "name": "ceres", - "features": [ - "lapack", - "suitesparse" - ] - }, - { - "name": "cgal", - "features": [ - "qt" - ] - }, - "eigen3", - "freeimage", - "gflags", - "glew", - "glog", - "qt5-base", - "suitesparse" - ], - "features": [ - { - "name": "cuda", - "description": "CUDA support for current compute architecture of this machine.", - "dependencies": [ - "cuda" - ] - }, - { - "name": "cuda-redist", - "description": "Redistributable CUDA support for common supported compute architectures.", - "dependencies": [ - "cuda" - ] - }, - { - "name": "tests", - "description": "Enable TESTS." - } - ] -} diff --git a/ports/constexpr-contracts/CONTROL b/ports/constexpr-contracts/CONTROL deleted file mode 100644 index 515b9b2b56907f..00000000000000 --- a/ports/constexpr-contracts/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: constexpr-contracts -Version: 2020-08-09 -Homepage: https://github.com/cjdb/constexpr-contracts -Description: A constexpr-friendly, optimisation-friendly contracts library. diff --git a/ports/constexpr-contracts/portfile.cmake b/ports/constexpr-contracts/portfile.cmake deleted file mode 100644 index 0a6e167b5d699d..00000000000000 --- a/ports/constexpr-contracts/portfile.cmake +++ /dev/null @@ -1,20 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO cjdb/constexpr-contracts - REF 58154e9010cb80aad4e95ef6f1835ebd7db3780a # commit 2020-05-25 - SHA512 b634267a4044cd712c8e52f65cd305f437864cab591f2b22104581f70b305ba52889dd46724e6047386463a010ee78fdd951411ea3691b5725d52d13f7adda76 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/constexpr-contracts) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/coroutine/CONTROL b/ports/coroutine/CONTROL new file mode 100644 index 00000000000000..13fa58ab2a58f2 --- /dev/null +++ b/ports/coroutine/CONTROL @@ -0,0 +1,6 @@ +Source: coroutine +Homepage: https://github.com/luncliff/coroutine +Version: 1.5.0 +Build-Depends: ms-gsl +Description: C++ 20 Coroutines helper/example library +Supports: !uwp diff --git a/ports/coroutine/fix-errorC7651.patch b/ports/coroutine/fix-errorC7651.patch deleted file mode 100644 index 42c4291a500006..00000000000000 --- a/ports/coroutine/fix-errorC7651.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/modules/portable/frame.cpp b/modules/portable/frame.cpp -index 2cedf81..f413f28 100644 ---- a/modules/portable/frame.cpp -+++ b/modules/portable/frame.cpp -@@ -77,13 +77,31 @@ size_t _coro_done(void*); - // - // intrinsic: Clang/GCC - // --extern "C" { --bool __builtin_coro_done(void*); --void __builtin_coro_resume(void*); --void __builtin_coro_destroy(void*); --// void* __builtin_coro_promise(void* ptr, int align, bool p); -+//extern "C" { -+template -+void resume_wrapper(void *p) -+{ -+ if constexpr (B) -+ __builtin_coro_resume(p); -+} -+ -+template -+void destroy_wrapper(void *p) -+{ -+ if constexpr(B) -+ __builtin_coro_destroy(p); - } - -+template -+bool done_wrapper(void *p) -+{ -+ if constexpr(B) -+ return __builtin_coro_done(p); -+ return false; -+} -+// void* __builtin_coro_promise(void* ptr, int align, bool p); -+//} -+ - bool _coro_finished(portable_coro_prefix* _Handle); - - #if defined(__clang__) -@@ -124,7 +142,7 @@ bool portable_coro_done(portable_coro_prefix* _Handle) { - if constexpr (is_msvc) { - return _coro_finished(_Handle); - } else if constexpr (is_clang) { -- return __builtin_coro_done(_Handle); -+ return done_wrapper(_Handle); - } - return false; // follow `noop_coroutine` - } -@@ -133,7 +151,7 @@ void portable_coro_resume(portable_coro_prefix* _Handle) { - if constexpr (is_msvc) { - _coro_resume(_Handle); - } else if constexpr (is_clang) { -- __builtin_coro_resume(_Handle); -+ resume_wrapper(_Handle); - } - } - -@@ -141,7 +159,7 @@ void portable_coro_destroy(portable_coro_prefix* _Handle) { - if constexpr (is_msvc) { - _coro_destroy(_Handle); - } else if constexpr (is_clang) { -- __builtin_coro_destroy(_Handle); -+ destroy_wrapper(_Handle); - } - } - diff --git a/ports/coroutine/portfile.cmake b/ports/coroutine/portfile.cmake index 3c5f27b72caaab..26abb7bf7a3ffe 100644 --- a/ports/coroutine/portfile.cmake +++ b/ports/coroutine/portfile.cmake @@ -10,7 +10,6 @@ vcpkg_from_github( REF 1.5.0 SHA512 61b91fdc641b6905b884e99c5bf193ec2cf6962144ab3baafdb9432115757d96f3797f116b30356f0d21417b23082bc908f75042721caeab3329c4910b654594 HEAD_REF master - PATCHES fix-errorC7651.patch ) vcpkg_configure_cmake( diff --git a/ports/coroutine/vcpkg.json b/ports/coroutine/vcpkg.json deleted file mode 100644 index 4e71341284ef76..00000000000000 --- a/ports/coroutine/vcpkg.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "coroutine", - "version-string": "1.5.0", - "port-version": 1, - "description": "C++ 20 Coroutines helper/example library", - "homepage": "https://github.com/luncliff/coroutine", - "supports": "!uwp", - "dependencies": [ - "ms-gsl" - ] -} diff --git a/ports/cppad/CONTROL b/ports/cppad/CONTROL deleted file mode 100644 index f38cfd121b4da8..00000000000000 --- a/ports/cppad/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: cppad -Version: 20200000.3 -Homepage: https://github.com/coin-or/CppAD -Description: CppAD: A Package for Differentiation of C++ Algorithms -Supports: !(arm|uwp) diff --git a/ports/cppad/pkgconfig-fix.patch b/ports/cppad/pkgconfig-fix.patch deleted file mode 100644 index 6688fc9d7f90f1..00000000000000 --- a/ports/cppad/pkgconfig-fix.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/pkgconfig/CMakeLists.txt b/pkgconfig/CMakeLists.txt -index db8b65902..b1224a01d 100644 ---- a/pkgconfig/CMakeLists.txt -+++ b/pkgconfig/CMakeLists.txt -@@ -42,8 +42,9 @@ ENDIF( cppad_has_ipopt ) - # cppad_pkgconfig_cflags - # cppad_pkgconfig_cflags_uninstalled - # --SET(cppad_pkgconfig_cflags "-I${cppad_abs_includedir}" ) --SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) -+SET(cppad_pkgconfig_includedir "${cmake_install_includedirs}" ) -+SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) -+SET(cppad_pkgconfig_libdir "${cmake_install_libdirs}" ) - # ---------------------------------------------------------------------------- - # cppad_pkgconfig_libs - # cppad_pkgconfig_libs_uninstalled -@@ -74,7 +75,7 @@ IF( "${libs}" STREQUAL "" ) - SET(cppad_pkgconfig_libs "") - SET(cppad_pkgconfig_libs_uninstalled "") - ELSE( "${libs}" STREQUAL "" ) -- SET(cppad_pkgconfig_libs "-L${cppad_abs_libdir} ${libs}") -+ SET(cppad_pkgconfig_libs "-L\${libdir} ${libs}") - SET(cppad_pkgconfig_libs_uninstalled "${uninstalled} ${libs}") - ENDIF( "${libs}" STREQUAL "" ) - # -@@ -84,10 +85,12 @@ ENDIF( "${libs}" STREQUAL "" ) - CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/cppad.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc -+ @ONLY - ) - CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/cppad-uninstalled.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/cppad-uninstalled.pc -+ @ONLY - ) - # During install copy cppad.pc to datadir and libdir - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc -diff --git a/pkgconfig/cppad.pc.in b/pkgconfig/cppad.pc.in -index a202e3fb3..1c34c1e08 100644 ---- a/pkgconfig/cppad.pc.in -+++ b/pkgconfig/cppad.pc.in -@@ -12,12 +12,19 @@ - # This file is used with pkg-config to include CppAD after it is installed - # - # Entries set by top source directory CMakeLists.txt file -+ -+prefix=${pcfiledir}/../.. -+exec_prefix=${prefix} -+libdir=${exec_prefix}/@cppad_pkgconfig_libdir@ -+includedir=${prefix}/@cppad_pkgconfig_includedir@ -+ - Name: cppad - Description: @cppad_description@ - Version: @cppad_version@ - URL: @cppad_url@ -+ - # - # Entries set by pkgconfig/CMakeLists.txt file --Cflags: @cppad_pkgconfig_cflags@ -+Cflags: -I${includedir} - Libs: @cppad_pkgconfig_libs@ - Requires: @cppad_pkgconfig_requires@ diff --git a/ports/cppad/portfile.cmake b/ports/cppad/portfile.cmake deleted file mode 100644 index 1c9fc8ddf4e45e..00000000000000 --- a/ports/cppad/portfile.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# the compilation fails on arm and uwp. Please check the related issue: -# https://github.com/microsoft/vcpkg/pull/12560#issuecomment-668412073 -vcpkg_fail_port_install(ON_TARGET "uwp" and "arm") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO coin-or/CppAD - REF 20200000.3 - SHA512 4e980665a21c76cf355d1c5597c65fbfba7ac3e15c43a88ccfe3ba0267b85b4e9aa7c6e8a0ed7a728f8cf2c6e1424625d5cbcdd295a6c0a08b47b4b121572d13 - HEAD_REF master - PATCHES - windows-fix.patch - pkgconfig-fix.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS - -Dcppad_prefix=${CURRENT_PACKAGES_DIR} - OPTIONS_RELEASE - -Dcmake_install_libdirs=lib - -Dcppad_debug_which:STRING=debug_none - OPTIONS_DEBUG - -Dcmake_install_libdirs=debug/lib -) - -vcpkg_install_cmake() - -# Install the pkgconfig file -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) -endif() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) -endif() - -vcpkg_fixup_pkgconfig() - -# Add the copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cppad/windows-fix.patch b/ports/cppad/windows-fix.patch deleted file mode 100644 index 50c38ca12307e6..00000000000000 --- a/ports/cppad/windows-fix.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff --git a/cppad_lib/cppad_colpack.cpp b/cppad_lib/cppad_colpack.cpp -index dc3327053..739363292 100644 ---- a/cppad_lib/cppad_colpack.cpp -+++ b/cppad_lib/cppad_colpack.cpp -@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: - - # if CPPAD_HAS_COLPACK == 0 - namespace CppAD { namespace local { -- CPPAD_LIB_EXPORT void this_routine_should_never_get_called(void) -+ void this_routine_should_never_get_called(void) - { CPPAD_ASSERT_UNKNOWN(false); } - } } - # else // CPPAD_HAS_COLPACK -@@ -52,7 +52,7 @@ the entry with index (i, adolc_pattern[i][k]) is a non-zero - in the sparsity pattern for the matrix. - */ - // ---------------------------------------------------------------------- --CPPAD_LIB_EXPORT void cppad_colpack_general( -+void cppad_colpack_general( - CppAD::vector& color , - size_t m , - size_t n , -@@ -164,7 +164,7 @@ For i = 0 , ... , m-1, and for k = 1, ... ,adolc_pattern[i][0], - the entry with index (i, adolc_pattern[i][k]) is - in the sparsity pattern for the symmetric matrix. - */ --CPPAD_LIB_EXPORT void cppad_colpack_symmetric( -+void cppad_colpack_symmetric( - CppAD::vector& color , - size_t m , - const CppAD::vector& adolc_pattern ) -diff --git a/cppad_lib/json_parser.cpp b/cppad_lib/json_parser.cpp -index fac417d9f..ac0910cee 100644 ---- a/cppad_lib/json_parser.cpp -+++ b/cppad_lib/json_parser.cpp -@@ -20,7 +20,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: - // documentation for this routine is in the file below - # include - --CPPAD_LIB_EXPORT void CppAD::local::graph::json_parser( -+void CppAD::local::graph::json_parser( - const std::string& json , - cpp_graph& graph_obj ) - { using std::string; -diff --git a/cppad_lib/json_writer.cpp b/cppad_lib/json_writer.cpp -index 250345c6e..add4b20a9 100644 ---- a/cppad_lib/json_writer.cpp -+++ b/cppad_lib/json_writer.cpp -@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: - // documentation for this routine is in the file below - # include - --CPPAD_LIB_EXPORT void CppAD::local::graph::json_writer( -+void CppAD::local::graph::json_writer( - std::string& json , - const cpp_graph& graph_obj ) - { using std::string; -diff --git a/include/cppad/local/cppad_colpack.hpp b/include/cppad/local/cppad_colpack.hpp -index ee96ab5fe..6dd022180 100644 ---- a/include/cppad/local/cppad_colpack.hpp -+++ b/include/cppad/local/cppad_colpack.hpp -@@ -59,7 +59,7 @@ it is not the case that both - This routine tries to minimize, with respect to the choice of colors, - the number of colors. - */ --extern void cppad_colpack_general( -+CPPAD_LIB_EXPORT void cppad_colpack_general( - CppAD::vector& color , - size_t m , - size_t n , -@@ -91,7 +91,7 @@ The properties of this coloring have not yet been determined; see - Efficient Computation of Sparse Hessians Using Coloring - and Automatic Differentiation (pdf/ad/gebemedhin14.pdf) - */ --extern void cppad_colpack_symmetric( -+CPPAD_LIB_EXPORT void cppad_colpack_symmetric( - CppAD::vector& color , - size_t n , - const CppAD::vector& adolc_pattern -diff --git a/include/cppad/local/graph/json_parser.hpp b/include/cppad/local/graph/json_parser.hpp -index 17bcc7c7e..a28d2c045 100644 ---- a/include/cppad/local/graph/json_parser.hpp -+++ b/include/cppad/local/graph/json_parser.hpp -@@ -42,7 +42,7 @@ Upon return it is a $cref cpp_ad_graph$$ representation of this function. - $head Prototype$$ - $srccode%hpp% */ - namespace CppAD { namespace local { namespace graph { -- void json_parser( -+ CPPAD_LIB_EXPORT void json_parser( - const std::string& json , - cpp_graph& graph_obj - ); -diff --git a/include/cppad/local/graph/json_writer.hpp b/include/cppad/local/graph/json_writer.hpp -index 36a4cb39f..299c56cc0 100644 ---- a/include/cppad/local/graph/json_writer.hpp -+++ b/include/cppad/local/graph/json_writer.hpp -@@ -41,7 +41,7 @@ This is a $code cpp_graph$$ object. - $head Prototype$$ - $srccode%hpp% */ - namespace CppAD { namespace local { namespace graph { -- void json_writer( -+ CPPAD_LIB_EXPORT void json_writer( - std::string& json , - const cpp_graph& graph_obj - ); diff --git a/ports/crashrpt/001-add-install-target-and-find-deps.patch b/ports/crashrpt/001-add-install-target-and-find-deps.patch deleted file mode 100644 index 2d983800d4a58a..00000000000000 --- a/ports/crashrpt/001-add-install-target-and-find-deps.patch +++ /dev/null @@ -1,809 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 44d7df0..ed9e3d3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17,6 +17,9 @@ set (CRASHRPT_VER 1403) - # Build options - option(CRASHRPT_BUILD_SHARED_LIBS "If set (default), CrashRpt modules are built as dynamic-link libraries, otherwise as static libs." ON) - option(CRASHRPT_LINK_CRT_AS_DLL "If set (default), CrashRpt modules link C run-time (CRT) as multi-threaded dynamic libraries, otherwise as multi-threaded static libs." ON) -+option(CRASHRPT_BUILD_PROBE "If set (default), CrashRpt builds the CrashRptProbe project." ON) -+option(CRASHRPT_BUILD_DEMOS "If set (default), CrashRpt builds the demo projects." ON) -+option(CRASHRPT_BUILD_TESTS "If set (default), CrashRpt builds the test projects." ON) - - # Set output directory for executable files - if(CMAKE_CL_64) -@@ -94,19 +97,65 @@ macro(fix_default_compiler_settings_) - - endmacro() - -+find_package(ZLIB REQUIRED) -+find_package(PNG REQUIRED) -+find_package(Ogg REQUIRED) -+find_package(JPEG REQUIRED) -+ -+find_library(THEORA_LIBRARY theora) -+if(NOT THEORA_LIBRARY) -+ message(FATAL_ERROR "theora library not found") -+endif() -+ -+find_path(THEORA_INCLUDE_DIR theora/theora.h) -+if(NOT THEORA_INCLUDE_DIR) -+ message(FATAL_ERROR "theora include dir not found") -+endif() -+ -+find_library(TINYXML_LIBRARY NAMES tinyxml) -+if(NOT TINYXML_LIBRARY) -+ message(FATAL_ERROR "tinyxml library not found") -+endif() -+ -+find_path(TINYXML_INCLUDE_DIR tinyxml.h) -+if(NOT TINYXML_INCLUDE_DIR) -+ message(FATAL_ERROR "tinyxml include dir not found") -+endif() -+ -+find_path(WTL_INCLUDE_DIR wtl/atlapp.h) -+if(NOT WTL_INCLUDE_DIR) -+ message(FATAL_ERROR "WTL include dir not found") -+endif() -+ -+find_library(DBGHELP_LIBRARY dbghelp) -+if(NOT DBGHELP_LIBRARY) -+ message(FATAL_ERROR "dbghelp library not found") -+endif() -+ -+find_path(DBGHELP_INCLUDE_DIR dbghelp.h) -+if(NOT DBGHELP_INCLUDE_DIR) -+ message(FATAL_ERROR "dbghelp include dir not found") -+endif() -+ - # Other CMakeLists are located in project subdirectories - -+if(CRASHRPT_BUILD_DEMOS) - add_subdirectory("demos/ConsoleDemo") - add_subdirectory("demos/WTLDemo") - add_subdirectory("demos/MFCDemo") -+endif() - - add_subdirectory("reporting/crashrpt") - add_subdirectory("reporting/crashsender") - -+if(CRASHRPT_BUILD_PROBE) - add_subdirectory("processing/crashrptprobe") - add_subdirectory("processing/crprober") -+endif() - -+if(CRASHRPT_BUILD_TESTS) - add_subdirectory("tests") -+endif() - - # Set output directory for LIB files - if(CMAKE_CL_64) -@@ -117,13 +166,13 @@ else(CMAKE_CL_64) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/thirdparty/lib) - endif(CMAKE_CL_64) - --add_subdirectory("thirdparty/tinyxml") --add_subdirectory("thirdparty/jpeg") --add_subdirectory("thirdparty/libpng") -+#add_subdirectory("thirdparty/tinyxml") -+#add_subdirectory("thirdparty/jpeg") -+#add_subdirectory("thirdparty/libpng") - add_subdirectory("thirdparty/minizip") --add_subdirectory("thirdparty/zlib") --add_subdirectory("thirdparty/libogg") --add_subdirectory("thirdparty/libtheora") -+#add_subdirectory("thirdparty/zlib") -+#add_subdirectory("thirdparty/libogg") -+#add_subdirectory("thirdparty/libtheora") - - - -diff --git a/demos/ConsoleDemo/CMakeLists.txt b/demos/ConsoleDemo/CMakeLists.txt -index e47ef4c..4df7b12 100644 ---- a/demos/ConsoleDemo/CMakeLists.txt -+++ b/demos/ConsoleDemo/CMakeLists.txt -@@ -12,12 +12,12 @@ fix_default_compiler_settings_() - # Add include dir - include_directories(${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/reporting/CrashRpt -- ${CMAKE_SOURCE_DIR}/thirdparty/wtl -- ${CMAKE_SOURCE_DIR}/thirdparty/zlib -+ ${WTL_INCLUDE_DIR} -+ ${ZLIB_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/thirdparty/minizip -- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg -- ${CMAKE_SOURCE_DIR}/thirdparty/libpng -- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml ) -+ ${JPEG_INCLUDE_DIR} -+ ${PNG_INCLUDE_DIRS} -+ ${TINYXML_INCLUDE_DIR} ) - - # Add executable build target - add_executable(ConsoleDemo ${source_files} ${header_files}) -@@ -26,3 +26,7 @@ add_executable(ConsoleDemo ${source_files} ${header_files}) - target_link_libraries(ConsoleDemo CrashRpt) - - set_target_properties(ConsoleDemo PROPERTIES DEBUG_POSTFIX d ) -+ -+install(TARGETS ConsoleDemo -+ RUNTIME DESTINATION tools/crashrpt -+) -diff --git a/demos/MFCDemo/CMakeLists.txt b/demos/MFCDemo/CMakeLists.txt -index a250ecc..ade93cb 100644 ---- a/demos/MFCDemo/CMakeLists.txt -+++ b/demos/MFCDemo/CMakeLists.txt -@@ -44,7 +44,7 @@ if(CMAKE_CL_64) - ADD_CUSTOM_COMMAND( - TARGET WTLDemo - POST_BUILD -- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" -+ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" -@@ -53,9 +53,13 @@ else(CMAKE_CL_64) - ADD_CUSTOM_COMMAND( - TARGET WTLDemo - POST_BUILD -- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" -+ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" - ) --endif(CMAKE_CL_64) -\ No newline at end of file -+endif(CMAKE_CL_64) -+ -+install(TARGETS MFCDemo -+ RUNTIME DESTINATION tools/crashrpt -+) -diff --git a/demos/WTLDemo/AboutDlg.h b/demos/WTLDemo/AboutDlg.h -index 83eaac0..e96d1c2 100644 ---- a/demos/WTLDemo/AboutDlg.h -+++ b/demos/WTLDemo/AboutDlg.h -@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #pragma once - #include "stdafx.h" - #include --#include -+#include - #include "CrashRpt.h" - - class CAboutDlg : public CDialogImpl -diff --git a/demos/WTLDemo/CMakeLists.txt b/demos/WTLDemo/CMakeLists.txt -index 40aaefb..42c0f5a 100644 ---- a/demos/WTLDemo/CMakeLists.txt -+++ b/demos/WTLDemo/CMakeLists.txt -@@ -19,7 +19,7 @@ fix_default_compiler_settings_() - - # Add include dir - include_directories(${CMAKE_SOURCE_DIR}/include -- ${CMAKE_SOURCE_DIR}/thirdparty/wtl) -+ ${WTL_INCLUDE_DIR}) - - # Add executable build target - add_executable(WTLDemo WIN32 ${source_files} ${header_files}) -@@ -36,7 +36,7 @@ if(CMAKE_CL_64) - ADD_CUSTOM_COMMAND( - TARGET WTLDemo - POST_BUILD -- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" -+ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" -@@ -45,9 +45,13 @@ else(CMAKE_CL_64) - ADD_CUSTOM_COMMAND( - TARGET WTLDemo - POST_BUILD -- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" -+ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" - COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" - ) --endif(CMAKE_CL_64) -\ No newline at end of file -+endif(CMAKE_CL_64) -+ -+install(TARGETS WTLDemo -+ RUNTIME DESTINATION tools/crashrpt -+) -diff --git a/demos/WTLDemo/DocumentDlg.h b/demos/WTLDemo/DocumentDlg.h -index afce8fe..9b47728 100644 ---- a/demos/WTLDemo/DocumentDlg.h -+++ b/demos/WTLDemo/DocumentDlg.h -@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #pragma once - #include "stdafx.h" - #include --#include -+#include - #include "CrashRpt.h" - - class CDocumentDlg : public CDialogImpl -diff --git a/demos/WTLDemo/WTLDemo.rc b/demos/WTLDemo/WTLDemo.rc -index c651841..71f4b39 100644 ---- a/demos/WTLDemo/WTLDemo.rc -+++ b/demos/WTLDemo/WTLDemo.rc -@@ -7,7 +7,7 @@ - // - // Generated from the TEXTINCLUDE 2 resource. - // --#include "atlres.h" -+#include "wtl/atlres.h" - - ///////////////////////////////////////////////////////////////////////////// - #undef APSTUDIO_READONLY_SYMBOLS -@@ -32,7 +32,7 @@ END - - 2 TEXTINCLUDE - BEGIN -- "#include ""atlres.h""\r\n" -+ "#include ""wtl/atlres.h""\r\n" - "\0" - END - -diff --git a/demos/WTLDemo/stdafx.h b/demos/WTLDemo/stdafx.h -index a601446..658d9e5 100644 ---- a/demos/WTLDemo/stdafx.h -+++ b/demos/WTLDemo/stdafx.h -@@ -16,10 +16,10 @@ be found in the Authors.txt file in the root of the source tree. - #pragma once - - // Change these values to use different versions --#define WINVER 0x0500 -+#define WINVER 0x0501 - #define _WIN32_WINNT 0x0501 --#define _WIN32_IE 0x0501 --#define _RICHEDIT_VER 0x0200 -+#define _WIN32_IE 0x0600 -+#define _RICHEDIT_VER 0x0300 - - #include - #if ( _ATL_VER < 0x0800 ) -@@ -52,18 +52,18 @@ namespace ATL - }; - #endif // _WTL_SUPPORT_SDK_ATL3 - --#include -+#include - - extern CAppModule _Module; - - #include - --#include --#include --#include -+#include -+#include -+#include - - #define _WTL_USE_CSTRING --#include -+#include - - #if _MSC_VER>=1400 - #if defined _M_IX86 -diff --git a/processing/crashrptprobe/CMakeLists.txt b/processing/crashrptprobe/CMakeLists.txt -index a6c692a..c513c6d 100644 ---- a/processing/crashrptprobe/CMakeLists.txt -+++ b/processing/crashrptprobe/CMakeLists.txt -@@ -21,11 +21,11 @@ fix_default_compiler_settings_() - include_directories( ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/reporting/crashrpt - ${CMAKE_SOURCE_DIR}/reporting/crashsender -- ${CMAKE_SOURCE_DIR}/thirdparty/wtl -- ${CMAKE_SOURCE_DIR}/thirdparty/zlib -+ ${WTL_INCLUDE_DIR} -+ ${ZLIB_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/thirdparty/minizip -- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml -- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include) -+ ${TINYXML_INCLUDE_DIR} -+ ${DBGHELP_INCLUDE_DIR}) - - # Add library build target - if(CRASHRPT_BUILD_SHARED_LIBS) -@@ -34,15 +34,15 @@ else(CRASHRPT_BUILD_SHARED_LIBS) - add_library(CrashRptProbe STATIC ${source_files} ${header_files}) - endif(CRASHRPT_BUILD_SHARED_LIBS) - --if(CMAKE_CL_64) -- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) -- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) --else(CMAKE_CL_64) -- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) -- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) --endif(CMAKE_CL_64) -+#if(CMAKE_CL_64) -+# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) -+# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) -+#else(CMAKE_CL_64) -+# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) -+# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) -+#endif(CMAKE_CL_64) - --target_link_libraries(CrashRptProbe zlib minizip tinyxml Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) -+target_link_libraries(CrashRptProbe ZLIB::ZLIB minizip ${TINYXML_LIBRARY} ${DBGHELP_LIBRARY} Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) - - if(CRASHRPT_BUILD_SHARED_LIBS) - -@@ -58,4 +58,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) - - endif(CRASHRPT_BUILD_SHARED_LIBS) - -+set_target_properties(CrashRptProbe PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRptProbe.h) - -+INSTALL(TARGETS CrashRptProbe -+ PUBLIC_HEADER DESTINATION include/crashrpt -+ LIBRARY -+ ARCHIVE -+ RUNTIME -+) -diff --git a/processing/crashrptprobe/CrashRptProbe.rc b/processing/crashrptprobe/CrashRptProbe.rc -index a08f63e..e12b8e9 100644 ---- a/processing/crashrptprobe/CrashRptProbe.rc -+++ b/processing/crashrptprobe/CrashRptProbe.rc -@@ -7,7 +7,7 @@ - // - // Generated from the TEXTINCLUDE 2 resource. - // --#include "atlres.h" -+#include "wtl/atlres.h" - - ///////////////////////////////////////////////////////////////////////////// - #undef APSTUDIO_READONLY_SYMBOLS -@@ -32,7 +32,7 @@ END - - 2 TEXTINCLUDE - BEGIN -- "#include ""atlres.h""\r\n" -+ "#include ""wtl/atlres.h""\r\n" - "\0" - END - -diff --git a/processing/crashrptprobe/stdafx.h b/processing/crashrptprobe/stdafx.h -index 2b027b2..0b60659 100644 ---- a/processing/crashrptprobe/stdafx.h -+++ b/processing/crashrptprobe/stdafx.h -@@ -70,13 +70,13 @@ namespace ATL - }; - #endif // _WTL_SUPPORT_SDK_ATL3 - --#include -+#include - extern CAppModule _Module; - #include - - // CString-related includes - #define _WTL_USE_CSTRING --#include -+#include - - #if _MSC_VER<1400 - #define WCSNCPY_S(strDest, sizeInBytes, strSource, count) wcsncpy(strDest, strSource, count) -diff --git a/processing/crprober/CMakeLists.txt b/processing/crprober/CMakeLists.txt -index 046ba57..255e200 100644 ---- a/processing/crprober/CMakeLists.txt -+++ b/processing/crprober/CMakeLists.txt -@@ -18,4 +18,8 @@ add_executable(crprober ${source_files} ${header_files}) - # Add input link libraries - target_link_libraries(crprober CrashRptProbe) - --set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) -\ No newline at end of file -+set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) -+ -+install(TARGETS crprober -+ RUNTIME DESTINATION tools/crashrpt -+) -diff --git a/reporting/crashrpt/CMakeLists.txt b/reporting/crashrpt/CMakeLists.txt -index 42d40e2..c7e4fd6 100644 ---- a/reporting/crashrpt/CMakeLists.txt -+++ b/reporting/crashrpt/CMakeLists.txt -@@ -18,7 +18,7 @@ add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE) - fix_default_compiler_settings_() - - # Add include dir --include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl) -+include_directories( ${CMAKE_SOURCE_DIR}/include ${WTL_INCLUDE_DIR}) - - # Add library build target - if(CRASHRPT_BUILD_SHARED_LIBS) -@@ -55,3 +55,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) - RELEASE_POSTFIX LIB ) - endif(CRASHRPT_BUILD_SHARED_LIBS) - -+set_target_properties(CrashRpt PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRpt.h) -+ -+INSTALL(TARGETS CrashRpt -+ PUBLIC_HEADER DESTINATION include/crashrpt -+ LIBRARY -+ ARCHIVE -+ RUNTIME -+) -diff --git a/reporting/crashrpt/CrashRpt.rc b/reporting/crashrpt/CrashRpt.rc -index 95e7502..a8c821b 100644 ---- a/reporting/crashrpt/CrashRpt.rc -+++ b/reporting/crashrpt/CrashRpt.rc -@@ -7,7 +7,7 @@ - // - // Generated from the TEXTINCLUDE 2 resource. - // --#include "atlres.h" -+#include "wtl/atlres.h" - - ///////////////////////////////////////////////////////////////////////////// - #undef APSTUDIO_READONLY_SYMBOLS -@@ -32,7 +32,7 @@ END - - 2 TEXTINCLUDE - BEGIN -- "#include ""atlres.h""\r\n" -+ "#include ""wtl/atlres.h""\r\n" - "\0" - END - -diff --git a/reporting/crashrpt/StdAfx.h b/reporting/crashrpt/StdAfx.h -index 77d8c36..13bbe50 100644 ---- a/reporting/crashrpt/StdAfx.h -+++ b/reporting/crashrpt/StdAfx.h -@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. - #define WINVER 0x0501 - #define _WIN32_WINNT 0x0501 - #define _WIN32_IE 0x0600 --#define _RICHEDIT_VER 0x0200 -+#define _RICHEDIT_VER 0x0300 - - #include - #include -@@ -54,12 +54,12 @@ namespace ATL - }; - #endif // _WTL_SUPPORT_SDK_ATL3 - --#include -+#include - extern CAppModule _Module; - #include - // CString-related includes - #define _WTL_USE_CSTRING --#include -+#include - #include - #include - #include -diff --git a/reporting/crashsender/CMakeLists.txt b/reporting/crashsender/CMakeLists.txt -index 9b444c5..aa4ab8a 100644 ---- a/reporting/crashsender/CMakeLists.txt -+++ b/reporting/crashsender/CMakeLists.txt -@@ -22,27 +22,27 @@ fix_default_compiler_settings_() - # Add include dir - include_directories( ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/reporting/CrashRpt -- ${CMAKE_SOURCE_DIR}/thirdparty/wtl -- ${CMAKE_SOURCE_DIR}/thirdparty/zlib -+ ${WTL_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/thirdparty/minizip -- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg -- ${CMAKE_SOURCE_DIR}/thirdparty/libpng -- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml -- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include -- ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include -- ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) -- --if(NOT CMAKE_CL_64) -- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) --else(NOT CMAKE_CL_64) -- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) --endif(NOT CMAKE_CL_64) -+ ${ZLIB_INCLUDE_DIRS} -+ ${JPEG_INCLUDE_DIR} -+ ${PNG_INCLUDE_DIRS} -+ ${TINYXML_INCLUDE_DIR} -+ ${DBGHELP_INCLUDE_DIR} -+ ${OGG_INCLUDE_DIRS} -+ ${THEORA_INCLUDE_DIR}) -+ -+#if(NOT CMAKE_CL_64) -+# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) -+#else(NOT CMAKE_CL_64) -+# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) -+#endif(NOT CMAKE_CL_64) - - # Add executable build target - add_executable(CrashSender WIN32 ${source_files} ${header_files}) - - # Add input link libraries --target_link_libraries(CrashSender zlib minizip libjpeg libpng tinyxml libogg libtheora WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) -+target_link_libraries(CrashSender ZLIB::ZLIB minizip ${JPEG_LIBRARIES} PNG::PNG ${TINYXML_LIBRARY} Ogg::ogg ${THEORA_LIBRARY} WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) - - # Add compiler flags (/MP for multi-processor compilation, /Os to favor small code) - set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") -@@ -52,4 +52,12 @@ set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") - - set_target_properties(CrashSender PROPERTIES - DEBUG_POSTFIX ${CRASHRPT_VER}d -- RELEASE_POSTFIX ${CRASHRPT_VER} ) -\ No newline at end of file -+ RELEASE_POSTFIX ${CRASHRPT_VER} ) -+ -+install(TARGETS CrashSender -+ RUNTIME DESTINATION tools/crashrpt -+) -+ -+file(GLOB LANG_FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_*.ini") -+install(FILES ${LANG_FILES} DESTINATION tools/crashrpt) -+install(FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_EN.ini" DESTINATION tools/crashrpt RENAME crashrpt_lang.ini) -diff --git a/reporting/crashsender/CrashSender.rc b/reporting/crashsender/CrashSender.rc -index 0502962..e10e269 100644 ---- a/reporting/crashsender/CrashSender.rc -+++ b/reporting/crashsender/CrashSender.rc -@@ -7,7 +7,7 @@ - // - // Generated from the TEXTINCLUDE 2 resource. - // --#include "atlres.h" -+#include "wtl/atlres.h" - - ///////////////////////////////////////////////////////////////////////////// - #undef APSTUDIO_READONLY_SYMBOLS -@@ -243,7 +243,7 @@ END - - 2 TEXTINCLUDE - BEGIN -- "#include ""atlres.h""\r\n" -+ "#include ""wtl/atlres.h""\r\n" - "\0" - END - -diff --git a/reporting/crashsender/ErrorReportSender.cpp b/reporting/crashsender/ErrorReportSender.cpp -index ac9603c..64cf2b5 100644 ---- a/reporting/crashsender/ErrorReportSender.cpp -+++ b/reporting/crashsender/ErrorReportSender.cpp -@@ -722,9 +722,9 @@ BOOL CErrorReportSender::CreateMiniDump() - CompiledApiVer.Reserved = 0; - LPAPI_VERSION pActualApiVer = lpImagehlpApiVersionEx(&CompiledApiVer); - pActualApiVer; -- ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); -- ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); -- ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); -+ //ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); -+ //ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); -+ //ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); - } - - // Write minidump to the file -@@ -1086,7 +1086,7 @@ BOOL CErrorReportSender::CreateCrashDescriptionXML(CErrorReportInfo& eri) - goto cleanup; - } - -- doc.useMicrosoftBOM = true; -+ //doc.useMicrosoftBOM = true; - bool bSave = doc.SaveFile(f); - if(!bSave) - { -diff --git a/reporting/crashsender/FilePreviewCtrl.cpp b/reporting/crashsender/FilePreviewCtrl.cpp -index e71aafc..5650291 100644 ---- a/reporting/crashsender/FilePreviewCtrl.cpp -+++ b/reporting/crashsender/FilePreviewCtrl.cpp -@@ -365,7 +365,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) - if (!png_ptr) - goto cleanup; - -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - goto cleanup; - - info_ptr = png_create_info_struct(png_ptr); -@@ -389,7 +389,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) - width = png_get_image_width(png_ptr, info_ptr); - height = png_get_image_height(png_ptr, info_ptr); - -- if(info_ptr->channels==3) -+ if (png_get_channels(png_ptr, info_ptr) == 3) - { - png_set_strip_16(png_ptr); - png_set_packing(png_ptr); -@@ -408,14 +408,14 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) - pBMI = (BITMAPINFO*)new BYTE[sizeof(BITMAPINFO)+256*4]; - memset(pBMI, 0, sizeof(BITMAPINFO)+256*4); - pBMI->bmiHeader.biSize = sizeof(BITMAPINFO); -- pBMI->bmiHeader.biBitCount = 8*info_ptr->channels; -+ pBMI->bmiHeader.biBitCount = 8 * png_get_channels(png_ptr, info_ptr); - pBMI->bmiHeader.biWidth = width; - pBMI->bmiHeader.biHeight = height; - pBMI->bmiHeader.biPlanes = 1; - pBMI->bmiHeader.biCompression = BI_RGB; - pBMI->bmiHeader.biSizeImage = rowbytes*height; - -- if( info_ptr->channels == 1 ) -+ if (png_get_channels(png_ptr, info_ptr) == 1) - { - RGBQUAD* palette = pBMI->bmiColors; - -@@ -431,7 +431,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) - - for(y=height-1; y>=0; y--) - { -- png_read_rows(png_ptr, &row, png_bytepp_NULL, 1); -+ png_read_rows(png_ptr, &row, NULL, 1); - - { - CAutoLock lock(&m_csLock); -diff --git a/reporting/crashsender/ScreenCap.cpp b/reporting/crashsender/ScreenCap.cpp -index c183c19..8f5643d 100644 ---- a/reporting/crashsender/ScreenCap.cpp -+++ b/reporting/crashsender/ScreenCap.cpp -@@ -11,6 +11,7 @@ be found in the Authors.txt file in the root of the source tree. - #include "stdafx.h" - #include "ScreenCap.h" - #include "Utility.h" -+#include "zlib.h" - - // Disable warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable - #pragma warning(disable:4611) -diff --git a/reporting/crashsender/stdafx.h b/reporting/crashsender/stdafx.h -index f087ff4..4494d3a 100644 ---- a/reporting/crashsender/stdafx.h -+++ b/reporting/crashsender/stdafx.h -@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. - #define WINVER 0x0501 - #define _WIN32_WINNT 0x0501 - #define _WIN32_IE 0x0600 --#define _RICHEDIT_VER 0x0200 -+#define _RICHEDIT_VER 0x0300 - - typedef __int64 off_t, _off_t; - #define _OFF_T_DEFINED -@@ -61,19 +61,19 @@ namespace ATL - }; - #endif // _WTL_SUPPORT_SDK_ATL3 - --#include -+#include - - extern CAppModule _Module; - - #include - --#include --#include --#include --#include -+#include -+#include -+#include -+#include - - #define _WTL_USE_CSTRING --#include -+#include - - #include - #include -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index f7bfede..9358bef 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -32,7 +32,7 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG") - # Add include dir - include_directories( ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/reporting/CrashRpt -- ${CMAKE_SOURCE_DIR}/thirdparty/wtl ) -+ ${WTL_INCLUDE_DIR} ) - - # Add executable build target - add_executable(Tests ${source_files} ${header_files}) -@@ -42,3 +42,10 @@ target_link_libraries(Tests CrashRpt CrashRptProbe) - - set_target_properties(Tests PROPERTIES DEBUG_POSTFIX d ) - #set_target_properties(Tests PROPERTIES COMPILE_FLAGS "/Zi" LINK_FLAGS "/DEBUG") -+ -+install(TARGETS Tests -+ RUNTIME DESTINATION tools/crashrpt -+) -+ -+install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.ini" DESTINATION tools/crashrpt) -+install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.log" DESTINATION tools/crashrpt) -diff --git a/tests/stdafx.h b/tests/stdafx.h -index f12675b..0ec2117 100644 ---- a/tests/stdafx.h -+++ b/tests/stdafx.h -@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. - #define WINVER 0x0501 - #define _WIN32_WINNT 0x0501 - #define _WIN32_IE 0x0600 --#define _RICHEDIT_VER 0x0200 -+#define _RICHEDIT_VER 0x0300 - - #include - #include -@@ -58,15 +58,15 @@ namespace ATL - }; - #endif // _WTL_SUPPORT_SDK_ATL3 - --#include -+#include - - extern CAppModule _Module; - - #include - --#include --#include --#include -+#include -+#include -+#include - #include - #include - #include -@@ -75,7 +75,7 @@ extern CAppModule _Module; - #include - - #define _WTL_USE_CSTRING --#include -+#include - - #if _MSC_VER<1400 - #define _TCSCPY_S(strDestination, numberOfElements, strSource) _tcscpy(strDestination, strSource) -diff --git a/thirdparty/libpng/CMakeLists.txt b/thirdparty/libpng/CMakeLists.txt -index b358c4e..e0f7a33 100644 ---- a/thirdparty/libpng/CMakeLists.txt -+++ b/thirdparty/libpng/CMakeLists.txt -@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) - add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4267) - - # Add include dir --include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) -+include_directories( ${ZLIB_INCLUDE_DIRS} ) - - fix_default_compiler_settings_() - -@@ -15,6 +15,6 @@ fix_default_compiler_settings_() - add_library(libpng STATIC ${source_files}) - - # Add linker input libraries --target_link_libraries(libpng zlib) -+target_link_libraries(libpng ZLIB::ZLIB) - - set_target_properties(libpng PROPERTIES DEBUG_POSTFIX d ) -\ No newline at end of file -diff --git a/thirdparty/libtheora/CMakeLists.txt b/thirdparty/libtheora/CMakeLists.txt -index 896fb47..f3cf5eb 100644 ---- a/thirdparty/libtheora/CMakeLists.txt -+++ b/thirdparty/libtheora/CMakeLists.txt -@@ -8,7 +8,7 @@ aux_source_directory( ./lib/x86_vc x86_source_files ) - add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4700 /wd4214 /wd4554 /wd4018 /wd4100 /wd4132 /wd4389 /wd4127 /wd4701 /wd4245 /wd4267 /wd4334) - - # Add include dir --include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include -+include_directories( ${OGG_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) - - fix_default_compiler_settings_() -diff --git a/thirdparty/minizip/CMakeLists.txt b/thirdparty/minizip/CMakeLists.txt -index 5f4d0af..2b015c9 100644 ---- a/thirdparty/minizip/CMakeLists.txt -+++ b/thirdparty/minizip/CMakeLists.txt -@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) - add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4127 /wd4131 /wd4100 /wd4189 /wd4244) - - # Add include dir --include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) -+include_directories( ${ZLIB_INCLUDE_DIRS} ) - - fix_default_compiler_settings_() - -@@ -15,6 +15,6 @@ fix_default_compiler_settings_() - add_library(minizip STATIC ${source_files}) - - # Add linker input libraries --target_link_libraries(minizip zlib) -+target_link_libraries(minizip ZLIB::ZLIB) - - set_target_properties(minizip PROPERTIES DEBUG_POSTFIX d ) -\ No newline at end of file diff --git a/ports/crashrpt/CONTROL b/ports/crashrpt/CONTROL deleted file mode 100644 index 4b15e9d2336243..00000000000000 --- a/ports/crashrpt/CONTROL +++ /dev/null @@ -1,16 +0,0 @@ -Source: crashrpt -Version: 1.4.3 -Description: A crash reporting system for Windows applications -Homepage: http://crashrpt.sourceforge.net/ -Build-Depends: dbghelp, libjpeg-turbo, libogg, libpng, libtheora, tinyxml, wtl, zlib -Default-Features: - -Feature: probe -Description: The CrashRptProbe library - -Feature: tests -Description: Test application for crashrpt -Build-Depends: crashrpt[core,probe] - -Feature: demos -Description: Demo applications for CrashRptProbe diff --git a/ports/crashrpt/portfile.cmake b/ports/crashrpt/portfile.cmake deleted file mode 100644 index f52f8e19a24b8f..00000000000000 --- a/ports/crashrpt/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "OSX" "Linux" "UWP") - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(ARCH_DIR "") -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(ARCH_DIR "x64/") -else() - vcpkg_fail_port_install(MESSAGE "${PORT} only supports x86 and x64 architectures" ALWAYS) -endif() - -vcpkg_from_git( - OUT_SOURCE_PATH SOURCE_PATH - URL https://git.code.sf.net/p/crashrpt/code - REF 4616504670be5a425a525376648d912a72ce18f2 - PATCHES - 001-add-install-target-and-find-deps.patch -) - -# Remove vendored dependencies to ensure they are not picked up by the build -# Vendored minizip is still used since it contains modifications needed for CrashRpt -foreach(DEPENDENCY dbghelp jpeg libogg libpng libtheora tinyxml wtl zlib) - if(EXISTS ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) - file(REMOVE_RECURSE ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) - endif() -endforeach() - -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CRASHRPT_BUILD_SHARED_LIBS) -string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" CRASHRPT_LINK_CRT_AS_DLL) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - probe CRASHRPT_BUILD_PROBE - tests CRASHRPT_BUILD_TESTS - demos CRASHRPT_BUILD_DEMOS -) - -# PREFER_NINJA is not used below since CrashSender fails to build with errors like this one: -# C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\ATLMFC\include\atlconv.h(788): error C2440: 'return': cannot convert from 'LPCTSTR' to 'LPCOLESTR' -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - # PREFER_NINJA - OPTIONS - -DCRASHRPT_BUILD_SHARED_LIBS=${CRASHRPT_BUILD_SHARED_LIBS} - -DCRASHRPT_LINK_CRT_AS_DLL=${CRASHRPT_LINK_CRT_AS_DLL} - ${FEATURE_OPTIONS} -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cudnn/CONTROL b/ports/cudnn/CONTROL index 24714f97fd2a87..4ab7c941b9d053 100644 --- a/ports/cudnn/CONTROL +++ b/ports/cudnn/CONTROL @@ -1,6 +1,5 @@ Source: cudnn Version: 7.6 -Port-Version: 2 Description: NVIDIA's cuDNN deep neural network acceleration library Build-Depends: cuda Supports: (windows|linux)&x64 diff --git a/ports/cudnn/FindCUDNN.cmake b/ports/cudnn/FindCUDNN.cmake index 5dc2e339266a74..1b6916577ffd25 100644 --- a/ports/cudnn/FindCUDNN.cmake +++ b/ports/cudnn/FindCUDNN.cmake @@ -38,11 +38,6 @@ endif() if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn.h") file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS) - if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn_version.h") - file(READ "${CUDNN_INCLUDE_DIR}/cudnn_version.h" CUDNN_VERSION_H_CONTENTS) - string(APPEND CUDNN_HEADER_CONTENTS "${CUDNN_VERSION_H_CONTENTS}") - unset(CUDNN_VERSION_H_CONTENTS) - endif() string(REGEX MATCH "define CUDNN_MAJOR * +([0-9]+)" CUDNN_VERSION_MAJOR "${CUDNN_HEADER_CONTENTS}") string(REGEX REPLACE "define CUDNN_MAJOR * +([0-9]+)" "\\1" diff --git a/ports/cudnn/vcpkg-cmake-wrapper.cmake b/ports/cudnn/vcpkg-cmake-wrapper.cmake index 5a69edec56201c..bbda1d04d68e9a 100644 --- a/ports/cudnn/vcpkg-cmake-wrapper.cmake +++ b/ports/cudnn/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(CUDNN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT CUDNN_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${CUDNN_PREV_MODULE_PATH}) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index 16c00db4f76d9c..ae36158755b964 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,15 +1,15 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 62b7b33..8a4bd71 100644 +index 62b7b33..9b0e2e1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -107,6 +107,10 @@ endif() +@@ -107,7 +107,9 @@ endif() target_link_libraries(${LIB_NAME} ${CURL_LIBS}) +-if(WIN32) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) -+endif() -+ - if(WIN32) ++elseif(WIN32) add_definitions(-D_USRDLL) endif() + diff --git a/ports/curl/0008_fix_tools_path.patch b/ports/curl/0008_fix_tools_path.patch new file mode 100644 index 00000000000000..7c411bf8004f8e --- /dev/null +++ b/ports/curl/0008_fix_tools_path.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5838805..d2ca468 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -103,7 +103,7 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) + + #INCLUDE(ModuleInstall OPTIONAL) + +-install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS ${EXE_NAME} DESTINATION tools) + #export(TARGETS ${EXE_NAME} + # APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake + # NAMESPACE ${PROJECT_NAME}:: diff --git a/ports/curl/0011_fix_static_build.patch b/ports/curl/0011_fix_static_build.patch deleted file mode 100644 index a50fa287f54cfe..00000000000000 --- a/ports/curl/0011_fix_static_build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 8a4bd71..1927fb0 100644 ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -111,7 +111,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) - endif() - --if(WIN32) -+if(WIN32 AND BUILD_SHARED_LIBS) - add_definitions(-D_USRDLL) - endif() - diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 6f50966de0290e..079b75d83f2d37 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,6 +1,5 @@ Source: curl Version: 7.71.1 -Port-Version: 2 Build-Depends: zlib Homepage: https://github.com/curl/curl Description: A library for transferring data with URLs diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 0ad9cd7a2dcae2..d34441170d0c53 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -10,9 +10,9 @@ vcpkg_from_github( 0005_remove_imp_suffix.patch 0006_fix_tool_depends.patch 0007_disable_tool_export_curl_target.patch + 0008_fix_tools_path.patch 0009_fix_openssl_config.patch 0010_fix_othertests_cmake.patch - 0011_fix_static_build.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) @@ -78,7 +78,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if ("tool" IN_LIST FEATURES) - vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/curl) endif() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CURL) diff --git a/ports/darknet/CONTROL b/ports/darknet/CONTROL index ea0b5ce26b5c88..3f22eeb31e3c3a 100644 --- a/ports/darknet/CONTROL +++ b/ports/darknet/CONTROL @@ -1,5 +1,5 @@ Source: darknet -Version: 2020-06-29 +Version: 2020-03-02 Description: Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities. Build-Depends: pthreads (windows), stb diff --git a/ports/darknet/fix_shared_static.patch b/ports/darknet/fix_shared_static.patch deleted file mode 100644 index 5b9670f4174f5d..00000000000000 --- a/ports/darknet/fix_shared_static.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 3.12) -+cmake_minimum_required(VERSION 3.17) - - set(Darknet_MAJOR_VERSION 0) - set(Darknet_MINOR_VERSION 2) -@@ -77,6 +77,11 @@ if(CMAKE_CUDA_COMPILER AND ENABLE_CUDA) - else() - message(STATUS "Your setup supports half precision (it requires CC >= 7.0)") - endif() -+ endif() -+ if(BUILD_SHARED_LIBS) -+ set(CMAKE_CUDA_RUNTIME_LIBRARY "Shared") -+ else() -+ set(CMAKE_CUDA_RUNTIME_LIBRARY "Static") - endif() - else() - set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA support" FORCE) diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake index ed8a41a720d436..9d15802b00f7f1 100644 --- a/ports/darknet/portfile.cmake +++ b/ports/darknet/portfile.cmake @@ -1,11 +1,9 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO AlexeyAB/darknet - REF 320e6fd8d29f6f7825ef668f15f955f90131f782 - SHA512 f95ac04c1c4e1b3f28aa835a64d969ffee064a3681a7966b255981722d562aa1eb91c30a378cad2f1bccd4581b74d8c2ec641c57763bc0fa97bfce8b1c222480 + REF 81290b07376c5abb4988a492dda70913bb90133d + SHA512 094197cde851dfdd1e102a3ffaed34d67a789dd75dc288bde611144dc9aa484ca0b9e3468abc297d075d3753553f7f09a214be279af9e58ccb642aa757909f79 HEAD_REF master - PATCHES - fix_shared_static.patch ) # enable CUDA inside DARKNET @@ -53,31 +51,11 @@ if ("cuda" IN_LIST FEATURES) endif() if("weights" IN_LIST FEATURES) - vcpkg_download_distfile(YOLOV4-TINY_WEIGHTS - URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights" - FILENAME "darknet-cache/yolov4-tiny.weights" - SHA512 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 - ) - vcpkg_download_distfile(YOLOV4_WEIGHTS - URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights" - FILENAME "darknet-cache/yolov4.weights" - SHA512 77f779c58df67975b187cfead99c1e62d72c57e76c3715e35b97a1c7aba1c7b092be97ffb17907099543ac3957085a0fe9688df4a653ea62dfe8322afca53e40 - ) - vcpkg_download_distfile(YOLOV3-TINY-PRN_WEIGHTS - URLS "https://drive.google.com/u/0/uc?id=18yYZWyKbo4XSDVyztmsEcF9B_6bxrhUY&export=download" - FILENAME "darknet-cache/yolov3-tiny-prn.weights" - SHA512 0be26786103866868751bb8c5cc0b5147b3e8528d0cf5b387f5aefc72807fd7f1bf8049d5b0a47e9b4445d34e773ea8e3abc95330edb2a3ecd6103e158df2677 - ) vcpkg_download_distfile(YOLOV3_WEIGHTS URLS "https://pjreddie.com/media/files/yolov3.weights" FILENAME "darknet-cache/yolov3.weights" SHA512 293c70e404ff0250d7c04ca1e5e053fc21a78547e69b5b329d34f25981613e59b982d93fff2c352915ef7531d6c3b02a9b0b38346d05c51d6636878d8883f2c1 ) - vcpkg_download_distfile(YOLOV3-OPENIMAGES_WEIGHTS - URLS "https://pjreddie.com/media/files/yolov3-openimages.weights" - FILENAME "darknet-cache/yolov3-openimages.weights" - SHA512 616e90057946c9588d045cff6ec36b63254660af4377201dc02642e798d62f392e8f3cdb5b10a1c4bcbe5c056e690275dca35b68db7fd802783a0c6bbd959ba8 - ) vcpkg_download_distfile(YOLOV2_WEIGHTS URLS "https://pjreddie.com/media/files/yolov2.weights" FILENAME "darknet-cache/yolov2.weights" @@ -96,22 +74,12 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) - vcpkg_download_distfile(YOLOV4-TINY-CONV-29 - URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.conv.29" - FILENAME "darknet-cache/yolov4-tiny.conv.29" - SHA512 318e47f4bdf43b7f4eff8f3669bc9ba66cd7bd8ffb31df5bc1978682c85fec8e63a8349958022fd933cc676cbf5241953f2181bf4d1789f7cf9d371e012e3e49 - ) - vcpkg_download_distfile(YOLOV4-CONV-137 - URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.conv.137" - FILENAME "darknet-cache/yolov4.conv.137" - SHA512 d146a61762bf6ef91deb6c627ede475f63b3975fbeeb1ff5e0949470b29be8fc28ee81280041937e7ded49679276fbabacdb92d02fa246cc622853633fd3d992 - ) - vcpkg_download_distfile(DARKNET53-CONV-74 + vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V3 URLS "https://pjreddie.com/media/files/darknet53.conv.74" FILENAME "darknet-cache/darknet53.conv.74" SHA512 8983e1c129e2d6e8e3da0cc0781ecb7a07813830ef5a87c24b53100df6a5f23db6c6e6a402aec78025a93fe060b75d1958f1b8f7439a04b54a3f19c81e2ae99b ) - vcpkg_download_distfile(DARKNET19-448-CONV-23 + vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V2 URLS "https://pjreddie.com/media/files/darknet19_448.conv.23" FILENAME "darknet-cache/darknet19_448.conv.23" SHA512 8016f5b7ddc15c5d7dad231592f5351eea65f608ebdb204f545034dde904e11962f693080dfeb5a4510e7b71bdda151a9121ba0f8a243018d680f01b1efdbd31 @@ -165,10 +133,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if("weights" IN_LIST FEATURES) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny-prn.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-openimages.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov2.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -176,8 +140,6 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.conv.29 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.conv.137 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet53.conv.74 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet19_448.conv.23 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() diff --git a/ports/date/0003-find-dependency-pthread.patch b/ports/date/0003-find-dependency-pthread.patch deleted file mode 100644 index 72c6c765a15b54..00000000000000 --- a/ports/date/0003-find-dependency-pthread.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cmake/dateConfig.cmake b/cmake/dateConfig.cmake -index 20f86e8..2198ad1 100644 ---- a/cmake/dateConfig.cmake -+++ b/cmake/dateConfig.cmake -@@ -1,8 +1,8 @@ - include( CMakeFindDependencyMacro ) - include( "${CMAKE_CURRENT_LIST_DIR}/dateTargets.cmake" ) --if( NOT MSVC AND TARGET date::tz ) -+if( NOT MSVC AND TARGET date::date-tz ) - find_dependency( Threads REQUIRED) -- get_target_property( _tzill date::tz INTERFACE_LINK_LIBRARIES ) -+ get_target_property( _tzill date::date-tz INTERFACE_LINK_LIBRARIES ) - if( _tzill AND "${_tzill}" MATCHES "libcurl" ) - find_dependency( CURL ) - endif( ) diff --git a/ports/date/CONTROL b/ports/date/CONTROL index b44b024cdb7d8c..c912bd283e9856 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,6 +1,5 @@ Source: date Version: 3.0.0 -Port-Version: 1 Homepage: https://github.com/HowardHinnant/date Description: A date and time library based on the C++17 header diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index 4dd5a40eb470db..3fd9121c4b346c 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -14,7 +14,6 @@ vcpkg_from_github( PATCHES 0001-fix-uwp.patch 0002-fix-cmake-3.14.patch - 0003-find-dependency-pthread.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS INVERTED_FEATURES @@ -40,5 +39,9 @@ endif() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright) +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) + +# Remove the wrapper when backwards compatibility when the unofficial::date::date and unofficial::date::tz +# targets are no longer required. +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) diff --git a/ports/date/usage b/ports/date/usage new file mode 100644 index 00000000000000..82f42f7f2d1469 --- /dev/null +++ b/ports/date/usage @@ -0,0 +1,4 @@ +The package date provides CMake targets: + + find_package(date CONFIG REQUIRED) + target_link_libraries(main PRIVATE date::date date::tz) diff --git a/ports/date/vcpkg-cmake-wrapper.cmake b/ports/date/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..317c49b8c049e3 --- /dev/null +++ b/ports/date/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,11 @@ +_find_package(${ARGS}) + +if(NOT TARGET unofficial::date::date AND TARGET date::date) + add_library(unofficial::date::date INTERFACE IMPORTED) + target_link_libraries(unofficial::date::date INTERFACE date::date) +endif() + +if(NOT TARGET unofficial::date::tz AND TARGET date::tz) + add_library(unofficial::date::tz INTERFACE IMPORTED) + target_link_libraries(unofficial::date::tz INTERFACE date::tz) +endif() diff --git a/ports/dbghelp/CONTROL b/ports/dbghelp/CONTROL deleted file mode 100644 index e92599d577c28e..00000000000000 --- a/ports/dbghelp/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: dbghelp -Version: 0.0 -Description: Windows Debug Help Library -Supports: windows \ No newline at end of file diff --git a/ports/dbghelp/portfile.cmake b/ports/dbghelp/portfile.cmake deleted file mode 100644 index 832bec6d74c498..00000000000000 --- a/ports/dbghelp/portfile.cmake +++ /dev/null @@ -1,27 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "OSX" "Linux") -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - -vcpkg_get_windows_sdk(WINDOWS_SDK) - -if (WINDOWS_SDK VERSION_GREATER "10") - set(LIBFILEPATH "$ENV{WindowsSdkDir}Debuggers\\lib\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.lib") - message("LIBFILEPATH: ${LIBFILEPATH}") - set(DLLFILEPATH "$ENV{WindowsSdkDir}Debuggers\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.dll") - message("DLLFILEPATH: ${DLLFILEPATH}") - set(HEADERPATH "$ENV{WindowsSdkDir}Debuggers\\inc\\dbghelp.h") - message("HEADERPATH: ${HEADERPATH}") -else() - message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") -endif() - -if (NOT EXISTS "${LIBFILEPATH}" OR NOT EXISTS "${DLLFILEPATH}" OR NOT EXISTS "${HEADERPATH}") - message(FATAL_ERROR "Cannot find debugging tools in Windows SDK ${WINDOWS_SDK}. Please reinstall the Windows SDK and select \"Debugging Tools\".") -endif() - -file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) -file(INSTALL ${HEADERPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license") diff --git a/ports/directxsdk/portfile.cmake b/ports/directxsdk/portfile.cmake deleted file mode 100644 index 86fa8a14914d14..00000000000000 --- a/ports/directxsdk/portfile.cmake +++ /dev/null @@ -1,60 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm") - -vcpkg_download_distfile(ARCHIVE - URLS "https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe" - FILENAME "DXSDK_Jun10.exe" - SHA512 4869ac947a35cd0d6949fbda17547256ea806fef36f48474dda63651f751583e9902641087250b6e8ccabaab85e51effccd9235dc6cdf64e21ec2b298227fe19 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - - -set(LIB_DIR "${SOURCE_PATH}/Lib/${VCPKG_TARGET_ARCHITECTURE}") -set(DEBUG_LIBS - ${LIB_DIR}/D3DCSXd.lib - ${LIB_DIR}/d3dx10d.lib - ${LIB_DIR}/d3dx11d.lib - ${LIB_DIR}/d3dx9d.lib - ${LIB_DIR}/xapobased.lib -) -set(RELEASE_LIBS - ${LIB_DIR}/D3DCSX.lib - ${LIB_DIR}/d3dx10.lib - ${LIB_DIR}/d3dx11.lib - ${LIB_DIR}/d3dx9.lib - ${LIB_DIR}/xapobase.lib -) -# Libs without a debug part -set(OTHER_LIBS - ${LIB_DIR}/d2d1.lib - ${LIB_DIR}/d3d10.lib - ${LIB_DIR}/d3d10_1.lib - ${LIB_DIR}/d3d11.lib - ${LIB_DIR}/d3d9.lib - ${LIB_DIR}//d3dcompiler.lib - ${LIB_DIR}/d3dxof.lib - ${LIB_DIR}/dinput8.lib - ${LIB_DIR}/dsound.lib - ${LIB_DIR}/dwrite.lib - ${LIB_DIR}/DxErr.lib - ${LIB_DIR}/dxgi.lib - ${LIB_DIR}/dxguid.lib - ${LIB_DIR}/X3DAudio.lib - ${LIB_DIR}/XAPOFX.lib - ${LIB_DIR}/XInput.lib -) -if(${VCPKG_TARGET_ARCHITECTURE} STREQUAL "x86") - list(APPEND OTHER_LIBS ${LIB_DIR}/dsetup.lib) -endif() - -#install(DIRECTORY "${SOURCE_PATH}/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY "${SOURCE_PATH}/Include/" DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) -file(COPY ${RELEASE_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${DEBUG_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - - -# # Handle copyright -file(INSTALL "${SOURCE_PATH}/Documentation/License Agreements/DirectX SDK EULA.txt" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/directxsdk/vcpkg.json b/ports/directxsdk/vcpkg.json deleted file mode 100644 index fa1f7a348d81bd..00000000000000 --- a/ports/directxsdk/vcpkg.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "directxsdk", - "version-string": "jun10", - "description": "DirectX SDK", - "homepage": "https://www.microsoft.com/en-us/download/details.aspx?id=6812", - "supports": "windows & !arm & !uwp" -} diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 61df74294412f1..9828f97265b278 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,7 +1,6 @@ Source: dlib -Version: 19.19 -Port-Version: 2 -Build-Depends: libjpeg-turbo, libpng, openblas (!osx), lapack +Version: 19.19-1 +Build-Depends: libjpeg-turbo, libpng, openblas (!osx), clapack (!osx) Homepage: https://github.com/davisking/dlib Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ Default-Features: fftw3, sqlite3 diff --git a/ports/embree3/CONTROL b/ports/embree3/CONTROL old mode 100755 new mode 100644 index 824e892e6c1ef6..d7013ff75b12a3 --- a/ports/embree3/CONTROL +++ b/ports/embree3/CONTROL @@ -1,5 +1,5 @@ Source: embree3 -Version: 3.11.0 +Version: 3.8.0 Homepage: https://github.com/embree/embree Description: High Performance Ray Tracing Kernels. Build-Depends: tbb diff --git a/ports/embree3/fix-InstallPath.patch b/ports/embree3/fix-InstallPath.patch new file mode 100644 index 00000000000000..316fa594d0a5db --- /dev/null +++ b/ports/embree3/fix-InstallPath.patch @@ -0,0 +1,15 @@ +diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake +index 3c3980d..0c365ac 100644 +--- a/common/cmake/package.cmake ++++ b/common/cmake/package.cmake +@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm + # create a config file for the build directory + CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) + +-INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} RENAME "embree-config.cmake" COMPONENT devel) +-INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) ++INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) + + ############################################################## + # CPack specific stuff diff --git a/ports/embree3/fix-cmake-path.patch b/ports/embree3/fix-cmake-path.patch new file mode 100644 index 00000000000000..e1e65eda37d3d8 --- /dev/null +++ b/ports/embree3/fix-cmake-path.patch @@ -0,0 +1,163 @@ +diff --git a/common/lexers/CMakeLists.txt b/common/lexers/CMakeLists.txt +index 10c8caf..95d96dc 100644 +--- a/common/lexers/CMakeLists.txt ++++ b/common/lexers/CMakeLists.txt +@@ -23,7 +23,7 @@ SET_PROPERTY(TARGET lexers PROPERTY FOLDER common) + SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT lexers-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS lexers EXPORT lexers-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT lexers-targets DESTINATION share/embree3 COMPONENT devel) + SIGN_TARGET(lexers) + ENDIF() +diff --git a/common/math/CMakeLists.txt b/common/math/CMakeLists.txt +index e7ed3b1..13247ca 100644 +--- a/common/math/CMakeLists.txt ++++ b/common/math/CMakeLists.txt +@@ -19,8 +19,8 @@ SET_PROPERTY(TARGET math PROPERTY FOLDER common) + SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT math-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS math EXPORT math-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT math-targets DESTINATION share/embree3 COMPONENT devel) + SIGN_TARGET(math) + ENDIF() + +diff --git a/common/simd/CMakeLists.txt b/common/simd/CMakeLists.txt +index 5b1658c..81d7c80 100644 +--- a/common/simd/CMakeLists.txt ++++ b/common/simd/CMakeLists.txt +@@ -19,7 +19,7 @@ SET_PROPERTY(TARGET simd PROPERTY FOLDER common) + SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT simd-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS simd EXPORT simd-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT simd-targets DESTINATION share/embree3 COMPONENT devel) + SIGN_TARGET(simd) + ENDIF() +diff --git a/common/sys/CMakeLists.txt b/common/sys/CMakeLists.txt +index e0e0848..b57e6be 100644 +--- a/common/sys/CMakeLists.txt ++++ b/common/sys/CMakeLists.txt +@@ -35,7 +35,7 @@ SET_PROPERTY(TARGET sys PROPERTY FOLDER common) + SET_PROPERTY(TARGET sys APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS sys EXPORT sys-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT sys-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS sys EXPORT sys-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT sys-targets DESTINATION share/embree3 COMPONENT devel) + SIGN_TARGET(sys) + ENDIF() +diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt +index f5db33f..b96671a 100644 +--- a/common/tasking/CMakeLists.txt ++++ b/common/tasking/CMakeLists.txt +@@ -28,7 +28,7 @@ SET_PROPERTY(TARGET tasking PROPERTY FOLDER common) + SET_PROPERTY(TARGET tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS tasking EXPORT tasking-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT tasking-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS tasking EXPORT tasking-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT tasking-targets DESTINATION share/embree3 COMPONENT devel) + SIGN_TARGET(tasking) + ENDIF() +diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt +index a5774d2..b637321 100644 +--- a/kernels/CMakeLists.txt ++++ b/kernels/CMakeLists.txt +@@ -255,8 +255,8 @@ IF (EMBREE_ISA_SSE42 AND EMBREE_LIBRARY_FILES_SSE42) + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_sse42) + CheckGlobals(embree_sse42) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT embree_sse42-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT embree_sse42-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + ENDIF () + +@@ -268,8 +268,8 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx) + CheckGlobals(embree_avx) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx EXPORT embree_avx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT embree_avx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS embree_avx EXPORT embree_avx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT embree_avx-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + ENDIF() + +@@ -281,8 +281,8 @@ IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2) + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx2) + CheckGlobals(embree_avx2) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT embree_avx2-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT embree_avx2-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + ENDIF() + +@@ -294,8 +294,8 @@ IF (EMBREE_ISA_AVX512KNL AND EMBREE_LIBRARY_FILES_AVX512KNL) + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512knl) + CheckGlobals(embree_avx512knl) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT embree_avx512knl-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT embree_avx512knl-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + ENDIF() + +@@ -307,8 +307,8 @@ IF (EMBREE_ISA_AVX512SKX AND EMBREE_LIBRARY_FILES_AVX512SKX) + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512skx) + CheckGlobals(embree_avx512skx) + IF (EMBREE_STATIC_LIB) +- INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) +- INSTALL(EXPORT embree_avx512skx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) ++ INSTALL(EXPORT embree_avx512skx-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + ENDIF() + +@@ -331,7 +331,7 @@ ELSE() + SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR}) + ENDIF() + +-INSTALL(TARGETS embree EXPORT embree-targets ++INSTALL(TARGETS embree EXPORT embree-targets DESTINATION share/embree3 + LIBRARY NAMELINK_SKIP DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib + # on Windows put the dlls into bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples +@@ -340,7 +340,7 @@ INSTALL(TARGETS embree EXPORT embree-targets + ) + + IF (EMBREE_STATIC_LIB) +- INSTALL(EXPORT embree-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) ++ INSTALL(EXPORT embree-targets DESTINATION share/embree3 COMPONENT devel) + ENDIF() + + IF (NOT EMBREE_STATIC_LIB) +diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake +index 0c365ac..7b140a5 100644 +--- a/common/cmake/package.cmake ++++ b/common/cmake/package.cmake +@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm + # create a config file for the build directory + CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) + +-INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) +-INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) ++INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION share/embree3 RENAME "embree-config.cmake" COMPONENT devel) ++INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION share/embree3 COMPONENT devel) + + ############################################################## + # CPack specific stuff diff --git a/ports/embree3/fix-embree-path.patch b/ports/embree3/fix-embree-path.patch new file mode 100644 index 00000000000000..31611275549eff --- /dev/null +++ b/ports/embree3/fix-embree-path.patch @@ -0,0 +1,26 @@ +diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake +index cab4d41..da84d3d 100644 +--- a/common/cmake/embree-config.cmake ++++ b/common/cmake/embree-config.cmake +@@ -14,11 +14,19 @@ + ## limitations under the License. ## + ## ======================================================================== ## + +-SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) ++SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../@EMBREE_RELATIV_ROOT_DIR@) + GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) + + SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) +-SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) ++ ++IF (CMAKE_BUILD_TYPE STREQUAL Debug) ++ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/debug/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) ++ENDIF () ++ ++IF (CMAKE_BUILD_TYPE STREQUAL Release) ++ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) ++ENDIF () ++ + SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) + + MARK_AS_ADVANCED(embree_DIR) diff --git a/ports/embree3/fix-path.patch b/ports/embree3/fix-path.patch deleted file mode 100755 index ff25a43aad5a89..00000000000000 --- a/ports/embree3/fix-path.patch +++ /dev/null @@ -1,117 +0,0 @@ -diff --git a/common/algorithms/CMakeLists.txt b/common/algorithms/CMakeLists.txt -index 5667d2bd3..cb26776a4 100644 ---- a/common/algorithms/CMakeLists.txt -+++ b/common/algorithms/CMakeLists.txt -@@ -17,11 +17,4 @@ ADD_LIBRARY(algorithms OBJECT - SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common) - SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - --# ideally we would use target_link_libraries to provide the algorithms target --# with the TBB include directory information. Howeve, this is only possible in --# very recent versions of TBB and therefore we use the target property instead --GET_TARGET_PROPERTY(tasking_include_dirs tasking INCLUDE_DIRECTORIES) --if (tasking_include_dirs) -- TARGET_INCLUDE_DIRECTORIES(algorithms PUBLIC "${tasking_include_dirs}") -- GET_TARGET_PROPERTY(algorithms_include_dirs algorithms INCLUDE_DIRECTORIES) --endif() -+TARGET_LINK_LIBRARIES(algorithms PUBLIC tasking) -diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake -index 9b7370ccd..14ce929d6 100644 ---- a/common/cmake/embree-config.cmake -+++ b/common/cmake/embree-config.cmake -@@ -5,8 +5,6 @@ SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) - GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) - - SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) --SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) --SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) - - SET(EMBREE_VERSION @EMBREE_VERSION@) - SET(EMBREE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@) -@@ -22,7 +20,6 @@ SET(EMBREE_ISA_AVX2 @EMBREE_ISA_AVX2@) - SET(EMBREE_ISA_AVX512KNL @EMBREE_ISA_AVX512KNL@) - SET(EMBREE_ISA_AVX512SKX @EMBREE_ISA_AVX512SKX@) - --SET(EMBREE_BUILD_TYPE @CMAKE_BUILD_TYPE@) - SET(EMBREE_ISPC_SUPPORT @EMBREE_ISPC_SUPPORT@) - SET(EMBREE_STATIC_LIB @EMBREE_STATIC_LIB@) - SET(EMBREE_TUTORIALS @EMBREE_TUTORIALS@) -@@ -53,10 +50,6 @@ IF (EMBREE_STATIC_LIB) - INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/simd-targets.cmake") - INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/lexers-targets.cmake") - INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake") -- -- add_library(TBB::tbb SHARED IMPORTED) -- set_target_properties(TBB::tbb PROPERTIES IMPORTED_LOCATION "${EMBREE_ROOT_DIR}/@EMBREE_INSTALLED_TBB@") -- - ENDIF() - - INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake") -diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake -index a4da0001a..b6f82e981 100644 ---- a/common/cmake/package.cmake -+++ b/common/cmake/package.cmake -@@ -20,16 +20,6 @@ ELSE() - ENDIF() - ENDIF() - --############################################################## --# Install MSVC runtime --############################################################## -- --IF (WIN32) -- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) -- INCLUDE(InstallRequiredSystemLibraries) -- LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll") -- INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT lib) --ENDIF() - - ############################################################## - # Install Headers -@@ -106,18 +96,9 @@ ELSE() - ENDIF() - ENDIF() - --IF (WIN32 OR EMBREE_ZIP_MODE) -- # for local "installs" and on Windows we want the cmake config files placed -- # in the install root, such that users can point the CMake variable -- # embree_DIR just to the install folder -- SET(EMBREE_CMAKECONFIG_DIR ".") -- SET(EMBREE_CMAKEEXPORT_DIR "cmake") -- SET(EMBREE_RELATIV_ROOT_DIR ".") --ELSE() -- SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") -- SET(EMBREE_CMAKEEXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") -- FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/") --ENDIF() -+SET(EMBREE_CMAKECONFIG_DIR "share/embree") -+SET(EMBREE_CMAKEEXPORT_DIR "share/embree3") -+SET(EMBREE_RELATIV_ROOT_DIR "../..") - - CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY) - CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY) -diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt -index 71ef29612..c846004e3 100644 ---- a/common/tasking/CMakeLists.txt -+++ b/common/tasking/CMakeLists.txt -@@ -10,7 +10,7 @@ ELSEIF (TASKING_TBB) - if (NOT ${EMBREE_TBB_ROOT} STREQUAL "") - set(TBB_ROOT ${EMBREE_TBB_ROOT}) - endif() -- FIND_PACKAGE(TBB REQUIRED tbb) -+ FIND_PACKAGE(TBB CONFIG REQUIRED tbb) - - ############################################################## - # Create tasking target and link against TBB. Also set include directory -@@ -18,10 +18,7 @@ ELSEIF (TASKING_TBB) - # with the TBB header files - ############################################################## - ADD_LIBRARY(tasking STATIC taskschedulertbb.cpp) -- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB) -- TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}") -- -- include(installTBB) -+ TARGET_LINK_LIBRARIES(tasking PUBLIC TBB::tbb) - - ELSEIF (TASKING_PPL) - ADD_LIBRARY(tasking STATIC taskschedulerppl.cpp) diff --git a/ports/embree3/portfile.cmake b/ports/embree3/portfile.cmake old mode 100755 new mode 100644 index 6832847ddc35e8..af320ffc1480b9 --- a/ports/embree3/portfile.cmake +++ b/ports/embree3/portfile.cmake @@ -1,40 +1,64 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO embree/embree - REF v3.11.0 - SHA512 a20acb07103d322eebc85d41152210466f8d9b97e7a332589c692f649ee02079465f89561748ddc8448fb40bc63f2595d728cc31a927f7b95bea13446c5c775d + REF 539d4eec716085484f957d7b0d697b1891dafec4 # v3.8.0 + SHA512 77ab07cc7283f1a0c50d7cec07d1cbe4a24a41482b8b043f79a045953fccfa41a854bbc29a76beb67385d1bbb6d43097287ccfd3e1d2c84c1a5d55a2696d0815 HEAD_REF master PATCHES - fix-path.patch + fix-InstallPath.patch + fix-cmake-path.patch + fix-embree-path.patch ) -string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static EMBREE_STATIC_LIB) -string(COMPARE EQUAL ${VCPKG_CRT_LINKAGE} static EMBREE_STATIC_RUNTIME) +file(REMOVE ${SOURCE_PATH}/common/cmake/FindTBB.cmake) + +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(EMBREE_STATIC_RUNTIME ON) +else() + set(EMBREE_STATIC_RUNTIME OFF) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(EMBREE_STATIC_LIB ON) +else() + set(EMBREE_STATIC_LIB OFF) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE - PREFER_NINJA + PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DEMBREE_ISPC_SUPPORT=OFF -DEMBREE_TUTORIALS=OFF -DEMBREE_STATIC_RUNTIME=${EMBREE_STATIC_RUNTIME} -DEMBREE_STATIC_LIB=${EMBREE_STATIC_LIB} + "-DTBB_LIBRARIES=TBB::tbb" + "-DTBB_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include" ) +# just wait, the release build of embree is insanely slow in MSVC +# a single file will took about 2-10 min vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets() + +vcpkg_fixup_cmake_targets(CONFIG_PATH share/embree3 TARGET_PATH share/embree) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -if(APPLE) - file(REMOVE ${CURRENT_PACKAGES_DIR}/uninstall.command ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) +if (EXISTS ${CURRENT_PACKAGES_DIR}/uninstall.command) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/uninstall.command) endif() -file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/${PORT}/doc) +if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) +endif() + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/embree/doc) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +# Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/embree3/usage b/ports/embree3/usage deleted file mode 100755 index 8622f121d74664..00000000000000 --- a/ports/embree3/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package embree3 provides CMake targets: - - find_package(embree 3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE embree) diff --git a/ports/ensmallen/CONTROL b/ports/ensmallen/CONTROL index bf13812e416277..2a93222c607da1 100644 --- a/ports/ensmallen/CONTROL +++ b/ports/ensmallen/CONTROL @@ -1,7 +1,6 @@ Source: ensmallen Version: 2.11.2 -Port-Version: 1 Homepage: https://github.com/mlpack/ensmallen Description: A header-only C++ library for mathematical optimization. -Build-Depends: openblas (!osx), lapack, armadillo +Build-Depends: openblas (!osx), clapack (!osx), armadillo diff --git a/ports/evpp/CONTROL b/ports/evpp/CONTROL index 047c77a4404031..68244157bf24e1 100644 --- a/ports/evpp/CONTROL +++ b/ports/evpp/CONTROL @@ -1,6 +1,5 @@ Source: evpp -Version: 0.7.0 -Port-Version: 4 +Version: 0.7.0-3 Homepage: https://github.com/Qihoo360/evpp Description: A modern C++ network library based on libevent for developing high performance network services in TCP/UDP/HTTP protocols. Build-Depends: glog, libevent (windows), libevent[openssl] (!windows), rapidjson, concurrentqueue (!windows), boost-lockfree (!windows) \ No newline at end of file diff --git a/ports/evpp/fix-linux-build.patch b/ports/evpp/fix-linux-build.patch index b5673b27c49cd3..2b772a145a49ea 100644 --- a/ports/evpp/fix-linux-build.patch +++ b/ports/evpp/fix-linux-build.patch @@ -11,7 +11,7 @@ index 7872fc8..2a06614 100644 + find_path(GLOG_INCLUDE_DIRS logging.h PATH_SUFFIXES glog) + find_package(Libevent CONFIG REQUIRED) + list(APPEND DEPENDENT_INCLUDE_DIRS "${GLOG_INCLUDE_DIRS}/../") -+ SET(DEPENDENT_LIBRARIES libevent::core libevent::extra libevent::openssl glog::glog pthread) ++ SET(DEPENDENT_LIBRARIES event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) else (UNIX) SET(DEPENDENT_LIBRARIES event glog) endif (UNIX) @@ -24,7 +24,7 @@ index 469ed1c..8219424 100644 if (UNIX) -set(LIBRARIES evpp_concurrentqueue event glog pthread) -+set(LIBRARIES evpp_concurrentqueue libevent::core libevent::extra libevent::openssl glog::glog pthread) ++set(LIBRARIES evpp_concurrentqueue event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) link_directories("/home/s/safe/lib" ${PROJECT_BUILD_DIR}/lib) else(UNIX) set(LIBRARIES evpp_static event glog) @@ -36,7 +36,7 @@ index 1148616..0356b71 100644 add_executable(benchmark_http_libevent libevent_http_bench.c) -target_link_libraries(benchmark_http_libevent event) -+target_link_libraries(benchmark_http_libevent libevent::core libevent::extra libevent::openssl) ++target_link_libraries(benchmark_http_libevent event_static event_core_static event_extra_static event_openssl_static) diff --git a/benchmark/ioevent/libevent/CMakeLists.txt b/benchmark/ioevent/libevent/CMakeLists.txt index dfa51a3..de4849d 100644 --- a/benchmark/ioevent/libevent/CMakeLists.txt @@ -45,7 +45,7 @@ index dfa51a3..de4849d 100644 add_executable(benchmark_ioevent_libevent libevent_ioevent_bench.c) -target_link_libraries(benchmark_ioevent_libevent event) -+target_link_libraries(benchmark_ioevent_libevent libevent::core libevent::extra libevent::openssl) ++target_link_libraries(benchmark_ioevent_libevent event_static event_core_static event_extra_static event_openssl_static) diff --git a/benchmark/throughput/libevent/CMakeLists.txt b/benchmark/throughput/libevent/CMakeLists.txt index 21dab84..aefe698 100644 --- a/benchmark/throughput/libevent/CMakeLists.txt @@ -53,11 +53,11 @@ index 21dab84..aefe698 100644 @@ -1,5 +1,5 @@ add_executable(benchmark_tcp_libevent_client client.c) -target_link_libraries(benchmark_tcp_libevent_client event) -+target_link_libraries(benchmark_tcp_libevent_client libevent::core libevent::extra libevent::openssl) ++target_link_libraries(benchmark_tcp_libevent_client event_static event_core_static event_extra_static event_openssl_static) add_executable(benchmark_tcp_libevent_server server.c) -target_link_libraries(benchmark_tcp_libevent_server event) -+target_link_libraries(benchmark_tcp_libevent_server libevent::core libevent::extra libevent::openssl) ++target_link_libraries(benchmark_tcp_libevent_server event_static event_core_static event_extra_static event_openssl_static) diff --git a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt index 7834db4..82294c5 100644 --- a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt @@ -67,7 +67,7 @@ index 7834db4..82294c5 100644 add_executable(example_recipes_self_control_timer_basic_01 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_01 event) -+target_link_libraries(example_recipes_self_control_timer_basic_01 libevent::core libevent::extra libevent::openssl) ++target_link_libraries(example_recipes_self_control_timer_basic_01 event_static event_core_static event_extra_static event_openssl_static) @@ -80,7 +80,7 @@ index a8be419..0329ccc 100644 add_executable(example_recipes_self_control_timer_basic_02 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_02 event) -+target_link_libraries(example_recipes_self_control_timer_basic_02 libevent::core libevent::extra libevent::openssl) ++target_link_libraries(example_recipes_self_control_timer_basic_02 event_static event_core_static event_extra_static event_openssl_static) @@ -93,7 +93,7 @@ index 1cae9bb..218b771 100644 add_executable(example_recipes_self_control_timer_cancel_03 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_cancel_03 event) -+target_link_libraries(example_recipes_self_control_timer_cancel_03 libevent::core libevent::extra libevent::openssl) ++target_link_libraries(example_recipes_self_control_timer_cancel_03 event_static event_core_static event_extra_static event_openssl_static) @@ -106,7 +106,7 @@ index 749c584..e7c658e 100644 add_executable(example_recipes_self_control_timer_periodic_04 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_periodic_04 event) -+target_link_libraries(example_recipes_self_control_timer_periodic_04 libevent::core libevent::extra libevent::openssl) ++target_link_libraries(example_recipes_self_control_timer_periodic_04 event_static event_core_static event_extra_static event_openssl_static) diff --git a/ports/farmhash/CONTROL b/ports/farmhash/CONTROL index 7d7f4d386f528c..f27140fbd01d5a 100644 --- a/ports/farmhash/CONTROL +++ b/ports/farmhash/CONTROL @@ -1,6 +1,5 @@ Source: farmhash -Version: 1.1 -Port-Version: 2 +Version: 1.1-1 Homepage: https://github.com/google/farmhash Description: FarmHash, a family of hash functions. Supports: !arm diff --git a/ports/farmhash/portfile.cmake b/ports/farmhash/portfile.cmake index 801e0570651319..d9bcc924063610 100644 --- a/ports/farmhash/portfile.cmake +++ b/ports/farmhash/portfile.cmake @@ -14,7 +14,6 @@ if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This endif() file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index a2a905b2cc2b7e..fadb1a29c892c4 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,11 +1,10 @@ Source: ffmpeg -Version: 4.2 -Port-Version: 18 +Version: 4.2-13 Build-Depends: zlib Homepage: https://ffmpeg.org Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. -Default-Features: avresample, avcodec, avformat, avdevice, avfilter, swresample, swscale +Default-Features: avresample Feature: ffmpeg Description: build the ffmpeg.exe application @@ -55,24 +54,6 @@ Description: upgrade (L)GPL to version 3 Feature: avresample Description: Libav audio resampling library support in ffmpeg -Feature: avcodec -Description: Codec support in ffmpeg - -Feature: avformat -Description: Format support in ffmpeg - -Feature: avdevice -Description: Device support in ffmpeg - -Feature: avfilter -Description: Filter support in ffmpeg - -Feature: swresample -Description: Swresample support in ffmpeg - -Feature: swscale -Description: Swscale support in ffmpeg - Feature: nvcodec Build-Depends: ffnvcodec, cuda Description: Hardware accelerated codecs diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 5fbd9963de8c7a..cd61ffcc85604b 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,11 +33,7 @@ set(FFMPEG_VERSION "4.2") find_dependency(Threads) if(UNIX) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread) -endif() - -if(UNIX AND NOT APPLE) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lX11) endif() if(@ENABLE_BZIP2@) @@ -131,68 +127,30 @@ if(APPLE) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) endif() -if(@ENABLE_AVCODEC@) - FFMPEG_FIND(libavcodec avcodec avcodec.h) -endif() -if(@ENABLE_AVDEVICE@) - FFMPEG_FIND(libavdevice avdevice avdevice.h) -endif() -if(@ENABLE_AVFILTER@) - FFMPEG_FIND(libavfilter avfilter avfilter.h) -endif() -if(@ENABLE_AVFORMAT@) - FFMPEG_FIND(libavformat avformat avformat.h) -endif() -if(@ENABLE_AVRESAMPLE@) - FFMPEG_FIND(libavresample avresample avresample.h) -endif() +FFMPEG_FIND(libavcodec avcodec avcodec.h) +FFMPEG_FIND(libavdevice avdevice avdevice.h) +FFMPEG_FIND(libavfilter avfilter avfilter.h) +FFMPEG_FIND(libavformat avformat avformat.h) +FFMPEG_FIND(libavresample avresample avresample.h) FFMPEG_FIND(libavutil avutil avutil.h) -if(@ENABLE_SWRESAMPLE@) - FFMPEG_FIND(libswresample swresample swresample.h) -endif() -if(@ENABLE_SWSCALE@) - FFMPEG_FIND(libswscale swscale swscale.h) -endif(@ENABLE_SWSCALE@) - -if (FFMPEG_libavutil_FOUND AND FFMPEG_libzlib_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavutil_INCLUDE_DIRS}) - if(FFMPEG_libavcodec_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavcodec_INCLUDE_DIRS}) - endif() - if(FFMPEG_libavdevice_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavdevice_INCLUDE_DIRS}) - endif() - if(FFMPEG_libavformat_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS}) - endif() - if(FFMPEG_libswscale_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libswscale_INCLUDE_DIRS}) - endif() +FFMPEG_FIND(libswresample swresample swresample.h) +FFMPEG_FIND(libswscale swscale swscale.h) + +if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS}) list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) - if(FFMPEG_libavcodec_FOUND) - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavdevice_FOUND) - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavfilter_FOUND) - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libavformat_FOUND) - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() + set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") if(FFMPEG_libavresample_FOUND) set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") endif() set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - if(FFMPEG_libswresample_FOUND) - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - if(FFMPEG_libswscale_FOUND) - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() + set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") list(APPEND FFMPEG_LIBRARIES ${FFMPEG_libavdevice_LIBRARY} @@ -202,7 +160,7 @@ if (FFMPEG_libavutil_FOUND AND FFMPEG_libzlib_FOUND) ${FFMPEG_libavcodec_LIBRARY} ${FFMPEG_libswresample_LIBRARY} ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} + ${FFMPEG_libavutil_LIBRARY} ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 86fd3e5d9880b1..14eb4ae100299b 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -127,58 +127,8 @@ else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() -set(ENABLE_AVRESAMPLE OFF) if("avresample" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-avresample") - set(ENABLE_AVRESAMPLE ON) #necessary for configuring FFMPEG CMake Module -endif() - -if("avcodec" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avcodec") - set(ENABLE_AVCODEC ON) -else() - set(OPTIONS "${OPTIONS} --disable-avcodec") - set(ENABLE_AVCODEC OFF) -endif() - -if("avdevice" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avdevice") - set(ENABLE_AVDEVICE ON) -else() - set(OPTIONS "${OPTIONS} --disable-avdevice") - set(ENABLE_AVDEVICE OFF) -endif() - -if("avformat" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avformat") - set(ENABLE_AVFORMAT ON) -else() - set(OPTIONS "${OPTIONS} --disable-avformat") - set(ENABLE_AVFORMAT OFF) -endif() - -if("avfilter" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avfilter") - set(ENABLE_AVFILTER ON) -else() - set(OPTIONS "${OPTIONS} --disable-avfilter") - set(ENABLE_AVFILTER OFF) -endif() - -if("swresample" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-swresample") - set(ENABLE_SWRESAMPLE ON) -else() - set(OPTIONS "${OPTIONS} --disable-swresample") - set(ENABLE_SWRESAMPLE OFF) -endif() - -if("swscale" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-swscale") - set(ENABLE_SWSCALE ON) -else() - set(OPTIONS "${OPTIONS} --disable-swscale") - set(ENABLE_SWSCALE OFF) endif() if (VCPKG_TARGET_IS_OSX) diff --git a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake index 8e2dd44d008eb1..322387565d03e8 100644 --- a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake +++ b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT FFMPEG_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH}) diff --git a/ports/field3d/0001_fix_build_errors.patch b/ports/field3d/0001_fix_build_errors.patch deleted file mode 100644 index 95149e39d893fd..00000000000000 --- a/ports/field3d/0001_fix_build_errors.patch +++ /dev/null @@ -1,148 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1610c2e..b012008 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -31,25 +31,17 @@ - - # Author : Nicholas Yue yue.nicholas@gmail.com - --CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) -+CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) - - PROJECT ( field3d ) - - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) - - FIND_PACKAGE (Doxygen) --FIND_PACKAGE (HDF5 COMPONENTS C) --IF ( CMAKE_HOST_WIN32 ) --# f3dinfo relies on program_options but don't include it, since --# for some reason, unlike all the other boost components, a link is --# forced via a pragma. --FIND_PACKAGE (Boost COMPONENTS regex thread) --ELSE () --FIND_PACKAGE (Boost COMPONENTS regex thread program_options system) --FIND_PACKAGE (MPI) --ENDIF () -+FIND_PACKAGE (HDF5 COMPONENTS C REQUIRED) -+FIND_PACKAGE (Boost COMPONENTS regex thread program_options system REQUIRED) - --FIND_PACKAGE (ILMBase) -+FIND_PACKAGE (OpenEXR REQUIRED) - - # Allow the developer to select if Dynamic or Static libraries are built - OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) -@@ -79,26 +71,14 @@ IF ( CMAKE_HOST_UNIX ) - ENDIF ( ) - IF ( CMAKE_HOST_WIN32 ) - ADD_DEFINITIONS ( -- -D_HAS_ITERATOR_DEBUGGING=0 - -D_CRT_SECURE_NO_WARNINGS=1 - ) - ENDIF ( ) - - SET ( LIB_TYPE SHARED ) - IF ( NOT BUILD_SHARED_LIBS ) -- IF ( CMAKE_HOST_WIN32 ) -- # User wants to build static libraries, so change the LIB_TYPE variable to CMake keyword 'STATIC' - SET ( LIB_TYPE STATIC ) - ADD_DEFINITIONS( -DFIELD3D_STATIC ) -- ENDIF() --ELSE () -- IF ( CMAKE_HOST_WIN32 ) -- ADD_DEFINITIONS ( -- -DOPENEXR_DLL -- -D_HDF5USEDLL_ -- -DHDF5CPP_USEDLL -- ) -- ENDIF() - ENDIF ( NOT BUILD_SHARED_LIBS ) - - ADD_LIBRARY ( Field3D ${LIB_TYPE} -@@ -147,24 +128,22 @@ IF ( CMAKE_HOST_UNIX ) - ${MPI_LIBRARIES} ) - ENDIF ( MPI_FOUND ) - LIST ( APPEND Field3D_Libraries_Shared -- Iex Half IlmThread Imath - pthread dl z ) - SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) - SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} - ${Boost_LIBRARIES} ) - ENDIF ( ) - IF ( CMAKE_HOST_WIN32 ) -- # Add OpenEXR and zlib release/debug -- FOREACH ( lib Iex Half IlmThread Imath zdll ) -+ FOREACH ( lib zlib ) - LIST ( APPEND Field3D_Libraries_Shared - optimized ${lib} -- debug ${lib}_d ) -+ debug ${lib}d ) - ENDFOREACH() - SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} Shlwapi.lib) - SET ( Field3D_BIN_Libraries Field3D ${Boost_LIBRARIES} ) - ENDIF () - --TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES}) -+TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES} OpenEXR::IlmImf) - - # Parase version and soversion from export/ns.h - -@@ -214,33 +193,7 @@ ADD_EXECUTABLE ( f3dinfo - - TARGET_LINK_LIBRARIES ( f3dinfo ${Field3D_BIN_Libraries} ) - --# field3d - sparse_field_io --ADD_EXECUTABLE ( sparse_field_io -- apps/sample_code/sparse_field_io/main.cpp -- ) -- --TARGET_LINK_LIBRARIES ( sparse_field_io ${Field3D_BIN_Libraries} ) -- --# field3d - read --ADD_EXECUTABLE ( read -- apps/sample_code/read/main.cpp -- ) - --TARGET_LINK_LIBRARIES ( read ${Field3D_BIN_Libraries} ) -- --# field3d - mixed_types --ADD_EXECUTABLE ( mixed_types -- apps/sample_code/mixed_types/main.cpp -- ) -- --TARGET_LINK_LIBRARIES ( mixed_types ${Field3D_BIN_Libraries} ) -- --# field3d - create_and_write --ADD_EXECUTABLE ( create_and_write -- apps/sample_code/create_and_write/main.cpp -- ) -- --TARGET_LINK_LIBRARIES ( create_and_write ${Field3D_BIN_Libraries} ) - - IF (DOXYGEN_FOUND) - ADD_CUSTOM_TARGET ( doc -@@ -249,7 +202,7 @@ IF (DOXYGEN_FOUND) - WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} - ) - IF (INSTALL_DOCS) -- INSTALL (DIRECTORY -+ INSTALL (DIRECTORY - ${CMAKE_HOME_DIRECTORY}/docs - DESTINATION ${CMAKE_INSTALL_PREFIX} - ) -@@ -263,12 +216,11 @@ INSTALL ( TARGETS - - FILE(GLOB Field3d_Includes "${CMAKE_CURRENT_SOURCE_DIR}/export/*.h") - --INSTALL ( FILES -- ${Field3d_Includes} -+INSTALL ( FILES -+ ${Field3d_Includes} - DESTINATION include/Field3D - ) - --INSTALL ( TARGETS f3dinfo -+INSTALL ( TARGETS f3dinfo - RUNTIME DESTINATION bin - ) -- diff --git a/ports/field3d/0002_improve_win_compatibility.patch b/ports/field3d/0002_improve_win_compatibility.patch deleted file mode 100644 index 08167be692f4c0..00000000000000 --- a/ports/field3d/0002_improve_win_compatibility.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/include/UtilFoundation.h b/include/UtilFoundation.h -index 2eb6290..a449b5b 100644 ---- a/include/UtilFoundation.h -+++ b/include/UtilFoundation.h -@@ -90,6 +90,9 @@ - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif -+#ifndef NOMINMAX -+#define NOMINMAX -+#endif - - // needed for mutex stuff - #include -diff --git a/src/FieldMapping.cpp b/src/FieldMapping.cpp -index b1f1a1f..90612b1 100644 ---- a/src/FieldMapping.cpp -+++ b/src/FieldMapping.cpp -@@ -49,9 +49,6 @@ - #include "FieldMapping.h" - #include "Types.h" - --#ifdef WIN32 --#define isnan(__x__) _isnan(__x__) --#endif - - //----------------------------------------------------------------------------// - -diff --git a/src/Log.cpp b/src/Log.cpp -index f78229c..d095a50 100644 ---- a/src/Log.cpp -+++ b/src/Log.cpp -@@ -40,8 +40,9 @@ - */ - - //----------------------------------------------------------------------------// -- -+#ifndef _WIN32 - #include -+#endif - #include - #include - diff --git a/ports/field3d/0003_hdf5_api.patch b/ports/field3d/0003_hdf5_api.patch deleted file mode 100644 index 183a49c9e6e071..00000000000000 --- a/ports/field3d/0003_hdf5_api.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b57057f..e809880 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -35,6 +35,7 @@ CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) - - PROJECT ( field3d ) - -+add_definitions(-DH5_USE_110_API) - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) - - FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/CONTROL b/ports/field3d/CONTROL index d16bd4cb4839de..965ad7477fe62c 100644 --- a/ports/field3d/CONTROL +++ b/ports/field3d/CONTROL @@ -1,7 +1,6 @@ Source: field3d Version: 1.7.3 -Port-Version: 1 Homepage: https://github.com/imageworks/Field3D Description: An open source library for storing voxel data. It provides C++ classes that handle in-memory storage and a file format based on HDF5 that allows the C++ objects to be written to and read from disk. -Build-Depends: hdf5, boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format -Supports: !(uwp) +Build-Depends: hdf5[core], boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format +Supports: !(windows|arm|uwp) \ No newline at end of file diff --git a/ports/field3d/fix-build_error.patch b/ports/field3d/fix-build_error.patch new file mode 100644 index 00000000000000..e2f44c093e5c5a --- /dev/null +++ b/ports/field3d/fix-build_error.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e9ad44f..45f3fad 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -147,7 +147,7 @@ IF ( CMAKE_HOST_UNIX ) + ${MPI_LIBRARIES} ) + ENDIF ( MPI_FOUND ) + LIST ( APPEND Field3D_Libraries_Shared +- Iex Half IlmThread Imath ++ Iex-2_3 Half-2_3 IlmThread-2_3 Imath-2_3 + pthread dl z ) + SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) + SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} diff --git a/ports/field3d/hdf5.api.patch b/ports/field3d/hdf5.api.patch new file mode 100644 index 00000000000000..21a08baebe419a --- /dev/null +++ b/ports/field3d/hdf5.api.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1e608b3ec..5ff2c3c31 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,7 +34,8 @@ + CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) + + PROJECT ( field3d ) +- ++add_definitions(-UH5_USE_112_API_DEFAULT) ++add_definitions(-DH5_USE_110_API_DEFAULT) + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) + + FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/portfile.cmake b/ports/field3d/portfile.cmake index a23e042494b94a..ccbfcd95a34c41 100644 --- a/ports/field3d/portfile.cmake +++ b/ports/field3d/portfile.cmake @@ -1,23 +1,21 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +if (TRIPLET_SYSTEM_ARCH MATCHES "arm") + message(FATAL_ERROR "ARM is currently not supported.") +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "Error: UWP builds are currently not supported.") endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO imageworks/Field3D - REF 0cf75ad982917e0919f59e5cb3d483517d06d7da - SHA512 e6f137013dd7b64b51b2ec3cc3ed8f4dbfadb85858946f08393653d78136cf8f93ae124716db11358e325c5e64ba04802afd4b89ca36ad65a14dd3db17f3072c + REF v1.7.3 + SHA512 de3f10ff120420925de67064b2169f2a30c9180e308acc9090d70567b45be5423f4b1f7eb32bb376c887cea1364803cf7b2db66c2bc49f8a39a1037bbf0e5f39 HEAD_REF master PATCHES - 0001_fix_build_errors.patch - 0002_improve_win_compatibility.patch - 0003_hdf5_api.patch # Switches the HDF5 default API for this port to 1.10 + fix-build_error.patch + hdf5.api.patch # Switches the HDF5 default API for this port to 1.10 ) -file(REMOVE ${SOURCE_PATH}/cmake/FindILMBase.cmake) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -32,4 +30,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +# Handle copyright +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") \ No newline at end of file diff --git a/ports/fizz/CONTROL b/ports/fizz/CONTROL index 152f53ad56d48f..9ad27acd8c1c66 100644 --- a/ports/fizz/CONTROL +++ b/ports/fizz/CONTROL @@ -1,5 +1,4 @@ Source: fizz -Version: 2020.02.03.00 -Port-Version: 1 +Version: 2020.02.03.00 Build-Depends: folly, openssl, libsodium, zlib, fmt Description: a TLS 1.3 implementation by Facebook \ No newline at end of file diff --git a/ports/fizz/fix-build_error.patch b/ports/fizz/fix-build_error.patch new file mode 100644 index 00000000000000..c6bafbb15e581f --- /dev/null +++ b/ports/fizz/fix-build_error.patch @@ -0,0 +1,13 @@ +diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt +index ccbbbb6..ee10c90 100644 +--- a/fizz/CMakeLists.txt ++++ b/fizz/CMakeLists.txt +@@ -86,7 +86,7 @@ if(TARGET event) + message(STATUS "Found libevent from package config") + list(APPEND FIZZ_SHINY_DEPENDENCIES event) + else() +- find_package(Libevent MODULE REQUIRED) ++ find_package(Libevent CONFIG REQUIRED) + list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB}) + list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) + endif() diff --git a/ports/fizz/portfile.cmake b/ports/fizz/portfile.cmake index 869dfcd2e57e94..1dc4fa30c2d080 100644 --- a/ports/fizz/portfile.cmake +++ b/ports/fizz/portfile.cmake @@ -3,16 +3,18 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebookincubator/fizz - REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 + REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 SHA512 7db706ffdd79f6d753c5530eb67646747d1e7b8b380387f34bd1fc7a06b289a68a6bb4c13faa74e108d4dede72bb2d993d7ad8f60fabcfb3b48abbf4326291c2 HEAD_REF master PATCHES find-zlib.patch + fix-build_error.patch ) # Prefer installed config files file(REMOVE ${SOURCE_PATH}/fizz/cmake/FindGflags.cmake + ${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake ${SOURCE_PATH}/fizz/cmake/FindGlog.cmake ) diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL index c6db1c1bbdcbb7..c9d660cee9f7bc 100644 --- a/ports/fltk/CONTROL +++ b/ports/fltk/CONTROL @@ -1,6 +1,5 @@ Source: fltk -Version: 1.3.5 -Port-Version: 3 +Version: 1.3.5-2 Homepage: https://www.fltk.org/ Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. Build-Depends: zlib, libpng, libjpeg-turbo diff --git a/ports/fltk/config-path.patch b/ports/fltk/config-path.patch deleted file mode 100644 index b308f750f50655..00000000000000 --- a/ports/fltk/config-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMake/setup.cmake b/CMake/setup.cmake -index 4d960a5..194887d 100644 ---- a/CMake/setup.cmake -+++ b/CMake/setup.cmake -@@ -88,6 +88,8 @@ else() - set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk) - endif(WIN32 AND NOT CYGWIN) - -+set(FLTK_CONFIG_PATH share/fltk) -+ - include(TestBigEndian) - TEST_BIG_ENDIAN(WORDS_BIGENDIAN) - diff --git a/ports/fltk/include.patch b/ports/fltk/include.patch deleted file mode 100644 index 27207fdbd7ed24..00000000000000 --- a/ports/fltk/include.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMake/macros.cmake b/CMake/macros.cmake -index ca03371..bde2c7e 100644 ---- a/CMake/macros.cmake -+++ b/CMake/macros.cmake -@@ -36,6 +36,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) - - add_library(${LIBRARY_NAME} ${LIBTYPE} ${LIBFILES}) - -+ target_include_directories(${LIBRARY_NAME} PUBLIC $) -+ - set_target_properties(${LIBRARY_NAME} - PROPERTIES - OUTPUT_NAME ${LIBRARY_NAME} diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index 1721c9072ba26c..905b140bbb15be 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -4,19 +4,20 @@ vcpkg_download_distfile(ARCHIVE SHA512 db7ea7c5f3489195a48216037b9371a50f1119ae7692d66f71b6711e5ccf78814670581bae015e408dee15c4bba921728309372c1cffc90113cdc092e8540821 ) -# FLTK has many improperly shared global variables that get duplicated into every DLL -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} PATCHES findlibsfix.patch add-link-libraries.patch - config-path.patch - include.patch ) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_SHARED ON) +else() + set(BUILD_SHARED OFF) +endif() + if (VCPKG_TARGET_ARCHITECTURE MATCHES "arm" OR VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") set(OPTION_USE_GL "-DOPTION_USE_GL=OFF") else() @@ -33,36 +34,55 @@ vcpkg_configure_cmake( -DOPTION_USE_SYSTEM_ZLIB=ON -DOPTION_USE_SYSTEM_LIBPNG=ON -DOPTION_USE_SYSTEM_LIBJPEG=ON - -DOPTION_BUILD_SHARED_LIBS=OFF - -DFLTK_CONFIG_PATH=share/fltk + -DOPTION_BUILD_SHARED_LIBS=${BUILD_SHARED} ${OPTION_USE_GL} ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/fltk) - -if(VCPKG_TARGET_IS_OSX) - vcpkg_copy_tools(TOOL_NAMES fluid.app fltk-config AUTO_CLEAN) -elseif(VCPKG_TARGET_IS_WINDOWS) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) - vcpkg_copy_tools(TOOL_NAMES fluid AUTO_CLEAN) -else() - vcpkg_copy_tools(TOOL_NAMES fluid fltk-config AUTO_CLEAN) +if (VCPKG_TARGET_IS_LINUX) + vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT} TARGET_PATH share/${PORT}) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid) +elseif (VCPKG_TARGET_IS_OSX) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.app DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.app) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.app) +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) + file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.exe) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.exe) endif() +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) + vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/fltk) + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin ) +else() + file(GLOB SHARED_LIBS "${CURRENT_PACKAGES_DIR}/lib/*_SHARED.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*_SHAREDd.lib") + file(GLOB STATIC_LIBS "${CURRENT_PACKAGES_DIR}/lib/*.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*.lib") + list(FILTER STATIC_LIBS EXCLUDE REGEX "_SHAREDd?\\.lib\$") + file(REMOVE ${STATIC_LIBS}) + foreach(SHARED_LIB ${SHARED_LIBS}) + string(REGEX REPLACE "_SHARED(d?)\\.lib\$" "\\1.lib" NEWNAME ${SHARED_LIB}) + file(RENAME ${SHARED_LIB} ${NEWNAME}) + endforeach() endif() -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share -) foreach(FILE Fl_Export.H fl_utf8.h) file(READ ${CURRENT_PACKAGES_DIR}/include/FL/${FILE} FLTK_HEADER) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index 8a5c423eb729ad..ce04fe4371a0b8 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,4 +1,4 @@ Source: fmt -Version: 7.0.3 +Version: 6.2.1 Homepage: https://github.com/fmtlib/fmt Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index f6126cd2634ce4..c44da534a6654c 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fmtlib/fmt - REF cd4af11efc9c622896a3e4cb599fa28668ca3d05#version 7.0.3 - SHA512 24b42288be97849533dc82282fc08833d74642ad2afeb511e65c6389d88c709cf25345dec5b550c18af3705f4c0847fa0d4066308b51cd41ccfdda1a2c3babd0 + REF 19bd751020a1f3c3363b2eb67a039852f139a8d3#version 6.2.1 + SHA512 5d03445c64c3b7973bdf4e445238c63fa41bf0fa8c2d5b32cd56f0a6b3036b039d9c303a06300f3af87795a07f80f2ed28b90ddbf9c3f7398796d77906c21f40 HEAD_REF master PATCHES fix-warning4189.patch ) @@ -33,10 +33,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() endif() - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h - "defined(FMT_SHARED)" - "1" - ) + # Force FMT_SHARED to 1 + file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/core.h FMT_CORE_H) + string(REPLACE "defined(FMT_SHARED)" "1" FMT_CORE_H "${FMT_CORE_H}") + file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/core.h "${FMT_CORE_H}") endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -45,16 +45,14 @@ vcpkg_fixup_pkgconfig() if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake - "lib/fmtd.dll" - "bin/fmtd.dll" - ) + file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) + string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake - "lib/fmt.dll" - "bin/fmt.dll" - ) + file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) + string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") endif() endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/freeimage/CMakeLists.txt b/ports/freeimage/CMakeLists.txt index 2e73e9b26709d7..f8fd969297db71 100644 --- a/ports/freeimage/CMakeLists.txt +++ b/ports/freeimage/CMakeLists.txt @@ -9,6 +9,10 @@ if(MSVC) set(CMAKE_CXX_FLAGS "/wd4828 ${CMAKE_CXX_FLAGS}") endif() +if(BUILD_SHARED_LIBS) + add_definitions("-DOPENEXR_DLL") +endif() + find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) @@ -96,6 +100,7 @@ target_include_directories(FreeImage PRIVATE ${REAL_SOURCE_DIR} ${WEBP_INCLUDE_DIRS} ${JXR_INCLUDE_DIRS} ${LibRaw_INCLUDE_DIRS} + ${OpenEXR_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) @@ -107,7 +112,7 @@ target_link_libraries(FreeImage ${ZLIB_LIBRARIES} ${WEBP_LIBRARIES} ${JXR_LIBRARIES} ${LibRaw_LIBRARIES} - OpenEXR::IlmImf) + ${OpenEXR_LIBRARIES}) target_compile_definitions(FreeImage PRIVATE ${PNG_DEFINITIONS}) diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL index 643c7b39877548..36829adc7a51bf 100644 --- a/ports/freeimage/CONTROL +++ b/ports/freeimage/CONTROL @@ -1,6 +1,5 @@ Source: freeimage -Version: 3.18.0 -Port-Version: 13 +Version: 3.18.0-12 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr Homepage: https://sourceforge.net/projects/freeimage/ Description: Support library for graphics image formats diff --git a/ports/freetype-gl/CONTROL b/ports/freetype-gl/CONTROL index a4081715e36f10..5419d6596b336c 100644 --- a/ports/freetype-gl/CONTROL +++ b/ports/freetype-gl/CONTROL @@ -1,6 +1,5 @@ Source: freetype-gl -Version: 2019-03-29 -Port-Version: 4 +Version: 2019-03-29-3 Homepage: https://github.com/rougier/freetype-gl Description: OpenGL text using one vertex buffer, one texture and FreeType Build-Depends: glew, freetype diff --git a/ports/freetype-gl/glew.patch b/ports/freetype-gl/glew.patch deleted file mode 100644 index 01b7f616d9c940..00000000000000 --- a/ports/freetype-gl/glew.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1c2e89fba..9e2d112c4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -92,7 +92,7 @@ include_directories( - ${OPENGL_INCLUDE_DIRS} - ${FREETYPE_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} -- ${GLEW_INCLUDE_PATH} -+ ${GLEW_INCLUDE_DIRS} - ) - - if(MSVC) diff --git a/ports/freetype-gl/portfile.cmake b/ports/freetype-gl/portfile.cmake index 9dfd38719ae7b6..5d931ced5d3b63 100644 --- a/ports/freetype-gl/portfile.cmake +++ b/ports/freetype-gl/portfile.cmake @@ -6,7 +6,6 @@ vcpkg_from_github( REF a91a3dda326ceaf66b7279bf64ba07014d3f81b8 SHA512 8e04573dfb400e14e2c1d3a2cd851a66f8218ccfdaa4f701ed9369d7f040d7028582e72af9b236af42d9d3c6c128014670e8ae0261c6f4770affd1aea1454b1e HEAD_REF master - PATCHES glew.patch ) # make sure that no "internal" libraries are used by removing them diff --git a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch b/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch new file mode 100644 index 00000000000000..1120cd096319cb --- /dev/null +++ b/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c00902521..b24508654 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -176,6 +176,8 @@ option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) + option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF) + option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF) + ++# vcpkg config install path ++option(CONFIG_INSTALL_PATH "location to install cmake config files" lib/cmake/freetype) + + # Disallow in-source builds + if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") +@@ -559,7 +561,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + COMPONENT libraries) + install( + EXPORT freetype-targets +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype ++ DESTINATION ${CONFIG_INSTALL_PATH} + FILE freetype-config.cmake + COMPONENT headers) + endif () diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index dcec495d7b07c6..7ba2032bf3107f 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,7 +1,7 @@ Source: freetype Version: 2.10.2 -Port-Version: 2 -Build-Depends: zlib, brotli +Port-Version: 1 +Build-Depends: zlib Homepage: https://www.freetype.org/ Description: A library to render fonts. Default-Features: bzip2, png diff --git a/ports/freetype/brotli-static.patch b/ports/freetype/brotli-static.patch deleted file mode 100644 index 0e15648920ab7f..00000000000000 --- a/ports/freetype/brotli-static.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake -index 7c484c7df..0bd49b825 100644 ---- a/builds/cmake/FindBrotliDec.cmake -+++ b/builds/cmake/FindBrotliDec.cmake -@@ -34,14 +34,14 @@ find_path(BROTLIDEC_INCLUDE_DIRS - PATH_SUFFIXES brotli) - - find_library(BROTLIDEC_LIBRARIES -- NAMES brotlidec -+ NAMES brotlidec brotlidec-static - HINTS ${PC_BROTLIDEC_LIBDIR} - ${PC_BROTLIDEC_LIBRARY_DIRS}) - - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args( -- brotlidec -+ BrotliDec - REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES - FOUND_VAR BROTLIDEC_FOUND - VERSION_VAR BROTLIDEC_VERSION) diff --git a/ports/freetype/pkgconfig.patch b/ports/freetype/pkgconfig.patch deleted file mode 100644 index 615434a34bbc6e..00000000000000 --- a/ports/freetype/pkgconfig.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 65839ac58..54f2ce8ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -517,7 +517,6 @@ endif () - - if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - # Generate the pkg-config file -- if (UNIX) - file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN) - - string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}") -@@ -551,7 +550,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - FILES ${PROJECT_BINARY_DIR}/freetype2.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - COMPONENT pkgconfig) -- endif () - - install( - TARGETS freetype diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index f62f34728ffc9a..eddc993da16511 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,9 +11,8 @@ vcpkg_extract_source_archive_ex( REF ${FT_VERSION} PATCHES 0001-Fix-install-command.patch + 0002-Add-CONFIG_INSTALL_PATH-option.patch 0003-Fix-UWP.patch - pkgconfig.patch - brotli-static.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -29,46 +28,41 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DCONFIG_INSTALL_PATH=share/freetype -DFT_WITH_ZLIB=ON # Force system zlib. - -DFT_WITH_BROTLI=ON - -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON ${FEATURE_OPTIONS} + -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype) -# Rename for easy usage (VS integration; CMake and autotools will not care) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Fix the include dir [freetype2 -> freetype] -file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) -string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include" CONFIG_MODULE "${CONFIG_MODULE}") -string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec-static.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") -string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") -string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config-debug.cmake DEBUG_MODULE) + string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" DEBUG_MODULE "${DEBUG_MODULE}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-debug.cmake "${DEBUG_MODULE}") +endif() -find_library(FREETYPE_DEBUG NAMES freetyped PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/" NO_DEFAULT_PATH) -if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc") - file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents) - if(FREETYPE_DEBUG) - string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}") - endif() - string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") - file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}") +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake RELEASE_MODULE) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" RELEASE_MODULE "${RELEASE_MODULE}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake "${RELEASE_MODULE}") endif() -if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc") - file(READ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" _contents) - string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") - file(WRITE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" "${_contents}") + +# Fix the include dir [freetype2 -> freetype] +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config.cmake CONFIG_MODULE) +else() #if(VCPKG_BUILD_TYPE STREQUAL "release") + file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) endif() -vcpkg_fixup_pkgconfig() +string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY diff --git a/ports/freetype/vcpkg-cmake-wrapper.cmake b/ports/freetype/vcpkg-cmake-wrapper.cmake index 355ddbcf575eeb..01da0b1dc271fb 100644 --- a/ports/freetype/vcpkg-cmake-wrapper.cmake +++ b/ports/freetype/vcpkg-cmake-wrapper.cmake @@ -10,14 +10,6 @@ if(@USE_PNG@) find_package(PNG) endif() -find_library(BROTLIDEC_LIBRARY_RELEASE NAMES brotlidec brotlidec-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) -find_library(BROTLIDEC_LIBRARY_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) -find_library(BROTLICOMMON_LIBRARY_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) -find_library(BROTLICOMMON_LIBRARY_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) -include(SelectLibraryConfigurations) -select_library_configurations(BROTLIDEC) -select_library_configurations(BROTLICOMMON) - if(TARGET Freetype::Freetype) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) @@ -28,7 +20,6 @@ if(TARGET Freetype::Freetype) if(@USE_PNG@) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES PNG::PNG) endif() - target_link_libraries(Freetype::Freetype INTERFACE ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() if(FREETYPE_LIBRARIES) @@ -41,6 +32,4 @@ if(FREETYPE_LIBRARIES) if(@USE_PNG@) list(APPEND FREETYPE_LIBRARIES ${PNG_LIBRARIES}) endif() - - list(APPEND FREETYPE_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() diff --git a/ports/freexl/CONTROL b/ports/freexl/CONTROL index 1a887b1932ad42..68d0d291fc6b88 100644 --- a/ports/freexl/CONTROL +++ b/ports/freexl/CONTROL @@ -1,6 +1,5 @@ Source: freexl -Version: 1.0.4 -Port-Version: 10 +Version: 1.0.4-9 Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet Build-Depends: libiconv diff --git a/ports/freexl/portfile.cmake b/ports/freexl/portfile.cmake index 6a79451dd77d95..3c4629dce5137f 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -64,7 +64,6 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX ) file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS_DEBUG INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" diff --git a/ports/fribidi/CONTROL b/ports/fribidi/CONTROL index 570fd13621e5b2..edfb9c77707406 100644 --- a/ports/fribidi/CONTROL +++ b/ports/fribidi/CONTROL @@ -1,4 +1,4 @@ Source: fribidi -Version: 1.0.10 +Version: 1.0.9-1 Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) Build-Depends: tool-meson diff --git a/ports/fribidi/fix-win-static-suffix.patch b/ports/fribidi/fix-win-static-suffix.patch index 953b1b91be7d19..87f288e939641a 100644 --- a/ports/fribidi/fix-win-static-suffix.patch +++ b/ports/fribidi/fix-win-static-suffix.patch @@ -1,25 +1,39 @@ diff --git a/lib/meson.build b/lib/meson.build -index aaf2aed..3fe8937 100644 +index 573d47f..c9b249e 100644 --- a/lib/meson.build +++ b/lib/meson.build -@@ -71,6 +71,10 @@ fribidi_sources = [ +@@ -71,14 +71,26 @@ fribidi_sources = [ 'fribidi-shape.c', ] -+libsuffix = [] +-libfribidi = library('fribidi', +- fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, +- generated_tab_include_files, config_h, +- include_directories: incs, +- c_args: ['-DHAVE_CONFIG_H'] + visibility_args, +- version: libversion, +- soversion: soversion, +- install: true) +if host_machine.system() == 'windows' and get_option('default_library') == 'static' -+ libsuffix = 'lib' ++ libfribidi = library('fribidi', ++ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, ++ generated_tab_include_files, config_h, ++ include_directories: incs, ++ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, ++ version: libversion, ++ soversion: soversion, ++ install: true, ++ name_suffix: 'lib') ++else ++ libfribidi = library('fribidi', ++ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, ++ generated_tab_include_files, config_h, ++ include_directories: incs, ++ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, ++ version: libversion, ++ soversion: soversion, ++ install: true) +endif - libfribidi = library('fribidi', - fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, - generated_tab_include_files, config_h, -@@ -78,7 +82,8 @@ libfribidi = library('fribidi', - c_args: ['-DHAVE_CONFIG_H', '-DFRIBIDI_BUILD'] + fribidi_static_cargs + visibility_args, - version: libversion, - soversion: soversion, -- install: true) -+ install: true, -+ name_suffix: libsuffix) libfribidi_dep = declare_dependency(link_with: libfribidi, include_directories: incs, diff --git a/ports/fribidi/portfile.cmake b/ports/fribidi/portfile.cmake index 740502bdd8c88d..342b4d3c5786c6 100644 --- a/ports/fribidi/portfile.cmake +++ b/ports/fribidi/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fribidi/fribidi - REF 5464c284034da9c058269377b7f5013bb089f553 # v1.0.10 - SHA512 82e42b022f23d6ecebac5071f997c9f46db6aa41c36f87a7f1a28a79b4ccaada10d68b233bbf687c552fc94d91f4b47161e0ef4909fd1de0b483089f1d1377f9 + REF abea9f626732a9b10499d76c1cd69ce5457950cc # v1.0.9 + SHA512 5cb28f9e35d0df205c9fb88a56776d371fdd8bca12c211cec282334cfbf12a05e3324cd14a3ae71bcc06e15ce07b06cbe97eaafe1c7368e517a4ce5a4c3a2bcc HEAD_REF master PATCHES fix-win-static-suffix.patch ) @@ -11,22 +11,23 @@ vcpkg_configure_meson( SOURCE_PATH ${SOURCE_PATH} OPTIONS -Ddocs=false - -Dbin=false - -Dtests=false --backend=ninja ) vcpkg_install_meson() vcpkg_copy_pdbs() -# Define static macro -file(READ ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h FRIBIDI_COMMON_H) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 0" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") -else() - string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 1" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") +file(GLOB EXE_FILES + "${CURRENT_PACKAGES_DIR}/bin/*.exe" + "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe" +) +if (EXE_FILES) + file(REMOVE ${EXE_FILES}) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h "${FRIBIDI_COMMON_H}") # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/g2o/CONTROL b/ports/g2o/CONTROL index 5234914a2de257..80b321d5bd7e15 100644 --- a/ports/g2o/CONTROL +++ b/ports/g2o/CONTROL @@ -1,6 +1,5 @@ Source: g2o Version: 2020-02-07 -Port-Version: 1 -Build-Depends: suitesparse, eigen3, lapack, ceres +Build-Depends: suitesparse, eigen3, clapack (!osx), ceres Description: g2o: A General Framework for Graph Optimization Homepage: https://openslam.org/g2o.html diff --git a/ports/gamedev-framework/CONTROL b/ports/gamedev-framework/CONTROL deleted file mode 100644 index d152e8426fc981..00000000000000 --- a/ports/gamedev-framework/CONTROL +++ /dev/null @@ -1,7 +0,0 @@ -Source: gamedev-framework -Version: 0.17 -Port-Version: 1 -Homepage: https://github.com/GamedevFramework/gf -Description: gf is a framework to build 2D games in C++14. -Build-Depends: sdl2, freetype, zlib, boost-algorithm, boost-filesystem, boost-heap, boost-container, stb, pugixml -Supports: !arm diff --git a/ports/gamedev-framework/portfile.cmake b/ports/gamedev-framework/portfile.cmake deleted file mode 100644 index 511bf9c23f42e9..00000000000000 --- a/ports/gamedev-framework/portfile.cmake +++ /dev/null @@ -1,48 +0,0 @@ -vcpkg_fail_port_install( - ON_ARCH "arm" -) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO GamedevFramework/gf - HEAD_REF master - REF v0.17.4 - SHA512 b35e0fef3c9dc397ec43132dcd6ca87f78217c55d72fc1117b1f530d568ad3537a0f682e285840471faa4e06eb7f396b784da767e83686519d0694b198a86379 -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DGF_VCPKG=ON - -DGF_USE_EMBEDDED_LIBS=OFF - -DGF_BUILD_GAMES=OFF - -DGF_BUILD_EXAMPLES=OFF - -DGF_BUILD_TESTS=OFF - -DGF_BUILD_DOCUMENTATION=OFF - -DGF_SINGLE_COMPILTATION_UNIT=ON - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - OPTIONS_RELEASE -DGF_DEBUG=OFF - OPTIONS_DEBUG -DGF_DEBUG=ON -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/gf TARGET_PATH share/gf) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/share/doc" - "${CURRENT_PACKAGES_DIR}/debug/bin/gf_info.exe" - "${CURRENT_PACKAGES_DIR}/bin/gf_info.exe" -) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/bin" - "${CURRENT_PACKAGES_DIR}/debug/bin" - ) -endif() - -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/geogram/CONTROL b/ports/geogram/CONTROL index 8661aa1e4f086b..4eb40eee04619b 100644 --- a/ports/geogram/CONTROL +++ b/ports/geogram/CONTROL @@ -1,8 +1,8 @@ Source: geogram -Version: 1.7.5 +Version: 1.6.9-7 Homepage: https://gforge.inria.fr/projects/geogram/ Description: Geogram is a programming library of geometric algorithms. -Build-Depends: openblas (!osx), lapack +Build-Depends: openblas (!osx), clapack (!osx) Feature: graphics Description: Build viewers and geogram_gfx library. diff --git a/ports/geogram/fix-cmake-config-and-install.patch b/ports/geogram/fix-cmake-config-and-install.patch index 8eb16c364bec17..2c7790923f1426 100644 --- a/ports/geogram/fix-cmake-config-and-install.patch +++ b/ports/geogram/fix-cmake-config-and-install.patch @@ -1,9 +1,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2e54997..169e33c 100644 +index 17dc02e..e489d75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -51,7 +51,7 @@ set(VORPALINE_VERSION_MINOR 7) - set(VORPALINE_VERSION_PATCH 5) +@@ -42,7 +42,7 @@ set(VORPALINE_VERSION_MINOR 6) + set(VORPALINE_VERSION_PATCH 9) set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH}) -set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR}) @@ -11,7 +11,7 @@ index 2e54997..169e33c 100644 # Determine the current Build-OS (Build-platform without the compiler info) string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM}) -@@ -113,6 +113,11 @@ if(GEOGRAM_WITH_VORPALINE) +@@ -106,6 +106,11 @@ if(GEOGRAM_WITH_VORPALINE) add_subdirectory(src/lib/vorpalib) endif() @@ -23,7 +23,7 @@ index 2e54997..169e33c 100644 add_subdirectory(src/lib/third_party) if(GEOGRAM_WITH_GRAPHICS) -@@ -145,8 +150,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) +@@ -138,8 +143,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) # FindGeogram.cmake @@ -70,10 +70,10 @@ index 2e54997..169e33c 100644 # Configure CPack diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt -index 49cb2ba..82c2f39 100755 +index d90bc48..927f857 100644 --- a/src/lib/geogram/CMakeLists.txt +++ b/src/lib/geogram/CMakeLists.txt -@@ -62,7 +62,14 @@ if(WIN32) +@@ -47,7 +47,14 @@ if(WIN32) endif() # Install the library @@ -90,10 +90,10 @@ index 49cb2ba..82c2f39 100755 # Install include files for the standard devkit install( diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt -index b155975..ad66440 100755 +index f319b93..e24039d 100644 --- a/src/lib/geogram_gfx/CMakeLists.txt +++ b/src/lib/geogram_gfx/CMakeLists.txt -@@ -47,14 +47,21 @@ if(VORPALINE_BUILD_DYNAMIC) +@@ -33,14 +33,21 @@ if(VORPALINE_BUILD_DYNAMIC) endif() # Install the library @@ -117,7 +117,7 @@ index b155975..ad66440 100755 ) # Install include files for the full devkit -@@ -62,7 +69,7 @@ install( +@@ -48,7 +55,7 @@ install( DIRECTORY . DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx COMPONENT devkit-full @@ -127,7 +127,7 @@ index b155975..ad66440 100755 install( diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt -index c9c3a6e..f16d7ec 100644 +index 5789cd2..e4262e3 100644 --- a/src/lib/third_party/numerics/CMakeLists.txt +++ b/src/lib/third_party/numerics/CMakeLists.txt @@ -10,16 +10,19 @@ endif() @@ -154,7 +154,7 @@ index c9c3a6e..f16d7ec 100644 target_link_libraries(geogram_num_3rdparty m) endif() diff --git a/src/lib/third_party/numerics/LIBF2C/getarg_.c b/src/lib/third_party/numerics/LIBF2C/getarg_.c -index 2b69a1e..1cde8b6 100755 +index 2b69a1e..a504538 100644 --- a/src/lib/third_party/numerics/LIBF2C/getarg_.c +++ b/src/lib/third_party/numerics/LIBF2C/getarg_.c @@ -17,20 +17,20 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls; @@ -193,7 +193,7 @@ index 2b69a1e..1cde8b6 100755 } #endif diff --git a/src/lib/third_party/numerics/LIBF2C/iargc_.c b/src/lib/third_party/numerics/LIBF2C/iargc_.c -index 2f29da0..50b00de 100755 +index 2f29da0..50b00de 100644 --- a/src/lib/third_party/numerics/LIBF2C/iargc_.c +++ b/src/lib/third_party/numerics/LIBF2C/iargc_.c @@ -9,8 +9,9 @@ ftnint iargc_() diff --git a/ports/geogram/portfile.cmake b/ports/geogram/portfile.cmake index 9aee74e6f7172e..3bf583d51245f3 100644 --- a/ports/geogram/portfile.cmake +++ b/ports/geogram/portfile.cmake @@ -1,9 +1,11 @@ -set(GEOGRAM_VERSION 1.7.5) +include(vcpkg_common_functions) + +set(GEOGRAM_VERSION 1.6.9) vcpkg_download_distfile(ARCHIVE - URLS "https://gforge.inria.fr/frs/download.php/file/38314/geogram_${GEOGRAM_VERSION}.tar.gz" + URLS "https://gforge.inria.fr/frs/download.php/file/37779/geogram_${GEOGRAM_VERSION}.tar.gz" FILENAME "geogram_${GEOGRAM_VERSION}.tar.gz" - SHA512 47dcbb8a5c4e5f791feb8d9b209b04b575b0757e8b89de09c82ef2324a36d4056a1f3001537038c8a752045b0e6b6eedf5421ad49132214c0f60163ff095c36f + SHA512 1b5c7540bef734c1908f213f26780aba63b4911a8022d5eb3f7c90eabe2cb69efd1f298b30cdc8e2c636a5b37c8c25832dd4aad0b7c2ff5f0a5b5caa17970136 ) vcpkg_extract_source_archive_ex( @@ -16,36 +18,35 @@ vcpkg_extract_source_archive_ex( file(COPY ${CURRENT_PORT_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH}/cmake) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - "graphics" GEOGRAM_WITH_GRAPHICS -) +set(GEOGRAM_WITH_GRAPHICS OFF) +if("graphics" IN_LIST FEATURES) + set(GEOGRAM_WITH_GRAPHICS ON) +endif() if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(VORPALINE_BUILD_DYNAMIC FALSE) - if (VCPKG_TARGET_IS_WINDOWS) + if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_TARGET_IS_LINUX) + if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") message("geogram on Linux only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_TARGET_IS_OSX) + if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") message("geogram on Darwin only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() else() set(VORPALINE_BUILD_DYNAMIC TRUE) - if (VCPKG_TARGET_IS_WINDOWS) + if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_TARGET_IS_LINUX) + if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_TARGET_IS_OSX) + if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() endif() @@ -56,11 +57,11 @@ vcpkg_configure_cmake( #PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DVORPALINE_BUILD_DYNAMIC=${VORPALINE_BUILD_DYNAMIC} + -DGEOGRAM_WITH_GRAPHICS=${GEOGRAM_WITH_GRAPHICS} -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_USE_SYSTEM_GLFW3=ON -DVORPALINE_PLATFORM=${VORPALINE_PLATFORM} -DGEOGRAM_WITH_VORPALINE=OFF - ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -72,11 +73,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_replace_string( - ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake - [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] - [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] - ) +file(READ ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake TARGET_CONFIG) +string(REPLACE [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] + [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] TARGET_CONFIG "${TARGET_CONFIG}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake "${TARGET_CONFIG}") # Handle copyright -file(INSTALL ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/geogram) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/geogram/license.dox ${CURRENT_PACKAGES_DIR}/share/geogram/copyright) diff --git a/ports/geographiclib/vcpkg.json b/ports/geographiclib/vcpkg.json index 8ec469c9025971..a60a5e7db2e1dc 100644 --- a/ports/geographiclib/vcpkg.json +++ b/ports/geographiclib/vcpkg.json @@ -1,8 +1,8 @@ { "name": "geographiclib", "version-string": "1.50.1", - "description": "GeographicLib, a C++ library for performing geographic conversions", "homepage": "https://geographiclib.sourceforge.io", + "description": "GeographicLib, a C++ library for performing geographic conversions", "features": [ { "name": "tools", diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 6409f87e7f4ce9..9a7fd7e9c2324e 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,4 +1,4 @@ Source: glew -Version: 2.1.0-8 +Version: 2.1.0-7 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. Homepage: https://github.com/nigels-com/glew diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index de436818cddc67..504a91dcf4a976 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -26,7 +26,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glew) -if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) +if(VCPKG_TARGET_IS_WINDOWS) set(_targets_cmake_files) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake") diff --git a/ports/gmp/CONTROL b/ports/gmp/CONTROL new file mode 100644 index 00000000000000..3f42c9d2a06d8f --- /dev/null +++ b/ports/gmp/CONTROL @@ -0,0 +1,5 @@ +Source: gmp +Version: 6.2.0-1 +Homepage: https://gmplib.org/ +Description: The GNU Multiple Precision Arithmetic Library +Build-Depends: vs-yasm (windows) \ No newline at end of file diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index b8a289628dfc9f..ee4b51c087b56a 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -1,7 +1,3 @@ -if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") - message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.") -endif() - if(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -9,10 +5,9 @@ if(VCPKG_TARGET_IS_WINDOWS) REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 HEAD_REF master - PATCHES - vs.build.patch - runtime.patch - prefix.patch + PATCHES vs.build.patch + runtime.patch + prefix.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -107,4 +102,6 @@ else() # # Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -endif() \ No newline at end of file +endif() + + diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json deleted file mode 100644 index 77b237197aa826..00000000000000 --- a/ports/gmp/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "gmp", - "version-string": "6.2.0", - "port-version": 3, - "description": "The GNU Multiple Precision Arithmetic Library", - "homepage": "https://gmplib.org", - "dependencies": [ - { - "name": "vs-yasm", - "platform": "windows" - } - ] -} diff --git a/ports/google-cloud-cpp/CONTROL b/ports/google-cloud-cpp/CONTROL index 3591680d6a5d04..fa905504f67a85 100644 --- a/ports/google-cloud-cpp/CONTROL +++ b/ports/google-cloud-cpp/CONTROL @@ -1,5 +1,5 @@ Source: google-cloud-cpp -Version: 1.16.0 +Version: 1.15.0 Build-Depends: abseil, grpc, curl[ssl], crc32c Description: C++ Client Libraries for Google Cloud Platform APIs. Homepage: https://github.com/googleapis/google-cloud-cpp diff --git a/ports/google-cloud-cpp/portfile.cmake b/ports/google-cloud-cpp/portfile.cmake index 065fe3706ad1ed..836115f01d6529 100644 --- a/ports/google-cloud-cpp/portfile.cmake +++ b/ports/google-cloud-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp - REF v1.16.0 - SHA512 0e8b427d0131dfcb12d741ebd22e37e2a572ea10f3500d288c611f60f9ace8896ceb2a80213f741510d331c250bff59a38232bf967d3669c3310719ce6b0c05f + REF v1.15.0 + SHA512 193599a0ae64ee72a130417e7ce11b0e1c4af353b14124be6c781cde4f7478313460adfcf429a14195486c7d17be197410c37c2778265f08cfcba97af603b86c HEAD_REF master ) diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch deleted file mode 100644 index c2d1771131a87c..00000000000000 --- a/ports/grpc/00011-fix-csharp_plugin.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 77cf3de..8bceae6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1812,10 +1812,14 @@ endif() - - if(gRPC_BUILD_CSHARP_EXT) - --add_library(grpc_csharp_ext SHARED -+add_library(grpc_csharp_ext - src/csharp/ext/grpc_csharp_ext.c - ) - -+if (WIN32 AND BUILD_SHARED_LIBS) -+ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) -+endif() -+ - set_target_properties(grpc_csharp_ext PROPERTIES - VERSION ${gRPC_CORE_VERSION} - SOVERSION ${gRPC_CORE_SOVERSION} -@@ -1829,6 +1833,12 @@ if(WIN32 AND MSVC) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb - DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL - ) -+ -+ install(TARGETS grpc_csharp_ext -+ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ) - endif() - endif() - diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index f62df066c6d239..af06e82a490f4e 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,6 +1,5 @@ Source: grpc Version: 1.29.1 -Port-Version: 1 Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil Homepage: https://github.com/grpc/grpc Description: An RPC library and framework diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index cc8fe92bec68bb..57fba090bd15f7 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -16,7 +16,6 @@ vcpkg_from_github( 00005-fix-uwp-error.patch 00009-use-system-upb.patch 00010-add-feature-absl-sync.patch - 00011-fix-csharp_plugin.patch snprintf.patch ) diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL index ff4434872abc2b..e5901fca747107 100644 --- a/ports/gsoap/CONTROL +++ b/ports/gsoap/CONTROL @@ -1,6 +1,6 @@ Source: gsoap -Version: 2.8.105 +Version: 2.8.102-4 Build-Depends: curl Homepage: https://sourceforge.net/projects/gsoap2/ Description: The gSOAP toolkit is a C and C++ software development toolkit for SOAP and REST XML Web services and generic C/C++ XML data bindings. -Supports: !(linux|osx|arm|uwp) +Supports: (x86 | x64) & windows diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index 1a4e75adbb63dc..b759fb876cca5b 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -4,8 +4,8 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO gsoap2 REF gsoap-2.8 - FILENAME "gsoap_2.8.105.zip" - SHA512 3b7b66ef738e9ba78f0c9d5ec141faab102dc2ed7c528e84358d530ec8cb913c559438bb86ae0f22e0736c4cd9be9e74f364a44257189ccaa1e6d001317f99de + FILENAME "gsoap_2.8.102.zip" + SHA512 3cff65605b15f820c9d56e32575231fb6fb89927bafc1db85ac1f879acd8496d6f38b558e994d17cce475beae0976d5fafcff7f22b28cdfbec8b7ec4b08bcbe7 PATCHES fix-build-in-windows.patch ) @@ -43,9 +43,6 @@ file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOUR # Handle import files file(COPY ${SOURCE_PATH}/gsoap/import DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -# Handle custom files -file(COPY ${SOURCE_PATH}/gsoap/custom DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - # Handle plugin files file(COPY ${SOURCE_PATH}/gsoap/plugin DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/gtkmm/CONTROL b/ports/gtkmm/CONTROL index 71a648f1578a12..ecdab2cc3853dc 100644 --- a/ports/gtkmm/CONTROL +++ b/ports/gtkmm/CONTROL @@ -1,6 +1,5 @@ Source: gtkmm -Version: 3.22.2 -Port-Version: 4 +Version: 3.22.2-2 Homepage: https://www.gtkmm.org/ Description: gtkmm is the official C++ interface for the popular GUI library GTK+. Build-Depends: glib, atk, gtk, gdk-pixbuf, pango, cairo, libepoxy, gettext, glibmm, atkmm, cairomm, pangomm diff --git a/ports/gtkmm/fix_treeviewcolumn.patch b/ports/gtkmm/fix_treeviewcolumn.patch deleted file mode 100644 index 8daf91afbd00a9..00000000000000 --- a/ports/gtkmm/fix_treeviewcolumn.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/gtk/gtkmm/treeviewcolumn.h b/gtk/gtkmm/treeviewcolumn.h -index f2a77c1..c66302a 100644 ---- a/gtk/gtkmm/treeviewcolumn.h -+++ b/gtk/gtkmm/treeviewcolumn.h -@@ -1026,9 +1026,7 @@ void TreeViewColumn::pack_end(const TreeModelColumn& column, - template inline - TreeViewColumn::TreeViewColumn(const Glib::ustring& title, - const TreeModelColumn& column) --: -- Glib::ObjectBase(nullptr), // not (yet) a custom class -- Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), nullptr)) -+: TreeViewColumn (title) - { - pack_start(column, true /* expand */); - } diff --git a/ports/gtkmm/portfile.cmake b/ports/gtkmm/portfile.cmake index feedbf2886b706..23e939608dbe89 100644 --- a/ports/gtkmm/portfile.cmake +++ b/ports/gtkmm/portfile.cmake @@ -17,7 +17,6 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES fix_properties.patch - fix_treeviewcolumn.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/msvc_recommended_pragmas.h DESTINATION ${SOURCE_PATH}/MSVC_Net2013) diff --git a/ports/healpix/CONTROL b/ports/healpix/CONTROL index 8b1e856e2a947f..629b095ee45004 100644 --- a/ports/healpix/CONTROL +++ b/ports/healpix/CONTROL @@ -1,6 +1,5 @@ Source: healpix -Version: 1.12.10 -Port-Version: 6 +Version: 1.12.10-5 Homepage: http://healpix.sourceforge.net/ Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere. Build-Depends: cfitsio diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index c1fa90f368a628..8b1a401517b07b 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -10,7 +10,6 @@ vcpkg_from_sourceforge( ) vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx COPY_SOURCE diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index e52ae90a5a50e4..efde5f1b4c2357 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,4 +1,3 @@ Source: ignition-modularscripts Version: 2020-05-16 -Port-Version: 1 Description: Vcpkg helpers to package ignition libraries diff --git a/ports/ignition-modularscripts/ignition_modular_library.cmake b/ports/ignition-modularscripts/ignition_modular_library.cmake index b294c097b6fcf1..f7b772d5f06d13 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -38,10 +38,7 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PAC # Make pkg-config files relocatable if(NOT IML_DISABLE_PKGCONFIG_INSTALL) - if(VCPKG_TARGET_IS_LINUX) - set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) - endif() - vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) + vcpkg_fixup_pkgconfig() else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) diff --git a/ports/ignition-msgs5/CONTROL b/ports/ignition-msgs5/CONTROL index 690ded1b6a60f5..fd7b362df7bc48 100644 --- a/ports/ignition-msgs5/CONTROL +++ b/ports/ignition-msgs5/CONTROL @@ -1,6 +1,5 @@ Source: ignition-msgs5 Version: 5.1.0 -Port-Version: 1 Build-Depends: ignition-modularscripts, ignition-cmake2, ignition-math6, protobuf, tinyxml2 Description: Middleware protobuf messages for robotics Supports: !(arm|linux|uwp) \ No newline at end of file diff --git a/ports/ignition-msgs5/portfile.cmake b/ports/ignition-msgs5/portfile.cmake index aec3a6cd75c385..812a1bca73d394 100644 --- a/ports/ignition-msgs5/portfile.cmake +++ b/ports/ignition-msgs5/portfile.cmake @@ -17,4 +17,4 @@ ignition_modular_library(NAME msgs "01-protobuf.patch") # Restore old path -set(ENV{PATH} "${path_backup}") +set(ENV{PATH} ${path_backup}) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 795ce24a7c6b18..a4f3cf61148290 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -131,11 +131,9 @@ install( if(NOT IMGUI_SKIP_HEADERS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/imgui.h - ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_rectpack.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_truetype.h + ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h DESTINATION include ) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index e87894d5e29ac6..88fb1440cee253 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,6 +1,6 @@ Source: imgui Version: 1.77 -Port-Version: 3 +Port-Version: 1 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 7b8cf302614fa2..6ee33622b9c27b 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -10,10 +10,6 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -if(("metal-binding" IN_LIST FEATURES OR "osx-binding" IN_LIST FEATURES) AND (NOT VCPKG_TARGET_IS_OSX)) - message(FATAL_ERROR "Feature metal-binding and osx-binding are only supported on osx.") -endif() - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS allegro5-binding IMGUI_BUILD_ALLEGRO5_BINDING dx9-binding IMGUI_BUILD_DX9_BINDING diff --git a/ports/implot/CONTROL b/ports/implot/CONTROL index 0f6633b28ffd44..f887c457940c89 100644 --- a/ports/implot/CONTROL +++ b/ports/implot/CONTROL @@ -1,5 +1,5 @@ Source: implot -Version: 0.4 +Version: 0.3-1 Homepage: https://github.com/epezent/implot Description: Advanced 2D Plotting for Dear ImGui Build-Depends: imgui diff --git a/ports/implot/portfile.cmake b/ports/implot/portfile.cmake index b783f57ae595bd..d9b59d430ce45b 100644 --- a/ports/implot/portfile.cmake +++ b/ports/implot/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO epezent/implot - REF v0.4 - SHA512 ab54a97fcfcdc21c47d56e7e9ba1fbd05ae0f9e8f9bf0bd742e9daa6231931ac0c3a7cb0a1637b254df531b2611b27a301cc9f51d6caa950e20d05ab5fc31247 + REF v0.3 + SHA512 28d25a76b725879ad796249edc87910fec721fcd43b80171947e00c4983a945f82f2b555f1794882b79c96a4497da982dc45695fed5eedcf6009f87c05576817 HEAD_REF master ) diff --git a/ports/itk/CONTROL b/ports/itk/CONTROL index d316675cb33cf0..282ac4b3c6a647 100644 --- a/ports/itk/CONTROL +++ b/ports/itk/CONTROL @@ -1,37 +1,9 @@ Source: itk -Version: 5.1.0 +Version: 5.0.1-2 Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis. Homepage: https://github.com/InsightSoftwareConsortium/ITK -Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc +Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[cpp], openjpeg Feature: vtk Description: Build ITKVtkGlue module. -Build-Depends: vtk[core] - -Feature: python -Description: Python functionality for ITK -Build-Depends: python3 - -Feature: opencl -Description: Use OpenCL -Build-Depends: opencl - -Feature: cufftw -Description: Use CUDA FFTW -Build-Depends: cuda - -Feature: cuda -Description: Build CUDA module -Build-Depends: cuda, itk[core, opencl] - -Feature: tbb -Description: Build TBB Module -Build-Depends: tbb - -Feature: rtk -Description: Build RTK Module - -Feature: tools -Description: Build RTK with tools -Build-Depends: itk[core, rtk] - +Build-Depends: vtk diff --git a/ports/itk/cufftw.patch b/ports/itk/cufftw.patch deleted file mode 100644 index 17365fb2f1f0e3..00000000000000 --- a/ports/itk/cufftw.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0f47aae05217884193a39690c2beef566f4ed3b1 Mon Sep 17 00:00:00 2001 -From: Stephen Aylward -Date: Sat, 25 Apr 2020 20:15:21 -0400 -Subject: [PATCH] BUG: CUFFTW paths were not being set and unnecessary FFTW - files used - -FindFFTW sets the FFTW_INCLUDES variable. The FFTW_INCLUDE_PATH var is -specific to FFTW (not used by CUFFTW). - -FFTWGlobalConfiguration file is only needed if FFTW is being used, -not if CUFFT is being used. ---- - CMake/FindFFTW.cmake | 2 +- - Modules/Filtering/FFT/CMakeLists.txt | 2 +- - Modules/Filtering/FFT/src/CMakeLists.txt | 9 +++++---- - 3 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake -index 785edc2b628..e1935899cab 100644 ---- a/CMake/FindFFTW.cmake -+++ b/CMake/FindFFTW.cmake -@@ -62,7 +62,7 @@ if(ITK_USE_FFTWD OR ITK_USE_FFTWF) - find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) - endif() - -- if(FFTW_INCLUDE_PATH) -+ if(FFTW_INCLUDE_PATH OR CUFFTW_INCLUDE_PATH) - if(ITK_USE_CUFFTW) - file(TO_CMAKE_PATH "${CUFFTW_INCLUDE_PATH}" CUFFTW_INCLUDE_PATH) - set(FFTW_INCLUDE ${CUFFTW_INCLUDE_PATH}) -diff --git a/Modules/Filtering/FFT/CMakeLists.txt b/Modules/Filtering/FFT/CMakeLists.txt -index 7d9d1900b56..713530149cb 100644 ---- a/Modules/Filtering/FFT/CMakeLists.txt -+++ b/Modules/Filtering/FFT/CMakeLists.txt -@@ -5,5 +5,5 @@ if(ITK_USE_CUFFTW) - else() - set(ITKFFT_LIBRARIES ITKFFT) - endif() --set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE_PATH}) -+set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE}) - itk_module_impl() -diff --git a/Modules/Filtering/FFT/src/CMakeLists.txt b/Modules/Filtering/FFT/src/CMakeLists.txt -index 3f3137b8cd4..bde3ee906f8 100644 ---- a/Modules/Filtering/FFT/src/CMakeLists.txt -+++ b/Modules/Filtering/FFT/src/CMakeLists.txt -@@ -1,7 +1,8 @@ --set(ITKFFT_SRCS -- itkFFTWGlobalConfiguration.cxx -- itkComplexToComplexFFTImageFilter.cxx -- ) -+set(ITKFFT_SRCS itkComplexToComplexFFTImageFilter.cxx) -+ -+if( ITK_USE_FFTWF OR ITK_USE_FFTWD AND NOT ITK_USE_CUFFTW) -+ list(APPEND ITKFFT_SRCS itkFFTWGlobalConfiguration.cxx ) -+endif() - - itk_module_add_library(ITKFFT ${ITKFFT_SRCS}) - diff --git a/ports/itk/double-conversion.patch b/ports/itk/double-conversion.patch deleted file mode 100644 index 636dd8c4c7d816..00000000000000 --- a/ports/itk/double-conversion.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt -index 16c611fd3..13978724c 100644 ---- a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt -+++ b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt -@@ -9,7 +9,10 @@ mark_as_advanced(ITK_USE_SYSTEM_DOUBLECONVERSION) - if(ITK_USE_SYSTEM_DOUBLECONVERSION) - find_package(double-conversion REQUIRED) - get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES) -- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION) -+ get_target_property(ITKDoubleConversion_LIBRARY_RELEASE double-conversion::double-conversion LOCATION_RELEASE) -+ get_target_property(ITKDoubleConversion_LIBRARY_DEBUG double-conversion::double-conversion LOCATION_DEBUG) -+ include(SelectLibraryConfigurations) -+ select_library_configurations(ITKDoubleConversion) - else() - set(ITKDoubleConversion_INCLUDE_DIRS - ${ITKDoubleConversion_SOURCE_DIR}/src diff --git a/ports/itk/fix_libminc_config_path.patch b/ports/itk/fix_libminc_config_path.patch new file mode 100644 index 00000000000000..3ff305d4be9776 --- /dev/null +++ b/ports/itk/fix_libminc_config_path.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt +index 305b2c63..63f81a53 100644 +--- a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt ++++ b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt +@@ -550,7 +550,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake + DESTINATION +- ${LIBMINC_INSTALL_LIB_DIR}/cmake ++ share/itk + COMPONENT Development) + ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) + diff --git a/ports/itk/fix_openjpeg_search.patch b/ports/itk/fix_openjpeg_search.patch new file mode 100644 index 00000000000000..d17a1ab8405f03 --- /dev/null +++ b/ports/itk/fix_openjpeg_search.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt +index 6ac16ab6..4638f13c 100644 +--- a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt ++++ b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt +@@ -373,7 +373,7 @@ else() + endif() + + if(GDCM_USE_SYSTEM_OPENJPEG) +- find_package(OpenJPEG 2.0.0 REQUIRED) ++ find_package(OpenJPEG REQUIRED) + set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) + else() + set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) diff --git a/ports/itk/hdf5.patch b/ports/itk/hdf5.patch deleted file mode 100644 index 091594cda0e933..00000000000000 --- a/ports/itk/hdf5.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/Modules/ThirdParty/HDF5/CMakeLists.txt b/Modules/ThirdParty/HDF5/CMakeLists.txt -index a700ecdfb..0a683a52b 100644 ---- a/Modules/ThirdParty/HDF5/CMakeLists.txt -+++ b/Modules/ThirdParty/HDF5/CMakeLists.txt -@@ -25,11 +25,11 @@ endif() - ") - endif() - -- set(ITKHDF5_LIBRARIES ) -- if(BUILD_SHARED_LIBS) -- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_SHARED_LIBRARY} ${HDF5_CXX_SHARED_LIBRARY}) -+ set(ITKHDF5_LIBRARIES) -+ if(HDF5_BUILD_SHARED_LIBS) -+ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-shared hdf5::hdf5-shared) - else() -- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_STATIC_LIBRARY} ${HDF5_CXX_STATIC_LIBRARY}) -+ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-static hdf5::hdf5-static) - endif() - - set(ITKHDF5_INCLUDE_DIRS diff --git a/ports/itk/opencl.patch b/ports/itk/opencl.patch deleted file mode 100644 index f935d09d40dade..00000000000000 --- a/ports/itk/opencl.patch +++ /dev/null @@ -1,176 +0,0 @@ -diff --git a/Modules/Core/GPUCommon/CMakeLists.txt b/Modules/Core/GPUCommon/CMakeLists.txt -index da2d66b63..6fb476680 100644 ---- a/Modules/Core/GPUCommon/CMakeLists.txt -+++ b/Modules/Core/GPUCommon/CMakeLists.txt -@@ -24,9 +24,13 @@ if(ITK_USE_GPU AND APPLE AND NOT ITK_COMPILER_HAS_BLOCKS) - endif() - - if(ITK_USE_GPU) -+ message(STATUS "OPENCL_LIBRARIES:${OPENCL_LIBRARIES}") -+ if(TARGET OpenCL::OpenCL) -+ message(STATUS "OPENCL_LIBRARIES:${OpenCL_LIBRARIES}") -+ endif() - set(ITKGPUCommon_LIBRARIES ITKGPUCommon) -- set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - if(NOT ITK_SOURCE_DIR) -diff --git a/Modules/Core/GPUCommon/src/CMakeLists.txt b/Modules/Core/GPUCommon/src/CMakeLists.txt -index 0b39f2a9a..160f7a752 100644 ---- a/Modules/Core/GPUCommon/src/CMakeLists.txt -+++ b/Modules/Core/GPUCommon/src/CMakeLists.txt -@@ -14,5 +14,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUCommon_Kernels}" ITKGPUCommon_SRCS) - - itk_module_add_library(ITKGPUCommon ${ITKGPUCommon_SRCS}) -- target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() -diff --git a/Modules/Core/GPUFiniteDifference/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/CMakeLists.txt -index c1bfde450..a642d9230 100644 ---- a/Modules/Core/GPUFiniteDifference/CMakeLists.txt -+++ b/Modules/Core/GPUFiniteDifference/CMakeLists.txt -@@ -9,8 +9,8 @@ if(NOT ITK_SOURCE_DIR) - endif() - - if (ITK_USE_GPU) -- set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - set(ITKGPUFiniteDifference_LIBRARIES ITKGPUFiniteDifference) - endif() - -diff --git a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt -index 8425cc025..8335c69a0 100644 ---- a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt -+++ b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt -@@ -9,5 +9,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUFiniteDifference_Kernels}" ITKGPUFiniteDifference_SRCS) - - itk_module_add_library(ITKGPUFiniteDifference ${ITKGPUFiniteDifference_SRCS}) -- target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() -diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt -index f36fd887d..310d983fa 100644 ---- a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt -+++ b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt -@@ -10,8 +10,8 @@ endif() - - if (ITK_USE_GPU) - set(ITKGPUAnisotropicSmoothing_LIBRARIES ITKGPUAnisotropicSmoothing) -- set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - if(NOT ITK_SOURCE_DIR) -diff --git a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt -index 078905521..67fd7b832 100644 ---- a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt -+++ b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt -@@ -10,8 +10,8 @@ endif() - - if (ITK_USE_GPU) - set(ITKGPUImageFilterBase_LIBRARIES ITKGPUImageFilterBase) -- set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - if(NOT ITK_SOURCE_DIR) -diff --git a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt -index 251493f5e..6d33fa964 100644 ---- a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt -+++ b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt -@@ -10,5 +10,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUImageFilterBase_Kernels}" ITKGPUImageFilterBase_SRCS) - - itk_module_add_library(ITKGPUImageFilterBase ${ITKGPUImageFilterBase_SRCS}) -- target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() -diff --git a/Modules/Filtering/GPUSmoothing/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/CMakeLists.txt -index 9bac40921..2ed493d40 100644 ---- a/Modules/Filtering/GPUSmoothing/CMakeLists.txt -+++ b/Modules/Filtering/GPUSmoothing/CMakeLists.txt -@@ -10,8 +10,8 @@ endif() - - if (ITK_USE_GPU) - set(ITKGPUSmoothing_LIBRARIES ITKGPUSmoothing) -- set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - if(NOT ITK_SOURCE_DIR) -diff --git a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt -index d2120e842..2c6ca4a4a 100644 ---- a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt -+++ b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt -@@ -9,5 +9,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUSmoothing_Kernels}" ITKGPUSmoothing_SRCS) - - itk_module_add_library(ITKGPUSmoothing ${ITKGPUSmoothing_SRCS}) -- target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() -diff --git a/Modules/Filtering/GPUThresholding/CMakeLists.txt b/Modules/Filtering/GPUThresholding/CMakeLists.txt -index 4390785f5..61786b7a8 100644 ---- a/Modules/Filtering/GPUThresholding/CMakeLists.txt -+++ b/Modules/Filtering/GPUThresholding/CMakeLists.txt -@@ -2,8 +2,8 @@ project(ITKGPUThresholding) - - if (ITK_USE_GPU) - set(ITKGPUThresholding_LIBRARIES ITKGPUThresholding) -- set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - itk_module_impl() -diff --git a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt -index 326c86859..c07c80414 100644 ---- a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt -+++ b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt -@@ -9,5 +9,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUThresholding_Kernels}" ITKGPUThresholding_SRCS) - - itk_module_add_library(ITKGPUThresholding ${ITKGPUThresholding_SRCS}) -- target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() -diff --git a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt -index c8d70a423..097c974c5 100644 ---- a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt -+++ b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt -@@ -2,8 +2,8 @@ project(ITKGPUPDEDeformableRegistration) - - if (ITK_USE_GPU) - set(ITKGPUPDEDeformableRegistration_LIBRARIES ITKGPUPDEDeformableRegistration) -- set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) -- set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) -+ set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) -+ set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) - endif() - - itk_module_impl() -diff --git a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt -index 28b1d194c..1a049bdde 100644 ---- a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt -+++ b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt -@@ -10,5 +10,5 @@ if (ITK_USE_GPU) - write_gpu_kernels("${ITKGPUPDEDeformableRegistration_Kernels}" ITKGPUPDEDeformableRegistration_SRCS) - - itk_module_add_library(ITKGPUPDEDeformableRegistration ${ITKGPUPDEDeformableRegistration_SRCS}) -- target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OPENCL_LIBRARIES}) -+ target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OpenCL_LIBRARIES}) - endif() diff --git a/ports/itk/openjpeg.patch b/ports/itk/openjpeg.patch deleted file mode 100644 index 0fe1f34c9c097c..00000000000000 --- a/ports/itk/openjpeg.patch +++ /dev/null @@ -1,548 +0,0 @@ -diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx -index 1b1fe9526..0da4aa0c4 100644 ---- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx -+++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx -@@ -26,9 +26,9 @@ - - extern "C" - { --#include "openjpeg.h" --#include "j2k.h" --#include "jp2.h" -+#include -+//#include "j2k.h" -+//##include "jp2.h" - } - - -@@ -62,8 +62,7 @@ public: - OPJ_UINT32 m_TileStartX; - OPJ_UINT32 m_TileStartY; - -- OPJ_UINT32 m_NumberOfTilesInX; -- OPJ_UINT32 m_NumberOfTilesInY; -+ OPJ_UINT32 m_NumberOfTiles; - - opj_dparameters_t m_DecompressionParameters; /* decompression parameters */ - }; -@@ -86,8 +85,7 @@ JPEG2000ImageIO::JPEG2000ImageIO() - this->m_Internal->m_TileStartX = 0; - this->m_Internal->m_TileStartY = 0; - -- this->m_Internal->m_NumberOfTilesInX = 0; -- this->m_Internal->m_NumberOfTilesInY = 0; -+ this->m_Internal->m_NumberOfTiles = 0; - - const char * extensions[] = { ".j2k", ".jp2", ".jpt" }; - -@@ -139,22 +137,16 @@ JPEG2000ImageIO::ReadImageInformation() - { - itkDebugMacro(<< "ReadImageInformation()"); - -- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); -- -- /* decompression parameters */ -+ /* set decoding parameters to default values */ -+ opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); - -- if (!l_file) -+ opj_stream_t * cio = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); -+ if (!cio) - { - itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl - << "Reason: " - << itksys::SystemTools::GetLastSystemError()); - } -- -- /* set decoding parameters to default values */ -- opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); -- -- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, true); -- - this->m_Internal->m_Dinfo = nullptr; /* handle to a decompressor */ - - opj_image_t * l_image = nullptr; -@@ -187,14 +179,14 @@ JPEG2000ImageIO::ReadImageInformation() - /* JPEG-2000 codestream */ - - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); - if (!this->m_Internal->m_Dinfo) - { - opj_stream_destroy(cio); -- fclose(l_file); -+ // fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); - } - break; - } -@@ -202,14 +194,14 @@ JPEG2000ImageIO::ReadImageInformation() - { - /* JPEG 2000 compressed image data */ - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); - if (!this->m_Internal->m_Dinfo) - { - opj_stream_destroy(cio); -- fclose(l_file); -+ // fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); - } - break; - } -@@ -217,20 +209,19 @@ JPEG2000ImageIO::ReadImageInformation() - { - /* JPEG 2000, JPIP */ - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); - if (!this->m_Internal->m_Dinfo) - { - opj_stream_destroy(cio); -- fclose(l_file); -+ // fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); - } - break; - } - default: - opj_stream_destroy(cio); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl - << "Reason: " -@@ -247,27 +238,11 @@ JPEG2000ImageIO::ReadImageInformation() - << "Reason: opj_setup_decoder returns false"); - } - -- // Image parameters - first tile -- OPJ_INT32 l_tile_x0; -- OPJ_INT32 l_tile_y0; - -- // Image parameters - tile width, height and number of tiles -- OPJ_UINT32 l_tile_width; -- OPJ_UINT32 l_tile_height; -- OPJ_UINT32 l_nb_tiles_x; -- OPJ_UINT32 l_nb_tiles_y; - - itkDebugMacro(<< "Trying to read header now..."); - -- bResult = opj_read_header(this->m_Internal->m_Dinfo, -- &l_image, -- &l_tile_x0, -- &l_tile_y0, -- &l_tile_width, -- &l_tile_height, -- &l_nb_tiles_x, -- &l_nb_tiles_y, -- cio); -+ bResult = opj_read_header(cio, this->m_Internal->m_Dinfo, &l_image); - - if (!bResult) - { -@@ -283,14 +258,22 @@ JPEG2000ImageIO::ReadImageInformation() - << "Reason: Error whle reading image header"); - } - -+ // Image parameters - first tile -+ OPJ_INT32 l_tile_x0=l_image->x0; -+ OPJ_INT32 l_tile_y0=l_image->y0; -+ -+ // Image parameters - tile width, height and number of tiles -+ OPJ_UINT32 l_tile_width=l_image->x1; -+ OPJ_UINT32 l_tile_height=l_image->y1; -+ OPJ_UINT32 l_nb_tiles=l_image->numcomps; -+ - this->m_Internal->m_TileStartX = l_tile_x0; - this->m_Internal->m_TileStartY = l_tile_y0; - - this->m_Internal->m_TileWidth = l_tile_width; - this->m_Internal->m_TileHeight = l_tile_height; - -- this->m_Internal->m_NumberOfTilesInX = l_nb_tiles_x; -- this->m_Internal->m_NumberOfTilesInY = l_nb_tiles_y; -+ this->m_Internal->m_NumberOfTiles = l_nb_tiles; - - - itkDebugMacro(<< "Number of Components = " << l_image->numcomps); -@@ -319,7 +302,7 @@ JPEG2000ImageIO::ReadImageInformation() - this->SetPixelType(IOPixelEnum::SCALAR); - break; - case 3: -- if (l_image->color_space != CLRSPC_SRGB) -+ if (l_image->color_space != OPJ_CLRSPC_SRGB) - { - itkWarningMacro(<< "file does not specify color space, assuming sRGB"); - } -@@ -335,8 +318,7 @@ JPEG2000ImageIO::ReadImageInformation() - itkDebugMacro(<< "Tile Start Y = " << this->m_Internal->m_TileStartY); - itkDebugMacro(<< "Tile Width = " << this->m_Internal->m_TileWidth); - itkDebugMacro(<< "Tile Height = " << this->m_Internal->m_TileHeight); -- itkDebugMacro(<< "Number of Tiles X = " << this->m_Internal->m_NumberOfTilesInX); -- itkDebugMacro(<< "Number of Tiles Y = " << this->m_Internal->m_NumberOfTilesInY); -+ itkDebugMacro(<< "Number of Tiles = " << this->m_Internal->m_NumberOfTiles); - - itkDebugMacro(<< "image->x1 = " << l_image->x1); - itkDebugMacro(<< "image->y1 = " << l_image->y1); -@@ -349,7 +331,6 @@ JPEG2000ImageIO::ReadImageInformation() - - /* close the byte stream */ - opj_stream_destroy(cio); -- fclose(l_file); - - if (this->m_Internal->m_Dinfo) - { -@@ -368,16 +349,7 @@ JPEG2000ImageIO::Read(void * buffer) - { - itkDebugMacro(<< "JPEG2000ImageIO::Read() Begin"); - -- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); -- -- if (!l_file) -- { -- itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl -- << "Reason: " -- << itksys::SystemTools::GetLastSystemError()); -- } -- -- opj_stream_t * l_stream = opj_stream_create_default_file_stream(l_file, true); -+ opj_stream_t * l_stream = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); - if (!l_stream) - { - itkExceptionMacro("JPEG2000ImageIO failed to read file: " -@@ -397,12 +369,13 @@ JPEG2000ImageIO::Read(void * buffer) - { - /* JPEG-2000 codestream */ - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); - if (!this->m_Internal->m_Dinfo) - { -+ opj_stream_destroy(l_stream); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); - } - break; - } -@@ -410,12 +383,13 @@ JPEG2000ImageIO::Read(void * buffer) - { - /* JPEG 2000 compressed image data */ - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); - if (!this->m_Internal->m_Dinfo) - { -+ opj_stream_destroy(l_stream); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); - } - break; - } -@@ -423,17 +397,18 @@ JPEG2000ImageIO::Read(void * buffer) - { - /* JPEG 2000, JPIP */ - /* get a decoder handle */ -- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); -+ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); - if (!this->m_Internal->m_Dinfo) - { -+ opj_stream_destroy(l_stream); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); -+ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); - } - break; - } - default: -- fclose(l_file); -+ opj_stream_destroy(l_stream); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " - << this->GetFileName() << std::endl - << "Reason: " -@@ -448,29 +423,13 @@ JPEG2000ImageIO::Read(void * buffer) - << "Reason: opj_setup_decoder returns false"); - } - -- OPJ_INT32 l_tile_x0, l_tile_y0; -- -- OPJ_UINT32 l_tile_width; -- OPJ_UINT32 l_tile_height; -- OPJ_UINT32 l_nb_tiles_x; -- OPJ_UINT32 l_nb_tiles_y; -- -- bool bResult = opj_read_header(this->m_Internal->m_Dinfo, -- &l_image, -- &l_tile_x0, -- &l_tile_y0, -- &l_tile_width, -- &l_tile_height, -- &l_nb_tiles_x, -- &l_nb_tiles_y, -- l_stream); -+ bool bResult = opj_read_header(l_stream, this->m_Internal->m_Dinfo,&l_image); - - if (!bResult) - { - opj_destroy_codec(this->m_Internal->m_Dinfo); - this->m_Internal->m_Dinfo = nullptr; - opj_stream_destroy(l_stream); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl - << "Reason: opj_read_header returns false"); - } -@@ -499,7 +458,7 @@ JPEG2000ImageIO::Read(void * buffer) - itkDebugMacro(<< "p_end_x = " << p_end_x); - itkDebugMacro(<< "p_end_y = " << p_end_y); - -- bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, p_start_x, p_start_y, p_end_x, p_end_y); -+ bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, l_image, p_start_x, p_start_y, p_end_x, p_end_y); - - itkDebugMacro(<< "opj_set_decode_area() after"); - -@@ -508,7 +467,6 @@ JPEG2000ImageIO::Read(void * buffer) - opj_destroy_codec(this->m_Internal->m_Dinfo); - this->m_Internal->m_Dinfo = nullptr; - opj_stream_destroy(l_stream); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl - << "Reason: opj_set_decode_area returns false"); - } -@@ -525,13 +483,13 @@ JPEG2000ImageIO::Read(void * buffer) - - OPJ_UINT32 l_max_data_size = 1000; - -- bool l_go_on = true; -+ int l_go_on = true; // should be OBJ_BOOL - - auto * l_data = (OPJ_BYTE *)malloc(1000); - - while (l_go_on) - { -- bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, -+ bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, l_stream, - &l_tile_index, - &l_data_size, - &l_current_tile_x0, -@@ -539,14 +497,12 @@ JPEG2000ImageIO::Read(void * buffer) - &l_current_tile_x1, - &l_current_tile_y1, - &l_nb_comps, -- &l_go_on, -- l_stream); -+ &l_go_on); - - if (!tileHeaderRead) - { - free(l_data); - opj_stream_destroy(l_stream); -- fclose(l_file); - opj_destroy_codec(this->m_Internal->m_Dinfo); - opj_image_destroy(l_image); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl -@@ -571,7 +527,6 @@ JPEG2000ImageIO::Read(void * buffer) - if (!l_data) - { - opj_stream_destroy(l_stream); -- fclose(l_file); - opj_destroy_codec(this->m_Internal->m_Dinfo); - opj_image_destroy(l_image); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl -@@ -590,7 +545,6 @@ JPEG2000ImageIO::Read(void * buffer) - { - free(l_data); - opj_stream_destroy(l_stream); -- fclose(l_file); - opj_destroy_codec(this->m_Internal->m_Dinfo); - opj_image_destroy(l_image); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl -@@ -654,7 +608,6 @@ JPEG2000ImageIO::Read(void * buffer) - { - free(l_data); - opj_stream_destroy(l_stream); -- fclose(l_file); - opj_destroy_codec(this->m_Internal->m_Dinfo); - opj_image_destroy(l_image); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl -@@ -666,14 +619,12 @@ JPEG2000ImageIO::Read(void * buffer) - opj_destroy_codec(this->m_Internal->m_Dinfo); - this->m_Internal->m_Dinfo = nullptr; - opj_stream_destroy(l_stream); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl - << "Reason: error whle reading image"); - } - - /* close the byte stream */ - opj_stream_destroy(l_stream); -- fclose(l_file); - - if (this->m_Internal->m_Dinfo) - { -@@ -840,13 +791,13 @@ JPEG2000ImageIO ::Write(const void * buffer) - - parameters.numresolution = numberOfResolutions; - -- OPJ_COLOR_SPACE color_space = CLRSPC_GRAY; -+ OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; - opj_image_cmptparm_t cmptparms[3]; - - if (this->GetNumberOfComponents() == 3) - { - -- color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? CLRSPC_SRGB : CLRSPC_UNSPECIFIED; -+ color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_UNSPECIFIED; - - /* initialize image components */ - memset(&cmptparms[0], 0, 3 * sizeof(opj_image_cmptparm_t)); -@@ -864,7 +815,7 @@ JPEG2000ImageIO ::Write(const void * buffer) - - if (this->GetNumberOfComponents() == 1) - { -- color_space = CLRSPC_GRAY; -+ color_space = OPJ_CLRSPC_GRAY; - - /* initialize image components */ - memset(&cmptparms[0], 0, sizeof(opj_image_cmptparm_t)); -@@ -940,32 +891,32 @@ JPEG2000ImageIO ::Write(const void * buffer) - opj_codec_t * cinfo = nullptr; - if (extension == ".j2k") - { -- cinfo = opj_create_compress(CODEC_J2K); -+ cinfo = opj_create_compress(OPJ_CODEC_J2K); - if (!cinfo) - { - itkExceptionMacro("JPEG2000ImageIO failed to write file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_compress(CODEC_J2K) returns nullptr"); -+ << "Reason: opj_create_compress(OPJ_CODEC_J2K) returns nullptr"); - } - } - else if (extension == ".jp2") - { -- cinfo = opj_create_compress(CODEC_JP2); -+ cinfo = opj_create_compress(OPJ_CODEC_JP2); - if (!cinfo) - { - itkExceptionMacro("JPEG2000ImageIO failed to write file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_compress(CODEC_JP2) returns nullptr"); -+ << "Reason: opj_create_compress(OPJ_CODEC_JP2) returns nullptr"); - } - } - else if (extension == ".jpt") - { -- cinfo = opj_create_compress(CODEC_JPT); -+ cinfo = opj_create_compress(OPJ_CODEC_JPT); - if (!cinfo) - { - itkExceptionMacro("JPEG2000ImageIO failed to write file: " - << this->GetFileName() << std::endl -- << "Reason: opj_create_compress(CODEC_JPT) returns nullptr"); -+ << "Reason: opj_create_compress(OPJ_CODEC_JPT) returns nullptr"); - } - } - else -@@ -989,17 +940,9 @@ JPEG2000ImageIO ::Write(const void * buffer) - << "Reason: opj_setup_encoder returns false"); - } - -- FILE * l_file = fopen(parameters.outfile, "wb"); -- if (!l_file) -- { -- itkExceptionMacro("JPEG2000ImageIO failed to open file for writing: " << this->GetFileName() << std::endl -- << "Reason: " -- << itksys::SystemTools::GetLastSystemError()); -- } -- - /* open a byte stream for writing */ - /* allocate memory for all tiles */ -- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, false); -+ opj_stream_t * cio = opj_stream_create_default_file_stream(parameters.outfile, false); - if (!cio) - { - itkExceptionMacro("JPEG2000ImageIO failed to write file: " -@@ -1017,8 +960,7 @@ JPEG2000ImageIO ::Write(const void * buffer) - if (!bSuccess) - { - opj_stream_destroy(cio); -- fclose(l_file); -- itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl -+ itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl - << "Reason: opj_start_compress returns false"); - } - -@@ -1026,7 +968,6 @@ JPEG2000ImageIO ::Write(const void * buffer) - if (!bSuccess) - { - opj_stream_destroy(cio); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl - << "Reason: opj_encode returns false"); - } -@@ -1035,14 +976,12 @@ JPEG2000ImageIO ::Write(const void * buffer) - if (!bSuccess) - { - opj_stream_destroy(cio); -- fclose(l_file); - itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl - << "Reason: opj_end_compress returns false"); - } - - /* close and free the byte stream */ - opj_stream_destroy(cio); -- fclose(l_file); - - /* free remaining compression structures */ - opj_destroy_codec(cinfo); -diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -index 103eaa9dd..eb8989135 100644 ---- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -+++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -@@ -1,12 +1,25 @@ - project(ITKOpenJPEG) - set(ITKOpenJPEG_THIRD_PARTY 1) - --set(ITKOpenJPEG_INCLUDE_DIRS -- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg -- ) --set(ITKOpenJPEG_LIBRARIES itkopenjpeg) --set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) -+if(ITK_USE_SYSTEM_OpenJPEG) -+ find_package(OpenJPEG REQUIRED) -+ if(TARGET openjp2) -+ set(ITKOpenJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) -+ else() -+ message(FATAL_ERROR "OpenJPEG target openjp2 missing!") -+ endif() -+ set(ITKOpenJPEG_INCLUDE_DIRS -+ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -+ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg -+ ) -+else() -+ set(ITKOpenJPEG_INCLUDE_DIRS -+ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -+ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg -+ ) -+ set(ITKOpenJPEG_LIBRARIES itkopenjpeg) -+ set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) -+endif() - - itk_module_impl() - diff --git a/ports/itk/openjpeg2.patch b/ports/itk/openjpeg2.patch deleted file mode 100644 index 86631f5f99b2db..00000000000000 --- a/ports/itk/openjpeg2.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt -index 565cc338b..c061f0721 100644 ---- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt -+++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt -@@ -194,7 +194,7 @@ mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) - # configure name mangling to allow multiple libraries to coexist - # peacefully - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) --set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) -+set(MANGLE_PREFIX) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in - ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h - @ONLY) -diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt -index c4adb91a2..89b731d88 100644 ---- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt -+++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt -@@ -3,7 +3,7 @@ include_regular_expression("^.*$") - # configure name mangling to allow multiple libraries to coexist - # peacefully - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) --set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) -+set(MANGLE_PREFIX) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in - ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h - @ONLY) -diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -index 3811e52f4..a41e9264e 100644 ---- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -+++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt -@@ -8,10 +8,10 @@ if(ITK_USE_SYSTEM_OpenJPEG) - else() - message(FATAL_ERROR "OpenJPEG target openjp2 missing!") - endif() -- set(ITKOpenJPEG_INCLUDE_DIRS -- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg -- ) -+ # set(ITKOpenJPEG_INCLUDE_DIRS -+ # ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -+ # ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg -+ # ) - else() - set(ITKOpenJPEG_INCLUDE_DIRS - ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg -diff --git a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt -index e62e43eda..35dc89976 100644 ---- a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt -+++ b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt -@@ -68,7 +68,7 @@ CONFIGURE_FILE(${ITK3P_OpenJPEG_SOURCE_DIR}/opj_configure.h.in - # configure name mangling to allow multiple libraries to coexist - # peacefully - if(EXISTS ${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in) --set(MANGLE_PREFIX itk) -+#set(MANGLE_PREFIX itk) - configure_file(${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in - ${ITK3P_OpenJPEG_BINARY_DIR}/openjpeg_mangle.h - @ONLY) diff --git a/ports/itk/portfile.cmake b/ports/itk/portfile.cmake index b16ba194aa83ac..a666b57132051c 100644 --- a/ports/itk/portfile.cmake +++ b/ports/itk/portfile.cmake @@ -1,129 +1,22 @@ +include(vcpkg_common_functions) + vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO InsightSoftwareConsortium/ITK - REF d3286c9cc04ba16cc8f73de9a98fbcd7c02f3c7b - SHA512 c358449870d580aeb10e32f8be0ca39e8a76d8dc06fda973788fafb5971333e546611c399190be49d40f5f3c18a1105d9699eef271a560aff25ce168a396926e + REF v5.0.1 + SHA512 242ce66cf83f82d26f20d2099108295e28c8875e7679126ba023834bf0e94454460ba86452a94c8ddaea93d2314befc399f2b151d7294370d4b47f0e9798e77f HEAD_REF master PATCHES - hdf5.patch - double-conversion.patch - openjpeg.patch - openjpeg2.patch - var_libraries.patch - wrapping.patch - python_gpu_wrapping.patch - opencl.patch - cufftw.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "vtk" Module_ITKVtkGlue - "cuda" Module_ITKCudaCommon # Requires RTK? - #"cuda" CUDA_HAVE_GPU # Automatically set by FindCUDA? - "cufftw" ITK_USE_CUFFTW - "opencl" ITK_USE_GPU - "tbb" Module_ITKTBB - "rtk" Module_RTK - "tools" RTK_BUILD_APPLICATIONS - # There are a lot of more (remote) modules and options in ITK - # feel free to add those as a feature + fix_openjpeg_search.patch + fix_libminc_config_path.patch ) -if("cufftw" IN_LIST FEATURES) - # Alternativly set CUFFT_LIB and CUFFTW_LIB - if(WIN32) - file(TO_CMAKE_PATH "$ENV{CUDA_PATH}" CUDA_PATH) - set(CUDA_LIB_PATH "${CUDA_PATH}") - - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - string(APPEND CUDA_LIB_PATH "/lib/x64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - string(APPEND CUDA_LIB_PATH "/lib/Win32") - message(FATAL_ERROR "CUFFTW is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") - else() - message(FATAL_ERROR "Architecture ${VCPKG_TARGET_ARCHITECTURE} not supported !") - endif() - - list(APPEND ADDITIONAL_OPTIONS - "-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}" - "-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include" - "-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include" - ) - endif() -endif() - -if("rtk" IN_LIST FEATURES) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - message(FATAL_ERROR "RTK is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") - endif() - SET(BUILD_RTK ON) - list(APPEND ADDITIONAL_OPTIONS - "-DModule_RTK_GIT_TAG=8099212f715231d093f7d6a1114daecf45d871ed" # RTK latest versions (11.05.2020) - ) - if("cuda" IN_LIST FEATURES) - list(APPEND ADDITIONAL_OPTIONS "-DRTK_USE_CUDA=ON") - #RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes. - endif() -endif() -file(REMOVE_RECURSE "${SOURCE_PATH}/Modules/Remote/RTK") - -if("opencl" IN_LIST FEATURES) - list(APPEND ADDITIONAL_OPTIONS # Wrapping options required by OpenCL if build with Python Wrappers - -DITK_WRAP_unsigned_long_long=ON - -DITK_WRAP_signed_long_long=ON - ) -endif() -if("tools" IN_LIST FEATURES) - - if("rtk" IN_LIST FEATURES) - list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient - rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal - rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart - rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster - rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom - rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient - rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition - rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient - rtkwangdisplaceddetectorweighting rtkwarpedbackprojectsequence rtkwarpedforwardprojectsequence rtkwaveletsdenoising rtkxradgeometry) - endif() -endif() -if("vtk" IN_LIST FEATURES) - vcpkg_find_acquire_program(PYTHON3) - list(APPEND ADDITIONAL_OPTIONS - "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by mvtk if vtk[python] was build - ) -endif() -if("python" IN_LIST FEATURES) - message(STATUS "${PORT} builds a long time (>1h) with python wrappers enabled!") - vcpkg_find_acquire_program(PYTHON3) - vcpkg_find_acquire_program(SWIG) # Swig is only required for wrapping! - get_filename_component(SWIG_DIR "${SWIG}" DIRECTORY) - list(APPEND ADDITIONAL_OPTIONS - -DITK_WRAP_PYTHON=ON - -DPython3_FIND_REGISTRY=NEVER - "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature - "-DSWIG_EXECUTABLE=${SWIG}" - "-DSWIG_DIR=${SWIG_DIR}" - ) - # Due to ITKs internal shenanigans with the variables ...... - if(VCPKG_TARGET_IS_WINDOWS) - list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib" - "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib" - "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8") - list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib") - list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib") - elseif(VCPKG_TARGET_IS_LINUX) - list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a" - "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a" - "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m") - list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a") - list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a") - elseif(VCPKG_TARGET_IS_OSX) - #Need Python3 information on OSX within VCPKG - endif() - #ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg +if ("vtk" IN_LIST FEATURES) + set(ITKVtkGlue ON) +else() + set(ITKVtkGlue OFF) endif() set(USE_64BITS_IDS OFF) @@ -131,7 +24,6 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL x64 OR VCPKG_TARGET_ARCHITECTURE STREQUAL set(USE_64BITS_IDS ON) endif() -file(REMOVE_RECURSE "${SOURCE_PATH}/CMake/FindOpenCL.cmake") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -139,10 +31,7 @@ vcpkg_configure_cmake( OPTIONS -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF - -DBUILD_PKGCONFIG_FILES=OFF - -DITK_DOXYGEN_HTML=OFF -DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON - -DITK_SKIP_PATH_LENGTH_CHECKS=ON -DITK_INSTALL_DATA_DIR=share/itk/data -DITK_INSTALL_DOC_DIR=share/itk/doc -DITK_INSTALL_PACKAGE_DIR=share/itk @@ -156,58 +45,31 @@ vcpkg_configure_cmake( -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_EIGEN=ON - -DITK_USE_SYSTEM_FFTW=ON - -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past and still is. ITK still has not figured out how to do it correctly! - -DITK_USE_SYSTEM_GDCM=ON - -DITK_USE_SYSTEM_OpenJPEG=ON # Added by VCPKG - -DITK_USE_SYSTEM_DCMTK=ON - -DDCMTK_USE_ICU=ON - -DITK_USE_SYSTEM_ICU=ON - #-DITK_USE_SYSTEM_VXL=ON - #-DITK_USE_SYSTEM_CASTXML=ON # needs to be added to vcpkg_find_acquire_program https://data.kitware.com/api/v1/file/hashsum/sha512/b8b6f0aff11fe89ab2fcd1949cc75f2c2378a7bc408827a004396deb5ff5a9976bffe8a597f8db1b74c886ea39eb905e610dce8f5bd7586a4d6c196d7349da8d/download - -DITK_USE_SYSTEM_MINC=ON - -DITK_USE_SYSTEM_SWIG=ON - -DITK_FORBID_DOWNLOADS=OFF # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break. Remote Modules would probably break with this! - -DINSTALL_GTEST=OFF - -DITK_USE_SYSTEM_GOOGLETEST=ON - -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} - - # TODO - #-DVXL_USE_GEOTIFF=ON - -DVXL_USE_LFS=ON - - -DITK_MINIMUM_COMPLIANCE_LEVEL:STRING=1 # To Display all remote modules within cmake-gui - #-DModule_IOSTL=ON # example how to turn on a non-default module - #-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module - #-DModule_RLEImage=ON # example how to turn on a remote module - - # Some additional wraping options - #-DITK_WRAP_double=ON - #-DITK_WRAP_complex_double=ON - #-DITK_WRAP_covariant_vector_double=ON - #-DITK_WRAP_vector_double=ON + # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break + -DITK_FORBID_DOWNLOADS=OFF + + -DITK_SKIP_PATH_LENGTH_CHECKS=ON + + # I haven't tried Python wrapping in vcpkg + #-DITK_WRAP_PYTHON=ON + #-DITK_PYTHON_VERSION=3 - ${FEATURE_OPTIONS} + -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past + -DModule_ITKVtkGlue=${ITKVtkGlue} # optional feature + + -DModule_IOSTL=ON # example how to turn on a non-default module + -DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module + -DModule_RLEImage=ON # example how to turn on a remote module + -DGDCM_USE_SYSTEM_OPENJPEG=ON #Use port openjpeg instead of own third-party ${ADDITIONAL_OPTIONS} - - OPTIONS_DEBUG ${OPTIONS_DEBUG} - OPTIONS_RELEASE ${OPTIONS_RELEASE} ) -if(BUILD_RTK) # Remote Modules are only downloaded on configure. - # TODO: In the future try to download via vcpkg_from_github and move the files. That way patching does not need this workaround - vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}/Modules/Remote/RTK" QUIET PATCHES rtk/already_defined.patch rtk/unresolved.patch) -endif() + vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() -if(TOOL_NAMES) - vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) -endif() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/itk/python_gpu_wrapping.patch b/ports/itk/python_gpu_wrapping.patch deleted file mode 100644 index 37367d979e0fb8..00000000000000 --- a/ports/itk/python_gpu_wrapping.patch +++ /dev/null @@ -1,178 +0,0 @@ -diff --git a/CMake/itkOpenCL.cmake b/CMake/itkOpenCL.cmake -index 0ccbe144d..fa381524f 100644 ---- a/CMake/itkOpenCL.cmake -+++ b/CMake/itkOpenCL.cmake -@@ -48,7 +48,7 @@ if(ITK_USE_GPU) - ) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE} - PROPERTIES GENERATED ON) -- set(${SRC_VAR} ${${SRC_VAR}} ${OUTPUT_FILE}) -+ set(${SRC_VAR} ${${SRC_VAR}} ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}) - endmacro() - - macro(write_gpu_kernels GPUKernels GPU_SRC) -diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h -index 1816f722a..3a6a8aee5 100644 ---- a/Modules/Core/Common/include/itkMacro.h -+++ b/Modules/Core/Common/include/itkMacro.h -@@ -1141,7 +1141,7 @@ compilers. - #define itkGetVectorMacro(name, type, count) \ - virtual type * Get##name() const { return this->m_##name; } - --/**\def itkGPUKernelClassMacro -+/**\def class itkGPUKernelClassMacro - * Construct a non-templatized helper class that - * provides the GPU kernel source code as a const char* - */ -@@ -1150,7 +1150,7 @@ compilers. - * Workaround KWstyle bug \ \ - * \ingroup ITKCommon \ \ - */ \ -- class kernel \ -+ kernel \ - { \ - public: \ - static const char * \ -diff --git a/Modules/Core/GPUCommon/include/itkGPUImageOps.h b/Modules/Core/GPUCommon/include/itkGPUImageOps.h -index f4eb8f33b..fbdf3d757 100644 ---- a/Modules/Core/GPUCommon/include/itkGPUImageOps.h -+++ b/Modules/Core/GPUCommon/include/itkGPUImageOps.h -@@ -23,7 +23,7 @@ - namespace itk - { - /** Create a helper GPU Kernel class for GPUImageOps */ --itkGPUKernelClassMacro(GPUImageOpsKernel); -+class itkGPUKernelClassMacro(GPUImageOpsKernel); - - /** \class GPUImageOps - * -diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.h b/Modules/Core/GPUCommon/include/itkGPUReduction.h -index 524a5cd01..1b3ce91e9 100644 ---- a/Modules/Core/GPUCommon/include/itkGPUReduction.h -+++ b/Modules/Core/GPUCommon/include/itkGPUReduction.h -@@ -26,7 +26,7 @@ - namespace itk - { - /** Create a helper GPU Kernel class for GPUReduction */ --itkGPUKernelClassMacro(GPUReductionKernel); -+class itkGPUKernelClassMacro(GPUReductionKernel); - - /** - * \class GPUReduction -diff --git a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h -index 853801cec..2fccf0bc5 100644 ---- a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h -+++ b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h -@@ -24,7 +24,7 @@ - namespace itk - { - /** Create a helper GPU Kernel class for GPUDenseFiniteDifferenceImageFilter */ --itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); -+class ITKGPUFiniteDifference_EXPORT itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); - - /** - * \class GPUDenseFiniteDifferenceImageFilter -diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h -index 4245ff914..1b21b709e 100644 ---- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h -+++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h -@@ -54,7 +54,7 @@ namespace itk - */ - - /** Create a helper GPU Kernel class for GPUGradientNDAnisotropicDiffusionFunction */ --itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); -+class itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); - - template - class ITK_TEMPLATE_EXPORT GPUGradientNDAnisotropicDiffusionFunction -diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h -index 305f6490e..d0d433080 100644 ---- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h -+++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h -@@ -32,7 +32,7 @@ namespace itk - * */ - - /** Create a helper GPU Kernel class for GPUScalarAnisotropicDiffusionFunction */ --itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); -+class itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); - - template - class ITK_TEMPLATE_EXPORT GPUScalarAnisotropicDiffusionFunction : public GPUAnisotropicDiffusionFunction -diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h -index 23530ac5c..e1b83f696 100644 ---- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h -+++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h -@@ -29,7 +29,7 @@ namespace itk - { - - /** Create a helper GPU Kernel class for GPUCastImageFilter */ --itkGPUKernelClassMacro(GPUCastImageFilterKernel); -+class itkGPUKernelClassMacro(GPUCastImageFilterKernel); - - /** \class GPUCastImageFilter - * \brief GPU version of CastImageFilter. -diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h -index c4adc2967..69aeac6db 100644 ---- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h -+++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h -@@ -41,7 +41,7 @@ namespace itk - */ - - /** Create a helper GPU Kernel class for GPUNeighborhoodOperatorImageFilter */ --itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); -+class itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); - - template - class ITK_TEMPLATE_EXPORT GPUMeanImageFilter -diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h -index 8d26dcfc5..613bc623f 100644 ---- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h -+++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h -@@ -85,7 +85,7 @@ private: - } // end of namespace Functor - - /** Create a helper GPU Kernel class for GPUBinaryThresholdImageFilter */ --itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); -+class itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); - - /** - * \class GPUBinaryThresholdImageFilter -diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h -index 28b21d592..0b46e27b8 100644 ---- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h -+++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h -@@ -51,7 +51,7 @@ namespace itk - * \ingroup ITKGPUPDEDeformableRegistration - */ - /** Create a helper GPU Kernel class for GPUDemonsRegistrationFunction */ --itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); -+class itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); - - template - class ITK_TEMPLATE_EXPORT GPUDemonsRegistrationFunction -diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h -index 93ab975ec..0afd84871 100644 ---- a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h -+++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h -@@ -73,7 +73,7 @@ namespace itk - */ - - /** Create a helper GPU Kernel class for GPUPDEDeformableRegistrationFilter */ --itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); -+class itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); - - template - -+#include "RTKExport.h" - #include "rtkMacro.h" - - namespace rtk -@@ -67,25 +68,18 @@ public: - * with the i-th matrix provides the physical coordinate on - * the i-th projection. - */ -- const std::vector & -- GetMatrices() const -- { -- return this->m_Matrices; -- } -+ itkGetConstReferenceMacro(Matrices,std::vector) - - /** Get the i-th projection matrix. */ - MatrixType -- GetMatrix(const unsigned int i) const -- { -- return this->m_Matrices[i]; -- } -+ GetMatrix(const unsigned int i) const; - - /** Empty the geometry object. */ - virtual void - Clear(); - - protected: -- ProjectionGeometry() = default; -+ ProjectionGeometry(); - ~ProjectionGeometry() override = default; - - void -@@ -93,11 +87,7 @@ protected: - - /** Add projection matrix */ - virtual void -- AddMatrix(const MatrixType & m) -- { -- this->m_Matrices.push_back(m); -- this->Modified(); -- } -+ AddMatrix(const MatrixType & m); - - private: - /** Projection matrices */ -@@ -105,6 +95,9 @@ private: - }; - } // namespace rtk - --#include "rtkProjectionGeometry.hxx" -+#ifndef ITK_MANUAL_INSTANTIATION -+# include "rtkProjectionGeometry.hxx" -+#endif -+ - - #endif // rtkProjectionGeometry_h -diff --git a/include/rtkProjectionGeometry.hxx b/include/rtkProjectionGeometry.hxx -index 192265812..97dfe8c3a 100644 ---- a/include/rtkProjectionGeometry.hxx -+++ b/include/rtkProjectionGeometry.hxx -@@ -23,6 +23,8 @@ - - namespace rtk - { -+template -+ProjectionGeometry::ProjectionGeometry() = default; - - template - void -@@ -43,6 +45,21 @@ ProjectionGeometry::Clear() - this->Modified(); - } - -+template -+typename ProjectionGeometry::MatrixType -+ProjectionGeometry::GetMatrix(const unsigned int i) const -+{ -+ return this->m_Matrices[i]; -+} -+ -+template -+void -+ProjectionGeometry::AddMatrix(const typename ProjectionGeometry::MatrixType & m) -+{ -+ this->m_Matrices.push_back(m); -+ this->Modified(); -+} -+ - } // namespace rtk - - #endif // rtkProjectionGeometry_hxx diff --git a/ports/itk/rtk/unresolved.patch b/ports/itk/rtk/unresolved.patch deleted file mode 100644 index e2209ec7574070..00000000000000 --- a/ports/itk/rtk/unresolved.patch +++ /dev/null @@ -1,213 +0,0 @@ -diff --git a/include/rtkDCMImagXImageIO.h b/include/rtkDCMImagXImageIO.h -index 2a70ae046..69abb409e 100644 ---- a/include/rtkDCMImagXImageIO.h -+++ b/include/rtkDCMImagXImageIO.h -@@ -18,7 +18,7 @@ - - #ifndef rtkDCMImagXImageIO_h - #define rtkDCMImagXImageIO_h -- -+#include "RTKExport.h" - #include - - #include "rtkMacro.h" -@@ -32,7 +32,7 @@ namespace rtk - * - * \ingroup RTK - */ --class DCMImagXImageIO : public itk::GDCMImageIO -+class RTK_EXPORT DCMImagXImageIO : public itk::GDCMImageIO - { - public: - ITK_DISALLOW_COPY_AND_ASSIGN(DCMImagXImageIO); -diff --git a/include/rtkEdfImageIO.h b/include/rtkEdfImageIO.h -index 66499c56b..7b16fbc5a 100644 ---- a/include/rtkEdfImageIO.h -+++ b/include/rtkEdfImageIO.h -@@ -18,7 +18,7 @@ - - #ifndef rtkEdfImageIO_h - #define rtkEdfImageIO_h -- -+#include "RTKExport.h" - #include - #include - #include -@@ -36,7 +36,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class EdfImageIO : public itk::ImageIOBase -+class RTK_EXPORT EdfImageIO : public itk::ImageIOBase - { - public: - ITK_DISALLOW_COPY_AND_ASSIGN(EdfImageIO); -diff --git a/include/rtkHisImageIO.h b/include/rtkHisImageIO.h -index 2ef2005dd..95449b8a6 100644 ---- a/include/rtkHisImageIO.h -+++ b/include/rtkHisImageIO.h -@@ -19,6 +19,8 @@ - #ifndef rtkHisImageIO_h - #define rtkHisImageIO_h - -+#include "RTKExport.h" -+ - // itk include - #include - #include "rtkMacro.h" -@@ -35,7 +37,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class HisImageIO : public itk::ImageIOBase -+class RTK_EXPORT HisImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkHncImageIO.h b/include/rtkHncImageIO.h -index 7b9539bde..dc9dca759 100644 ---- a/include/rtkHncImageIO.h -+++ b/include/rtkHncImageIO.h -@@ -19,9 +19,11 @@ - #ifndef rtkHncImageIO_h - #define rtkHncImageIO_h - -+#include "RTKExport.h" -+ - // itk include - #include --#include "itksys/SystemTools.hxx" -+//#include "itksys/SystemTools.hxx" - - #if defined(_MSC_VER) && (_MSC_VER < 1600) - // SR: taken from -@@ -43,7 +45,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class HncImageIO : public itk::ImageIOBase -+class RTK_EXPORT HncImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkHncImageIOFactory.h b/include/rtkHncImageIOFactory.h -index 2bca8f77e..1d5a97938 100644 ---- a/include/rtkHncImageIOFactory.h -+++ b/include/rtkHncImageIOFactory.h -@@ -38,7 +38,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class HncImageIOFactory : public itk::ObjectFactoryBase -+class RTK_EXPORT HncImageIOFactory : public itk::ObjectFactoryBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkHndImageIO.h b/include/rtkHndImageIO.h -index 5a07897cc..5f843362a 100644 ---- a/include/rtkHndImageIO.h -+++ b/include/rtkHndImageIO.h -@@ -19,6 +19,8 @@ - #ifndef rtkHndImageIO_h - #define rtkHndImageIO_h - -+#include "RTKExport.h" -+ - // itk include - #include - -@@ -43,7 +45,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class HndImageIO : public itk::ImageIOBase -+class RTK_EXPORT HndImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkImagXImageIO.h b/include/rtkImagXImageIO.h -index d69e9a790..d6cc8388e 100644 ---- a/include/rtkImagXImageIO.h -+++ b/include/rtkImagXImageIO.h -@@ -18,7 +18,7 @@ - - #ifndef rtkImagXImageIO_h - #define rtkImagXImageIO_h -- -+#include "RTKExport.h" - #include - #include - #include -@@ -34,7 +34,7 @@ namespace rtk - * - * \ingroup RTK - */ --class ImagXImageIO : public itk::ImageIOBase -+class RTK_EXPORT ImagXImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkOraImageIO.h b/include/rtkOraImageIO.h -index ece525a42..2d5332872 100644 ---- a/include/rtkOraImageIO.h -+++ b/include/rtkOraImageIO.h -@@ -19,6 +19,8 @@ - #ifndef rtkOraImageIO_h - #define rtkOraImageIO_h - -+#include "RTKExport.h" -+ - // This is done to avoid any interference with zlib - #ifdef OF - # undef OF -@@ -41,7 +43,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class OraImageIO : public itk::MetaImageIO -+class RTK_EXPORT OraImageIO : public itk::MetaImageIO - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkXRadImageIO.h b/include/rtkXRadImageIO.h -index a72c934e4..0a92afa22 100644 ---- a/include/rtkXRadImageIO.h -+++ b/include/rtkXRadImageIO.h -@@ -19,6 +19,7 @@ - #ifndef rtkXRadImageIO_h - #define rtkXRadImageIO_h - -+#include "RTKExport.h" - #include - #include - #include -@@ -37,7 +38,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class XRadImageIO : public itk::ImageIOBase -+class RTK_EXPORT XRadImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ -diff --git a/include/rtkXimImageIO.h b/include/rtkXimImageIO.h -index ae789dbf9..741f05183 100644 ---- a/include/rtkXimImageIO.h -+++ b/include/rtkXimImageIO.h -@@ -19,6 +19,7 @@ - #ifndef rtkXimImageIO_h - #define rtkXimImageIO_h - -+#include "RTKExport.h" - #include "rtkMacro.h" - - // itk include -@@ -43,7 +44,7 @@ namespace rtk - * - * \ingroup RTK IOFilters - */ --class XimImageIO : public itk::ImageIOBase -+class RTK_EXPORT XimImageIO : public itk::ImageIOBase - { - public: - /** Standard class type alias. */ diff --git a/ports/itk/var_libraries.patch b/ports/itk/var_libraries.patch deleted file mode 100644 index 738fa980f131ca..00000000000000 --- a/ports/itk/var_libraries.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMake/ITKModuleMacros.cmake b/CMake/ITKModuleMacros.cmake -index da9f3a902..60420bb0a 100644 ---- a/CMake/ITKModuleMacros.cmake -+++ b/CMake/ITKModuleMacros.cmake -@@ -162,9 +162,6 @@ macro(itk_module_impl) - foreach(dep IN LISTS ITK_MODULE_${itk-module}_DEPENDS) - list(APPEND ${itk-module}_LIBRARIES "${${dep}_LIBRARIES}") - endforeach() -- if(${itk-module}_LIBRARIES) -- list(REMOVE_DUPLICATES ${itk-module}_LIBRARIES) -- endif() - endif() - - if(EXISTS ${${itk-module}_SOURCE_DIR}/include) -diff --git a/CMake/ITKModuleAPI.cmake b/CMake/ITKModuleAPI.cmake -index af64d96dc..809335e6d 100644 ---- a/CMake/ITKModuleAPI.cmake -+++ b/CMake/ITKModuleAPI.cmake -@@ -133,7 +133,7 @@ macro(itk_module_config ns) - endforeach() - unset(_${ns}_USED_MODULES) - -- foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS -+ foreach(v ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS - ${ns}_RUNTIME_LIBRARY_DIRS ${ns}_FACTORY_NAMES ${ns}_FACTORY_LIST) - if(${v}) - list(REMOVE_DUPLICATES ${v}) diff --git a/ports/itk/wrapping.patch b/ports/itk/wrapping.patch deleted file mode 100644 index 1e2e531504eb23..00000000000000 --- a/ports/itk/wrapping.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/Wrapping/TypedefMacros.cmake b/Wrapping/TypedefMacros.cmake -index e6f8d0bf3..6c000dba8 100644 ---- a/Wrapping/TypedefMacros.cmake -+++ b/Wrapping/TypedefMacros.cmake -@@ -57,13 +57,12 @@ macro(itk_wrap_module library_name) - - # WRAPPER_LIBRARY_DEPENDS. List of names of other wrapper libraries that - # define symbols used by this wrapper library. - INTERSECTION(WRAPPER_LIBRARY_DEPENDS "${ITK_MODULE_${library_name}_DEPENDS}" "${WRAP_ITK_MODULES}") - # set(WRAPPER_LIBRARY_DEPENDS ${ITK_MODULE_${library_name}_DEPENDS}) - - # WRAPPER_LIBRARY_LINK_LIBRARIES. List of other libraries that should - # be linked to the wrapper library. -- set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${itk-module}_LIBRARIES}) -- -+ set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${library_name}_LIBRARIES}) - # WRAPPER_SUBMODULE_ORDER. List of *.wrap submodules in the source dir - # that should be included/wrapped before the rest in the given order. - # Just the submodule group name is needed, not the full path or file name. diff --git a/ports/josuttis-jthread/CONTROL b/ports/josuttis-jthread/CONTROL deleted file mode 100644 index 760fb6eb716f0e..00000000000000 --- a/ports/josuttis-jthread/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: josuttis-jthread -Version: 2020-07-21 -Homepage: https://github.com/josuttis/jthread -Description: C++ class for a joining and cooperative interruptible thread (std::jthread) with stop_token helper diff --git a/ports/josuttis-jthread/portfile.cmake b/ports/josuttis-jthread/portfile.cmake deleted file mode 100644 index e01c165855d732..00000000000000 --- a/ports/josuttis-jthread/portfile.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# header-only library - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO josuttis/jthread - REF 3e1908f3bbaba6d2195bb423840c23e107c9e8b2 - SHA512 b6e4df35b364848a433eb31023a8b5b5045b2445aaf9a81406a6b3ce7cfdda08bcdb486be9201f5b1e54df38884c1763fae336fdcb9ad79f11658a92c535055d - HEAD_REF master -) - -file(INSTALL ${SOURCE_PATH}/source/jthread.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/source/stop_token.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/source/condition_variable_any2.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include}) - -file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/jsoncons/CONTROL b/ports/jsoncons/CONTROL index a867c1b42c365c..4063d9323c2be2 100644 --- a/ports/jsoncons/CONTROL +++ b/ports/jsoncons/CONTROL @@ -1,4 +1,4 @@ Source: jsoncons -Version: 0.155.1 -Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON +Version: 0.153.3 +Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, CSV, MessagePack, CBOR, BSON, UBJSON Homepage: https://github.com/danielaparker/jsoncons diff --git a/ports/jsoncons/portfile.cmake b/ports/jsoncons/portfile.cmake index 960e199d54dcae..7da19ced61374b 100644 --- a/ports/jsoncons/portfile.cmake +++ b/ports/jsoncons/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danielaparker/jsoncons - REF 0fd102277ca361b8a82cdab97df67d18fe335409 # v0.155.1 - SHA512 77c64bd0f8ce681a5b517c4a94fbe718e15fa4c5047e718c93413dfa173614818f435419d64313555653966d3a2c35deec15702d9d3768eeba6aba129625fea4 + REF 41302e394917a71e7e73db9a50f7d496d2862fd3 # v0.153.3 + SHA512 8b1859f484eada1db02c7f146efd1a53b412f06e4b4c2b0a1aaf4b96242a839093c5eb5b588e1e29b56830223e07b6d0b6418cca616d901316d9cb30de4e803e HEAD_REF master ) diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL index c92324b4ffce53..ac2559064dbef2 100644 --- a/ports/jxrlib/CONTROL +++ b/ports/jxrlib/CONTROL @@ -1,4 +1,4 @@ Source: jxrlib -Version: 2019.10.9-1 +Version: 2019.10.9 Homepage: https://github.com/4creators/jxrlib Description: Open source implementation of the jpegxr image format standard. diff --git a/ports/jxrlib/vcpkg-cmake-wrapper.cmake b/ports/jxrlib/vcpkg-cmake-wrapper.cmake index 4bee9171d8197c..e95a66bdc4ed6a 100644 --- a/ports/jxrlib/vcpkg-cmake-wrapper.cmake +++ b/ports/jxrlib/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(JXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT JXR_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${JXR_PREV_MODULE_PATH}) diff --git a/ports/kf5archive/CONTROL b/ports/kf5archive/CONTROL index 16592e34e80d1d..a8f1d30ab2cbb6 100644 --- a/ports/kf5archive/CONTROL +++ b/ports/kf5archive/CONTROL @@ -1,5 +1,4 @@ Source: kf5archive Version: 5.64.0-1 -Homepage: https://api.kde.org/frameworks/karchive/html/index.html Description: File compression Build-Depends: ecm, qt5-base[core], zlib, bzip2 diff --git a/ports/kf5archive/portfile.cmake b/ports/kf5archive/portfile.cmake index c7b99e8526c8de..aaaa48de0bbce0 100644 --- a/ports/kf5archive/portfile.cmake +++ b/ports/kf5archive/portfile.cmake @@ -9,11 +9,10 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF + OPTIONS -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() @@ -23,5 +22,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/kf5archive RENAME copyright) diff --git a/ports/kf5completion/CONTROL b/ports/kf5completion/CONTROL deleted file mode 100644 index fb1f4309acea58..00000000000000 --- a/ports/kf5completion/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5completion -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kcompletion/html/index.html -Description: Text completion helpers and widgets -Build-Depends: ecm, qt5-tools, kf5config, kf5widgetsaddons \ No newline at end of file diff --git a/ports/kf5completion/add-qdbus-to-required-libraries.patch b/ports/kf5completion/add-qdbus-to-required-libraries.patch deleted file mode 100644 index b5c285a652b693..00000000000000 --- a/ports/kf5completion/add-qdbus-to-required-libraries.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a86a05e..688bae2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -32,7 +32,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KCOMPLETION - # Dependencies - set(REQUIRED_QT_VERSION 5.11.0) - --find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets) -+find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets DBus) - - find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) - find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED) diff --git a/ports/kf5completion/portfile.cmake b/ports/kf5completion/portfile.cmake deleted file mode 100644 index d9e697dcf3cd34..00000000000000 --- a/ports/kf5completion/portfile.cmake +++ /dev/null @@ -1,33 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kcompletion - REF v5.64.0 - SHA512 1d597bc0e82d1570b1ff7b254425ab18d4d505a0b7f475a43b51d70566b91e763b86675837421c3f09073544efa77e673e9d2cfef586c12684fc9fe7b0c6a0cc - HEAD_REF master - # reported issue, just a manual workaround until the issue is fixed upstream - PATCHES - "add-qdbus-to-required-libraries.patch" -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DBUILD_DESIGNERPLUGIN=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Completion) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5config/CONTROL b/ports/kf5config/CONTROL deleted file mode 100644 index 8c0c49e3114d5d..00000000000000 --- a/ports/kf5config/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5config -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kconfig/html/index.html -Description: Configuration system -Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5config/portfile.cmake b/ports/kf5config/portfile.cmake deleted file mode 100644 index 444b1aed5abe24..00000000000000 --- a/ports/kf5config/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kconfig - REF v5.64.0 - SHA512 b8919e552a35ed3f4882d2d15205c5576be985e9f6e4e834d26587c9288e85a2ab27504a1531d1af70e8db4dc7ed71a6b0caf91c7310dace81177b68aa6a97e5 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake() - -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - -if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconfig_compiler_kf5.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconfig_compiler_kf5.exe) - file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconf_update.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconf_update.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5.exe) - file (GLOB EXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) - file(REMOVE ${EXES}) -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kreadconfig5) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kwriteconfig5) -endif() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Config) - -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") -vcpkg_copy_pdbs() - -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/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5coreaddons/CONTROL b/ports/kf5coreaddons/CONTROL deleted file mode 100644 index 03d14a3545db45..00000000000000 --- a/ports/kf5coreaddons/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5coreaddons -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kcoreaddons/html/index.html -Description: Addons to QtCore -Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5coreaddons/portfile.cmake b/ports/kf5coreaddons/portfile.cmake deleted file mode 100644 index 14862e07f1188c..00000000000000 --- a/ports/kf5coreaddons/portfile.cmake +++ /dev/null @@ -1,42 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kcoreaddons - REF v5.64.0 - SHA512 b6849c072aa33cd2d93477e7a08ffc8ec7034f7d8530b6492faa9a53e4e15af0da778fc54e5d865e68b36c32aa6559f3d178a03046f5120d11dcb61d35ed7a60 -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DKDE_INSTALL_DATAROOTDIR=data -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5CoreAddons) -vcpkg_copy_pdbs() - -vcpkg_copy_tools( - TOOL_NAMES desktoptojson - AUTO_CLEAN -) - -file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/desktoptojson${EXECUTABLE_SUFFIX}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5crash/CONTROL b/ports/kf5crash/CONTROL deleted file mode 100644 index 927eca46cd0919..00000000000000 --- a/ports/kf5crash/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: kf5crash -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kcrash/html/index.html -Description: KCrash provides support for intercepting and handling application crashes. -Supports: linux -Build-Depends: ecm, kf5coreaddons, kf5widgetsaddons diff --git a/ports/kf5crash/add_x11extras.patch b/ports/kf5crash/add_x11extras.patch deleted file mode 100644 index a6ff6fc66ce412..00000000000000 --- a/ports/kf5crash/add_x11extras.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8a9d1c6..0d5fb3f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKA - set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - - set(REQUIRED_QT_VERSION 5.11.0) --find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) -+find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core X11Extras) - include(KDEInstallDirs) - include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) - include(KDECMakeSettings) diff --git a/ports/kf5crash/portfile.cmake b/ports/kf5crash/portfile.cmake deleted file mode 100644 index dc608d37153250..00000000000000 --- a/ports/kf5crash/portfile.cmake +++ /dev/null @@ -1,31 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "osx" "uwp" "windows") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kcrash - REF v5.64.0 - SHA512 28749b220002fef756dbd8436cf684b7e3eb1d72ae00ae8b1bfded5c4a446683dc925a3be9beb55ad0872e71d3c23411d32b4fab935909816efa339cedaeda3d - HEAD_REF master - PATCHES - add_x11extras.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Crash) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) - -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5guiaddons/CONTROL b/ports/kf5guiaddons/CONTROL deleted file mode 100644 index a364eecc1d79d3..00000000000000 --- a/ports/kf5guiaddons/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5guiaddons -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kguiaddons/html/index.html -Description: Addons to QtGui -Build-Depends: ecm, qt5-winextras (windows), qt5-x11extras (linux), qt5-tools diff --git a/ports/kf5guiaddons/portfile.cmake b/ports/kf5guiaddons/portfile.cmake deleted file mode 100644 index 8234e4cd8787ea..00000000000000 --- a/ports/kf5guiaddons/portfile.cmake +++ /dev/null @@ -1,29 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kguiaddons - REF v5.64.0 - SHA512 98d07360f02b473997cdbf9e9b832ea8c4a459a73669eff1db5276dfbd63e9a9088e3c1ed99d70cc1433468e1efcbce43d22fefdf75a399f4812e0fc4a4f13b1 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5GuiAddons) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5i18n/CONTROL b/ports/kf5i18n/CONTROL deleted file mode 100644 index 4cb5ce4d594c39..00000000000000 --- a/ports/kf5i18n/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5i18n -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/ki18n/html/index.html -Description: Advanced internationalization framework -Build-Depends: ecm, qt5-declarative, qt5-tools, gettext diff --git a/ports/kf5i18n/portfile.cmake b/ports/kf5i18n/portfile.cmake deleted file mode 100644 index efa22a577c9f82..00000000000000 --- a/ports/kf5i18n/portfile.cmake +++ /dev/null @@ -1,35 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/ki18n - REF v5.64.0 - SHA512 13b5d701003edea704ffc86a886d86b27ff2198d4cde4ee732b9241cf04dba0fba403f1f78b45facd7c2d3b543f8f0a098369035270a61b347331eb495fae1d3 -) - -if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES mingw-w64-i686-gettext) - set(GETTEXT_PATH ${MSYS_ROOT}/mingw32/bin) - vcpkg_add_to_path(${GETTEXT_PATH}) -endif() - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DKDE_INSTALL_PLUGINDIR=plugins -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5I18n) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemmodels/CONTROL b/ports/kf5itemmodels/CONTROL deleted file mode 100644 index f94f20fa9d9fa4..00000000000000 --- a/ports/kf5itemmodels/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5itemmodels -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kitemmodels/html/index.html -Description: Models for Qt Model/View system -Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemmodels/portfile.cmake b/ports/kf5itemmodels/portfile.cmake deleted file mode 100644 index 9facbb120bea25..00000000000000 --- a/ports/kf5itemmodels/portfile.cmake +++ /dev/null @@ -1,28 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kitemmodels - REF v5.64.0 - SHA512 c29911b5ff521a8d1dae9b72250be59267da7bf059aeb1efec6a7361204957c12a1ae95fd34a00067b277ce3a61d88930326501c361341a316d6c0afb109b7ed -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemModels) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemviews/CONTROL b/ports/kf5itemviews/CONTROL deleted file mode 100644 index 8d83844ebeae86..00000000000000 --- a/ports/kf5itemviews/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5itemviews -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kitemviews/html/index.html -Description: Widget addons for Qt Model/View -Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemviews/portfile.cmake b/ports/kf5itemviews/portfile.cmake deleted file mode 100644 index f134b477ceb43a..00000000000000 --- a/ports/kf5itemviews/portfile.cmake +++ /dev/null @@ -1,29 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kitemviews - REF v5.64.0 - SHA512 c40d1dee94badac2e58098138522d72be00082ac9ce70e8f5690b5bd5ae0705fa79a7edc3af391230a86d08a4a8b7dac1c28f148758f7ee8c09195a178e35bcb -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DBUILD_DESIGNERPLUGIN=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemViews) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5widgetsaddons/CONTROL b/ports/kf5widgetsaddons/CONTROL deleted file mode 100644 index 2e5f2eb515d499..00000000000000 --- a/ports/kf5widgetsaddons/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5widgetsaddons -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kwidgetsaddons/html/index.html -Description: Addons to QtWidgets -Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5widgetsaddons/portfile.cmake b/ports/kf5widgetsaddons/portfile.cmake deleted file mode 100644 index fe7106e224bd09..00000000000000 --- a/ports/kf5widgetsaddons/portfile.cmake +++ /dev/null @@ -1,30 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kwidgetsaddons - REF v5.64.0 - SHA512 f49bade85b97468ad4c2faa34b71c6d04ff95c720c27e5b7adfb9a7b5acf8ff30b91d2beca7472dec6b8241f918b4fb15bddc1429be86a62bcefefe918311307 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DBUILD_DESIGNERPLUGIN=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WidgetsAddons) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5windowsystem/CONTROL b/ports/kf5windowsystem/CONTROL deleted file mode 100644 index d5cb904870e089..00000000000000 --- a/ports/kf5windowsystem/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: kf5windowsystem -Version: 5.64.0 -Homepage: https://api.kde.org/frameworks/kwindowsystem/html/ -Description: Access to the windowing system -Build-Depends: ecm, qt5-winextras (windows), qt5-tools diff --git a/ports/kf5windowsystem/portfile.cmake b/ports/kf5windowsystem/portfile.cmake deleted file mode 100644 index 0284c7408e5205..00000000000000 --- a/ports/kf5windowsystem/portfile.cmake +++ /dev/null @@ -1,29 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/kwindowsystem - REF v5.64.0 - SHA512 7e1033ac383042b76254f35676c8aa011f02192e80ac2eb0554014a483749b13002062e7e928884f95dc7cb2a1c390bd2a93a7871d3f107b7042f7219dadecf5 -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF - -DKDE_INSTALL_PLUGINDIR=plugins -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WindowSystem) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/lapack-reference/CONTROL b/ports/lapack-reference/CONTROL deleted file mode 100644 index 493e7f50e4cd36..00000000000000 --- a/ports/lapack-reference/CONTROL +++ /dev/null @@ -1,16 +0,0 @@ -Source: lapack-reference -Version: 3.8.0 -Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/ -Default-Features: blas-select -Build-Depends: vcpkg-gfortran (windows) - -Feature: cblas -Description: Builds CBLAS - -Feature: noblas -Build-Depends: openblas -Description: Use external optimized BLAS - -Feature: blas-select -Build-Depends: lapack-reference[core, noblas](!windows|(windows&!static)) -Description: Use external optimized BLAS diff --git a/ports/lapack-reference/FindLAPACK.cmake b/ports/lapack-reference/FindLAPACK.cmake deleted file mode 100644 index 1edaa0f831a5f9..00000000000000 --- a/ports/lapack-reference/FindLAPACK.cmake +++ /dev/null @@ -1,568 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#[=======================================================================[.rst: -FindLAPACK ----------- - -Find Linear Algebra PACKage (LAPACK) library - -This module finds an installed Fortran library that implements the -LAPACK linear-algebra interface (see http://www.netlib.org/lapack/). - -The approach follows that taken for the ``autoconf`` macro file, -``acx_lapack.m4`` (distributed at -http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). - -Input Variables -^^^^^^^^^^^^^^^ - -The following variables may be set to influence this module's behavior: - -``BLA_STATIC`` - if ``ON`` use static linkage - -``BLA_VENDOR`` - If set, checks only the specified vendor, if not set checks all the - possibilities. List of vendors valid in this module: - - * ``OpenBLAS`` - * ``FLAME`` - * ``Intel10_32`` (intel mkl v10 32 bit) - * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) - * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) - * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) - * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model) - * ``Intel10_64_dyn`` (intel mkl v10+ 64 bit, single dynamic library) - * ``Intel`` (obsolete versions of mkl 32 and 64 bit) - * ``ACML`` - * ``Apple`` - * ``NAS`` - * ``Arm`` - * ``Arm_mp`` - * ``Arm_ilp64`` - * ``Arm_ilp64_mp`` - * ``Generic`` - -``BLA_F95`` - if ``ON`` tries to find the BLAS95/LAPACK95 interfaces - -Imported targets -^^^^^^^^^^^^^^^^ - -This module defines the following :prop_tgt:`IMPORTED` target: - -``LAPACK::LAPACK`` - The libraries to use for LAPACK, if found. - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -``LAPACK_FOUND`` - library implementing the LAPACK interface is found -``LAPACK_LINKER_FLAGS`` - uncached list of required linker flags (excluding ``-l`` and ``-L``). -``LAPACK_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use LAPACK -``LAPACK95_LIBRARIES`` - uncached list of libraries (using full path name) to link against - to use LAPACK95 -``LAPACK95_FOUND`` - library implementing the LAPACK95 interface is found - -.. note:: - - C, CXX or Fortran must be enabled to detect a BLAS/LAPACK library. - C or CXX must be enabled to use Intel Math Kernel Library (MKL). - - For example, to use Intel MKL libraries and/or Intel compiler: - - .. code-block:: cmake - - set(BLA_VENDOR Intel10_64lp) - find_package(LAPACK) -#]=======================================================================] - -# Check the language being used -if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED)) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.") - else() - message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)") - return() - endif() -endif() - -if(CMAKE_Fortran_COMPILER_LOADED) - include(${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -else() - include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -endif() -include(${CMAKE_ROOT}/Modules/CMakePushCheckState.cmake) - -cmake_push_check_state() -set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY}) - -set(LAPACK_FOUND FALSE) -set(LAPACK95_FOUND FALSE) - -set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -if(BLA_STATIC) - if(WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif() -else() - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # for ubuntu's libblas3gf and liblapack3gf packages - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) - endif() -endif() - -# TODO: move this stuff to a separate module - -macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _addlibdir _subdirs _blas) - # This macro checks for the existence of the combination of fortran libraries - # given by _list. If the combination is found, this macro checks (using the - # Check_Fortran_Function_Exists macro) whether can link against that library - # combination using the name of a routine given by _name using the linker - # flags given by _flags. If the combination of libraries is found and passes - # the link test, LIBRARIES is set to the list of complete library paths that - # have been found. Otherwise, LIBRARIES is set to FALSE. - - # N.B. _prefix is the prefix applied to the names of all cached variables that - # are generated internally and marked advanced by this macro. - # _addlibdir is a list of additional search paths. _subdirs is a list of path - # suffixes to be used by find_library(). - - set(_libraries_work TRUE) - set(${LIBRARIES}) - set(_combined_name) - - set(_extaddlibdir "${_addlibdir}") - if(WIN32) - list(APPEND _extaddlibdir ENV LIB) - elseif(APPLE) - list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH) - else() - list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH) - endif() - list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") - - foreach(_library ${_list}) - if(_library MATCHES "^-Wl,--(start|end)-group$") - # Respect linker flags like --start/end-group (required by MKL) - set(${LIBRARIES} ${${LIBRARIES}} "${_library}") - else() - set(_combined_name ${_combined_name}_${_library}) - if(_libraries_work) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_extaddlibdir} - PATH_SUFFIXES ${_subdirs} - ) - #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}") - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif() - endif() - endforeach() - - if(_libraries_work) - # Test this combination of libraries. - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threadlibs}) - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if(CMAKE_Fortran_COMPILER_LOADED) - check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) - else() - check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - endif() - set(CMAKE_REQUIRED_LIBRARIES) - set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) - endif() - - if(_libraries_work) - if("${_list}${_blas}" STREQUAL "") - set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") - else() - set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threadlibs}) - endif() - else() - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro() - -set(LAPACK_LINKER_FLAGS) -set(LAPACK_LIBRARIES) -set(LAPACK95_LIBRARIES) - -if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS) -else() - find_package(BLAS REQUIRED) -endif() - -if(BLAS_FOUND) - set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) - if(NOT $ENV{BLA_VENDOR} STREQUAL "") - set(BLA_VENDOR $ENV{BLA_VENDOR}) - else() - if(NOT BLA_VENDOR) - set(BLA_VENDOR "All") - endif() - endif() - - # LAPACK in the Intel MKL 10+ library? - if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - if(CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) - # System-specific settings - if(NOT WIN32) - set(LAPACK_mkl_LM "-lm") - set(LAPACK_mkl_LDL "-ldl") - endif() - - if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(Threads) - else() - find_package(Threads REQUIRED) - endif() - - if(BLA_VENDOR MATCHES "_64ilp") - set(LAPACK_mkl_ILP_MODE "ilp64") - else() - set(LAPACK_mkl_ILP_MODE "lp64") - endif() - - set(LAPACK_SEARCH_LIBS "") - - if(BLA_F95) - set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") - set(_LIBRARIES LAPACK95_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) - - # old - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95") - # new >= 10.3 - list(APPEND LAPACK_SEARCH_LIBS - "mkl_intel_c") - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack95_${LAPACK_mkl_ILP_MODE}") - else() - set(LAPACK_mkl_SEARCH_SYMBOL "cheev") - set(_LIBRARIES LAPACK_LIBRARIES) - set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) - - # old and new >= 10.3 - list(APPEND LAPACK_SEARCH_LIBS - "mkl_lapack") - endif() - - # MKL uses a multitude of partially platform-specific subdirectories: - if(BLA_VENDOR STREQUAL "Intel10_32") - set(LAPACK_mkl_ARCH_NAME "ia32") - else() - set(LAPACK_mkl_ARCH_NAME "intel64") - endif() - if(WIN32) - set(LAPACK_mkl_OS_NAME "win") - elseif(APPLE) - set(LAPACK_mkl_OS_NAME "mac") - else() - set(LAPACK_mkl_OS_NAME "lin") - endif() - if(DEFINED ENV{MKLROOT}) - file(TO_CMAKE_PATH "$ENV{MKLROOT}" LAPACK_mkl_MKLROOT) - # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead - # so we can better detect other relevant libraries in 'compiler' or 'tbb': - get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME) - if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl") - get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY) - endif() - endif() - set(LAPACK_mkl_LIB_PATH_SUFFIXES - "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" - "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" - "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}") - - # First try empty lapack libs - if(NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - LAPACK - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "" - "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" - "${LAPACK_mkl_MKLROOT}" - "${LAPACK_mkl_LIB_PATH_SUFFIXES}" - "${_BLAS_LIBRARIES}" - ) - endif() - - # Then try the search libs - foreach(IT ${LAPACK_SEARCH_LIBS}) - string(REPLACE " " ";" SEARCH_LIBS ${IT}) - if(NOT ${_LIBRARIES}) - check_lapack_libraries( - ${_LIBRARIES} - LAPACK - ${LAPACK_mkl_SEARCH_SYMBOL} - "" - "${SEARCH_LIBS}" - "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" - "${LAPACK_mkl_MKLROOT}" - "${LAPACK_mkl_LIB_PATH_SUFFIXES}" - "${_BLAS_LIBRARIES}" - ) - endif() - endforeach() - - unset(LAPACK_mkl_ILP_MODE) - unset(LAPACK_mkl_SEARCH_SYMBOL) - unset(LAPACK_mkl_LM) - unset(LAPACK_mkl_LDL) - unset(LAPACK_mkl_MKLROOT) - unset(LAPACK_mkl_ARCH_NAME) - unset(LAPACK_mkl_OS_NAME) - unset(LAPACK_mkl_LIB_PATH_SUFFIXES) - endif() - endif() - endif() - - # gotoblas? (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) - if(BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "goto2" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # OpenBLAS? (http://www.openblas.net) - if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "openblas" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # ArmPL? (https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries) - if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All") - - # Check for 64bit Integer support - if(BLA_VENDOR MATCHES "_ilp64") - set(LAPACK_armpl_LIB "armpl_ilp64") - else() - set(LAPACK_armpl_LIB "armpl_lp64") - endif() - - # Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp - if(BLA_VENDOR MATCHES "_mp") - set(LAPACK_armpl_LIB "${LAPACK_armpl_LIB}_mp") - endif() - - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "${LAPACK_armpl_LIB}" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # FLAME's blis library? (https://github.com/flame/blis) - if(BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "flame" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # BLAS in acml library? - if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") - if(BLAS_LIBRARIES MATCHES ".+acml.+") - set(LAPACK_LIBRARIES ${BLAS_LIBRARIES}) - endif() - endif() - - # Apple LAPACK library? - if(BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "Accelerate" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # Apple NAS (vecLib) library? - if(BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "vecLib" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() - - # Generic LAPACK library? - if(BLA_VENDOR STREQUAL "Generic" OR - BLA_VENDOR STREQUAL "ATLAS" OR - BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - if(NOT LAPACK_LIBRARIES AND NOT WIN32) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack;-lm;-lgfortran" - "" - "" - "" - "${BLAS_LIBRARIES}" - ) - endif() - endif() -else() - message(STATUS "LAPACK requires BLAS") -endif() - -if(BLA_F95) - if(LAPACK95_LIBRARIES) - set(LAPACK95_FOUND TRUE) - else() - set(LAPACK95_FOUND FALSE) - endif() - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK95_FOUND) - message(STATUS "A library with LAPACK95 API found.") - else() - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK95 API not found. Please specify library location." - ) - else() - message(STATUS - "A library with LAPACK95 API not found. Please specify library location." - ) - endif() - endif() - endif() - set(LAPACK_FOUND "${LAPACK95_FOUND}") - set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") -else() - if(LAPACK_LIBRARIES) - set(LAPACK_FOUND TRUE) - else() - set(LAPACK_FOUND FALSE) - endif() - - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK_FOUND) - message(STATUS "A library with LAPACK API found.") - else() - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK API not found. Please specify library location." - ) - else() - message(STATUS - "A library with LAPACK API not found. Please specify library location." - ) - endif() - endif() - endif() -endif() - -# On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines) -# we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above. -if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") - set(LAPACK_LIBRARIES "") -endif() - -if(NOT TARGET LAPACK::LAPACK) - add_library(LAPACK::LAPACK INTERFACE IMPORTED) - set(_lapack_libs "${LAPACK_LIBRARIES}") - if(_lapack_libs AND TARGET BLAS::BLAS) - # remove the ${BLAS_LIBRARIES} from the interface and replace it - # with the BLAS::BLAS target - list(REMOVE_ITEM _lapack_libs "${BLAS_LIBRARIES}") - endif() - - if(_lapack_libs) - set_target_properties(LAPACK::LAPACK PROPERTIES - INTERFACE_LINK_LIBRARIES "${_lapack_libs}" - ) - endif() - unset(_lapack_libs) -endif() - -cmake_pop_check_state() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/ports/lapack-reference/portfile.cmake b/ports/lapack-reference/portfile.cmake deleted file mode 100644 index 1e3f8d6b653539..00000000000000 --- a/ports/lapack-reference/portfile.cmake +++ /dev/null @@ -1,123 +0,0 @@ -#TODO: Features to add: -# USE_XBLAS??? extended precision blas. needs xblas -# LAPACKE should be its own PORT -# USE_OPTIMIZED_LAPACK (Probably not what we want. Does a find_package(LAPACK): probably for LAPACKE only builds _> own port?) -# LAPACKE Builds LAPACKE -# LAPACKE_WITH_TMG Build LAPACKE with tmglib routines -include(vcpkg_find_fortran) -SET(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) - -set(lapack_ver 3.8.0) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO "Reference-LAPACK/lapack" - REF "v${lapack_ver}" - SHA512 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f - HEAD_REF master -) - -if(NOT VCPKG_TARGET_IS_WINDOWS) - set(ENV{FFLAGS} "$ENV{FFLAGS} -fPIC") -endif() - -set(CBLAS OFF) -if("cblas" IN_LIST FEATURES) - set(CBLAS ON) -endif() - -set(USE_OPTIMIZED_BLAS OFF) -if("noblas" IN_LIST FEATURES) - set(USE_OPTIMIZED_BLAS ON) - set(pcfile "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/openblas.pc") - if(EXISTS "${pcfile}") - file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) - endif() - set(pcfile "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig/openblas.pc") - if(EXISTS "${pcfile}") - file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) - endif() -endif() - -set(VCPKG_CRT_LINKAGE_BACKUP ${VCPKG_CRT_LINKAGE}) -vcpkg_find_fortran(FORTRAN_CMAKE) -if(VCPKG_USE_INTERNAL_Fortran) - if(VCPKG_CRT_LINKAGE_BACKUP STREQUAL static) - # If openblas has been built with static crt linkage we cannot use it with gfortran! - set(USE_OPTIMIZED_BLAS OFF) - #Cannot use openblas from vcpkg if we are building with gfortran here. - if("noblas" IN_LIST FEATURES) - message(FATAL_ERROR "Feature 'noblas' cannot be used without supplying an external fortran compiler") - endif() - endif() -else() - set(USE_OPTIMIZED_BLAS ON) -endif() -vcpkg_configure_cmake( - PREFER_NINJA - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - "-DUSE_OPTIMIZED_BLAS=${USE_OPTIMIZED_BLAS}" - "-DCBLAS=${CBLAS}" - "${FORTRAN_CMAKE}" - ) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/lapack-${lapack_ver}) #Should the target path be lapack and not lapack-reference? - -set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/lapack.pc") -if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") -endif() -set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/lapack.pc") -if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") -endif() -if(NOT USE_OPTIMIZED_BLAS) - set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc") - if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") - endif() - set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc") - if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") - endif() -endif() -vcpkg_fixup_pkgconfig() -vcpkg_copy_pdbs() - -# Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -# remove debug includs -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if(VCPKG_TARGET_IS_WINDOWS) - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/lib/lapack.lib") - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/lapack.lib") - endif() - if(NOT USE_OPTIMIZED_BLAS) - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libblas.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/lib/blas.lib") - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/blas.lib") - endif() - endif() -endif() - -if(NOT VCPKG_TARGET_IS_WINDOWS) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) -endif() diff --git a/ports/lapack-reference/vcpkg-cmake-wrapper.cmake b/ports/lapack-reference/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index a91b040ca90298..00000000000000 --- a/ports/lapack-reference/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,2 +0,0 @@ -message(STATUS "Using VCPKG FindLAPACK. Remove if CMake has been updated to account for -lm and -lgfortran in lapack-reference!") -include(${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake) diff --git a/ports/lapack/CMakeLists.txt b/ports/lapack/CMakeLists.txt deleted file mode 100644 index 07b2818b1a4a97..00000000000000 --- a/ports/lapack/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.17) - -project(Find_LAPACK_external) -find_package(LAPACK REQUIRED) -#TODO make sure that the found LAPACK is outside VCPKG \ No newline at end of file diff --git a/ports/lapack/CONTROL b/ports/lapack/CONTROL deleted file mode 100644 index c4e27f77d36db5..00000000000000 --- a/ports/lapack/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: lapack -Version: 1 -Description: Metapackage for packages which provide LAPACK -Build-Depends: clapack ((arm&windows)|uwp), lapack-reference(!uwp&!(arm&windows)) \ No newline at end of file diff --git a/ports/lapack/portfile.cmake b/ports/lapack/portfile.cmake deleted file mode 100644 index ab7f28a0bf0f46..00000000000000 --- a/ports/lapack/portfile.cmake +++ /dev/null @@ -1,10 +0,0 @@ -SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) -# Make sure LAPACK can be found - -if(VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") - # Install clapack wrappers. - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/clapack/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share//${PORT}) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/clapack/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share//${PORT}) -endif() -vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR} - OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}") diff --git a/ports/libass/CMakeLists.txt b/ports/libass/CMakeLists.txt index aacf89d86b0b75..32d7ef097d3a5c 100644 --- a/ports/libass/CMakeLists.txt +++ b/ports/libass/CMakeLists.txt @@ -7,30 +7,18 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -if(WIN32) - add_compile_definitions(CONFIG_DIRECTWRITE) -elseif(APPLE) - add_compile_definitions(CONFIG_CORETEXT) -else() - add_compile_definitions(CONFIG_FONTCONFIG) -endif() - +# This is Windows-specific. Other acceptable values on different platforms should be +# macOS - CONFIG_CORETEXT +# linux - CONFIG_FONTCONFIG +add_compile_definitions(CONFIG_DIRECTWRITE) add_compile_definitions(CONFIG_FREETYPE) add_compile_definitions(CONFIG_FRIBIDI) add_compile_definitions(CONFIG_HARFBUZZ) file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/libass/*.c) -if(WIN32) - list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") - list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") -elseif(APPLE) - list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") - list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") -else() - list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") - list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") -endif() +list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") +list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") find_package(Freetype REQUIRED) @@ -42,24 +30,18 @@ find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h PATH_SUFFIXES harfbuzz) -find_path(DIRENT_INCLUDE_DIR - NAMES dirent.h) - -find_library(FRIBIDI_LIBRARY NAMES libfribidi fribidi) +find_library(FRIBIDI_LIBRARY NAMES fribidi) find_library(HARFBUZZ_LIBRARY NAMES harfbuzz) add_library(ass ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/libass.def) -target_include_directories(ass PRIVATE - ${FRIBIDI_INCLUDE_DIR} +target_include_directories(ass PRIVATE + ${FRIBIDI_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}) -if(DIRENT_INCLUDE_DIR) - target_include_directories(ass PRIVATE - ${DIRENT_INCLUDE_DIR}) -endif() -target_link_libraries(ass PRIVATE - Freetype::Freetype - ${FRIBIDI_LIBRARY} + +target_link_libraries(ass PRIVATE + Freetype::Freetype + ${FRIBIDI_LIBRARY} ${HARFBUZZ_LIBRARY}) install(TARGETS ass diff --git a/ports/libass/CONTROL b/ports/libass/CONTROL new file mode 100644 index 00000000000000..ea25ea9a189f84 --- /dev/null +++ b/ports/libass/CONTROL @@ -0,0 +1,4 @@ +Source: libass +Version: 0.14.0 +Build-Depends: freetype, fribidi, harfbuzz, dirent (windows) +Description: libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. diff --git a/ports/libass/portfile.cmake b/ports/libass/portfile.cmake index f5ab6606c07ef4..040cadc661dca5 100644 --- a/ports/libass/portfile.cmake +++ b/ports/libass/portfile.cmake @@ -1,3 +1,6 @@ + +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libass/libass @@ -11,6 +14,9 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/libass.def DESTINATION ${SOURCE_PATH}) +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libass RENAME copyright) + # Since libass uses automake, make and configure, we use a custom CMake file file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -21,7 +27,4 @@ vcpkg_configure_cmake( PREFER_NINJA) vcpkg_install_cmake() -vcpkg_copy_pdbs() - -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +vcpkg_copy_pdbs() \ No newline at end of file diff --git a/ports/libass/vcpkg.json b/ports/libass/vcpkg.json deleted file mode 100644 index 151d87cdd6a69e..00000000000000 --- a/ports/libass/vcpkg.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "libass", - "version-string": "0.14.0", - "port-version": 3, - "description": "libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format", - "homepage": "https://github.com/libass/libass", - "dependencies": [ - { - "name": "dirent", - "platform": "windows" - }, - "freetype", - "fribidi", - "harfbuzz" - ] -} diff --git a/ports/libb2/portfile.cmake b/ports/libb2/portfile.cmake index 992c59f4be3eb5..2401cf0c1e2e62 100644 --- a/ports/libb2/portfile.cmake +++ b/ports/libb2/portfile.cmake @@ -14,7 +14,6 @@ if(CMAKE_HOST_WIN32) endif() vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS ${OPTIONS} ) diff --git a/ports/libb2/vcpkg.json b/ports/libb2/vcpkg.json index dbe8dc265e8ed7..1d2f19db823e96 100644 --- a/ports/libb2/vcpkg.json +++ b/ports/libb2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libb2", "version-string": "0.98.1", - "port-version": 4, + "port-version": 3, "description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp", "homepage": "https://github.com/BLAKE2/libb2", "supports": "!windows" diff --git a/ports/libcrafter/CONTROL b/ports/libcrafter/CONTROL index 47538dae935abe..b8ebac0bf72624 100644 --- a/ports/libcrafter/CONTROL +++ b/ports/libcrafter/CONTROL @@ -1,6 +1,5 @@ Source: libcrafter -Version: 0.3 -Port-Version: 2 +Version: 0.3-1 Homepage: https://github.com/pellegre/libcrafter Description: Libcrafter is a high level library for C++ designed to create and decode network packets. -Build-Depends: libpcap +Build-Depends: libpcap \ No newline at end of file diff --git a/ports/libcrafter/portfile.cmake b/ports/libcrafter/portfile.cmake index 565a0c3462a575..9965b7d3c9f0e9 100644 --- a/ports/libcrafter/portfile.cmake +++ b/ports/libcrafter/portfile.cmake @@ -8,7 +8,6 @@ vcpkg_from_github( ) vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH libcrafter OPTIONS diff --git a/ports/libde265/CONTROL b/ports/libde265/CONTROL deleted file mode 100644 index 09ab2f2318147f..00000000000000 --- a/ports/libde265/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: libde265 -Version: 1.0.5 -Homepage: https://www.libde265.org/ -Description: Open h.265 video codec implementation. -Supports: !(arm|uwp) diff --git a/ports/libde265/portfile.cmake b/ports/libde265/portfile.cmake deleted file mode 100644 index 70cfe2e3015b32..00000000000000 --- a/ports/libde265/portfile.cmake +++ /dev/null @@ -1,24 +0,0 @@ -vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO strukturag/libde265 - REF v1.0.5 - SHA512 3ff7310fc4621cac0ef1cb9bbc4df61724f8943d57f5263a3663a77f4d90d84716b2a708ee9fec306e909dc8b5e7fe645a641b6a6db795a89a01799be910831e - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libde265/) - -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") -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index 93d1aede793073..daf330e83442ef 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,6 +1,5 @@ Source: libepoxy Version: 1.5.4 -Port-Version: 1 Homepage: https://github.com/anholt/libepoxy Description: Epoxy is a library for handling OpenGL function pointer management for you Build-Depends: tool-meson diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index caaa02ab200522..69482f9c227c9a 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -11,7 +11,8 @@ vcpkg_from_github( libepoxy-1.5.4_Add_call_convention_to_mock_function.patch ) -if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX) + +if (VCPKG_TARGET_IS_WINDOWS) vcpkg_configure_meson(SOURCE_PATH ${SOURCE_PATH} OPTIONS -Denable-glx=no @@ -23,7 +24,7 @@ else() if (NOT autoreconf OR NOT EXISTS "/usr/share/doc/libgles2/copyright") message(FATAL_ERROR "autoreconf and libgles2-mesa-dev must be installed before libepoxy can build. Install them with \"apt-get install dh-autoreconf libgles2-mesa-dev\".") endif() - + find_program(MAKE make) if (NOT MAKE) message(FATAL_ERROR "MAKE not found") @@ -31,34 +32,34 @@ else() file(REMOVE_RECURSE ${SOURCE_PATH}/m4) file(MAKE_DIRECTORY ${SOURCE_PATH}/m4) - + set(LIBEPOXY_CONFIG_ARGS "--enable-x11=yes --enable-glx=yes --enable-egl=yes") - + vcpkg_execute_required_process( COMMAND "autoreconf" -v --install WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME autoreconf-${TARGET_TRIPLET} ) - + message(STATUS "Configuring ${TARGET_TRIPLET}") set(OUT_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/make-build-${TARGET_TRIPLET}-release) - + file(REMOVE_RECURSE ${OUT_PATH_RELEASE}) file(MAKE_DIRECTORY ${OUT_PATH_RELEASE}) - + vcpkg_execute_required_process( COMMAND "./configure" --prefix=${OUT_PATH_RELEASE} "${LIBEPOXY_CONFIG_ARGS}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME config-${TARGET_TRIPLET} ) - + message(STATUS "Building ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-release ) - + message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make install diff --git a/ports/libevent/CONTROL b/ports/libevent/CONTROL index fd98e588a12ddd..4df532990ce45d 100644 --- a/ports/libevent/CONTROL +++ b/ports/libevent/CONTROL @@ -1,5 +1,5 @@ Source: libevent -Version: 2.1.12 +Version: 2.1.11-5 Homepage: https://github.com/libevent/libevent Description: An event notification library Supports: !uwp diff --git a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch index 9566f152cc4b27..b444ae3e724047 100644 --- a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch +++ b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch @@ -1,13 +1,13 @@ diff --git a/cmake/LibeventConfig.cmake.in b/cmake/LibeventConfig.cmake.in -index 7b808c3..fbf67be 100644 +index 5422336..d436100 100644 --- a/cmake/LibeventConfig.cmake.in +++ b/cmake/LibeventConfig.cmake.in -@@ -58,7 +58,7 @@ endif() - - # Get the path of the current file. +@@ -8,7 +8,7 @@ get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) --get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE) -+get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../.." ABSOLUTE) - - macro(message_if_needed _flag _msg) - if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) + + # Set the include directories. +-set(LIBEVENT_INCLUDE_DIRS "@EVENT_INSTALL_INCLUDE_DIR@") ++set(LIBEVENT_INCLUDE_DIRS "${LIBEVENT_CMAKE_DIR}/../../include") + + # Include the project Targets file, this contains definitions for IMPORTED targets. + include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake) diff --git a/ports/libevent/fix-crt_linkage.patch b/ports/libevent/fix-crt_linkage.patch new file mode 100644 index 00000000000000..b766b455652ced --- /dev/null +++ b/ports/libevent/fix-crt_linkage.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bf333f3..5bc2a54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,7 +230,7 @@ endif() + + if (${MSVC}) + set(msvc_static_runtime OFF) +- if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC") ++ if ("${VCPKG_CRT_LINKAGE}" STREQUAL "STATIC") + set(msvc_static_runtime ON) + endif() + diff --git a/ports/libevent/fix-file_path.patch b/ports/libevent/fix-file_path.patch index fb34080f8790d8..179700b7ed2c17 100644 --- a/ports/libevent/fix-file_path.patch +++ b/ports/libevent/fix-file_path.patch @@ -1,22 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6e91c08..44b6e18 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1430,7 +1430,7 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in + # Calculate the relative directory from the Cmake dir. + file(RELATIVE_PATH + REL_INCLUDE_DIR +- "${EVENT_INSTALL_CMAKE_DIR}" ++ "${CURRENT_PACKAGES_DIR}/${EVENT_INSTALL_CMAKE_DIR}" + "${CMAKE_INSTALL_PREFIX}/include") + + # Note the LIBEVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in, diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake -index 04f5837..95d9808 100644 +index 9de4484..411ca9d 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake -@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) - install(TARGETS "${LIB_NAME}_${TYPE}" - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib -- RUNTIME DESTINATION "lib" COMPONENT lib -+ RUNTIME DESTINATION "bin" COMPONENT bin - COMPONENT dev - ) - else() -@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) - EXPORT LibeventTargets-${TYPE} - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib -- RUNTIME DESTINATION "lib" COMPONENT lib -+ RUNTIME DESTINATION "bin" COMPONENT bin - COMPONENT dev - ) - endif() +@@ -113,7 +113,7 @@ macro(add_event_library LIB_NAME) + EXPORT LibeventTargets + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT bin + PUBLIC_HEADER DESTINATION "include/event2" + COMPONENT dev + ) diff --git a/ports/libevent/portfile.cmake b/ports/libevent/portfile.cmake index 9865cecea3faae..bd44d8428a5a45 100644 --- a/ports/libevent/portfile.cmake +++ b/ports/libevent/portfile.cmake @@ -3,10 +3,11 @@ vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP" ON_TARG vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libevent/libevent - REF release-2.1.12-stable - SHA512 5d6c6f0072f69a68b190772d4c973ce8f33961912032cdc104ad0854c0950f9d7e28bc274ca9df23897937f0cd8e45d1f214543d80ec271c5a6678814a7f195e + REF release-2.1.11-stable + SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02 PATCHES fix-file_path.patch + fix-crt_linkage.patch fix-LibeventConfig_cmake_in_path.patch ) @@ -22,18 +23,13 @@ else() set(LIBEVENT_LIB_TYPE STATIC) endif() -if(VCPKG_CRT_LINKAGE STREQUAL "static") - set(LIBEVENT_STATIC_RUNTIME ON) -else() - set(LIBEVENT_STATIC_RUNTIME OFF) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} + -DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent -DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE} - -DEVENT__MSVC_STATIC_RUNTIME=${LIBEVENT_STATIC_RUNTIME} + -DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE} -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_REGRESS=ON @@ -42,28 +38,20 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent) +else () + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) +endif() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libevent/) file(RENAME ${CURRENT_PACKAGES_DIR}/bin/event_rpcgen.py ${CURRENT_PACKAGES_DIR}/tools/libevent/event_rpcgen.py) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -set(_target_suffix) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(_target_suffix static) -else() - set(_target_suffix shared) -endif() -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/libevent/LibeventTargets-${_target_suffix}.cmake - "${CURRENT_PACKAGES_DIR}" - "${CURRENT_INSTALLED_DIR}" -) - vcpkg_copy_pdbs() #Handle copyright diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index a5d4c20941d852..95dfbeb56ea68c 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,5 +1,4 @@ Source: libffi -Version: 3.3 -Port-Version: 4 +Version: 3.3-3 Homepage: https://github.com/libffi/libffi Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 7748d1cb63ca2e..3033319249ce1a 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -6,9 +6,6 @@ vcpkg_from_github( REF v3.3 SHA512 62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83 HEAD_REF master - PATCHES - win64-disable-stackframe-check.patch - win32-disable-stackframe-check.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libffi/win32-disable-stackframe-check.patch b/ports/libffi/win32-disable-stackframe-check.patch deleted file mode 100644 index 8fdca8b011ff19..00000000000000 --- a/ports/libffi/win32-disable-stackframe-check.patch +++ /dev/null @@ -1,50 +0,0 @@ -Rolf Gebhardt -22 Jul 2020 -[PATCH] x86/win32: disable runtime stack frame checks with msvc - around built assembly - -based on the patch for x86/win64: - -From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 -From: Matthew Waters -Date: Fri, 16 Mar 2018 15:10:04 +1100 -Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc - around built assembly - -MSVC can add truntime code that checks if a stack frame is mismanaged -however our custom assembly delibrately accesses and modifies the parent -stack frame. Fortunately we can disable that specific check for the -function call so do that. ---- - src/x86/ffi.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/src/x86/ffi.c b/src/x86/ffi.c -index 9a59218..9f5d703 100644 ---- a/src/x86/ffi.c -+++ b/src/x86/ffi.c -@@ -255,6 +255,14 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = { - - extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; - -+/* we perform some black magic here to use some of the parent's -+ * stack frame in ff_call_win() that breaks with the msvc compiler -+ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time -+ * error checking' for this function so we don't hit weird exceptions -+ * in debug builds */ -+#if defined(_MSC_VER) -+#pragma runtime_checks("s", off) -+#endif - static void - ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -@@ -390,6 +398,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - - ffi_call_i386 (frame, stack); - } -+#if defined(_MSC_VER) -+#pragma runtime_checks("s", restore) -+#endif - - void - ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libffi/win64-disable-stackframe-check.patch b/ports/libffi/win64-disable-stackframe-check.patch deleted file mode 100644 index ce3d3ca5574009..00000000000000 --- a/ports/libffi/win64-disable-stackframe-check.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 -From: Matthew Waters -Date: Fri, 16 Mar 2018 15:10:04 +1100 -Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc - around built assembly - -MSVC can add truntime code that checks if a stack frame is mismanaged -however our custom assembly delibrately accesses and modifies the parent -stack frame. Fortunately we can disable that specific check for the -function call so do that. ---- - src/x86/ffiw64.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/src/x86/ffiw64.c b/src/x86/ffiw64.c -index f7875252..88bb3a34 100644 ---- a/src/x86/ffiw64.c -+++ b/src/x86/ffiw64.c -@@ -106,6 +106,14 @@ EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) - return FFI_OK; - } - -+/* we perform some black magic here to use some of the parent's -+ * stack frame in ff_call_win64() that breaks with the msvc compiler -+ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time -+ * error checking' for this function so we don't hit weird exceptions -+ * in debug builds */ -+#if defined(_MSC_VER) -+#pragma runtime_checks("s", off) -+#endif - static void - ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -@@ -170,6 +178,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - - ffi_call_win64 (stack, frame, closure); - } -+#if defined(_MSC_VER) -+#pragma runtime_checks("s", restore) -+#endif - - void - EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 696e9fffb2ed5d..745494c7705fed 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,6 +1,5 @@ Source: libflac -Version: 1.3.3 -Port-Version: 3 +Version: 1.3.3-1 Homepage: https://xiph.org/flac/ Description: Library for manipulating FLAC files Build-Depends: libogg diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 36f7b997ee7612..72309d9bbaf900 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -9,20 +9,6 @@ vcpkg_from_github( "${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch" ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(BUILD_SHARED_LIBS ON) -else() - set(BUILD_SHARED_LIBS OFF) -endif() - -if(VCPKG_TARGET_IS_MINGW) - set(WITH_STACK_PROTECTOR OFF) - string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0") - string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0") -else() - set(WITH_STACK_PROTECTOR ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -30,9 +16,7 @@ vcpkg_configure_cmake( -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF - -DBUILD_TESTING=OFF - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR}) + -DBUILD_TESTING=OFF) vcpkg_install_cmake() vcpkg_fixup_cmake_targets( @@ -44,26 +28,7 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h - "#if defined(FLAC__NO_DLL)" - "#if 0" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h - "#if defined(FLAC__NO_DLL)" - "#if 0" - ) -else() - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h - "#if defined(FLAC__NO_DLL)" - "#if 1" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h - "#if defined(FLAC__NO_DLL)" - "#if 1" - ) -endif() - # This license (BSD) is relevant only for library - if someone would want to install # FLAC cmd line tools as well additional license (GPL) should be included -file(INSTALL ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright) diff --git a/ports/libftdi1/CONTROL b/ports/libftdi1/CONTROL index daab99f1793d30..d282ad9eb8d28a 100644 --- a/ports/libftdi1/CONTROL +++ b/ports/libftdi1/CONTROL @@ -1,4 +1,4 @@ Source: libftdi1 -Version: 1.4-1 +Version: 1.4 Build-Depends: libusb Description: FTDI USB driver with bitbang mode (v1.4) diff --git a/ports/libftdi1/portfile.cmake b/ports/libftdi1/portfile.cmake index e05ccca2064556..4007e91220b3f5 100644 --- a/ports/libftdi1/portfile.cmake +++ b/ports/libftdi1/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_download_distfile(ARCHIVE URLS "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.4.tar.bz2" FILENAME "libftdi1-1.4.tar.bz2" @@ -24,6 +26,7 @@ vcpkg_configure_cmake( -DEXAMPLES=OFF -DPYTHON_BINDINGS=OFF -DLINK_PYTHON_LIBRARY=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON -DCMAKE_DISABLE_FIND_PACKAGE_Confuse=ON @@ -38,10 +41,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libftdi1 TARGET_PATH share/libft file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libftdi1) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libftdi1/LICENSE ${CURRENT_PACKAGES_DIR}/share/libftdi1/copyright) vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libgpod/CMakeLists.txt b/ports/libgpod/CMakeLists.txt index ea1294906ee3ae..233efc72231f26 100644 --- a/ports/libgpod/CMakeLists.txt +++ b/ports/libgpod/CMakeLists.txt @@ -4,7 +4,7 @@ project (libgpod C) option(WITH_INTERNAL_GCHECKSUM OFF) -find_package(unofficial-sqlite3 CONFIG REQUIRED) +find_package(sqlite3 CONFIG REQUIRED) include(SelectLibraryConfigurations) find_path(glib_PATH glib.h PATHS include) @@ -66,7 +66,7 @@ if (WITH_INTERNAL_GCHECKSUM) endif() target_compile_definitions(libgpod PRIVATE -DLIBGPOD_BLOB_DIR=\"${LIBGPOD_BLOB_DIR}\" -DGETTEXT_PACKAGE="libgpod") -target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} unofficial::sqlite3::sqlite3) +target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} sqlite3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/itdb.h DESTINATION include/libgpod/gpod) diff --git a/ports/libgpod/CONTROL b/ports/libgpod/CONTROL index 2d6fe295cbb868..01134d30349476 100644 --- a/ports/libgpod/CONTROL +++ b/ports/libgpod/CONTROL @@ -1,6 +1,5 @@ Source: libgpod Version: 2019-08-29 -Port-Version: 1 Homepage: https://github.com/fadingred/libgpod Description: libgpod is a library meant to abstract access to an iPod content. Build-Depends: glib, libplist, sqlite3 \ No newline at end of file diff --git a/ports/libheif/CONTROL b/ports/libheif/CONTROL deleted file mode 100644 index c6dc34356082a4..00000000000000 --- a/ports/libheif/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: libheif -Version: 1.7.0 -Port-Version: 1 -Homepage: http://www.libheif.org/ -Description: Open h.265 video codec implementation. -Build-Depends: x265, libde265 diff --git a/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch b/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch deleted file mode 100644 index 78bab905a380dc..00000000000000 --- a/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4463476..3a5cfbc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -80,6 +80,6 @@ configure_file(libheif.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - --add_subdirectory (examples) -+#add_subdirectory (examples) - add_subdirectory (libheif) --add_subdirectory (gdk-pixbuf) -+#add_subdirectory (gdk-pixbuf) diff --git a/ports/libheif/install-extra-headers.patch b/ports/libheif/install-extra-headers.patch deleted file mode 100644 index eb32ee8a408dab..00000000000000 --- a/ports/libheif/install-extra-headers.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt -index 6d683ec..dc2c4eb 100644 ---- a/libheif/CMakeLists.txt -+++ b/libheif/CMakeLists.txt -@@ -17,6 +17,7 @@ set(libheif_headers - heif_plugin_registry.h - heif_limits.h - heif_plugin.h -+ heif_cxx.h - logging.h - ${CMAKE_CURRENT_BINARY_DIR}/heif_version.h - ) diff --git a/ports/libheif/portfile.cmake b/ports/libheif/portfile.cmake deleted file mode 100644 index 97068d449bae66..00000000000000 --- a/ports/libheif/portfile.cmake +++ /dev/null @@ -1,21 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO strukturag/libheif - REF v1.7.0 - SHA512 7da6ab9daf253c2493e0c3960c6f817e0234dfbd0463467cd1e5f11f7d6804735e401b73fb1038b8f81cfc6527fafb6ac7f4668c3de9400a0131c1292bdbe660 - HEAD_REF master - PATCHES - dont_build_examples_and_gdk_pixbuf.patch - remove_finding_pkgconfig.patch - install-extra-headers.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libheif/) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libheif/remove_finding_pkgconfig.patch b/ports/libheif/remove_finding_pkgconfig.patch deleted file mode 100644 index ed8913a22b352b..00000000000000 --- a/ports/libheif/remove_finding_pkgconfig.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3a5cfbc..9a3046e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -52,10 +52,9 @@ if (has_potentially_evaluated_expression) - endif() - - if (UNIX) -- find_package(PkgConfig) -- pkg_check_modules(LIBDE265 libde265) -- pkg_check_modules(X265 x265) -- pkg_check_modules(AOM aom) -+ find_package(libde265) -+ find_package(x265) -+ find_package(aom) - endif() - - # Create libheif pkgconfig file diff --git a/ports/libigl/CONTROL b/ports/libigl/CONTROL index 496f735700ffeb..90c5313fbd8572 100644 --- a/ports/libigl/CONTROL +++ b/ports/libigl/CONTROL @@ -1,9 +1,8 @@ Source: libigl -Version: 2.2.0 +Version: 2.1.0-2 Homepage: https://github.com/libigl/libigl Description: libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB. Build-Depends: eigen3 -Supports: !(arm|uwp) Feature: embree Description: Build with embree @@ -21,6 +20,18 @@ Feature: imgui Description: Build with imgui Build-Depends: imgui[bindings] +Feature: png +Description: Build with libpng +Build-Depends: libpng, stb + Feature: xml Description: Build with libxml Build-Depends: tinyxml2 + +Feature: python +Description: Build with python bind +Build-Depends: pybind11 + +Feature: test +Description: Build test +Build-Depends: catch2 \ No newline at end of file diff --git a/ports/libigl/fix-dependency.patch b/ports/libigl/fix-dependency.patch index e891e341efac4a..06e3d0f7d00064 100644 --- a/ports/libigl/fix-dependency.patch +++ b/ports/libigl/fix-dependency.patch @@ -1,51 +1,47 @@ -diff --git a/cmake/LibiglWindows.cmake b/cmake/LibiglWindows.cmake -index b98aa55..46c68a7 100644 ---- a/cmake/LibiglWindows.cmake -+++ b/cmake/LibiglWindows.cmake -@@ -1,4 +1,4 @@ --if(MSVC) -+if(0) - option(IGL_STATIC_RUNTIME "Use libigl with the static MSVC runtime." OFF) - if(IGL_STATIC_RUNTIME) - message(STATUS "MSVC -> forcing use of statically-linked runtime.") diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake -index d07bbb3..a33cefa 100644 +index 7016cbf..3a6b4dd 100644 --- a/cmake/libigl.cmake +++ b/cmake/libigl.cmake -@@ -107,7 +107,8 @@ if(HUNTER_ENABLED) +@@ -96,8 +96,9 @@ if(UNIX) endif() # Eigen --if(NOT TARGET Eigen3::Eigen) -+find_package(Eigen3 CONFIG REQUIRED) -+if(0) +-if(TARGET Eigen3::Eigen) ++if(1) + # If an imported target already exists, use it ++ find_package(Eigen3 CONFIG REQUIRED) + target_link_libraries(igl_common INTERFACE Eigen3::Eigen) + else() igl_download_eigen() - add_library(igl_eigen INTERFACE) - target_include_directories(igl_eigen SYSTEM INTERFACE -@@ -296,9 +297,9 @@ endif() +@@ -182,7 +183,7 @@ compile_igl_module("core" ${SOURCES_IGL}) ################################################################################ - ### Compile the embree part ### - if(LIBIGL_WITH_EMBREE) -- set(EMBREE_DIR "${LIBIGL_EXTERNAL}/embree") -+ find_package(embree 3 CONFIG REQUIRED) + ### Download the python part ### + if(LIBIGL_WITH_PYTHON) +- igl_download_pybind11() ++ #igl_download_pybind11() + endif() + + ################################################################################ +@@ -281,7 +282,8 @@ if(LIBIGL_WITH_EMBREE) + set(EMBREE_STATIC_RUNTIME ON CACHE BOOL " " FORCE) + endif() - if(NOT TARGET embree) ++ find_package(embree 3 CONFIG REQUIRED) + if(0) + # TODO: Should probably save/restore the CMAKE_CXX_FLAGS_*, since embree seems to be + # overriding them on Windows. But well... it works for now. igl_download_embree() - - set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "") -@@ -315,8 +316,8 @@ if(LIBIGL_WITH_EMBREE) +@@ -289,7 +291,7 @@ if(LIBIGL_WITH_EMBREE) endif() compile_igl_module("embree") - target_link_libraries(igl_embree ${IGL_SCOPE} embree) -- target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) -+ target_link_libraries(igl_embree ${IGL_SCOPE} ${EMBREE_LIBRARIES}) -+ target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_INCLUDE_DIRS}) ++ target_link_libraries(igl_embree ${IGL_SCOPE} sys math simd embree) + target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) target_compile_definitions(igl_embree ${IGL_SCOPE} -DEMBREE_STATIC_LIB) endif() - -@@ -358,11 +359,12 @@ if(LIBIGL_WITH_OPENGL) +@@ -332,11 +334,12 @@ if(LIBIGL_WITH_OPENGL) endif() # glad module @@ -60,17 +56,17 @@ index d07bbb3..a33cefa 100644 endif() ################################################################################ -@@ -371,7 +373,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) +@@ -345,7 +348,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) if(TARGET igl::opengl) # GLFW module compile_igl_module("opengl/glfw") - if(NOT TARGET glfw) + find_package(glfw3 CONFIG REQUIRED) + if(0) - igl_download_glfw() - option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) - option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) -@@ -394,11 +397,12 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) + set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) + set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE) + set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE) +@@ -363,9 +367,10 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) if(TARGET igl::opengl_glfw) # ImGui module compile_igl_module("opengl/glfw/imgui") @@ -78,14 +74,12 @@ index d07bbb3..a33cefa 100644 + find_package(imgui CONFIG REQUIRED) + if(0) igl_download_imgui() - add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) +- add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) ++ add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui::imgui) endif() -- target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) -+ target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui::imgui) + target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) endif() - endif() - -@@ -408,12 +412,22 @@ if(LIBIGL_WITH_PNG) +@@ -377,12 +382,21 @@ if(LIBIGL_WITH_PNG) # png/ module is anomalous because it also depends on opengl it really should # be moved into the opengl/ directory and namespace ... if(TARGET igl_opengl) @@ -93,7 +87,6 @@ index d07bbb3..a33cefa 100644 + find_path(stb_include_dir stb.h) + find_package(opengl REQUIRED) + find_package(libpng CONFIG REQUIRED) -+ find_package(glad CONFIG REQUIRED) + if (BUILD_SHARED_LIBS) + set(libpng_LIBRARIES png) + else() @@ -105,12 +98,12 @@ index d07bbb3..a33cefa 100644 endif() compile_igl_module("png" "") - target_link_libraries(igl_png ${IGL_SCOPE} igl_stb_image igl_opengl) -+ target_include_directories(igl_png INTERFACE ${stb_include_dir}) -+ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES} glad::glad) ++ target_include_directories(igl_png PUBLIC ${stb_include_dir}) ++ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES}) endif() endif() -@@ -461,7 +475,8 @@ endif() +@@ -430,7 +444,8 @@ endif() ### Compile the xml part ### if(LIBIGL_WITH_XML) set(TINYXML2_DIR "${LIBIGL_EXTERNAL}/tinyxml2") @@ -120,7 +113,7 @@ index d07bbb3..a33cefa 100644 igl_download_tinyxml2() add_library(tinyxml2 STATIC ${TINYXML2_DIR}/tinyxml2.cpp ${TINYXML2_DIR}/tinyxml2.h) target_include_directories(tinyxml2 PUBLIC ${TINYXML2_DIR}) -@@ -471,7 +486,7 @@ if(LIBIGL_WITH_XML) +@@ -440,7 +455,7 @@ if(LIBIGL_WITH_XML) SOVERSION "3") endif() compile_igl_module("xml") @@ -143,26 +136,20 @@ index 1d3e3bc..682b6d7 100644 #include #include diff --git a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -index 47de487..6c607de 100644 +index 3939b03..835b208 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp +++ b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -@@ -9,10 +9,10 @@ +@@ -9,7 +9,7 @@ #include "ImGuiMenu.h" #include "ImGuiHelpers.h" #include -#include --#include --#include --#include +#include -+#include -+#include -+#include - #include - #include - //////////////////////////////////////////////////////////////////////////////// + #include + #include + #include diff --git a/include/igl/opengl/glfw/imgui/ImGuiTraits.h b/include/igl/opengl/glfw/imgui/ImGuiTraits.h -index 7dae22a..e6911c5 100644 +index fbc892f..e8828b1 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiTraits.h +++ b/include/igl/opengl/glfw/imgui/ImGuiTraits.h @@ -8,7 +8,7 @@ @@ -174,11 +161,30 @@ index 7dae22a..e6911c5 100644 // Extend ImGui by populating its namespace directly namespace ImGui +diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt +index 7a14775..f5c84a8 100644 +--- a/python/CMakeLists.txt ++++ b/python/CMakeLists.txt +@@ -23,8 +23,8 @@ endif() + # set(PYTHON_INCLUDE_DIR "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m") + + set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7) +-find_package(PythonInterp 3.4 REQUIRED) +-find_package(PythonLibs 3.4 REQUIRED) ++find_package(PythonInterp REQUIRED) ++find_package(PythonLibs REQUIRED) + + ## libigl + if(NOT TARGET igl::core) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 273324d..cefbd52 100644 +index 8a0af13..5c6a350 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt -@@ -15,12 +15,11 @@ igl_download_test_data() +@@ -11,16 +11,14 @@ else() + endif() + + ### Download data +-igl_download_test_data() set(IGL_TEST_DATA ${LIBIGL_EXTERNAL}/../tests/data) ### Download Catch2 unit test framework @@ -193,7 +199,7 @@ index 273324d..cefbd52 100644 # Create test executable diff --git a/tutorial/106_ViewerMenu/main.cpp b/tutorial/106_ViewerMenu/main.cpp -index cc514e5..f1be538 100644 +index 09f3272..9e1a19d 100644 --- a/tutorial/106_ViewerMenu/main.cpp +++ b/tutorial/106_ViewerMenu/main.cpp @@ -2,7 +2,7 @@ diff --git a/ports/libigl/portfile.cmake b/ports/libigl/portfile.cmake index d3e342b5b6abf5..6407ca812639eb 100644 --- a/ports/libigl/portfile.cmake +++ b/ports/libigl/portfile.cmake @@ -1,12 +1,10 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp") -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libigl/libigl - REF 3cb4894eaf8ea4610467189ca292be349425d44b #2.2.0 - SHA512 339f96e36b6a99ae8301ec2e234e18cecba7b7c42289ed68a26c20b279dce3135405f9b49e292c321fba962d56c083ae61831057bec9a19ad1495e2afa379b8b + REF f6b406427400ed7ddb56cfc2577b6af571827c8c #2.1.0 + SHA512 262f0b16e6c018d86d11a7cc90f8f4f8088fa7190634a7cd5cc392ebdefe47e2218b4f9276e411498ae0001d66d0207f4108c87c5090e3a39df4a2760930e945 HEAD_REF master PATCHES fix-dependency.patch ) @@ -16,9 +14,10 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(LIBIGL_BUILD_STATIC ON) endif() -if ("imgui" IN_LIST FEATURES AND VCPKG_LIBRARY_LINKAGE STREQUAL static) - # Remove this after add port libigl-imgui - message(FATAL_ERROR "Feature imgui does not support static build currentlly") +if ("python" IN_LIST FEATURES) + vcpkg_find_acquire_program(PYTHON2) + get_filename_component(PYTHON2_DIR ${PYTHON2} DIRECTORY) + set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}") endif() if ("test" IN_LIST FEATURES AND NOT EXISTS ${SOURCE_PATH}/tests/data) @@ -38,9 +37,10 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS opengl LIBIGL_WITH_OPENGL glfw LIBIGL_WITH_OPENGL_GLFW imgui LIBIGL_WITH_OPENGL_GLFW_IMGUI - #png LIBIGL_WITH_PNG # Disable this feature due to issue https://github.com/libigl/libigl/issues/1199 + png LIBIGL_WITH_PNG xml LIBIGL_WITH_XML - #python LIBIGL_WITH_PYTHON # Python binding are in the process of being redone. + python LIBIGL_WITH_PYTHON + test LIBIGL_BUILD_TESTS ) vcpkg_configure_cmake( @@ -55,9 +55,7 @@ vcpkg_configure_cmake( -DLIBIGL_WITH_TRIANGLE=OFF -DLIBIGL_WITH_PREDICATES=OFF -DLIBIGL_BUILD_TUTORIALS=OFF - -DLIBIGL_WITH_PNG=OFF - -DLIBIGL_BUILD_TESTS=OFF - -DPYTHON_EXECUTABLE=${PYTHON2} + -DPYTHON_EXECUTABLE=${PYTHON2} ) vcpkg_install_cmake() @@ -72,3 +70,4 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE.GPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index dc9d0fda86c7e5..e95b13c3c0d49e 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,5 +1,4 @@ Source: liblzma Version: 5.2.5 -Port-Version: 1 Homepage: https://github.com/xz-mirror/xz Description: Compression library with an API similar to that of zlib. diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index c29dbafedc367e..acc0dbaaa9b01d 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -68,13 +68,9 @@ set(LZMA_FOUND TRUE CACHE BOOL \"\") set(LIBLZMA_FOUND TRUE CACHE BOOL \"\") ") -file(READ ${CURRENT_PACKAGES_DIR}/include/lzma.h _contents) -if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(LZMA_API_STATIC)" "1" _contents "${_contents}") -else() - string(REPLACE "defined(LZMA_API_STATIC)" "0" _contents "${_contents}") +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(APPEND ${CURRENT_PACKAGES_DIR}/share/liblzma/LibLZMAConfig.cmake "add_definitions(-DLZMA_API_STATIC)") endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/lzma.h "${_contents}") if (VCPKG_BUILD_TYPE STREQUAL debug) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include) diff --git a/ports/libmagic/CONTROL b/ports/libmagic/CONTROL index 750b6513901124..07fce2a682e2b0 100644 --- a/ports/libmagic/CONTROL +++ b/ports/libmagic/CONTROL @@ -1,5 +1,4 @@ Source: libmagic -Version: 5.37 -Port-Version: 2 +Version: 5.37-1 Homepage: https://github.com/file/file -Description: This library can be used to classify files according to magic number tests. +Description: This library can be used to classify files according to magic number tests. \ No newline at end of file diff --git a/ports/libmagic/portfile.cmake b/ports/libmagic/portfile.cmake index 363fa148f3f4da..65fe8d8ab6cbfe 100644 --- a/ports/libmagic/portfile.cmake +++ b/ports/libmagic/portfile.cmake @@ -7,7 +7,6 @@ vcpkg_from_github( ) vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index d3b39d0afc406a..6507c55c71c49e 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,14 +1,4 @@ Source: libmariadb -Version: 3.1.7 -Port-Version: 2 +Version: 3.1.7-1 Homepage: https://github.com/MariaDB/mariadb-connector-c Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases -Default-Features: zlib, openssl - -Feature: zlib -Build-Depends: zlib -Description: Use internal zlib - -Feature: openssl -Build-Depends: openssl -Description: Enable SSL support diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index 6943c934c0bb88..06f54bb41d55e3 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -8,7 +8,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO MariaDB/mariadb-connector-c - REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 + REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 SHA512 b663effe7794d997c0589a9a20dab6b7359414612e60e3cb43e3fd0ddeae0391bcbc2d816cba4a7438602566ad6781cbf8e18b0062f1d37a2b2bd521af16033c HEAD_REF master PATCHES @@ -17,17 +17,12 @@ vcpkg_from_github( fix-InstallPath.patch ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - zlib WITH_EXTERNAL_ZLIB - openssl WITH_SSL -) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - ${FEATURE_OPTIONS} -DWITH_UNITTEST=OFF + -DWITH_SSL=OFF -DWITH_CURL=OFF ) diff --git a/ports/libmodbus/CMakeLists.txt b/ports/libmodbus/CMakeLists.txt index 618ba5f6cb8992..c08abe838c3026 100644 --- a/ports/libmodbus/CMakeLists.txt +++ b/ports/libmodbus/CMakeLists.txt @@ -59,10 +59,9 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) if(BUILD_SHARED_LIBS) add_compile_options(-DDLLBUILD=ON) -else() - add_compile_options(-DLIBBUILD=ON) endif() + set(MODBUS_PUBLIC_HEADERS src/modbus-rtu.h src/modbus-tcp.h diff --git a/ports/libmodbus/CONTROL b/ports/libmodbus/CONTROL new file mode 100644 index 00000000000000..cb3f5a295b73e6 --- /dev/null +++ b/ports/libmodbus/CONTROL @@ -0,0 +1,3 @@ +Source: libmodbus +Version: 3.1.6 +Description: libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol diff --git a/ports/libmodbus/fix-static-linkage.patch b/ports/libmodbus/fix-static-linkage.patch deleted file mode 100644 index 7d7ae79f509e66..00000000000000 --- a/ports/libmodbus/fix-static-linkage.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/modbus.h b/src/modbus.h -index fbe20bc..895d05d 100644 ---- a/src/modbus.h -+++ b/src/modbus.h -@@ -24,6 +24,8 @@ - # if defined(DLLBUILD) - /* define DLLBUILD when building the DLL */ - # define MODBUS_API __declspec(dllexport) -+# elif defined(LIBBUILD) -+# define MODBUS_API - # else - # define MODBUS_API __declspec(dllimport) - # endif diff --git a/ports/libmodbus/portfile.cmake b/ports/libmodbus/portfile.cmake index a607f5a9ed6b8d..fda250e4f33310 100644 --- a/ports/libmodbus/portfile.cmake +++ b/ports/libmodbus/portfile.cmake @@ -1,32 +1,27 @@ -vcpkg_fail_port_install(ON_TARGET "uwp") +include(vcpkg_common_functions) vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO stephane/libmodbus - REF v3.1.6 - SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 - HEAD_REF master - PATCHES fix-static-linkage.patch + OUT_SOURCE_PATH SOURCE_PATH + REPO stephane/libmodbus + REF v3.1.6 + SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 + HEAD_REF master ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${CMAKE_CURRENT_LIST_DIR}/config.h.cmake DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( - SOURCE_PATH "${SOURCE_PATH}" - PREFER_NINJA - OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=ON + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) -if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/modbus.h "elif defined(LIBBUILD)" "elif 1") -endif() - # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmodbus RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) \ No newline at end of file +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/libmodbus/vcpkg.json b/ports/libmodbus/vcpkg.json deleted file mode 100644 index cea78893150e31..00000000000000 --- a/ports/libmodbus/vcpkg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "libmodbus", - "version-string": "3.1.6", - "port-version": 1, - "description": "libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol", - "homepage": "https://github.com/stephane/libmodbus", - "supports": "!uwp" -} diff --git a/ports/libmodman/CONTROL b/ports/libmodman/CONTROL index 21b45a2c6ea368..c1fd4cd49c5bf2 100644 --- a/ports/libmodman/CONTROL +++ b/ports/libmodman/CONTROL @@ -1,5 +1,5 @@ Source: libmodman -Version: 2.0.1-2 +Version: 2.0.1-1 Homepage: https://code.google.com/p/libmodman Description: a simple library for managing modules diff --git a/ports/libmodman/vcpkg-cmake-wrapper.cmake b/ports/libmodman/vcpkg-cmake-wrapper.cmake index f3722577475339..6d67806f51b153 100644 --- a/ports/libmodman/vcpkg-cmake-wrapper.cmake +++ b/ports/libmodman/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(LIBMODMAN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT LIBMODMAN_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${LIBMODMAN_PREV_MODULE_PATH}) diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index e0689fa91f3a36..8a62ab9a876df2 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) -find_package(unofficial-sqlite3 CONFIG) +find_package(sqlite3 CONFIG) configure_file(config.unix.h.in odb/sqlite/details/config.h COPYONLY) set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") @@ -17,7 +17,7 @@ target_include_directories(libodb-sqlite $ ) -target_link_libraries(libodb-sqlite PRIVATE odb::libodb unofficial::sqlite3::sqlite3) +target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3) if(BUILD_SHARED_LIBS) target_compile_definitions(libodb-sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB diff --git a/ports/libodb-sqlite/CONTROL b/ports/libodb-sqlite/CONTROL index ae35fc37219ab1..e7afd76e0ef20e 100644 --- a/ports/libodb-sqlite/CONTROL +++ b/ports/libodb-sqlite/CONTROL @@ -1,6 +1,5 @@ Source: libodb-sqlite -Version: 2.4.0 -Port-Version: 7 +Version: 2.4.0-6 Homepage: https://www.codesynthesis.com/products/odb/ Description: Sqlite support for the ODB ORM library Build-Depends: libodb, sqlite3 diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 988f95ebf9e65a..0258a720e625ff 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,6 +1,5 @@ Source: libpng -Version: 1.6.37 -Port-Version: 11 +Version: 1.6.37-9 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/libpng/pkgconfig.2.patch b/ports/libpng/pkgconfig.2.patch deleted file mode 100644 index 99c1b19300d950..00000000000000 --- a/ports/libpng/pkgconfig.2.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6451fcf..4090f42 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -821,20 +821,31 @@ endif() - # Only do this on Windows for Cygwin - the files don't make much sense outside - # of a UNIX look-alike. - if(NOT WIN32 OR CYGWIN OR MINGW) -- set(prefix ${CMAKE_INSTALL_PREFIX}) -- set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -- set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) -- set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) -- set(LIBS "-lz -lm") -- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in -- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) -- create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) -- -- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in -- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) -- create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) -+ set(LIBS "-lz") -+ if(NOT APPLE) -+ string(APPEND LIBS " -lm") -+ endif() -+else() -+ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(LIBS "-lzlibd") -+ else() -+ set(LIBS "-lzlib") -+ endif() - endif() - -+set(prefix ${CMAKE_INSTALL_PREFIX}) -+set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -+set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) -+set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) -+ -+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in -+ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) -+create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) -+ -+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in -+ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) -+create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) -+ - # SET UP LINKS - if(PNG_SHARED) - set_target_properties(png PROPERTIES diff --git a/ports/libpng/pkgconfig.patch b/ports/libpng/pkgconfig.patch deleted file mode 100644 index 5640f3834ca44c..00000000000000 --- a/ports/libpng/pkgconfig.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6599e1d7d..c0bb2fad2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -894,13 +894,13 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) - install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) - install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) - # Install pkg-config files -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config -- DESTINATION bin) -+ DESTINATION tools/libpng) -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config -- DESTINATION bin) -+ DESTINATION tools/libpng) - endif() diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index d366283b1ebc62..28fee46f3a4522 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -14,13 +14,16 @@ if ("apng" IN_LIST FEATURES) FILENAME "${LIBPNG_APG_PATCH_NAME}.gz" SHA512 226adcb3a8c60f2267fe2976ab531329ae43c2603dab4d0cf8f16217d64069936b879f3d6516b75d259c47d6f5c5b1f24f887602206c8e46abde0fb7f5c7946b ) + vcpkg_find_acquire_program(7Z) + vcpkg_execute_required_process( COMMAND ${7Z} x ${LIBPNG_APNG_PATCH_ARCHIVE} -aoa WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src LOGNAME extract-patch.log ) endif() + set(APNG_EXTRA_PATCH ${LIBPNG_APG_PATCH_PATH}) set(LIBPNG_APNG_OPTION "-DPNG_PREFIX=a") endif() @@ -34,8 +37,6 @@ vcpkg_from_github( PATCHES use_abort.patch cmake.patch - pkgconfig.patch - pkgconfig.2.patch ${APNG_EXTRA_PATCH} ) @@ -61,7 +62,6 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DPNG_MAN_DIR=share/${PORT}/man ${LIBPNG_APNG_OPTION} ${LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION} ${LD_VERSION_SCRIPT_OPTION} @@ -71,65 +71,15 @@ vcpkg_configure_cmake( -DPNG_TESTS=OFF -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON - -DSKIP_INSTALL_FILES=OFF - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON + -DSKIP_INSTALL_FILES=ON + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON ) + vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpng) -set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng16.pc") -if(EXISTS ${_file}) - file(READ "${_file}" _contents) - if(VCPKG_TARGET_IS_WINDOWS) - string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") - else() - string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") - endif() - if(VCPKG_TARGET_IS_MINGW) - string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") - else() - string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") - endif() - file(WRITE "${_file}" "${_contents}") -endif() -set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng.pc") -if(EXISTS ${_file}) - file(READ "${_file}" _contents) - if(VCPKG_TARGET_IS_WINDOWS) - string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") - else() - string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") - endif() - if(VCPKG_TARGET_IS_MINGW) - string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") - else() - string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") - endif() - file(WRITE "${_file}" "${_contents}") -endif() -if(VCPKG_TARGET_IS_WINDOWS) - set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng16.pc") - if(EXISTS ${_file}) - file(READ "${_file}" _contents) - string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") - if(VCPKG_TARGET_IS_MINGW) - string(REPLACE "-lz" "-lzlib" _contents "${_contents}") - endif() - file(WRITE "${_file}" "${_contents}") - endif() - set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng.pc") - if(EXISTS ${_file}) - file(READ "${_file}" _contents) - string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") - if(VCPKG_TARGET_IS_MINGW) - string(REPLACE "-lz" "-lzlib" _contents "${_contents}") - endif() - file(WRITE "${_file}" "${_contents}") - endif() -endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index e42dd5f5e20c60..cd63f76717490f 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,6 +1,6 @@ Source: libpq Version: 12.2 -Port-Version: 6 +Port-Version: 5 Build-Depends: libpq[bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 3d147104e2d3f1..756e20d1b2e383 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -67,11 +67,7 @@ vcpkg_extract_source_archive_ex( ) unset(buildenv_contents) # Get paths to required programs -set(REQUIRED_PROGRAMS PERL) -if(VCPKG_TARGET_IS_WINDOWS) - list(APPEND REQUIRED_PROGRAMS BISON FLEX) -endif() -foreach(program_name ${REQUIRED_PROGRAMS}) +foreach(program_name BISON FLEX PERL) # Need to rename win_bison and win_flex to just bison and flex vcpkg_find_acquire_program(${program_name}) get_filename_component(${program_name}_EXE_PATH ${${program_name}} DIRECTORY) diff --git a/ports/libproxy/CONTROL b/ports/libproxy/CONTROL index 1855f9947a3e46..051420c855651a 100644 --- a/ports/libproxy/CONTROL +++ b/ports/libproxy/CONTROL @@ -1,5 +1,5 @@ Source: libproxy -Version: 0.4.15-2 +Version: 0.4.15-1 Homepage: https://github.com/libproxy/libproxy Description: libproxy is a library that provides automatic proxy configuration management. Build-Depends: libmodman diff --git a/ports/libproxy/vcpkg-cmake-wrapper.cmake b/ports/libproxy/vcpkg-cmake-wrapper.cmake index 63158432bc5ae4..31c99f39f07d25 100644 --- a/ports/libproxy/vcpkg-cmake-wrapper.cmake +++ b/ports/libproxy/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(LIBPROXY_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT LIBPROXY_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${LIBPROXY_PREV_MODULE_PATH}) diff --git a/ports/libraqm/CMakeLists.txt b/ports/libraqm/CMakeLists.txt index 9ad1db64a6bc86..22f4e59d9d98d0 100644 --- a/ports/libraqm/CMakeLists.txt +++ b/ports/libraqm/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(harfbuzz CONFIG REQUIRED) find_path(HARFBUZZ_INCLUDE_DIRS NAMES hb.h PATH_SUFFIXES harfbuzz) -find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2) +find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h) configure_file(src/raqm-version.h.in src/raqm-version.h) diff --git a/ports/libraqm/CONTROL b/ports/libraqm/CONTROL index 460e66c1676a97..d768af76f72dda 100644 --- a/ports/libraqm/CONTROL +++ b/ports/libraqm/CONTROL @@ -1,5 +1,4 @@ Source: libraqm -Version: 0.7.0 -Port-Version: 2 +Version: 0.7.0-1 Description: A library for complex text layout Build-Depends: freetype, harfbuzz, fribidi \ No newline at end of file diff --git a/ports/librdkafka/CONTROL b/ports/librdkafka/CONTROL index 12f1ae21bde613..f88fa9bb325cac 100644 --- a/ports/librdkafka/CONTROL +++ b/ports/librdkafka/CONTROL @@ -1,5 +1,5 @@ Source: librdkafka -Version: 1.5.0 +Version: 1.2.0-2 Description: The Apache Kafka C/C++ library Homepage: https://github.com/edenhill/librdkafka diff --git a/ports/librdkafka/portfile.cmake b/ports/librdkafka/portfile.cmake index 5ae2b695e846e9..f64aa17f069f22 100644 --- a/ports/librdkafka/portfile.cmake +++ b/ports/librdkafka/portfile.cmake @@ -1,8 +1,10 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO edenhill/librdkafka - REF 39796d359898c07ea422849e6d7cd34cd13ec466 #v1.5.0 - SHA512 96bc1e1063d4387483f955315a8523045a308aba5fc40197c805f14ceb12ff5241f98b6937c41ab84094fe39e034e8b11ba66dd4d69a758b6ecb20d56d78cbfe + REF v1.2.0 + SHA512 7caddeec09bd1556688f0011f5cae49f8b0cde55b8dbc1296b3d2a39879badc42b7f59369bb1938ce7c4c4ff8b0fe4f1973b923c3db603466c10a4c015306522 HEAD_REF master PATCHES fix-arm64.patch @@ -76,3 +78,6 @@ configure_file(${SOURCE_PATH}/LICENSES.txt ${CURRENT_PACKAGES_DIR}/share/${PORT} # Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) + +# CMake integration test +vcpkg_test_cmake(PACKAGE_NAME RdKafka) diff --git a/ports/libressl/CONTROL b/ports/libressl/CONTROL index 2b7d62ec20a9a6..a5dfd10c70e388 100644 --- a/ports/libressl/CONTROL +++ b/ports/libressl/CONTROL @@ -1,6 +1,5 @@ Source: libressl -Version: 2.9.1 -Port-Version: 3 +Version: 2.9.1-2 Description: LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes. Supports: !(uwp|arm) diff --git a/ports/libressl/portfile.cmake b/ports/libressl/portfile.cmake index 7e37c207edd966..5c8e5b964ce65d 100644 --- a/ports/libressl/portfile.cmake +++ b/ports/libressl/portfile.cmake @@ -1,17 +1,26 @@ +cmake_minimum_required(VERSION 3.13) + if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") message(WARNING "Can't build libressl if openssl is installed. Please remove openssl, and try install libressl again if you need it. Build will continue since libressl is a subset of openssl") set(VCPKG_POLICY_EMPTY_PACKAGE enabled) return() endif() -vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(FATAL_ERROR "${PORT} does not currently support UWP") +endif() +if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + message(FATAL_ERROR "${PORT} does not support ARM") +endif() + +include(vcpkg_common_functions) set(LIBRESSL_VERSION 2.9.1) set(LIBRESSL_HASH 7051911e566bb093c48a70da72c9981b870e3bf49a167ba6c934eece873084cc41221fbe3cd0c8baba268d0484070df7164e4b937854e716337540a87c214354) vcpkg_download_distfile( LIBRESSL_SOURCE_ARCHIVE - URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz https://ftp.fau.de/openbsd/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz + URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz FILENAME ${PORT}-${LIBRESSL_VERSION}.tar.gz SHA512 ${LIBRESSL_HASH} ) @@ -25,15 +34,16 @@ vcpkg_extract_source_archive_ex( 0002-suppress-msvc-warnings.patch ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "tools" LIBRESSL_APPS -) +set(LIBRESSL_APPS OFF) +if("tools" IN_LIST FEATURES) + set(LIBRESSL_APPS ON) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - ${FEATURE_OPTIONS} + -DLIBRESSL_APPS=${LIBRESSL_APPS} -DLIBRESSL_TESTS=OFF OPTIONS_DEBUG -DLIBRESSL_APPS=OFF @@ -41,8 +51,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if("tools" IN_LIST FEATURES) - if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) +if(LIBRESSL_APPS) + if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) set(EXECUTABLE_SUFFIX .exe) endif() file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl") @@ -63,12 +73,15 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" ) +if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") +endif() vcpkg_copy_pdbs() file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -if((VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) +if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) file(GLOB_RECURSE LIBS "${CURRENT_PACKAGES_DIR}/*.lib") foreach(LIB ${LIBS}) string(REGEX REPLACE "(.+)-[0-9]+\\.lib" "\\1.lib" LINK "${LIB}") diff --git a/ports/libsndfile/CONTROL b/ports/libsndfile/CONTROL index 913af809d22801..ed59ac139eaf4c 100644 --- a/ports/libsndfile/CONTROL +++ b/ports/libsndfile/CONTROL @@ -1,6 +1,5 @@ Source: libsndfile -Version: 1.0.29 -Port-Version: 10 +Version: 1.0.29-9 Description: Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo Homepage: https://github.com/erikd/libsndfile Default-Features: external-libs diff --git a/ports/libsndfile/portfile.cmake b/ports/libsndfile/portfile.cmake index 1e86fbffbdc53f..ce8f9427b7b93b 100644 --- a/ports/libsndfile/portfile.cmake +++ b/ports/libsndfile/portfile.cmake @@ -19,6 +19,9 @@ option(BUILD_EXECUTABLES "Build sndfile tools and install to folder tools" OFF) if("external-libs" IN_LIST FEATURES) set(SNDFILE_WITHOUT_EXTERNAL_LIBS OFF) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(FLAC_EXPORT_DEFINITION "-DFLAC__NO_DLL") + endif() else() set(SNDFILE_WITHOUT_EXTERNAL_LIBS ON) endif() @@ -34,6 +37,7 @@ vcpkg_configure_cmake( -DENABLE_STATIC_RUNTIME=${CRT_LIB_STATIC} -DBUILD_STATIC_LIBS=${BUILD_STATIC} -DDISABLE_EXTERNAL_LIBS=${SNDFILE_WITHOUT_EXTERNAL_LIBS} + -DCMAKE_C_FLAGS=${FLAC_EXPORT_DEFINITION} OPTIONS_RELEASE -DBUILD_PROGRAMS=${BUILD_EXECUTABLES} OPTIONS_DEBUG diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index 48505d85a58978..c6cd574b7fdbd1 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,9 +1,9 @@ Source: libtorrent -Version: 1.2.8 +Version: 1.2.7 Homepage: https://github.com/arvidn/libtorrent Description: An efficient feature complete C++ BitTorrent implementation Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision, boost-variant -Supports: !uwp&!(windows&arm) +Supports: !uwp Feature: deprfun Description: build with deprecated functions enabled diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index e88ddf7cc2ce85..bdab0a37400fb9 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -39,8 +39,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO arvidn/libtorrent - REF libtorrent-1.2.8 - SHA512 2a36412fb399f066de9768f4afd87ddbfc10fcd2a0b3a8be0a43bec6914497e71d9d4ffe4ff8ccc5544a048f799ccba6ce086ab6199f4dee66d1341f02d73f9a + REF libtorrent_1_2_7 + SHA512 8a6b0ab387e538351ad770ad189ceaa29f0c382b7152d65d3b40b4271716c8f1550c51189ac1e2550683b69f24abbd667d13a0197e7db2ac9ea06ffa37933495 HEAD_REF RC_1_2 PATCHES add-datetime-to-boost-libs.patch diff --git a/ports/libu2f-server/CONTROL b/ports/libu2f-server/CONTROL index 1af6aa8f1d5cb6..26803fbb7ecd09 100644 --- a/ports/libu2f-server/CONTROL +++ b/ports/libu2f-server/CONTROL @@ -1,7 +1,4 @@ Source: libu2f-server Version: 1.1.0 -Port-Version: 2 Build-Depends: openssl, json-c -Homepage: https://developers.yubico.com/libu2f-server/ Description: Yubico Universal 2nd Factor (U2F) Server C Library -Supports: (x86 | x64) & windows diff --git a/ports/libu2f-server/portfile.cmake b/ports/libu2f-server/portfile.cmake index e4f7c6ddbfac39..86e5d9bbebf2b8 100644 --- a/ports/libu2f-server/portfile.cmake +++ b/ports/libu2f-server/portfile.cmake @@ -23,12 +23,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -# The include file must be patched after the build has completed, because the source files use the wrong subdirectory name! -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libu2f-server/u2f-server.h - "#include " - "#include " -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL index accbf3d0e0aa39..8e351613262ec8 100644 --- a/ports/libusb/CONTROL +++ b/ports/libusb/CONTROL @@ -1,6 +1,4 @@ Source: libusb Version: 1.0.23 -Port-Version: 2 Homepage: https://github.com/libusb/libusb Description: a cross-platform library to access USB devices -Supports: !uwp diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake index 74a592f41f2706..1beb053aa12353 100644 --- a/ports/libusb/portfile.cmake +++ b/ports/libusb/portfile.cmake @@ -1,6 +1,8 @@ -vcpkg_fail_port_install(ON_TARGET "uwp") +if (VCPKG_CMAKE_SYSTEM_NAME) + message(FATAL_ERROR "Error: the port is unsupported on your platform. Please open an issue on github.com/Microsoft/vcpkg to request a fix") +endif() -if(VCPKG_TARGET_IS_LINUX) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") message("${PORT} currently requires the following tools and libraries from the system package manager:\n autoreconf\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install autoreconf libudev-dev") endif() @@ -39,22 +41,78 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() - # The README file in the archive is a symlink to README.md - # which causes issues with the windows MSBUILD process - file(REMOVE ${SOURCE_PATH}/README) - vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH msvc/libusb_${LIBUSB_PROJECT_TYPE}_${MSVS_VERSION}.vcxproj LICENSE_SUBPATH COPYING ) - file(INSTALL ${SOURCE_PATH}/libusb/libusb.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0) else() - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG - ) - vcpkg_install_make() + set(BASH /bin/bash) + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + # Copy sources + message(STATUS "Copying source files...") + file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) + foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) + file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + endforeach() + message(STATUS "Copying source files... done") + # Configure release + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + # Copy sources + message(STATUS "Copying source files...") + file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) + foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) + file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + endforeach() + message(STATUS "Copying source files... done") + # Configure debug + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}/debug\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + # Build release + message(STATUS "Package ${TARGET_TRIPLET}-rel") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"make install\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # Build debug + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + execute_process( + COMMAND "${BASH} --noprofile --norc -c \"make install\"" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + endif() endif() +file(INSTALL + ${SOURCE_PATH}/libusb/libusb.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0 +) + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index 82eec705c923c4..969ae8a10961c7 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -1,6 +1,6 @@ Source: libvpx Version: 1.8.1 -Port-Version: 9 +Port-Version: 8 Homepage: https://github.com/webmproject/libvpx Description: The reference software implementation for the video coding formats VP8 and VP9. Supports: !(uwp&arm) diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index 7a899c9cb70ea1..1d818ddf169db0 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -83,24 +83,23 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) OPTIONS /p:UseEnv=True ) - # note: pdb file names are hardcoded in the lib file, cannot rename if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmd.pdb") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmt.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmt.pdb") endif() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmdd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmdd.pdb") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmtd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmtd.pdb") endif() endif() diff --git a/ports/libwandio/CONTROL b/ports/libwandio/CONTROL index 1150b06ec140fb..5fc36ba357f7f2 100644 --- a/ports/libwandio/CONTROL +++ b/ports/libwandio/CONTROL @@ -1,7 +1,5 @@ Source: libwandio -Version: 4.2.1 -Port-Version: 3 +Version: 4.2.1-2 Homepage: https://github.com/wanduow/wandio Description: C library for simple and efficient file IO. -Build-Depends: zlib, zstd, liblzma, lzo, lz4, curl, pthread, bzip2 -Supports: !windows +Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2 \ No newline at end of file diff --git a/ports/libwandio/configure.lib.patch b/ports/libwandio/configure.lib.patch index 3898836b7bc082..57719581ea09ac 100644 --- a/ports/libwandio/configure.lib.patch +++ b/ports/libwandio/configure.lib.patch @@ -120,3 +120,21 @@ index 4579fbb3d..f6be008c8 100644 fi AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support") with_lz4=streamapi +@@ -296,12 +304,14 @@ AC_ARG_WITH([http], + AS_IF([test "x$with_http" != "xno"], + [ + # we need curl_easy_pause which was added in 7.18.0 +- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) ++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) ++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) + ], [have_curl=no]) + + AS_IF([test "x$have_curl" = "xyes"], [ +- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" ++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" ++ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" + fi + AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") + with_http=yes], diff --git a/ports/libwandio/configure.patch b/ports/libwandio/configure.patch deleted file mode 100644 index 929662d6703296..00000000000000 --- a/ports/libwandio/configure.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index e250c0c31..0465120ba 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -83,7 +83,7 @@ ADD_INCLS="" - ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib" - LIBWANDIO_LIBS="" - --CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1" -+CFLAGS="$CFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" --CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1" -+CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" - - # Check for -fvisibility diff --git a/ports/libwandio/curl.patch b/ports/libwandio/curl.patch deleted file mode 100644 index 326700ed0bb142..00000000000000 --- a/ports/libwandio/curl.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 4579fbb3d..f6be008c8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -296,12 +304,14 @@ AC_ARG_WITH([http], - AS_IF([test "x$with_http" != "xno"], - [ - # we need curl_easy_pause which was added in 7.18.0 -- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) -+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d libcurl libcurl-d], have_curl=yes, have_curl=no, [-lCrypt32 -lWldap32 -lWs2_32 -ladvapi32]) -+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) - ], [have_curl=no]) - - AS_IF([test "x$have_curl" = "xyes"], [ -- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then -- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" -+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then -+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lCrypt32 -lWldap32 -lWs2_32 -ladvapi32 $ac_cv_search_curl_easy_pause" -+ LIBS="$LIBS" - fi - AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") - with_http=yes], diff --git a/ports/libwandio/openssl.patch b/ports/libwandio/openssl.patch deleted file mode 100644 index 586cdfab569bf9..00000000000000 --- a/ports/libwandio/openssl.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 4579fbb3d..f6be008c8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -296,12 +304,14 @@ AC_ARG_WITH([http], - AS_IF([test "x$with_http" != "xno"], - [ - # we need curl_easy_pause which was added in 7.18.0 -- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) -+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) -+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) - ], [have_curl=no]) - - AS_IF([test "x$have_curl" = "xyes"], [ -- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then -- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" -+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then -+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" -+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" - fi - AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") - with_http=yes], diff --git a/ports/libwandio/portfile.cmake b/ports/libwandio/portfile.cmake index a03d5c79f2c768..c9be34be64f4ae 100644 --- a/ports/libwandio/portfile.cmake +++ b/ports/libwandio/portfile.cmake @@ -1,11 +1,3 @@ -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - set(PATCHES curl.patch) - #TODO: Still does not work. Requires proper "signal" support and "unistd" -else() - set(PATCHES openssl.patch) # needed if curl is using openssl -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wanduow/wandio @@ -13,12 +5,9 @@ vcpkg_from_github( SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d HEAD_REF master PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed. - configure.patch - ${PATCHES} ) vcpkg_configure_make( - AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} COPY_SOURCE ) diff --git a/ports/libzip/CONTROL b/ports/libzip/CONTROL index 8a3d1513724495..9ed941bccf718b 100644 --- a/ports/libzip/CONTROL +++ b/ports/libzip/CONTROL @@ -1,6 +1,5 @@ Source: libzip Version: 1.7.1 -Port-Version: 1 Homepage: https://github.com/nih-at/libzip Build-Depends: zlib Default-Features: bzip2,default-aes diff --git a/ports/libzip/fix-findpackage.patch b/ports/libzip/fix-findpackage.patch deleted file mode 100644 index 94ef7d93a0dcc5..00000000000000 --- a/ports/libzip/fix-findpackage.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6e35082..d90c0c4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -482,7 +482,7 @@ CONFIGURE_PACKAGE_CONFIG_FILE("${PROJECT_NAME}.cmake.in" "${PROJECT_BINARY_DIR}/ - IF(LIBZIP_DO_INSTALL) - INSTALL(EXPORT ${PROJECT_NAME}-targets - FILE ${PROJECT_NAME}-targets.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake - ) - ENDIF() - -@@ -494,7 +494,7 @@ EXPORT(TARGETS zip - IF(LIBZIP_DO_INSTALL) - INSTALL(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-version.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake - ) - ENDIF() - -diff --git a/libzip.cmake.in b/libzip.cmake.in -index 462439b..6caf754 100644 ---- a/libzip.cmake.in -+++ b/libzip.cmake.in -@@ -1,7 +1,7 @@ - @PACKAGE_INIT@ - - # Provide all our library targets to users. --include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/cmake/libzip/libzip-targets.cmake") -+include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/../share/libzip/libzip-targets.cmake") - - get_filename_component(LIBZIP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - set(LIBZIP_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/ports/libzip/portfile.cmake b/ports/libzip/portfile.cmake index 131c3ccfcaf006..5b325363b6dbb4 100644 --- a/ports/libzip/portfile.cmake +++ b/ports/libzip/portfile.cmake @@ -4,7 +4,6 @@ vcpkg_from_github( REF dcd9a0bfe1ac2893d7f62bafb19f0a4d7b08c0f7 #v1.7.1 SHA512 33ad594398f79544636464d6ae0892553a212dc833b508820f81f10823c3a5c4016288d05953176fb8d52919414edd28f26da6037b93129a58826abdcb501d18 HEAD_REF master - PATCHES fix-findpackage.patch ) vcpkg_check_features( diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL index 11d3c0207b19aa..ec84f40653626d 100644 --- a/ports/log4cpp/CONTROL +++ b/ports/log4cpp/CONTROL @@ -1,6 +1,5 @@ Source: log4cpp -Version: 2.9.1 -Port-Version: 3 +Version: 2.9.1-2 Homepage: https://github.com/orocos-toolchain/log4cpp Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable. Supports: !uwp diff --git a/ports/log4cpp/fix-includepath.patch b/ports/log4cpp/fix-includepath.patch deleted file mode 100644 index 2fdac90fe82c12..00000000000000 --- a/ports/log4cpp/fix-includepath.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index beace9e..c8264ec 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -136,7 +136,7 @@ SET(prefix "${CMAKE_INSTALL_PREFIX}") - SET(exec_prefix "\${prefix}") - SET(log4cpp_cflags "") - SET(log4cpp_libs "${LOG4CPP_LIBS}") --SET(includedir "\${prefix}/include/orocos") -+SET(includedir "\${prefix}/include") - SET(libdir "\${prefix}/lib") - CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc @ONLY) - -@@ -147,7 +147,7 @@ INSTALL( - - INSTALL ( - DIRECTORY include/log4cpp -- DESTINATION include/orocos -+ DESTINATION include - PATTERN "config.h.in" EXCLUDE - PATTERN ".svn" EXCLUDE - PATTERN "*.am" EXCLUDE -@@ -157,7 +157,7 @@ INSTALL ( - - INSTALL ( - FILES ${CMAKE_CURRENT_BINARY_DIR}/include/log4cpp/config.h -- DESTINATION include/orocos/log4cpp -+ DESTINATION include/log4cpp - ) - - INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake index e8de2c0e342b62..44c91587655720 100644 --- a/ports/log4cpp/portfile.cmake +++ b/ports/log4cpp/portfile.cmake @@ -1,4 +1,8 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + message(FATAL_ERROR "${PORT} does not currently support UWP.") +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -9,7 +13,6 @@ vcpkg_from_github( PATCHES fix-install-targets.patch Fix-StaticSupport.patch - fix-includepath.patch ) vcpkg_configure_cmake( @@ -26,4 +29,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) diff --git a/ports/lzokay/portfile.cmake b/ports/lzokay/portfile.cmake deleted file mode 100644 index 719c63d979da4c..00000000000000 --- a/ports/lzokay/portfile.cmake +++ /dev/null @@ -1,23 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO jackoalan/lzokay - REF 546a9695271e8a8b4711383f828172754fd825f2 - SHA512 b4e96183ea52dc5ba0d88b4b9b27baa2c3e2c540b1bfd50cf7a3c2569337fbe9d73dd9939cb456d5f7459df8e10d84677d40ee33f7d524f0f5f8a723d7a70583 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/lzokay/vcpkg.json b/ports/lzokay/vcpkg.json deleted file mode 100644 index fb2b0787a587db..00000000000000 --- a/ports/lzokay/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "lzokay", - "version-string": "2020-07-30", - "description": "lzokay – MIT licensed C++ implementation of LZO compression/decompression algorithm", - "homepage": "https://github.com/jackoalan/lzokay" -} diff --git a/ports/marble/CONTROL b/ports/marble/CONTROL deleted file mode 100644 index 20dd30c0c313fd..00000000000000 --- a/ports/marble/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: marble -Version: 19.08.2 -Homepage: https://marble.kde.org -Description: Marble KDE library -Supports: windows & x64 & !static -Build-Depends: qt5-base, qt5-svg, qt5-quickcontrols, qt5-webchannel diff --git a/ports/marble/portfile.cmake b/ports/marble/portfile.cmake deleted file mode 100644 index 665eb31d10e9b9..00000000000000 --- a/ports/marble/portfile.cmake +++ /dev/null @@ -1,45 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO KDE/marble - REF 552cb9ae1f34482d1ec56532a703e0d820856286 #v20.04.3 - SHA512 ac6106a6db53534c96d7281b1a07624c2852ed8c78cce0b91c5f865b106487f1f49aaa4c72d00ffb1f79a761d8d2eca18129ef9517bef463a1840554ed3e51fb - HEAD_REF master - PATCHES "qtfix.patch" -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) - -# Install plugins and data files -file(GLOB_RECURSE PLUGINS "${CURRENT_PACKAGES_DIR}/plugins/*") -file(GLOB_RECURSE PLUGINS_DESIGNER "${CURRENT_PACKAGES_DIR}/lib/plugins/*") -file(GLOB_RECURSE PLUGINS_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/plugins/*") -file(GLOB_RECURSE MKSPECS "${CURRENT_PACKAGES_DIR}/mkspecs/*") - -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(COPY ${PLUGINS} ${PLUGINS_DESIGNER} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/plugins) -file(COPY ${PLUGINS_DEBUG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/plugins) -file(COPY "${CURRENT_PACKAGES_DIR}/data" DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) # have to keep folder structure here -file(COPY ${MKSPECS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/mkspecs) - -# remove plugin folder -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/plugins ${CURRENT_PACKAGES_DIR}/debug/plugins - ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/debug/data - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/mkspecs ${CURRENT_PACKAGES_DIR}/debug/mkspecs - ${CURRENT_PACKAGES_DIR}/debug/share - ${CURRENT_PACKAGES_DIR}/debug/lib/plugins ${CURRENT_PACKAGES_DIR}/lib/plugins -) - -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/marble/qtfix.patch b/ports/marble/qtfix.patch deleted file mode 100644 index 39a420be02ce3a..00000000000000 --- a/ports/marble/qtfix.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a3b2139dc..1f9a10513 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -171,7 +171,7 @@ set (PEDANTIC FALSE CACHE BOOL "Determines if we should compile with -Wall -Werr - set (WITH_DESIGNER_PLUGIN TRUE CACHE BOOL "Build plugins for Qt Designer") - add_feature_info("Qt Designer plugins" WITH_DESIGNER_PLUGIN "Marble widget support in Qt Designer. Toggle with WITH_DESIGNER_PLUGIN=YES/NO") - --set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory for executables and libraries" FORCE) -+set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "Base directory for executables and libraries" FORCE) - if (NOT QT_PLUGINS_DIR) - set(QT_PLUGINS_DIR ${CMAKE_INSTALL_LIBDIR}/plugins) - endif() -@@ -248,7 +248,7 @@ add_definitions( - -DQT_NO_URL_CAST_FROM_STRING - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY -- -DQT_STRICT_ITERATORS -+# -DQT_STRICT_ITERATORS - -DQT_DISABLE_DEPRECATED_BEFORE=0x050700 - ) - -diff --git a/src/apps/marble-qt/CMakeLists.txt b/src/apps/marble-qt/CMakeLists.txt -index d28e3aa5e..7bbf4a63c 100644 ---- a/src/apps/marble-qt/CMakeLists.txt -+++ b/src/apps/marble-qt/CMakeLists.txt -@@ -48,7 +48,7 @@ if(STATIC_BUILD) - endif(STATIC_BUILD) - - if(WIN32) --install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) -+ install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/marble) - else(WIN32) - if (APPLE) - # No need for this when installing to a bundle -diff --git a/src/lib/astro/CMakeLists.txt b/src/lib/astro/CMakeLists.txt -index 5e1afd60f..fc53985f4 100644 ---- a/src/lib/astro/CMakeLists.txt -+++ b/src/lib/astro/CMakeLists.txt -@@ -50,7 +50,7 @@ target_include_directories(astro - - # choose the correct target install library path - if(WIN32) -- INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) -+ INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - elseif(APPLE) - INSTALL(TARGETS astro LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) - else() -diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt -index 7d27be94b..f1f377967 100644 ---- a/src/lib/marble/CMakeLists.txt -+++ b/src/lib/marble/CMakeLists.txt -@@ -448,7 +448,7 @@ target_include_directories(marblewidget - - # choose the correct target install library path - if(WIN32) -- install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) -+ install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - elseif(APPLE) - install(TARGETS marblewidget LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) - else() -diff --git a/src/lib/marble/declarative/CMakeLists.txt b/src/lib/marble/declarative/CMakeLists.txt -index dd5d519c4..482a02ad5 100644 ---- a/src/lib/marble/declarative/CMakeLists.txt -+++ b/src/lib/marble/declarative/CMakeLists.txt -@@ -53,7 +53,7 @@ if(Qt5Positioning_FOUND) - endif() - - if(WIN32) -- install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) -+ install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) - else() - install(TARGETS marbledeclarative LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() -diff --git a/src/plugins/positionprovider/CMakeLists.txt b/src/plugins/positionprovider/CMakeLists.txt -index 85591098e..87011876e 100644 ---- a/src/plugins/positionprovider/CMakeLists.txt -+++ b/src/plugins/positionprovider/CMakeLists.txt -@@ -12,12 +12,12 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} - COMPONENTS - Positioning - ) --marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) --marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) --marble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) --if(Qt5Positioning_FOUND) -- ADD_SUBDIRECTORY( qtpositioning ) --endif() -+#marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) -+#marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) -+#arble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) -+#if(Qt5Positioning_FOUND) -+# ADD_SUBDIRECTORY( qtpositioning ) -+#endif() - - - macro_optional_find_package(libwlocate) diff --git a/ports/minc/CONTROL b/ports/minc/CONTROL deleted file mode 100644 index 6cd1d54997367d..00000000000000 --- a/ports/minc/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: minc -Version: 2.4.03 -Description: MINC - Medical Image NetCDF or MINC isn't netCDF -Homepage: https://github.com/BIC-MNI/libminc -Build-Depends: nifticlib, hdf5[core], zlib - -Feature: minc1 -Description: Support minc1 file format, requires NETCDF -Build-Depends: netcdf[core] \ No newline at end of file diff --git a/ports/minc/build.patch b/ports/minc/build.patch deleted file mode 100644 index d0275c20d4c61e..00000000000000 --- a/ports/minc/build.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 52cc81ace..d7a1f63f8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -403,9 +404,11 @@ ENDIF(LIBMINC_MINC1_SUPPORT) - # Keep this variable for compatibility - SET(VOLUME_IO_LIBRARY ${LIBMINC_EXTERNAL_LIB_PREFIX}minc2) - SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) - - ADD_LIBRARY(${LIBMINC_LIBRARY} ${LIBRARY_TYPE} ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} ) -- -+if(WIN32) -+ target_link_libraries(${LIBMINC_LIBRARY} ws2_32) -+endif() - IF(NIFTI_FOUND AND NOT LIBMINC_USE_SYSTEM_NIFTI) - ADD_DEPENDENCIES(${LIBMINC_LIBRARY} NIFTI) - ENDIF() -@@ -453,7 +456,7 @@ IF( LIBMINC_INSTALL_LIB_DIR ) - ${LIBMINC_EXPORTED_TARGETS} - LIBRARY DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries - ARCHIVE DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries -- RUNTIME DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries -+ RUNTIME DESTINATION ${LIBMINC_INSTALL_BIN_DIR} COMPONENT libraries - ) - ENDIF( LIBMINC_INSTALL_LIB_DIR ) - -@@ -538,7 +541,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake - DESTINATION -- ${LIBMINC_INSTALL_LIB_DIR} -+ ${LIBMINC_INSTALL_LIB_DIR}/cmake - COMPONENT Development) - - ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) -diff --git a/config.h.cmake b/config.h.cmake -index 9ceffa8fc..21c2f3baf 100644 ---- a/config.h.cmake -+++ b/config.h.cmake -@@ -1,4 +1,8 @@ - /* various defines */ -+#ifdef _MSC_VER -+#define strcasecmp _stricmp -+#define strncasecmp _strnicmp -+#endif - - #ifndef MINC2 - #define MINC2 @MINC2@ -diff --git a/libcommon/minc_config.c b/libcommon/minc_config.c -index 531ef108e..5472d9274 100644 ---- a/libcommon/minc_config.c -+++ b/libcommon/minc_config.c -@@ -20,14 +20,6 @@ - - #include "minc_config.h" - --#ifdef _MSC_VER --#define snprintf _snprintf --#define vsnprintf _vsnprintf --#define strcasecmp _stricmp --#define strncasecmp _strnicmp --#endif -- -- - static const char *_CONFIG_VAR[]= - { - "MINC_FORCE_V2", diff --git a/ports/minc/config.patch b/ports/minc/config.patch deleted file mode 100644 index a726b9a57f0392..00000000000000 --- a/ports/minc/config.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/LIBMINCConfig.cmake.in b/LIBMINCConfig.cmake.in -index 7790597b2..c041b685a 100644 ---- a/LIBMINCConfig.cmake.in -+++ b/LIBMINCConfig.cmake.in -@@ -1,3 +1,4 @@ -+set(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../") - # LIBMINC CMake configuration file - - get_filename_component(LIBMINC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) -@@ -37,3 +38,4 @@ set( LIBMINC_FOUND 1 ) - # set( LIBMINC_TARGETS_IMPORTED 1 ) - # include( "${LIBMINC_CMAKE_DIR}/@LIBMINC_EXPORTED_TARGETS@.cmake" ) - #endif() -+unset(_IMPORT_PREFIX) -\ No newline at end of file diff --git a/ports/minc/portfile.cmake b/ports/minc/portfile.cmake deleted file mode 100644 index 4b9ff63b149d80..00000000000000 --- a/ports/minc/portfile.cmake +++ /dev/null @@ -1,47 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO BIC-MNI/libminc - REF e75a936c12a305b596d743c26a5437196ebce2a4 - SHA512 744f879ac8f0594c310d1c1b7fe67543c5feeb3e5a0979035918dbb2bf1d0973fbd389e5357a75631e618cc614b648c21179f7467576bd68e3522e63f21451b0 - HEAD_REF master - PATCHES build.patch - config.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "minc1" LIBMINC_MINC1_SUPPORT -) - -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # Symbols are not properly exported -endif() - -set(OPTIONS) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=ON") -else() - list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=OFF") -endif() - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE - OPTIONS - "-DBUILD_TESTING=OFF" - "-DLIBMINC_USE_SYSTEM_NIFTI=ON" - ${OPTIONS} - ${FEATURE_OPTIONS} -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libminc) - -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/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index 252c669976b6b9..dfccb9025821df 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -1,9 +1,8 @@ Source: mlpack -Version: 3.2.2 -Port-Version: 5 +Version: 3.2.2-3 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: openblas (!osx), lapack, boost, armadillo, ensmallen, stb +Build-Depends: openblas (!osx), clapack (!osx), boost, armadillo, ensmallen, stb Feature: tools Description: Build command-line executables. diff --git a/ports/mlpack/cmakelists.patch b/ports/mlpack/cmakelists.patch index 79f176419bed90..9db41f91267dc5 100644 --- a/ports/mlpack/cmakelists.patch +++ b/ports/mlpack/cmakelists.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 26757a5..c200b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -288,6 +282,7 @@ endif() +@@ -288,6 +288,7 @@ endif() # and find LAPACK and BLAS ourselves, using a slightly modified variant of the # script Armadillo uses to find these. if (WIN32) @@ -10,14 +10,16 @@ index 26757a5..c200b40 100644 find_library(LAPACK_LIBRARY NAMES lapack liblapack lapack_win32_MT lapack_win32 PATHS "C:/Program Files/Armadillo" -@@ -305,24 +306,25 @@ if (WIN32) +@@ -305,24 +306,31 @@ if (WIN32) if (NOT BLAS_LIBRARY) message(FATAL_ERROR "Cannot find BLAS library (.lib)!") endif () + endif() -+ find_package(LAPACK REQUIRED) -+ find_package(BLAS REQUIRED) ++ find_package(clapack CONFIG REQUIRED) ++ set(LAPACK_LIBRARIES lapack) ++ find_package(OpenBLAS CONFIG REQUIRED) ++ set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) # Piggyback LAPACK and BLAS linking into Armadillo link. set(ARMADILLO_LIBRARIES - ${ARMADILLO_LIBRARIES} ${BLAS_LIBRARY} ${LAPACK_LIBRARY}) @@ -26,19 +28,23 @@ index 26757a5..c200b40 100644 # Ensure that the libraries are added to the MSVC IDE runtime path. - get_filename_component(BLAS_DIR ${BLAS_LIBRARY} DIRECTORY) - get_filename_component(LAPACK_DIR ${LAPACK_LIBRARY} DIRECTORY) ++ get_property(BLAS_DIR TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_LOCATION_RELEASE) ++ get_filename_component(BLAS_DIR ${BLAS_DIR} DIRECTORY) ++ get_property(LAPACK_DIR TARGET lapack PROPERTY IMPORTED_LOCATION_RELEASE) ++ get_filename_component(LAPACK_DIR ${LAPACK_DIR} DIRECTORY) # Sometimes, especially with an OpenBLAS install via nuget, the DLLs are # actually in ../../bin/x64/. Automatically add these. - if (EXISTS "${BLAS_DIR}/../../bin/x64/") - get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}/../../bin/x64" ABSOLUTE) -+ if (0) ++ if (EXISTS "${BLAS_DIR}") + get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () - if (EXISTS "${LAPACK_DIR}/../../bin/x64/") - get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}/../../bin/x64" ABSOLUTE) -+ if (0) ++ if (EXISTS "${LAPACK_DIR}") + get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () diff --git a/ports/monkeys-audio/CONTROL b/ports/monkeys-audio/CONTROL index 388299f8c7e25f..8b66f9027d06a4 100644 --- a/ports/monkeys-audio/CONTROL +++ b/ports/monkeys-audio/CONTROL @@ -1,5 +1,5 @@ Source: monkeys-audio -Version: 5.48 +Version: 5.46 Homepage: https://monkeysaudio.com Description: Monkey's Audio is an excellent audio compression tool which has multiple advantages over traditional methods. Audio files compressed with it end with .ape extension. diff --git a/ports/monkeys-audio/portfile.cmake b/ports/monkeys-audio/portfile.cmake index f0edaaf32e0c77..320aeada95b312 100644 --- a/ports/monkeys-audio/portfile.cmake +++ b/ports/monkeys-audio/portfile.cmake @@ -2,12 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "UWP" "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) -set(MA_VERSION 548) +set(MA_VERSION 546) vcpkg_download_distfile(ARCHIVE URLS "https://monkeysaudio.com/files/MAC_SDK_${MA_VERSION}.zip" FILENAME "MAC_SDK_${MA_VERSION}.zip" - SHA512 036c75f4cc8dc54837b2f9f822d260ebdbed918dff9ac744746e2786d13a33364d0cd7f380f015e89eaf5ebedd7180df979dfd15cb8f0160e339fafebc93f4ba + SHA512 5fd426e3fa1d9283ef812a039fe4290e67881aaf1c374ce912b31df894128413c57e23fda0e79c0ae1e1d117ba15c8dd635b784d150451602f06f2fd3fe41566 ) vcpkg_extract_source_archive_ex( diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL new file mode 100644 index 00000000000000..6955ef15da9404 --- /dev/null +++ b/ports/mosquitto/CONTROL @@ -0,0 +1,6 @@ +Source: mosquitto +Version: 1.6.8-1 +Build-Depends: c-ares, libwebsockets, openssl, pthreads +Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1. + MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino. +Homepage: https://mosquitto.org/download/ diff --git a/ports/mosquitto/portfile.cmake b/ports/mosquitto/portfile.cmake index 8c83401c94e366..2c04a7bb05debd 100644 --- a/ports/mosquitto/portfile.cmake +++ b/ports/mosquitto/portfile.cmake @@ -46,7 +46,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) -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) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/mosquitto/usage b/ports/mosquitto/usage deleted file mode 100644 index 1f4e6735c12c5e..00000000000000 --- a/ports/mosquitto/usage +++ /dev/null @@ -1,5 +0,0 @@ -The package mosquitto provides CMake targets: - - find_package(mosquitto REQUIRED) - target_include_directories(main PRIVATE ${MOSQUITTO_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${MOSQUITTO_LIBRARIES}) diff --git a/ports/mosquitto/vcpkg-cmake-wrapper.cmake b/ports/mosquitto/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index ad8124c677974e..00000000000000 --- a/ports/mosquitto/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,15 +0,0 @@ -include(FindPackageHandleStandardArgs) -include(SelectLibraryConfigurations) - -find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h) - -find_library(MOSQUITTO_LIBRARY_DEBUG NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) -find_library(MOSQUITTO_LIBRARY_RELEASE NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) -find_library(MOSQUITTOPP_LIBRARY_DEBUG NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) -find_library(MOSQUITTOPP_LIBRARY_RELEASE NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) - -select_library_configurations(MOSQUITTO) -select_library_configurations(MOSQUITTOPP) - -set(MOSQUITTO_INCLUDE_DIRS ${MOSQUITTO_INCLUDE_DIR}) -set(MOSQUITTO_LIBRARIES ${MOSQUITTO_LIBRARY} ${MOSQUITTOPP_LIBRARY}) diff --git a/ports/mosquitto/vcpkg.json b/ports/mosquitto/vcpkg.json deleted file mode 100644 index 2e3654754bd238..00000000000000 --- a/ports/mosquitto/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "mosquitto", - "version-string": "1.6.8", - "port-version": 2, - "description": "Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1, MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model, This makes it suitable for machine to machine messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino", - "homepage": "https://mosquitto.org/download/", - "dependencies": [ - "c-ares", - "libwebsockets", - "openssl", - "pthreads" - ] -} diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL index 998e5eacfe4b3f..867ba8bcaebd88 100644 --- a/ports/mozjpeg/CONTROL +++ b/ports/mozjpeg/CONTROL @@ -1,5 +1,4 @@ Source: mozjpeg -Version: 2020-06-02-1 -Build-Depends: libpng +Version: 2020-06-02 Homepage: https://github.com/mozilla/mozjpeg Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg. diff --git a/ports/mozjpeg/fix-install-error.patch b/ports/mozjpeg/fix-install-error.patch index 0d0a283652a6c2..b0ba9ac2d7b71b 100644 --- a/ports/mozjpeg/fix-install-error.patch +++ b/ports/mozjpeg/fix-install-error.patch @@ -1,33 +1,126 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt +index 51f4714..9ca3463 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1369,13 +1369,13 @@ - ############################################################################### +@@ -1370,21 +1370,28 @@ endif() set(EXE ${CMAKE_EXECUTABLE_SUFFIX}) ++if(CMAKE_BUILD_TYPE STREQUAL "Debug") ++ set(REAL_BUILDS_PATH "Debug/") ++else() ++ set(REAL_BUILDS_PATH "Release/") ++endif() ++ if(WITH_TURBOJPEG) if(ENABLE_SHARED) -- install(TARGETS turbojpeg tjbench -+ install(TARGETS turbojpeg #tjbench - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(TARGETS turbojpeg tjbench +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ RUNTIME DESTINATION tools/mozjpeg) if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND CMAKE_C_LINKER_SUPPORTS_PDB) install(FILES "$" -@@ -1413,13 +1413,13 @@ - DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) +- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) ++ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) + endif() + endif() + if(ENABLE_STATIC) +- install(TARGETS turbojpeg-static ARCHIVE +- DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS turbojpeg-static ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) + if(NOT ENABLE_SHARED) + if(MSVC_IDE OR XCODE) + set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") +@@ -1392,15 +1399,15 @@ if(WITH_TURBOJPEG) + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() + install(PROGRAMS ${DIR}/tjbench-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) ++ DESTINATION tools/mozjpeg RENAME tjbench${EXE}) + endif() + endif() + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) + endif() + + if(ENABLE_STATIC) +- install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) + if(NOT ENABLE_SHARED) + if(MSVC_IDE OR XCODE) + set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") +@@ -1408,15 +1415,15 @@ if(ENABLE_STATIC) + set(DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() + install(PROGRAMS ${DIR}/cjpeg-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) ++ DESTINATION tools/mozjpeg RENAME cjpeg${EXE}) + install(PROGRAMS ${DIR}/djpeg-static${EXE} +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) ++ DESTINATION tools/mozjpeg RENAME djpeg${EXE}) install(PROGRAMS ${DIR}/jpegtran-static${EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) +- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) ++ DESTINATION tools/mozjpeg RENAME jpegtran${EXE}) endif() endif() -install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+#install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt - ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c +@@ -1424,10 +1431,10 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt + ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt +- ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) ++ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION share/mozjpeg) + if(WITH_JAVA) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java +- DESTINATION ${CMAKE_INSTALL_DOCDIR}) ++ DESTINATION share/mozjpeg) + endif() + + if(UNIX OR MINGW) +@@ -1439,12 +1446,12 @@ if(UNIX OR MINGW) + endif() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc + ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/mozjpeg) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h + ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) + + include(cmakescripts/BuildPackages.cmake) + +diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt +index f0a7d87..1e82349 100644 +--- a/sharedlib/CMakeLists.txt ++++ b/sharedlib/CMakeLists.txt +@@ -92,11 +92,11 @@ add_executable(jcstest ../jcstest.c) + target_link_libraries(jcstest jpeg) + + install(TARGETS jpeg cjpeg djpeg jpegtran +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg ++ RUNTIME DESTINATION tools/mozjpeg) + if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND + CMAKE_C_LINKER_SUPPORTS_PDB) + install(FILES "$" +- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) ++ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) + endif() diff --git a/ports/mozjpeg/portfile.cmake b/ports/mozjpeg/portfile.cmake index 9c756e778d11e8..93f9c86e94c8f4 100644 --- a/ports/mozjpeg/portfile.cmake +++ b/ports/mozjpeg/portfile.cmake @@ -12,41 +12,34 @@ vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) vcpkg_add_to_path(${NASM_EXE_PATH}) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(ENABLE_STATIC_BUILD ON) + set(ENABLE_SHARED_BUILD OFF) +else() + set(ENABLE_STATIC_BUILD OFF) + set(ENABLE_SHARED_BUILD ON) +endif() + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DENABLE_SHARED=${ENABLE_SHARED} - -DENABLE_STATIC=${ENABLE_STATIC} + -DDENABLE_SHARED=${ENABLE_SHARED_BUILD} + -DENABLE_STATIC=${ENABLE_STATIC_BUILD} -DWITH_CRT_DLL=${WITH_CRT_DLL} ) vcpkg_install_cmake() -# Rename libraries for static builds -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib") - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib") - endif() -endif() - -# Remove extra debug files +#remove extra debug files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_tools(TOOL_NAMES cjpeg djpeg jpegtran AUTO_CLEAN) -vcpkg_fixup_pkgconfig() +vcpkg_copy_tools(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) -# Remove empty folders after static build +#remove empty folders after static build if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/mpg123/CONTROL b/ports/mpg123/CONTROL index 3e7705ab08f280..deefddbdaa079b 100644 --- a/ports/mpg123/CONTROL +++ b/ports/mpg123/CONTROL @@ -1,5 +1,4 @@ Source: mpg123 -Version: 1.25.8 -Port-Version: 13 +Version: 1.25.8-12 Homepage: https://sourceforge.net/projects/mpg123/ Description: mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers 1, 2 and 3 (MPEG 1.0 layer 3 also known as MP3). diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 9438c58115e5fa..5190a17db091e5 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -116,38 +116,97 @@ elseif(VCPKG_TARGET_IS_WINDOWS) ${SOURCE_PATH}/src/libmpg123/mpg123.h.in DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX) - set(MPG123_OPTIONS - --disable-dependency-tracking +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(REMOVE_RECURSE ${SOURCE_PATH}/build/debug) + file(REMOVE_RECURSE ${SOURCE_PATH}/build/release) + + ################ + # Debug build + ################ + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/debug --enable-debug=yes --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME config-${TARGET_TRIPLET}-dbg ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done.") - # Find cross-compiler prefix - if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - endif() - if(CMAKE_C_COMPILER) - vcpkg_execute_required_process( - COMMAND ${CMAKE_C_COMPILER} -dumpmachine - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} - LOGNAME dumpmachine-${TARGET_TRIPLET} + message(STATUS "Installing ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Installing ${TARGET_TRIPLET}-dbg done.") + + ################ + # Release build + ################ + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make distclean + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + vcpkg_execute_required_process( + COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/release --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done.") + + message(STATUS "Installing ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + message(STATUS "Installing ${TARGET_TRIPLET}-rel done.") + + file( + INSTALL + "${SOURCE_PATH}/build/debug/include/fmt123.h" + "${SOURCE_PATH}/build/debug/include/mpg123.h" + "${SOURCE_PATH}/build/debug/include/out123.h" + DESTINATION + ${CURRENT_PACKAGES_DIR}/include + ) + + if(EXISTS "${SOURCE_PATH}/build/debug/lib64/libmpg123.a") + file( + INSTALL + "${SOURCE_PATH}/build/debug/lib64/libmpg123.a" + "${SOURCE_PATH}/build/debug/lib64/libout123.a" + DESTINATION + ${CURRENT_INSTALLED_DIR}/debug/lib ) - file(READ ${CURRENT_BUILDTREES_DIR}/dumpmachine-${TARGET_TRIPLET}-out.log MPG123_HOST) - string(REPLACE "\n" "" MPG123_HOST "${MPG123_HOST}") - message(STATUS "Cross-compiling with ${CMAKE_C_COMPILER}") - message(STATUS "Detected autoconf triplet --host=${MPG123_HOST}") - set(MPG123_OPTIONS - --host=${MPG123_HOST} - ${MPG123_OPTIONS} + else() + file( + INSTALL + "${SOURCE_PATH}/build/debug/lib/libmpg123.a" + "${SOURCE_PATH}/build/debug/lib/libout123.a" + DESTINATION + ${CURRENT_INSTALLED_DIR}/debug/lib ) endif() - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS ${MPG123_OPTIONS} - ) - vcpkg_install_make() - - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + if(EXISTS "${SOURCE_PATH}/build/release/lib64/libmpg123.a") + file( + INSTALL + "${SOURCE_PATH}/build/release/lib64/libmpg123.a" + "${SOURCE_PATH}/build/release/lib64/libout123.a" + DESTINATION + ${CURRENT_PACKAGES_DIR}/lib + ) + else() + file( + INSTALL + "${SOURCE_PATH}/build/release/lib/libmpg123.a" + "${SOURCE_PATH}/build/release/lib/libout123.a" + DESTINATION + ${CURRENT_PACKAGES_DIR}/lib + ) + endif() endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL new file mode 100644 index 00000000000000..0871ce157b27a6 --- /dev/null +++ b/ports/mpir/CONTROL @@ -0,0 +1,5 @@ +Source: mpir +Version: 3.0.0-8 +Homepage: https://github.com/wbhart/mpir +Description: Multiple Precision Integers and Rationals. +Supports: !(uwp|arm) \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 856e4e273d4b55..118a19602e25c0 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,9 +1,5 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") -if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") - message(FATAL_ERROR "Can't build ${PORT} if gmp is installed. Please remove gmp, and try to install ${PORT} again if you need it.") -endif() - if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs") endif() @@ -34,29 +30,44 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) set(OPTIONS --disable-silent-rules --enable-gmpcompat --enable-cxx ${SHARED_STATIC}) - string(APPEND VCPKG_C_FLAGS " -Wno-implicit-function-declaration") - string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG} -O0 -g") + set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g") + set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME configure-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Building ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME install-${TARGET_TRIPLET}-dbg + ) - # on Linux, autoconf is required; on macOS, it isn't - if(VCPKG_TARGET_IS_LINUX) - set(AUTOCONFIG "AUTOCONFIG") - endif() - - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - ${AUTOCONFIG} - OPTIONS ${OPTIONS} + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE} -O2") + set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O2") + set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME configure-${TARGET_TRIPLET}-rel + ) + message(STATUS "Building ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME install-${TARGET_TRIPLET}-rel ) - - vcpkg_install_make() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - endif() - - configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) + file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -102,52 +113,37 @@ elseif(VCPKG_TARGET_IS_WINDOWS) OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" ) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) - endif() + file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) + file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(GLOB HEADERS - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h - ) - file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(GLOB HEADERS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h + ) + file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + + file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) + file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) + + file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) + file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) - file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) - file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) - list(APPEND REL_LIBS ${REL_LIBS_CXX}) - - file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB HEADERS - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmp.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmpxx.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.h - ) - file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - - file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) - file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) - list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) - - file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) - - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) - endif() - endif() + list(APPEND REL_LIBS ${REL_LIBS_CXX}) + list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) + + file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -endif() +endif() \ No newline at end of file diff --git a/ports/mpir/vcpkg.json b/ports/mpir/vcpkg.json deleted file mode 100644 index 29754ccd9ace40..00000000000000 --- a/ports/mpir/vcpkg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "mpir", - "version-string": "3.0.0", - "port-version": 10, - "description": "Multiple Precision Integers and Rationals", - "homepage": "https://github.com/wbhart/mpir", - "supports": "!(uwp | arm)" -} diff --git a/ports/nana/CMakeLists.txt b/ports/nana/CMakeLists.txt index eca50614d0aa81..7cd9865dcb60af 100644 --- a/ports/nana/CMakeLists.txt +++ b/ports/nana/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -project(nana VERSION 1.7.2 LANGUAGES CXX) +project(nana VERSION 1.5.5 LANGUAGES CXX) option(NANA_ENABLE_PNG "Enable PNG support" OFF) option(NANA_ENABLE_JPEG "Enable JPEG support" OFF) @@ -26,7 +26,7 @@ target_include_directories(nana PUBLIC $ $) -target_compile_features(nana PUBLIC cxx_std_17) +target_compile_features(nana PUBLIC cxx_std_14) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_link_libraries(nana PUBLIC c++experimental) diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL index d6c94949850503..c0abb1df034ad6 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,6 +1,5 @@ Source: nana -Version: 1.7.2 -Port-Version: 4 +Version: 1.7.2-3 Homepage: https://github.com/cnjinhao/nana Description: Cross-platform library for GUI programming in modern C++ style. Build-Depends: libpng, libjpeg-turbo, freetype (!uwp&&!windows), fontconfig (!uwp&&!windows) diff --git a/ports/neargye-semver/CONTROL b/ports/neargye-semver/CONTROL deleted file mode 100644 index 4b7745b394b8c0..00000000000000 --- a/ports/neargye-semver/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: neargye-semver -Version: 0.2.2 -Description: C++17 header-only dependency-free versioning library complying with Semantic Versioning 2.0.0 -Homepage: https://github.com/Neargye/semver diff --git a/ports/neargye-semver/portfile.cmake b/ports/neargye-semver/portfile.cmake deleted file mode 100644 index 8a74ee93a98e2b..00000000000000 --- a/ports/neargye-semver/portfile.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# header-only library - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO Neargye/semver - REF v0.2.2 - SHA512 f299e6d74f0232f40e20959ed3d7138d5faff924f60748827849e21951d76d34070bac2479a35f3ea6e801ec5e23ebf8391adedc70d778c4aa5e4c89b20c332c - HEAD_REF master -) - -file(COPY ${SOURCE_PATH}/include/semver.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/neargye) - -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index 92d0439d96285a..d277cd975fb649 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,6 +1,5 @@ Source: netcdf-c -Version: 4.7.3 -Port-Version: 4 +Version: 4.7.3-1 Build-Depends: hdf5, curl Homepage: https://github.com/Unidata/netcdf-c Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/fix-dependency-libmath.patch b/ports/netcdf-c/fix-dependency-libmath.patch deleted file mode 100644 index 0db00ccaff9056..00000000000000 --- a/ports/netcdf-c/fix-dependency-libmath.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 35c694f..e2c03e5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -839,7 +839,7 @@ ENDIF() - - # Check for the math library so it can be explicitly linked. - IF(NOT WIN32) -- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) -+ FIND_LIBRARY(HAVE_LIBM NAMES m libm math) - MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") - IF(NOT HAVE_LIBM) - MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index 4813aa5b83824d..d1af9d9f175d18 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -9,7 +9,6 @@ vcpkg_from_github( config-pkg-location.patch use_targets.patch mpi.patch - fix-dependency-libmath.patch ) #Remove outdated find modules diff --git a/ports/netcdf-c/usage b/ports/netcdf-c/usage index 681a20f8c1bde9..98824b337bfa8d 100644 --- a/ports/netcdf-c/usage +++ b/ports/netcdf-c/usage @@ -1,4 +1,4 @@ The package netcdf-c provides CMake targets: find_package(netCDF CONFIG REQUIRED) - target_link_libraries(main PRIVATE netcdf) + target_link_libraries(main PRIVATE netcdf) \ No newline at end of file diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL index b628a3825bd4e3..baf0147c68b475 100644 --- a/ports/netcdf-cxx4/CONTROL +++ b/ports/netcdf-cxx4/CONTROL @@ -1,6 +1,5 @@ Source: netcdf-cxx4 Version: 4.3.1 -Port-Version: 1 Build-Depends: hdf5, netcdf-c Homepage: https://github.com/Unidata/netcdf-cxx4 Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch index 73b9a0d0134ddb..5d289ec2efdac1 100644 --- a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch +++ b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch @@ -1,41 +1,32 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 60c699d..f06fcc0 100644 +index 60c699d..6bd7822 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -395,14 +395,20 @@ ENDIF(NC_HAS_DEF_VAR_FILTER) - ### - # Find HDF5 - ### --IF(MSVC) -+IF(0) +@@ -402,7 +402,7 @@ ELSE(MSVC) + FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + ENDIF(MSVC) + +-CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) ++set(HAVE_H5FREE_MEMORY ON) + IF(NOT HAVE_H5FREE_MEMORY) + MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") + SET(NC_HAS_DEF_VAR_FILTER "") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6a48709..79de128 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -399,7 +399,13 @@ IF(MSVC) SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL NO_MODULES REQUIRED ${NC_HDF5_LINK_TYPE}) ELSE(MSVC) - FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + FIND_PACKAGE(hdf5 CONFIG REQUIRED) + set(HDF5_FOUND ${hdf5_FOUND}) -+ if (NOT HDF5_USE_STATIC_LIBRARIES) ++ if (BUILD_SHARED_LIBS) + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared hdf5::hdf5_hl-shared) + else() + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static hdf5::hdf5_hl-static) + endif() ENDIF(MSVC) --CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) -+set(HAVE_H5FREE_MEMORY ON) - IF(NOT HAVE_H5FREE_MEMORY) - MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") - SET(NC_HAS_DEF_VAR_FILTER "") -diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt -index 30a4a96..1809d29 100644 ---- a/plugins/CMakeLists.txt -+++ b/plugins/CMakeLists.txt -@@ -23,7 +23,7 @@ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES OUTPUT_NAME "bzip2") - SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "h5bzip2") - SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "h5bzip2") - SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES RUNTIME_OUTPUT_NAME "h5bzip2") --TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS}) -+TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS} ${HDF5_C_LIBRARY_hdf5}) - - ADD_LIBRARY(misc MODULE ${libmisc_SOURCES}) - SET_TARGET_PROPERTIES(misc PROPERTIES LIBRARY_OUTPUT_NAME "misc") + set(HAVE_H5FREE_MEMORY ON) diff --git a/ports/netcdf-cxx4/portfile.cmake b/ports/netcdf-cxx4/portfile.cmake index 3efd8e3aa0eefc..d90ea7131ab3c0 100644 --- a/ports/netcdf-cxx4/portfile.cmake +++ b/ports/netcdf-cxx4/portfile.cmake @@ -1,7 +1,7 @@ -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HDF5_USE_STATIC_LIBRARIES) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +set(HDF5_USE_STATIC_LIBRARIES ON) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Unidata/netcdf-cxx4 diff --git a/ports/nettle/CONTROL b/ports/nettle/CONTROL index c6e3e37353b7cc..e73b0df663cb18 100644 --- a/ports/nettle/CONTROL +++ b/ports/nettle/CONTROL @@ -1,5 +1,5 @@ Source: nettle -Version: 3.5.1-2 +Version: 3.5.1-1 Homepage: https://git.lysator.liu.se/nettle/nettle Description: Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space. Build-Depends: gmp, vs-yasm (windows) \ No newline at end of file diff --git a/ports/ngspice/CONTROL b/ports/ngspice/CONTROL deleted file mode 100644 index 40a5d35b9cacc0..00000000000000 --- a/ports/ngspice/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: ngspice -Version: 32 -Homepage: http://ngspice.sourceforge.net/ -Description: Ngspice is a mixed-level/mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley SPICE -Supports: !(linux|osx|arm|uwp) diff --git a/ports/ngspice/portfile.cmake b/ports/ngspice/portfile.cmake deleted file mode 100644 index 5265ac816ce4f8..00000000000000 --- a/ports/ngspice/portfile.cmake +++ /dev/null @@ -1,50 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "arm" "arm64") - -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - -vcpkg_from_sourceforge( - OUT_SOURCE_PATH SOURCE_PATH - REPO ngspice/ng-spice-rework - REF 32 - FILENAME "ngspice-32.tar.gz" - SHA512 222eaa0cd6577a6eb8454bb49a7050a162d430c4b07a4fdc6baf350c5b3f5b018bac640fd44f465ec09c8cba6a9729b1cbe8d3d8c097f672acc2c22fabe8f4bc - PATCHES - use-winbison-global.patch -) - -vcpkg_find_acquire_program(BISON) - -get_filename_component(BISON_DIR "${BISON}" DIRECTORY) -vcpkg_add_to_path(PREPEND "${BISON_DIR}") - -# Ensure its windows -if (VCPKG_TARGET_IS_WINDOWS) - # Sadly, vcpkg globs .libs inside install_msbuild and whines that the 47 year old SPICE format isn't a MSVC lib ;) - # We need to kill them off first before the source tree is copied to a tmp location by install_msbuild - - file(REMOVE_RECURSE ${SOURCE_PATH}/contrib) - file(REMOVE_RECURSE ${SOURCE_PATH}/examples) - file(REMOVE_RECURSE ${SOURCE_PATH}/man) - file(REMOVE_RECURSE ${SOURCE_PATH}/tests) - - # We use build_msbuild because install_msbuild is incompatible due to SPICE using .lib for the last 47 years.... - vcpkg_install_msbuild( - USE_VCPKG_INTEGRATION - SOURCE_PATH ${SOURCE_PATH} - INCLUDES_SUBPATH /src/include - LICENSE_SUBPATH COPYING - PLATFORM ${TRIPLET_SYSTEM_ARCH} # install_msbuild swaps x86 for win32(bad) if we dont force our own setting - PROJECT_SUBPATH visualc/sharedspice.sln - TARGET Build - ) -else() - message(FATAL_ERROR "Sorry but ngspice only can be built in Windows") -endif() - -# Unforunately install_msbuild isn't able to dual include directories that effectively layer -file(GLOB NGSPICE_INCLUDES - ${SOURCE_PATH}/visualc/src/include/ngspice/* -) -file(COPY ${NGSPICE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ngspice) - -vcpkg_copy_pdbs() diff --git a/ports/ngspice/use-winbison-global.patch b/ports/ngspice/use-winbison-global.patch deleted file mode 100644 index f28a34acec3da9..00000000000000 --- a/ports/ngspice/use-winbison-global.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/visualc/sharedspice.vcxproj b/visualc/sharedspice.vcxproj -index 96786b1..f5d9322 100644 ---- a/visualc/sharedspice.vcxproj -+++ b/visualc/sharedspice.vcxproj -@@ -879,7 +879,7 @@ - - - invoke win_bison.exe for %(Identity) -- ..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 -+ win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 - .\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h - - diff --git a/ports/nifticlib/CONTROL b/ports/nifticlib/CONTROL deleted file mode 100644 index acd8aedaa51db3..00000000000000 --- a/ports/nifticlib/CONTROL +++ /dev/null @@ -1,25 +0,0 @@ -Source: nifticlib -Version: 2020-04-30 -Description: Nifticlib is a C I/O library for reading and writing files in the nifti-1 data format. -Homepage: NIFTI-Imaging/nifti_clib -Build-Depends: zlib -Default-Features: nifti2, nifticdf -Supports: !uwp - -Feature: cifti -Description: Build cifti libraries and tools - -Feature: fsl -Description: Build fsl libraries and tools - -Feature: nifti2 -Description: Build nifti2 libraries and tools - -Feature: nifticdf -Description: Build nifticdf libraries and tools - -Feature: tools -Description: Build tools - -Feature: tests -Description: Build tests diff --git a/ports/nifticlib/portfile.cmake b/ports/nifticlib/portfile.cmake deleted file mode 100644 index c9d74a49e5c39e..00000000000000 --- a/ports/nifticlib/portfile.cmake +++ /dev/null @@ -1,48 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO NIFTI-Imaging/nifti_clib - REF 65f801b9c2f1f15f4de4a19d45e6595c25765632 - SHA512 be03cdc6cf17fd9ff74c5ecc1f6b2132121bb4b7973a731da334af2a8428d1f0dbbf7b94b2511d1ff7e515b8cc4cf3316d62b189566fb6ffc88c6146eebd48ff - HEAD_REF master - PATCHES zlib_include.patch -) - -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -endif() - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "cifti" USE_CIFTI_CODE - "fsl" USE_FSL_CODE - "nifti2" USE_NIFTI2_CODE - "nifticdf" USE_NIFTICDF_CODE - "tools" NIFTI_BUILD_APPLICATIONS - "tests" BUILD_TESTING -) -set(TOOL_NAMES) -if("tools" IN_LIST FEATURES) - list(APPEND TOOL_NAMES nifti_stats nifti_tool nifti1_tool) -endif() -if("tests" IN_LIST FEATURES) - list(APPEND TOOL_NAMES nifit_test) -endif() - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - ${FEATURE_OPTIONS} -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake TARGET_PATH share) - -if(TOOL_NAMES) - vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nifticlib/zlib_include.patch b/ports/nifticlib/zlib_include.patch deleted file mode 100644 index 1ef462b7f1f8de..00000000000000 --- a/ports/nifticlib/zlib_include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 54150d739..c3ca8fe50 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -77,6 +77,7 @@ set_if_not_defined(ZNZ_COMPILE_DEF "") - if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package - ### USE AS STAND ALONE PACKAGE - find_package(ZLIB REQUIRED) -+ include_directories(${ZLIB_INCLUDE_DIRS}) - set(NIFTI_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) - endif() - #message(STATUS "---------------------ZLIB -${NIFTI_ZLIB_LIBRARIES}--") diff --git a/ports/nlohmann-json/CONTROL b/ports/nlohmann-json/CONTROL index f474ce9067e82e..3e8f51fa6a8b43 100644 --- a/ports/nlohmann-json/CONTROL +++ b/ports/nlohmann-json/CONTROL @@ -1,4 +1,5 @@ Source: nlohmann-json -Version: 3.9.1 +Version: 3.8.0 +Port-Version: 2 Homepage: https://github.com/nlohmann/json Description: JSON for Modern C++ diff --git a/ports/nlohmann-json/portfile.cmake b/ports/nlohmann-json/portfile.cmake index 448ca04b399c1d..1f5f8575cf52df 100644 --- a/ports/nlohmann-json/portfile.cmake +++ b/ports/nlohmann-json/portfile.cmake @@ -1,4 +1,4 @@ -set(SOURCE_VERSION 3.9.1) +set(SOURCE_VERSION 3.8.0) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${PORT}-v${SOURCE_VERSION}) file(MAKE_DIRECTORY ${SOURCE_PATH}) @@ -13,17 +13,16 @@ function(download_src SUBPATH SHA512) file(COPY ${FILE} DESTINATION ${SUBPATH_DIR}) endfunction() -download_src(CMakeLists.txt d0ea797de0e3f98778cfcfa1249e9a363f0ae14f057f8f4338a2026d59eb929ddee9e45889c7f25d2c48633baa89ae9b4db4e5d99205f5ce7e1238fd82f3c113) +download_src(CMakeLists.txt 18151b19cb5258e58feffac8d4aed559c87e158dc217f47be23351b15c86e1d3f3c5ad2f7d11beabe3f0c0f948f3da1b9a807d425b1a9a0bb1ed74767cefafa9) download_src(LICENSE.MIT d5f7bb6a33469e19250a5e20db44e7ba09602ee85bc0afb03e4932402b08ca1c0dbbe6376b7e0a84eb11c782d70ae96f130755967204d35420c6ecbcafd301e5) download_src(nlohmann_json.natvis 9bce6758db0e54777394a4e718e60a281952b15f0c6dc6a6ad4a6d023c958b5515b2d39b7d4c66c03f0d3fdfdc1d6c23afb8b8419f1345c9d44d7b9a9ee2582b) download_src(cmake/config.cmake.in 7caab6166baa891f77f5b632ac4a920e548610ec41777b885ec51fe68d3665ffe91984dd2881caf22298b5392dfbd84b526fda252467bb66de9eb90e6e6ade5a) -download_src(cmake/pkg-config.pc.in 34afe9f9ef9c77c9053f81bdc5605523ba5c20ca1bc2e0cb26afe1754362b25e88d809df47cdd63024c60f346240010a6aa343ff46d6a959a38612b3f1955664) download_src(cmake/nlohmann_jsonConfigVersion.cmake.in 3b3ca2cfe740ba9646e5976b1112ba37c229bf527959bfb47a5e6c2fcd5ba6b5626d3c2455c181fe41a72ec78500738e2950e4fe76a2e91ba2073ba01f5595a8) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/nlohmann/json/releases/download/v${SOURCE_VERSION}/include.zip" FILENAME ${PORT}-v${SOURCE_VERSION}-include.zip - SHA512 24984da33c5bf80eb276712d4bdc698c2724e72dc0f4c70e87527fb6b16e21f535f5a022d52c7ed2f59dcfe4a4e5b61a56101b61def09b31c827689f6c7ec673 + SHA512 f4453aced8d74cf7c65d038fdf8da1e2b2153a1c15e26c7f25394ab1ce81f78920dd30b418b1db4cbf3f934df0459024230700bdd943aad569b2525b6a26e5d0 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH OUT_PATH diff --git a/ports/ocilib/CONTROL b/ports/ocilib/CONTROL index a4d44f4a36d902..c5d4fbb3742c95 100644 --- a/ports/ocilib/CONTROL +++ b/ports/ocilib/CONTROL @@ -1,6 +1,5 @@ Source: ocilib -Version: 4.6.4 -Port-Version: 2 +Version: 4.6.4-1 Homepage: https://vrogier.github.io/ocilib/ Description: OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases. Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/ocilib/portfile.cmake b/ports/ocilib/portfile.cmake index a8a451f484d899..84912c10f6c5d5 100644 --- a/ports/ocilib/portfile.cmake +++ b/ports/ocilib/portfile.cmake @@ -1,64 +1,62 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO vrogier/ocilib - REF v4.6.4 - SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a - HEAD_REF master - PATCHES - out_of_source_build_version_file_configure.patch + OUT_SOURCE_PATH SOURCE_PATH + REPO vrogier/ocilib + REF v4.6.4 + SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a + HEAD_REF master + PATCHES + out_of_source_build_version_file_configure.patch ) if(VCPKG_TARGET_IS_WINDOWS) - if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") set(SOLUTION_TYPE vs2019) set(OCILIB_ARCH_X86 x86) set(OCILIB_ARCH_X64 x64) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(SOLUTION_TYPE vs2017) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - else() + else() set(SOLUTION_TYPE vs2015) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - endif() + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM ${OCILIB_ARCH_X86}) else() set(PLATFORM ${OCILIB_ARCH_X64}) endif() - - # There is no debug configuration - # As it is a C library, build the release configuration and copy its output to the debug folder - set(VCPKG_BUILD_TYPE release) - vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln - INCLUDES_SUBPATH include - LICENSE_SUBPATH LICENSE - RELEASE_CONFIGURATION "Release - ANSI" - PLATFORM ${PLATFORM} - USE_VCPKG_INTEGRATION - ALLOW_ROOT_INCLUDES) + + # There is no debug configuration + # As it is a C library, build the release configuration and copy its output to the debug folder + set(VCPKG_BUILD_TYPE release) + vcpkg_install_msbuild( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln + INCLUDES_SUBPATH include + LICENSE_SUBPATH LICENSE + RELEASE_CONFIGURATION "Release - ANSI" + PLATFORM ${PLATFORM} + USE_VCPKG_INTEGRATION + ALLOW_ROOT_INCLUDES) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) - file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) + file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) else() - vcpkg_configure_make( - COPY_SOURCE - AUTOCONFIG - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - --with-oracle-import=runtime - ) + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + --with-oracle-import=runtime + ) - vcpkg_install_make() + vcpkg_install_make() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endif() diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL new file mode 100644 index 00000000000000..521f13f1738f14 --- /dev/null +++ b/ports/ogre/CONTROL @@ -0,0 +1,18 @@ +Source: ogre +Version: 1.12.1-1 +Build-Depends: freeimage, freetype, zlib, zziplib +Homepage: https://github.com/OGRECave/ogre +Description: 3D Object-Oriented Graphics Rendering Engine + +Feature: d3d9 +Description: Build Direct3D9 RenderSystem + +Feature: csharp +Description: Build csharp bindings + +Feature: java +Description: Build Java (JNI) bindings + +Feature: python +Description: Build Python bindings +Build-Depends: python3 diff --git a/ports/ogre/fix-dependency.patch b/ports/ogre/fix-dependency.patch deleted file mode 100644 index ba7e7516de72fa..00000000000000 --- a/ports/ogre/fix-dependency.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake -index 959fdf5..dcd28bb 100644 ---- a/CMake/Dependencies.cmake -+++ b/CMake/Dependencies.cmake -@@ -217,7 +217,7 @@ find_package(FreeImage) - macro_log_feature(FreeImage_FOUND "freeimage" "Support for commonly used graphics image formats" "http://freeimage.sourceforge.net" FALSE "" "") - - # Find FreeType --find_package(Freetype) -+find_package(freetype CONFIG REQUIRED) - macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "") - - # Find X11 -@@ -291,7 +291,7 @@ macro_log_feature(SWIG_FOUND "SWIG" "Language bindings (Python, Java, C#) for OG - # Find sdl2 - if(NOT ANDROID AND NOT EMSCRIPTEN) - # find script does not work in cross compilation environment -- find_package(SDL2 QUIET) -+ find_package(SDL2 CONFIG REQUIRED) - macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "") - if(SDL2_FOUND AND NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 INTERFACE IMPORTED) -diff --git a/PlugIns/DotScene/CMakeLists.txt b/PlugIns/DotScene/CMakeLists.txt -index fd285df..ab8e9c1 100644 ---- a/PlugIns/DotScene/CMakeLists.txt -+++ b/PlugIns/DotScene/CMakeLists.txt -@@ -1,4 +1,4 @@ --find_package(pugixml QUIET) -+find_package(pugixml CONFIG REQUIRED) - - file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") - list(APPEND HEADER_FILES ${PROJECT_BINARY_DIR}/include/OgreDotScenePluginExports.h) -diff --git a/Tools/XMLConverter/CMakeLists.txt b/Tools/XMLConverter/CMakeLists.txt -index 8fe9683..2a516b2 100644 ---- a/Tools/XMLConverter/CMakeLists.txt -+++ b/Tools/XMLConverter/CMakeLists.txt -@@ -22,7 +22,7 @@ set(SOURCE_FILES - ) - - # allow override by cmake --find_package(pugixml QUIET) -+find_package(pugixml CONFIG REQUIRED) - - add_executable(OgreXMLConverter ${HEADER_FILES} ${SOURCE_FILES}) - target_include_directories(OgreXMLConverter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/ports/ogre/fix-findimgui.patch b/ports/ogre/fix-findimgui.patch deleted file mode 100644 index efd30d061ea704..00000000000000 --- a/ports/ogre/fix-findimgui.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt -index 1cea873..d3e756e 100644 ---- a/Components/Overlay/CMakeLists.txt -+++ b/Components/Overlay/CMakeLists.txt -@@ -19,12 +19,8 @@ list(APPEND HEADER_FILES - file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") - - if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) -- list(APPEND SOURCE_FILES -- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.cpp -- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_draw.cpp -- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_widgets.cpp -- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_demo.cpp -- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype/imgui_freetype.cpp) -+ find_package(imgui CONFIG REQUIRED) -+ find_path(IMGUI_INCLUDE_DIR imgui.h) - else() - list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreImGuiOverlay.cpp") - endif() -@@ -32,13 +28,13 @@ endif() - # setup target - add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) - set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) --target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) -+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB imgui::imgui) - target_include_directories(OgreOverlay PUBLIC - "$" - $ - PRIVATE ${FREETYPE_INCLUDE_DIRS}) - --if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) -+if(0) - target_include_directories(OgreOverlay PUBLIC - PUBLIC "$" - PRIVATE "$") diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index 408ce416bf6544..f5faac14b88890 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -9,13 +9,11 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OGRECave/ogre - REF 8ff1a4046716244fc4b3a3e44e5b6abeda755b0a #v1.12.7 - SHA512 60c66118e35904cbabe881301f3e59026483507341450956f99b67220e1aaebd7035caac69c3e06cf45f08163254264da111b93d0c6b3402c3fba64858786b66 + REF 8083067c1835147de5d82015347d95c710e36bc0 + SHA512 0690aaff0bea74c38598894939396cab8077b84bda166deb4790fba87566114bc5267660e8efc4de9babeb1b8bddf73530e1a1dbbc63c7e24b14bc012b033bc8 HEAD_REF master PATCHES toolchain_fixes.patch - fix-dependency.patch - fix-findimgui.patch ) file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake") diff --git a/ports/ogre/toolchain_fixes.patch b/ports/ogre/toolchain_fixes.patch index cae36e1ebbbf9a..9ff2d87dfe6b1d 100644 --- a/ports/ogre/toolchain_fixes.patch +++ b/ports/ogre/toolchain_fixes.patch @@ -20,10 +20,10 @@ index a7a3796..2e21403 100644 set(INST_FILES Utils/FindPkgMacros.cmake) diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake -index 06a055b..09d10bd 100644 +index 783755e..79f7514 100644 --- a/CMake/InstallResources.cmake +++ b/CMake/InstallResources.cmake -@@ -201,10 +201,12 @@ endif () +@@ -208,10 +208,12 @@ endif () # Create the CMake package files include(CMakePackageConfigHelpers) @@ -38,8 +38,8 @@ index 06a055b..09d10bd 100644 + set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") + endif() endif() - if(WIN32) - set(OGRE_PLUGIN_DIR_CMAKE "bin") + configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${PROJECT_BINARY_DIR}/cmake/OGREConfig.cmake + INSTALL_DESTINATION ${OGRE_CMAKE_DIR} diff --git a/CMake/Packages/FindCg.cmake b/CMake/Packages/FindCg.cmake index 4501cf9..7eb57c3 100644 --- a/CMake/Packages/FindCg.cmake @@ -93,7 +93,7 @@ index 7125895..13a306f 100644 findpkg_finish(HLSL2GLSL) add_parent_dir(HLSL2GLSL_INCLUDE_DIRS HLSL2GLSL_INCLUDE_DIR) diff --git a/CMake/Packages/FindNVAPI.cmake b/CMake/Packages/FindNVAPI.cmake -index 95c70cd..893ce01 100644 +index 2b9deba..f33a298 100644 --- a/CMake/Packages/FindNVAPI.cmake +++ b/CMake/Packages/FindNVAPI.cmake @@ -44,7 +44,7 @@ findpkg_framework(NVAPI) @@ -238,10 +238,10 @@ index 374f84b..dc7066d 100644 # Generate debug names from given release names diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1602572..9fddbe7 100644 +index 3e09d2d..58968f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -269,7 +269,7 @@ elseif(EMSCRIPTEN) +@@ -274,7 +274,7 @@ elseif(EMSCRIPTEN) elseif (APPLE AND NOT APPLE_IOS) set(XCODE_ATTRIBUTE_SDKROOT macosx) @@ -250,6 +250,32 @@ index 1602572..9fddbe7 100644 execute_process(COMMAND xcodebuild -version -sdk "${XCODE_ATTRIBUTE_SDKROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT) string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}") else() +diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt +index bdb303d..d9cc221 100644 +--- a/Components/Overlay/CMakeLists.txt ++++ b/Components/Overlay/CMakeLists.txt +@@ -21,7 +21,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + # setup target + add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} ${PLATFORM_SOURCE_FILES}) + set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) +-target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE "${FREETYPE_LIBRARIES}" ZLIB::ZLIB) ++target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) + target_include_directories(OgreOverlay PUBLIC + "$" + $ +diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt +index 6ec4e34..cc9cb9d 100644 +--- a/OgreMain/CMakeLists.txt ++++ b/OgreMain/CMakeLists.txt +@@ -225,8 +225,6 @@ if (APPLE) + set_target_properties(OgreMain PROPERTIES + LINK_FLAGS "-framework IOKit -framework Cocoa -framework Carbon -framework OpenGL -framework CoreVideo" + ) +- +- set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)") + + if(OGRE_BUILD_LIBS_AS_FRAMEWORKS) + add_custom_command(TARGET OgreMain POST_BUILD diff --git a/PlugIns/EXRCodec/CMakeLists.txt b/PlugIns/EXRCodec/CMakeLists.txt index e9c936a..bb8747e 100644 --- a/PlugIns/EXRCodec/CMakeLists.txt diff --git a/ports/ogre/vcpkg.json b/ports/ogre/vcpkg.json deleted file mode 100644 index 133fb3cfb200e8..00000000000000 --- a/ports/ogre/vcpkg.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "ogre", - "version-string": "1.12.7", - "description": "3D Object-Oriented Graphics Rendering Engine", - "homepage": "https://github.com/OGRECave/ogre", - "dependencies": [ - "freeimage", - "freetype", - { - "name": "imgui", - "features": [ - "freetype" - ] - }, - "pugixml", - "sdl2", - "zlib", - "zziplib" - ], - "features": [ - { - "name": "csharp", - "description": "Build csharp bindings" - }, - { - "name": "d3d9", - "description": "Build Direct3D9 RenderSystem" - }, - { - "name": "java", - "description": "Build Java (JNI) bindings" - }, - { - "name": "python", - "description": "Build Python bindings", - "dependencies": [ - "python3" - ] - } - ] -} diff --git a/ports/ompl/CONTROL b/ports/ompl/CONTROL index 292ad71b66ee57..8a60f34cdd4bc2 100644 --- a/ports/ompl/CONTROL +++ b/ports/ompl/CONTROL @@ -1,6 +1,5 @@ Source: ompl -Version: 1.4.2 -Port-Version: 5 +Version: 1.4.2-4 Homepage: https://bitbucket.org/ompl Description: The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms Build-Depends: boost-dynamic-bitset, boost-filesystem, boost-graph, boost-odeint, boost-program-options, boost-serialization, boost-system, boost-test, boost-ublas, boost-timer, eigen3 diff --git a/ports/ompl/portfile.cmake b/ports/ompl/portfile.cmake index a3c1244e931a22..074d2b852aa14a 100644 --- a/ports/ompl/portfile.cmake +++ b/ports/ompl/portfile.cmake @@ -29,7 +29,6 @@ file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${_contents}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - DISABLE_PARALLEL_CONFIGURE OPTIONS -DOMPL_VERSIONED_INSTALL=OFF -DOMPL_REGISTRATION=OFF diff --git a/ports/openal-soft/CONTROL b/ports/openal-soft/CONTROL index a139fb9e8085a8..6b84e63ff2b8b5 100644 --- a/ports/openal-soft/CONTROL +++ b/ports/openal-soft/CONTROL @@ -1,6 +1,6 @@ Source: openal-soft Version: 1.20.1 -Port-Version: 5 +Port-Version: 4 Homepage: https://github.com/kcat/openal-soft Description: OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. Supports: !uwp diff --git a/ports/openal-soft/fix-mingw-build.patch b/ports/openal-soft/fix-mingw-build.patch deleted file mode 100644 index ffb2db303a4ad4..00000000000000 --- a/ports/openal-soft/fix-mingw-build.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/common/alstring.h b/common/alstring.h -index 194e54a1..5a5f87ed 100644 ---- a/common/alstring.h -+++ b/common/alstring.h -@@ -4,6 +4,9 @@ - #include - #include - -+// This fixes MinGW link errors. It defines strcasecmp and strncasecmp in string.h. -+#include -+ - #include "almalloc.h" - - diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 31ebc6bae143ad..5b6c8067ce5948 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -9,7 +9,6 @@ vcpkg_from_github( PATCHES dont-export-symbols-in-static-build.patch fix-arm-builds.patch - fix-mingw-build.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL index ea246834dd9953..3c2b0b7ebe68d7 100644 --- a/ports/openblas/CONTROL +++ b/ports/openblas/CONTROL @@ -1,6 +1,5 @@ Source: openblas -Version: 0.3.9 -Port-Version: 2 +Version: 0.3.9-1 Homepage: https://github.com/xianyi/OpenBLAS -Build-Depends: pthread (linux&osx) +Build-Depends: pthread (linux) Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index 57b9236ace6cd6..2decb588380674 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xianyi/OpenBLAS @@ -20,15 +22,13 @@ set(SED_EXE_PATH "${GIT_EXE_PATH}/../usr/bin") # openblas require perl to generate .def for exports vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(PATH_BACKUP "$ENV{PATH}") -vcpkg_add_to_path("${PERL_EXE_PATH}") -vcpkg_add_to_path("${SED_EXE_PATH}") +set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${SED_EXE_PATH}") set(COMMON_OPTIONS -DBUILD_WITHOUT_LAPACK=ON) # for UWP version, must build non uwp first for helper # binaries. -if(VCPKG_TARGET_IS_UWP) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") message(STATUS "Building Windows helper files") set(TEMP_CMAKE_SYSTEM_NAME "${VCPKG_CMAKE_SYSTEM_NAME}") set(TEMP_CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}") @@ -46,7 +46,7 @@ if(VCPKG_TARGET_IS_UWP) # add just built path to environment for gen_config_h.exe, # getarch.exe and getarch_2nd.exe - vcpkg_add_to_path("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + set(ENV{PATH} "$ENV{PATH};${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") # restore target build information set(VCPKG_CMAKE_SYSTEM_NAME "${TEMP_CMAKE_SYSTEM_NAME}") @@ -63,7 +63,7 @@ if(VCPKG_TARGET_IS_UWP) -DVS_WINRT_COMPONENT=TRUE "-DBLASHELPER_BINARY_DIR=${CURRENT_BUILDTREES_DIR}/x64-windows-rel") -elseif(VCPKG_TARGET_IS_WINDOWS) +elseif(NOT VCPKG_CMAKE_SYSTEM_NAME) vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} @@ -85,23 +85,6 @@ endif() vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) -set(ENV{PATH} "${PATH_BACKUP}") - -set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openblas.pc") -if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") - #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) -endif() -set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/openblas.pc") -if(EXISTS "${pcfile}") - file(READ "${pcfile}" _contents) - set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") - file(WRITE "${pcfile}" "${_contents}") - #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) -endif() -vcpkg_fixup_pkgconfig() #maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file # openblas do not make the config file , so I manually made this @@ -114,7 +97,8 @@ string(REPLACE "#include \"common.h\"" "#include \"openblas_common.h\"" CBLAS_H file(WRITE ${CURRENT_PACKAGES_DIR}/include/cblas.h "${CBLAS_H}") # openblas is BSD -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openblas) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/openblas/LICENSE ${CURRENT_PACKAGES_DIR}/share/openblas/copyright) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindBLAS.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) diff --git a/ports/opencl/CONTROL b/ports/opencl/CONTROL index 41069be8225e56..9ad614bbf67b9e 100644 --- a/ports/opencl/CONTROL +++ b/ports/opencl/CONTROL @@ -1,6 +1,5 @@ Source: opencl -Version: 2.2 -Port-Version: 3 +Version: 2.2-2-1 Homepage: https://github.com/KhronosGroup/OpenCL-Headers Description: C/C++ headers and ICD loader (Installable Client Driver) for OpenCL diff --git a/ports/opencl/vcpkg-cmake-wrapper.cmake b/ports/opencl/vcpkg-cmake-wrapper.cmake index 0893710ff58a4a..73c9da576937b5 100644 --- a/ports/opencl/vcpkg-cmake-wrapper.cmake +++ b/ports/opencl/vcpkg-cmake-wrapper.cmake @@ -4,9 +4,6 @@ if(NOT BUILD_SHARED_LIBS AND (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")) set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) if(CMAKE_SYSTEM_NAME MATCHES "Windows") list(APPEND OpenCL_Extra_Libs cfgmgr32) - if($ENV{WindowsSDKVersion} MATCHES "^10") - list(APPEND OpenCL_Extra_Libs OneCoreUAP) - endif() endif(CMAKE_SYSTEM_NAME MATCHES "Windows") if(TARGET OpenCL::OpenCL) diff --git a/ports/opencolorio-tools/0001-lcms-dependency-search.patch b/ports/opencolorio-tools/0001-lcms-dependency-search.patch deleted file mode 100644 index 353a8061501cbb..00000000000000 --- a/ports/opencolorio-tools/0001-lcms-dependency-search.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index d31b4e3..2b57d1c 100644 ---- a/src/apps/ociobakelut/CMakeLists.txt -+++ b/src/apps/ociobakelut/CMakeLists.txt -@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE - FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" - "${LCMS_INCLUDE_DIR}") - else() -+ find_path(LCMS_INCLUDE_DIRS -+ NAMES -+ lcms2.h -+ lcms2_plugin.h -+ HINTS -+ ${LCMS_INCLUDEDIR} -+ ${LCMS_INCLUDE_DIRS} -+ ) -+ -+ find_library(LCMS_LIBRARIES -+ LIBRARY_NAMES -+ lcms -+ lcms2 -+ HINTS -+ ${LCMS_LIBRARY_DIRS} -+ ) -+ -+ get_filename_component(LCMS_LIBRARY_DIRS ${LCMS_LIBRARIES} DIRECTORY) -+ -+ find_package_handle_standard_args(LCMS -+ REQUIRED_VARS -+ LCMS_LIBRARIES -+ LCMS_LIBRARY_DIRS -+ LCMS_INCLUDE_DIRS -+ ) -+ mark_as_advanced(LCMS_LIBRARIES LCMS_INCLUDE_DIRS LCMS_LIBRARY_DIRS LCMS_FOUND) -+endif() -+ -+if(NOT LCMS_FOUND) - find_package(Git) - if(NOT GIT_EXECUTABLE) - message("Git not found, could not build external LCMS as we cannot apply patch") diff --git a/ports/opencolorio-tools/0002-msvc-cpluscplus.patch b/ports/opencolorio-tools/0002-msvc-cpluscplus.patch deleted file mode 100644 index c4349ea1276bb8..00000000000000 --- a/ports/opencolorio-tools/0002-msvc-cpluscplus.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff --git a/src/apps/ocioconvert/CMakeLists.txt b/src/apps/ocioconvert/CMakeLists.txt -index 82b0792..7d16bdf 100644 ---- a/src/apps/ocioconvert/CMakeLists.txt -+++ b/src/apps/ocioconvert/CMakeLists.txt -@@ -6,16 +6,23 @@ if (OIIO_FOUND) - ${OIIO_INCLUDES} - ${ILMBASE_INCLUDES} - ) -- -+ - file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") -- -+ - add_executable(ocioconvert ${share_src_files} main.cpp) -- -+ -+ target_compile_options(ocioconvert -+ PRIVATE -+ $<$: -+ /Zc:__cplusplus # Enable updated __cplusplus macro -+ > -+ ) -+ - set_target_properties(ocioconvert PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - - target_link_libraries(ocioconvert ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) -- -+ - target_link_OCIO(ocioconvert) -- -+ - install(TARGETS ocioconvert EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) - endif() -diff --git a/src/apps/ociodisplay/CMakeLists.txt b/src/apps/ociodisplay/CMakeLists.txt -index d11b9e1..0f27d86 100644 ---- a/src/apps/ociodisplay/CMakeLists.txt -+++ b/src/apps/ociodisplay/CMakeLists.txt -@@ -11,6 +11,13 @@ if (OIIO_FOUND) - - add_executable(ociodisplay main.cpp) - -+ target_compile_options(ociodisplay -+ PRIVATE -+ $<$: -+ /Zc:__cplusplus # Enable updated __cplusplus macro -+ > -+ ) -+ - # set_target_properties(ociodisplay PROPERTIES INSTALL_RPATH ${OIIO_LIBRARIES} ) - set_target_properties(ociodisplay PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - target_link_libraries(ociodisplay ${GLEW_LIBRARIES} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${OIIO_LIBRARIES}) -diff --git a/src/apps/ociolutimage/CMakeLists.txt b/src/apps/ociolutimage/CMakeLists.txt -index 528333f..821155d 100644 ---- a/src/apps/ociolutimage/CMakeLists.txt -+++ b/src/apps/ociolutimage/CMakeLists.txt -@@ -6,16 +6,23 @@ if (OIIO_FOUND) - ${OIIO_INCLUDES} - ${ILMBASE_INCLUDES} - ) -- -+ - file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") -- -+ - add_executable(ociolutimage ${share_src_files} main.cpp) -- -+ -+ target_compile_options(ociolutimage -+ PRIVATE -+ $<$: -+ /Zc:__cplusplus # Enable updated __cplusplus macro -+ > -+ ) -+ - set_target_properties(ociolutimage PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - - target_link_libraries(ociolutimage ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) -- -+ - target_link_OCIO(ociolutimage) -- -+ - install(TARGETS ociolutimage EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) - endif() diff --git a/ports/opencolorio-tools/0003-osx-self-assign-field.patch b/ports/opencolorio-tools/0003-osx-self-assign-field.patch deleted file mode 100644 index 18947bbbdeed1e..00000000000000 --- a/ports/opencolorio-tools/0003-osx-self-assign-field.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/core/Config.cpp b/src/core/Config.cpp -index f5cb379..5ea178e 100644 ---- a/src/core/Config.cpp -+++ b/src/core/Config.cpp -@@ -330,7 +330,7 @@ OCIO_NAMESPACE_ENTER - sanitytext_ = rhs.sanitytext_; - - cacheids_ = rhs.cacheids_; -- cacheidnocontext_ = cacheidnocontext_; -+ cacheidnocontext_ = rhs.cacheidnocontext_; - } - return *this; - } diff --git a/ports/opencolorio-tools/0004-yaml-dependency-search.patch b/ports/opencolorio-tools/0004-yaml-dependency-search.patch deleted file mode 100644 index 30c01d41a83239..00000000000000 --- a/ports/opencolorio-tools/0004-yaml-dependency-search.patch +++ /dev/null @@ -1,108 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e4f3119..5cfa601 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -244,34 +244,49 @@ else(USE_EXTERNAL_TINYXML) - endif() - set_target_properties(TINYXML_LIB PROPERTIES FOLDER External) - endif(USE_EXTERNAL_TINYXML) -- -+ - ############################################################################### - ### YAML ### - - if(USE_EXTERNAL_YAML) -- # Set minimum yaml version for non-patched sources. -- set(YAML_VERSION_MIN "0.3.0") -- include(FindPkgConfig) -- pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) -- find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h -- HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) -- find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp -- HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) -- set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) -- set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) -- set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) -- -- if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) -- message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") -- endif() -+ find_package(yaml-cpp 0.3.0) -+ if(yaml-cpp_FOUND) -+ include(FindPackageMessage) -+ -+ set(YAML_CPP_FOUND ${yaml-cpp_FOUND}) -+ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) -+ set(YAML_CPP_VERSION ${yaml-cpp_VERSION}) -+ set(YAML_CPP_LIBRARIES yaml-cpp) -+ -+ find_package_message(yaml-cpp -+ "Found yaml ${YAML_CPP_VERSION}: ${YAML_CPP_INCLUDE_DIRS}" -+ "${YAML_CPP_INCLUDE_DIRS}:${YAML_CPP_LIBRARIES}" -+ ) -+ else() -+ # Set minimum yaml version for non-patched sources. -+ set(YAML_VERSION_MIN "0.3.0") -+ include(FindPkgConfig) -+ pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) -+ find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h -+ HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) -+ find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp -+ HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) -+ set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) -+ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) -+ set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) -+ -+ if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) -+ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") -+ endif() - -- find_package_handle_standard_args(yaml-cpp -- REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) -- set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) -- mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) -+ find_package_handle_standard_args(yaml-cpp -+ REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) -+ set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) -+ mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) -+ endif() - - if(YAML_CPP_FOUND) -- if(YAML_CPP_VERSION VERSION_GREATER "0.5.0") -+ if(YAML_CPP_VERSION VERSION_GREATER "0.5.0" AND YAML_CPP_VERSION VERSION_LESS "0.6.0") - # Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them. - # Don't bother doing this step if we are already including the boost headers for shared_ptr - if(NOT OCIO_USE_BOOST_PTR) -diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt -index 4b931ef..12a1dbf 100644 ---- a/src/core/CMakeLists.txt -+++ b/src/core/CMakeLists.txt -@@ -77,7 +77,14 @@ endif() - if(OCIO_BUILD_STATIC) - list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) - add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) -- add_dependencies(OpenColorIO_STATIC TINYXML_LIB YAML_CPP_LIB) -+ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) -+ -+ if(USE_EXTERNAL_YAML) -+ target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) -+ else(USE_EXTERNAL_YAML) -+ add_dependencies(OpenColorIO_STATIC YAML_CPP_LIB) -+ endif() -+ - if(EXTERNAL_LIBRARIES) - target_link_libraries(OpenColorIO_STATIC ${EXTERNAL_LIBRARIES}) - endif() -diff --git a/src/core/OCIOYaml.cpp b/src/core/OCIOYaml.cpp -index aeee4d1..f1c662d 100644 ---- a/src/core/OCIOYaml.cpp -+++ b/src/core/OCIOYaml.cpp -@@ -69,7 +69,7 @@ namespace YAML { - - #ifdef WIN32 - #pragma warning( push ) --#pragma warning( disable: 4146 ) -+#pragma warning( disable: 4146 4251 ) - #endif - - #include diff --git a/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch b/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch deleted file mode 100644 index 319f88b733fdf0..00000000000000 --- a/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt -index 45e55f9..f4b687d 100644 ---- a/src/core/CMakeLists.txt -+++ b/src/core/CMakeLists.txt -@@ -77,7 +77,12 @@ endif() - if(OCIO_BUILD_STATIC) - list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) - add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) -- add_dependencies(OpenColorIO_STATIC TINYXML_LIB) -+ -+ if(USE_EXTERNAL_TINYXML) -+ target_link_libraries(OpenColorIO_STATIC ${TINYXML_LIBRARIES}) -+ else(USE_EXTERNAL_TINYXML) -+ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) -+ endif(USE_EXTERNAL_TINYXML) - - if(USE_EXTERNAL_YAML) - target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) diff --git a/ports/opencolorio-tools/0006-oiio-dependency-search.patch b/ports/opencolorio-tools/0006-oiio-dependency-search.patch deleted file mode 100644 index 09624e55c70740..00000000000000 --- a/ports/opencolorio-tools/0006-oiio-dependency-search.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5cfa601..f79807c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -475,7 +475,8 @@ endif() - if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) - - # Try to find OpenImageIO (OIIO) and OpenGL stuff -- OCIOFindOpenImageIO() -+ find_package(OpenImageIO CONFIG REQUIRED) -+ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) - - if(OIIO_FOUND) - add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio-tools/CONTROL b/ports/opencolorio-tools/CONTROL deleted file mode 100644 index 679933a250eb60..00000000000000 --- a/ports/opencolorio-tools/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: opencolorio-tools -Version: 1.1.1 -Homepage: https://opencolorio.org/ -Description: OpenColorIO applications, same source with port OpenColorIO. -Build-Depends: openimageio[opencolorio] diff --git a/ports/opencolorio-tools/portfile.cmake b/ports/opencolorio-tools/portfile.cmake deleted file mode 100644 index f08786a325c3d0..00000000000000 --- a/ports/opencolorio-tools/portfile.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# Note: Should be maintained simultaneously with opencolorio! -SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(_BUILD_SHARED OFF) - set(_BUILD_STATIC ON) -else() - set(_BUILD_SHARED ON) - set(_BUILD_STATIC OFF) -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO imageworks/OpenColorIO - REF v1.1.1 - SHA512 bed722f9ddce1887d28aacef2882debccd7c3f3c0c708d2723fea58a097de9f02721af9e85453e089ffda5406aef593ab6536c6886307823c132aa787e492e33 - HEAD_REF master - PATCHES - 0001-lcms-dependency-search.patch - 0002-msvc-cpluscplus.patch - 0003-osx-self-assign-field.patch - 0004-yaml-dependency-search.patch - 0005-tinyxml-dependency-search.patch - 0006-oiio-dependency-search.patch -) - -vcpkg_find_acquire_program(PYTHON3) -get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) -vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) - -# TODO(theblackunknown) build additional targets based on feature - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DOCIO_BUILD_APPS=ON - -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} - -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} - -DOCIO_BUILD_TRUELIGHT:BOOL=OFF - -DOCIO_BUILD_NUKE:BOOL=OFF - -DOCIO_BUILD_DOCS:BOOL=OFF - -DOCIO_BUILD_TESTS:BOOL=OFF - -DOCIO_BUILD_PYGLUE:BOOL=OFF - -DOCIO_BUILD_JNIGLUE:BOOL=OFF - -DOCIO_STATIC_JNIGLUE:BOOL=OFF - -DUSE_EXTERNAL_TINYXML:BOOL=ON - -DUSE_EXTERNAL_YAML:BOOL=ON -) - -vcpkg_install_cmake() - -vcpkg_copy_pdbs() - -vcpkg_copy_tools(TOOL_NAMES ociobakelut ociocheck) - -# Clean redundant files -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug - ${CURRENT_PACKAGES_DIR}/include - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/cmake - ${CURRENT_PACKAGES_DIR}/share) - -file(REMOVE ${CURRENT_PACKAGES_DIR}/OpenColorIOConfig.cmake) - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencolorio/0001-lcms-dependency-search.patch b/ports/opencolorio/0001-lcms-dependency-search.patch index 353a8061501cbb..597609a6e6e95e 100644 --- a/ports/opencolorio/0001-lcms-dependency-search.patch +++ b/ports/opencolorio/0001-lcms-dependency-search.patch @@ -1,8 +1,8 @@ diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index d31b4e3..2b57d1c 100644 +index d31b4e3..778b631 100644 --- a/src/apps/ociobakelut/CMakeLists.txt +++ b/src/apps/ociobakelut/CMakeLists.txt -@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE +@@ -5,6 +5,34 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" "${LCMS_INCLUDE_DIR}") else() @@ -18,7 +18,6 @@ index d31b4e3..2b57d1c 100644 + find_library(LCMS_LIBRARIES + LIBRARY_NAMES + lcms -+ lcms2 + HINTS + ${LCMS_LIBRARY_DIRS} + ) diff --git a/ports/opencolorio/0006-oiio-dependency-search.patch b/ports/opencolorio/0006-oiio-dependency-search.patch deleted file mode 100644 index 09624e55c70740..00000000000000 --- a/ports/opencolorio/0006-oiio-dependency-search.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5cfa601..f79807c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -475,7 +475,8 @@ endif() - if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) - - # Try to find OpenImageIO (OIIO) and OpenGL stuff -- OCIOFindOpenImageIO() -+ find_package(OpenImageIO CONFIG REQUIRED) -+ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) - - if(OIIO_FOUND) - add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio/CONTROL b/ports/opencolorio/CONTROL index 806609be0d4333..9d57a22e3b0138 100644 --- a/ports/opencolorio/CONTROL +++ b/ports/opencolorio/CONTROL @@ -1,6 +1,9 @@ Source: opencolorio -Version: 1.1.1 -Port-Version: 3 +Version: 1.1.1-2 Homepage: https://opencolorio.org/ Description: OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation. OCIO provides a straightforward and consistent user experience across all supporting applications while allowing for sophisticated back-end configuration options suitable for high-end production usage. OCIO is compatible with the Academy Color Encoding Specification (ACES) and is LUT-format agnostic, supporting many popular formats. -Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] \ No newline at end of file +Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] + +Feature: applications +Description: Enable OpenColorIO tools +Build-Depends: openimageio[core], openexr[core] diff --git a/ports/opencolorio/portfile.cmake b/ports/opencolorio/portfile.cmake index 1a55713e67425b..1d9ee2d7e1cbcf 100644 --- a/ports/opencolorio/portfile.cmake +++ b/ports/opencolorio/portfile.cmake @@ -1,4 +1,3 @@ -# Note: Should be maintained simultaneously with opencolorio-tools! if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(_BUILD_SHARED OFF) set(_BUILD_STATIC ON) @@ -21,6 +20,12 @@ vcpkg_from_github( 0005-tinyxml-dependency-search.patch ) +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + applications OCIO_BUILD_APPS +) + vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) @@ -31,7 +36,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DOCIO_BUILD_APPS=OFF + ${FEATURE_OPTIONS} -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} -DOCIO_BUILD_TRUELIGHT:BOOL=OFF @@ -51,6 +56,33 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake") vcpkg_copy_pdbs() +if("applications" IN_LIST FEATURES) + # port applications to tools + file(MAKE_DIRECTORY + "${CURRENT_PACKAGES_DIR}/tools/${PORT}" + "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}" + ) + + file(GLOB_RECURSE _TOOLS + "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" + ) + foreach(_TOOL IN LISTS _TOOLS) + get_filename_component(_NAME ${_TOOL} NAME) + file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${_NAME}") + endforeach() + + file(GLOB_RECURSE _TOOLS + "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" + ) + foreach(_TOOL IN LISTS _TOOLS) + get_filename_component(_NAME ${_TOOL} NAME) + file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/${_NAME}") + endforeach() + + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}") +endif() + # Clean redundant files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 768d8fda7d9ee4..7b5ba5af93765b 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,102 +1,102 @@ -Source: opencv -Version: 4.3.0 -Homepage: https://github.com/opencv/opencv -Description: Computer vision library -Build-Depends: opencv4[core] -Default-Features: dnn, jpeg, opengl, png, tiff, webp - -Feature: nonfree -Build-Depends: opencv4[core,nonfree] -Description: opencv nonfree module - -Feature: ade -Build-Depends: opencv4[core,ade] -Description: graph api - -Feature: contrib -Build-Depends: opencv4[core,contrib] -Description: opencv_contrib module - -Feature: cuda -Build-Depends: opencv4[core,cuda] -Description: CUDA support for opencv - -Feature: dnn -Build-Depends: opencv4[core,dnn] -Description: Enable dnn module - -Feature: eigen -Build-Depends: opencv4[core,eigen] -Description: Eigen support for opencv - -Feature: ffmpeg -Build-Depends: opencv4[core,ffmpeg] -Description: ffmpeg support for opencv - -Feature: gdcm -Build-Depends: opencv4[core,gdcm] -Description: GDCM support for opencv - -Feature: halide -Build-Depends: opencv4[core,halide] -Description: Halide support for opencv - -Feature: ipp -Build-Depends: opencv4[core,ipp] -Description: Enable Intel Integrated Performance Primitives - -Feature: jasper -Build-Depends: opencv4[core,jasper] -Description: JPEG 2000 support for opencv - -Feature: jpeg -Build-Depends: opencv4[core,jpeg] -Description: JPEG support for opencv - -Feature: openexr -Build-Depends: opencv4[core,openexr] -Description: OpenEXR support for opencv - -Feature: opengl -Build-Depends: opencv4[core,opengl] -Description: opengl support for opencv - -Feature: openmp -Build-Depends: opencv4[core,openmp] -Description: Enable openmp support for opencv - -Feature: ovis -Build-Depends: opencv4[core,ovis] -Description: opencv_ovis module - -Feature: png -Build-Depends: opencv4[core,png] -Description: PNG support for opencv - -Feature: qt -Build-Depends: opencv4[core,qt] -Description: Qt GUI support for opencv - -Feature: sfm -Build-Depends: opencv4[core,sfm] -Description: opencv_sfm module - -Feature: tbb -Build-Depends: opencv4[core,tbb] -Description: Enable Intel Threading Building Blocks - -Feature: tiff -Build-Depends: opencv4[core,tiff] -Description: TIFF support for opencv - -Feature: vtk -Build-Depends: opencv4[core,vtk] -Description: vtk support for opencv - -Feature: webp -Build-Depends: opencv4[core,webp] -Description: WebP support for opencv - -Feature: world -Build-Depends: opencv4[core,world] -Description: Compile to a single package support for opencv +Source: opencv +Version: 4.1.1-1 +Homepage: https://github.com/opencv/opencv +Description: Computer vision library +Build-Depends: opencv4[core] +Default-Features: dnn, jpeg, opengl, png, tiff, webp + +Feature: nonfree +Build-Depends: opencv4[nonfree] +Description: opencv nonfree module + +Feature: ade +Build-Depends: opencv4[ade] +Description: graph api + +Feature: contrib +Build-Depends: opencv4[contrib] +Description: opencv_contrib module + +Feature: cuda +Build-Depends: opencv4[cuda] +Description: CUDA support for opencv + +Feature: dnn +Build-Depends: opencv4[dnn] +Description: Enable dnn module + +Feature: eigen +Build-Depends: opencv4[eigen] +Description: Eigen support for opencv + +Feature: ffmpeg +Build-Depends: opencv4[ffmpeg] +Description: ffmpeg support for opencv + +Feature: gdcm +Build-Depends: opencv4[gdcm] +Description: GDCM support for opencv + +Feature: ipp +Build-Depends: opencv4[ipp] +Description: Enable Intel Integrated Performance Primitives + +Feature: jasper +Build-Depends: opencv4[jasper] +Description: JPEG 2000 support for opencv + +Feature: jpeg +Build-Depends: opencv4[jpeg] +Description: JPEG support for opencv + +Feature: openexr +Build-Depends: opencv4[openexr] +Description: OpenEXR support for opencv + +Feature: opengl +Build-Depends: opencv4[opengl] +Description: opengl support for opencv + +Feature: openmp +Build-Depends: opencv4[openmp] +Description: Enable openmp support for opencv + +Feature: ovis +Build-Depends: opencv4[ovis] +Description: opencv_ovis module + +Feature: png +Build-Depends: opencv4[png] +Description: PNG support for opencv + +Feature: qt +Build-Depends: opencv4[qt] +Description: Qt GUI support for opencv + +Feature: sfm +Build-Depends: opencv4[sfm] +Description: opencv_sfm module + +Feature: tbb +Build-Depends: opencv4[tbb] +Description: Enable Intel Threading Building Blocks + +Feature: tiff +Build-Depends: opencv4[tiff] +Description: TIFF support for opencv + +Feature: vtk +Build-Depends: opencv4[vtk] +Description: vtk support for opencv + +Feature: webp +Build-Depends: opencv4[webp] +Description: WebP support for opencv + +Feature: halide +Build-Depends: opencv4[halide] +Description: Halide support for opencv + +Feature: world +Build-Depends: opencv4[world] +Description: Compile to a single package support for opencv diff --git a/ports/opencv2/CONTROL b/ports/opencv2/CONTROL index d2cff4b6a612b5..391621beecdcb8 100644 --- a/ports/opencv2/CONTROL +++ b/ports/opencv2/CONTROL @@ -1,6 +1,5 @@ Source: opencv2 -Version: 2.4.13.7 -Port-Version: 2 +Version: 2.4.13.7-2 Build-Depends: zlib Description: computer vision library, version 2 Default-Features: eigen, jpeg, opengl, png, tiff diff --git a/ports/opencv2/FindCUDA.cmake b/ports/opencv2/FindCUDA.cmake deleted file mode 100644 index 56e15e89d2ed07..00000000000000 --- a/ports/opencv2/FindCUDA.cmake +++ /dev/null @@ -1,2026 +0,0 @@ -#[=======================================================================[.rst: -FindCUDA --------- - -.. deprecated:: 3.10 - - Superseded by first-class support for the CUDA language in CMake. - Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. - -Replacement -^^^^^^^^^^^ - -It is no longer necessary to use this module or call ``find_package(CUDA)`` -for compiling CUDA code. Instead, list ``CUDA`` among the languages named -in the top-level call to the :command:`project` command, or call the -:command:`enable_language` command with ``CUDA``. -Then one can add CUDA (``.cu``) sources to programs directly -in calls to :command:`add_library` and :command:`add_executable`. - -To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` -module has superseded this module. It works whether or not the ``CUDA`` -language is enabled. - -Documentation of Deprecated Usage -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Tools for building CUDA C files: libraries and build dependencies. - -This script locates the NVIDIA CUDA C tools. It should work on Linux, -Windows, and macOS and should be reasonably up to date with CUDA C -releases. - -This script makes use of the standard :command:`find_package` arguments of -````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an -acceptable version of CUDA was found. - -The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if -the prefix cannot be determined by the location of nvcc in the system -path and ``REQUIRED`` is specified to :command:`find_package`. To use -a different installed version of the toolkit set the environment variable -``CUDA_BIN_PATH`` before running cmake (e.g. -``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default -``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If -you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that -depend on the path will be relocated. - -It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain -platforms, or to use a CUDA runtime not installed in the default -location. In newer versions of the toolkit the CUDA library is -included with the graphics driver -- be sure that the driver version -matches what is needed by the CUDA runtime version. - -The following variables affect the behavior of the macros in the -script (in alphabetical order). Note that any of these flags can be -changed multiple times in the same directory before calling -``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, -``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` -or ``CUDA_WRAP_SRCS``:: - - CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) - -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. - Note that making this different from the host code when generating object - or C files from CUDA code just won't work, because size_t gets defined by - nvcc in the generated source. If you compile to PTX and then load the - file yourself, you can mix bit sizes between device and host. - - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) - -- Set to ON if you want the custom build rule to be attached to the source - file in Visual Studio. Turn OFF if you add the same cuda file to multiple - targets. - - This allows the user to build the target from the CUDA file; however, bad - things can happen if the CUDA source file is added to multiple targets. - When performing parallel builds it is possible for the custom build - command to be run more than once and in parallel causing cryptic build - errors. VS runs the rules for every source file in the target, and a - source can have only one rule no matter how many projects it is added to. - When the rule is run from multiple targets race conditions can occur on - the generated file. Eventually everything will get built, but if the user - is unaware of this behavior, there may be confusion. It would be nice if - this script could detect the reuse of source files across multiple targets - and turn the option off for the user, but no good solution could be found. - - CUDA_BUILD_CUBIN (Default OFF) - -- Set to ON to enable and extra compilation pass with the -cubin option in - Device mode. The output is parsed and register, shared memory usage is - printed during build. - - CUDA_BUILD_EMULATION (Default OFF for device mode) - -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files - when CUDA_BUILD_EMULATION is TRUE. - - CUDA_LINK_LIBRARIES_KEYWORD (Default "") - -- The keyword to use for internal - target_link_libraries calls. The default is to use no keyword which - uses the old "plain" form of target_link_libraries. Note that is matters - because whatever is used inside the FindCUDA module must also be used - outside - the two forms of target_link_libraries cannot be mixed. - - CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) - -- Set to the path you wish to have the generated files placed. If it is - blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. - Intermediate files will always be placed in - CMAKE_CURRENT_BINARY_DIR/CMakeFiles. - - CUDA_HOST_COMPILATION_CPP (Default ON) - -- Set to OFF for C compilation of host code. - - CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) - -- Set the host compiler to be used by nvcc. Ignored if -ccbin or - --compiler-bindir is already present in the CUDA_NVCC_FLAGS or - CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, - the host compiler is constructed with one or more visual studio macros - such as $(VCInstallDir), that expands out to the path when - the command is run from within VS. - If the CUDAHOSTCXX environment variable is set it will - be used as the default. - - CUDA_NVCC_FLAGS - CUDA_NVCC_FLAGS_ - -- Additional NVCC command line arguments. NOTE: multiple arguments must be - semi-colon delimited (e.g. --compiler-options;-Wall) - - CUDA_PROPAGATE_HOST_FLAGS (Default ON) - -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration - dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the - host compiler through nvcc's -Xcompiler flag. This helps make the - generated host code match the rest of the system better. Sometimes - certain flags give nvcc problems, and this will help you turn the flag - propagation off. This does not affect the flags supplied directly to nvcc - via CUDA_NVCC_FLAGS or through the OPTION flags specified through - CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for - shared library compilation are not affected by this flag. - - CUDA_SEPARABLE_COMPILATION (Default OFF) - -- If set this will enable separable compilation for all CUDA runtime object - files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY - (e.g. calling CUDA_WRAP_SRCS directly), - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. - - CUDA_SOURCE_PROPERTY_FORMAT - -- If this source file property is set, it can override the format specified - to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file - is not a .cu file, setting this file will cause it to be treated as a .cu - file. See documentation for set_source_files_properties on how to set - this property. - - CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) - -- When enabled the static version of the CUDA runtime library will be used - in CUDA_LIBRARIES. If the version of CUDA configured doesn't support - this option, then it will be silently disabled. - - CUDA_VERBOSE_BUILD (Default OFF) - -- Set to ON to see all the commands used when building the CUDA file. When - using a Makefile generator the value defaults to VERBOSE (run make - VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will - always print the output. - -The script creates the following macros (in alphabetical order):: - - CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) - -- Adds the cufft library to the target (can be any target). Handles whether - you are in emulation mode or not. - - CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) - -- Adds the cublas library to the target (can be any target). Handles - whether you are in emulation mode or not. - - CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... - [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Creates an executable "cuda_target" which is made up of the files - specified. All of the non CUDA C files are compiled using the standard - build rules specified by CMAKE and the cuda files are compiled to object - files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is - added automatically to include_directories(). Some standard CMake target - calls can be used on the target after calling this macro - (e.g. set_target_properties and target_link_libraries), but setting - properties that adjust compilation flags will not affect code compiled by - nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. - - CUDA_ADD_LIBRARY( cuda_target file0 file1 ... - [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Same as CUDA_ADD_EXECUTABLE except that a library is created. - - CUDA_BUILD_CLEAN_TARGET() - -- Creates a convenience target that deletes all the dependency files - generated. You should make clean after running this target to ensure the - dependency files get regenerated. - - CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] - [OPTIONS ...] ) - -- Returns a list of generated files from the input source files to be used - with ADD_LIBRARY or ADD_EXECUTABLE. - - CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of PTX files generated from the input source files. - - CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of FATBIN files generated from the input source files. - - CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of CUBIN files generated from the input source files. - - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var - cuda_target - object_files ) - -- Compute the name of the intermediate link file used for separable - compilation. This file name is typically passed into - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced - based on cuda_target the list of objects files that need separable - compilation as specified by object_files. If the object_files list is - empty, then output_file_var will be empty. This function is called - automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that - this is a function and not a macro. - - CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) - -- Sets the directories that should be passed to nvcc - (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu - files. - - - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target - nvcc_flags object_files) - -- Generates the link object required by separable compilation from the given - object files. This is called automatically for CUDA_ADD_EXECUTABLE and - CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS - directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the - nvcc_flags passed in are the same as the flags passed in via the OPTIONS - argument. The only nvcc flag added automatically is the bitness flag as - specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function - instead of a macro. - - CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) - -- Selects GPU arch flags for nvcc based on target_CUDA_architectures - target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) - - "Auto" detects local machine GPU compute arch at runtime. - - "Common" and "All" cover common and entire subsets of architectures - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal - NUM: Any number. Only those pairs are currently accepted by NVCC though: - 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 - Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} - Additionally, sets ${out_variable}_readable to the resulting numeric list - Example: - CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) - LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) - - More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA - Note that this is a function instead of a macro. - - CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... - [STATIC | SHARED | MODULE] [OPTIONS ...] ) - -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this - function under the hood. - - Given the list of files (file0 file1 ... fileN) this macro generates - custom commands that generate either PTX or linkable objects (use "PTX" or - "OBJ" for the format argument to switch). Files that don't end with .cu - or have the HEADER_FILE_ONLY property are ignored. - - The arguments passed in after OPTIONS are extra command line options to - give to nvcc. You can also specify per configuration options by - specifying the name of the configuration followed by the options. General - options must precede configuration specific options. Not all - configurations need to be specified, only the ones provided will be used. - - OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" - DEBUG -g - RELEASE --use_fast_math - RELWITHDEBINFO --use_fast_math;-g - MINSIZEREL --use_fast_math - - For certain configurations (namely VS generating object files with - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will - be produced for the given cuda file. This is because when you add the - cuda file to Visual Studio it knows that this file produces an object file - and will link in the resulting object file automatically. - - This script will also generate a separate cmake script that is used at - build time to invoke nvcc. This is for several reasons. - - 1. nvcc can return negative numbers as return values which confuses - Visual Studio into thinking that the command succeeded. The script now - checks the error codes and produces errors when there was a problem. - - 2. nvcc has been known to not delete incomplete results when it - encounters problems. This confuses build systems into thinking the - target was generated when in fact an unusable file exists. The script - now deletes the output files if there was an error. - - 3. By putting all the options that affect the build into a file and then - make the build rule dependent on the file, the output files will be - regenerated when the options change. - - This script also looks at optional arguments STATIC, SHARED, or MODULE to - determine when to target the object compilation for a shared library. - BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in - CUDA_ADD_LIBRARY. On some systems special flags are added for building - objects intended for shared libraries. A preprocessor macro, - _EXPORTS is defined when a shared library compilation is - detected. - - Flags passed into add_definitions with -D or /D are passed along to nvcc. - - - -The script defines the following variables:: - - CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. - CUDA_VERSION_MINOR -- The minor version. - CUDA_VERSION - CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR - CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. - - CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). - CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the - SDK. This script will not directly support finding - specific libraries or headers, as that isn't - supported by NVIDIA. If you want to change - libraries when the path changes see the - FindCUDA.cmake script for an example of how to clear - these variables. There are also examples of how to - use the CUDA_SDK_ROOT_DIR to locate headers or - libraries, if you so choose (at your own risk). - CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically - for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. - CUDA_LIBRARIES -- Cuda RT library. - CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT - implementation (alternative to: - CUDA_ADD_CUFFT_TO_TARGET macro) - CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS - implementation (alternative to: - CUDA_ADD_CUBLAS_TO_TARGET macro). - CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. - Only available for CUDA version 5.5+ - CUDA_cudadevrt_LIBRARY -- Device runtime library. - Required for separable compilation. - CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. - Only available for CUDA version 4.0+. - CUDA_curand_LIBRARY -- CUDA Random Number Generation library. - Only available for CUDA version 3.2+. - CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. - Only available for CUDA version 7.0+. - CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. - Only available for CUDA version 3.2+. - CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. - Only available for CUDA version 4.0+. - CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). - Only available for CUDA version 5.5+. - CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 5.5 - 8.0. - CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0 - 10.2. - Replaced by nvjpeg. - CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). - Only available for CUDA version 5.5+. - CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvToolsExt_LIBRARY - -- NVIDA CUDA Tools Extension library. - Available for CUDA version 5+. - CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. - Available for CUDA version 5+. - -#]=======================================================================] - -# James Bigler, NVIDIA Corp (nvidia.com - jbigler) -# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html -# -# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. -# -# Copyright (c) 2007-2009 -# Scientific Computing and Imaging Institute, University of Utah -# -# This code is licensed under the MIT License. See the FindCUDA.cmake script -# for the text of the license. - -# The MIT License -# -# License for the specific language governing rights and limitations under -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -############################################################################### - -# FindCUDA.cmake - -# This macro helps us find the location of helper files we will need the full path to -macro(CUDA_FIND_HELPER_FILE _name _extension) - set(_full_name "${_name}.${_extension}") - # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being - # processed. Using this variable, we can pull out the current path, and - # provide a way to get access to the other files we need local to here. - set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") - if(NOT EXISTS "${CUDA_${_name}}") - set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "${error_message}") - else() - if(NOT CUDA_FIND_QUIETLY) - message(STATUS "${error_message}") - endif() - endif() - endif() - # Set this variable as internal, so the user isn't bugged with it. - set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) -endmacro() - -##################################################################### -## CUDA_INCLUDE_NVCC_DEPENDENCIES -## - -# So we want to try and include the dependency file if it exists. If -# it doesn't exist then we need to create an empty one, so we can -# include it. - -# If it does exist, then we need to check to see if all the files it -# depends on exist. If they don't then we should clear the dependency -# file and regenerate it later. This covers the case where a header -# file has disappeared or moved. - -macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) - set(CUDA_NVCC_DEPEND) - set(CUDA_NVCC_DEPEND_REGENERATE FALSE) - - - # Include the dependency file. Create it first if it doesn't exist . The - # INCLUDE puts a dependency that will force CMake to rerun and bring in the - # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few - # hours figuring out why it didn't work. - if(NOT EXISTS ${dependency_file}) - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - # Always include this file to force CMake to run again next - # invocation and rebuild the dependencies. - #message("including dependency_file = ${dependency_file}") - include(${dependency_file}) - - # Now we need to verify the existence of all the included files - # here. If they aren't there we need to just blank this variable and - # make the file regenerate again. -# if(DEFINED CUDA_NVCC_DEPEND) -# message("CUDA_NVCC_DEPEND set") -# else() -# message("CUDA_NVCC_DEPEND NOT set") -# endif() - if(CUDA_NVCC_DEPEND) - #message("CUDA_NVCC_DEPEND found") - foreach(f ${CUDA_NVCC_DEPEND}) - # message("searching for ${f}") - if(NOT EXISTS ${f}) - #message("file ${f} not found") - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - endforeach() - else() - #message("CUDA_NVCC_DEPEND false") - # No dependencies, so regenerate the file. - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - - #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") - # No incoming dependencies, so we need to generate them. Make the - # output depend on the dependency file itself, which should cause the - # rule to re-run. - if(CUDA_NVCC_DEPEND_REGENERATE) - set(CUDA_NVCC_DEPEND ${dependency_file}) - #message("Generating an empty dependency_file: ${dependency_file}") - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - -endmacro() - -############################################################################### -############################################################################### -# Setup variables' defaults -############################################################################### -############################################################################### - -# Allow the user to specify if the device code is supposed to be 32 or 64 bit. -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) -else() - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) -endif() -option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) - -# Attach the build rule to the source file in VS. This option -option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) - -# Prints out extra information about the cuda file during compilation -option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) - -# Set whether we are using emulation or device mode. -option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) - -# Where to put the generated output. -set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") - -# Parse HOST_COMPILATION mode. -option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) - -# Extra user settable flags -cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") - -if(DEFINED ENV{CUDAHOSTCXX}) - set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") -elseif(CMAKE_GENERATOR MATCHES "Visual Studio") - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") - if(MSVC_VERSION LESS 1910) - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") - endif() - - set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") - -else() - if(APPLE - AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" - AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") - # Using cc which is symlink to clang may let NVCC think it is GCC and issue - # unhandled -dumpspecs option to clang. Also in case neither - # CMAKE_C_COMPILER is defined (project does not use C language) nor - # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let - # nvcc use its own default C compiler. - # Only care about this on APPLE with clang to avoid - # following symlinks to things like ccache - if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) - get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) - # if the real path does not end up being clang then - # go back to using CMAKE_C_COMPILER - if(NOT "${c_compiler_realpath}" MATCHES "/clang$") - set(c_compiler_realpath "${CMAKE_C_COMPILER}") - endif() - else() - set(c_compiler_realpath "") - endif() - set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") - elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") - # NVCC does not think it will work if it is passed clcache.exe or sccache.exe - # as the host compiler, which means that builds with CC=cl.exe won't work. - # Best to just feed it whatever the actual cl.exe is as the host compiler. - set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") - else() - set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" - CACHE FILEPATH "Host side compiler used by NVCC") - endif() -endif() - -# Propagate the host flags to the host compiler via -Xcompiler -option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) - -# Enable CUDA_SEPARABLE_COMPILATION -option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) - -# Specifies whether the commands used when compiling the .cu file will be printed out. -option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) - -mark_as_advanced( - CUDA_64_BIT_DEVICE_CODE - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE - CUDA_GENERATED_OUTPUT_DIR - CUDA_HOST_COMPILATION_CPP - CUDA_NVCC_FLAGS - CUDA_PROPAGATE_HOST_FLAGS - CUDA_BUILD_CUBIN - CUDA_BUILD_EMULATION - CUDA_VERBOSE_BUILD - CUDA_SEPARABLE_COMPILATION - ) - -# Single config generators like Makefiles or Ninja don't usually have -# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by -# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for -# single config generators (and should not be defined for multi-config -# generators). To ensure we get a complete superset of all possible -# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and -# all of the standard configurations, then weed out duplicates with -# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have -# each configuration-specific set of nvcc flags defined and marked as advanced. -set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) -list(REMOVE_DUPLICATES CUDA_configuration_types) - -############################################################################### -############################################################################### -# Locate CUDA, Set Build Type, etc. -############################################################################### -############################################################################### - -macro(cuda_unset_include_and_libraries) - unset(CUDA_TOOLKIT_INCLUDE CACHE) - unset(CUDA_CUDART_LIBRARY CACHE) - unset(CUDA_CUDA_LIBRARY CACHE) - # Make sure you run this before you unset CUDA_VERSION. - if(CUDA_VERSION VERSION_EQUAL "3.0") - # This only existed in the 3.0 version of the CUDA toolkit - unset(CUDA_CUDARTEMU_LIBRARY CACHE) - endif() - unset(CUDA_cudart_static_LIBRARY CACHE) - unset(CUDA_cudadevrt_LIBRARY CACHE) - unset(CUDA_cublas_LIBRARY CACHE) - unset(CUDA_cublas_device_LIBRARY CACHE) - unset(CUDA_cublasemu_LIBRARY CACHE) - unset(CUDA_cufft_LIBRARY CACHE) - unset(CUDA_cufftemu_LIBRARY CACHE) - unset(CUDA_cupti_LIBRARY CACHE) - unset(CUDA_curand_LIBRARY CACHE) - unset(CUDA_cusolver_LIBRARY CACHE) - unset(CUDA_cusparse_LIBRARY CACHE) - unset(CUDA_npp_LIBRARY CACHE) - unset(CUDA_nppc_LIBRARY CACHE) - unset(CUDA_nppi_LIBRARY CACHE) - unset(CUDA_npps_LIBRARY CACHE) - unset(CUDA_nvcuvenc_LIBRARY CACHE) - unset(CUDA_nvcuvid_LIBRARY CACHE) - unset(CUDA_nvToolsExt_LIBRARY CACHE) - unset(CUDA_OpenCL_LIBRARY CACHE) - unset(CUDA_GPU_DETECT_OUTPUT CACHE) -endmacro() - -# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, -# if they have then clear the cache variables, so that will be detected again. -if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") - unset(CUDA_TOOLKIT_TARGET_DIR CACHE) - unset(CUDA_NVCC_EXECUTABLE CACHE) - cuda_unset_include_and_libraries() - unset(CUDA_VERSION CACHE) -endif() - -if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") - cuda_unset_include_and_libraries() -endif() - -# -# End of unset() -# - -# -# Start looking for things -# - -# Search for the cuda distribution. -if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) - # Search in the CUDA_BIN_PATH first. - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS - ENV CUDA_TOOLKIT_ROOT - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - DOC "Toolkit location." - NO_DEFAULT_PATH - ) - - # Now search default paths - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS /opt/cuda/bin - PATH_SUFFIXES cuda/bin - DOC "Toolkit location." - ) - - if (CUDA_TOOLKIT_ROOT_DIR_NVCC) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) - string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - # We need to force this back into the cache. - set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) - set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - endif() - unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) - - if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") - elseif(NOT CUDA_FIND_QUIETLY) - message("CUDA_TOOLKIT_ROOT_DIR not found or specified") - endif() - endif () -endif () - -if(CMAKE_CROSSCOMPILING) - SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") - # Support for NVPACK - set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - # Support for arm cross compilation - set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - # Support for aarch64 cross compilation - if (ANDROID_ARCH_NAME STREQUAL "arm64") - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") - else() - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") - endif (ANDROID_ARCH_NAME STREQUAL "arm64") - endif() - - if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") - set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") - SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) - mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) - endif() - - # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers - set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") - macro( cuda_find_host_program ) - if (COMMAND find_host_program) - find_host_program( ${ARGN} ) - else() - find_program( ${ARGN} ) - endif() - endmacro() -else() - # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR - macro( cuda_find_host_program ) - find_program( ${ARGN} ) - endmacro() - SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) -endif() - - -# CUDA_NVCC_EXECUTABLE -if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) - set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") -else() - cuda_find_host_program(CUDA_NVCC_EXECUTABLE - NAMES nvcc - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - NO_DEFAULT_PATH - ) - # Search default search paths, after we search our own set of paths. - cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) -endif() -mark_as_advanced(CUDA_NVCC_EXECUTABLE) - -if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) - # Compute the version. - execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) - set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") - mark_as_advanced(CUDA_VERSION) -else() - # Need to set these based off of the cached value - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") -endif() - - -# Always set this convenience variable -set(CUDA_VERSION_STRING "${CUDA_VERSION}") - -# CUDA_TOOLKIT_INCLUDE -find_path(CUDA_TOOLKIT_INCLUDE - device_functions.h # Header included in toolkit - PATHS ${CUDA_TOOLKIT_TARGET_DIR} - ENV CUDA_PATH - ENV CUDA_INC_PATH - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -# Search default search paths, after we search our own set of paths. -find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) -mark_as_advanced(CUDA_TOOLKIT_INCLUDE) - -if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") - set(CUDA_HAS_FP16 TRUE) -else() - set(CUDA_HAS_FP16 FALSE) -endif() - -# Set the user list of include dir to nothing to initialize it. -set (CUDA_NVCC_INCLUDE_DIRS_USER "") -set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) - -macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # CUDA 3.2+ on Windows moved the library directories, so we need the new - # and old paths. - set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) - endif() - # CUDA 3.2+ on Windows moved the library directories, so we need to new - # (lib/Win32) and the old path (lib). - find_library(${_var} - NAMES ${_names} - PATHS "${CUDA_TOOLKIT_TARGET_DIR}" - ENV CUDA_PATH - ENV CUDA_LIB_PATH - PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" - DOC ${_doc} - NO_DEFAULT_PATH - ) - if (NOT CMAKE_CROSSCOMPILING) - # Search default search paths, after we search our own set of paths. - find_library(${_var} - NAMES ${_names} - PATHS "/usr/lib/nvidia-current" - DOC ${_doc} - ) - endif() -endmacro() - -macro(cuda_find_library_local_first _var _names _doc) - cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - -macro(find_library_local_first _var _names _doc ) - cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - - -# CUDA_LIBRARIES -cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") -if(CUDA_VERSION VERSION_EQUAL "3.0") - # The cudartemu library only existed for the 3.0 version of CUDA. - cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") - mark_as_advanced( - CUDA_CUDARTEMU_LIBRARY - ) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.5") - cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") - mark_as_advanced(CUDA_cudart_static_LIBRARY) -endif() - - -if(CUDA_cudart_static_LIBRARY) - # If static cudart available, use it by default, but provide a user-visible option to disable it. - option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) -else() - # If not available, silently disable the option. - set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) -else() - set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") - mark_as_advanced(CUDA_cudadevrt_LIBRARY) -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - if(UNIX) - # Check for the dependent libraries. - - # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} - # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and - # -Werror causes the try_compile to fail. We will just temporarily disable other flags - # when doing the find_package command here. - set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) - set(CMAKE_C_FLAGS "-fPIC") - find_package(Threads REQUIRED) - set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - - if(NOT APPLE) - #On Linux, you must link against librt when using the static cuda runtime. - find_library(CUDA_rt_LIBRARY rt) - if (NOT CUDA_rt_LIBRARY) - message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") - endif() - endif() - endif() -endif() - -# CUPTI library showed up in cuda toolkit 4.0 -if(NOT CUDA_VERSION VERSION_LESS "4.0") - cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") - mark_as_advanced(CUDA_cupti_LIBRARY) -endif() - -# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are -# using the CUDA runtime. For the dynamic version of the runtime, most of the -# dependencies are brough in, but for the static version there are additional libraries -# and linker commands needed. -# Initialize to empty -set(CUDA_LIBRARIES) - -# If we are using emulation mode and we found the cudartemu library then use -# that one instead of cudart. -if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) -elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) - if (TARGET Threads::Threads) - list(APPEND CUDA_LIBRARIES Threads::Threads) - endif() - list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) - if (CUDA_rt_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) - endif() - if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) - endif() -else() - list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) -endif() - -# 1.1 toolkit on linux doesn't appear to have a separate library on -# some platforms. -cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") - -mark_as_advanced( - CUDA_CUDA_LIBRARY - CUDA_CUDART_LIBRARY - ) - -####################### -# Look for some of the toolkit helper libraries -macro(FIND_CUDA_HELPER_LIBS _name) - cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") - mark_as_advanced(CUDA_${_name}_LIBRARY) -endmacro() - -####################### -# Disable emulation for v3.1 onward -if(CUDA_VERSION VERSION_GREATER "3.0") - if(CUDA_BUILD_EMULATION) - message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") - endif() -endif() - -# Search for additional CUDA toolkit libraries. -if(CUDA_VERSION VERSION_LESS "3.1") - # Emulation libraries aren't available in version 3.1 onward. - find_cuda_helper_libs(cufftemu) - find_cuda_helper_libs(cublasemu) -endif() -find_cuda_helper_libs(cufft) -find_cuda_helper_libs(cublas) -if(NOT CUDA_VERSION VERSION_LESS "3.2") - # cusparse showed up in version 3.2 - find_cuda_helper_libs(cusparse) - find_cuda_helper_libs(curand) - if (WIN32) - find_cuda_helper_libs(nvcuvenc) - find_cuda_helper_libs(nvcuvid) - endif() -endif() -if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") - # In CUDA 9.2 cublas_device was deprecated - find_cuda_helper_libs(cublas_device) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - find_cuda_helper_libs(nvToolsExt) - find_cuda_helper_libs(OpenCL) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "9.0") - # In CUDA 9.0 NPP was nppi was removed - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppial) - find_cuda_helper_libs(nppicc) - if(CUDA_VERSION VERSION_LESS "11.0") - find_cuda_helper_libs(nppicom) - endif() - find_cuda_helper_libs(nppidei) - find_cuda_helper_libs(nppif) - find_cuda_helper_libs(nppig) - find_cuda_helper_libs(nppim) - find_cuda_helper_libs(nppist) - find_cuda_helper_libs(nppisu) - find_cuda_helper_libs(nppitc) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(CUDA_VERSION VERSION_GREATER "5.0") - # In CUDA 5.5 NPP was split into 3 separate libraries. - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppi) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(NOT CUDA_VERSION VERSION_LESS "4.0") - find_cuda_helper_libs(npp) -endif() -if(NOT CUDA_VERSION VERSION_LESS "7.0") - # cusolver showed up in version 7.0 - find_cuda_helper_libs(cusolver) -endif() - -if (CUDA_BUILD_EMULATION) - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) -else() - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) -endif() - -######################## -# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with -# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory -find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h - HINTS - "$ENV{NVSDKCOMPUTE_ROOT}/C" - ENV NVSDKCUDA_ROOT - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" - PATHS - "/Developer/GPU\ Computing/C" - ) - -# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the -# environment variables. -set(CUDA_SDK_SEARCH_PATH - "${CUDA_SDK_ROOT_DIR}" - "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" - "/Developer/CUDA" - ) - -# Example of how to find an include file from the CUDA_SDK_ROOT_DIR - -# find_path(CUDA_CUT_INCLUDE_DIR -# cutil.h -# PATHS ${CUDA_SDK_SEARCH_PATH} -# PATH_SUFFIXES "common/inc" -# DOC "Location of cutil.h" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") - -# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) - - -# Example of how to find a library in the CUDA_SDK_ROOT_DIR - -# # cutil library is called cutil64 for 64 bit builds on windows. We don't want -# # to get these confused, so we are setting the name based on the word size of -# # the build. - -# if(CMAKE_SIZEOF_VOID_P EQUAL 8) -# set(cuda_cutil_name cutil64) -# else() -# set(cuda_cutil_name cutil32) -# endif() - -# find_library(CUDA_CUT_LIBRARY -# NAMES cutil ${cuda_cutil_name} -# PATHS ${CUDA_SDK_SEARCH_PATH} -# # The new version of the sdk shows up in common/lib, but the old one is in lib -# PATH_SUFFIXES "common/lib" "lib" -# DOC "Location of cutil library" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") -# mark_as_advanced(CUDA_CUT_LIBRARY) -# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) - - - -############################# -# Check for required components -set(CUDA_FOUND TRUE) - -set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) -set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) -set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) - -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) - -find_package_handle_standard_args(CUDA - REQUIRED_VARS - CUDA_TOOLKIT_ROOT_DIR - CUDA_NVCC_EXECUTABLE - CUDA_INCLUDE_DIRS - ${CUDA_CUDART_LIBRARY_VAR} - VERSION_VAR - CUDA_VERSION - ) - - - -############################################################################### -############################################################################### -# Macros -############################################################################### -############################################################################### - -############################################################################### -# Add include directories to pass to the nvcc command. -macro(CUDA_INCLUDE_DIRECTORIES) - foreach(dir ${ARGN}) - list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) - endforeach() -endmacro() - - -############################################################################## -cuda_find_helper_file(parse_cubin cmake) -cuda_find_helper_file(make2cmake cmake) -cuda_find_helper_file(run_nvcc cmake) -include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") - -############################################################################## -# Separate the OPTIONS out from the sources -# -macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) - set( ${_sources} ) - set( ${_cmake_options} ) - set( ${_options} ) - set( _found_options FALSE ) - foreach(arg ${ARGN}) - if("x${arg}" STREQUAL "xOPTIONS") - set( _found_options TRUE ) - elseif( - "x${arg}" STREQUAL "xWIN32" OR - "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR - "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR - "x${arg}" STREQUAL "xSTATIC" OR - "x${arg}" STREQUAL "xSHARED" OR - "x${arg}" STREQUAL "xMODULE" - ) - list(APPEND ${_cmake_options} ${arg}) - else() - if ( _found_options ) - list(APPEND ${_options} ${arg}) - else() - # Assume this is a file - list(APPEND ${_sources} ${arg}) - endif() - endif() - endforeach() -endmacro() - -############################################################################## -# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix -# -macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) - set( _found_config ) - foreach(arg ${ARGN}) - # Determine if we are dealing with a perconfiguration flag - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - if (arg STREQUAL "${config_upper}") - set( _found_config _${arg}) - # Set arg to nothing to keep it from being processed further - set( arg ) - endif() - endforeach() - - if ( arg ) - list(APPEND ${_option_prefix}${_found_config} "${arg}") - endif() - endforeach() -endmacro() - -############################################################################## -# Helper to add the include directory for CUDA only once -function(CUDA_ADD_CUDA_INCLUDE_ONCE) - get_directory_property(_include_directories INCLUDE_DIRECTORIES) - set(_add TRUE) - if(_include_directories) - foreach(dir ${_include_directories}) - if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") - set(_add FALSE) - endif() - endforeach() - endif() - if(_add) - include_directories(${CUDA_INCLUDE_DIRS}) - endif() -endfunction() - -function(CUDA_BUILD_SHARED_LIBRARY shared_flag) - set(cmake_args ${ARGN}) - # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then - # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. - list(FIND cmake_args SHARED _cuda_found_SHARED) - list(FIND cmake_args MODULE _cuda_found_MODULE) - list(FIND cmake_args STATIC _cuda_found_STATIC) - if( _cuda_found_SHARED GREATER -1 OR - _cuda_found_MODULE GREATER -1 OR - _cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs) - else() - if (BUILD_SHARED_LIBS) - set(_cuda_build_shared_libs SHARED) - else() - set(_cuda_build_shared_libs STATIC) - endif() - endif() - set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) -endfunction() - -############################################################################## -# Helper to avoid clashes of files with the same basename but different paths. -# This doesn't attempt to do exactly what CMake internals do, which is to only -# add this path when there is a conflict, since by the time a second collision -# in names is detected it's already too late to fix the first one. For -# consistency sake the relative path will be added to all files. -function(CUDA_COMPUTE_BUILD_PATH path build_path) - #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") - # Only deal with CMake style paths from here on out - file(TO_CMAKE_PATH "${path}" bpath) - if (IS_ABSOLUTE "${bpath}") - # Absolute paths are generally unnessary, especially if something like - # file(GLOB_RECURSE) is used to pick up the files. - - string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) - if (_binary_dir_pos EQUAL 0) - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") - else() - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") - endif() - endif() - - # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the - # CMake source. - - # Remove leading / - string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") - # Avoid absolute paths by removing ':' - string(REPLACE ":" "_" bpath "${bpath}") - # Avoid relative paths that go up the tree - string(REPLACE "../" "__/" bpath "${bpath}") - # Avoid spaces - string(REPLACE " " "_" bpath "${bpath}") - - # Strip off the filename. I wait until here to do it, since removin the - # basename can make a path that looked like path/../basename turn into - # path/.. (notice the trailing slash). - get_filename_component(bpath "${bpath}" PATH) - - set(${build_path} "${bpath}" PARENT_SCOPE) - #message("${build_path} = ${bpath}") -endfunction() - -############################################################################## -# This helper macro populates the following variables and setups up custom -# commands and targets to invoke the nvcc compiler to generate C or PTX source -# dependent upon the format parameter. The compiler is invoked once with -M -# to generate a dependency file and a second time with -cuda or -ptx to generate -# a .cpp or .ptx file. -# INPUT: -# cuda_target - Target name -# format - PTX, CUBIN, FATBIN or OBJ -# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. -# OPTIONS - Extra options to NVCC -# OUTPUT: -# generated_files - List of generated files -############################################################################## -############################################################################## - -macro(CUDA_WRAP_SRCS cuda_target format generated_files) - - # Put optional arguments in list. - set(_argn_list "${ARGN}") - # If one of the given optional arguments is "PHONY", make a note of it, then - # remove it from the list. - list(FIND _argn_list "PHONY" _phony_idx) - if("${_phony_idx}" GREATER "-1") - set(_target_is_phony true) - list(REMOVE_AT _argn_list ${_phony_idx}) - else() - set(_target_is_phony false) - endif() - - # If CMake doesn't support separable compilation, complain - if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") - message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") - endif() - - # Set up all the command line flags here, so that they can be overridden on a per target basis. - - set(nvcc_flags "") - - # Emulation if the card isn't present. - if (CUDA_BUILD_EMULATION) - # Emulation. - set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) - else() - # Device mode. No flags necessary. - endif() - - if(CUDA_HOST_COMPILATION_CPP) - set(CUDA_C_OR_CXX CXX) - else() - if(CUDA_VERSION VERSION_LESS "3.0") - set(nvcc_flags ${nvcc_flags} --host-compilation C) - else() - message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) - endif() - set(CUDA_C_OR_CXX C) - endif() - - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - - if(CUDA_64_BIT_DEVICE_CODE) - set(nvcc_flags ${nvcc_flags} -m64) - else() - set(nvcc_flags ${nvcc_flags} -m32) - endif() - - if(CUDA_TARGET_CPU_ARCH) - set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") - endif() - - # This needs to be passed in at this stage, because VS needs to fill out the - # various macros from within VS. Note that CCBIN is only used if - # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches - # _CUDA_MSVC_HOST_COMPILER - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) - else() - set(ccbin_flags) - endif() - - # Figure out which configure we will use and pass that in as an argument to - # the script. We need to defer the decision until compilation time, because - # for VS projects we won't know if we are making a debug or release build - # until build time. - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set( CUDA_build_configuration "$(ConfigurationName)" ) - else() - set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") - endif() - - # Initialize our list of includes with the user ones followed by the CUDA system ones. - set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") - if(_target_is_phony) - # If the passed in target name isn't a real target (i.e., this is from a call to one of the - # cuda_compile_* functions), need to query directory properties to get include directories - # and compile definitions. - get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) - get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) - - list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") - set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") - else() - # Append the include directories for this target via generator expression, which is - # expanded by the FILE(GENERATE) call below. This generator expression captures all - # include dirs set by the user, whether via directory properties or target properties - list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") - - # Do the same thing with compile definitions - set(CUDA_NVCC_COMPILE_DEFINITIONS "$") - endif() - - - # Reset these variables - set(CUDA_WRAP_OPTION_NVCC_FLAGS) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) - endforeach() - - CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) - CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) - - # Figure out if we are building a shared library. BUILD_SHARED_LIBS is - # respected in CUDA_ADD_LIBRARY. - set(_cuda_build_shared_libs FALSE) - # SHARED, MODULE - list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) - list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) - if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) - set(_cuda_build_shared_libs TRUE) - endif() - # STATIC - list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) - if(_cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs FALSE) - endif() - - # CUDA_HOST_FLAGS - if(_cuda_build_shared_libs) - # If we are setting up code for a shared library, then we need to add extra flags for - # compiling objects for shared libraries. - set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) - else() - set(CUDA_HOST_SHARED_FLAGS) - endif() - # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We - # always need to set the SHARED_FLAGS, though. - if(CUDA_PROPAGATE_HOST_FLAGS) - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") - else() - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") - endif() - - set(_cuda_nvcc_flags_config "# Build specific configuration flags") - # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS - # we convert the strings to lists (like we want). - - if(CUDA_PROPAGATE_HOST_FLAGS) - # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g - set(_cuda_fix_g3 FALSE) - - if(CMAKE_COMPILER_IS_GNUCC) - if (CUDA_VERSION VERSION_LESS "3.0" OR - CUDA_VERSION VERSION_EQUAL "4.1" OR - CUDA_VERSION VERSION_EQUAL "4.2" - ) - set(_cuda_fix_g3 TRUE) - endif() - endif() - if(_cuda_fix_g3) - string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - else() - set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - endif() - - string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") - endif() - - # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list - # like it is currently), we can remove the quotes around the - # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. - string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") - endforeach() - - # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and - # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses - # the C preprocessor). In order to get this to work correctly, we need to use nvcc's - # specific c++11 flag. - if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") - # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at - # the main flag instead of the configuration specific flags. - if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) - list(APPEND nvcc_flags --std c++11) - endif() - string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") - endif() - - if(_cuda_build_shared_libs) - list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") - endif() - - # Reset the output variable - set(_cuda_wrap_generated_files "") - - # Iterate over the macro arguments and create custom - # commands for all the .cu files. - foreach(file ${_argn_list}) - # Ignore any file marked as a HEADER_FILE_ONLY - get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - # Allow per source file overrides of the format. Also allows compiling non-.cu files. - get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) - if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) - - if(NOT _cuda_source_format) - set(_cuda_source_format ${format}) - endif() - # If file isn't a .cu file, we need to tell nvcc to treat it as such. - if(NOT ${file} MATCHES "\\.cu$") - set(cuda_language_flag -x=cu) - else() - set(cuda_language_flag) - endif() - - if( ${_cuda_source_format} MATCHES "OBJ") - set( cuda_compile_to_external_module OFF ) - else() - set( cuda_compile_to_external_module ON ) - if( ${_cuda_source_format} MATCHES "PTX" ) - set( cuda_compile_to_external_module_type "ptx" ) - elseif( ${_cuda_source_format} MATCHES "CUBIN") - set( cuda_compile_to_external_module_type "cubin" ) - elseif( ${_cuda_source_format} MATCHES "FATBIN") - set( cuda_compile_to_external_module_type "fatbin" ) - else() - message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") - endif() - endif() - - if(cuda_compile_to_external_module) - # Don't use any of the host compilation flags for PTX targets. - set(CUDA_HOST_FLAGS) - set(CUDA_NVCC_FLAGS_CONFIG) - else() - set(CUDA_HOST_FLAGS ${_cuda_host_flags}) - set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) - endif() - - # Determine output directory - cuda_compute_build_path("${file}" cuda_build_path) - set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") - if(CUDA_GENERATED_OUTPUT_DIR) - set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") - else() - if ( cuda_compile_to_external_module ) - set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") - else() - set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") - endif() - endif() - - # Add a custom target to generate a c or ptx file. ###################### - - get_filename_component( basename ${file} NAME ) - if( cuda_compile_to_external_module ) - set(generated_file_path "${cuda_compile_output_dir}") - set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") - set(format_flag "-${cuda_compile_to_external_module_type}") - file(MAKE_DIRECTORY "${cuda_compile_output_dir}") - else() - set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") - set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") - if(CUDA_SEPARABLE_COMPILATION) - set(format_flag "-dc") - else() - set(format_flag "-c") - endif() - endif() - - # Set all of our file names. Make sure that whatever filenames that have - # generated_file_path in them get passed in through as a command line - # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time - # instead of configure time. - set(generated_file "${generated_file_path}/${generated_file_basename}") - set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") - set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") - set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") - set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") - set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") - - # Setup properties for obj files: - if( NOT cuda_compile_to_external_module ) - set_source_files_properties("${generated_file}" - PROPERTIES - EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. - ) - endif() - - # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. - get_filename_component(file_path "${file}" PATH) - if(IS_ABSOLUTE "${file_path}") - set(source_file "${file}") - else() - set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - endif() - - if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) - list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") - endif() - - # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### - cuda_include_nvcc_dependencies(${cmake_dependency_file}) - - # Convenience string for output ######################################### - if(CUDA_BUILD_EMULATION) - set(cuda_build_type "Emulation") - else() - set(cuda_build_type "Device") - endif() - - # Build the NVCC made dependency file ################################### - set(build_cubin OFF) - if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) - if ( NOT cuda_compile_to_external_module ) - set ( build_cubin ON ) - endif() - endif() - - # Configure the build script - configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) - file(GENERATE - OUTPUT "${custom_target_script}" - INPUT "${custom_target_script_pregen}" - ) - - # So if a user specifies the same cuda file as input more than once, you - # can have bad things happen with dependencies. Here we check an option - # to see if this is the behavior they want. - if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) - set(main_dep MAIN_DEPENDENCY ${source_file}) - else() - set(main_dep DEPENDS ${source_file}) - endif() - - if(CUDA_VERBOSE_BUILD) - set(verbose_output ON) - elseif(CMAKE_GENERATOR MATCHES "Makefiles") - set(verbose_output "$(VERBOSE)") - else() - set(verbose_output OFF) - endif() - - # Create up the comment string - file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") - if(cuda_compile_to_external_module) - set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") - else() - set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") - endif() - - set(_verbatim VERBATIM) - if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - # Build the generated file and dependency file ########################## - add_custom_command( - OUTPUT ${generated_file} - # These output files depend on the source_file and the contents of cmake_dependency_file - ${main_dep} - DEPENDS ${CUDA_NVCC_DEPEND} - DEPENDS ${custom_target_script} - # Make sure the output directory exists before trying to write to it. - COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" - COMMAND ${CMAKE_COMMAND} ARGS - -D verbose:BOOL=${verbose_output} - ${ccbin_flags} - -D build_configuration:STRING=${CUDA_build_configuration} - -D "generated_file:STRING=${generated_file}" - -D "generated_cubin_file:STRING=${generated_cubin_file}" - -P "${custom_target_script}" - WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" - COMMENT "${cuda_build_comment_string}" - ${_verbatim} - ) - - # Make sure the build system knows the file is generated. - set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - - list(APPEND _cuda_wrap_generated_files ${generated_file}) - - # Add the other files that we want cmake to clean on a cleanup ########## - list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") - list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) - set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") - - endif() - endforeach() - - # Set the return parameter - set(${generated_files} ${_cuda_wrap_generated_files}) -endmacro() - -function(_cuda_get_important_host_flags important_flags flag_string) - if(CMAKE_GENERATOR MATCHES "Visual Studio") - string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - else() - string(REGEX MATCHALL "-fPIC" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - endif() - set(${important_flags} ${${important_flags}} PARENT_SCOPE) -endfunction() - -############################################################################### -############################################################################### -# Separable Compilation Link -############################################################################### -############################################################################### - -# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS -function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) - if (object_files) - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") - else() - set(output_file) - endif() - - set(${output_file_var} "${output_file}" PARENT_SCOPE) -endfunction() - -# Setup the build rule for the separable compilation intermediate link file. -function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) - if (object_files) - - set_source_files_properties("${output_file}" - PROPERTIES - EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only - # be linked. - GENERATED TRUE # This file is generated during the build - ) - - # For now we are ignoring all the configuration specific flags. - set(nvcc_flags) - CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) - if(CUDA_64_BIT_DEVICE_CODE) - list(APPEND nvcc_flags -m64) - else() - list(APPEND nvcc_flags -m32) - endif() - # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. - list( FIND nvcc_flags "-ccbin" ccbin_found0 ) - list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) - if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) - # Match VERBATIM check below. - if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") - list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") - else() - list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") - endif() - endif() - - # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* - set(config_specific_flags) - set(flags) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # Add config specific flags - foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) - list(APPEND config_specific_flags $<$:${f}>) - endforeach() - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - foreach(f ${important_host_flags}) - list(APPEND flags $<$:-Xcompiler> $<$:${f}>) - endforeach() - endforeach() - # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") - foreach(f ${important_host_flags}) - list(APPEND flags -Xcompiler ${f}) - endforeach() - - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags - set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) - - file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") - - # Some generators don't handle the multiple levels of custom command - # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so - # we work around that issue by compiling the intermediate link object as a - # pre-link custom command in that situation. - set(do_obj_build_rule TRUE) - if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) - # VS 2010 and 2012 have this problem. - set(do_obj_build_rule FALSE) - endif() - - set(_verbatim VERBATIM) - if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - if (do_obj_build_rule) - add_custom_command( - OUTPUT ${output_file} - DEPENDS ${object_files} - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} - ${flags} - COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - else() - get_filename_component(output_file_dir "${output_file}" DIRECTORY) - add_custom_command( - TARGET ${cuda_target} - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - endif() - endif() -endfunction() - -############################################################################### -############################################################################### -# ADD LIBRARY -############################################################################### -############################################################################### -macro(CUDA_ADD_LIBRARY cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} - ${_cmake_options} ${_cuda_shared_flag} - OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_library(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - if(CUDA_SEPARABLE_COMPILATION) - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_cudadevrt_LIBRARY} - ) - endif() - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# ADD EXECUTABLE -############################################################################### -############################################################################### -macro(CUDA_ADD_EXECUTABLE cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_executable(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# (Internal) helper for manually added cuda source files with specific targets -############################################################################### -############################################################################### -macro(cuda_compile_base cuda_target format generated_files) - # Update a counter in this directory, to keep phony target names unique. - set(_cuda_target "${cuda_target}") - get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) - if(_counter) - math(EXPR _counter "${_counter} + 1") - else() - set(_counter 1) - endif() - string(APPEND _cuda_target "_${_counter}") - set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} - ${_cmake_options} OPTIONS ${_options} PHONY) - - set( ${generated_files} ${_generated_files}) - -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE -############################################################################### -############################################################################### -macro(CUDA_COMPILE generated_files) - cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE PTX -############################################################################### -############################################################################### -macro(CUDA_COMPILE_PTX generated_files) - cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE FATBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_FATBIN generated_files) - cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE CUBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_CUBIN generated_files) - cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) -endmacro() - - -############################################################################### -############################################################################### -# CUDA ADD CUFFT TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUFFT_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA ADD CUBLAS TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUBLAS_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA BUILD CLEAN TARGET -############################################################################### -############################################################################### -macro(CUDA_BUILD_CLEAN_TARGET) - # Call this after you add all your CUDA targets, and you will get a - # convenience target. You should also make clean after running this target - # to get the build system to generate all the code again. - - set(cuda_clean_target_name clean_cuda_depends) - if (CMAKE_GENERATOR MATCHES "Visual Studio") - string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) - endif() - add_custom_target(${cuda_clean_target_name} - COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) - - # Clear out the variable, so the next time we configure it will be empty. - # This is useful so that the files won't persist in the list after targets - # have been removed. - set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") -endmacro() diff --git a/ports/opencv2/portfile.cmake b/ports/opencv2/portfile.cmake index e901c77a9eb874..8033ba4b4fdd8f 100644 --- a/ports/opencv2/portfile.cmake +++ b/ports/opencv2/portfile.cmake @@ -30,10 +30,10 @@ vcpkg_from_github( file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) #contains fixes for CUDA 11 compat, remove when CMake has support for it vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" WITH_CUDA + "cuda" WITH_CUBLAS "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "jasper" WITH_JASPER @@ -105,7 +105,6 @@ vcpkg_configure_cmake( -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENMP=OFF -DWITH_ZLIB=ON - -DWITH_CUBLAS=OFF # newer libcublas cannot be found by the old cuda cmake script in opencv2, requires a fix ) vcpkg_install_cmake() @@ -116,14 +115,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES) string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" "set(CMAKE_IMPORT_FILE_VERSION 1) -find_package(CUDA QUIET) -find_package(Threads QUIET) find_package(PNG QUIET) -find_package(OpenEXR QUIET) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) -find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(TIFF QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") diff --git a/ports/opencv3/0001-disable-downloading.patch b/ports/opencv3/0001-disable-downloading.patch index 41131c6a811b21..7e49fae2a1e2f2 100644 --- a/ports/opencv3/0001-disable-downloading.patch +++ b/ports/opencv3/0001-disable-downloading.patch @@ -1,14 +1,13 @@ diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake -index 63cf6d3..01e84a5 100644 +index cdc47ad..175aaf3 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -157,6 +157,9 @@ function(ocv_download) +@@ -154,6 +154,8 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") -+ - foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) - ocv_download_log("#try ${try}") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" + INACTIVITY_TIMEOUT 60 + TIMEOUT 600 diff --git a/ports/opencv3/0002-install-options.patch b/ports/opencv3/0002-install-options.patch index 4f0197f9d23304..3d334a0a150880 100644 --- a/ports/opencv3/0002-install-options.patch +++ b/ports/opencv3/0002-install-options.patch @@ -1,65 +1,69 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 614baa2..1e930a3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -601,7 +601,7 @@ endif() - ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) - - # --- Python Support --- --if(NOT IOS) -+if(0) - include(cmake/OpenCVDetectPython.cmake) - endif() - -diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index 476156f..4b27b6a 100644 ---- a/cmake/OpenCVCompilerOptions.cmake -+++ b/cmake/OpenCVCompilerOptions.cmake -@@ -261,7 +261,6 @@ if(MSVC) - #endif() - - if(BUILD_WITH_DEBUG_INFO) -- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") - set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") - set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") - endif() -diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index c7f9fc2..84bd302 100644 ---- a/cmake/OpenCVGenConfig.cmake -+++ b/cmake/OpenCVGenConfig.cmake -@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) - endif() - endfunction() - --if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(TRUE) - ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") - endif() - --if(ANDROID) -+if(FALSE) - ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") - install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) - endif() -@@ -121,7 +121,7 @@ endif() - # -------------------------------------------------------------------------------------------- - # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages - # -------------------------------------------------------------------------------------------- --if(WIN32) -+if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) - ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" - "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" -diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt -index 1f0d720..0bb1ff7 100644 ---- a/data/CMakeLists.txt -+++ b/data/CMakeLists.txt -@@ -1,8 +1,6 @@ - file(GLOB HAAR_CASCADES haarcascades/*.xml) - file(GLOB LBP_CASCADES lbpcascades/*.xml) - --install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) --install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) - - if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) - install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6ce583b..e9ea757 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -665,7 +665,7 @@ endif() + + if(WIN32) + # Postfix of DLLs: +- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") ++ set(OPENCV_DLLVERSION "") + set(OPENCV_DEBUG_POSTFIX d) + else() + # Postfix of so's: +@@ -716,7 +716,7 @@ endif() + ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) + + # --- Python Support --- +-if(NOT IOS) ++if(0) + include(cmake/OpenCVDetectPython.cmake) + endif() + +diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake +index 0b9d669..142b21b 100644 +--- a/cmake/OpenCVCompilerOptions.cmake ++++ b/cmake/OpenCVCompilerOptions.cmake +@@ -254,7 +254,6 @@ if(MSVC) + #endif() + + if(BUILD_WITH_DEBUG_INFO) +- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") + set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") + set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") + endif() +diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake +index 2c7c42b..e7bc157 100644 +--- a/cmake/OpenCVGenConfig.cmake ++++ b/cmake/OpenCVGenConfig.cmake +@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) + endif() + endfunction() + +-if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) ++if(NOT ANDROID) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") + endif() + +@@ -121,7 +121,7 @@ endif() + # -------------------------------------------------------------------------------------------- + # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages + # -------------------------------------------------------------------------------------------- +-if(WIN32) ++if(0) + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + if(BUILD_SHARED_LIBS) + set(_lib_suffix "lib") +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index 1f0d720..0bb1ff7 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -1,8 +1,6 @@ + file(GLOB HAAR_CASCADES haarcascades/*.xml) + file(GLOB LBP_CASCADES lbpcascades/*.xml) + +-install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) +-install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) + + if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) + install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") diff --git a/ports/opencv3/0003-force-package-requirements.patch b/ports/opencv3/0003-force-package-requirements.patch index 7f1b0c906f23f3..d43ccf4f6e3263 100644 --- a/ports/opencv3/0003-force-package-requirements.patch +++ b/ports/opencv3/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index fcf716b..f3951e3 100644 +index fcf716b..bda80e9 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -70,7 +70,7 @@ index fcf716b..f3951e3 100644 # --- GDAL (optional) --- if(WITH_GDAL) - find_package(GDAL QUIET) -+ find_package(GDAL REQUIRED) ++ find_package(GDAL REQUIRED) if(NOT GDAL_FOUND) set(HAVE_GDAL NO) @@ -83,39 +83,3 @@ index fcf716b..f3951e3 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) -diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake -index b9b1a95..596c152 100644 ---- a/cmake/OpenCVFindLibsPerf.cmake -+++ b/cmake/OpenCVFindLibsPerf.cmake -@@ -51,14 +51,9 @@ endif(WITH_CUDA) - - # --- Eigen --- - if(WITH_EIGEN AND NOT HAVE_EIGEN) -- find_package(Eigen3 QUIET) -+ find_package(Eigen3 REQUIRED) - - if(Eigen3_FOUND) -- if(TARGET Eigen3::Eigen) -- # Use Eigen3 imported target if possible -- list(APPEND OPENCV_LINKER_LIBS Eigen3::Eigen) -- set(HAVE_EIGEN 1) -- else() - if(DEFINED EIGEN3_INCLUDE_DIRS) - set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) - set(HAVE_EIGEN 1) -@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) - set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) - set(HAVE_EIGEN 1) - endif() -- endif() - if(HAVE_EIGEN) - if(DEFINED EIGEN3_WORLD_VERSION) # CMake module - set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) -@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) - set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) - set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) - endif() -+ ocv_include_directories(${EIGEN_INCLUDE_PATH}) - endif() - endif() - diff --git a/ports/opencv3/0004-add-missing-stdexcept-include.patch b/ports/opencv3/0004-add-missing-stdexcept-include.patch deleted file mode 100644 index 4f0df7d06615e5..00000000000000 --- a/ports/opencv3/0004-add-missing-stdexcept-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp -index fef3fea..68d1a80 100644 ---- a/modules/cvv/src/util/observer_ptr.hpp -+++ b/modules/cvv/src/util/observer_ptr.hpp -@@ -11,6 +11,7 @@ - #include //size_t - #include // [u]intXX_t - #include // since some people like to forget that one -+#include - - namespace cvv - { diff --git a/ports/opencv3/0009-fix-uwp.patch b/ports/opencv3/0009-fix-uwp.patch index 73cac14531af2a..cba3963dc9693f 100644 --- a/ports/opencv3/0009-fix-uwp.patch +++ b/ports/opencv3/0009-fix-uwp.patch @@ -1,13 +1,67 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 634b5b2..07a96fb 100644 +index c2fda8f..3f7dfdc 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -1183,7 +1183,7 @@ function(ocv_add_perf_tests) - set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") - endif() - -- if(WINRT) -+ if(WINRT AND BUILD_TESTS) - # removing APPCONTAINER from tests to run from console - # look for detailed description inside of ocv_create_module macro above - add_custom_command(TARGET "opencv_perf_${name}" +@@ -850,7 +850,7 @@ macro(ocv_create_module) + set(the_module_target ${the_module}) + endif() + +- if(WINRT) ++ if(WINRT AND BUILD_TESTS) + # removing APPCONTAINER from modules to run from console + # in case of usual starting of WinRT test apps output is missing + # so starting of console version w/o APPCONTAINER is required to get test results +diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp +index f1107b0..c613ca2 100644 +--- a/modules/core/src/utils/datafile.cpp ++++ b/modules/core/src/utils/datafile.cpp +@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) + CV_UNUSED(addr); + #ifdef _WIN32 + HMODULE m = 0; +-#if _WIN32_WINNT >= 0x0501 ++#if (_WIN32_WINNT >= 0x0501) && (!WINRT_STORE) + ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast(addr), + &m); +diff --git a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp +index f4147f3..b92efdd 100644 +--- a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp ++++ b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp +@@ -24,6 +24,7 @@ + // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + // POSSIBILITY OF SUCH DAMAGE. + ++#include "opencv2/core/cvdef.h" + using namespace Windows::UI::Xaml::Controls; + + namespace cv +diff --git a/modules/highgui/src/window_winrt_bridge.hpp b/modules/highgui/src/window_winrt_bridge.hpp +index 25f4aef..5429f0b 100644 +--- a/modules/highgui/src/window_winrt_bridge.hpp ++++ b/modules/highgui/src/window_winrt_bridge.hpp +@@ -28,6 +28,7 @@ + + #include + #include ++#include "opencv2/highgui/highgui_c.h" + + using namespace Windows::UI::Xaml::Controls; + +diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp +index 236e227..e2417dc 100644 +--- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp ++++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp +@@ -94,10 +94,10 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() + + void Media::CaptureFrameGrabber::ShowCameraSettings() + { +-#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP ++#if (WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY!=WINAPI_FAMILY_APP) + if (_state == State::Started) + { +- CameraOptionsUI::Show(_capture.Get()); ++ CameraOptionsUI::Show(_capture.Get()); // TODO: Turn it on again in UWP mode by adding reference to UWP Desktop Extensions + } + #endif + } diff --git a/ports/opencv3/CONTROL b/ports/opencv3/CONTROL index 623eb99218e3af..a103e97a6d9dd2 100644 --- a/ports/opencv3/CONTROL +++ b/ports/opencv3/CONTROL @@ -1,5 +1,5 @@ Source: opencv3 -Version: 3.4.10 +Version: 3.4.7-4 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -12,11 +12,11 @@ Feature: flann Description: opencv_flann module Feature: contrib -Build-Depends: opencv3[dnn], hdf5 (!uwp), tesseract (!uwp) +Build-Depends: opencv3[dnn], hdf5 (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv3[contrib], cuda, cudnn +Build-Depends: opencv3[contrib], cuda Description: CUDA support for opencv Feature: dnn @@ -35,10 +35,6 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv -Feature: halide -Build-Depends: halide, opencv3[core], opencv3[dnn] -Description: Halide support for opencv - Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -90,5 +86,9 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv +Feature: halide +Build-Depends: halide, opencv3[core], opencv3[dnn] +Description: Halide support for opencv + Feature: world Description: Compile to a single package support for opencv diff --git a/ports/opencv3/FindCUDA.cmake b/ports/opencv3/FindCUDA.cmake deleted file mode 100644 index 56e15e89d2ed07..00000000000000 --- a/ports/opencv3/FindCUDA.cmake +++ /dev/null @@ -1,2026 +0,0 @@ -#[=======================================================================[.rst: -FindCUDA --------- - -.. deprecated:: 3.10 - - Superseded by first-class support for the CUDA language in CMake. - Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. - -Replacement -^^^^^^^^^^^ - -It is no longer necessary to use this module or call ``find_package(CUDA)`` -for compiling CUDA code. Instead, list ``CUDA`` among the languages named -in the top-level call to the :command:`project` command, or call the -:command:`enable_language` command with ``CUDA``. -Then one can add CUDA (``.cu``) sources to programs directly -in calls to :command:`add_library` and :command:`add_executable`. - -To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` -module has superseded this module. It works whether or not the ``CUDA`` -language is enabled. - -Documentation of Deprecated Usage -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Tools for building CUDA C files: libraries and build dependencies. - -This script locates the NVIDIA CUDA C tools. It should work on Linux, -Windows, and macOS and should be reasonably up to date with CUDA C -releases. - -This script makes use of the standard :command:`find_package` arguments of -````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an -acceptable version of CUDA was found. - -The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if -the prefix cannot be determined by the location of nvcc in the system -path and ``REQUIRED`` is specified to :command:`find_package`. To use -a different installed version of the toolkit set the environment variable -``CUDA_BIN_PATH`` before running cmake (e.g. -``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default -``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If -you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that -depend on the path will be relocated. - -It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain -platforms, or to use a CUDA runtime not installed in the default -location. In newer versions of the toolkit the CUDA library is -included with the graphics driver -- be sure that the driver version -matches what is needed by the CUDA runtime version. - -The following variables affect the behavior of the macros in the -script (in alphabetical order). Note that any of these flags can be -changed multiple times in the same directory before calling -``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, -``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` -or ``CUDA_WRAP_SRCS``:: - - CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) - -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. - Note that making this different from the host code when generating object - or C files from CUDA code just won't work, because size_t gets defined by - nvcc in the generated source. If you compile to PTX and then load the - file yourself, you can mix bit sizes between device and host. - - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) - -- Set to ON if you want the custom build rule to be attached to the source - file in Visual Studio. Turn OFF if you add the same cuda file to multiple - targets. - - This allows the user to build the target from the CUDA file; however, bad - things can happen if the CUDA source file is added to multiple targets. - When performing parallel builds it is possible for the custom build - command to be run more than once and in parallel causing cryptic build - errors. VS runs the rules for every source file in the target, and a - source can have only one rule no matter how many projects it is added to. - When the rule is run from multiple targets race conditions can occur on - the generated file. Eventually everything will get built, but if the user - is unaware of this behavior, there may be confusion. It would be nice if - this script could detect the reuse of source files across multiple targets - and turn the option off for the user, but no good solution could be found. - - CUDA_BUILD_CUBIN (Default OFF) - -- Set to ON to enable and extra compilation pass with the -cubin option in - Device mode. The output is parsed and register, shared memory usage is - printed during build. - - CUDA_BUILD_EMULATION (Default OFF for device mode) - -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files - when CUDA_BUILD_EMULATION is TRUE. - - CUDA_LINK_LIBRARIES_KEYWORD (Default "") - -- The keyword to use for internal - target_link_libraries calls. The default is to use no keyword which - uses the old "plain" form of target_link_libraries. Note that is matters - because whatever is used inside the FindCUDA module must also be used - outside - the two forms of target_link_libraries cannot be mixed. - - CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) - -- Set to the path you wish to have the generated files placed. If it is - blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. - Intermediate files will always be placed in - CMAKE_CURRENT_BINARY_DIR/CMakeFiles. - - CUDA_HOST_COMPILATION_CPP (Default ON) - -- Set to OFF for C compilation of host code. - - CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) - -- Set the host compiler to be used by nvcc. Ignored if -ccbin or - --compiler-bindir is already present in the CUDA_NVCC_FLAGS or - CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, - the host compiler is constructed with one or more visual studio macros - such as $(VCInstallDir), that expands out to the path when - the command is run from within VS. - If the CUDAHOSTCXX environment variable is set it will - be used as the default. - - CUDA_NVCC_FLAGS - CUDA_NVCC_FLAGS_ - -- Additional NVCC command line arguments. NOTE: multiple arguments must be - semi-colon delimited (e.g. --compiler-options;-Wall) - - CUDA_PROPAGATE_HOST_FLAGS (Default ON) - -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration - dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the - host compiler through nvcc's -Xcompiler flag. This helps make the - generated host code match the rest of the system better. Sometimes - certain flags give nvcc problems, and this will help you turn the flag - propagation off. This does not affect the flags supplied directly to nvcc - via CUDA_NVCC_FLAGS or through the OPTION flags specified through - CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for - shared library compilation are not affected by this flag. - - CUDA_SEPARABLE_COMPILATION (Default OFF) - -- If set this will enable separable compilation for all CUDA runtime object - files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY - (e.g. calling CUDA_WRAP_SRCS directly), - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. - - CUDA_SOURCE_PROPERTY_FORMAT - -- If this source file property is set, it can override the format specified - to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file - is not a .cu file, setting this file will cause it to be treated as a .cu - file. See documentation for set_source_files_properties on how to set - this property. - - CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) - -- When enabled the static version of the CUDA runtime library will be used - in CUDA_LIBRARIES. If the version of CUDA configured doesn't support - this option, then it will be silently disabled. - - CUDA_VERBOSE_BUILD (Default OFF) - -- Set to ON to see all the commands used when building the CUDA file. When - using a Makefile generator the value defaults to VERBOSE (run make - VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will - always print the output. - -The script creates the following macros (in alphabetical order):: - - CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) - -- Adds the cufft library to the target (can be any target). Handles whether - you are in emulation mode or not. - - CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) - -- Adds the cublas library to the target (can be any target). Handles - whether you are in emulation mode or not. - - CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... - [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Creates an executable "cuda_target" which is made up of the files - specified. All of the non CUDA C files are compiled using the standard - build rules specified by CMAKE and the cuda files are compiled to object - files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is - added automatically to include_directories(). Some standard CMake target - calls can be used on the target after calling this macro - (e.g. set_target_properties and target_link_libraries), but setting - properties that adjust compilation flags will not affect code compiled by - nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. - - CUDA_ADD_LIBRARY( cuda_target file0 file1 ... - [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Same as CUDA_ADD_EXECUTABLE except that a library is created. - - CUDA_BUILD_CLEAN_TARGET() - -- Creates a convenience target that deletes all the dependency files - generated. You should make clean after running this target to ensure the - dependency files get regenerated. - - CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] - [OPTIONS ...] ) - -- Returns a list of generated files from the input source files to be used - with ADD_LIBRARY or ADD_EXECUTABLE. - - CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of PTX files generated from the input source files. - - CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of FATBIN files generated from the input source files. - - CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of CUBIN files generated from the input source files. - - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var - cuda_target - object_files ) - -- Compute the name of the intermediate link file used for separable - compilation. This file name is typically passed into - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced - based on cuda_target the list of objects files that need separable - compilation as specified by object_files. If the object_files list is - empty, then output_file_var will be empty. This function is called - automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that - this is a function and not a macro. - - CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) - -- Sets the directories that should be passed to nvcc - (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu - files. - - - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target - nvcc_flags object_files) - -- Generates the link object required by separable compilation from the given - object files. This is called automatically for CUDA_ADD_EXECUTABLE and - CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS - directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the - nvcc_flags passed in are the same as the flags passed in via the OPTIONS - argument. The only nvcc flag added automatically is the bitness flag as - specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function - instead of a macro. - - CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) - -- Selects GPU arch flags for nvcc based on target_CUDA_architectures - target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) - - "Auto" detects local machine GPU compute arch at runtime. - - "Common" and "All" cover common and entire subsets of architectures - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal - NUM: Any number. Only those pairs are currently accepted by NVCC though: - 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 - Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} - Additionally, sets ${out_variable}_readable to the resulting numeric list - Example: - CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) - LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) - - More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA - Note that this is a function instead of a macro. - - CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... - [STATIC | SHARED | MODULE] [OPTIONS ...] ) - -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this - function under the hood. - - Given the list of files (file0 file1 ... fileN) this macro generates - custom commands that generate either PTX or linkable objects (use "PTX" or - "OBJ" for the format argument to switch). Files that don't end with .cu - or have the HEADER_FILE_ONLY property are ignored. - - The arguments passed in after OPTIONS are extra command line options to - give to nvcc. You can also specify per configuration options by - specifying the name of the configuration followed by the options. General - options must precede configuration specific options. Not all - configurations need to be specified, only the ones provided will be used. - - OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" - DEBUG -g - RELEASE --use_fast_math - RELWITHDEBINFO --use_fast_math;-g - MINSIZEREL --use_fast_math - - For certain configurations (namely VS generating object files with - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will - be produced for the given cuda file. This is because when you add the - cuda file to Visual Studio it knows that this file produces an object file - and will link in the resulting object file automatically. - - This script will also generate a separate cmake script that is used at - build time to invoke nvcc. This is for several reasons. - - 1. nvcc can return negative numbers as return values which confuses - Visual Studio into thinking that the command succeeded. The script now - checks the error codes and produces errors when there was a problem. - - 2. nvcc has been known to not delete incomplete results when it - encounters problems. This confuses build systems into thinking the - target was generated when in fact an unusable file exists. The script - now deletes the output files if there was an error. - - 3. By putting all the options that affect the build into a file and then - make the build rule dependent on the file, the output files will be - regenerated when the options change. - - This script also looks at optional arguments STATIC, SHARED, or MODULE to - determine when to target the object compilation for a shared library. - BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in - CUDA_ADD_LIBRARY. On some systems special flags are added for building - objects intended for shared libraries. A preprocessor macro, - _EXPORTS is defined when a shared library compilation is - detected. - - Flags passed into add_definitions with -D or /D are passed along to nvcc. - - - -The script defines the following variables:: - - CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. - CUDA_VERSION_MINOR -- The minor version. - CUDA_VERSION - CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR - CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. - - CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). - CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the - SDK. This script will not directly support finding - specific libraries or headers, as that isn't - supported by NVIDIA. If you want to change - libraries when the path changes see the - FindCUDA.cmake script for an example of how to clear - these variables. There are also examples of how to - use the CUDA_SDK_ROOT_DIR to locate headers or - libraries, if you so choose (at your own risk). - CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically - for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. - CUDA_LIBRARIES -- Cuda RT library. - CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT - implementation (alternative to: - CUDA_ADD_CUFFT_TO_TARGET macro) - CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS - implementation (alternative to: - CUDA_ADD_CUBLAS_TO_TARGET macro). - CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. - Only available for CUDA version 5.5+ - CUDA_cudadevrt_LIBRARY -- Device runtime library. - Required for separable compilation. - CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. - Only available for CUDA version 4.0+. - CUDA_curand_LIBRARY -- CUDA Random Number Generation library. - Only available for CUDA version 3.2+. - CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. - Only available for CUDA version 7.0+. - CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. - Only available for CUDA version 3.2+. - CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. - Only available for CUDA version 4.0+. - CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). - Only available for CUDA version 5.5+. - CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 5.5 - 8.0. - CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0 - 10.2. - Replaced by nvjpeg. - CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). - Only available for CUDA version 5.5+. - CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvToolsExt_LIBRARY - -- NVIDA CUDA Tools Extension library. - Available for CUDA version 5+. - CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. - Available for CUDA version 5+. - -#]=======================================================================] - -# James Bigler, NVIDIA Corp (nvidia.com - jbigler) -# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html -# -# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. -# -# Copyright (c) 2007-2009 -# Scientific Computing and Imaging Institute, University of Utah -# -# This code is licensed under the MIT License. See the FindCUDA.cmake script -# for the text of the license. - -# The MIT License -# -# License for the specific language governing rights and limitations under -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -############################################################################### - -# FindCUDA.cmake - -# This macro helps us find the location of helper files we will need the full path to -macro(CUDA_FIND_HELPER_FILE _name _extension) - set(_full_name "${_name}.${_extension}") - # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being - # processed. Using this variable, we can pull out the current path, and - # provide a way to get access to the other files we need local to here. - set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") - if(NOT EXISTS "${CUDA_${_name}}") - set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "${error_message}") - else() - if(NOT CUDA_FIND_QUIETLY) - message(STATUS "${error_message}") - endif() - endif() - endif() - # Set this variable as internal, so the user isn't bugged with it. - set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) -endmacro() - -##################################################################### -## CUDA_INCLUDE_NVCC_DEPENDENCIES -## - -# So we want to try and include the dependency file if it exists. If -# it doesn't exist then we need to create an empty one, so we can -# include it. - -# If it does exist, then we need to check to see if all the files it -# depends on exist. If they don't then we should clear the dependency -# file and regenerate it later. This covers the case where a header -# file has disappeared or moved. - -macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) - set(CUDA_NVCC_DEPEND) - set(CUDA_NVCC_DEPEND_REGENERATE FALSE) - - - # Include the dependency file. Create it first if it doesn't exist . The - # INCLUDE puts a dependency that will force CMake to rerun and bring in the - # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few - # hours figuring out why it didn't work. - if(NOT EXISTS ${dependency_file}) - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - # Always include this file to force CMake to run again next - # invocation and rebuild the dependencies. - #message("including dependency_file = ${dependency_file}") - include(${dependency_file}) - - # Now we need to verify the existence of all the included files - # here. If they aren't there we need to just blank this variable and - # make the file regenerate again. -# if(DEFINED CUDA_NVCC_DEPEND) -# message("CUDA_NVCC_DEPEND set") -# else() -# message("CUDA_NVCC_DEPEND NOT set") -# endif() - if(CUDA_NVCC_DEPEND) - #message("CUDA_NVCC_DEPEND found") - foreach(f ${CUDA_NVCC_DEPEND}) - # message("searching for ${f}") - if(NOT EXISTS ${f}) - #message("file ${f} not found") - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - endforeach() - else() - #message("CUDA_NVCC_DEPEND false") - # No dependencies, so regenerate the file. - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - - #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") - # No incoming dependencies, so we need to generate them. Make the - # output depend on the dependency file itself, which should cause the - # rule to re-run. - if(CUDA_NVCC_DEPEND_REGENERATE) - set(CUDA_NVCC_DEPEND ${dependency_file}) - #message("Generating an empty dependency_file: ${dependency_file}") - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - -endmacro() - -############################################################################### -############################################################################### -# Setup variables' defaults -############################################################################### -############################################################################### - -# Allow the user to specify if the device code is supposed to be 32 or 64 bit. -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) -else() - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) -endif() -option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) - -# Attach the build rule to the source file in VS. This option -option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) - -# Prints out extra information about the cuda file during compilation -option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) - -# Set whether we are using emulation or device mode. -option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) - -# Where to put the generated output. -set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") - -# Parse HOST_COMPILATION mode. -option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) - -# Extra user settable flags -cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") - -if(DEFINED ENV{CUDAHOSTCXX}) - set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") -elseif(CMAKE_GENERATOR MATCHES "Visual Studio") - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") - if(MSVC_VERSION LESS 1910) - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") - endif() - - set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") - -else() - if(APPLE - AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" - AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") - # Using cc which is symlink to clang may let NVCC think it is GCC and issue - # unhandled -dumpspecs option to clang. Also in case neither - # CMAKE_C_COMPILER is defined (project does not use C language) nor - # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let - # nvcc use its own default C compiler. - # Only care about this on APPLE with clang to avoid - # following symlinks to things like ccache - if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) - get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) - # if the real path does not end up being clang then - # go back to using CMAKE_C_COMPILER - if(NOT "${c_compiler_realpath}" MATCHES "/clang$") - set(c_compiler_realpath "${CMAKE_C_COMPILER}") - endif() - else() - set(c_compiler_realpath "") - endif() - set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") - elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") - # NVCC does not think it will work if it is passed clcache.exe or sccache.exe - # as the host compiler, which means that builds with CC=cl.exe won't work. - # Best to just feed it whatever the actual cl.exe is as the host compiler. - set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") - else() - set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" - CACHE FILEPATH "Host side compiler used by NVCC") - endif() -endif() - -# Propagate the host flags to the host compiler via -Xcompiler -option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) - -# Enable CUDA_SEPARABLE_COMPILATION -option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) - -# Specifies whether the commands used when compiling the .cu file will be printed out. -option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) - -mark_as_advanced( - CUDA_64_BIT_DEVICE_CODE - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE - CUDA_GENERATED_OUTPUT_DIR - CUDA_HOST_COMPILATION_CPP - CUDA_NVCC_FLAGS - CUDA_PROPAGATE_HOST_FLAGS - CUDA_BUILD_CUBIN - CUDA_BUILD_EMULATION - CUDA_VERBOSE_BUILD - CUDA_SEPARABLE_COMPILATION - ) - -# Single config generators like Makefiles or Ninja don't usually have -# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by -# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for -# single config generators (and should not be defined for multi-config -# generators). To ensure we get a complete superset of all possible -# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and -# all of the standard configurations, then weed out duplicates with -# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have -# each configuration-specific set of nvcc flags defined and marked as advanced. -set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) -list(REMOVE_DUPLICATES CUDA_configuration_types) - -############################################################################### -############################################################################### -# Locate CUDA, Set Build Type, etc. -############################################################################### -############################################################################### - -macro(cuda_unset_include_and_libraries) - unset(CUDA_TOOLKIT_INCLUDE CACHE) - unset(CUDA_CUDART_LIBRARY CACHE) - unset(CUDA_CUDA_LIBRARY CACHE) - # Make sure you run this before you unset CUDA_VERSION. - if(CUDA_VERSION VERSION_EQUAL "3.0") - # This only existed in the 3.0 version of the CUDA toolkit - unset(CUDA_CUDARTEMU_LIBRARY CACHE) - endif() - unset(CUDA_cudart_static_LIBRARY CACHE) - unset(CUDA_cudadevrt_LIBRARY CACHE) - unset(CUDA_cublas_LIBRARY CACHE) - unset(CUDA_cublas_device_LIBRARY CACHE) - unset(CUDA_cublasemu_LIBRARY CACHE) - unset(CUDA_cufft_LIBRARY CACHE) - unset(CUDA_cufftemu_LIBRARY CACHE) - unset(CUDA_cupti_LIBRARY CACHE) - unset(CUDA_curand_LIBRARY CACHE) - unset(CUDA_cusolver_LIBRARY CACHE) - unset(CUDA_cusparse_LIBRARY CACHE) - unset(CUDA_npp_LIBRARY CACHE) - unset(CUDA_nppc_LIBRARY CACHE) - unset(CUDA_nppi_LIBRARY CACHE) - unset(CUDA_npps_LIBRARY CACHE) - unset(CUDA_nvcuvenc_LIBRARY CACHE) - unset(CUDA_nvcuvid_LIBRARY CACHE) - unset(CUDA_nvToolsExt_LIBRARY CACHE) - unset(CUDA_OpenCL_LIBRARY CACHE) - unset(CUDA_GPU_DETECT_OUTPUT CACHE) -endmacro() - -# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, -# if they have then clear the cache variables, so that will be detected again. -if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") - unset(CUDA_TOOLKIT_TARGET_DIR CACHE) - unset(CUDA_NVCC_EXECUTABLE CACHE) - cuda_unset_include_and_libraries() - unset(CUDA_VERSION CACHE) -endif() - -if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") - cuda_unset_include_and_libraries() -endif() - -# -# End of unset() -# - -# -# Start looking for things -# - -# Search for the cuda distribution. -if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) - # Search in the CUDA_BIN_PATH first. - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS - ENV CUDA_TOOLKIT_ROOT - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - DOC "Toolkit location." - NO_DEFAULT_PATH - ) - - # Now search default paths - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS /opt/cuda/bin - PATH_SUFFIXES cuda/bin - DOC "Toolkit location." - ) - - if (CUDA_TOOLKIT_ROOT_DIR_NVCC) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) - string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - # We need to force this back into the cache. - set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) - set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - endif() - unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) - - if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") - elseif(NOT CUDA_FIND_QUIETLY) - message("CUDA_TOOLKIT_ROOT_DIR not found or specified") - endif() - endif () -endif () - -if(CMAKE_CROSSCOMPILING) - SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") - # Support for NVPACK - set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - # Support for arm cross compilation - set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - # Support for aarch64 cross compilation - if (ANDROID_ARCH_NAME STREQUAL "arm64") - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") - else() - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") - endif (ANDROID_ARCH_NAME STREQUAL "arm64") - endif() - - if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") - set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") - SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) - mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) - endif() - - # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers - set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") - macro( cuda_find_host_program ) - if (COMMAND find_host_program) - find_host_program( ${ARGN} ) - else() - find_program( ${ARGN} ) - endif() - endmacro() -else() - # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR - macro( cuda_find_host_program ) - find_program( ${ARGN} ) - endmacro() - SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) -endif() - - -# CUDA_NVCC_EXECUTABLE -if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) - set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") -else() - cuda_find_host_program(CUDA_NVCC_EXECUTABLE - NAMES nvcc - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - NO_DEFAULT_PATH - ) - # Search default search paths, after we search our own set of paths. - cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) -endif() -mark_as_advanced(CUDA_NVCC_EXECUTABLE) - -if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) - # Compute the version. - execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) - set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") - mark_as_advanced(CUDA_VERSION) -else() - # Need to set these based off of the cached value - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") -endif() - - -# Always set this convenience variable -set(CUDA_VERSION_STRING "${CUDA_VERSION}") - -# CUDA_TOOLKIT_INCLUDE -find_path(CUDA_TOOLKIT_INCLUDE - device_functions.h # Header included in toolkit - PATHS ${CUDA_TOOLKIT_TARGET_DIR} - ENV CUDA_PATH - ENV CUDA_INC_PATH - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -# Search default search paths, after we search our own set of paths. -find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) -mark_as_advanced(CUDA_TOOLKIT_INCLUDE) - -if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") - set(CUDA_HAS_FP16 TRUE) -else() - set(CUDA_HAS_FP16 FALSE) -endif() - -# Set the user list of include dir to nothing to initialize it. -set (CUDA_NVCC_INCLUDE_DIRS_USER "") -set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) - -macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # CUDA 3.2+ on Windows moved the library directories, so we need the new - # and old paths. - set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) - endif() - # CUDA 3.2+ on Windows moved the library directories, so we need to new - # (lib/Win32) and the old path (lib). - find_library(${_var} - NAMES ${_names} - PATHS "${CUDA_TOOLKIT_TARGET_DIR}" - ENV CUDA_PATH - ENV CUDA_LIB_PATH - PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" - DOC ${_doc} - NO_DEFAULT_PATH - ) - if (NOT CMAKE_CROSSCOMPILING) - # Search default search paths, after we search our own set of paths. - find_library(${_var} - NAMES ${_names} - PATHS "/usr/lib/nvidia-current" - DOC ${_doc} - ) - endif() -endmacro() - -macro(cuda_find_library_local_first _var _names _doc) - cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - -macro(find_library_local_first _var _names _doc ) - cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - - -# CUDA_LIBRARIES -cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") -if(CUDA_VERSION VERSION_EQUAL "3.0") - # The cudartemu library only existed for the 3.0 version of CUDA. - cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") - mark_as_advanced( - CUDA_CUDARTEMU_LIBRARY - ) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.5") - cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") - mark_as_advanced(CUDA_cudart_static_LIBRARY) -endif() - - -if(CUDA_cudart_static_LIBRARY) - # If static cudart available, use it by default, but provide a user-visible option to disable it. - option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) -else() - # If not available, silently disable the option. - set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) -else() - set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") - mark_as_advanced(CUDA_cudadevrt_LIBRARY) -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - if(UNIX) - # Check for the dependent libraries. - - # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} - # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and - # -Werror causes the try_compile to fail. We will just temporarily disable other flags - # when doing the find_package command here. - set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) - set(CMAKE_C_FLAGS "-fPIC") - find_package(Threads REQUIRED) - set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - - if(NOT APPLE) - #On Linux, you must link against librt when using the static cuda runtime. - find_library(CUDA_rt_LIBRARY rt) - if (NOT CUDA_rt_LIBRARY) - message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") - endif() - endif() - endif() -endif() - -# CUPTI library showed up in cuda toolkit 4.0 -if(NOT CUDA_VERSION VERSION_LESS "4.0") - cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") - mark_as_advanced(CUDA_cupti_LIBRARY) -endif() - -# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are -# using the CUDA runtime. For the dynamic version of the runtime, most of the -# dependencies are brough in, but for the static version there are additional libraries -# and linker commands needed. -# Initialize to empty -set(CUDA_LIBRARIES) - -# If we are using emulation mode and we found the cudartemu library then use -# that one instead of cudart. -if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) -elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) - if (TARGET Threads::Threads) - list(APPEND CUDA_LIBRARIES Threads::Threads) - endif() - list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) - if (CUDA_rt_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) - endif() - if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) - endif() -else() - list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) -endif() - -# 1.1 toolkit on linux doesn't appear to have a separate library on -# some platforms. -cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") - -mark_as_advanced( - CUDA_CUDA_LIBRARY - CUDA_CUDART_LIBRARY - ) - -####################### -# Look for some of the toolkit helper libraries -macro(FIND_CUDA_HELPER_LIBS _name) - cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") - mark_as_advanced(CUDA_${_name}_LIBRARY) -endmacro() - -####################### -# Disable emulation for v3.1 onward -if(CUDA_VERSION VERSION_GREATER "3.0") - if(CUDA_BUILD_EMULATION) - message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") - endif() -endif() - -# Search for additional CUDA toolkit libraries. -if(CUDA_VERSION VERSION_LESS "3.1") - # Emulation libraries aren't available in version 3.1 onward. - find_cuda_helper_libs(cufftemu) - find_cuda_helper_libs(cublasemu) -endif() -find_cuda_helper_libs(cufft) -find_cuda_helper_libs(cublas) -if(NOT CUDA_VERSION VERSION_LESS "3.2") - # cusparse showed up in version 3.2 - find_cuda_helper_libs(cusparse) - find_cuda_helper_libs(curand) - if (WIN32) - find_cuda_helper_libs(nvcuvenc) - find_cuda_helper_libs(nvcuvid) - endif() -endif() -if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") - # In CUDA 9.2 cublas_device was deprecated - find_cuda_helper_libs(cublas_device) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - find_cuda_helper_libs(nvToolsExt) - find_cuda_helper_libs(OpenCL) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "9.0") - # In CUDA 9.0 NPP was nppi was removed - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppial) - find_cuda_helper_libs(nppicc) - if(CUDA_VERSION VERSION_LESS "11.0") - find_cuda_helper_libs(nppicom) - endif() - find_cuda_helper_libs(nppidei) - find_cuda_helper_libs(nppif) - find_cuda_helper_libs(nppig) - find_cuda_helper_libs(nppim) - find_cuda_helper_libs(nppist) - find_cuda_helper_libs(nppisu) - find_cuda_helper_libs(nppitc) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(CUDA_VERSION VERSION_GREATER "5.0") - # In CUDA 5.5 NPP was split into 3 separate libraries. - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppi) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(NOT CUDA_VERSION VERSION_LESS "4.0") - find_cuda_helper_libs(npp) -endif() -if(NOT CUDA_VERSION VERSION_LESS "7.0") - # cusolver showed up in version 7.0 - find_cuda_helper_libs(cusolver) -endif() - -if (CUDA_BUILD_EMULATION) - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) -else() - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) -endif() - -######################## -# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with -# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory -find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h - HINTS - "$ENV{NVSDKCOMPUTE_ROOT}/C" - ENV NVSDKCUDA_ROOT - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" - PATHS - "/Developer/GPU\ Computing/C" - ) - -# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the -# environment variables. -set(CUDA_SDK_SEARCH_PATH - "${CUDA_SDK_ROOT_DIR}" - "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" - "/Developer/CUDA" - ) - -# Example of how to find an include file from the CUDA_SDK_ROOT_DIR - -# find_path(CUDA_CUT_INCLUDE_DIR -# cutil.h -# PATHS ${CUDA_SDK_SEARCH_PATH} -# PATH_SUFFIXES "common/inc" -# DOC "Location of cutil.h" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") - -# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) - - -# Example of how to find a library in the CUDA_SDK_ROOT_DIR - -# # cutil library is called cutil64 for 64 bit builds on windows. We don't want -# # to get these confused, so we are setting the name based on the word size of -# # the build. - -# if(CMAKE_SIZEOF_VOID_P EQUAL 8) -# set(cuda_cutil_name cutil64) -# else() -# set(cuda_cutil_name cutil32) -# endif() - -# find_library(CUDA_CUT_LIBRARY -# NAMES cutil ${cuda_cutil_name} -# PATHS ${CUDA_SDK_SEARCH_PATH} -# # The new version of the sdk shows up in common/lib, but the old one is in lib -# PATH_SUFFIXES "common/lib" "lib" -# DOC "Location of cutil library" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") -# mark_as_advanced(CUDA_CUT_LIBRARY) -# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) - - - -############################# -# Check for required components -set(CUDA_FOUND TRUE) - -set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) -set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) -set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) - -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) - -find_package_handle_standard_args(CUDA - REQUIRED_VARS - CUDA_TOOLKIT_ROOT_DIR - CUDA_NVCC_EXECUTABLE - CUDA_INCLUDE_DIRS - ${CUDA_CUDART_LIBRARY_VAR} - VERSION_VAR - CUDA_VERSION - ) - - - -############################################################################### -############################################################################### -# Macros -############################################################################### -############################################################################### - -############################################################################### -# Add include directories to pass to the nvcc command. -macro(CUDA_INCLUDE_DIRECTORIES) - foreach(dir ${ARGN}) - list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) - endforeach() -endmacro() - - -############################################################################## -cuda_find_helper_file(parse_cubin cmake) -cuda_find_helper_file(make2cmake cmake) -cuda_find_helper_file(run_nvcc cmake) -include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") - -############################################################################## -# Separate the OPTIONS out from the sources -# -macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) - set( ${_sources} ) - set( ${_cmake_options} ) - set( ${_options} ) - set( _found_options FALSE ) - foreach(arg ${ARGN}) - if("x${arg}" STREQUAL "xOPTIONS") - set( _found_options TRUE ) - elseif( - "x${arg}" STREQUAL "xWIN32" OR - "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR - "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR - "x${arg}" STREQUAL "xSTATIC" OR - "x${arg}" STREQUAL "xSHARED" OR - "x${arg}" STREQUAL "xMODULE" - ) - list(APPEND ${_cmake_options} ${arg}) - else() - if ( _found_options ) - list(APPEND ${_options} ${arg}) - else() - # Assume this is a file - list(APPEND ${_sources} ${arg}) - endif() - endif() - endforeach() -endmacro() - -############################################################################## -# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix -# -macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) - set( _found_config ) - foreach(arg ${ARGN}) - # Determine if we are dealing with a perconfiguration flag - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - if (arg STREQUAL "${config_upper}") - set( _found_config _${arg}) - # Set arg to nothing to keep it from being processed further - set( arg ) - endif() - endforeach() - - if ( arg ) - list(APPEND ${_option_prefix}${_found_config} "${arg}") - endif() - endforeach() -endmacro() - -############################################################################## -# Helper to add the include directory for CUDA only once -function(CUDA_ADD_CUDA_INCLUDE_ONCE) - get_directory_property(_include_directories INCLUDE_DIRECTORIES) - set(_add TRUE) - if(_include_directories) - foreach(dir ${_include_directories}) - if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") - set(_add FALSE) - endif() - endforeach() - endif() - if(_add) - include_directories(${CUDA_INCLUDE_DIRS}) - endif() -endfunction() - -function(CUDA_BUILD_SHARED_LIBRARY shared_flag) - set(cmake_args ${ARGN}) - # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then - # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. - list(FIND cmake_args SHARED _cuda_found_SHARED) - list(FIND cmake_args MODULE _cuda_found_MODULE) - list(FIND cmake_args STATIC _cuda_found_STATIC) - if( _cuda_found_SHARED GREATER -1 OR - _cuda_found_MODULE GREATER -1 OR - _cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs) - else() - if (BUILD_SHARED_LIBS) - set(_cuda_build_shared_libs SHARED) - else() - set(_cuda_build_shared_libs STATIC) - endif() - endif() - set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) -endfunction() - -############################################################################## -# Helper to avoid clashes of files with the same basename but different paths. -# This doesn't attempt to do exactly what CMake internals do, which is to only -# add this path when there is a conflict, since by the time a second collision -# in names is detected it's already too late to fix the first one. For -# consistency sake the relative path will be added to all files. -function(CUDA_COMPUTE_BUILD_PATH path build_path) - #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") - # Only deal with CMake style paths from here on out - file(TO_CMAKE_PATH "${path}" bpath) - if (IS_ABSOLUTE "${bpath}") - # Absolute paths are generally unnessary, especially if something like - # file(GLOB_RECURSE) is used to pick up the files. - - string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) - if (_binary_dir_pos EQUAL 0) - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") - else() - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") - endif() - endif() - - # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the - # CMake source. - - # Remove leading / - string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") - # Avoid absolute paths by removing ':' - string(REPLACE ":" "_" bpath "${bpath}") - # Avoid relative paths that go up the tree - string(REPLACE "../" "__/" bpath "${bpath}") - # Avoid spaces - string(REPLACE " " "_" bpath "${bpath}") - - # Strip off the filename. I wait until here to do it, since removin the - # basename can make a path that looked like path/../basename turn into - # path/.. (notice the trailing slash). - get_filename_component(bpath "${bpath}" PATH) - - set(${build_path} "${bpath}" PARENT_SCOPE) - #message("${build_path} = ${bpath}") -endfunction() - -############################################################################## -# This helper macro populates the following variables and setups up custom -# commands and targets to invoke the nvcc compiler to generate C or PTX source -# dependent upon the format parameter. The compiler is invoked once with -M -# to generate a dependency file and a second time with -cuda or -ptx to generate -# a .cpp or .ptx file. -# INPUT: -# cuda_target - Target name -# format - PTX, CUBIN, FATBIN or OBJ -# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. -# OPTIONS - Extra options to NVCC -# OUTPUT: -# generated_files - List of generated files -############################################################################## -############################################################################## - -macro(CUDA_WRAP_SRCS cuda_target format generated_files) - - # Put optional arguments in list. - set(_argn_list "${ARGN}") - # If one of the given optional arguments is "PHONY", make a note of it, then - # remove it from the list. - list(FIND _argn_list "PHONY" _phony_idx) - if("${_phony_idx}" GREATER "-1") - set(_target_is_phony true) - list(REMOVE_AT _argn_list ${_phony_idx}) - else() - set(_target_is_phony false) - endif() - - # If CMake doesn't support separable compilation, complain - if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") - message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") - endif() - - # Set up all the command line flags here, so that they can be overridden on a per target basis. - - set(nvcc_flags "") - - # Emulation if the card isn't present. - if (CUDA_BUILD_EMULATION) - # Emulation. - set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) - else() - # Device mode. No flags necessary. - endif() - - if(CUDA_HOST_COMPILATION_CPP) - set(CUDA_C_OR_CXX CXX) - else() - if(CUDA_VERSION VERSION_LESS "3.0") - set(nvcc_flags ${nvcc_flags} --host-compilation C) - else() - message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) - endif() - set(CUDA_C_OR_CXX C) - endif() - - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - - if(CUDA_64_BIT_DEVICE_CODE) - set(nvcc_flags ${nvcc_flags} -m64) - else() - set(nvcc_flags ${nvcc_flags} -m32) - endif() - - if(CUDA_TARGET_CPU_ARCH) - set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") - endif() - - # This needs to be passed in at this stage, because VS needs to fill out the - # various macros from within VS. Note that CCBIN is only used if - # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches - # _CUDA_MSVC_HOST_COMPILER - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) - else() - set(ccbin_flags) - endif() - - # Figure out which configure we will use and pass that in as an argument to - # the script. We need to defer the decision until compilation time, because - # for VS projects we won't know if we are making a debug or release build - # until build time. - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set( CUDA_build_configuration "$(ConfigurationName)" ) - else() - set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") - endif() - - # Initialize our list of includes with the user ones followed by the CUDA system ones. - set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") - if(_target_is_phony) - # If the passed in target name isn't a real target (i.e., this is from a call to one of the - # cuda_compile_* functions), need to query directory properties to get include directories - # and compile definitions. - get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) - get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) - - list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") - set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") - else() - # Append the include directories for this target via generator expression, which is - # expanded by the FILE(GENERATE) call below. This generator expression captures all - # include dirs set by the user, whether via directory properties or target properties - list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") - - # Do the same thing with compile definitions - set(CUDA_NVCC_COMPILE_DEFINITIONS "$") - endif() - - - # Reset these variables - set(CUDA_WRAP_OPTION_NVCC_FLAGS) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) - endforeach() - - CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) - CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) - - # Figure out if we are building a shared library. BUILD_SHARED_LIBS is - # respected in CUDA_ADD_LIBRARY. - set(_cuda_build_shared_libs FALSE) - # SHARED, MODULE - list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) - list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) - if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) - set(_cuda_build_shared_libs TRUE) - endif() - # STATIC - list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) - if(_cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs FALSE) - endif() - - # CUDA_HOST_FLAGS - if(_cuda_build_shared_libs) - # If we are setting up code for a shared library, then we need to add extra flags for - # compiling objects for shared libraries. - set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) - else() - set(CUDA_HOST_SHARED_FLAGS) - endif() - # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We - # always need to set the SHARED_FLAGS, though. - if(CUDA_PROPAGATE_HOST_FLAGS) - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") - else() - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") - endif() - - set(_cuda_nvcc_flags_config "# Build specific configuration flags") - # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS - # we convert the strings to lists (like we want). - - if(CUDA_PROPAGATE_HOST_FLAGS) - # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g - set(_cuda_fix_g3 FALSE) - - if(CMAKE_COMPILER_IS_GNUCC) - if (CUDA_VERSION VERSION_LESS "3.0" OR - CUDA_VERSION VERSION_EQUAL "4.1" OR - CUDA_VERSION VERSION_EQUAL "4.2" - ) - set(_cuda_fix_g3 TRUE) - endif() - endif() - if(_cuda_fix_g3) - string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - else() - set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - endif() - - string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") - endif() - - # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list - # like it is currently), we can remove the quotes around the - # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. - string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") - endforeach() - - # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and - # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses - # the C preprocessor). In order to get this to work correctly, we need to use nvcc's - # specific c++11 flag. - if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") - # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at - # the main flag instead of the configuration specific flags. - if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) - list(APPEND nvcc_flags --std c++11) - endif() - string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") - endif() - - if(_cuda_build_shared_libs) - list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") - endif() - - # Reset the output variable - set(_cuda_wrap_generated_files "") - - # Iterate over the macro arguments and create custom - # commands for all the .cu files. - foreach(file ${_argn_list}) - # Ignore any file marked as a HEADER_FILE_ONLY - get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - # Allow per source file overrides of the format. Also allows compiling non-.cu files. - get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) - if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) - - if(NOT _cuda_source_format) - set(_cuda_source_format ${format}) - endif() - # If file isn't a .cu file, we need to tell nvcc to treat it as such. - if(NOT ${file} MATCHES "\\.cu$") - set(cuda_language_flag -x=cu) - else() - set(cuda_language_flag) - endif() - - if( ${_cuda_source_format} MATCHES "OBJ") - set( cuda_compile_to_external_module OFF ) - else() - set( cuda_compile_to_external_module ON ) - if( ${_cuda_source_format} MATCHES "PTX" ) - set( cuda_compile_to_external_module_type "ptx" ) - elseif( ${_cuda_source_format} MATCHES "CUBIN") - set( cuda_compile_to_external_module_type "cubin" ) - elseif( ${_cuda_source_format} MATCHES "FATBIN") - set( cuda_compile_to_external_module_type "fatbin" ) - else() - message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") - endif() - endif() - - if(cuda_compile_to_external_module) - # Don't use any of the host compilation flags for PTX targets. - set(CUDA_HOST_FLAGS) - set(CUDA_NVCC_FLAGS_CONFIG) - else() - set(CUDA_HOST_FLAGS ${_cuda_host_flags}) - set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) - endif() - - # Determine output directory - cuda_compute_build_path("${file}" cuda_build_path) - set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") - if(CUDA_GENERATED_OUTPUT_DIR) - set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") - else() - if ( cuda_compile_to_external_module ) - set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") - else() - set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") - endif() - endif() - - # Add a custom target to generate a c or ptx file. ###################### - - get_filename_component( basename ${file} NAME ) - if( cuda_compile_to_external_module ) - set(generated_file_path "${cuda_compile_output_dir}") - set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") - set(format_flag "-${cuda_compile_to_external_module_type}") - file(MAKE_DIRECTORY "${cuda_compile_output_dir}") - else() - set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") - set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") - if(CUDA_SEPARABLE_COMPILATION) - set(format_flag "-dc") - else() - set(format_flag "-c") - endif() - endif() - - # Set all of our file names. Make sure that whatever filenames that have - # generated_file_path in them get passed in through as a command line - # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time - # instead of configure time. - set(generated_file "${generated_file_path}/${generated_file_basename}") - set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") - set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") - set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") - set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") - set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") - - # Setup properties for obj files: - if( NOT cuda_compile_to_external_module ) - set_source_files_properties("${generated_file}" - PROPERTIES - EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. - ) - endif() - - # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. - get_filename_component(file_path "${file}" PATH) - if(IS_ABSOLUTE "${file_path}") - set(source_file "${file}") - else() - set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - endif() - - if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) - list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") - endif() - - # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### - cuda_include_nvcc_dependencies(${cmake_dependency_file}) - - # Convenience string for output ######################################### - if(CUDA_BUILD_EMULATION) - set(cuda_build_type "Emulation") - else() - set(cuda_build_type "Device") - endif() - - # Build the NVCC made dependency file ################################### - set(build_cubin OFF) - if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) - if ( NOT cuda_compile_to_external_module ) - set ( build_cubin ON ) - endif() - endif() - - # Configure the build script - configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) - file(GENERATE - OUTPUT "${custom_target_script}" - INPUT "${custom_target_script_pregen}" - ) - - # So if a user specifies the same cuda file as input more than once, you - # can have bad things happen with dependencies. Here we check an option - # to see if this is the behavior they want. - if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) - set(main_dep MAIN_DEPENDENCY ${source_file}) - else() - set(main_dep DEPENDS ${source_file}) - endif() - - if(CUDA_VERBOSE_BUILD) - set(verbose_output ON) - elseif(CMAKE_GENERATOR MATCHES "Makefiles") - set(verbose_output "$(VERBOSE)") - else() - set(verbose_output OFF) - endif() - - # Create up the comment string - file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") - if(cuda_compile_to_external_module) - set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") - else() - set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") - endif() - - set(_verbatim VERBATIM) - if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - # Build the generated file and dependency file ########################## - add_custom_command( - OUTPUT ${generated_file} - # These output files depend on the source_file and the contents of cmake_dependency_file - ${main_dep} - DEPENDS ${CUDA_NVCC_DEPEND} - DEPENDS ${custom_target_script} - # Make sure the output directory exists before trying to write to it. - COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" - COMMAND ${CMAKE_COMMAND} ARGS - -D verbose:BOOL=${verbose_output} - ${ccbin_flags} - -D build_configuration:STRING=${CUDA_build_configuration} - -D "generated_file:STRING=${generated_file}" - -D "generated_cubin_file:STRING=${generated_cubin_file}" - -P "${custom_target_script}" - WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" - COMMENT "${cuda_build_comment_string}" - ${_verbatim} - ) - - # Make sure the build system knows the file is generated. - set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - - list(APPEND _cuda_wrap_generated_files ${generated_file}) - - # Add the other files that we want cmake to clean on a cleanup ########## - list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") - list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) - set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") - - endif() - endforeach() - - # Set the return parameter - set(${generated_files} ${_cuda_wrap_generated_files}) -endmacro() - -function(_cuda_get_important_host_flags important_flags flag_string) - if(CMAKE_GENERATOR MATCHES "Visual Studio") - string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - else() - string(REGEX MATCHALL "-fPIC" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - endif() - set(${important_flags} ${${important_flags}} PARENT_SCOPE) -endfunction() - -############################################################################### -############################################################################### -# Separable Compilation Link -############################################################################### -############################################################################### - -# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS -function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) - if (object_files) - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") - else() - set(output_file) - endif() - - set(${output_file_var} "${output_file}" PARENT_SCOPE) -endfunction() - -# Setup the build rule for the separable compilation intermediate link file. -function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) - if (object_files) - - set_source_files_properties("${output_file}" - PROPERTIES - EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only - # be linked. - GENERATED TRUE # This file is generated during the build - ) - - # For now we are ignoring all the configuration specific flags. - set(nvcc_flags) - CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) - if(CUDA_64_BIT_DEVICE_CODE) - list(APPEND nvcc_flags -m64) - else() - list(APPEND nvcc_flags -m32) - endif() - # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. - list( FIND nvcc_flags "-ccbin" ccbin_found0 ) - list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) - if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) - # Match VERBATIM check below. - if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") - list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") - else() - list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") - endif() - endif() - - # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* - set(config_specific_flags) - set(flags) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # Add config specific flags - foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) - list(APPEND config_specific_flags $<$:${f}>) - endforeach() - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - foreach(f ${important_host_flags}) - list(APPEND flags $<$:-Xcompiler> $<$:${f}>) - endforeach() - endforeach() - # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") - foreach(f ${important_host_flags}) - list(APPEND flags -Xcompiler ${f}) - endforeach() - - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags - set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) - - file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") - - # Some generators don't handle the multiple levels of custom command - # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so - # we work around that issue by compiling the intermediate link object as a - # pre-link custom command in that situation. - set(do_obj_build_rule TRUE) - if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) - # VS 2010 and 2012 have this problem. - set(do_obj_build_rule FALSE) - endif() - - set(_verbatim VERBATIM) - if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - if (do_obj_build_rule) - add_custom_command( - OUTPUT ${output_file} - DEPENDS ${object_files} - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} - ${flags} - COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - else() - get_filename_component(output_file_dir "${output_file}" DIRECTORY) - add_custom_command( - TARGET ${cuda_target} - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - endif() - endif() -endfunction() - -############################################################################### -############################################################################### -# ADD LIBRARY -############################################################################### -############################################################################### -macro(CUDA_ADD_LIBRARY cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} - ${_cmake_options} ${_cuda_shared_flag} - OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_library(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - if(CUDA_SEPARABLE_COMPILATION) - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_cudadevrt_LIBRARY} - ) - endif() - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# ADD EXECUTABLE -############################################################################### -############################################################################### -macro(CUDA_ADD_EXECUTABLE cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_executable(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# (Internal) helper for manually added cuda source files with specific targets -############################################################################### -############################################################################### -macro(cuda_compile_base cuda_target format generated_files) - # Update a counter in this directory, to keep phony target names unique. - set(_cuda_target "${cuda_target}") - get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) - if(_counter) - math(EXPR _counter "${_counter} + 1") - else() - set(_counter 1) - endif() - string(APPEND _cuda_target "_${_counter}") - set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} - ${_cmake_options} OPTIONS ${_options} PHONY) - - set( ${generated_files} ${_generated_files}) - -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE -############################################################################### -############################################################################### -macro(CUDA_COMPILE generated_files) - cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE PTX -############################################################################### -############################################################################### -macro(CUDA_COMPILE_PTX generated_files) - cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE FATBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_FATBIN generated_files) - cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE CUBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_CUBIN generated_files) - cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) -endmacro() - - -############################################################################### -############################################################################### -# CUDA ADD CUFFT TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUFFT_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA ADD CUBLAS TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUBLAS_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA BUILD CLEAN TARGET -############################################################################### -############################################################################### -macro(CUDA_BUILD_CLEAN_TARGET) - # Call this after you add all your CUDA targets, and you will get a - # convenience target. You should also make clean after running this target - # to get the build system to generate all the code again. - - set(cuda_clean_target_name clean_cuda_depends) - if (CMAKE_GENERATOR MATCHES "Visual Studio") - string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) - endif() - add_custom_target(${cuda_clean_target_name} - COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) - - # Clear out the variable, so the next time we configure it will be empty. - # This is useful so that the files won't persist in the list after targets - # have been removed. - set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") -endmacro() diff --git a/ports/opencv3/portfile.cmake b/ports/opencv3/portfile.cmake index f190376c28e96e..6c7320c42c8cca 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -6,13 +6,15 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4") message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4") endif() -set(OPENCV_VERSION "3.4.10") +include(vcpkg_common_functions) + +set(OPENCV_VERSION "3.4.7") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 7ccdc7fef26436b2f643cce2a13c9f9f77e56d3fd0340117419df3c1665ca12416277b626cce3c056fdc14899805bbe9ece391f11d28c6adea716d47ce8894bc + SHA512 ba1336ad4e5208748aa09c99770392cc71ef72688560d0b03287ddafd36093ef30cbdf6422f87f8f878663ab8085cc0ff8a8c65fd1ff0ec6800855ea01309beb HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -21,11 +23,6 @@ vcpkg_from_github( 0009-fix-uwp.patch ) -file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") -file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released - string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -51,17 +48,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "world" BUILD_opencv_world ) -# Cannot use vcpkg_check_features() for "dnn", "ipp", ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. -set(BUILD_opencv_dnn OFF) -if("dnn" IN_LIST FEATURES) - if(NOT VCPKG_TARGET_IS_ANDROID) - set(BUILD_opencv_dnn ON) - else() - message(WARNING "The dnn module cannot be enabled on Android") - endif() -endif() - set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) @@ -106,13 +94,11 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 70b4ecfaf9881390ad826a2aba24cced8514a680965ec7151df9926082fff53364bbe6be36458bb9ff466fda6f6f6ca2174eeac94c10a6bada989f07ed1c4da1 + SHA512 922620f3e8754fc15dedf8993bdc1f00c06b623cbeeb72afb984ddaad6e0e04f46561a0ee4d20f5e260616c1f32c6dc0dd7248355d417873ae72bd03cb5d57fd HEAD_REF master - PATCHES - 0004-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") - + # Used for opencv's face module vcpkg_download_distfile(OCV_DOWNLOAD URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat" FILENAME "opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat" @@ -158,9 +144,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" - SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" + SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -169,15 +155,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" - SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" + SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" - SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" + SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -186,15 +172,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" - FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" - SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" + FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" + SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" - FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" - SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" + FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" + SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -252,20 +238,14 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= - -DOPENCV_BIN_INSTALL_PATH=bin - -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv - -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d - -DOPENCV_DLLVERSION= - -DOPENCV_DEBUG_POSTFIX=d - -DOPENCV_GENERATE_SETUPVARS=OFF + -DOpenCV_DISABLE_ARCH_PATH=ON # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -277,9 +257,6 @@ vcpkg_configure_cmake( -DBUILD_TIFF=OFF -DBUILD_WEBP=OFF -DBUILD_ZLIB=OFF - -DBUILD_TBB=OFF - -DBUILD_IPP_IW=OFF - -DBUILD_ITT=OFF ###### Disable build 3rd party components -DBUILD_PROTOBUF=OFF ###### OpenCV Build components @@ -287,21 +264,14 @@ vcpkg_configure_cmake( -DBUILD_opencv_bgsegm=${BUILD_opencv_bgsegm} -DBUILD_opencv_line_descriptor=${BUILD_opencv_line_descriptor} -DBUILD_opencv_saliency=${BUILD_opencv_saliency} - -DBUILD_ANDROID_PROJECT=OFF - -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_PACKAGE=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_WITH_DEBUG_INFO=ON -DBUILD_WITH_STATIC_CRT=${BUILD_WITH_STATIC_CRT} - -DBUILD_JAVA=OFF - -DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR} ###### PROTOBUF -DPROTOBUF_UPDATE_FILES=ON -DUPDATE_PROTO_FILES=ON - ###### PYLINT/FLAKE8 - -DENABLE_PYLINT=OFF - -DENABLE_FLAKE8=OFF # CMAKE -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON @@ -314,23 +284,18 @@ vcpkg_configure_cmake( ###### customized properties ## Options from vcpkg_check_features() ${FEATURE_OPTIONS} - -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} - -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MATLAB=OFF -DWITH_MSMF=${WITH_MSMF} - -DWITH_OPENMP=OFF -DWITH_PROTOBUF=ON -DWITH_OPENCLAMDBLAS=OFF -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} - -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} - -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} ###### Additional build flags @@ -361,8 +326,6 @@ if(Protobuf_FOUND) ) endif() endif() -find_package(CUDA QUIET) -find_package(Threads QUIET) find_package(TIFF QUIET) find_package(HDF5 QUIET) find_package(Freetype QUIET) @@ -373,19 +336,8 @@ find_package(ade QUIET) find_package(VTK QUIET) find_package(OpenMP QUIET) find_package(Tesseract QUIET) -find_package(OpenEXR QUIET) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") - if(BUILD_opencv_ovis) - string(REPLACE "OgreGLSupportStatic" - "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") - endif() - file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -393,12 +345,8 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv3.cmd) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv3.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) - -if(VCPKG_TARGET_IS_ANDROID) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) -endif() - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencv4/0001-disable-downloading.patch b/ports/opencv4/0001-disable-downloading.patch index 41131c6a811b21..28b00251fe4f23 100644 --- a/ports/opencv4/0001-disable-downloading.patch +++ b/ports/opencv4/0001-disable-downloading.patch @@ -1,14 +1,11 @@ -diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake -index 63cf6d3..01e84a5 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -157,6 +157,9 @@ function(ocv_download) +@@ -151,6 +151,8 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") -+ - foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) - ocv_download_log("#try ${try}") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" + INACTIVITY_TIMEOUT 60 + TIMEOUT 600 diff --git a/ports/opencv4/0002-install-options.patch b/ports/opencv4/0002-install-options.patch index 9707a6a323695c..10aa08c24449da 100644 --- a/ports/opencv4/0002-install-options.patch +++ b/ports/opencv4/0002-install-options.patch @@ -1,8 +1,17 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4c0b388..16c0ede 100644 +index 8631bbc..e801558 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -594,7 +594,7 @@ endif() +@@ -647,7 +647,7 @@ endif() + + if(WIN32) + # Postfix of DLLs: +- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") ++ set(OPENCV_DLLVERSION "") + set(OPENCV_DEBUG_POSTFIX d) + else() + # Postfix of so's: +@@ -698,7 +698,7 @@ endif() ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) # --- Python Support --- @@ -12,10 +21,10 @@ index 4c0b388..16c0ede 100644 endif() diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index 87b2161..5192875 100644 +index e3ae62f..d866162 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake -@@ -263,7 +263,6 @@ if(MSVC) +@@ -256,7 +256,6 @@ if(MSVC) #endif() if(BUILD_WITH_DEBUG_INFO) @@ -24,32 +33,27 @@ index 87b2161..5192875 100644 set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") endif() diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index 6991289..3a691c5 100644 +index cef9d0b..b6ddb81 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake -@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) +@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) endif() endfunction() -if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(TRUE) ++if(NOT ANDROID) ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") endif() --if(ANDROID) -+if(FALSE) - ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") - install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) - endif() @@ -121,7 +121,7 @@ endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- -if(WIN32) +if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) - ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" - "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) + if(BUILD_SHARED_LIBS) + set(_lib_suffix "lib") diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 1f0d720..0bb1ff7 100644 --- a/data/CMakeLists.txt diff --git a/ports/opencv4/0003-force-package-requirements.patch b/ports/opencv4/0003-force-package-requirements.patch index b25668b38325ee..b6051f8498b66b 100644 --- a/ports/opencv4/0003-force-package-requirements.patch +++ b/ports/opencv4/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index 0beaf19..3ba1ebd 100644 +index 227cfb2..7a97a19 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -38,7 +38,7 @@ index 0beaf19..3ba1ebd 100644 if(WEBP_FOUND) set(HAVE_WEBP 1) endif() -@@ -173,7 +173,7 @@ if(WITH_JASPER AND NOT HAVE_OPENJPEG) +@@ -158,7 +158,7 @@ if(WITH_JASPER) if(BUILD_JASPER) ocv_clear_vars(JASPER_FOUND) else() @@ -47,7 +47,7 @@ index 0beaf19..3ba1ebd 100644 endif() if(NOT JASPER_FOUND) -@@ -197,7 +197,7 @@ if(WITH_PNG) +@@ -182,7 +182,7 @@ if(WITH_PNG) if(BUILD_PNG) ocv_clear_vars(PNG_FOUND) else() @@ -56,7 +56,7 @@ index 0beaf19..3ba1ebd 100644 if(PNG_FOUND) include(CheckIncludeFile) check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H) -@@ -228,7 +228,7 @@ endif() +@@ -213,7 +213,7 @@ endif() if(WITH_OPENEXR) ocv_clear_vars(HAVE_OPENEXR) if(NOT BUILD_OPENEXR) @@ -65,7 +65,7 @@ index 0beaf19..3ba1ebd 100644 endif() if(OPENEXR_FOUND) -@@ -246,7 +246,7 @@ endif() +@@ -231,7 +231,7 @@ endif() # --- GDAL (optional) --- if(WITH_GDAL) @@ -74,7 +74,7 @@ index 0beaf19..3ba1ebd 100644 if(NOT GDAL_FOUND) set(HAVE_GDAL NO) -@@ -258,7 +258,7 @@ if(WITH_GDAL) +@@ -243,7 +243,7 @@ if(WITH_GDAL) endif() if (WITH_GDCM) @@ -83,11 +83,18 @@ index 0beaf19..3ba1ebd 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) +@@ -273,4 +273,4 @@ if(WITH_IMGCODEC_PFM) + set(HAVE_IMGCODEC_PFM ON) + elseif(DEFINED WITH_IMGCODEC_PFM) + set(HAVE_IMGCODEC_PFM OFF) +-endif() +\ No newline at end of file ++endif() diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake -index b9b1a95..596c152 100644 +index a658bf6..5c9411a 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake -@@ -51,14 +51,9 @@ endif(WITH_CUDA) +@@ -41,14 +41,9 @@ endif(WITH_CUDA) # --- Eigen --- if(WITH_EIGEN AND NOT HAVE_EIGEN) @@ -103,7 +110,7 @@ index b9b1a95..596c152 100644 if(DEFINED EIGEN3_INCLUDE_DIRS) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) set(HAVE_EIGEN 1) -@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -56,7 +51,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) set(HAVE_EIGEN 1) endif() @@ -111,7 +118,7 @@ index b9b1a95..596c152 100644 if(HAVE_EIGEN) if(DEFINED EIGEN3_WORLD_VERSION) # CMake module set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) -@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -67,6 +61,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) endif() diff --git a/ports/opencv4/0004-fix-policy-CMP0057.patch b/ports/opencv4/0004-fix-policy-CMP0057.patch index 7f0f0c0271ba01..ed25d501dfe7c2 100644 --- a/ports/opencv4/0004-fix-policy-CMP0057.patch +++ b/ports/opencv4/0004-fix-policy-CMP0057.patch @@ -1,5 +1,5 @@ diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt -index c1c6754..360aa6b 100644 +index 1608655..a394f04 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -1,3 +1,4 @@ diff --git a/ports/opencv4/0005-add-missing-stdexcept-include.patch b/ports/opencv4/0005-add-missing-stdexcept-include.patch deleted file mode 100644 index 4f0df7d06615e5..00000000000000 --- a/ports/opencv4/0005-add-missing-stdexcept-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp -index fef3fea..68d1a80 100644 ---- a/modules/cvv/src/util/observer_ptr.hpp -+++ b/modules/cvv/src/util/observer_ptr.hpp -@@ -11,6 +11,7 @@ - #include //size_t - #include // [u]intXX_t - #include // since some people like to forget that one -+#include - - namespace cvv - { diff --git a/ports/opencv4/0009-fix-uwp.patch b/ports/opencv4/0009-fix-uwp.patch index 1c40cf1e17d4aa..5c54256a598c5f 100644 --- a/ports/opencv4/0009-fix-uwp.patch +++ b/ports/opencv4/0009-fix-uwp.patch @@ -1,8 +1,17 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 9053957..d2b6412 100644 +index 799592b..3f44173 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -1196,7 +1196,7 @@ function(ocv_add_perf_tests) +@@ -852,7 +852,7 @@ macro(ocv_create_module) + set(the_module_target ${the_module}) + endif() + +- if(WINRT) ++ if(WINRT AND BUILD_TESTS) + # removing APPCONTAINER from modules to run from console + # in case of usual starting of WinRT test apps output is missing + # so starting of console version w/o APPCONTAINER is required to get test results +@@ -1175,7 +1175,7 @@ function(ocv_add_perf_tests) set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") endif() @@ -11,3 +20,38 @@ index 9053957..d2b6412 100644 # removing APPCONTAINER from tests to run from console # look for detailed description inside of ocv_create_module macro above add_custom_command(TARGET "opencv_perf_${name}" +diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp +index aafbfdf..10543ae 100644 +--- a/modules/core/src/utils/datafile.cpp ++++ b/modules/core/src/utils/datafile.cpp +@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) + CV_UNUSED(addr); + #ifdef _WIN32 + HMODULE m = 0; +-#if _WIN32_WINNT >= 0x0501 ++#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) + ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast(addr), + &m); +@@ -155,7 +155,7 @@ bool getBinLocation(std::wstring& dst) + { + void* addr = (void*)getModuleLocation; // using code address, doesn't work with static linkage! + HMODULE m = 0; +-#if _WIN32_WINNT >= 0x0501 ++#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) + ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast(addr), + &m); +diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp +index 236e227..eccf97e 100644 +--- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp ++++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp +@@ -94,7 +94,7 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() + + void Media::CaptureFrameGrabber::ShowCameraSettings() + { +-#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP ++#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PC_APP) + if (_state == State::Started) + { + CameraOptionsUI::Show(_capture.Get()); diff --git a/ports/opencv4/CONTROL b/ports/opencv4/CONTROL index fa6388e66f49d8..60c1e0aa7d2df8 100644 --- a/ports/opencv4/CONTROL +++ b/ports/opencv4/CONTROL @@ -1,5 +1,5 @@ Source: opencv4 -Version: 4.3.0 +Version: 4.1.1-6 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -13,11 +13,11 @@ Build-Depends: ade Description: graph api Feature: contrib -Build-Depends: hdf5 (!uwp), tesseract (!uwp) +Build-Depends: hdf5 (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv4[contrib], cuda, cudnn +Build-Depends: opencv4[contrib], cuda Description: CUDA support for opencv Feature: dnn @@ -35,10 +35,6 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv -Feature: halide -Build-Depends: halide, opencv4[core], opencv4[dnn] -Description: Halide support for opencv - Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -93,5 +89,13 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv +Feature: halide +Build-Depends: halide, opencv4[core], opencv4[dnn] +Description: Halide support for opencv + Feature: world Description: Compile to a single package support for opencv + +Feature: gtk +Build-Depends: gtk +Description: gtk support for opencv diff --git a/ports/opencv4/FindCUDA.cmake b/ports/opencv4/FindCUDA.cmake deleted file mode 100644 index 56e15e89d2ed07..00000000000000 --- a/ports/opencv4/FindCUDA.cmake +++ /dev/null @@ -1,2026 +0,0 @@ -#[=======================================================================[.rst: -FindCUDA --------- - -.. deprecated:: 3.10 - - Superseded by first-class support for the CUDA language in CMake. - Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. - -Replacement -^^^^^^^^^^^ - -It is no longer necessary to use this module or call ``find_package(CUDA)`` -for compiling CUDA code. Instead, list ``CUDA`` among the languages named -in the top-level call to the :command:`project` command, or call the -:command:`enable_language` command with ``CUDA``. -Then one can add CUDA (``.cu``) sources to programs directly -in calls to :command:`add_library` and :command:`add_executable`. - -To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` -module has superseded this module. It works whether or not the ``CUDA`` -language is enabled. - -Documentation of Deprecated Usage -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Tools for building CUDA C files: libraries and build dependencies. - -This script locates the NVIDIA CUDA C tools. It should work on Linux, -Windows, and macOS and should be reasonably up to date with CUDA C -releases. - -This script makes use of the standard :command:`find_package` arguments of -````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an -acceptable version of CUDA was found. - -The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if -the prefix cannot be determined by the location of nvcc in the system -path and ``REQUIRED`` is specified to :command:`find_package`. To use -a different installed version of the toolkit set the environment variable -``CUDA_BIN_PATH`` before running cmake (e.g. -``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default -``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If -you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that -depend on the path will be relocated. - -It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain -platforms, or to use a CUDA runtime not installed in the default -location. In newer versions of the toolkit the CUDA library is -included with the graphics driver -- be sure that the driver version -matches what is needed by the CUDA runtime version. - -The following variables affect the behavior of the macros in the -script (in alphabetical order). Note that any of these flags can be -changed multiple times in the same directory before calling -``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, -``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` -or ``CUDA_WRAP_SRCS``:: - - CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) - -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. - Note that making this different from the host code when generating object - or C files from CUDA code just won't work, because size_t gets defined by - nvcc in the generated source. If you compile to PTX and then load the - file yourself, you can mix bit sizes between device and host. - - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) - -- Set to ON if you want the custom build rule to be attached to the source - file in Visual Studio. Turn OFF if you add the same cuda file to multiple - targets. - - This allows the user to build the target from the CUDA file; however, bad - things can happen if the CUDA source file is added to multiple targets. - When performing parallel builds it is possible for the custom build - command to be run more than once and in parallel causing cryptic build - errors. VS runs the rules for every source file in the target, and a - source can have only one rule no matter how many projects it is added to. - When the rule is run from multiple targets race conditions can occur on - the generated file. Eventually everything will get built, but if the user - is unaware of this behavior, there may be confusion. It would be nice if - this script could detect the reuse of source files across multiple targets - and turn the option off for the user, but no good solution could be found. - - CUDA_BUILD_CUBIN (Default OFF) - -- Set to ON to enable and extra compilation pass with the -cubin option in - Device mode. The output is parsed and register, shared memory usage is - printed during build. - - CUDA_BUILD_EMULATION (Default OFF for device mode) - -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files - when CUDA_BUILD_EMULATION is TRUE. - - CUDA_LINK_LIBRARIES_KEYWORD (Default "") - -- The keyword to use for internal - target_link_libraries calls. The default is to use no keyword which - uses the old "plain" form of target_link_libraries. Note that is matters - because whatever is used inside the FindCUDA module must also be used - outside - the two forms of target_link_libraries cannot be mixed. - - CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) - -- Set to the path you wish to have the generated files placed. If it is - blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. - Intermediate files will always be placed in - CMAKE_CURRENT_BINARY_DIR/CMakeFiles. - - CUDA_HOST_COMPILATION_CPP (Default ON) - -- Set to OFF for C compilation of host code. - - CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) - -- Set the host compiler to be used by nvcc. Ignored if -ccbin or - --compiler-bindir is already present in the CUDA_NVCC_FLAGS or - CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, - the host compiler is constructed with one or more visual studio macros - such as $(VCInstallDir), that expands out to the path when - the command is run from within VS. - If the CUDAHOSTCXX environment variable is set it will - be used as the default. - - CUDA_NVCC_FLAGS - CUDA_NVCC_FLAGS_ - -- Additional NVCC command line arguments. NOTE: multiple arguments must be - semi-colon delimited (e.g. --compiler-options;-Wall) - - CUDA_PROPAGATE_HOST_FLAGS (Default ON) - -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration - dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the - host compiler through nvcc's -Xcompiler flag. This helps make the - generated host code match the rest of the system better. Sometimes - certain flags give nvcc problems, and this will help you turn the flag - propagation off. This does not affect the flags supplied directly to nvcc - via CUDA_NVCC_FLAGS or through the OPTION flags specified through - CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for - shared library compilation are not affected by this flag. - - CUDA_SEPARABLE_COMPILATION (Default OFF) - -- If set this will enable separable compilation for all CUDA runtime object - files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY - (e.g. calling CUDA_WRAP_SRCS directly), - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. - - CUDA_SOURCE_PROPERTY_FORMAT - -- If this source file property is set, it can override the format specified - to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file - is not a .cu file, setting this file will cause it to be treated as a .cu - file. See documentation for set_source_files_properties on how to set - this property. - - CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) - -- When enabled the static version of the CUDA runtime library will be used - in CUDA_LIBRARIES. If the version of CUDA configured doesn't support - this option, then it will be silently disabled. - - CUDA_VERBOSE_BUILD (Default OFF) - -- Set to ON to see all the commands used when building the CUDA file. When - using a Makefile generator the value defaults to VERBOSE (run make - VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will - always print the output. - -The script creates the following macros (in alphabetical order):: - - CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) - -- Adds the cufft library to the target (can be any target). Handles whether - you are in emulation mode or not. - - CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) - -- Adds the cublas library to the target (can be any target). Handles - whether you are in emulation mode or not. - - CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... - [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Creates an executable "cuda_target" which is made up of the files - specified. All of the non CUDA C files are compiled using the standard - build rules specified by CMAKE and the cuda files are compiled to object - files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is - added automatically to include_directories(). Some standard CMake target - calls can be used on the target after calling this macro - (e.g. set_target_properties and target_link_libraries), but setting - properties that adjust compilation flags will not affect code compiled by - nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. - - CUDA_ADD_LIBRARY( cuda_target file0 file1 ... - [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) - -- Same as CUDA_ADD_EXECUTABLE except that a library is created. - - CUDA_BUILD_CLEAN_TARGET() - -- Creates a convenience target that deletes all the dependency files - generated. You should make clean after running this target to ensure the - dependency files get regenerated. - - CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] - [OPTIONS ...] ) - -- Returns a list of generated files from the input source files to be used - with ADD_LIBRARY or ADD_EXECUTABLE. - - CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of PTX files generated from the input source files. - - CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of FATBIN files generated from the input source files. - - CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) - -- Returns a list of CUBIN files generated from the input source files. - - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var - cuda_target - object_files ) - -- Compute the name of the intermediate link file used for separable - compilation. This file name is typically passed into - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced - based on cuda_target the list of objects files that need separable - compilation as specified by object_files. If the object_files list is - empty, then output_file_var will be empty. This function is called - automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that - this is a function and not a macro. - - CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) - -- Sets the directories that should be passed to nvcc - (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu - files. - - - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target - nvcc_flags object_files) - -- Generates the link object required by separable compilation from the given - object files. This is called automatically for CUDA_ADD_EXECUTABLE and - CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS - directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the - nvcc_flags passed in are the same as the flags passed in via the OPTIONS - argument. The only nvcc flag added automatically is the bitness flag as - specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function - instead of a macro. - - CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) - -- Selects GPU arch flags for nvcc based on target_CUDA_architectures - target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) - - "Auto" detects local machine GPU compute arch at runtime. - - "Common" and "All" cover common and entire subsets of architectures - ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX - NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal - NUM: Any number. Only those pairs are currently accepted by NVCC though: - 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 - Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} - Additionally, sets ${out_variable}_readable to the resulting numeric list - Example: - CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) - LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) - - More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA - Note that this is a function instead of a macro. - - CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... - [STATIC | SHARED | MODULE] [OPTIONS ...] ) - -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, - CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this - function under the hood. - - Given the list of files (file0 file1 ... fileN) this macro generates - custom commands that generate either PTX or linkable objects (use "PTX" or - "OBJ" for the format argument to switch). Files that don't end with .cu - or have the HEADER_FILE_ONLY property are ignored. - - The arguments passed in after OPTIONS are extra command line options to - give to nvcc. You can also specify per configuration options by - specifying the name of the configuration followed by the options. General - options must precede configuration specific options. Not all - configurations need to be specified, only the ones provided will be used. - - OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" - DEBUG -g - RELEASE --use_fast_math - RELWITHDEBINFO --use_fast_math;-g - MINSIZEREL --use_fast_math - - For certain configurations (namely VS generating object files with - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will - be produced for the given cuda file. This is because when you add the - cuda file to Visual Studio it knows that this file produces an object file - and will link in the resulting object file automatically. - - This script will also generate a separate cmake script that is used at - build time to invoke nvcc. This is for several reasons. - - 1. nvcc can return negative numbers as return values which confuses - Visual Studio into thinking that the command succeeded. The script now - checks the error codes and produces errors when there was a problem. - - 2. nvcc has been known to not delete incomplete results when it - encounters problems. This confuses build systems into thinking the - target was generated when in fact an unusable file exists. The script - now deletes the output files if there was an error. - - 3. By putting all the options that affect the build into a file and then - make the build rule dependent on the file, the output files will be - regenerated when the options change. - - This script also looks at optional arguments STATIC, SHARED, or MODULE to - determine when to target the object compilation for a shared library. - BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in - CUDA_ADD_LIBRARY. On some systems special flags are added for building - objects intended for shared libraries. A preprocessor macro, - _EXPORTS is defined when a shared library compilation is - detected. - - Flags passed into add_definitions with -D or /D are passed along to nvcc. - - - -The script defines the following variables:: - - CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. - CUDA_VERSION_MINOR -- The minor version. - CUDA_VERSION - CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR - CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. - - CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). - CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the - SDK. This script will not directly support finding - specific libraries or headers, as that isn't - supported by NVIDIA. If you want to change - libraries when the path changes see the - FindCUDA.cmake script for an example of how to clear - these variables. There are also examples of how to - use the CUDA_SDK_ROOT_DIR to locate headers or - libraries, if you so choose (at your own risk). - CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically - for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. - CUDA_LIBRARIES -- Cuda RT library. - CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT - implementation (alternative to: - CUDA_ADD_CUFFT_TO_TARGET macro) - CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS - implementation (alternative to: - CUDA_ADD_CUBLAS_TO_TARGET macro). - CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. - Only available for CUDA version 5.5+ - CUDA_cudadevrt_LIBRARY -- Device runtime library. - Required for separable compilation. - CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. - Only available for CUDA version 4.0+. - CUDA_curand_LIBRARY -- CUDA Random Number Generation library. - Only available for CUDA version 3.2+. - CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. - Only available for CUDA version 7.0+. - CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. - Only available for CUDA version 3.2+. - CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. - Only available for CUDA version 4.0+. - CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). - Only available for CUDA version 5.5+. - CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 5.5 - 8.0. - CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0 - 10.2. - Replaced by nvjpeg. - CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). - Only available for CUDA version 9.0. - CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). - Only available for CUDA version 5.5+. - CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. - Only available for CUDA version 3.2+. - Windows only. - CUDA_nvToolsExt_LIBRARY - -- NVIDA CUDA Tools Extension library. - Available for CUDA version 5+. - CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. - Available for CUDA version 5+. - -#]=======================================================================] - -# James Bigler, NVIDIA Corp (nvidia.com - jbigler) -# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html -# -# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. -# -# Copyright (c) 2007-2009 -# Scientific Computing and Imaging Institute, University of Utah -# -# This code is licensed under the MIT License. See the FindCUDA.cmake script -# for the text of the license. - -# The MIT License -# -# License for the specific language governing rights and limitations under -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -############################################################################### - -# FindCUDA.cmake - -# This macro helps us find the location of helper files we will need the full path to -macro(CUDA_FIND_HELPER_FILE _name _extension) - set(_full_name "${_name}.${_extension}") - # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being - # processed. Using this variable, we can pull out the current path, and - # provide a way to get access to the other files we need local to here. - set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") - if(NOT EXISTS "${CUDA_${_name}}") - set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "${error_message}") - else() - if(NOT CUDA_FIND_QUIETLY) - message(STATUS "${error_message}") - endif() - endif() - endif() - # Set this variable as internal, so the user isn't bugged with it. - set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) -endmacro() - -##################################################################### -## CUDA_INCLUDE_NVCC_DEPENDENCIES -## - -# So we want to try and include the dependency file if it exists. If -# it doesn't exist then we need to create an empty one, so we can -# include it. - -# If it does exist, then we need to check to see if all the files it -# depends on exist. If they don't then we should clear the dependency -# file and regenerate it later. This covers the case where a header -# file has disappeared or moved. - -macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) - set(CUDA_NVCC_DEPEND) - set(CUDA_NVCC_DEPEND_REGENERATE FALSE) - - - # Include the dependency file. Create it first if it doesn't exist . The - # INCLUDE puts a dependency that will force CMake to rerun and bring in the - # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few - # hours figuring out why it didn't work. - if(NOT EXISTS ${dependency_file}) - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - # Always include this file to force CMake to run again next - # invocation and rebuild the dependencies. - #message("including dependency_file = ${dependency_file}") - include(${dependency_file}) - - # Now we need to verify the existence of all the included files - # here. If they aren't there we need to just blank this variable and - # make the file regenerate again. -# if(DEFINED CUDA_NVCC_DEPEND) -# message("CUDA_NVCC_DEPEND set") -# else() -# message("CUDA_NVCC_DEPEND NOT set") -# endif() - if(CUDA_NVCC_DEPEND) - #message("CUDA_NVCC_DEPEND found") - foreach(f ${CUDA_NVCC_DEPEND}) - # message("searching for ${f}") - if(NOT EXISTS ${f}) - #message("file ${f} not found") - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - endforeach() - else() - #message("CUDA_NVCC_DEPEND false") - # No dependencies, so regenerate the file. - set(CUDA_NVCC_DEPEND_REGENERATE TRUE) - endif() - - #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") - # No incoming dependencies, so we need to generate them. Make the - # output depend on the dependency file itself, which should cause the - # rule to re-run. - if(CUDA_NVCC_DEPEND_REGENERATE) - set(CUDA_NVCC_DEPEND ${dependency_file}) - #message("Generating an empty dependency_file: ${dependency_file}") - file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") - endif() - -endmacro() - -############################################################################### -############################################################################### -# Setup variables' defaults -############################################################################### -############################################################################### - -# Allow the user to specify if the device code is supposed to be 32 or 64 bit. -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) -else() - set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) -endif() -option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) - -# Attach the build rule to the source file in VS. This option -option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) - -# Prints out extra information about the cuda file during compilation -option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) - -# Set whether we are using emulation or device mode. -option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) - -# Where to put the generated output. -set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") - -# Parse HOST_COMPILATION mode. -option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) - -# Extra user settable flags -cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") - -if(DEFINED ENV{CUDAHOSTCXX}) - set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") -elseif(CMAKE_GENERATOR MATCHES "Visual Studio") - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") - if(MSVC_VERSION LESS 1910) - set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") - endif() - - set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") - -else() - if(APPLE - AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" - AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") - # Using cc which is symlink to clang may let NVCC think it is GCC and issue - # unhandled -dumpspecs option to clang. Also in case neither - # CMAKE_C_COMPILER is defined (project does not use C language) nor - # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let - # nvcc use its own default C compiler. - # Only care about this on APPLE with clang to avoid - # following symlinks to things like ccache - if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) - get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) - # if the real path does not end up being clang then - # go back to using CMAKE_C_COMPILER - if(NOT "${c_compiler_realpath}" MATCHES "/clang$") - set(c_compiler_realpath "${CMAKE_C_COMPILER}") - endif() - else() - set(c_compiler_realpath "") - endif() - set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") - elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") - # NVCC does not think it will work if it is passed clcache.exe or sccache.exe - # as the host compiler, which means that builds with CC=cl.exe won't work. - # Best to just feed it whatever the actual cl.exe is as the host compiler. - set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") - else() - set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" - CACHE FILEPATH "Host side compiler used by NVCC") - endif() -endif() - -# Propagate the host flags to the host compiler via -Xcompiler -option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) - -# Enable CUDA_SEPARABLE_COMPILATION -option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) - -# Specifies whether the commands used when compiling the .cu file will be printed out. -option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) - -mark_as_advanced( - CUDA_64_BIT_DEVICE_CODE - CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE - CUDA_GENERATED_OUTPUT_DIR - CUDA_HOST_COMPILATION_CPP - CUDA_NVCC_FLAGS - CUDA_PROPAGATE_HOST_FLAGS - CUDA_BUILD_CUBIN - CUDA_BUILD_EMULATION - CUDA_VERBOSE_BUILD - CUDA_SEPARABLE_COMPILATION - ) - -# Single config generators like Makefiles or Ninja don't usually have -# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by -# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for -# single config generators (and should not be defined for multi-config -# generators). To ensure we get a complete superset of all possible -# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and -# all of the standard configurations, then weed out duplicates with -# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have -# each configuration-specific set of nvcc flags defined and marked as advanced. -set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) -list(REMOVE_DUPLICATES CUDA_configuration_types) - -############################################################################### -############################################################################### -# Locate CUDA, Set Build Type, etc. -############################################################################### -############################################################################### - -macro(cuda_unset_include_and_libraries) - unset(CUDA_TOOLKIT_INCLUDE CACHE) - unset(CUDA_CUDART_LIBRARY CACHE) - unset(CUDA_CUDA_LIBRARY CACHE) - # Make sure you run this before you unset CUDA_VERSION. - if(CUDA_VERSION VERSION_EQUAL "3.0") - # This only existed in the 3.0 version of the CUDA toolkit - unset(CUDA_CUDARTEMU_LIBRARY CACHE) - endif() - unset(CUDA_cudart_static_LIBRARY CACHE) - unset(CUDA_cudadevrt_LIBRARY CACHE) - unset(CUDA_cublas_LIBRARY CACHE) - unset(CUDA_cublas_device_LIBRARY CACHE) - unset(CUDA_cublasemu_LIBRARY CACHE) - unset(CUDA_cufft_LIBRARY CACHE) - unset(CUDA_cufftemu_LIBRARY CACHE) - unset(CUDA_cupti_LIBRARY CACHE) - unset(CUDA_curand_LIBRARY CACHE) - unset(CUDA_cusolver_LIBRARY CACHE) - unset(CUDA_cusparse_LIBRARY CACHE) - unset(CUDA_npp_LIBRARY CACHE) - unset(CUDA_nppc_LIBRARY CACHE) - unset(CUDA_nppi_LIBRARY CACHE) - unset(CUDA_npps_LIBRARY CACHE) - unset(CUDA_nvcuvenc_LIBRARY CACHE) - unset(CUDA_nvcuvid_LIBRARY CACHE) - unset(CUDA_nvToolsExt_LIBRARY CACHE) - unset(CUDA_OpenCL_LIBRARY CACHE) - unset(CUDA_GPU_DETECT_OUTPUT CACHE) -endmacro() - -# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, -# if they have then clear the cache variables, so that will be detected again. -if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") - unset(CUDA_TOOLKIT_TARGET_DIR CACHE) - unset(CUDA_NVCC_EXECUTABLE CACHE) - cuda_unset_include_and_libraries() - unset(CUDA_VERSION CACHE) -endif() - -if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") - cuda_unset_include_and_libraries() -endif() - -# -# End of unset() -# - -# -# Start looking for things -# - -# Search for the cuda distribution. -if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) - # Search in the CUDA_BIN_PATH first. - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS - ENV CUDA_TOOLKIT_ROOT - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - DOC "Toolkit location." - NO_DEFAULT_PATH - ) - - # Now search default paths - find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC - NAMES nvcc nvcc.exe - PATHS /opt/cuda/bin - PATH_SUFFIXES cuda/bin - DOC "Toolkit location." - ) - - if (CUDA_TOOLKIT_ROOT_DIR_NVCC) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) - get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) - string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - # We need to force this back into the cache. - set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) - set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) - endif() - unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) - - if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) - if(CUDA_FIND_REQUIRED) - message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") - elseif(NOT CUDA_FIND_QUIETLY) - message("CUDA_TOOLKIT_ROOT_DIR not found or specified") - endif() - endif () -endif () - -if(CMAKE_CROSSCOMPILING) - SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") - # Support for NVPACK - set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") - # Support for arm cross compilation - set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") - # Support for aarch64 cross compilation - if (ANDROID_ARCH_NAME STREQUAL "arm64") - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") - else() - set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") - endif (ANDROID_ARCH_NAME STREQUAL "arm64") - endif() - - if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") - set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") - SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) - mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) - endif() - - # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers - set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") - macro( cuda_find_host_program ) - if (COMMAND find_host_program) - find_host_program( ${ARGN} ) - else() - find_program( ${ARGN} ) - endif() - endmacro() -else() - # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR - macro( cuda_find_host_program ) - find_program( ${ARGN} ) - endmacro() - SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) -endif() - - -# CUDA_NVCC_EXECUTABLE -if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) - set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") -else() - cuda_find_host_program(CUDA_NVCC_EXECUTABLE - NAMES nvcc - PATHS "${CUDA_TOOLKIT_ROOT_DIR}" - ENV CUDA_PATH - ENV CUDA_BIN_PATH - PATH_SUFFIXES bin bin64 - NO_DEFAULT_PATH - ) - # Search default search paths, after we search our own set of paths. - cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) -endif() -mark_as_advanced(CUDA_NVCC_EXECUTABLE) - -if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) - # Compute the version. - execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) - string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) - set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") - mark_as_advanced(CUDA_VERSION) -else() - # Need to set these based off of the cached value - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") - string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") -endif() - - -# Always set this convenience variable -set(CUDA_VERSION_STRING "${CUDA_VERSION}") - -# CUDA_TOOLKIT_INCLUDE -find_path(CUDA_TOOLKIT_INCLUDE - device_functions.h # Header included in toolkit - PATHS ${CUDA_TOOLKIT_TARGET_DIR} - ENV CUDA_PATH - ENV CUDA_INC_PATH - PATH_SUFFIXES include - NO_DEFAULT_PATH - ) -# Search default search paths, after we search our own set of paths. -find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) -mark_as_advanced(CUDA_TOOLKIT_INCLUDE) - -if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") - set(CUDA_HAS_FP16 TRUE) -else() - set(CUDA_HAS_FP16 FALSE) -endif() - -# Set the user list of include dir to nothing to initialize it. -set (CUDA_NVCC_INCLUDE_DIRS_USER "") -set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) - -macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - # CUDA 3.2+ on Windows moved the library directories, so we need the new - # and old paths. - set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) - endif() - # CUDA 3.2+ on Windows moved the library directories, so we need to new - # (lib/Win32) and the old path (lib). - find_library(${_var} - NAMES ${_names} - PATHS "${CUDA_TOOLKIT_TARGET_DIR}" - ENV CUDA_PATH - ENV CUDA_LIB_PATH - PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" - DOC ${_doc} - NO_DEFAULT_PATH - ) - if (NOT CMAKE_CROSSCOMPILING) - # Search default search paths, after we search our own set of paths. - find_library(${_var} - NAMES ${_names} - PATHS "/usr/lib/nvidia-current" - DOC ${_doc} - ) - endif() -endmacro() - -macro(cuda_find_library_local_first _var _names _doc) - cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - -macro(find_library_local_first _var _names _doc ) - cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) -endmacro() - - -# CUDA_LIBRARIES -cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") -if(CUDA_VERSION VERSION_EQUAL "3.0") - # The cudartemu library only existed for the 3.0 version of CUDA. - cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") - mark_as_advanced( - CUDA_CUDARTEMU_LIBRARY - ) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.5") - cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") - mark_as_advanced(CUDA_cudart_static_LIBRARY) -endif() - - -if(CUDA_cudart_static_LIBRARY) - # If static cudart available, use it by default, but provide a user-visible option to disable it. - option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) -else() - # If not available, silently disable the option. - set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) -else() - set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") - mark_as_advanced(CUDA_cudadevrt_LIBRARY) -endif() - -if(CUDA_USE_STATIC_CUDA_RUNTIME) - if(UNIX) - # Check for the dependent libraries. - - # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} - # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and - # -Werror causes the try_compile to fail. We will just temporarily disable other flags - # when doing the find_package command here. - set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) - set(CMAKE_C_FLAGS "-fPIC") - find_package(Threads REQUIRED) - set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - - if(NOT APPLE) - #On Linux, you must link against librt when using the static cuda runtime. - find_library(CUDA_rt_LIBRARY rt) - if (NOT CUDA_rt_LIBRARY) - message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") - endif() - endif() - endif() -endif() - -# CUPTI library showed up in cuda toolkit 4.0 -if(NOT CUDA_VERSION VERSION_LESS "4.0") - cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") - mark_as_advanced(CUDA_cupti_LIBRARY) -endif() - -# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are -# using the CUDA runtime. For the dynamic version of the runtime, most of the -# dependencies are brough in, but for the static version there are additional libraries -# and linker commands needed. -# Initialize to empty -set(CUDA_LIBRARIES) - -# If we are using emulation mode and we found the cudartemu library then use -# that one instead of cudart. -if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) -elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) - if (TARGET Threads::Threads) - list(APPEND CUDA_LIBRARIES Threads::Threads) - endif() - list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) - if (CUDA_rt_LIBRARY) - list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) - endif() - if(APPLE) - # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that - # the static cuda runtime can find it at runtime. - list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) - endif() -else() - list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) -endif() - -# 1.1 toolkit on linux doesn't appear to have a separate library on -# some platforms. -cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") - -mark_as_advanced( - CUDA_CUDA_LIBRARY - CUDA_CUDART_LIBRARY - ) - -####################### -# Look for some of the toolkit helper libraries -macro(FIND_CUDA_HELPER_LIBS _name) - cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") - mark_as_advanced(CUDA_${_name}_LIBRARY) -endmacro() - -####################### -# Disable emulation for v3.1 onward -if(CUDA_VERSION VERSION_GREATER "3.0") - if(CUDA_BUILD_EMULATION) - message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") - endif() -endif() - -# Search for additional CUDA toolkit libraries. -if(CUDA_VERSION VERSION_LESS "3.1") - # Emulation libraries aren't available in version 3.1 onward. - find_cuda_helper_libs(cufftemu) - find_cuda_helper_libs(cublasemu) -endif() -find_cuda_helper_libs(cufft) -find_cuda_helper_libs(cublas) -if(NOT CUDA_VERSION VERSION_LESS "3.2") - # cusparse showed up in version 3.2 - find_cuda_helper_libs(cusparse) - find_cuda_helper_libs(curand) - if (WIN32) - find_cuda_helper_libs(nvcuvenc) - find_cuda_helper_libs(nvcuvid) - endif() -endif() -if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") - # In CUDA 9.2 cublas_device was deprecated - find_cuda_helper_libs(cublas_device) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "5.0") - find_cuda_helper_libs(nvToolsExt) - find_cuda_helper_libs(OpenCL) -endif() - -if(NOT CUDA_VERSION VERSION_LESS "9.0") - # In CUDA 9.0 NPP was nppi was removed - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppial) - find_cuda_helper_libs(nppicc) - if(CUDA_VERSION VERSION_LESS "11.0") - find_cuda_helper_libs(nppicom) - endif() - find_cuda_helper_libs(nppidei) - find_cuda_helper_libs(nppif) - find_cuda_helper_libs(nppig) - find_cuda_helper_libs(nppim) - find_cuda_helper_libs(nppist) - find_cuda_helper_libs(nppisu) - find_cuda_helper_libs(nppitc) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(CUDA_VERSION VERSION_GREATER "5.0") - # In CUDA 5.5 NPP was split into 3 separate libraries. - find_cuda_helper_libs(nppc) - find_cuda_helper_libs(nppi) - find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") -elseif(NOT CUDA_VERSION VERSION_LESS "4.0") - find_cuda_helper_libs(npp) -endif() -if(NOT CUDA_VERSION VERSION_LESS "7.0") - # cusolver showed up in version 7.0 - find_cuda_helper_libs(cusolver) -endif() - -if (CUDA_BUILD_EMULATION) - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) -else() - set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) - set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) -endif() - -######################## -# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with -# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory -find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h - HINTS - "$ENV{NVSDKCOMPUTE_ROOT}/C" - ENV NVSDKCUDA_ROOT - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" - PATHS - "/Developer/GPU\ Computing/C" - ) - -# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the -# environment variables. -set(CUDA_SDK_SEARCH_PATH - "${CUDA_SDK_ROOT_DIR}" - "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" - "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK" - "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" - "/Developer/CUDA" - ) - -# Example of how to find an include file from the CUDA_SDK_ROOT_DIR - -# find_path(CUDA_CUT_INCLUDE_DIR -# cutil.h -# PATHS ${CUDA_SDK_SEARCH_PATH} -# PATH_SUFFIXES "common/inc" -# DOC "Location of cutil.h" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") - -# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) - - -# Example of how to find a library in the CUDA_SDK_ROOT_DIR - -# # cutil library is called cutil64 for 64 bit builds on windows. We don't want -# # to get these confused, so we are setting the name based on the word size of -# # the build. - -# if(CMAKE_SIZEOF_VOID_P EQUAL 8) -# set(cuda_cutil_name cutil64) -# else() -# set(cuda_cutil_name cutil32) -# endif() - -# find_library(CUDA_CUT_LIBRARY -# NAMES cutil ${cuda_cutil_name} -# PATHS ${CUDA_SDK_SEARCH_PATH} -# # The new version of the sdk shows up in common/lib, but the old one is in lib -# PATH_SUFFIXES "common/lib" "lib" -# DOC "Location of cutil library" -# NO_DEFAULT_PATH -# ) -# # Now search system paths -# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") -# mark_as_advanced(CUDA_CUT_LIBRARY) -# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) - - - -############################# -# Check for required components -set(CUDA_FOUND TRUE) - -set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) -set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) -set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL - "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) - -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) - -find_package_handle_standard_args(CUDA - REQUIRED_VARS - CUDA_TOOLKIT_ROOT_DIR - CUDA_NVCC_EXECUTABLE - CUDA_INCLUDE_DIRS - ${CUDA_CUDART_LIBRARY_VAR} - VERSION_VAR - CUDA_VERSION - ) - - - -############################################################################### -############################################################################### -# Macros -############################################################################### -############################################################################### - -############################################################################### -# Add include directories to pass to the nvcc command. -macro(CUDA_INCLUDE_DIRECTORIES) - foreach(dir ${ARGN}) - list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) - endforeach() -endmacro() - - -############################################################################## -cuda_find_helper_file(parse_cubin cmake) -cuda_find_helper_file(make2cmake cmake) -cuda_find_helper_file(run_nvcc cmake) -include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") - -############################################################################## -# Separate the OPTIONS out from the sources -# -macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) - set( ${_sources} ) - set( ${_cmake_options} ) - set( ${_options} ) - set( _found_options FALSE ) - foreach(arg ${ARGN}) - if("x${arg}" STREQUAL "xOPTIONS") - set( _found_options TRUE ) - elseif( - "x${arg}" STREQUAL "xWIN32" OR - "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR - "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR - "x${arg}" STREQUAL "xSTATIC" OR - "x${arg}" STREQUAL "xSHARED" OR - "x${arg}" STREQUAL "xMODULE" - ) - list(APPEND ${_cmake_options} ${arg}) - else() - if ( _found_options ) - list(APPEND ${_options} ${arg}) - else() - # Assume this is a file - list(APPEND ${_sources} ${arg}) - endif() - endif() - endforeach() -endmacro() - -############################################################################## -# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix -# -macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) - set( _found_config ) - foreach(arg ${ARGN}) - # Determine if we are dealing with a perconfiguration flag - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - if (arg STREQUAL "${config_upper}") - set( _found_config _${arg}) - # Set arg to nothing to keep it from being processed further - set( arg ) - endif() - endforeach() - - if ( arg ) - list(APPEND ${_option_prefix}${_found_config} "${arg}") - endif() - endforeach() -endmacro() - -############################################################################## -# Helper to add the include directory for CUDA only once -function(CUDA_ADD_CUDA_INCLUDE_ONCE) - get_directory_property(_include_directories INCLUDE_DIRECTORIES) - set(_add TRUE) - if(_include_directories) - foreach(dir ${_include_directories}) - if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") - set(_add FALSE) - endif() - endforeach() - endif() - if(_add) - include_directories(${CUDA_INCLUDE_DIRS}) - endif() -endfunction() - -function(CUDA_BUILD_SHARED_LIBRARY shared_flag) - set(cmake_args ${ARGN}) - # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then - # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. - list(FIND cmake_args SHARED _cuda_found_SHARED) - list(FIND cmake_args MODULE _cuda_found_MODULE) - list(FIND cmake_args STATIC _cuda_found_STATIC) - if( _cuda_found_SHARED GREATER -1 OR - _cuda_found_MODULE GREATER -1 OR - _cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs) - else() - if (BUILD_SHARED_LIBS) - set(_cuda_build_shared_libs SHARED) - else() - set(_cuda_build_shared_libs STATIC) - endif() - endif() - set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) -endfunction() - -############################################################################## -# Helper to avoid clashes of files with the same basename but different paths. -# This doesn't attempt to do exactly what CMake internals do, which is to only -# add this path when there is a conflict, since by the time a second collision -# in names is detected it's already too late to fix the first one. For -# consistency sake the relative path will be added to all files. -function(CUDA_COMPUTE_BUILD_PATH path build_path) - #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") - # Only deal with CMake style paths from here on out - file(TO_CMAKE_PATH "${path}" bpath) - if (IS_ABSOLUTE "${bpath}") - # Absolute paths are generally unnessary, especially if something like - # file(GLOB_RECURSE) is used to pick up the files. - - string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) - if (_binary_dir_pos EQUAL 0) - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") - else() - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") - endif() - endif() - - # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the - # CMake source. - - # Remove leading / - string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") - # Avoid absolute paths by removing ':' - string(REPLACE ":" "_" bpath "${bpath}") - # Avoid relative paths that go up the tree - string(REPLACE "../" "__/" bpath "${bpath}") - # Avoid spaces - string(REPLACE " " "_" bpath "${bpath}") - - # Strip off the filename. I wait until here to do it, since removin the - # basename can make a path that looked like path/../basename turn into - # path/.. (notice the trailing slash). - get_filename_component(bpath "${bpath}" PATH) - - set(${build_path} "${bpath}" PARENT_SCOPE) - #message("${build_path} = ${bpath}") -endfunction() - -############################################################################## -# This helper macro populates the following variables and setups up custom -# commands and targets to invoke the nvcc compiler to generate C or PTX source -# dependent upon the format parameter. The compiler is invoked once with -M -# to generate a dependency file and a second time with -cuda or -ptx to generate -# a .cpp or .ptx file. -# INPUT: -# cuda_target - Target name -# format - PTX, CUBIN, FATBIN or OBJ -# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. -# OPTIONS - Extra options to NVCC -# OUTPUT: -# generated_files - List of generated files -############################################################################## -############################################################################## - -macro(CUDA_WRAP_SRCS cuda_target format generated_files) - - # Put optional arguments in list. - set(_argn_list "${ARGN}") - # If one of the given optional arguments is "PHONY", make a note of it, then - # remove it from the list. - list(FIND _argn_list "PHONY" _phony_idx) - if("${_phony_idx}" GREATER "-1") - set(_target_is_phony true) - list(REMOVE_AT _argn_list ${_phony_idx}) - else() - set(_target_is_phony false) - endif() - - # If CMake doesn't support separable compilation, complain - if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") - message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") - endif() - - # Set up all the command line flags here, so that they can be overridden on a per target basis. - - set(nvcc_flags "") - - # Emulation if the card isn't present. - if (CUDA_BUILD_EMULATION) - # Emulation. - set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) - else() - # Device mode. No flags necessary. - endif() - - if(CUDA_HOST_COMPILATION_CPP) - set(CUDA_C_OR_CXX CXX) - else() - if(CUDA_VERSION VERSION_LESS "3.0") - set(nvcc_flags ${nvcc_flags} --host-compilation C) - else() - message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) - endif() - set(CUDA_C_OR_CXX C) - endif() - - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - - if(CUDA_64_BIT_DEVICE_CODE) - set(nvcc_flags ${nvcc_flags} -m64) - else() - set(nvcc_flags ${nvcc_flags} -m32) - endif() - - if(CUDA_TARGET_CPU_ARCH) - set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") - endif() - - # This needs to be passed in at this stage, because VS needs to fill out the - # various macros from within VS. Note that CCBIN is only used if - # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches - # _CUDA_MSVC_HOST_COMPILER - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) - else() - set(ccbin_flags) - endif() - - # Figure out which configure we will use and pass that in as an argument to - # the script. We need to defer the decision until compilation time, because - # for VS projects we won't know if we are making a debug or release build - # until build time. - if(CMAKE_GENERATOR MATCHES "Visual Studio") - set( CUDA_build_configuration "$(ConfigurationName)" ) - else() - set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") - endif() - - # Initialize our list of includes with the user ones followed by the CUDA system ones. - set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") - if(_target_is_phony) - # If the passed in target name isn't a real target (i.e., this is from a call to one of the - # cuda_compile_* functions), need to query directory properties to get include directories - # and compile definitions. - get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) - get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) - - list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") - set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") - else() - # Append the include directories for this target via generator expression, which is - # expanded by the FILE(GENERATE) call below. This generator expression captures all - # include dirs set by the user, whether via directory properties or target properties - list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") - - # Do the same thing with compile definitions - set(CUDA_NVCC_COMPILE_DEFINITIONS "$") - endif() - - - # Reset these variables - set(CUDA_WRAP_OPTION_NVCC_FLAGS) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) - endforeach() - - CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) - CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) - - # Figure out if we are building a shared library. BUILD_SHARED_LIBS is - # respected in CUDA_ADD_LIBRARY. - set(_cuda_build_shared_libs FALSE) - # SHARED, MODULE - list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) - list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) - if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) - set(_cuda_build_shared_libs TRUE) - endif() - # STATIC - list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) - if(_cuda_found_STATIC GREATER -1) - set(_cuda_build_shared_libs FALSE) - endif() - - # CUDA_HOST_FLAGS - if(_cuda_build_shared_libs) - # If we are setting up code for a shared library, then we need to add extra flags for - # compiling objects for shared libraries. - set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) - else() - set(CUDA_HOST_SHARED_FLAGS) - endif() - # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We - # always need to set the SHARED_FLAGS, though. - if(CUDA_PROPAGATE_HOST_FLAGS) - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") - else() - set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") - endif() - - set(_cuda_nvcc_flags_config "# Build specific configuration flags") - # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS - # we convert the strings to lists (like we want). - - if(CUDA_PROPAGATE_HOST_FLAGS) - # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g - set(_cuda_fix_g3 FALSE) - - if(CMAKE_COMPILER_IS_GNUCC) - if (CUDA_VERSION VERSION_LESS "3.0" OR - CUDA_VERSION VERSION_EQUAL "4.1" OR - CUDA_VERSION VERSION_EQUAL "4.2" - ) - set(_cuda_fix_g3 TRUE) - endif() - endif() - if(_cuda_fix_g3) - string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - else() - set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - endif() - - string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") - endif() - - # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list - # like it is currently), we can remove the quotes around the - # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. - string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") - endforeach() - - # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and - # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses - # the C preprocessor). In order to get this to work correctly, we need to use nvcc's - # specific c++11 flag. - if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") - # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at - # the main flag instead of the configuration specific flags. - if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) - list(APPEND nvcc_flags --std c++11) - endif() - string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") - endif() - - if(_cuda_build_shared_libs) - list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") - endif() - - # Reset the output variable - set(_cuda_wrap_generated_files "") - - # Iterate over the macro arguments and create custom - # commands for all the .cu files. - foreach(file ${_argn_list}) - # Ignore any file marked as a HEADER_FILE_ONLY - get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - # Allow per source file overrides of the format. Also allows compiling non-.cu files. - get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) - if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) - - if(NOT _cuda_source_format) - set(_cuda_source_format ${format}) - endif() - # If file isn't a .cu file, we need to tell nvcc to treat it as such. - if(NOT ${file} MATCHES "\\.cu$") - set(cuda_language_flag -x=cu) - else() - set(cuda_language_flag) - endif() - - if( ${_cuda_source_format} MATCHES "OBJ") - set( cuda_compile_to_external_module OFF ) - else() - set( cuda_compile_to_external_module ON ) - if( ${_cuda_source_format} MATCHES "PTX" ) - set( cuda_compile_to_external_module_type "ptx" ) - elseif( ${_cuda_source_format} MATCHES "CUBIN") - set( cuda_compile_to_external_module_type "cubin" ) - elseif( ${_cuda_source_format} MATCHES "FATBIN") - set( cuda_compile_to_external_module_type "fatbin" ) - else() - message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") - endif() - endif() - - if(cuda_compile_to_external_module) - # Don't use any of the host compilation flags for PTX targets. - set(CUDA_HOST_FLAGS) - set(CUDA_NVCC_FLAGS_CONFIG) - else() - set(CUDA_HOST_FLAGS ${_cuda_host_flags}) - set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) - endif() - - # Determine output directory - cuda_compute_build_path("${file}" cuda_build_path) - set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") - if(CUDA_GENERATED_OUTPUT_DIR) - set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") - else() - if ( cuda_compile_to_external_module ) - set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") - else() - set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") - endif() - endif() - - # Add a custom target to generate a c or ptx file. ###################### - - get_filename_component( basename ${file} NAME ) - if( cuda_compile_to_external_module ) - set(generated_file_path "${cuda_compile_output_dir}") - set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") - set(format_flag "-${cuda_compile_to_external_module_type}") - file(MAKE_DIRECTORY "${cuda_compile_output_dir}") - else() - set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") - set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") - if(CUDA_SEPARABLE_COMPILATION) - set(format_flag "-dc") - else() - set(format_flag "-c") - endif() - endif() - - # Set all of our file names. Make sure that whatever filenames that have - # generated_file_path in them get passed in through as a command line - # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time - # instead of configure time. - set(generated_file "${generated_file_path}/${generated_file_basename}") - set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") - set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") - set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") - set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") - set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") - - # Setup properties for obj files: - if( NOT cuda_compile_to_external_module ) - set_source_files_properties("${generated_file}" - PROPERTIES - EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. - ) - endif() - - # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. - get_filename_component(file_path "${file}" PATH) - if(IS_ABSOLUTE "${file_path}") - set(source_file "${file}") - else() - set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - endif() - - if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) - list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") - endif() - - # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### - cuda_include_nvcc_dependencies(${cmake_dependency_file}) - - # Convenience string for output ######################################### - if(CUDA_BUILD_EMULATION) - set(cuda_build_type "Emulation") - else() - set(cuda_build_type "Device") - endif() - - # Build the NVCC made dependency file ################################### - set(build_cubin OFF) - if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) - if ( NOT cuda_compile_to_external_module ) - set ( build_cubin ON ) - endif() - endif() - - # Configure the build script - configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) - file(GENERATE - OUTPUT "${custom_target_script}" - INPUT "${custom_target_script_pregen}" - ) - - # So if a user specifies the same cuda file as input more than once, you - # can have bad things happen with dependencies. Here we check an option - # to see if this is the behavior they want. - if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) - set(main_dep MAIN_DEPENDENCY ${source_file}) - else() - set(main_dep DEPENDS ${source_file}) - endif() - - if(CUDA_VERBOSE_BUILD) - set(verbose_output ON) - elseif(CMAKE_GENERATOR MATCHES "Makefiles") - set(verbose_output "$(VERBOSE)") - else() - set(verbose_output OFF) - endif() - - # Create up the comment string - file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") - if(cuda_compile_to_external_module) - set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") - else() - set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") - endif() - - set(_verbatim VERBATIM) - if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - # Build the generated file and dependency file ########################## - add_custom_command( - OUTPUT ${generated_file} - # These output files depend on the source_file and the contents of cmake_dependency_file - ${main_dep} - DEPENDS ${CUDA_NVCC_DEPEND} - DEPENDS ${custom_target_script} - # Make sure the output directory exists before trying to write to it. - COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" - COMMAND ${CMAKE_COMMAND} ARGS - -D verbose:BOOL=${verbose_output} - ${ccbin_flags} - -D build_configuration:STRING=${CUDA_build_configuration} - -D "generated_file:STRING=${generated_file}" - -D "generated_cubin_file:STRING=${generated_cubin_file}" - -P "${custom_target_script}" - WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" - COMMENT "${cuda_build_comment_string}" - ${_verbatim} - ) - - # Make sure the build system knows the file is generated. - set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - - list(APPEND _cuda_wrap_generated_files ${generated_file}) - - # Add the other files that we want cmake to clean on a cleanup ########## - list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") - list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) - set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") - - endif() - endforeach() - - # Set the return parameter - set(${generated_files} ${_cuda_wrap_generated_files}) -endmacro() - -function(_cuda_get_important_host_flags important_flags flag_string) - if(CMAKE_GENERATOR MATCHES "Visual Studio") - string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - else() - string(REGEX MATCHALL "-fPIC" flags "${flag_string}") - list(APPEND ${important_flags} ${flags}) - endif() - set(${important_flags} ${${important_flags}} PARENT_SCOPE) -endfunction() - -############################################################################### -############################################################################### -# Separable Compilation Link -############################################################################### -############################################################################### - -# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS -function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) - if (object_files) - set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) - set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") - else() - set(output_file) - endif() - - set(${output_file_var} "${output_file}" PARENT_SCOPE) -endfunction() - -# Setup the build rule for the separable compilation intermediate link file. -function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) - if (object_files) - - set_source_files_properties("${output_file}" - PROPERTIES - EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only - # be linked. - GENERATED TRUE # This file is generated during the build - ) - - # For now we are ignoring all the configuration specific flags. - set(nvcc_flags) - CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) - if(CUDA_64_BIT_DEVICE_CODE) - list(APPEND nvcc_flags -m64) - else() - list(APPEND nvcc_flags -m32) - endif() - # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. - list( FIND nvcc_flags "-ccbin" ccbin_found0 ) - list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) - if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) - # Match VERBATIM check below. - if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") - list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") - else() - list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") - endif() - endif() - - # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* - set(config_specific_flags) - set(flags) - foreach(config ${CUDA_configuration_types}) - string(TOUPPER ${config} config_upper) - # Add config specific flags - foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) - list(APPEND config_specific_flags $<$:${f}>) - endforeach() - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") - foreach(f ${important_host_flags}) - list(APPEND flags $<$:-Xcompiler> $<$:${f}>) - endforeach() - endforeach() - # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS - set(important_host_flags) - _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") - foreach(f ${important_host_flags}) - list(APPEND flags -Xcompiler ${f}) - endforeach() - - # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags - set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) - - file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") - - # Some generators don't handle the multiple levels of custom command - # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so - # we work around that issue by compiling the intermediate link object as a - # pre-link custom command in that situation. - set(do_obj_build_rule TRUE) - if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) - # VS 2010 and 2012 have this problem. - set(do_obj_build_rule FALSE) - endif() - - set(_verbatim VERBATIM) - if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") - set(_verbatim "") - endif() - - if (do_obj_build_rule) - add_custom_command( - OUTPUT ${output_file} - DEPENDS ${object_files} - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} - ${flags} - COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - else() - get_filename_component(output_file_dir "${output_file}" DIRECTORY) - add_custom_command( - TARGET ${cuda_target} - PRE_LINK - COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" - COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" - COMMAND_EXPAND_LISTS - ${_verbatim} - ) - endif() - endif() -endfunction() - -############################################################################### -############################################################################### -# ADD LIBRARY -############################################################################### -############################################################################### -macro(CUDA_ADD_LIBRARY cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} - ${_cmake_options} ${_cuda_shared_flag} - OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_library(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - if(CUDA_SEPARABLE_COMPILATION) - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_cudadevrt_LIBRARY} - ) - endif() - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# ADD EXECUTABLE -############################################################################### -############################################################################### -macro(CUDA_ADD_EXECUTABLE cuda_target) - - CUDA_ADD_CUDA_INCLUDE_ONCE() - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) - - # Compute the file name of the intermedate link file used for separable - # compilation. - CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - # Add the library. - add_executable(${cuda_target} ${_cmake_options} - ${_generated_files} - ${_sources} - ${link_file} - ) - - # Add a link phase for the separable compilation if it has been enabled. If - # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS - # variable will have been defined. - CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") - - target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} - ${CUDA_LIBRARIES} - ) - - # We need to set the linker language based on what the expected generated file - # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. - set_target_properties(${cuda_target} - PROPERTIES - LINKER_LANGUAGE ${CUDA_C_OR_CXX} - ) - -endmacro() - - -############################################################################### -############################################################################### -# (Internal) helper for manually added cuda source files with specific targets -############################################################################### -############################################################################### -macro(cuda_compile_base cuda_target format generated_files) - # Update a counter in this directory, to keep phony target names unique. - set(_cuda_target "${cuda_target}") - get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) - if(_counter) - math(EXPR _counter "${_counter} + 1") - else() - set(_counter 1) - endif() - string(APPEND _cuda_target "_${_counter}") - set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) - - # Separate the sources from the options - CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) - - # Create custom commands and targets for each file. - CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} - ${_cmake_options} OPTIONS ${_options} PHONY) - - set( ${generated_files} ${_generated_files}) - -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE -############################################################################### -############################################################################### -macro(CUDA_COMPILE generated_files) - cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE PTX -############################################################################### -############################################################################### -macro(CUDA_COMPILE_PTX generated_files) - cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE FATBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_FATBIN generated_files) - cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) -endmacro() - -############################################################################### -############################################################################### -# CUDA COMPILE CUBIN -############################################################################### -############################################################################### -macro(CUDA_COMPILE_CUBIN generated_files) - cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) -endmacro() - - -############################################################################### -############################################################################### -# CUDA ADD CUFFT TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUFFT_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA ADD CUBLAS TO TARGET -############################################################################### -############################################################################### -macro(CUDA_ADD_CUBLAS_TO_TARGET target) - if (CUDA_BUILD_EMULATION) - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) - else() - target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) - endif() -endmacro() - -############################################################################### -############################################################################### -# CUDA BUILD CLEAN TARGET -############################################################################### -############################################################################### -macro(CUDA_BUILD_CLEAN_TARGET) - # Call this after you add all your CUDA targets, and you will get a - # convenience target. You should also make clean after running this target - # to get the build system to generate all the code again. - - set(cuda_clean_target_name clean_cuda_depends) - if (CMAKE_GENERATOR MATCHES "Visual Studio") - string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) - endif() - add_custom_target(${cuda_clean_target_name} - COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) - - # Clear out the variable, so the next time we configure it will be empty. - # This is useful so that the files won't persist in the list after targets - # have been removed. - set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") -endmacro() diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 522623c45f0945..660a4e263bc73d 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -6,13 +6,15 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3") message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3") endif() -set(OPENCV_VERSION "4.3.0") +include(vcpkg_common_functions) + +set(OPENCV_VERSION "4.1.1") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 ac22b41fffa3e3138701fa0df0d19900b3ce72e168f4478ecdc593c5c9fd004b4b1b26612d62c25b681db99a8720db7a11b5b224e576e595624965fa79b0f383 + SHA512 80fa48d992ca06a2a4ab6740df6d8c21f4926165486b393969da2c5bbe2f3a0b799fb76dee5e3654e90c743e49bbd2b5b02ad59a4766896bbf4cd5b4e3251e0f HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -22,11 +24,6 @@ vcpkg_from_github( 0009-fix-uwp.patch ) -file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") -file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") -file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released - string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) set(ADE_DIR ${CURRENT_INSTALLED_DIR}/share/ade CACHE PATH "Path to existing ADE CMake Config file") @@ -36,6 +33,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "contrib" WITH_CONTRIB "cuda" WITH_CUDA "cuda" WITH_CUBLAS + "dnn" BUILD_opencv_dnn "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "gdcm" WITH_GDCM @@ -45,39 +43,23 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "nonfree" OPENCV_ENABLE_NONFREE "openexr" WITH_OPENEXR "opengl" WITH_OPENGL + "openmp" WITH_OPENMP "png" WITH_PNG "qt" WITH_QT "sfm" BUILD_opencv_sfm "tiff" WITH_TIFF "webp" WITH_WEBP "world" BUILD_opencv_world + "gtk" WITH_GTK ) -# Cannot use vcpkg_check_features() for "dnn", ipp", "openmp", "ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. -set(BUILD_opencv_dnn OFF) -if("dnn" IN_LIST FEATURES) - if(NOT VCPKG_TARGET_IS_ANDROID) - set(BUILD_opencv_dnn ON) - else() - message(WARNING "The dnn module cannot be enabled on Android") - endif() -endif() - set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) endif() -set(WITH_OPENMP OFF) -if("openmp" IN_LIST FEATURES) - if(NOT VCPKG_TARGET_IS_OSX) - set(WITH_OPENMP ON) - else() - message(WARNING "The OpenMP feature is not supported on macOS") - endif() -endif() - set(BUILD_opencv_ovis OFF) if("ovis" IN_LIST FEATURES) set(BUILD_opencv_ovis ON) @@ -125,10 +107,8 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 cfeda06a9f86ccaedbca9521c35bf685c3d8d3a182fb943f9378a7ecd1949d6e2e9df1673f0e3e9686840ca4c9e5a8e8cf2ac962a33b6e1f88f8278abd8c37e5 + SHA512 8af13f0a5f350360316662c1ce5e58c21d906a58591acfbd575a8dacde19b6f3bbd694c3c199feb35c33549cf8c37e3fb4c494b586a00ad29fe3b4aeeb2d22ab HEAD_REF master - PATCHES - 0005-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") @@ -198,9 +178,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" - SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" + SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -209,15 +189,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" - SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" + SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" - FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" - SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" + FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" + SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -226,15 +206,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" - FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" - SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" + FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" + SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" - FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" - SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" + FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" + SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -283,20 +263,13 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= - -DOPENCV_BIN_INSTALL_PATH=bin - -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv - -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d - -DOPENCV_DLLVERSION= - -DOPENCV_DEBUG_POSTFIX=d - -DOPENCV_GENERATE_SETUPVARS=OFF # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -347,23 +320,17 @@ vcpkg_configure_cmake( ${FEATURE_OPTIONS} -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON - -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MSMF=${WITH_MSMF} - -DWITH_OPENMP=${WITH_OPENMP} -DWITH_PROTOBUF=ON -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} - -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} - -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} - ###### The following module is disabled because it's broken #https://github.com/opencv/opencv_contrib/issues/2307 - -DBUILD_opencv_rgbd=OFF ###### Additional build flags ${ADDITIONAL_BUILD_FLAGS} ) @@ -392,8 +359,6 @@ if(Protobuf_FOUND) ) endif() endif() -find_package(CUDA QUIET) -find_package(Threads QUIET) find_package(TIFF QUIET) find_package(HDF5 QUIET) find_package(Freetype QUIET) @@ -404,25 +369,15 @@ find_package(ade QUIET) find_package(VTK QUIET) find_package(OpenMP QUIET) find_package(Tesseract QUIET) -find_package(OpenEXR QUIET) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) -find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") - if(WITH_OPENMP) + if("openmp" IN_LIST FEATURES) string(REPLACE "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"" "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"\$;" OPENCV_MODULES "${OPENCV_MODULES}") endif() - if(BUILD_opencv_ovis) - string(REPLACE "OgreGLSupportStatic" - "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") - endif() - file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -430,12 +385,9 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv4.cmd) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv4.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) -if(VCPKG_TARGET_IS_ANDROID) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) -endif() - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openexr/CONTROL b/ports/openexr/CONTROL index 0a725a0424a3a9..ddf7b0fbd2be03 100644 --- a/ports/openexr/CONTROL +++ b/ports/openexr/CONTROL @@ -1,7 +1,6 @@ Source: openexr -Version: 2.5.0 -Port-Version: 1 +Version: 2.3.0-5 Homepage: https://www.openexr.com/ Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications -Build-Depends: zlib, python3 -Supports: !uwp +Build-Depends: zlib +Supports: !uwp \ No newline at end of file diff --git a/ports/openexr/FindOpenEXR.cmake b/ports/openexr/FindOpenEXR.cmake new file mode 100644 index 00000000000000..f036c742e1ffd8 --- /dev/null +++ b/ports/openexr/FindOpenEXR.cmake @@ -0,0 +1,94 @@ +include(FindPackageHandleStandardArgs) + +find_path(OpenEXR_INCLUDE_DIRS OpenEXR/OpenEXRConfig.h) +find_path(OPENEXR_INCLUDE_PATHS NAMES ImfRgbaFile.h PATH_SUFFIXES OpenEXR) + +file(STRINGS "${OpenEXR_INCLUDE_DIRS}/OpenEXR/OpenEXRConfig.h" OPENEXR_CONFIG_H) + +string(REGEX REPLACE "^.*define OPENEXR_VERSION_MAJOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MAJOR "${OPENEXR_CONFIG_H}") +string(REGEX REPLACE "^.*define OPENEXR_VERSION_MINOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MINOR "${OPENEXR_CONFIG_H}") +set(OpenEXR_LIB_SUFFIX "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}") + +include(SelectLibraryConfigurations) + +if(NOT OpenEXR_BASE_LIBRARY) + find_library(OpenEXR_BASE_LIBRARY_RELEASE NAMES IlmImf-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_BASE_LIBRARY_DEBUG NAMES IlmImf-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_BASE) +endif() + +if(NOT OpenEXR_UTIL_LIBRARY) + find_library(OpenEXR_UTIL_LIBRARY_RELEASE NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_UTIL_LIBRARY_DEBUG NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_UTIL) +endif() + +if(NOT OpenEXR_HALF_LIBRARY) + find_library(OpenEXR_HALF_LIBRARY_RELEASE NAMES Half-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_HALF_LIBRARY_DEBUG NAMES Half-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_HALF) +endif() + +if(NOT OpenEXR_IEX_LIBRARY) + find_library(OpenEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_IEX) +endif() + +if(NOT OpenEXR_MATH_LIBRARY) + find_library(OpenEXR_MATH_LIBRARY_RELEASE NAMES Imath-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_MATH_LIBRARY_DEBUG NAMES Imath-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_MATH) +endif() + +if(NOT OpenEXR_THREAD_LIBRARY) + find_library(OpenEXR_THREAD_LIBRARY_RELEASE NAMES IlmThread-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_THREAD_LIBRARY_DEBUG NAMES IlmThread-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_THREAD) +endif() + +if(NOT OpenEXR_IEXMATH_LIBRARY) + find_library(OpenEXR_IEXMATH_LIBRARY_RELEASE NAMES IexMath-${OpenEXR_LIB_SUFFIX}) + find_library(OpenEXR_IEXMATH_LIBRARY_DEBUG NAMES IexMath-${OpenEXR_LIB_SUFFIX}_d) + select_library_configurations(OpenEXR_IEXMATH) +endif() + +set(OPENEXR_HALF_LIBRARY "${OpenEXR_HALF_LIBRARY}") +set(OPENEXR_Half_LIBRARY "${OpenEXR_HALF_LIBRARY}") +set(OPENEXR_IEX_LIBRARY "${OpenEXR_IEX_LIBRARY}") +set(OPENEXR_Iex_LIBRARY "${OpenEXR_IEX_LIBRARY}") +set(OPENEXR_IMATH_LIBRARY "${OpenEXR_MATH_LIBRARY}") +set(OPENEXR_ILMIMF_LIBRARY "${OpenEXR_BASE_LIBRARY}") +set(OPENEXR_IlmImf_LIBRARY "${OpenEXR_BASE_LIBRARY}") +set(OPENEXR_ILMIMFUTIL_LIBRARY "${OpenEXR_UTIL_LIBRARY}") +set(OPENEXR_ILMTHREAD_LIBRARY "${OpenEXR_THREAD_LIBRARY}") + +set(OpenEXR_LIBRARY "${OpenEXR_BASE_LIBRARY}") + +set(OpenEXR_LIBRARIES + ${OpenEXR_LIBRARY} + ${OpenEXR_MATH_LIBRARY} + ${OpenEXR_IEXMATH_LIBRARY} + ${OpenEXR_UTIL_LIBRARY} + ${OpenEXR_HALF_LIBRARY} + ${OpenEXR_IEX_LIBRARY} + ${OpenEXR_THREAD_LIBRARY} +) + +set(OPENEXR_LIBRARIES + ${OPENEXR_HALF_LIBRARY} + ${OPENEXR_IEX_LIBRARY} + ${OPENEXR_IMATH_LIBRARY} + ${OPENEXR_ILMIMF_LIBRARY} + ${OPENEXR_ILMTHREAD_LIBRARY} +) + +set(OpenEXR_INCLUDE_DIR ${OpenEXR_INCLUDE_DIRS}) +set(OPENEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS}) +set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATHS}) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR REQUIRED_VARS OpenEXR_LIBRARIES OpenEXR_INCLUDE_DIRS) + +if(OpenEXR_FOUND) + set(OPENEXR_FOUND 1) +endif() diff --git a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch new file mode 100644 index 00000000000000..05e86b50c6e4ef --- /dev/null +++ b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch @@ -0,0 +1,13 @@ +diff --git a/IlmBase/CMakeLists.txt b/IlmBase/CMakeLists.txt +index e13c768..95942c8 100644 +--- a/IlmBase/CMakeLists.txt ++++ b/IlmBase/CMakeLists.txt +@@ -110,7 +110,7 @@ ENDIF () + + IF (OPENEXR_FORCE_CXX03) + FILE ( APPEND ${ILMBASE_TMP_CONFIG} "#define ILMBASE_FORCE_CXX03 1\n" ) +-ELSEIF (NOT WIN32) ++ELSEIF (NOT WIN32 AND NOT APPLE) + # really only care about c++11 right now for the threading bits, but this can be changed to 14 + # when needed... + # Note that the __cplusplus check is not valid under MSVC diff --git a/ports/openexr/fix_install_ilmimf.patch b/ports/openexr/fix_install_ilmimf.patch new file mode 100644 index 00000000000000..db65be73684da1 --- /dev/null +++ b/ports/openexr/fix_install_ilmimf.patch @@ -0,0 +1,19 @@ +diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt +index e1a8740..d31cf68 100644 +--- a/OpenEXR/IlmImf/CMakeLists.txt ++++ b/OpenEXR/IlmImf/CMakeLists.txt +@@ -2,14 +2,6 @@ + + SET(CMAKE_INCLUDE_CURRENT_DIR 1) + +-IF (WIN32) +- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/bin) +- SET(WORKING_DIR ${RUNTIME_DIR}) +-ELSE () +- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/lib) +- SET(WORKING_DIR .) +-ENDIF () +- + SET(BUILD_B44EXPLOGTABLE OFF) + IF (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/b44ExpLogTable.h") + SET(BUILD_B44EXPLOGTABLE ON) diff --git a/ports/openexr/fix_linux_static_library_names.patch b/ports/openexr/fix_linux_static_library_names.patch new file mode 100644 index 00000000000000..e7a41daa7ee0f2 --- /dev/null +++ b/ports/openexr/fix_linux_static_library_names.patch @@ -0,0 +1,109 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b06d97e..ad360f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,10 +53,13 @@ endif() + if (WIN32 AND OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_OPENEXR AND OPENEXR_BUILD_SHARED) + # necessary for building dwa lookup tables, and b44log tables on windows + set(BUILD_ILMBASE_STATIC ON) ++ set(OPENEXR_STATIC_SUFFIX "_s") + elseif (OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_STATIC) + set(BUILD_ILMBASE_STATIC ON) ++ set(OPENEXR_STATIC_SUFFIX "") + else() + set(BUILD_ILMBASE_STATIC OFF) ++ set(OPENEXR_STATIC_SUFFIX "") + endif() + + if (NOT OPENEXR_BUILD_SHARED) +diff --git a/IlmBase/Half/CMakeLists.txt b/IlmBase/Half/CMakeLists.txt +index 3d24cd7..d92aa67 100644 +--- a/IlmBase/Half/CMakeLists.txt ++++ b/IlmBase/Half/CMakeLists.txt +@@ -60,7 +60,7 @@ IF (BUILD_ILMBASE_STATIC) + SET_TARGET_PROPERTIES ( Half_static + PROPERTIES + VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} +- OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}_s" ++ OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + + ADD_DEPENDENCIES ( Half_static toFloat eLut ) +diff --git a/IlmBase/Iex/CMakeLists.txt b/IlmBase/Iex/CMakeLists.txt +index 847518c..9425430 100644 +--- a/IlmBase/Iex/CMakeLists.txt ++++ b/IlmBase/Iex/CMakeLists.txt +@@ -34,7 +34,7 @@ IF (BUILD_ILMBASE_STATIC) + SET_TARGET_PROPERTIES ( Iex_static + PROPERTIES + VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} +- OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}_s" ++ OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + ENDIF() + +diff --git a/IlmBase/IexMath/CMakeLists.txt b/IlmBase/IexMath/CMakeLists.txt +index 472fd33..1427fa8 100644 +--- a/IlmBase/IexMath/CMakeLists.txt ++++ b/IlmBase/IexMath/CMakeLists.txt +@@ -36,7 +36,7 @@ IF (BUILD_ILMBASE_STATIC) + SET_TARGET_PROPERTIES ( IexMath_static + PROPERTIES + VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} +- OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}_s" ++ OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + ENDIF( ) + +diff --git a/IlmBase/IlmThread/CMakeLists.txt b/IlmBase/IlmThread/CMakeLists.txt +index 3a24823..b281916 100644 +--- a/IlmBase/IlmThread/CMakeLists.txt ++++ b/IlmBase/IlmThread/CMakeLists.txt +@@ -49,7 +49,7 @@ IF (BUILD_ILMBASE_STATIC) + SET_TARGET_PROPERTIES ( IlmThread_static + PROPERTIES + VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} +- OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}_s" ++ OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + ENDIF () + +diff --git a/IlmBase/Imath/CMakeLists.txt b/IlmBase/Imath/CMakeLists.txt +index 8faa97a..bf29000 100644 +--- a/IlmBase/Imath/CMakeLists.txt ++++ b/IlmBase/Imath/CMakeLists.txt +@@ -37,7 +37,7 @@ IF (BUILD_ILMBASE_STATIC) + SET_TARGET_PROPERTIES ( Imath_static + PROPERTIES + VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} +- OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}_s" ++ OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + ENDIF () + +diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt +index d31cf68..52c2b6e 100644 +--- a/OpenEXR/IlmImf/CMakeLists.txt ++++ b/OpenEXR/IlmImf/CMakeLists.txt +@@ -226,7 +226,7 @@ IF (OPENEXR_BUILD_STATIC) + SET_TARGET_PROPERTIES ( IlmImf_static + PROPERTIES + VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} +- OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}_s" ++ OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + SET_ILMBASE_INCLUDE_DIRS(IlmImf_static) + +diff --git a/OpenEXR/IlmImfUtil/CMakeLists.txt b/OpenEXR/IlmImfUtil/CMakeLists.txt +index 4cc53de..26df90e 100644 +--- a/OpenEXR/IlmImfUtil/CMakeLists.txt ++++ b/OpenEXR/IlmImfUtil/CMakeLists.txt +@@ -60,7 +60,7 @@ IF ( OPENEXR_BUILD_STATIC ) + PROPERTIES + VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} + SOVERSION ${OPENEXR_SOVERSION} +- OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}_s" ++ OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" + ) + ENDIF() + diff --git a/ports/openexr/fixup_cmake_exports_path.patch b/ports/openexr/fixup_cmake_exports_path.patch deleted file mode 100644 index e39bd3792ff8a7..00000000000000 --- a/ports/openexr/fixup_cmake_exports_path.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt -index d9c5ae4..45ee6cc 100644 ---- a/IlmBase/config/CMakeLists.txt -+++ b/IlmBase/config/CMakeLists.txt -@@ -105,7 +105,7 @@ endif() - include(CMakePackageConfigHelpers) - configure_package_config_file(IlmBaseConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake -- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ INSTALL_DESTINATION share/ilmbase - ) - write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" - VERSION ${ILMBASE_VERSION} -@@ -113,10 +113,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" - ) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/ilmbase - ) - install(EXPORT ${PROJECT_NAME} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/ilmbase - FILE ${PROJECT_NAME}Targets.cmake - NAMESPACE ${PROJECT_NAME}:: - EXPORT_LINK_INTERFACE_LIBRARIES -diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt -index b52ad0d..3dc6d22 100644 ---- a/OpenEXR/config/CMakeLists.txt -+++ b/OpenEXR/config/CMakeLists.txt -@@ -19,7 +19,7 @@ int main() - sysconf(_SC_NPROCESSORS_ONLN); - } - " OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN --) -+) - - check_cxx_source_compiles( - " -@@ -100,7 +100,7 @@ endif() - include(CMakePackageConfigHelpers) - configure_package_config_file(OpenEXRConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake -- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ INSTALL_DESTINATION share/openexr - ) - write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" - VERSION ${OPENEXR_VERSION} -@@ -108,10 +108,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" - ) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/openexr - ) - install(EXPORT ${PROJECT_NAME} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/openexr - FILE ${PROJECT_NAME}Targets.cmake - NAMESPACE ${PROJECT_NAME}:: - EXPORT_LINK_INTERFACE_LIBRARIES -diff --git a/PyIlmBase/config/CMakeLists.txt b/PyIlmBase/config/CMakeLists.txt -index 1872c89..bc61f43 100644 ---- a/PyIlmBase/config/CMakeLists.txt -+++ b/PyIlmBase/config/CMakeLists.txt -@@ -39,10 +39,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" - COMPATIBILITY SameMajorVersion - ) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/pyilmbase - ) - install(EXPORT ${PROJECT_NAME} -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} -+ DESTINATION share/pyilmbase - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE ${PROJECT_NAME}:: - EXPORT_LINK_INTERFACE_LIBRARIES diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake index d73520cea1f9b2..31b0582ed4d780 100644 --- a/ports/openexr/portfile.cmake +++ b/ports/openexr/portfile.cmake @@ -1,49 +1,65 @@ +include(vcpkg_common_functions) + if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") message(FATAL_ERROR "UWP build not supported") endif() +set(OPENEXR_VERSION 2.3.0) +set(OPENEXR_HASH 268ae64b40d21d662f405fba97c307dad1456b7d996a447aadafd41b640ca736d4851d9544b4741a94e7b7c335fe6e9d3b16180e710671abfc0c8b2740b147b2) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openexr/openexr - REF ed64d5467dee9763f28baf300f7699e6288b9f5f - SHA512 549d37ed1ef4d1ff7e732d583f7213ee15c7f92625aea9fd65345e4c5b854902c02e5940d0692b1af5ae0a02abf46aaefea2662db2389d1b2fb4264a373baac2 + REF v${OPENEXR_VERSION} + SHA512 ${OPENEXR_HASH} HEAD_REF master PATCHES - remove_find_package_macro.patch - fixup_cmake_exports_path.patch - remove_symlinks.patch + fix_clang_not_setting_modern_cplusplus.patch + fix_install_ilmimf.patch + fix_linux_static_library_names.patch ) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENEXR_BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENEXR_BUILD_SHARED) + vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCMAKE_DEBUG_POSTFIX=_d - -DPYILMBASE_ENABLE=FALSE -) + -DOPENEXR_BUILD_PYTHON_LIBS:BOOL=FALSE + -DOPENEXR_BUILD_STATIC=${OPENEXR_BUILD_STATIC} + -DOPENEXR_BUILD_SHARED=${OPENEXR_BUILD_SHARED} + OPTIONS_DEBUG + -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}/debug + OPTIONS_RELEASE + -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/ilmbase TARGET_PATH share/ilmbase) -vcpkg_fixup_cmake_targets() - -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +# NOTE: Only use ".exe" extension on Windows executables. +# Is there a cleaner way to do this? +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(EXECUTABLE_SUFFIX ".exe") +else() + set(EXECUTABLE_SUFFIX "") +endif() +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${EXECUTABLE_SUFFIX}) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/openexr/) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${EXECUTABLE_SUFFIX}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openexr) vcpkg_copy_pdbs() @@ -52,8 +68,6 @@ if (VCPKG_CMAKE_SYSTEM_NAME OR 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) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOpenEXR.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/openexr/remove_find_package_macro.patch b/ports/openexr/remove_find_package_macro.patch deleted file mode 100644 index 967e89a83c7e3f..00000000000000 --- a/ports/openexr/remove_find_package_macro.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 111a603..109394f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -25,22 +25,12 @@ endif() - project(OpenEXRMetaProject) - - --# An "official" way to make this a super-project --# basically overrides the find_package to not find anything --# for stuff we're including locally --set(as_subproject IlmBase OpenEXR) --macro(find_package) -- if(NOT "${ARGV0}" IN_LIST as_subproject) -- _find_package(${ARGV}) -- endif() --endmacro() -- - - # If you want to use ctest to configure, build and - # upload the results, cmake has builtin support for - # submitting to CDash, or any server who speaks the - # same protocol --# -+# - # These settings will need to be set for your environment, - # and then a script such as the example in - # -@@ -51,7 +41,7 @@ endmacro() - # cmake -S cmake/SampleCTestScript.cmake - # - # [or whatever you name the file you edit] --# -+# - #set(CTEST_PROJECT_NAME "OpenEXR") - #set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC") - #set(CTEST_DROP_METHOD "http") # there are others... -diff --git a/OpenEXR/CMakeLists.txt b/OpenEXR/CMakeLists.txt -index 390b27f..87b2d01 100644 ---- a/OpenEXR/CMakeLists.txt -+++ b/OpenEXR/CMakeLists.txt -@@ -35,7 +35,6 @@ include(config/OpenEXRSetup.cmake) - - # Everyone depends on IlmBase, and we currently rely on - # the version matched with our release --find_package(IlmBase ${OPENEXR_VERSION} EXACT REQUIRED CONFIG) - - # generates config headers, package config files - add_subdirectory(config) -diff --git a/OpenEXR/config/OpenEXRSetup.cmake b/OpenEXR/config/OpenEXRSetup.cmake -index 5116726..34c7c87 100644 ---- a/OpenEXR/config/OpenEXRSetup.cmake -+++ b/OpenEXR/config/OpenEXRSetup.cmake -@@ -33,7 +33,7 @@ endif() - # Whether to build & install the various command line utility programs - option(OPENEXR_BUILD_UTILS "Enables building of utility programs" ON) - --# This is a variable here for use in controlling where include files are -+# This is a variable here for use in controlling where include files are - # installed. Care must be taken when changing this, as many things - # probably assume this is OpenEXR - set(OPENEXR_OUTPUT_SUBDIR OpenEXR CACHE STRING "Destination sub-folder of the include path for install") -diff --git a/OpenEXR_Viewers/CMakeLists.txt b/OpenEXR_Viewers/CMakeLists.txt -index 5efa353..5246fa7 100644 ---- a/OpenEXR_Viewers/CMakeLists.txt -+++ b/OpenEXR_Viewers/CMakeLists.txt -@@ -24,8 +24,6 @@ project(OpenEXR_Viewers VERSION ${OPENEXR_VIEWERS_VERSION}) - ####################################### - include(config/OpenEXRViewersSetup.cmake) - --find_package(IlmBase ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) --find_package(OpenEXR ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) - - # This is for newer cmake versions who know about vendor versions - set(OpenGL_GL_PREFERENCE GLVND) -diff --git a/PyIlmBase/CMakeLists.txt b/PyIlmBase/CMakeLists.txt -index 291b96e..7d5074f 100644 ---- a/PyIlmBase/CMakeLists.txt -+++ b/PyIlmBase/CMakeLists.txt -@@ -27,7 +27,6 @@ project(PyIlmBase VERSION ${PYILMBASE_VERSION} LANGUAGES C CXX) - include(config/PyIlmBaseSetup.cmake) - - # we have a strong dependence on IlmBase being an exact match --find_package(IlmBase ${PYILMBASE_VERSION} EXACT REQUIRED CONFIG) - - # we are building a python extension, so of course we depend on - # python as well. Except we don't know which version... diff --git a/ports/openexr/remove_symlinks.patch b/ports/openexr/remove_symlinks.patch deleted file mode 100644 index 89b9c53f3c96fc..00000000000000 --- a/ports/openexr/remove_symlinks.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/IlmBase/config/LibraryDefine.cmake b/IlmBase/config/LibraryDefine.cmake -index 44254a7..1f5d2a6 100644 ---- a/IlmBase/config/LibraryDefine.cmake -+++ b/IlmBase/config/LibraryDefine.cmake -@@ -101,15 +101,6 @@ function(ILMBASE_DEFINE_LIBRARY libname) - if(BUILD_SHARED_LIBS AND (NOT "${ILMBASE_LIB_SUFFIX}" STREQUAL "")) - set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${ILMBASE_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) -- if(WIN32) -- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") -- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") -- else() -- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") -- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_LIBDIR} ${baselibname} -> ${verlibname}\")") -- endif() -- set(verlibname) -- set(baselibname) - endif() - - if(ILMBASE_BUILD_BOTH_STATIC_SHARED) -diff --git a/OpenEXR/config/LibraryDefine.cmake b/OpenEXR/config/LibraryDefine.cmake -index a9561dc..42853af 100644 ---- a/OpenEXR/config/LibraryDefine.cmake -+++ b/OpenEXR/config/LibraryDefine.cmake -@@ -95,15 +95,6 @@ function(OPENEXR_DEFINE_LIBRARY libname) - if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "")) - set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) -- if(WIN32) -- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") -- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") -- else() -- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") -- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_DIR} ${baselibname} -> ${verlibname}\")") -- endif() -- set(verlibname) -- set(baselibname) - endif() - - if(OPENEXR_BUILD_BOTH_STATIC_SHARED) diff --git a/ports/openexr/vcpkg-cmake-wrapper.cmake b/ports/openexr/vcpkg-cmake-wrapper.cmake index 479cd302782d11..a977a420e867d7 100644 --- a/ports/openexr/vcpkg-cmake-wrapper.cmake +++ b/ports/openexr/vcpkg-cmake-wrapper.cmake @@ -1,38 +1,8 @@ -_find_package(${ARGS}) +set(OPENEXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(TARGET OpenEXR::IlmImf AND NOT OPENEXR_LIBRARIES AND NOT OPENEXR_FOUND) - set(OPENEXR_FOUND TRUE CACHE BOOL "") - set(OpenEXR_FOUND TRUE CACHE BOOL "") - set(OPENEXR_VERSION "2.5.0" CACHE STRING "") - set(OpenEXR_VERSION "2.5.0" CACHE STRING "") - get_target_property(OpenEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(OPENEXR_INCLUDE_PATHS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(OPENEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(OPENEXR_INCLUDE_DIR OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) - set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS} CACHE STRING "") - set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} CACHE STRING "") - set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIRS} CACHE STRING "") - set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR} CACHE STRING "") - set(OPENEXR_ILMIMF_LIBRARY "OpenEXR::IlmImf" CACHE STRING "") - set(OPENEXR_ILMIMFUTIL_LIBRARY "OpenEXR::IlmImfUtil" CACHE STRING "") - set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMFUTIL_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} CACHE STRING "") +if(NOT OpenEXR_LIBRARIES OR OPENEXR_LIBRARIES) + _find_package(${ARGS}) endif() -if(TARGET IlmBase::Half AND NOT ILMBASE_LIBRARIES AND NOT ILMBASE_FOUND) - set(ILMBASE_FOUND TRUE CACHE BOOL "") - set(IlmBASE_FOUND TRUE CACHE BOOL "") - set(ILMBASE_VERSION "2.5.0" CACHE STRING "") - set(IlmBASE_VERSION "2.5.0" CACHE STRING "") - get_target_property(ILMBASE_INCLUDE_DIR IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(ILMBASE_INCLUDE_DIRS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(ILMBASE_INCLUDE_PATHS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) - set(ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_DIR} CACHE STRING "") - set(ILMBASE_INCLUDE_DIRS ${ILMBASE_INCLUDE_DIRS} CACHE STRING "") - set(ILMBASE_INCLUDE_PATHS ${ILMBASE_INCLUDE_PATHS} CACHE STRING "") - set(OPENEXR_HALF_LIBRARY "IlmBase::Half" CACHE STRING "") - set(OPENEXR_IEX_LIBRARY "IlmBase::Iex" CACHE STRING "") - set(OPENEXR_IEXMATH_LIBRARY "IlmBase::IexMath" CACHE STRING "") - set(OPENEXR_ILMTHREAD_LIBRARY "IlmBase::IlmThread" CACHE STRING "") - set(OPENEXR_IMATH_LIBRARY "IlmBase::Imath" CACHE STRING "") - set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "") -endif() +set(CMAKE_MODULE_PATH ${OPENEXR_PREV_MODULE_PATH}) diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index 3612d396d1a61e..c68f5cf8aeea2b 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -1,9 +1,8 @@ Source: openimageio Version: 2.1.16.0 -Port-Version: 3 Homepage: https://github.com/OpenImageIO/oiio Description: A library for reading and writing images, and a bunch of related classes, utilities, and application -Build-Depends: libjpeg-turbo, tiff, libpng, libheif, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt +Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt Feature: libraw Build-Depends: libraw diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index f549457afbb5c6..8e3e90ef84a6fd 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -66,7 +66,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO TARGET_PATH share/OpenImageIO) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO) if ("tools" IN_LIST FEATURES) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openimageio) @@ -78,8 +78,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) +file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openimageio/vcpkg-cmake-wrapper.cmake b/ports/openimageio/vcpkg-cmake-wrapper.cmake index 688c83f3cc99d8..82dc991f066967 100644 --- a/ports/openimageio/vcpkg-cmake-wrapper.cmake +++ b/ports/openimageio/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(OPENIMAGEIO_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT OPENIMAGEIO_LIBRARIES) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${OPENIMAGEIO_PREV_MODULE_PATH}) diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index 07afd75f16236e..0fd7d64a6a0ca2 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,17 +1,4 @@ Source: openjpeg -Version: 2.3.1 -Port-Version: 2 +Version: 2.3.1-1 Homepage: https://github.com/uclouvain/openjpeg Description: JPEG 2000 image library - -Feature: jpwl -Description: Build optional component jpwl - -Feature: mj2 -Description: Build optional component mj2 - -Feature: jpip -Description: Build optional component jpip - -Feature: jp3d -Description: Build optional component jp3d diff --git a/ports/openjpeg/dll.location.patch b/ports/openjpeg/dll.location.patch deleted file mode 100644 index bdc77a5427c31d..00000000000000 --- a/ports/openjpeg/dll.location.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/src/lib/openjp3d/CMakeLists.txt b/src/lib/openjp3d/CMakeLists.txt -index b0469af1f..75048ef13 100644 ---- a/src/lib/openjp3d/CMakeLists.txt -+++ b/src/lib/openjp3d/CMakeLists.txt -@@ -34,8 +34,9 @@ endif() - # Install library - install(TARGETS ${OPENJP3D_LIBRARY_NAME} - EXPORT OpenJP3DTargets -- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} -- COMPONENT Libraries -+ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications -+ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries -+ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries - ) - - # Install includes files -diff --git a/src/lib/openmj2/CMakeLists.txt b/src/lib/openmj2/CMakeLists.txt -index 25294b20e..e3acfe8e7 100644 ---- a/src/lib/openmj2/CMakeLists.txt -+++ b/src/lib/openmj2/CMakeLists.txt -@@ -53,8 +53,9 @@ endif() - # Install library - install(TARGETS ${OPENMJ2_LIBRARY_NAME} - EXPORT OpenMJ2Targets -- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} -- COMPONENT Libraries -+ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications -+ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries -+ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries - ) - - # Install includes files diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index c6d854490fa0c5..2296734ad1c872 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -1,65 +1,27 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO uclouvain/openjpeg REF v2.3.1 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 HEAD_REF master - PATCHES dll.location.patch ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=OFF" - "-DBUILD_STATIC_LIBS=ON") -else() - list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_STATIC_LIBS=OFF") -endif() - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - "jpwl" BUILD_JPWL - "mj2" BUILD_MJ2 - "jpip" BUILD_JPIP - "jp3d" BUILD_JP3D - ) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_CODEC:BOOL=OFF - -DBUILD_DOC:BOOL=OFF -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg -DOPENJPEG_INSTALL_INCLUDE_DIR=include - -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} - -DBUILD_PKGCONFIG_FILES=ON - ${FEATURE_OPTIONS} - ${OPTIONS} ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() -if(VCPKG_TARGET_IS_WINDOWS) - # TODO: remove -lm from *.pc files -endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -set(TOOL_NAMES) -if("jpwl" IN_LIST FEATURES) - list(APPEND TOOL_NAMES opj_dec_server opj_jpwl_compress opj_jpwl_decompress) -endif() -if("mj2" IN_LIST FEATURES) - list(APPEND TOOL_NAMES opj_compress opj_decompress opj_dump opj_mj2_compress opj_mj2_decompress opj_mj2_extract opj_mj2_wrap) -endif() -if("jpip" IN_LIST FEATURES) - list(APPEND TOOL_NAMES opj_jpip_addxml opj_jpip_test opj_jpip_transcode) -endif() -if("jp3d" IN_LIST FEATURES) - list(APPEND TOOL_NAMES opj_jp3d_compress opj_jp3d_decompress) -endif() -if(TOOL_NAMES) - vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) -endif() +vcpkg_fixup_cmake_targets() + file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg.h OPENJPEG_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}") @@ -70,6 +32,7 @@ string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}") file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg.h "${OPENJPEG_H}") # Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) vcpkg_copy_pdbs() diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL index 37fe14b0ca97c2..4da1df53ed4e66 100644 --- a/ports/openmpi/CONTROL +++ b/ports/openmpi/CONTROL @@ -1,6 +1,5 @@ Source: openmpi Version: 4.0.3 -Port-Version: 2 Homepage: https://www.open-mpi.org/ Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers. Supports: !(windows|uwp) diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake index 0ef3c3c6a57cd7..6dbb01127c78ae 100644 --- a/ports/openmpi/portfile.cmake +++ b/ports/openmpi/portfile.cmake @@ -21,7 +21,6 @@ get_filename_component(PERL_PATH ${PERL} DIRECTORY) vcpkg_add_to_path(${PERL_PATH}) vcpkg_configure_make( - COPY_SOURCE SOURCE_PATH ${SOURCE_PATH} OPTIONS --with-hwloc=internal diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt index c7d7cc32ab8c17..7857058f0a0dd2 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -15,12 +15,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(PLATFORM darwin64-x86_64-cc) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(PLATFORM BSD-generic64) -elseif(MINGW) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(PLATFORM mingw64) - else() - set(PLATFORM mingw) - endif() else() message(FATAL_ERROR "Unknown platform") endif() @@ -82,15 +76,10 @@ if(BUILD_SHARED_LIBS) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(LIB_EXT dylib) set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT}) - elseif(MINGW) - string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}") - set(BIN_EXT dll) - set(LIB_EXT dll.a) else() set(LIB_EXT so) set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION}) endif() - list(APPEND BIN_EXTS ${BIN_EXT}) list(APPEND LIB_EXTS ${LIB_EXT}) else() set(SHARED no-shared) @@ -100,14 +89,6 @@ foreach(lib ssl crypto) foreach(ext ${LIB_EXTS}) list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}") endforeach() - foreach(ext ${BIN_EXTS}) - # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}") - else() - list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}") - endif() - endforeach() endforeach() if(CMAKE_HOST_WIN32) @@ -161,7 +142,3 @@ install( FILES ${INSTALL_LIBS} DESTINATION lib ) -install( - FILES ${INSTALL_BINS} - DESTINATION bin -) \ No newline at end of file diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index 01fa5f3f6e8711..a28775cc22e7a5 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,5 +1,4 @@ Source: openssl-unix Version: 1.1.1g -Port-Version: 1 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. Supports: !(windows|uwp) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index 5dd28a6f2c77fd..633cef70d2a2d0 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -1,6 +1,4 @@ -if (NOT VCPKG_TARGET_IS_MINGW) - vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") -endif() +vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL index e70ab221cb2bc9..e9ea27a427846b 100644 --- a/ports/openssl-windows/CONTROL +++ b/ports/openssl-windows/CONTROL @@ -1,5 +1,4 @@ Source: openssl-windows Version: 1.1.1g -Port-Version: 1 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. Supports: windows diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index a4735d1fce9ee4..a802c84c509a8c 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -1,9 +1,9 @@ vcpkg_fail_port_install(MESSAGE "${PORT} is only for Windows Desktop" ON_TARGET "UWP" "Linux" "OSX") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + return() endif() vcpkg_find_acquire_program(PERL) @@ -20,8 +20,8 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} ) vcpkg_find_acquire_program(NASM) @@ -32,10 +32,10 @@ vcpkg_find_acquire_program(JOM) set(OPENSSL_SHARED no-shared) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPENSSL_SHARED shared) + set(OPENSSL_SHARED shared) endif() -set(CONFIGURE_OPTIONS +set(CONFIGURE_COMMAND ${PERL} Configure enable-static-engine enable-capieng no-ssl2 @@ -44,12 +44,6 @@ set(CONFIGURE_OPTIONS ${OPENSSL_SHARED} ) -if(DEFINED OPENSSL_USE_NOPINSHARED) - set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) -endif() - -set(CONFIGURE_COMMAND ${PERL} Configure ${CONFIGURE_OPTIONS}) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(OPENSSL_ARCH VC-WIN32) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") @@ -176,15 +170,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) endif() -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" - "" - "" -) +file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) +string(REPLACE "" "" _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" - "# include " - "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " -) +file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) +string(REPLACE "# include " "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " _contents "${_contents}") +file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") vcpkg_copy_pdbs() diff --git a/ports/orocos-kdl/CONTROL b/ports/orocos-kdl/CONTROL index 1270962d769369..edef89076a3e9c 100644 --- a/ports/orocos-kdl/CONTROL +++ b/ports/orocos-kdl/CONTROL @@ -1,6 +1,5 @@ Source: orocos-kdl -Version: 1.4 -Port-Version: 3 +Version: 1.4-2 Homepage: https://github.com/orocos/orocos_kinematics_dynamics Description: Kinematics and Dynamics Library Build-Depends: eigen3 diff --git a/ports/orocos-kdl/portfile.cmake b/ports/orocos-kdl/portfile.cmake index 8044d3ee9d4af7..f0549d14522524 100644 --- a/ports/orocos-kdl/portfile.cmake +++ b/ports/orocos-kdl/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO orocos/orocos_kinematics_dynamics @@ -18,11 +20,6 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/orocos_kdl/cmake TARGET_PATH share/orocos_kdl) -file(READ ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake _contents) -string(REPLACE "\${CMAKE_CURRENT_LIST_DIR}/../../.." "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") -string(REPLACE "\${_IMPORT_PREFIX}" "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake "${_contents}") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index 6a7d856da9c853..598ec59b1cd107 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -1,5 +1,5 @@ Source: osg -Version: 3.6.5 +Version: 3.6.4-3 Homepage: https://github.com/openscenegraph/OpenSceneGraph Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. Build-Depends: zlib, fontconfig, boost-asio (!windows), boost-core (!windows), boost-logic (!windows), boost-lexical-cast (!windows), boost-smart-ptr (!windows), boost-tuple (!windows), boost-bind (!windows), freeglut (windows), expat (windows), openimageio (osx) @@ -24,4 +24,4 @@ Feature: packages Description: Set to ON to generate CPack configuration files and packaging targets Feature: docs -Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads +Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads \ No newline at end of file diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index 332359122441ba..d8c8a846532ac3 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -1,10 +1,10 @@ -set(OSG_VER 3.6.5) +set(OSG_VER 3.6.4) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openscenegraph/OpenSceneGraph REF OpenSceneGraph-${OSG_VER} - SHA512 7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b + SHA512 7cb34fc279ba62a7d7177d3f065f845c28255688bd29026ffb305346e1bb2e515a22144df233e8a7246ed392044ee3e8b74e51bf655282d33ab27dcaf12f4b19 HEAD_REF master PATCHES collada.patch diff --git a/ports/osg/remove-prefix.patch b/ports/osg/remove-prefix.patch index ced94522cdb579..62b1466c961328 100644 --- a/ports/osg/remove-prefix.patch +++ b/ports/osg/remove-prefix.patch @@ -11,6 +11,15 @@ index bb3be63..356edcd 100644 HANDLE_MSVC_DLL() ENDIF() +@@ -33,7 +33,7 @@ INSTALL( + ) + + IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) +- GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) ++ set(PREFIX "") + INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) + ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) diff --git a/src/OpenThreads/win32/CMakeLists.txt b/src/OpenThreads/win32/CMakeLists.txt index 84550bd..0e816f7 100644 --- a/src/OpenThreads/win32/CMakeLists.txt diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 3585c467e3f041..74f1c5875af302 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,5 +1,4 @@ Source: osgearth -Version: 3.0 -Homepage: https://github.com/gwaldron/osgearth +Version: 2.10.2-1 Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. Build-Depends: osg[plugins] diff --git a/ports/osgearth/RocksDB.patch b/ports/osgearth/RocksDB.patch index c73cdad19b869d..07fd7e6031a11e 100644 --- a/ports/osgearth/RocksDB.patch +++ b/ports/osgearth/RocksDB.patch @@ -1,79 +1,84 @@ -diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake -index b0692b0..984d3f2 100644 ---- a/CMakeModules/FindRocksDB.cmake -+++ b/CMakeModules/FindRocksDB.cmake -@@ -39,5 +39,49 @@ find_package_handle_standard_args(ROCKSDB - "Could NOT find ROCKSDB" - ) - -+if(ROCKSDB_FOUND) -+ FIND_PACKAGE(ZLIB REQUIRED) -+ -+ include(SelectLibraryConfigurations) -+ # Find Snappy library -+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) -+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) -+ select_library_configurations(SNAPPY) -+ find_package_handle_standard_args(SNAPPY -+ FOUND_VAR -+ SNAPPY_FOUND -+ REQUIRED_VARS -+ SNAPPY_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find SNAPPY" -+ ) -+ -+ # Find LZ4 library -+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) -+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) -+ select_library_configurations(LZ4) -+ find_package_handle_standard_args(LZ4 -+ FOUND_VAR -+ LZ4_FOUND -+ REQUIRED_VARS -+ LZ4_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find LZ4" -+ ) -+ -+ # Find ZSTD library -+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) -+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) -+ select_library_configurations(ZSTD) -+ find_package_handle_standard_args(ZSTD -+ FOUND_VAR -+ ZSTD_FOUND -+ REQUIRED_VARS -+ ZSTD_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find ZSTD_" -+ ) -+endif(ROCKSDB_FOUND) -+ - set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) - set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) -diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -index ecaac34..b4ec764 100644 ---- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -@@ -34,7 +34,19 @@ IF(ROCKSDB_FOUND OR RocksDB_FOUND) - RocksDBCacheDriver.cpp - ) - -- SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) -+ if(SNAPPY_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) -+ endif(SNAPPY_FOUND) -+ -+ if(LZ4_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) -+ endif(LZ4_FOUND) -+ -+ if(ZSTD_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) -+ endif(ZSTD_FOUND) -+ -+ SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) - - IF(MSVC) - SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) +diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake +index 109b383..8382ed9 100644 +--- a/CMakeModules/FindRocksDB.cmake ++++ b/CMakeModules/FindRocksDB.cmake +@@ -40,5 +40,49 @@ find_package_handle_standard_args(ROCKSDB + "Could NOT find ROCKSDB" + ) + ++if(ROCKSDB_FOUND) ++ FIND_PACKAGE(ZLIB REQUIRED) ++ ++ include(SelectLibraryConfigurations) ++ # Find Snappy library ++ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) ++ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) ++ select_library_configurations(SNAPPY) ++ find_package_handle_standard_args(SNAPPY ++ FOUND_VAR ++ SNAPPY_FOUND ++ REQUIRED_VARS ++ SNAPPY_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find SNAPPY" ++ ) ++ ++ # Find LZ4 library ++ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) ++ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) ++ select_library_configurations(LZ4) ++ find_package_handle_standard_args(LZ4 ++ FOUND_VAR ++ LZ4_FOUND ++ REQUIRED_VARS ++ LZ4_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find LZ4" ++ ) ++ ++ # Find ZSTD library ++ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) ++ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) ++ select_library_configurations(ZSTD) ++ find_package_handle_standard_args(ZSTD ++ FOUND_VAR ++ ZSTD_FOUND ++ REQUIRED_VARS ++ ZSTD_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find ZSTD_" ++ ) ++endif(ROCKSDB_FOUND) ++ + set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) + set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) +- +- + +diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +index 68ad85d..86bb18a 100644 +--- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt ++++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +@@ -16,7 +16,19 @@ SET(TARGET_SRC + RocksDBCacheDriver.cpp + ) + +-SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) ++if(SNAPPY_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) ++endif(SNAPPY_FOUND) ++ ++if(LZ4_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) ++endif(LZ4_FOUND) ++ ++if(ZSTD_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) ++endif(ZSTD_FOUND) ++ ++SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) + + IF(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) +- +- \ No newline at end of file diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 3be639cb46b314..8f74dea63c421c 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) file(GLOB OSG_PLUGINS_SUBDIR ${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*) @@ -10,11 +12,11 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OS vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gwaldron/osgearth - REF 90ad04f281cbc87ffc45bed847ebaaecb188e593 #version 3.0 - SHA512 d1d59ae65cb4ef8a71e01b42411029e61bef20e2fd6d95b81c091d7d32b8c30f96d3156d7fd28e177ca83fd74ed113b9e31bf5ef360757524beb7cec7ced4996 + REF osgearth-2.10.2 + SHA512 fa306a82374716dafae9d834ed0fb07a7369ae0961696de36b6e2af45bc150040295985d9b9781ab713fd0707691451a6a8f173b34253749ab22764f51e60045 HEAD_REF master PATCHES - RocksDB.patch + RocksDB.patch ) vcpkg_configure_cmake( @@ -25,7 +27,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() #Release -set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT}) +set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/osgearth) set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH}) @@ -43,7 +45,7 @@ file(REMOVE_RECURSE ${OSGDB_PLUGINS}) #Debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) +set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/osgearth) set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH}) @@ -60,4 +62,5 @@ file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osgearth) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/osgearth/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osgearth/copyright) diff --git a/ports/outcome/CONTROL b/ports/outcome/CONTROL index 449485ed9611fc..a90346b67e6d8e 100644 --- a/ports/outcome/CONTROL +++ b/ports/outcome/CONTROL @@ -1,4 +1,4 @@ Source: outcome -Version: 2.1.3 +Version: 2.1 Homepage: https://github.com/ned14/outcome -Description: Provides very lightweight outcome and result (non-Boost edition) +Description: Provides very lightweight outcome and result (non-Boost edition) \ No newline at end of file diff --git a/ports/outcome/portfile.cmake b/ports/outcome/portfile.cmake index 0d1223fc74a3d4..a9686b31c1e8f1 100644 --- a/ports/outcome/portfile.cmake +++ b/ports/outcome/portfile.cmake @@ -1,13 +1,16 @@ -# header-only library +# single header file + +include(vcpkg_common_functions) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ned14/outcome - REF 34f3bd55e2bcaf246cb79efe64a5600e89b91b66 #v2.1.3 - SHA512 83eba50e2095e7c768dacb3af5f82db117c3451f1d5bc2f73d716608d56f7b73006ec33d0f3842fdefd076f0e82b72ece5777868712f75e83eac93aa8adf351c + REF 525478ed519d7c3400d60110649c315d705a07ad #v2.1 + SHA512 cf05f7c09ced02fa5fe3d9ad6533358a2fb63e31b5d5be81c16c285250cd275467217b8f9364b4ff1947d8c4aa6a86e10cef310d8475dcd9f7a0a713f1a01c8e HEAD_REF develop ) file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") -file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt index 127b92319c7dce..5fdd730ba79ee4 100644 --- a/ports/pango/CMakeLists.txt +++ b/ports/pango/CMakeLists.txt @@ -49,7 +49,11 @@ find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARY fontconfig) # find freetype -find_package(Freetype REQUIRED) +find_path(FREETYPE_INCLUDE_DIR ft2build.h) +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(FT_SUFFIX d) +endif() +find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) # find harfbuzz find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) @@ -61,7 +65,7 @@ if (APPLE) endif() set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) -set(FONT_LIBRARIES Freetype::Freetype ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) +set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) macro(pango_add_module MODULE_NAME) add_library(${MODULE_NAME} ${ARGN}) diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL index cea8f146423d8e..2e1d6679e44832 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -1,6 +1,5 @@ Source: pango -Version: 1.40.11 -Port-Version: 8 +Version: 1.40.11-7 Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ Description: Text and font handling library. Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/pangolin/CONTROL b/ports/pangolin/CONTROL index 8fb88660e8de8b..8963cc26bbe352 100644 --- a/ports/pangolin/CONTROL +++ b/ports/pangolin/CONTROL @@ -1,7 +1,5 @@ Source: pangolin -Version: 0.5 -Port-Version: 9 +Version: 0.5-7 Build-Depends: eigen3, glew, libpng, libjpeg-turbo, ffmpeg Homepage: https://github.com/stevenlovegrove/Pangolin Description: Lightweight GUI Library -Supports: !uwp & !osx & !(windows&static) diff --git a/ports/pangolin/fix-dependency-python.patch b/ports/pangolin/fix-dependency-python.patch deleted file mode 100644 index 67eae1288cf54a..00000000000000 --- a/ports/pangolin/fix-dependency-python.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 7f364a7..9e0baac 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -213,6 +213,9 @@ endif() - find_package(PythonLibs QUIET) - if(BUILD_PANGOLIN_GUI AND BUILD_PANGOLIN_VARS AND PYTHONLIBS_FOUND AND NOT _WIN_) - set(HAVE_PYTHON 1) -+ if (UNIX) -+ set(PYTHON_LIBRARY ${PYTHON_LIBRARY} dl util) -+ endif() - list(APPEND HEADERS - ${INCDIR}/console/ConsoleInterpreter.h - ${INCDIR}/console/ConsoleView.h diff --git a/ports/pangolin/fix-dependeny-ffmpeg.patch b/ports/pangolin/fix-dependeny-ffmpeg.patch deleted file mode 100644 index 2c52bb710c3755..00000000000000 --- a/ports/pangolin/fix-dependeny-ffmpeg.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/CMakeModules/FindFFMPEG.cmake b/CMakeModules/FindFFMPEG.cmake -index 4f77e5a..151762f 100644 ---- a/CMakeModules/FindFFMPEG.cmake -+++ b/CMakeModules/FindFFMPEG.cmake -@@ -21,6 +21,14 @@ FIND_PATH( - SWSCALE_INCLUDE_DIR libswscale/swscale.h - /usr/include /usr/local/include /opt/local/include - ) -+FIND_PATH( -+ AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h -+ /usr/include /usr/local/include /opt/local/include -+) -+FIND_PATH( -+ SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h -+ /usr/include /usr/local/include /opt/local/include -+) - - # Find Library files - FIND_LIBRARY( -@@ -43,15 +51,28 @@ FIND_LIBRARY( - NAMES swscale - PATH /usr/lib /usr/local/lib /opt/local/lib - ) -+FIND_LIBRARY( -+ AVDEVICE_LIBRARY -+ NAMES avdevice -+ PATH /usr/lib /usr/local/lib /opt/local/lib -+) -+FIND_LIBRARY( -+ SWRESAMPLE_LIBRARY -+ NAMES swresample -+ PATH /usr/lib /usr/local/lib /opt/local/lib -+) - - IF( EXISTS "${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" ) - SET( AVUTIL_HAVE_PIXDESC TRUE) - endif() - - IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC) -+ IF (WIN32) -+ SET(AVFORMAT_LIBRARY ${AVFORMAT_LIBRARY} Ws2_32 Secur32 Bcrypt) -+ ENDIF() - SET(FFMPEG_FOUND TRUE) -- SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY}) -- SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR}) -+ SET(FFMPEG_LIBRARIES ${AVFORMAT_LIBRARY} ${AVDEVICE_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} ${SWRESAMPLE_LIBRARY}) -+ SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR}) - - include(CheckCXXSourceCompiles) - diff --git a/ports/pangolin/portfile.cmake b/ports/pangolin/portfile.cmake index 4f48fc1c66beca..e22672ec00dd55 100644 --- a/ports/pangolin/portfile.cmake +++ b/ports/pangolin/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -9,8 +11,6 @@ vcpkg_from_github( PATCHES deprecated_constants.patch # Change from upstream pangolin to address build failures from latest ffmpeg library fix-includepath-error.patch # include path has one more ../ - fix-dependeny-ffmpeg.patch - fix-dependency-python.patch ) file(REMOVE ${SOURCE_PATH}/CMakeModules/FindGLEW.cmake) @@ -33,9 +33,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Pangolin) vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(GLOB EXE ${CURRENT_PACKAGES_DIR}/lib/*.dll) file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE ${EXE}) @@ -44,17 +42,21 @@ if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${DEBUG_EXE}) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake - "lib/pangolin.dll" "bin/pangolin.dll" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake - "lib/pangolin.dll" "bin/pangolin.dll" - ) - - # Copy missing header file - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) + file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake PANGOLIN_TARGETS) + string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake "${PANGOLIN_TARGETS}") + + file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake PANGOLIN_TARGETS) + string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake "${PANGOLIN_TARGETS}") endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Copy missing header file +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) + # Put the license file where vcpkg expects it -file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/) -file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) +file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/Pangolin/LICENCE ${CURRENT_PACKAGES_DIR}/share/Pangolin/copyright) diff --git a/ports/paraview/CONTROL b/ports/paraview/CONTROL index d40b55adc6282a..56aa3cbaadfa49 100644 --- a/ports/paraview/CONTROL +++ b/ports/paraview/CONTROL @@ -1,9 +1,8 @@ Source: paraview -Version: 5.8.0 -Port-Version: 3 +Version: 5.8.0-2 Homepage: https://www.paraview.org/ Description: VTK-based Data Analysis and Visualization Application -Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm +Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm, embree3(linux) Feature: vtkm Description: enables vtkm for the build of paraview diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index ab64ef34af2c8f..84f1d1aab2cc53 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -1,5 +1,9 @@ set(VERSION 5.8) +if ("tools" IN_LIST FEATURES AND VCPKG_TARGET_IS_OSX) + mesage(FATAL_ERROR "Feature tools are currently not supported.") +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" PARAVIEW_USE_CUDA #untested; probably only affects internal VTK build so it does nothing here "all_modules" PARAVIEW_BUILD_ALL_MODULES #untested @@ -61,9 +65,13 @@ if("python" IN_LIST FEATURES) -DPython3_FIND_REGISTRY=NEVER "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature ) + #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages endif() +string(APPEND VCPKG_C_FLAGS " -DH5_USE_110_API") +string(APPEND VCPKG_CXX_FLAGS " -DH5_USE_110_API") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja @@ -74,15 +82,15 @@ vcpkg_configure_cmake( -DVTK_MODULE_ENABLE_ParaView_qttesting=YES -DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF -DPARAVIEW_USE_QTHELP:BOOL=OFF - + #A little bit of help in finding the boost headers "-DBoost_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include" - + # Workarounds for CMake issues -DHAVE_SYS_TYPES_H=0 ## For some strange reason the test first succeeds and then fails the second time around -DWORDS_BIGENDIAN=0 ## Tests fails in VisItCommon.cmake for some unknown reason this is just a workaround since most systems are little endian. ${ADDITIONAL_OPTIONS} - + #-DPARAVIEW_ENABLE_FFMPEG:BOOL=OFF ) if(CMAKE_HOST_UNIX) @@ -112,7 +120,7 @@ set(TOOLS paraview smTestDriver vtkProcessXML vtkWrapClientServer) - + foreach(tool ${TOOLS}) # Remove debug tools set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL index e7f0cc3c06c3e1..1577832fd66730 100644 --- a/ports/pbc/CONTROL +++ b/ports/pbc/CONTROL @@ -1,7 +1,6 @@ Source: pbc -Version: 0.5.14 -Port-Version: 4 -Build-Depends: mpir (windows), gmp (!windows) +Version: 0.5.14-2 +Build-Depends: mpir (windows) Homepage: https://crypto.stanford.edu/pbc Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems. -Supports: !uwp +Supports: !uwp \ No newline at end of file diff --git a/ports/pbc/portfile.cmake b/ports/pbc/portfile.cmake index 93b06c5dbe090f..3f47fa56ea3fde 100644 --- a/ports/pbc/portfile.cmake +++ b/ports/pbc/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP") set(PBC_VERSION 0.5.14) -if(NOT VCPKG_TARGET_IS_WINDOWS) +if(VCPKG_CMAKE_SYSTEM_NAME) vcpkg_download_distfile( ARCHIVE URLS "https://crypto.stanford.edu/pbc/files/pbc-${PBC_VERSION}.tar.gz" @@ -27,16 +27,45 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) endif() set(OPTIONS ${SHARED_STATIC} LEX=${FLEX} YACC=${BISON}\ -y) + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/setup + WORKING_DIRECTORY ${SOURCE_PATH} + LOGNAME setup-${TARGET_TRIPLET} + ) - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG - COPY_SOURCE - OPTIONS - ${OPTIONS} + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g -I${SOURCE_PATH}/include") + set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME configure-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Building ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME install-${TARGET_TRIPLET}-dbg ) - vcpkg_install_make() + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O3 -I${SOURCE_PATH}/include") + set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + vcpkg_execute_required_process( + COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME configure-${TARGET_TRIPLET}-rel + ) + message(STATUS "Building ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND make -j install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME install-${TARGET_TRIPLET}-rel + ) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index cbd70b86927bb0..a36dec4e8298a5 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,5 +1,5 @@ Source: pcre Version: 8.44 -Port-Version: 7 +Port-Version: 5 Homepage: https://www.pcre.org/ Description: Perl Compatible Regular Expressions diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 6175b0bbb1f43c..fe989d66013df8 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -73,46 +73,44 @@ if(VCPKG_TARGET_IS_LINUX) # Used here in .pc.in files: Libs.private: @PTHREAD_CFLAGS@ set(PTHREAD_CFLAGS "-pthread") endif() -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - - configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) -endif() + +configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) + # debug set(prefix "${CURRENT_INSTALLED_DIR}/debug") set(exec_prefix "\${prefix}") set(libdir "\${prefix}/lib") set(includedir "\${prefix}/../include") -if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) - configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) - if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc - "-lpcre" "-lpcred" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc - "-lpcre16" "-lpcre16d" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc - "-lpcre32" "-lpcre32d" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc - "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" - ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc - "-lpcreposix" "-lpcreposixd" - ) - endif() +configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) +configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) + +if(VCPKG_TARGET_IS_WINDOWS) + file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc LIBPCRE.PC) + string(REPLACE "-lpcre" "-lpcred" LIBPCRE.PC ${LIBPCRE.PC}) + file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc ${LIBPCRE.PC}) + file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc LIBPCRE16.PC) + string(REPLACE "-lpcre16" "-lpcre16d" LIBPCRE16.PC ${LIBPCRE16.PC}) + file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc ${LIBPCRE16.PC}) + file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc LIBPCRE32.PC) + string(REPLACE "-lpcre32" "-lpcre32d" LIBPCRE32.PC ${LIBPCRE32.PC}) + file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc ${LIBPCRE32.PC}) + file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc LIBPCRECPP.PC) + string(REPLACE "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" LIBPCRECPP.PC ${LIBPCRECPP.PC}) + file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc ${LIBPCRECPP.PC}) + file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc LIBPCREPOSIX.PC) + string(REPLACE "-lpcreposix" "-lpcreposixd" LIBPCREPOSIX.PC ${LIBPCREPOSIX.PC}) + file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc ${LIBPCREPOSIX.PC}) endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread) +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/physx/CONTROL b/ports/physx/CONTROL index 7b8c12c2a8db7f..c744a2ae36c38d 100644 --- a/ports/physx/CONTROL +++ b/ports/physx/CONTROL @@ -1,5 +1,4 @@ Source: physx -Version: 4.1.1 -Port-Version: 5 +Version: 4.1.1-3 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 Supports: !uwp diff --git a/ports/physx/internalMBP_symbols.patch b/ports/physx/internalMBP_symbols.patch deleted file mode 100644 index a74e2eaab79199..00000000000000 --- a/ports/physx/internalMBP_symbols.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp -index f19ba271..51580049 100644 ---- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp -+++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp -@@ -90,6 +90,8 @@ using namespace Cm; - return ir; - }*/ - -+namespace internalMBP { -+ - struct RegionHandle : public Ps::UserAllocated - { - PxU16 mHandle; // Handle from region -@@ -582,6 +584,10 @@ struct RegionData : public Ps::UserAllocated - #endif - #endif - -+} -+ -+using namespace internalMBP; -+ - /////////////////////////////////////////////////////////////////////////////// - - MBP_PairManager::MBP_PairManager() : -diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h -index cf15f6d3..90f43e47 100644 ---- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h -+++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h -@@ -35,8 +35,10 @@ - #include "BpBroadPhaseMBPCommon.h" - #include "BpMBPTasks.h" - -+namespace internalMBP { - class MBP; -- -+} -+ - namespace physx - { - namespace Bp -@@ -84,7 +86,7 @@ namespace Bp - MBPUpdateWorkTask mMBPUpdateWorkTask; - MBPPostUpdateWorkTask mMBPPostUpdateWorkTask; - -- MBP* mMBP; // PT: TODO: aggregate -+ internalMBP::MBP* mMBP; // PT: TODO: aggregate - - MBP_Handle* mMapping; - PxU32 mCapacity; diff --git a/ports/physx/portfile.cmake b/ports/physx/portfile.cmake index 2dcb5bdc1e0d36..c77b18773dc178 100644 --- a/ports/physx/portfile.cmake +++ b/ports/physx/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(SYSTEM_PLATFORM "32") set(SYSTEM_PLATFORM_PATH "x86_32") @@ -11,30 +13,30 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(SYSTEM_PLATFORM "arm64") set(SYSTEM_PLATFORM_PATH "arm_64") else() - message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(GENERATE_STATIC_LIBRARIES "True") elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(GENERATE_STATIC_LIBRARIES "False") + set(GENERATE_STATIC_LIBRARIES "False") endif() -if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) +if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(MSBUILD_PLATFORM "Win32") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(MSBUILD_PLATFORM "x64") - elseif(VCPKG_TARGET_IS_UWP) + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") set(MSBUILD_PLATFORM "ARM") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(MSBUILD_PLATFORM "ARM64") else() - message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() else() - message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140") @@ -54,7 +56,7 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) set(BUILD_SNIPPETS "False") set(BUILD_PUBLIC_SAMPLES "False") - if(VCPKG_TARGET_IS_WINDOWS) + if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "") set(SYSTEM "win") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") set(USE_STATIC_WINCRT "False") @@ -67,7 +69,7 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) set(COMPILER "vc${MSVC_VERSION}${SYSTEM}${SYSTEM_PLATFORM}") set(PRESET_FILE ${COMPILER}-${RUNTIME_LIBRARY_LINKAGE}-${VCPKG_LIBRARY_LINKAGE}) set(BUILD_PATH "${SYSTEM}.${SYSTEM_PLATFORM_PATH}.vc${TOOLSET_VERSION}.${RUNTIME_LIBRARY_LINKAGE}") - elseif(VCPKG_TARGET_IS_UWP) + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(SYSTEM "uwp") set(USE_STATIC_WINCRT "False") set(USE_DEBUG_CRT "False") @@ -85,10 +87,9 @@ vcpkg_from_github( REF ae80dede0546d652040ae6260a810e53e20a06fa SHA512 f3a690039cf39fe2db9a728b82af0d39eaa02340a853bdad4b5152d63532367eb24fc7033a614882168049b80d803b6225fc60ed2900a9d0deab847f220540be HEAD_REF master - PATCHES - internalMBP_symbols.patch - msvc_142_bug_workaround.patch - vs16_3_typeinfo_header_fix.patch + PATCHES + msvc_142_bug_workaround.patch + vs16_3_typeinfo_header_fix.patch ) file(REMOVE ${SOURCE_PATH}/physx/buildtools/presets/public/${PRESET_FILE}.xml) @@ -109,16 +110,14 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET} ) -if(NOT DEFINED RELEASE_CONFIGURATION) - set(RELEASE_CONFIGURATION "release") -endif() +set(RELEASE_CONFIGURATION "release") set(DEBUG_CONFIGURATION "debug") vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln + PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} - PLATFORM ${MSBUILD_PLATFORM} + PLATFORM ${MSBUILD_PLATFORM} ) file(INSTALL ${SOURCE_PATH}/physx/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}/) @@ -137,9 +136,9 @@ endif() file( GLOB RELEASE_LIBS - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb - ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb ) file(INSTALL ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) diff --git a/ports/pngpp/portfile.cmake b/ports/pngpp/portfile.cmake deleted file mode 100644 index 1fa23e4445ab07..00000000000000 --- a/ports/pngpp/portfile.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# Header only library -vcpkg_download_distfile(ARCHIVE - URLS "http://download.savannah.nongnu.org/releases/pngpp/png++-0.2.10.tar.gz" - FILENAME "png++-0.2.10.tar.gz" - SHA512 c54a74c0c20212bd0dcf86386c0c11dd824ad14952917ba0ff4c184b6547744458728a4f06018371acb7d5b842b641708914ccaa81bad8e72e173903f494ca85 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} -) - -file(GLOB HEADER_FILES ${SOURCE_PATH}/*.hpp) -file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/png++) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pngpp/vcpkg.json b/ports/pngpp/vcpkg.json deleted file mode 100644 index 67312ef2f9f1dd..00000000000000 --- a/ports/pngpp/vcpkg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "pngpp", - "version-string": "0.2.10", - "description": "A C++ wrapper for libpng library.", - "dependencies": [ - "libpng" - ] -} diff --git a/ports/podofo/CONTROL b/ports/podofo/CONTROL index 933f7363fc410d..a6965d832de761 100644 --- a/ports/podofo/CONTROL +++ b/ports/podofo/CONTROL @@ -1,6 +1,5 @@ Source: podofo -Version: 0.9.6 -Port-Version: 12 +Version: 0.9.6-11 Homepage: https://sourceforge.net/projects/podofo/ Description: PoDoFo is a library to work with the PDF file format Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openssl, freetype diff --git a/ports/podofo/freetype.patch b/ports/podofo/freetype.patch deleted file mode 100644 index f241690f719136..00000000000000 --- a/ports/podofo/freetype.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/cmake/modules/FindFREETYPE.cmake b/cmake/modules/FindFREETYPE.cmake -index 41114798f..0911dc092 100644 ---- a/cmake/modules/FindFREETYPE.cmake -+++ b/cmake/modules/FindFREETYPE.cmake -@@ -15,9 +15,13 @@ SET(FREETYPE_FIND_QUIETLY 1) - # first we try to find ft2build.h in the new location as - # of freetype 2.5.1 - FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h -+ PATHS - /usr/include/freetype2 - /usr/local/include/freetype2 - /usr/X11/include/freetype2 -+ PATH_SUFFIXES -+ freetype2 -+ include/freetype2 - NO_CMAKE_SYSTEM_PATH - ) - diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake index 36bd2c48e4cd50..d9b34614a8c2e6 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -13,7 +13,6 @@ vcpkg_from_sourceforge( PATCHES 0001-unique_ptr.patch 0002-HAVE_UNISTD_H.patch - freetype.patch ${ADDITIONAL_PATCH} ) diff --git a/ports/polyhook2/CONTROL b/ports/polyhook2/CONTROL index 924ea7e2a5f38b..d867d5ebaa666e 100644 --- a/ports/polyhook2/CONTROL +++ b/ports/polyhook2/CONTROL @@ -1,5 +1,5 @@ Source: polyhook2 -Version: 2020-08-04 +Version: 2020-07-01 Homepage: https://github.com/stevemk14ebr/PolyHook_2_0 Description: C++17, x86/x64 Hooking Libary v2.0 Supports: !(arm|uwp|linux|osx) diff --git a/ports/polyhook2/portfile.cmake b/ports/polyhook2/portfile.cmake index 267945d2046cb1..93e1ead79a6c22 100644 --- a/ports/polyhook2/portfile.cmake +++ b/ports/polyhook2/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "Linux" "OSX" "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stevemk14ebr/PolyHook_2_0 - REF 69fa86df9ae125617ac660b2d6ae2920c69194d9 - SHA512 822c6f07106b5264ab0fe6608875e18ff85572e4316f9bf90be9c68a2c0ed2c4a8f1d1b9fd497d8adf8420c1c9cc34ff46f2e8848f128e37491a86212ed14dc9 + REF d8d0eb9b0932783f7d6be2d96e4d2c8adbf08c4b + SHA512 4e08614818dac648596118c62c38b36f88b39bd7c299cdbb44604249b3d7201541dcb64e926e3f5a92327603342f8393e4c7c84feda37e9f4250a5bf06ab2473 HEAD_REF master ) diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL index ef83912c6408fc..523e449a1e018e 100644 --- a/ports/proj4/CONTROL +++ b/ports/proj4/CONTROL @@ -1,6 +1,5 @@ Source: proj4 -Version: 6.3.1 -Port-Version: 2 +Version: 6.3.1-1 Homepage: https://github.com/OSGeo/PROJ Description: PROJ.4 library for cartographic projections Build-Depends: sqlite3[core] @@ -8,4 +7,4 @@ Default-Features: database Feature: database Build-Depends: sqlite3[tool] (!uwp&!arm) -Description: generate database +Description: generate database \ No newline at end of file diff --git a/ports/proj4/fix-sqlite-dependency-export.patch b/ports/proj4/fix-sqlite-dependency-export.patch index 06ea71c79ba9a3..774d1acfdd28e0 100644 --- a/ports/proj4/fix-sqlite-dependency-export.patch +++ b/ports/proj4/fix-sqlite-dependency-export.patch @@ -7,7 +7,7 @@ index 2e90f98f..dc171e91 100644 include_directories(${SQLITE3_INCLUDE_DIR}) -target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_LIBRARY}) ++target_link_libraries(${PROJ_CORE_TARGET} PUBLIC ${SQLITE3_LIBRARY}) if(MSVC AND BUILD_LIBPROJ_SHARED) target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index b669bfd729df40..be633ef0ce6a00 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -11,7 +11,6 @@ vcpkg_from_github( fix-win-output-name.patch fix-sqlite-dependency-export.patch fix-linux-build.patch - use-sqlite3-config.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/proj4/use-sqlite3-config.patch b/ports/proj4/use-sqlite3-config.patch deleted file mode 100644 index 050a88415eab8a..00000000000000 --- a/ports/proj4/use-sqlite3-config.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c617912..bed0428 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -122,7 +122,23 @@ if(NOT EXE_SQLITE3) - message(SEND_ERROR "sqlite3 binary not found!") - endif() - --find_package(Sqlite3 REQUIRED) -+#find_package(Sqlite3 REQUIRED) -+find_package(unofficial-sqlite3 CONFIG REQUIRED) -+if(unofficial-sqlite3_FOUND) -+ set(SQLITE3_FOUND true) -+ get_target_property(SQLITE3_INCLUDE_DIR unofficial::sqlite3::sqlite3 INTERFACE_INCLUDE_DIRECTORIES) -+ set(SQLITE3_LIBRARY unofficial::sqlite3::sqlite3) -+ # Extract version information from the header file -+ if(SQLITE3_INCLUDE_DIR) -+ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line -+ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" -+ LIMIT_COUNT 1) -+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" -+ SQLITE3_VERSION "${_ver_line}") -+ unset(_ver_line) -+ endif() -+endif() -+ - if(NOT SQLITE3_FOUND) - message(SEND_ERROR "sqlite3 dependency not found!") - endif() -diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 92197c8..ab65de7 100644 ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -25,6 +25,10 @@ else () - endif () - - string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) -+set(FIND_DEPENDENCY_SQLITE3 "") -+if(NOT BUILD_LIBPROJ_SHARED) -+ set(FIND_DEPENDENCY_SQLITE3 "find_package(unofficial-sqlite3 CONFIG REQUIRED)") -+endif() - configure_file(project-config.cmake.in project-config.cmake @ONLY) - configure_file(project-config-version.cmake.in - project-config-version.cmake @ONLY) -diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in -index 9a52b3b..295d95d 100644 ---- a/cmake/project-config.cmake.in -+++ b/cmake/project-config.cmake.in -@@ -13,6 +13,8 @@ message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}") - message (STATUS - "@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}") - -+@FIND_DEPENDENCY_SQLITE3@ -+ - # Tell the user project where to find our headers and libraries - get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) - get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE) diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 3b2a541bc031d6..2daa1ecaa17339 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,6 +1,5 @@ Source: protobuf Version: 3.12.3 -Port-Version: 2 Homepage: https://github.com/google/protobuf Description: Protocol Buffers - Google's data interchange format diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 3b8f806cf2b493..f8610470ac6b86 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_from_github( if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(protobuf_BUILD_PROTOC_BINARIES OFF) -elseif(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_IS_MINGW AND NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)) +elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME) set(protobuf_BUILD_PROTOC_BINARIES OFF) else() set(protobuf_BUILD_PROTOC_BINARIES ON) @@ -90,7 +90,8 @@ protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) if(CMAKE_HOST_WIN32) if(protobuf_BUILD_PROTOC_BINARIES) - vcpkg_copy_tools(TOOL_NAMES protoc) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) else() file(COPY ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/${PORT} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() @@ -121,15 +122,3 @@ endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() -set(packages protobuf protobuf-lite) -foreach(_package IN LISTS packages) - set(_file ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_package}.pc) - if(EXISTS "${_file}") - vcpkg_replace_string(${_file} "-l${_package}" "-l${_package}d") - endif() -endforeach() - -if(NOT VCPKG_TARGET_IS_WINDOWS) - set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) -endif() -vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 28247c42d506bc..4788f4b3852d6c 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,9 +1,8 @@ Source: qt5-base Version: 5.15.0 -Port-Version: 2 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. -Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) +Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) Feature: latest Description: Build latest qt version (5.15.0) instead of LTS (latest and LTS are currently the same) diff --git a/ports/qt5-base/cmake/install_qt.cmake b/ports/qt5-base/cmake/install_qt.cmake index 97f2e71a20e920..a188138f499c7b 100644 --- a/ports/qt5-base/cmake/install_qt.cmake +++ b/ports/qt5-base/cmake/install_qt.cmake @@ -4,7 +4,6 @@ function(install_qt) if(CMAKE_HOST_WIN32) vcpkg_find_acquire_program(JOM) set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY}) - set(INVOKE_SINGLE "${JOM}" /J 1) else() find_program(MAKE make) set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY}) @@ -63,9 +62,8 @@ function(install_qt) endif() message(STATUS "Building ${_build_triplet}") - vcpkg_execute_build_process( + vcpkg_execute_required_process( COMMAND ${INVOKE} - NO_PARALLEL_COMMAND ${INVOKE_SINGLE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet} LOGNAME build-${_build_triplet} ) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 1044df3174644f..f989926730ef66 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -130,13 +130,6 @@ find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux) find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(BROTLI_ENC_RELEASE NAMES brotlienc brotlienc-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(BROTLI_ENC_DEBUG NAMES brotlienc brotlienc-static brotliencd brotlienc-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) - find_library(ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(ICUTU_RELEASE NAMES icutu libicutu PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) @@ -173,8 +166,8 @@ find_library(SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DI find_library(EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_ENC_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}") -set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_ENC_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_RELEASE}") +set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}") +set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}") # If HarfBuzz is built with GLib enabled, it must be statically link set(GLIB_LIB_VERSION 2.0) @@ -193,7 +186,7 @@ set(RELEASE_OPTIONS "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}" "ICU_LIBS=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" ) set(DEBUG_OPTIONS "LIBJPEG_LIBS=${JPEG_DEBUG}" @@ -268,7 +261,7 @@ elseif(VCPKG_TARGET_IS_OSX) set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) message(STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}") FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) - string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) + string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) endif() #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) diff --git a/ports/qt5-connectivity/CONTROL b/ports/qt5-connectivity/CONTROL index aefaea84647020..7ffc9959c974c0 100644 --- a/ports/qt5-connectivity/CONTROL +++ b/ports/qt5-connectivity/CONTROL @@ -1,5 +1,4 @@ Source: qt5-connectivity Version: 5.15.0 -Port-Version: 1 Description: Qt5 Connectivity module - Provides access to Bluetooth and NFC hardware Build-Depends: qt5-base[core] diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL index 6cc1b86eadd211..277ba3c0ca29db 100644 --- a/ports/qt5-imageformats/CONTROL +++ b/ports/qt5-imageformats/CONTROL @@ -1,5 +1,4 @@ Source: qt5-imageformats Version: 5.15.0 -Port-Version: 1 Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP Build-Depends: qt5-base[core], tiff, libwebp, jasper diff --git a/ports/qt5-location/CONTROL b/ports/qt5-location/CONTROL index c0e66e5ac1ec53..ecc878edf71715 100644 --- a/ports/qt5-location/CONTROL +++ b/ports/qt5-location/CONTROL @@ -1,5 +1,4 @@ Source: qt5-location Version: 5.15.0 -Port-Version: 1 Description: Qt5 Location Module - Displays map, navigation, and place content in a QML application. Build-Depends: qt5-base[core], qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport diff --git a/ports/qt5-webengine/CONTROL b/ports/qt5-webengine/CONTROL index a157652411afcc..8dc1dc5a953bd1 100644 --- a/ports/qt5-webengine/CONTROL +++ b/ports/qt5-webengine/CONTROL @@ -1,6 +1,5 @@ Source: qt5-webengine Version: 5.15.0 -Port-Version: 1 Description: Qt5 webengine Module; Build-Depends: qt5-base[core], qt5-declarative, qt5-location, qt5-quickcontrols, qt5-quickcontrols2, qt5-tools, qt5-webchannel, atlmfc (windows), ffmpeg[core] (!windows) Supports: !static diff --git a/ports/qt5-webengine/portfile.cmake b/ports/qt5-webengine/portfile.cmake index 611a3c7c035ddb..9da6797ca90ba1 100644 --- a/ports/qt5-webengine/portfile.cmake +++ b/ports/qt5-webengine/portfile.cmake @@ -10,6 +10,8 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) endif() include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) + + vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) vcpkg_find_acquire_program(GPERF) @@ -36,10 +38,7 @@ vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") vcpkg_add_to_path(PREPEND "${GPERF_DIR}") vcpkg_add_to_path(PREPEND "${NINJA_DIR}") -set(PATCHES common.pri.patch - gl.patch - build.patch - vs2017.patch) +set(PATCHES common.pri.patch gl.patch build.patch) if(NOT VCPKG_TARGET_IS_WINDOWS) list(APPEND CORE_OPTIONS "BUILD_OPTIONS" "-webengine-system-libwebp" "-webengine-system-ffmpeg" "-webengine-system-icu") diff --git a/ports/qt5-webengine/vs2017.patch b/ports/qt5-webengine/vs2017.patch deleted file mode 100644 index 07eb79e16fb6bd..00000000000000 --- a/ports/qt5-webengine/vs2017.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc -index 33d5cb1f6f6..1ba53aee4b3 100644 ---- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc -+++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc -@@ -26,6 +26,7 @@ - #include "src/trace_processor/slice_tracker.h" - #include "src/trace_processor/track_tracker.h" - -+#include - #include - #include - #include diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 2b06636e7b82dd..0f5121a287f50d 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,10 +1,9 @@ Source: qt5 Version: 5.15.0 -Port-Version: 1 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Build-Depends: qt5-base[core] -Default-Features: essentials +Default-Features: essentials, default Feature: essentials Build-Depends: qt5[core, tools, networkauth, quickcontrols2, multimedia, imageformats, declarative, svg, activeqt] @@ -14,25 +13,29 @@ Feature: latest Build-Depends: qt5-base[core, latest] Description: Build latest qt version (5.14.2) instead of LTS +Feature: default +Build-Depends: qt5[core, 3d, webchannel, websockets, extras, sensors, serialport, speech, virtualkeyboard, purchasing, scxml, charts, datavis3d, gamepad, graphicaleffects, location, webglplugin, webview, translations, remoteobjects, connectivity] +Description: Build the essential qt modules + Feature: all Build-Depends: qt5[3d, webchannel, websockets, extras, xmlpatterns, sensors, serialport, speech, svg, tools, virtualkeyboard, networkauth, purchasing, quickcontrols, quickcontrols2, script, scxml, activeqt, charts, datavis3d, declarative, gamepad, graphicaleffects, imageformats, location, multimedia, mqtt, webglplugin, webview, serialbus, translations, doc, remoteobjects, connectivity], qt5[core,webengine] (!static), qt5[core,wayland] (!windows) Description: Install all Qt5 submodules (Warning: Could take a long time and fail...) Feature: extras Build-Depends: qt5-winextras (windows), qt5-macextras (osx), qt5-x11extras (linux), qt5-androidextras (android) -Description: +Description: Feature: 3d Build-Depends: qt5-3d -Description: +Description: Feature: webchannel Build-Depends: qt5-webchannel -Description: +Description: Feature: websockets Build-Depends: qt5-websockets -Description: +Description: Feature: xmlpatterns Build-Depends: qt5-xmlpatterns @@ -40,35 +43,35 @@ Description: (deprecated) Feature: sensors Build-Depends: qt5-sensors -Description: +Description: Feature: serialport Build-Depends: qt5-serialport -Description: +Description: Feature: speech Build-Depends: qt5-speech -Description: +Description: Feature: svg Build-Depends: qt5-svg -Description: +Description: Feature: tools Build-Depends: qt5-tools -Description: +Description: Feature: virtualkeyboard Build-Depends: qt5-virtualkeyboard -Description: +Description: Feature: networkauth Build-Depends: qt5-networkauth -Description: +Description: Feature: purchasing Build-Depends: qt5-purchasing -Description: +Description: Feature: quickcontrols Build-Depends: qt5-quickcontrols @@ -76,7 +79,7 @@ Description: (deprecated) Feature: quickcontrols2 Build-Depends: qt5-quickcontrols2 -Description: +Description: Feature: script Build-Depends: qt5-script @@ -84,7 +87,7 @@ Description: (deprecated) Feature: scxml Build-Depends: qt5-scxml -Description: +Description: Feature: activeqt Build-Depends: qt5-activeqt (windows) @@ -92,72 +95,76 @@ Description: Windows Only Feature: charts Build-Depends: qt5-charts -Description: +Description: Feature: datavis3d Build-Depends: qt5-datavis3d -Description: +Description: Feature: declarative Build-Depends: qt5-declarative -Description: +Description: Feature: gamepad Build-Depends: qt5-gamepad -Description: +Description: Feature: graphicaleffects Build-Depends: qt5-graphicaleffects -Description: +Description: + +Feature: declarative +Build-Depends: qt5-declarative +Description: Feature: imageformats Build-Depends: qt5-imageformats -Description: +Description: Feature: location Build-Depends: qt5-location -Description: +Description: Feature: multimedia Build-Depends: qt5-multimedia -Description: +Description: Feature: mqtt Build-Depends: qt5-mqtt -Description: +Description: Feature: webglplugin Build-Depends: qt5-webglplugin -Description: +Description: Feature: webview Build-Depends: qt5-webview -Description: +Description: Feature: wayland Build-Depends: qt5-wayland -Description: +Description: Feature: webengine Build-Depends: qt5-webengine -Description: +Description: Feature: serialbus Build-Depends: qt5-serialbus -Description: +Description: Feature: translations Build-Depends: qt5-translations -Description: +Description: Feature: doc Build-Depends: qt5-doc -Description: +Description: Feature: remoteobjects Build-Depends: qt5-remoteobjects -Description: +Description: Feature: connectivity Build-Depends: qt5-connectivity -Description: +Description: diff --git a/ports/quazip/CONTROL b/ports/quazip/CONTROL deleted file mode 100644 index 853be24c058248..00000000000000 --- a/ports/quazip/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: quazip -Version: 0.9.1 -Homepage: https://stachenov.github.io/quazip/ -Description: Qt/C++ wrapper over minizip -Build-Depends: qt5-base, zlib diff --git a/ports/quazip/portfile.cmake b/ports/quazip/portfile.cmake deleted file mode 100644 index 4c8602b69234a2..00000000000000 --- a/ports/quazip/portfile.cmake +++ /dev/null @@ -1,20 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO stachenov/quazip - REF v0.9.1 - SHA512 db31f3c7e3d7e95c25090ceb8379643e0b49ed69ece009dd015bee120b2b60f42e73408f580caed3138fa19ca64dcd23a05f16435abb54e2b8df21105c7b42c0 - PATCHES - vcpkg_remove_extra_static.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/QuaZip5/) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright) \ No newline at end of file diff --git a/ports/quazip/vcpkg_remove_extra_static.patch b/ports/quazip/vcpkg_remove_extra_static.patch deleted file mode 100644 index e600424751c1d1..00000000000000 --- a/ports/quazip/vcpkg_remove_extra_static.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/quazip/CMakeLists.txt b/quazip/CMakeLists.txt -index 1efb5e2..2412b8a 100644 ---- a/quazip/CMakeLists.txt -+++ b/quazip/CMakeLists.txt -@@ -10,22 +10,13 @@ ADD_DEFINITIONS(-DQUAZIP_BUILD) - qt_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS}) - set(SRCS ${SRCS} ${MOC_SRCS}) - --add_library(${QUAZIP_LIB_TARGET_NAME} SHARED ${SRCS}) --add_library(quazip_static STATIC ${SRCS}) -- --# Windows uses .lib extension for both static and shared library --# *nix systems use different extensions for SHARED and STATIC library and by convention both libraries have the same name --if (NOT WIN32) -- set_target_properties(quazip_static PROPERTIES OUTPUT_NAME quazip${QUAZIP_LIB_VERSION_SUFFIX}) --endif () -+add_library(${QUAZIP_LIB_TARGET_NAME} ${SRCS}) - - target_include_directories(${QUAZIP_LIB_TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) --target_include_directories(quazip_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) --set_target_properties(${QUAZIP_LIB_TARGET_NAME} quazip_static PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) -+set_target_properties(${QUAZIP_LIB_TARGET_NAME} PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) - - # Link against ZLIB_LIBRARIES if needed (on Windows this variable is empty) - target_link_libraries(${QUAZIP_LIB_TARGET_NAME} ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) --target_link_libraries(quazip_static ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) - - install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip${QUAZIP_LIB_VERSION_SUFFIX}) --install(TARGETS ${QUAZIP_LIB_TARGET_NAME} quazip_static LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION}) -+install(TARGETS ${QUAZIP_LIB_TARGET_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ports/quill/CONTROL b/ports/quill/CONTROL index 9fee17006d55c2..c69e4ffab6da44 100644 --- a/ports/quill/CONTROL +++ b/ports/quill/CONTROL @@ -1,5 +1,5 @@ Source: quill -Version: 1.3.3 +Version: 1.3.1 Homepage: https://github.com/odygrd/quill/ Description: C++14 Asynchronous Low Latency Logging Library Supports: !(arm|arm64|uwp|android) diff --git a/ports/quill/portfile.cmake b/ports/quill/portfile.cmake index 61ad68227be8a9..9f35ddc2b28681 100644 --- a/ports/quill/portfile.cmake +++ b/ports/quill/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO odygrd/quill - REF f1d244f521a117beabebbe536f8507f8b2aa2244 #v1.3.3 - SHA512 1164f6089f92822f35570832873aef9d619d3da311d1f57f36fd83fd2f659255a1ea44db79948a1591d48c4ec45a7b7158a5745f37a3c940e7bc7b97d52dd85e + REF 3d72126ab749277267c45da80b65ee76aaafff6d #v1.3.1 + SHA512 06ca205d291cb5161bc956b472c00e791d8ff9bd512ac4b9d3592e0f5af19aac425836d77131d0294ceea83aaec386dbdb86179cf93fbb0c3972e5547c216287 HEAD_REF master ) diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 8353f4670f4306..4a2407b343b8a7 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,6 +1,5 @@ Source: qwt Version: 6.1.4 -Port-Version: 1 Homepage: https://sourceforge.net/projects/qwt Description: Qt widgets library for technical applications Build-Depends: qt5-base[core], qt5-svg, qt5-tools diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index 795fe53b0bb408..bbf03abc1482aa 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -31,4 +31,4 @@ file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/qwtw/CONTROL b/ports/qwtw/CONTROL deleted file mode 100644 index 2ce5b0a13bac69..00000000000000 --- a/ports/qwtw/CONTROL +++ /dev/null @@ -1,7 +0,0 @@ -Source: qwtw -Version: 3.0 -Homepage: https://github.com/ig-or/qwtw -Description: qwt-based 2D plotting library -Supports: windows & x64 & !static -Build-Depends: qt5-base, qt5-svg, qwt, marble, boost-system, boost-filesystem, boost-date-time, boost-chrono, boost-regex, boost-thread, boost-circular-buffer, boost-asio - diff --git a/ports/qwtw/portfile.cmake b/ports/qwtw/portfile.cmake deleted file mode 100644 index c88ac2179ed5f5..00000000000000 --- a/ports/qwtw/portfile.cmake +++ /dev/null @@ -1,19 +0,0 @@ -vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO ig-or/qwtw - REF 54bedcce743991f2f274bebda0ee399683a9e9bb - SHA512 defd7f199c8bf490f5ac69deade4a4a45581c0fa5b79cf2aa1fbec8c46bbbe1d9c9cf0f7ba383e8e92f5e6145b42a837b7dc555017893797f72dab1ce490e57a - HEAD_REF master -) - - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/raylib/CONTROL b/ports/raylib/CONTROL index 7308a4e43f8a95..382de52f3fcee3 100644 --- a/ports/raylib/CONTROL +++ b/ports/raylib/CONTROL @@ -1,13 +1,9 @@ Source: raylib Version: 3.0.0 -Port-Version: 3 +Port-Version: 1 Description: A simple and easy-to-use library to enjoy videogames programming Homepage: https://github.com/raysan5/raylib Supports: !(arm|uwp) -Default-Features: use-audio -Feature: hidpi -Description: Support high-DPI displays - -Feature: use-audio -Description: Build raylib with audio module +Feature: non-audio +Description: Build raylib without audio module diff --git a/ports/raylib/portfile.cmake b/ports/raylib/portfile.cmake index ba63fff8484560..f39d61d1cf6cab 100644 --- a/ports/raylib/portfile.cmake +++ b/ports/raylib/portfile.cmake @@ -25,9 +25,8 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - hidpi SUPPORT_HIGH_DPI - use-audio USE_AUDIO + INVERTED_FEATURES + non-audio USE_AUDIO ) vcpkg_configure_cmake( @@ -38,8 +37,8 @@ vcpkg_configure_cmake( -DBUILD_GAMES=OFF -DSHARED=${SHARED} -DSTATIC=${STATIC} + -DUSE_AUDIO=${USE_AUDIO} -DUSE_EXTERNAL_GLFW=OFF # externl glfw3 causes build errors on Windows - ${FEATURE_OPTIONS} OPTIONS_DEBUG -DENABLE_ASAN=ON -DENABLE_UBSAN=ON @@ -56,6 +55,12 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake + ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake + @ONLY +) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share @@ -69,5 +74,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() +# Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file diff --git a/ports/raylib/usage b/ports/raylib/usage index 94ce10978f78d5..936b74f502a845 100644 --- a/ports/raylib/usage +++ b/ports/raylib/usage @@ -1,5 +1,5 @@ The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: find_package(@PORT@ CONFIG REQUIRED) - target_include_directories(main PRIVATE ${RAYLIB_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${RAYLIB_LIBRARIES}) + target_include_directories(main PRIVATE ${raylib_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${raylib_LIBRARIES}) diff --git a/ports/raylib/vcpkg-cmake-wrapper.cmake b/ports/raylib/vcpkg-cmake-wrapper.cmake index 34484ea6fe3e41..81e9989ec0d357 100644 --- a/ports/raylib/vcpkg-cmake-wrapper.cmake +++ b/ports/raylib/vcpkg-cmake-wrapper.cmake @@ -1,11 +1,14 @@ -include(SelectLibraryConfigurations) +set(raylib_USE_STATIC_LIBS @STATIC@) -find_path(RAYLIB_INCLUDE_DIR raylib.h) +_find_package(${ARGS}) -find_library(RAYLIB_LIBRARY_DEBUG NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) -find_library(RAYLIB_LIBRARY_RELEASE NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) +if(raylib_FOUND) + get_filename_component(_raylib_lib_name ${raylib_LIBRARY} NAME) -select_library_configurations(RAYLIB) + set(raylib_LIBRARY + debug ${CURRENT_INSTALLED_DIR}/debug/lib/${_raylib_lib_name} + optimized ${CURRENT_INSTALLED_DIR}/lib/${_raylib_lib_name} + ) -set(RAYLIB_INCLUDE_DIRS ${RAYLIB_INCLUDE_DIR}) -set(RAYLIB_LIBRARIES ${RAYLIB_LIBRARY}) + set(raylib_LIBRARIES ${raylib_LIBRARY}) +endif() diff --git a/ports/restinio/CONTROL b/ports/restinio/CONTROL index f86387b32c6af1..d953dcfee202ca 100644 --- a/ports/restinio/CONTROL +++ b/ports/restinio/CONTROL @@ -1,5 +1,5 @@ Source: restinio -Version: 0.6.9 +Version: 0.6.8 Description: A header-only C++14 library that gives you an embedded HTTP/Websocket server targeted primarily for asynchronous processing of HTTP-requests. Build-Depends: asio, fmt, http-parser Homepage: https://github.com/stiffstream/restinio diff --git a/ports/restinio/portfile.cmake b/ports/restinio/portfile.cmake index 5dcd5e6906e9c7..c2cbbb05712c57 100644 --- a/ports/restinio/portfile.cmake +++ b/ports/restinio/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stiffstream/restinio - REF 0ef04a26155d8aa4a56a36cc013c7e722675da21 # v.0.6.9 - SHA512 6ae218275f8b654e64708bfde7873170d613e830ffce4e9dade18ff06c47c0a8eec42570fe59f36e31ab052ad0e7724928d94fd70c6f72454a3cd7eb6cdbf175 + REF c34f83a68e60537eba52e2d076ed22495ad4c5df # v.0.6.8 + SHA512 1c03a2cc96f44ce004870136ffdaa7a9abc5bc5173edadfe58e4f92f2e3c67c1555b4604094ad3a1dab1f0bf01cf9d79cf7d5a381f357aa4bdff90656a27e0c1 ) vcpkg_configure_cmake( diff --git a/ports/robin-hood-hashing/CONTROL b/ports/robin-hood-hashing/CONTROL index 6aa499d881356b..8d7eda75586bba 100644 --- a/ports/robin-hood-hashing/CONTROL +++ b/ports/robin-hood-hashing/CONTROL @@ -1,4 +1,4 @@ Source: robin-hood-hashing -Version: 3.8.0 +Version: 3.7.0 Homepage: https://github.com/martinus/robin-hood-hashing Description: Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 diff --git a/ports/robin-hood-hashing/portfile.cmake b/ports/robin-hood-hashing/portfile.cmake index 4169c32483f009..209fb611e6d314 100644 --- a/ports/robin-hood-hashing/portfile.cmake +++ b/ports/robin-hood-hashing/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO martinus/robin-hood-hashing - REF 3.8.0 - SHA512 f64635a2fc3ebd975d40dc4fd3e3df81a6bed11e8bb9df1d6d100e408c2c81da2679e9836313444e573c6bfb160eeecd7fde68988e9d0246601c8993ecc42085 + REF 3.7.0 + SHA512 3dd7c7ace50bd16579ef9db8f9a89e1b2fd8406d7f3af6a4cedb674ea14303bd70332da403b87b2f0fb3c7f415dd93e9a7b330cb86ca2f58d5916ca42666a8e5 HEAD_REF master ) diff --git a/ports/rsocket/CONTROL b/ports/rsocket/CONTROL deleted file mode 100644 index 333fe0df395f43..00000000000000 --- a/ports/rsocket/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: rsocket -Version: 2020.05.04.00-1 -Homepage: https://github.com/rsocket/rsocket-cpp -Description: C++ implementation of RSocket http://rsocket.io -Build-Depends: folly, double-conversion, openssl, gflags, glog, fmt, boost-system, boost-thread, boost-filesystem, boost-regex, boost-context, boost-program-options, zlib -Supports: !(windows&x64) diff --git a/ports/rsocket/fix-cmake-config.patch b/ports/rsocket/fix-cmake-config.patch deleted file mode 100644 index d3bf7b886ee444..00000000000000 --- a/ports/rsocket/fix-cmake-config.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/cmake/rsocket-config.cmake.in b/cmake/rsocket-config.cmake.in -index d5579a85..ea12752a 100644 ---- a/cmake/rsocket-config.cmake.in -+++ b/cmake/rsocket-config.cmake.in -@@ -4,7 +4,7 @@ - @PACKAGE_INIT@ - - if(NOT TARGET rsocket::ReactiveSocket) -- include("${PACKAGE_PREFIX_DIR}/lib/cmake/rsocket/rsocket-exports.cmake") -+ include("${CMAKE_CURRENT_LIST_DIR}/rsocket-exports.cmake") - endif() - - if (NOT rsocket_FIND_QUIETLY) -diff --git a/yarpl/cmake/yarpl-config.cmake.in b/yarpl/cmake/yarpl-config.cmake.in -index d557b213..1b83fffc 100644 ---- a/yarpl/cmake/yarpl-config.cmake.in -+++ b/yarpl/cmake/yarpl-config.cmake.in -@@ -4,7 +4,7 @@ - @PACKAGE_INIT@ - - if(NOT TARGET yarpl::yarpl) -- include("${PACKAGE_PREFIX_DIR}/lib/cmake/yarpl/yarpl-exports.cmake") -+ include("${CMAKE_CURRENT_LIST_DIR}/yarpl-exports.cmake") - endif() - - set(YARPL_LIBRARIES yarpl::yarpl) diff --git a/ports/rsocket/fix-find-dependencies.patch b/ports/rsocket/fix-find-dependencies.patch deleted file mode 100644 index 287a6fa99df0fe..00000000000000 --- a/ports/rsocket/fix-find-dependencies.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f69e907..22570b5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -124,7 +124,7 @@ option(BUILD_BENCHMARKS "Build benchmarks" ON) - option(BUILD_EXAMPLES "Build examples" ON) - option(BUILD_TESTS "Build tests" ON) - --enable_testing() -+#enable_testing() - - include(ExternalProject) - include(CTest) -@@ -172,7 +172,9 @@ endif() - - if("${BUILD_TYPE_LOWER}" MATCHES "debug") - message("debug mode was set") -+ if (NOT WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code") -+ endif() - else() - message("release mode was set") - endif() -@@ -181,18 +183,25 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(TEST_CXX_FLAGS ${TEST_CXX_FLAGS} -Wno-inconsistent-missing-override) - endif() - --find_library(DOUBLE-CONVERSION double-conversion) -+find_package(double-conversion CONFIG REQUIRED) - - find_package(OpenSSL REQUIRED) - --find_package(Gflags REQUIRED) -+find_package(gflags CONFIG REQUIRED) - --# find glog::glog to satisfy the folly dep. --find_package(Glog REQUIRED) -+find_package(ZLIB REQUIRED) - --find_package(fmt CONFIG REQUIRED) -+if (BUILD_SHARED_LIBS) -+ set(gflags gflags_shared) -+else() -+ set(gflags gflags_static) -+endif() - --include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) -+# find glog::glog to satisfy the folly dep. -+find_package(folly CONFIG REQUIRED) -+#find_package(glog CONFIG REQUIRED) -+# -+#find_package(fmt CONFIG REQUIRED) - - include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) - -@@ -327,7 +336,7 @@ target_compile_options( - ReactiveSocket - PRIVATE ${EXTRA_CXX_FLAGS}) - --enable_testing() -+#enable_testing() - - install(TARGETS ReactiveSocket EXPORT rsocket-exports DESTINATION lib) - install(DIRECTORY rsocket DESTINATION include FILES_MATCHING PATTERN "*.h") -@@ -470,7 +479,7 @@ if(BUILD_TESTS) - ${GMOCK_LIBS} # This also needs the preceding `add_dependencies` - glog::glog - gflags -- ${DOUBLE-CONVERSION}) -+ double-conversion::double-conversion) - - # Download the latest TCK drivers JAR. - set(TCK_DRIVERS_JAR rsocket-tck-drivers-0.9.10.jar) -diff --git a/yarpl/CMakeLists.txt b/yarpl/CMakeLists.txt -index f4159b8..8c01ffb 100644 ---- a/yarpl/CMakeLists.txt -+++ b/yarpl/CMakeLists.txt -@@ -53,8 +53,14 @@ endif() - # Using NDEBUG in Release builds. - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") - --find_package(Gflags REQUIRED) --find_package(Glog REQUIRED) -+find_package(gflags CONFIG REQUIRED) -+if (BUILD_SHARED_LIBS) -+ set(gflags gflags_shared) -+else() -+ set(gflags gflags_static) -+endif() -+ -+find_package(glog CONFIG REQUIRED) - find_package(fmt CONFIG REQUIRED) - - IF(NOT FOLLY_VERSION) diff --git a/ports/rsocket/portfile.cmake b/ports/rsocket/portfile.cmake deleted file mode 100644 index 4ae31c106ef0fe..00000000000000 --- a/ports/rsocket/portfile.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# yarpl only support static build in Windows -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_fail_port_install(ON_ARCH "x64") - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO rsocket/rsocket-cpp #v2020.05.04.00 - REF 8038d05e741c3d3ecd6adb069b4a1b3daa230e14 - SHA512 d7bc93af7b6130d73fa0823f534ad57a531dfa7d7aa990a2a1a1b72b6761db7eeb60573d0d38f55daa991554e3ab4ac507047f8051a4390b3343cd708a48efbb - HEAD_REF master - PATCHES - fix-cmake-config.patch - fix-find-dependencies.patch -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_EXAMPLES=OFF - -DBUILD_TESTS=OFF - -DBUILD_BENCHMARKS=OFF -) - -vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/include/yarpl/perf - ${CURRENT_PACKAGES_DIR}/include/yarpl/cmake - ${CURRENT_PACKAGES_DIR}/include/yarpl/test - ${CURRENT_PACKAGES_DIR}/include/rsocket/examples - ${CURRENT_PACKAGES_DIR}/include/rsocket/test -) - -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rtmidi/CMakeLists.txt b/ports/rtmidi/CMakeLists.txt new file mode 100644 index 00000000000000..91782fd1817485 --- /dev/null +++ b/ports/rtmidi/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.8) +project(rtmidi CXX) + +add_library(rtmidi RtMidi.cpp rtmidi_c.cpp) +if(BUILD_SHARED_LIBS) + target_compile_definitions(rtmidi PRIVATE -DRTMIDI_EXPORT) +endif() + +file(READ "${PROJECT_SOURCE_DIR}/rtmidi_c.h" RTMIDI_EXPORT) +if (BUILD_SHARED_LIBS) + string(REPLACE "if defined(RTMIDI_EXPORT)" "if 1" RTMIDI_EXPORT "${RTMIDI_EXPORT}") +else() + string(REPLACE "if defined(RTMIDI_EXPORT)" "if 0" RTMIDI_EXPORT "${RTMIDI_EXPORT}") +endif() +file(WRITE "${PROJECT_BINARY_DIR}/rtmidi_c.h" "${RTMIDI_EXPORT}") + +install( + TARGETS rtmidi + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES "RtMidi.h" DESTINATION include) + install(FILES "${PROJECT_BINARY_DIR}/rtmidi_c.h" DESTINATION include) +endif() diff --git a/ports/rtmidi/CONTROL b/ports/rtmidi/CONTROL index 7c2c39f2ad8f29..3742ec9b16a450 100644 --- a/ports/rtmidi/CONTROL +++ b/ports/rtmidi/CONTROL @@ -1,6 +1,4 @@ Source: rtmidi Version: 4.0.0 -Port-Version: 2 Homepage: https://github.com/thestk/rtmidi Description: A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMidi & JACK) and Windows (Multimedia) -Supports: !uwp diff --git a/ports/rtmidi/portfile.cmake b/ports/rtmidi/portfile.cmake index 4a9fccbcc078fb..8aa949b5a4cea5 100644 --- a/ports/rtmidi/portfile.cmake +++ b/ports/rtmidi/portfile.cmake @@ -1,29 +1,22 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") - -# Upstream uses CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, which causes issues -# https://github.com/thestk/rtmidi/blob/4.0.0/CMakeLists.txt#L20 -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO thestk/rtmidi - REF dda792c5394375769466ab1c1d7773e741bbd950 # 4.0.0 - SHA512 cb1ded29c0b22cf7f38719131a9572a4daba7071fd8cf8b5b8d7306560a218bb0ef42150bf341b76f4ddee0ae087da975116c3b153e7bb908f2a674ecacb9d7a + REF 4.0.0 + SHA512 39383f121320c9471b31f8b9d283167bfadf4c7328b6664d1d54a4c52e3dd9b76362875258d90363c6044e87fcee31ccce80e19435dc620c88e6d60fc82d0f9d HEAD_REF master - PATCHES - fix-POSIXname.patch + PATCHES + fix-POSIXname.patch ) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON - OPTIONS -DRTMIDI_API_ALSA=OFF ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtmidi RENAME copyright) diff --git a/ports/sdl1/CONTROL b/ports/sdl1/CONTROL index 87bb7b2afb825f..d34e89ad008880 100644 --- a/ports/sdl1/CONTROL +++ b/ports/sdl1/CONTROL @@ -1,5 +1,4 @@ Source: sdl1 -Version: 1.2.15 -Port-Version: 12 +Version: 1.2.15-11 Homepage: https://www.libsdl.org Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl1/portfile.cmake b/ports/sdl1/portfile.cmake index 6dd7da6876d573..e84582bf0a9a8d 100644 --- a/ports/sdl1/portfile.cmake +++ b/ports/sdl1/portfile.cmake @@ -54,13 +54,11 @@ else() message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".") vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() - vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib - -Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib - SYSTEM_LIBRARIES pthread) + vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread) file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") foreach (SDL1_TOOL ${SDL1_TOOLS}) diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt index cc9816d0b781a2..b5b5eac619b265 100644 --- a/ports/sdl2-mixer/CMakeLists.txt +++ b/ports/sdl2-mixer/CMakeLists.txt @@ -91,7 +91,7 @@ add_library(SDL2_mixer music_wav.c version.rc) -if((WIN32 OR APPLE) AND SDL_MIXER_ENABLE_NATIVEMIDI) +if(WIN32 OR APPLE) list(APPEND SDL_MIXER_DEFINES MUSIC_MID_NATIVE) target_sources(SDL2_mixer PRIVATE music_nativemidi.c native_midi/native_midi_common.c) target_link_libraries(SDL2_mixer ${SDL_MIXER_LIBRARIES}) diff --git a/ports/sdl2-mixer/CONTROL b/ports/sdl2-mixer/CONTROL index ef18e139debe36..4ea51192ef4168 100644 --- a/ports/sdl2-mixer/CONTROL +++ b/ports/sdl2-mixer/CONTROL @@ -1,17 +1,12 @@ Source: sdl2-mixer -Version: 2.0.4 -Port-Version: 10 +Version: 2.0.4-9 Homepage: https://www.libsdl.org/projects/SDL_mixer Description: Multi-channel audio mixer library for SDL. Build-Depends: sdl2 -Default-Features: nativemidi Feature: dynamic-load Description: Load plugins with dynamic call -Feature: nativemidi -Description: Support for MIDI audio format on Windows and macOS. - Feature: libflac Description: Support for FLAC audio format. Build-Depends: libflac diff --git a/ports/sdl2-mixer/portfile.cmake b/ports/sdl2-mixer/portfile.cmake index 16e45c5d88ab76..74037d2f6b1d0d 100644 --- a/ports/sdl2-mixer/portfile.cmake +++ b/ports/sdl2-mixer/portfile.cmake @@ -34,7 +34,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS libmodplug SDL_MIXER_ENABLE_MOD libvorbis SDL_MIXER_ENABLE_OGGVORBIS opusfile SDL_MIXER_ENABLE_OPUS - nativemidi SDL_MIXER_ENABLE_NATIVEMIDI ) vcpkg_configure_cmake( diff --git a/ports/secp256k1/CMakeLists.txt b/ports/secp256k1/CMakeLists.txt index a3af313b6e7109..2e6b46198aabd8 100644 --- a/ports/secp256k1/CMakeLists.txt +++ b/ports/secp256k1/CMakeLists.txt @@ -12,24 +12,15 @@ add_definitions( file(GLOB SOURCES src/secp256k1.c) add_library(secp256k1 ${SOURCES}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(secp256k1 PUBLIC $ $) - -if(INSTALL_HEADERS) - file(GLOB HEADERS include/*.h) - install(FILES ${HEADERS} DESTINATION include) -endif() - -install(TARGETS secp256k1 EXPORT unofficial-secp256k1-targets +install(TARGETS secp256k1 RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -install( - EXPORT unofficial-secp256k1-targets - FILE unofficial-secp256k1-targets.cmake - NAMESPACE unofficial:: - DESTINATION share/unofficial-secp256k1 -) \ No newline at end of file +if(INSTALL_HEADERS) + file(GLOB HEADERS include/*.h) + install(FILES ${HEADERS} DESTINATION include) +endif() \ No newline at end of file diff --git a/ports/secp256k1/CONTROL b/ports/secp256k1/CONTROL index 10d73e4c08d73c..a0414b60c0af59 100644 --- a/ports/secp256k1/CONTROL +++ b/ports/secp256k1/CONTROL @@ -1,5 +1,4 @@ Source: secp256k1 -Version: 2017-19-10 -Port-Version: 3 +Version: 2017-19-10-0b7024185045a49a1a6a4c5615bf31c94f63d9c4-2 Homepage: https://github.com/bitcoin-core/secp256k1 Description: Optimized C library for EC operations on curve diff --git a/ports/secp256k1/portfile.cmake b/ports/secp256k1/portfile.cmake index 3bf158816ae426..28291c7eca389f 100644 --- a/ports/secp256k1/portfile.cmake +++ b/ports/secp256k1/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -18,8 +20,6 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -configure_file(${CMAKE_CURRENT_LIST_DIR}/secp256k1-config.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-secp256k1-config.cmake @ONLY) -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright) diff --git a/ports/secp256k1/secp256k1-config.cmake b/ports/secp256k1/secp256k1-config.cmake deleted file mode 100644 index 5cc40fe829a9ae..00000000000000 --- a/ports/secp256k1/secp256k1-config.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/unofficial-secp256k1-targets.cmake") diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL index 836280f8bb795c..6f46156a93519e 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,6 +1,5 @@ Source: sfml -Version: 2.5.1 -Port-Version: 8 +Version: 2.5.1-7 Homepage: https://github.com/sfml/sfml Description: Simple and fast multimedia library Build-Depends: freetype, libflac, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index 82f6e11d15b524..efbcdd135912d0 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -5,7 +5,6 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH SHA512 7aed2fc29d1da98e6c4d598d5c86cf536cb4eb5c2079cdc23bb8e502288833c052579dadbe0ce13ad6461792d959bf6d9660229f54c54cf90a541c88c6b03d59 PATCHES use-system-freetype.patch - stb_include.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) diff --git a/ports/sfml/stb_include.patch b/ports/sfml/stb_include.patch deleted file mode 100644 index 3519b1c1e61233..00000000000000 --- a/ports/sfml/stb_include.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e821a49bc..c68264ef2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -188,6 +188,9 @@ if(SFML_USE_SYSTEM_DEPS) - endforeach() - - list(REMOVE_DUPLICATES CMAKE_IGNORE_PATH) -+ -+ find_path(STB_INCLUDE_DIR stb.h) -+ include_directories(${STB_INCLUDE_DIR}) - endif() - - # Visual C++: remove warnings regarding SL security and algorithms on pointers diff --git a/ports/shapelib/CONTROL b/ports/shapelib/CONTROL index e656682756f7b9..283b66b442d812 100644 --- a/ports/shapelib/CONTROL +++ b/ports/shapelib/CONTROL @@ -1,4 +1,4 @@ Source: shapelib -Version: 1.5.0 +Version: 1.4.1-2 Homepage: https://download.osgeo.org/shapelib Description: Shapefile C Library is simple C API for reading and writing ESRI Shapefiles diff --git a/ports/shapelib/portfile.cmake b/ports/shapelib/portfile.cmake index 3aceff84d7a016..788e21e2e3f5fe 100644 --- a/ports/shapelib/portfile.cmake +++ b/ports/shapelib/portfile.cmake @@ -1,5 +1,7 @@ -set(SHAPELIB_VERSION 1.5.0) -set(SHAPELIB_HASH 230939afb33aee042808a32b38ee9dfc7ec1f39432e5a4ebe3fda99c2f87bfbebc91830d4e21691c51aae3f4bb65d7e71e7061472bb08124dcd3402c46800d6c) +include(vcpkg_common_functions) + +set(SHAPELIB_VERSION 1.4.1) +set(SHAPELIB_HASH e3e02dde8006773fed25d630896e79fd79d2008a029cc86b157fe0d92c143a9fab930fdb93d9700d4e1397c3b23ae4b86e91db1dbaca1c5388d4e3aea0309341) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/shapelib/shapelib-${SHAPELIB_VERSION}.zip" @@ -42,7 +44,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/shapelib) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/shapelib/COPYING ${CURRENT_PACKAGES_DIR}/share/shapelib/copyright) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/shapelib) diff --git a/ports/simple-fft/CONTROL b/ports/simple-fft/CONTROL deleted file mode 100644 index 6595558bbd83df..00000000000000 --- a/ports/simple-fft/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: simple-fft -Version: 2020-06-14 -Homepage: https://github.com/d1vanov/Simple-FFT -Description: Header-only C++ library implementing fast Fourier transform of 1D, 2D and 3D data diff --git a/ports/simple-fft/portfile.cmake b/ports/simple-fft/portfile.cmake deleted file mode 100644 index 81f33e054c4b66..00000000000000 --- a/ports/simple-fft/portfile.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Header-only library -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO d1vanov/Simple-FFT - REF a0cc843ff36d33ad09c08674b9503614742ad0b9 - SHA512 6fbbda1f172505f6627f97ae671d12ff282844ca50e6e6c8016f78ee333c32ce6d17763837c281e47f10cfc277cb1f67394169f6bbf137b09885c1a053d6d342 - HEAD_REF master -) - -file(COPY ${SOURCE_PATH}/include/simple_fft/check_fft.hpp - ${SOURCE_PATH}/include/simple_fft/copy_array.hpp - ${SOURCE_PATH}/include/simple_fft/error_handling.hpp - ${SOURCE_PATH}/include/simple_fft/fft.h - ${SOURCE_PATH}/include/simple_fft/fft.hpp - ${SOURCE_PATH}/include/simple_fft/fft_impl.hpp - ${SOURCE_PATH}/include/simple_fft/fft_settings.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include/simple_fft -) - -file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index 8636d8ba951701..9005193609cad1 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,5 +1,5 @@ Source: spdlog -Version: 1.7.0 +Version: 1.6.1 Homepage: https://github.com/gabime/spdlog Description: Very fast, header only, C++ logging library Build-Depends: fmt diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 844575c134759a..0c8b0df72c3458 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gabime/spdlog - REF 616caa5d30172b65cc3a06800894c575d70cb8e6 #v1.7.0 - SHA512 47411e8a607a339bffe2d5e13b4568b825ee8a07d88e69cf32096b08b76cdb60cbd64003620506e9c5748d3f66d8df76fa8880bb1a092923b7b405fedd18ad0c + REF 22a169bc319ac06948e7ee0be6b9b0ac81386604 #v1.6.1 + SHA512 29eac6f1be8d9fc08a257eab7f59cf70d63b2978fa4b8b63c825b39cf77f2505083bfd9db3fa2925739cea71d07986c022fc3d236cce351b3570d543f100a8a5 HEAD_REF v1.x ) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 6250eb7111b979..3c1fc071c26c29 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -24,15 +24,6 @@ target_compile_definitions( -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_COLUMN_METADATA ) - -if(WITH_GEOPOLY) - add_compile_definitions(SQLITE_ENABLE_GEOPOLY) -endif() - -if(WITH_JSON1) - add_compile_definitions(SQLITE_ENABLE_JSON1) -endif() - target_include_directories(sqlite3 INTERFACE $) if(NOT WIN32) find_package(Threads REQUIRED) @@ -55,11 +46,11 @@ endif() install( TARGETS sqlite3 - EXPORT unofficial-sqlite3-targets + EXPORT sqlite3 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release) -install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) +install(EXPORT sqlite3 FILE sqlite3-targets.cmake DESTINATION share/sqlite3) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index 01df1c91abe0d6..c48578eef46afe 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,14 +1,7 @@ Source: sqlite3 Version: 3.32.3 -Port-Version: 1 Homepage: https://sqlite.org/ Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Feature: tool Description: sqlite3 executable - -Feature: geopoly -Description: enable geopoly functionality for sqlite3 - -Feature: json1 -Description: enable JSON functionality for sqlite3 diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 7a1a5775e73e43..21d60ab9f6a554 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -17,9 +17,6 @@ vcpkg_extract_source_archive_ex( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - geopoly WITH_GEOPOLY - json1 WITH_JSON1 INVERTED_FEATURES tool SQLITE3_SKIP_TOOLS ) @@ -33,7 +30,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) +vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -43,7 +40,7 @@ endif() configure_file( ${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake - ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake + ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake @ONLY ) diff --git a/ports/sqlite3/sqlite3-config.in.cmake b/ports/sqlite3/sqlite3-config.in.cmake index e7e26bf2cde563..538342cf42961f 100644 --- a/ports/sqlite3/sqlite3-config.in.cmake +++ b/ports/sqlite3/sqlite3-config.in.cmake @@ -4,4 +4,4 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) find_dependency(Threads) endif() -include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/sqlite3-targets.cmake) diff --git a/ports/sqlitecpp/0001-Find-external-sqlite3.patch b/ports/sqlitecpp/0001-Find-external-sqlite3.patch index 5914dc17d04700..b2371490c07833 100644 --- a/ports/sqlitecpp/0001-Find-external-sqlite3.patch +++ b/ports/sqlitecpp/0001-Find-external-sqlite3.patch @@ -7,10 +7,10 @@ index 9363c0d..0f47f0f 100644 target_link_libraries(SQLiteCpp PUBLIC sqlite3) else (SQLITECPP_INTERNAL_SQLITE) - find_package (SQLite3 REQUIRED) -+ find_package(unofficial-sqlite3 CONFIG) ++ find_package(sqlite3 CONFIG) message(STATUS "Link to sqlite3 system library") - target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) -+ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3) ++ target_link_libraries(SQLiteCpp PRIVATE sqlite3) if(SQLite3_VERSION VERSION_LESS "3.19") set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") endif() diff --git a/ports/sqlitecpp/CONTROL b/ports/sqlitecpp/CONTROL index 372acc14b06458..d05dcec852980f 100644 --- a/ports/sqlitecpp/CONTROL +++ b/ports/sqlitecpp/CONTROL @@ -1,6 +1,5 @@ Source: sqlitecpp Version: 3.0.0 -Port-Version: 1 Build-Depends: sqlite3 Homepage: https://github.com/SRombauts/SQLiteCpp Description: SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper. diff --git a/ports/stb/CONTROL b/ports/stb/CONTROL index b048cb8a057b53..d54f21412a5221 100644 --- a/ports/stb/CONTROL +++ b/ports/stb/CONTROL @@ -1,4 +1,4 @@ Source: stb -Version: 2020-02-08-1 +Version: 2020-02-08 Homepage: https://github.com/nothings/stb Description: public domain header-only libraries diff --git a/ports/stb/vcpkg-cmake-wrapper.cmake b/ports/stb/vcpkg-cmake-wrapper.cmake index e787d29f05cbe3..e13d523becdc6d 100644 --- a/ports/stb/vcpkg-cmake-wrapper.cmake +++ b/ports/stb/vcpkg-cmake-wrapper.cmake @@ -1,6 +1,8 @@ set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -_find_package(${ARGS}) +if(NOT Stb_INCLUDE_DIR) + _find_package(${ARGS}) +endif() set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH}) diff --git a/ports/stx/CMakeLists.patch b/ports/stx/CMakeLists.patch deleted file mode 100644 index 70aaccbfda8e73..00000000000000 --- a/ports/stx/CMakeLists.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e4ed99e..b0d2b15 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -204,12 +204,7 @@ endif() - # =============================================== - - if(STX_ENABLE_BACKTRACE) -- if(NOT EXISTS third_party/abseil) -- execute_process( -- COMMAND git submodule update --init --recursive third_party/abseil -- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -- endif() -- add_subdirectory(third_party/abseil) -+ find_package(absl CONFIG REQUIRED) - endif() - - # the atomics library doesn't automatically link on my Android phone -@@ -246,13 +241,17 @@ else() - add_library(stx STATIC ${STX_SRCS}) - endif() - --target_include_directories(stx PUBLIC include) -+target_include_directories(stx PUBLIC -+ $ -+ $ -+) -+ - target_compile_options(stx PRIVATE ${STX_FLAGS} ${STX_WARNING_FLAGS}) - target_compile_definitions(stx PUBLIC ${STX_COMPILER_DEFS}) - target_link_libraries(stx ${STX_LIB_DEPENDENCIES}) - - if(STX_ENABLE_BACKTRACE) -- target_link_libraries(stx absl::stacktrace absl::symbolize) -+ target_link_libraries(stx PUBLIC absl::stacktrace absl::symbolize) - endif() - - if(ANDROID) -@@ -288,6 +287,7 @@ endif() - # - # =============================================== - -+ - if(STX_BUILD_BENCHMARKS) - - if(NOT EXISTS third_party/benchmark) -@@ -433,3 +433,24 @@ if(STX_BUILD_DOCS) - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/docs/html/assets) - - endif() -+ -+install( -+ TARGETS stx -+ EXPORT stx -+ ARCHIVE DESTINATION lib -+ LIBRARY DESTINATION lib -+ RUNTIME DESTINATION bin -+) -+ -+install( -+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ -+ DESTINATION include -+ FILES_MATCHING PATTERN "*.h*") -+ -+install( -+ EXPORT stx -+ DESTINATION share/stx -+ FILE stxConfig.cmake -+ NAMESPACE stx:: -+) -+ diff --git a/ports/stx/CONTROL b/ports/stx/CONTROL deleted file mode 100644 index cd6886925d1d35..00000000000000 --- a/ports/stx/CONTROL +++ /dev/null @@ -1,8 +0,0 @@ -Source: stx -Version: 1.0.1 -Homepage: https://github.com/lamarrr/STX -Description: C++17 & C++ 20 error-handling and utility extensions - -Feature: backtrace -Description: stacktrace support for STX -Build-Depends: abseil diff --git a/ports/stx/portfile.cmake b/ports/stx/portfile.cmake deleted file mode 100644 index ebfca54ab39778..00000000000000 --- a/ports/stx/portfile.cmake +++ /dev/null @@ -1,35 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO lamarrr/STX - REF v1.0.1 - SHA512 544ca32f07cd863082fa9688f5d56e2715b0129ff90d2a8533cc24a92c943e5848c4b2b06a71f54c12668f6e89e9e3c649f595f9eb886f671a5fa18d343f794b - HEAD_REF master - PATCHES - "CMakeLists.patch" -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - backtrace STX_ENABLE_BACKTRACE -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - ${FEATURE_OPTIONS} - -DSTX_BUILD_DOCS=OFF - -DSTX_BUILD_BENCHMARKS=OFF - -DSTX_BUILD_SHARED=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/stx) -vcpkg_copy_pdbs() - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/include" -) diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 722dac00485e74..5481ea4014540a 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,7 +1,6 @@ Source: suitesparse -Version: 5.4.0 -Port-Version: 7 -Build-Depends: lapack +Version: 5.4.0-6 +Build-Depends: clapack (!osx) Homepage: http://faculty.cse.tamu.edu/davis/SuiteSparse Description: algebra library diff --git a/ports/teemo/CONTROL b/ports/teemo/CONTROL index 843f68e834b1a2..159990ec4fa89e 100644 --- a/ports/teemo/CONTROL +++ b/ports/teemo/CONTROL @@ -1,5 +1,5 @@ Source: teemo -Version: 2.1 -Build-Depends: curl[non-http] +Version: 1.3 +Build-Depends: curl[non-http], cpprestsdk Description: C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed. Homepage: https://github.com/winsoft666/teemo \ No newline at end of file diff --git a/ports/teemo/portfile.cmake b/ports/teemo/portfile.cmake index 55afaf490f1fef..b6baba5637bf49 100644 --- a/ports/teemo/portfile.cmake +++ b/ports/teemo/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO winsoft666/teemo - REF 99b012f827ba126fe43986e6c9266f656120edd6 - SHA512 b6fcbba897b370154965a5e884a6dbd13aa1dab1ec25f404125b62f3857752b5c8e791a90014ef058e839c21f1deae8b88df2d9a8084a9e48f7f676561aa9dc9 + REF 1ee566747fba3febade554718a2db6a6c71c6fc4 + SHA512 10b391a0c629bdcd3737c1e04ac09300412322c8a4b87a8008d368663a223442fe7d7dac4fbd423b5051afcab60bb4c619cfc451a9c5902d396b7a7081a4d3c4 HEAD_REF master ) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 6fa024164b5297..a9830adb24f719 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,6 +1,5 @@ Source: tensorflow-cc -Version: 1.14 -Port-Version: 4 +Version: 1.14-3 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index fdd95307c4bc38..8d2c187b057b86 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -47,7 +47,6 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VS} $ENV{VSInstallDir}) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) - set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() # tensorflow has long file names, which will not work on windows @@ -80,7 +79,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) message(STATUS "Configuring TensorFlow") vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index f37049768efb92..d8f79b2f90c2f3 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,5 +1,5 @@ Source: tiff -Version: 4.1.0 +Version: 4.0.10-9 Build-Depends: zlib, libjpeg-turbo, liblzma Homepage: https://download.osgeo.org/libtiff Description: A library that supports the manipulation of TIFF image files diff --git a/ports/tiff/cmakelists.patch b/ports/tiff/cmakelists.patch index a82de0452b33be..597c980c5571f4 100644 --- a/ports/tiff/cmakelists.patch +++ b/ports/tiff/cmakelists.patch @@ -73,6 +73,21 @@ diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index 1cf1b75..4ee29f6 100644 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt +@@ -104,11 +104,11 @@ set(tiffxx_HEADERS + set(tiffxx_SOURCES + tif_stream.cxx) + +-if(WIN32_IO) +- extra_dist(tif_unix.c) ++if(USE_WIN32_FILEIO) ++ extra_dist(tif_win32.c) + list(APPEND tiff_SOURCES tif_win32.c) + else() +- extra_dist(tif_win32.c) ++ extra_dist(tif_unix.c) + list(APPEND tiff_SOURCES tif_unix.c) + endif() + @@ -143,7 +143,7 @@ install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index ab610d3287484b..828e8ec0baedf0 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,9 +1,9 @@ -set(LIBTIFF_VERSION 4.1.0) +set(LIBTIFF_VERSION 4.0.10) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz" FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz" - SHA512 fd541dcb11e3d5afaa1ec2f073c9497099727a52f626b338ef87dc93ca2e23ca5f47634015a4beac616d4e8f05acf7b7cd5797fb218758cc2ad31b390491c5a6 + SHA512 d213e5db09fd56b8977b187c5a756f60d6e3e998be172550c2892dbdb4b2a8e8c750202bc863fe27d0d1c577ab9de1710d15e9f6ed665aadbfd857525a81eea8 ) vcpkg_extract_source_archive_ex( @@ -49,8 +49,8 @@ file(REMOVE_RECURSE ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff) +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff RENAME copyright) if ("tool" IN_LIST FEATURES) file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) diff --git a/ports/tlx/CONTROL b/ports/tlx/CONTROL deleted file mode 100644 index b65af72604a4ca..00000000000000 --- a/ports/tlx/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: tlx -Version: 0.5.20191212 -Homepage: https://github.com/tlx/tlx -Description: tlx is a collection of C++ helpers and extensions universally needed, but not found in the STL diff --git a/ports/tlx/portfile.cmake b/ports/tlx/portfile.cmake deleted file mode 100644 index 525894d28041b9..00000000000000 --- a/ports/tlx/portfile.cmake +++ /dev/null @@ -1,38 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -# TODO: Fix .dlls not producing .lib files - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO tlx/tlx - REF 903b9b35df8731496a90d8d74f8bedbad2517d9b - SHA512 17087973f2f4751538c589e9f80d2b5ea872d2e7d90659769ae3350d441bda0b64aec9a4150d01a7cf5323ce327ebd104cdca7b4a3bc4eebdf574e71e013ba6e - HEAD_REF master -) - -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DVERBOSE=1 - -DTLX_BUILD_TESTS=off - -DTLX_USE_GCOV=off - -DTLX_TRY_COMPILE_HEADERS=off - -DTLX_MORE_TESTS=off - -DTLX_BUILD_STATIC_LIBS=${BUILD_STATIC} - -DTLX_BUILD_SHARED_LIBS=${BUILD_SHARED} -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake/") -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/tlx") -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/tomlplusplus/CONTROL b/ports/tomlplusplus/CONTROL deleted file mode 100644 index 5cba84a104489a..00000000000000 --- a/ports/tomlplusplus/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: tomlplusplus -Version: 2.1.0 -Homepage: https://marzer.github.io/tomlplusplus/ -Description: Header-only TOML config file parser and serializer for modern C++. -Supports: !(arm|uwp|linux|osx) diff --git a/ports/tomlplusplus/portfile.cmake b/ports/tomlplusplus/portfile.cmake deleted file mode 100644 index 26b8f81713fafd..00000000000000 --- a/ports/tomlplusplus/portfile.cmake +++ /dev/null @@ -1,25 +0,0 @@ -vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO marzer/tomlplusplus - REF v2.1.0 - SHA512 7bd0ea4ecfc90946487acd545bc8635a85353506c90553f4a6f8e3d83c30f85ac12e1ce82c10e03a4ea335c1b622e64ea0753efca9b2829907996e3a6d28867a - HEAD_REF master -) - -vcpkg_configure_meson( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DGENERATE_CMAKE_CONFIG=enabled - -DBUILD_TESTS=disabled - -DBUILD_EXAMPLES=disabled -) - -vcpkg_install_meson() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -vcpkg_fixup_pkgconfig() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/treehopper/CONTROL b/ports/treehopper/CONTROL index b54e10dde0f5ad..f50e84f1b74462 100644 --- a/ports/treehopper/CONTROL +++ b/ports/treehopper/CONTROL @@ -1,5 +1,5 @@ Source: treehopper -Version: 1.11.3-4 +Version: 1.11.3-3 Description: Treehopper connects the physical world to your computer, tablet, or smartphone. Homepage: https://treehopper.io Build-Depends: libusb diff --git a/ports/treehopper/portfile.cmake b/ports/treehopper/portfile.cmake index c9e9855ceffbe4..46ed0d85e386d1 100644 --- a/ports/treehopper/portfile.cmake +++ b/ports/treehopper/portfile.cmake @@ -1,3 +1,5 @@ +include(vcpkg_common_functions) + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( @@ -16,9 +18,8 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - file(INSTALL ${SOURCE_PATH}/C++/API/inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Treehopper/) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/treehopper RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/vc/CONTROL b/ports/vc/CONTROL deleted file mode 100644 index e56fda2d669037..00000000000000 --- a/ports/vc/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: vc -Version: 1.4.1 -Homepage: https://github.com/VcDevel/Vc -Description: SIMD Vector Classes for C++ . -Supports: !arm64 diff --git a/ports/vc/correct_cmake_config_path.patch b/ports/vc/correct_cmake_config_path.patch deleted file mode 100644 index bb1d5437b3d5a3..00000000000000 --- a/ports/vc/correct_cmake_config_path.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cmake/VcConfig.cmake.in b/cmake/VcConfig.cmake.in -index 36de476..5cb0e5b 100644 ---- a/cmake/VcConfig.cmake.in -+++ b/cmake/VcConfig.cmake.in -@@ -4,7 +4,7 @@ - set_and_check(@PROJECT_NAME@_INSTALL_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@) - set_and_check(@PROJECT_NAME@_INCLUDE_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/include) - set_and_check(@PROJECT_NAME@_LIB_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@) --set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR ${@PROJECT_NAME@_LIB_DIR}/cmake/Vc) -+set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/share/vc) - set(@PROJECT_NAME@_VERSION_STRING "@PROJECT_VERSION@") - - ### Setup @PROJECT_NAME@ defaults -@@ -20,7 +20,7 @@ list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_COMPILE_FLAGS}) - list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_ARCHITECTURE_FLAGS}) - - ### Import targets --include("@PACKAGE_CMAKE_INSTALL_PREFIX@/@PACKAGE_INSTALL_DESTINATION@/@PROJECT_NAME@Targets.cmake") -+include(${@PROJECT_NAME@_CMAKE_MODULES_DIR}/@PROJECT_NAME@Targets.cmake) - - ### Define @PROJECT_NAME@_LIBRARIES for backwards compatibility - get_target_property(vc_lib_location @PROJECT_NAME@::Vc INTERFACE_LOCATION) diff --git a/ports/vc/portfile.cmake b/ports/vc/portfile.cmake deleted file mode 100644 index b5b0da5fb526ec..00000000000000 --- a/ports/vc/portfile.cmake +++ /dev/null @@ -1,26 +0,0 @@ -vcpkg_fail_port_install(ON_ARCH "arm64") - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO VcDevel/Vc - REF 1.4.1 - SHA512 dd17e214099796c41d70416d365ea038c00c5fda285b05e48d7ee4fe03f4db2671d2be006ca7b98b0d4133bfcb57faf04cecfe35c29c3b006cd91c9a185cc04a - HEAD_REF master - PATCHES - "correct_cmake_config_path.patch" -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - -DBUILD_TESTING=OFF - -DBUILD_EXAMPLES=OFF -) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Vc/) -vcpkg_copy_pdbs() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/vcpkg-gfortran/CONTROL b/ports/vcpkg-gfortran/CONTROL deleted file mode 100644 index 80484175a4440a..00000000000000 --- a/ports/vcpkg-gfortran/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: vcpkg-gfortran -Version: 1 -Description: Metaport to install gfortran dependencies from msys if VCPKG_USE_EXTERNAL_Fortran is false -Supports: windows & !arm \ No newline at end of file diff --git a/ports/vcpkg-gfortran/portfile.cmake b/ports/vcpkg-gfortran/portfile.cmake deleted file mode 100644 index 5dd1965cd8b1c2..00000000000000 --- a/ports/vcpkg-gfortran/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "linux" "osx") -include(vcpkg_find_fortran) -vcpkg_find_fortran(FORTRAN_CMAKE) -if(VCPKG_USE_INTERNAL_Fortran) - set(VCPKG_CRT_LINKAGE dynamic) # Will always be dynamic no way to overwrite internal CRT linkage here - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) - endif() - - if(HOST_ARCH MATCHES "(amd|AMD)64") - set(MINGW_W w64) - set(MSYS_HOST x86_64) - elseif(HOST_ARCH MATCHES "(x|X)86") - set(MINGW_W w32) - set(MSYS_HOST i686) - else() - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH}!" ) - endif() - - if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") - set(MSYS_TARGET x86_64) - set(MINGW_W_TARGET 64) - set(GCC_LIB_SUFFIX s_seh-1) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") - set(MSYS_TARGET i686) - set(MINGW_W_TARGET 32) - set(GCC_LIB_SUFFIX s_dw2-1) - else() - message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" ) - endif() - - - vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran") # TODO: make x86 work - - set(MINGW_BIN "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/bin/") - set(MINGW_Fortran_DLLS "${MINGW_BIN}/libgfortran-5.dll" - "${MINGW_BIN}/libquadmath-0.dll" - "${MINGW_BIN}/libwinpthread-1.dll" - "${MINGW_BIN}/libgcc_${GCC_LIB_SUFFIX}.dll") - file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") - file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") - set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled) # due to outdated msvcrt - set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) - set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) - file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/winpthreads" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license") - file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/gcc-libs" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license") - file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/crt/COPYING.MinGW-w64-runtime.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -else() - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -endif() \ No newline at end of file diff --git a/ports/vtk/6811.patch b/ports/vtk/6811.patch deleted file mode 100644 index 86dca7ea0ca298..00000000000000 --- a/ports/vtk/6811.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 34b9d59acb1688f4a9f38908760d5756a0e05ee4 Mon Sep 17 00:00:00 2001 -From: Julien Schueller -Date: Fri, 24 Apr 2020 08:28:23 -0400 -Subject: [PATCH] vtk_hdf5: Stick to 1.10.x API - -Closes #17866 ---- - ThirdParty/hdf5/vtk_hdf5.h.in | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/ThirdParty/hdf5/vtk_hdf5.h.in b/ThirdParty/hdf5/vtk_hdf5.h.in -index 1d802937ba..c4738b2cbf 100644 ---- a/ThirdParty/hdf5/vtk_hdf5.h.in -+++ b/ThirdParty/hdf5/vtk_hdf5.h.in -@@ -18,6 +18,8 @@ - /* Use the hdf5 library configured for VTK. */ - #cmakedefine01 VTK_MODULE_USE_EXTERNAL_vtkhdf5 - -+#define H5_USE_110_API -+ - #if VTK_MODULE_USE_EXTERNAL_vtkhdf5 - #cmakedefine01 vtkhdf5_is_parallel - #if vtkhdf5_is_parallel --- -GitLab - diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 089dc11b67b310..42af4d39a17682 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -109,7 +109,6 @@ vcpkg_from_github( SHA512 0efb1845053b6143e5ee7fa081b8be98f6825262c59051e88b2be02497e23362055067b2f811eff82e93eb194e5a9afd2a12e3878a252eb4011a5dab95127a6f HEAD_REF master PATCHES - 6811.patch FindLZMA.patch # Will be fixed in 9.1? FindLZ4.patch Findproj.patch diff --git a/ports/vxl/CONTROL b/ports/vxl/CONTROL index 4e6ba9d27b76be..d95016ac05c008 100644 --- a/ports/vxl/CONTROL +++ b/ports/vxl/CONTROL @@ -1,7 +1,8 @@ Source: vxl Version: 2.0.2 -Port-Version: 2 +Port-Version: 1 Build-Depends: bzip2, expat, libgeotiff, libjpeg-turbo, libpng, shapelib, tiff, zlib +# Build-Depends: bzip2, dcmtk, expat, libgeotiff, libjpeg-turbo, openjpeg, libpng, shapelib, tiff, zlib Description: A multi-platform collection of C++ software libraries for Computer Vision and Image Understanding. Feature: core-imaging diff --git a/ports/vxl/fix_dependency.patch b/ports/vxl/fix_dependency.patch index 88cecfd660c70d..1c8e2ad54921b2 100644 --- a/ports/vxl/fix_dependency.patch +++ b/ports/vxl/fix_dependency.patch @@ -1,13 +1,13 @@ -diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index 3483f9c..57e149b 100644 ---- a/core/CMakeLists.txt -+++ b/core/CMakeLists.txt -@@ -100,7 +100,7 @@ endif() - - - # coordinate systems --if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS) -+if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS AND VXL_BUILD_CORE_IMAGING) - add_subdirectory(vcsl) - add_subdirectory(vpgl) - endif() +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index b6af7c2..7ca75d3 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -100,7 +100,7 @@ endif() + + + # coordinate systems +-if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS) ++if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS AND BUILD_CORE_IMAGING) + add_subdirectory(vcsl) + add_subdirectory(vpgl) + endif() diff --git a/ports/vxl/portfile.cmake b/ports/vxl/portfile.cmake index c3124ce202c978..232cfa3a534a9c 100644 --- a/ports/vxl/portfile.cmake +++ b/ports/vxl/portfile.cmake @@ -1,8 +1,8 @@ -set(VXL_BUILD_CORE_IMAGING OFF) +set(BUILD_CORE_IMAGING OFF) if("core-imaging" IN_LIST FEATURES) - set(VXL_BUILD_CORE_IMAGING ON) + set(BUILD_CORE_IMAGING ON) if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openjpeg.h") - set(VXL_BUILD_CORE_IMAGING OFF) + set(BUILD_CORE_IMAGING OFF) message(WARNING "Can't build VXL CORE_IMAGING features with non built-in OpenJpeg. Please remove OpenJpeg, and try install VXL again if you need them.") endif() endif() @@ -18,7 +18,7 @@ vcpkg_from_github( ) set(USE_WIN_WCHAR_T OFF) -if(VCPKG_TARGET_IS_WINDOWS) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(USE_WIN_WCHAR_T ON) endif() @@ -26,9 +26,9 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DVXL_BUILD_EXAMPLES=OFF + -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DVXL_BUILD_CORE_IMAGING=${VXL_BUILD_CORE_IMAGING} + -DBUILD_CORE_IMAGING=${BUILD_CORE_IMAGING} -DVXL_FORCE_V3P_BZLIB2=OFF -DVXL_USING_NATIVE_BZLIB2=TRUE # for disable build built-in bzip2 (v3p/bzlib/CMakeLists.txt#L10-L26) -DVXL_FORCE_V3P_CLIPPER=ON # TODO : need add clipper port to turn off @@ -41,7 +41,7 @@ vcpkg_configure_cmake( -DVXL_FORCE_V3P_TIFF=OFF -DVXL_FORCE_V3P_ZLIB=OFF -DVXL_USE_DCMTK=OFF # TODO : need fix dcmtk support to turn on - -DVXL_USE_GEOTIFF=ON + -DXVL_USE_GEOTIFF=ON -DVXL_USE_WIN_WCHAR_T=${USE_WIN_WCHAR_T} ) @@ -53,4 +53,5 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +# diff --git a/ports/wavpack/CONTROL b/ports/wavpack/CONTROL index a0052e027638ef..e8edf703e09939 100644 --- a/ports/wavpack/CONTROL +++ b/ports/wavpack/CONTROL @@ -1,6 +1,4 @@ Source: wavpack -Version: 5.2.0 -Port-Version: 1 +Version: 5.2.0 Homepage: https://github.com/dbry/WavPack Description: WavPack encode/decode library, command-line programs, and several plugins -Supports: !(arm|arm64) \ No newline at end of file diff --git a/ports/wavpack/portfile.cmake b/ports/wavpack/portfile.cmake index f2b7d87cf1acca..c59374aa36524d 100644 --- a/ports/wavpack/portfile.cmake +++ b/ports/wavpack/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(ON_ARCH "arm" "arm64") +include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -24,14 +24,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/WavPack) -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# Post-build test for cmake libraries +# vcpkg_test_cmake(PACKAGE_NAME wavpack) diff --git a/ports/winpcap/CONTROL b/ports/winpcap/CONTROL index c745c2d96ae12f..14960d89d86c2b 100644 --- a/ports/winpcap/CONTROL +++ b/ports/winpcap/CONTROL @@ -1,5 +1,4 @@ Source: winpcap -Version: 4.1.3 -Port-Version: 4 +Version: 4.1.3-3 Homepage: https://www.winpcap.org Description: WinPcap is the industry-standard tool for link-layer network access in Windows environments. diff --git a/ports/winpcap/portfile.cmake b/ports/winpcap/portfile.cmake index 8549c543d26c8a..62183624fdd5df 100644 --- a/ports/winpcap/portfile.cmake +++ b/ports/winpcap/portfile.cmake @@ -45,7 +45,12 @@ vcpkg_extract_source_archive_ex( "${CMAKE_CURRENT_LIST_DIR}/fix-create-lib-batch.patch" ) -file(COPY "${CURRENT_PORT_DIR}/create_bin.bat" DESTINATION ${SOURCE_PATH}) +file( + COPY + "${CURRENT_PORT_DIR}/create_bin.bat" + DESTINATION + ${SOURCE_PATH} +) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM Win32) @@ -106,7 +111,8 @@ vcpkg_execute_required_process( LOGNAME create_include-${TARGET_TRIPLET} ) -file(INSTALL +file( + INSTALL "${SOURCE_PATH}/WpdPack/Include/bittypes.h" "${SOURCE_PATH}/WpdPack/Include/ip6_misc.h" "${SOURCE_PATH}/WpdPack/Include/Packet32.h" @@ -116,9 +122,12 @@ file(INSTALL "${SOURCE_PATH}/WpdPack/Include/pcap-stdinc.h" "${SOURCE_PATH}/WpdPack/Include/remote-ext.h" "${SOURCE_PATH}/WpdPack/Include/Win32-Extensions.h" - DESTINATION ${CURRENT_PACKAGES_DIR}/include) + DESTINATION + ${CURRENT_PACKAGES_DIR}/include +) -file(INSTALL +file( + INSTALL "${SOURCE_PATH}/WpdPack/Include/pcap/bluetooth.h" "${SOURCE_PATH}/WpdPack/Include/pcap/bpf.h" "${SOURCE_PATH}/WpdPack/Include/pcap/namedb.h" @@ -126,7 +135,9 @@ file(INSTALL "${SOURCE_PATH}/WpdPack/Include/pcap/sll.h" "${SOURCE_PATH}/WpdPack/Include/pcap/usb.h" "${SOURCE_PATH}/WpdPack/Include/pcap/vlan.h" - DESTINATION ${CURRENT_PACKAGES_DIR}/include/pcap) + DESTINATION + ${CURRENT_PACKAGES_DIR}/include/pcap +) vcpkg_execute_required_process( COMMAND ${SOURCE_PATH}/create_lib.bat @@ -139,15 +150,21 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(PCAP_LIBRARY_PATH "${PCAP_LIBRARY_PATH}/x64") endif() -file(INSTALL +file( + INSTALL "${PCAP_LIBRARY_PATH}/Packet.lib" "${PCAP_LIBRARY_PATH}/wpcap.lib" - DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + DESTINATION + ${CURRENT_PACKAGES_DIR}/lib +) -file(INSTALL +file( + INSTALL "${PCAP_LIBRARY_PATH}/debug/Packet.lib" "${PCAP_LIBRARY_PATH}/debug/wpcap.lib" - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + DESTINATION + ${CURRENT_PACKAGES_DIR}/debug/lib +) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_execute_required_process( @@ -161,17 +178,21 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PCAP_BINARY_PATH "${PCAP_BINARY_PATH}/x64") endif() - file(INSTALL + file( + INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + DESTINATION + ${CURRENT_PACKAGES_DIR}/bin + ) - file(INSTALL + file( + INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + DESTINATION + ${CURRENT_PACKAGES_DIR}/debug/bin + ) endif() -vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/pcap-stdinc.h "#define inline __inline" "#ifndef __cplusplus\n#define inline __inline\n#endif") - -configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/winpcap/copyright COPYONLY) diff --git a/ports/wpilib/CONTROL b/ports/wpilib/CONTROL index 913521505e8b5f..deef611ea76479 100644 --- a/ports/wpilib/CONTROL +++ b/ports/wpilib/CONTROL @@ -1,9 +1,8 @@ Source: wpilib -Version: 2020.3.2 +Version: 2020.1.1 Homepage: https://github.com/wpilibsuite/allwpilib Build-Depends: eigen3, libuv Description: WPILib is the software library package for the FIRST Robotics Competition. The core install includes wpiutil, a common utilies library, and ntcore, the base NetworkTables library. -Supports: !osx Feature: cameraserver Build-Depends: opencv diff --git a/ports/wpilib/portfile.cmake b/ports/wpilib/portfile.cmake index cbe4051f75fec1..15041d84ba55cf 100644 --- a/ports/wpilib/portfile.cmake +++ b/ports/wpilib/portfile.cmake @@ -3,23 +3,30 @@ vcpkg_fail_port_install(ON_TARGET "OSX") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wpilibsuite/allwpilib - REF 35eb90c135eba994a2ca2cbd50a68c367910f4b6 - SHA512 55bc608632ab67c097f3cce7c5ad9790b2b123a633c93bf5b4008f90bf79538cc142c911850d5f49b75e3a12f43ffad9f6f5f9bcdf1351cce7513ecc4b04e439 + REF e874ba9313a8243aa18eefb13e1d88a3999dd80e + SHA512 9a2e7abb3739008ed59e716d241a4ec8f0848c655ae8bb7e5bd98090109d6d86115c97ef16ea8881cc28715b691d873ab7be77b515efed8c361cb1f47745697f ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - cameraserver WITHOUT_CSCORE - allwpilib WITHOUT_ALLWPILIB -) +set(WITHOUT_JAVA ON) +set(WITHOUT_CSCORE ON) +set(WITHOUT_ALLWPILIB ON) + +if ("cameraserver" IN_LIST FEATURES) + set(WITHOUT_CSCORE OFF) +endif() + +if ("allwpilib" IN_LIST FEATURES) + set(WITHOUT_ALLWPILIB OFF) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DWITHOUT_JAVA=ON - ${FEATURE_OPTIONS} + -DWITHOUT_JAVA=${WITHOUT_JAVA} + -DWITHOUT_CSCORE=${WITHOUT_CSCORE} + -DWITHOUT_ALLWPILIB=${WITHOUT_ALLWPILIB} -DUSE_VCPKG_LIBUV=ON -DUSE_VCPKG_EIGEN=ON -DFLAT_INSTALL_WPILIB=ON @@ -28,27 +35,26 @@ vcpkg_install_cmake() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/ntcore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpiutil/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) - -if ("allwpilib" IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) +if (NOT WITHOUT_ALLWPILIB) +file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/gen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) endif() - -if ("cameraserver" IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +if (NOT WITHOUT_CSCORE) +file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) endif() if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") endif() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") @@ -59,4 +65,4 @@ file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAG vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wpilib RENAME copyright) diff --git a/ports/wtl/CONTROL b/ports/wtl/CONTROL index db55ce52f709d0..63f618d9b656cd 100644 --- a/ports/wtl/CONTROL +++ b/ports/wtl/CONTROL @@ -1,4 +1,4 @@ Source: wtl -Version: 10.0.10077 +Version: 10.0-10 Homepage: https://sourceforge.net/projects/wtl/ Description: Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake index 0f8d189a867d4a..e72367e73dd3d6 100644 --- a/ports/wtl/portfile.cmake +++ b/ports/wtl/portfile.cmake @@ -1,10 +1,10 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO wtl/WTL%2010 - REF WTL%2010.0.10077 - FILENAME "WTL10_1077..zip" + REF WTL%2010.0.9163 + FILENAME "WTL10_9163.zip" NO_REMOVE_ONE_LEVEL - SHA512 5a49283196caf5b2ad8a3fb3cfa5d09cd555d59d4d5871408bf6a5b850cf4546cc6ece4e0bf79d152a4d2589fae3749f0f3e73ab6a3a7bc0cb373efa1474b98b + SHA512 feb7fb1c456e44ad05610f31f8c0f964eb6ce3eadf65a389219051f0ea2547069727666616622631cd90e25ea4a682a7c88c7089a374181870717246ad44e035 ) file(INSTALL ${SOURCE_PATH}/Include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT} FILES_MATCHING PATTERN "*.h") diff --git a/ports/wxwidgets/CONTROL b/ports/wxwidgets/CONTROL index 357ab8f8b0b59a..e69ead3add70a4 100644 --- a/ports/wxwidgets/CONTROL +++ b/ports/wxwidgets/CONTROL @@ -1,6 +1,5 @@ Source: wxwidgets -Version: 3.1.4 -Port-Version: 1 +Version: 3.1.3-1 Homepage: https://github.com/wxWidgets/wxWidgets Description: wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. -Build-Depends: zlib, libpng, tiff, expat \ No newline at end of file +Build-Depends: zlib, libpng, tiff, expat diff --git a/ports/wxwidgets/disable-platform-lib-dir.patch b/ports/wxwidgets/disable-platform-lib-dir.patch index 930477c010327d..2a1de613eed16f 100644 --- a/ports/wxwidgets/disable-platform-lib-dir.patch +++ b/ports/wxwidgets/disable-platform-lib-dir.patch @@ -1,13 +1,13 @@ diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake -index d013e92..c03135d 100644 +index 06256b1..2960a31 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake -@@ -149,7 +149,7 @@ else() +@@ -66,7 +66,7 @@ else() set(wxCOMPILER_PREFIX) endif() --if(MSVC) -+if(MSVC AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) +-if(MSVC OR MINGW) ++if((MSVC OR MINGW) AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) if(wxBUILD_SHARED) set(lib_suffix "dll") else() diff --git a/ports/wxwidgets/fix-macos-clipboard.patch b/ports/wxwidgets/fix-macos-clipboard.patch new file mode 100644 index 00000000000000..9f37cc1d9e1d36 --- /dev/null +++ b/ports/wxwidgets/fix-macos-clipboard.patch @@ -0,0 +1,26 @@ +diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp +index 274e200..6012d37 100644 +--- a/src/osx/carbon/clipbrd.cpp ++++ b/src/osx/carbon/clipbrd.cpp +@@ -60,7 +60,11 @@ void wxClipboard::Clear() + + bool wxClipboard::Flush() + { +- return false; ++ wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); ++ ++ wxOSXPasteboard::GetGeneralClipboard()->Flush(); ++ ++ return true; + } + + bool wxClipboard::Open() +@@ -105,6 +109,8 @@ bool wxClipboard::AddData( wxDataObject *data ) + + data->WriteToSink(wxOSXPasteboard::GetGeneralClipboard()); + ++ Flush(); ++ + m_data = data; + + return true; diff --git a/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch b/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch deleted file mode 100644 index e028112e7ece62..00000000000000 --- a/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch +++ /dev/null @@ -1,202 +0,0 @@ -From 590e32c60b1dfb32b34632f3d1b0b5cf7c8e4b84 Mon Sep 17 00:00:00 2001 -From: Maarten Bent -Date: Sat, 1 Aug 2020 11:54:26 +0200 -Subject: [PATCH] Fix building with wxUSE_STL enabled in VS2019 16.6 - -Exporting standard C++ library types is not allowed any more, see - -https://developercommunity.visualstudio.com/content/problem/1042081/142628801includexhash201332-error-c2338-this-funct.html - -so don't use DLL export declarations for wxHash{Map,Set} classes, which -derive from std::{map,set}. - -Since the classes are header-only, this should have no direct -consequences. Only classes that extend wxHashMap or wxHashSet, like -wxImageHistogram, have to be made header only as well. - -Remove the wxLogError message in wxImageHistogram::FindFirstUnusedColour, so -log.h and translation.h do not have to be included in the header. - -Closes https://github.com/wxWidgets/wxWidgets/pull/2009 ---- - include/wx/hashmap.h | 9 ++++++--- - include/wx/hashset.h | 6 ++++-- - include/wx/image.h | 42 ++++++++++++++++++++++++++++++++++++++---- - src/common/image.cpp | 43 ------------------------------------------- - 4 files changed, 48 insertions(+), 52 deletions(-) - -diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h -index df9092a3823..86700f40ca9 100644 ---- a/include/wx/hashmap.h -+++ b/include/wx/hashmap.h -@@ -678,24 +678,27 @@ public: \ - - // and these do exactly the same thing but should be used inside the - // library -+// note: DECL is not used since the class is inline - #define WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ -- _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) -+ _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) - - #define WX_DECLARE_EXPORTED_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, \ - CLASSNAME, class WXDLLIMPEXP_CORE ) - -+// note: DECL is not used since the class is inline - #define WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ - _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ -- CLASSNAME, DECL ) -+ CLASSNAME, class ) - - #define WX_DECLARE_EXPORTED_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ - WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ - class WXDLLIMPEXP_CORE ) - -+// note: DECL is not used since the class is inline - #define WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ - _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ -- CLASSNAME, DECL ) -+ CLASSNAME, class ) - - #define WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ - WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ -diff --git a/include/wx/hashset.h b/include/wx/hashset.h -index bb713b87f4f..311aeca9a6e 100644 ---- a/include/wx/hashset.h -+++ b/include/wx/hashset.h -@@ -159,8 +159,9 @@ public: \ - - // and these do exactly the same thing but should be used inside the - // library -+// note: DECL is not used since the class is inline - #define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ -- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, DECL ) -+ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, class ) - - #define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \ -@@ -173,8 +174,9 @@ public: \ - // common compilers (notably Sun CC). - #define WX_DECLARE_HASH_SET_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) -+// note: DECL is not used since the class is inline - #define WX_DECLARE_HASH_SET_WITH_DECL_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ -- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, DECL ) -+ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) - - // delete all hash elements - // -diff --git a/include/wx/image.h b/include/wx/image.h -index f2b5866d2d7..d53ff0b1165 100644 ---- a/include/wx/image.h -+++ b/include/wx/image.h -@@ -190,7 +190,7 @@ WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry, - wxIntegerHash, wxIntegerEqual, - wxImageHistogramBase); - --class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase -+class wxImageHistogram : public wxImageHistogramBase - { - public: - wxImageHistogram() : wxImageHistogramBase(256) { } -@@ -211,9 +211,43 @@ class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase - bool FindFirstUnusedColour(unsigned char *r, - unsigned char *g, - unsigned char *b, -- unsigned char startR = 1, -- unsigned char startG = 0, -- unsigned char startB = 0 ) const; -+ unsigned char r2 = 1, -+ unsigned char g2 = 0, -+ unsigned char b2 = 0 ) const -+ { -+ unsigned long key = MakeKey(r2, g2, b2); -+ -+ while ( find(key) != end() ) -+ { -+ // color already used -+ r2++; -+ if ( r2 >= 255 ) -+ { -+ r2 = 0; -+ g2++; -+ if ( g2 >= 255 ) -+ { -+ g2 = 0; -+ b2++; -+ if ( b2 >= 255 ) -+ { -+ return false; -+ } -+ } -+ } -+ -+ key = MakeKey(r2, g2, b2); -+ } -+ -+ if ( r ) -+ *r = r2; -+ if ( g ) -+ *g = g2; -+ if ( b ) -+ *b = b2; -+ -+ return true; -+ } - }; - - //----------------------------------------------------------------------------- -diff --git a/src/common/image.cpp b/src/common/image.cpp -index 096f823f0c1..880c1c4ea74 100644 ---- a/src/common/image.cpp -+++ b/src/common/image.cpp -@@ -3381,49 +3381,6 @@ wxImageHandler::GetResolutionFromOptions(const wxImage& image, int *x, int *y) - // image histogram stuff - // ---------------------------------------------------------------------------- - --bool --wxImageHistogram::FindFirstUnusedColour(unsigned char *r, -- unsigned char *g, -- unsigned char *b, -- unsigned char r2, -- unsigned char g2, -- unsigned char b2) const --{ -- unsigned long key = MakeKey(r2, g2, b2); -- -- while ( find(key) != end() ) -- { -- // color already used -- r2++; -- if ( r2 >= 255 ) -- { -- r2 = 0; -- g2++; -- if ( g2 >= 255 ) -- { -- g2 = 0; -- b2++; -- if ( b2 >= 255 ) -- { -- wxLogError(_("No unused colour in image.") ); -- return false; -- } -- } -- } -- -- key = MakeKey(r2, g2, b2); -- } -- -- if ( r ) -- *r = r2; -- if ( g ) -- *g = g2; -- if ( b ) -- *b = b2; -- -- return true; --} -- - bool - wxImage::FindFirstUnusedColour(unsigned char *r, - unsigned char *g, diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index c862fec3899d68..530605782383e2 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -1,12 +1,11 @@ +include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wxWidgets/wxWidgets - REF v3.1.4 - SHA512 108e35220de10afbfc58762498ada9ece0b3166f56a6d11e11836d51bfbaed1de3033c32ed4109992da901fecddcf84ce8a1ba47303f728c159c638dac77d148 + REF v3.1.3 + SHA512 4ecb5c2d13f9bda7aa3c12e887c351a0004509ec24bdd440542bec67e1b6dca20e7838a01236a71dd3cf2e1ba0653c40878047f406464cb2c9ee07c26d6f2599 HEAD_REF master - PATCHES - disable-platform-lib-dir.patch - fix-stl-build-vs2019-16.6.patch + PATCHES disable-platform-lib-dir.patch fix-macos-clipboard.patch ) set(OPTIONS) @@ -38,8 +37,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") @@ -59,16 +56,14 @@ if(DLLS) endforeach() endif() -# do the copy pdbs now after the dlls got moved to the expected /bin folder above -vcpkg_copy_pdbs() +# Handle copyright +file(COPY ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/wxwidgets/licence.txt ${CURRENT_PACKAGES_DIR}/share/wxwidgets/copyright) if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) endif() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/mswu) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/mswud) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index 0a4af3912f140f..b49bf0a7729147 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -1,6 +1,5 @@ Source: x264 -Version: 157-303c484ec828ed0 -Port-Version: 9 +Version: 157-303c484ec828ed0-8 Homepage: https://github.com/mirror/x264 Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format -Build-Depends: pthread (linux&osx) +Build-Depends: pthread (linux&osx) \ No newline at end of file diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 1c9e32e9251816..d7aff89d7b49b5 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -12,24 +12,9 @@ vcpkg_from_github( "uwp-cflags.patch" ) -if(VCPKG_TARGET_IS_WINDOWS) - _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) - _vcpkg_determine_autotools_target_cpu(HOST_ARCH) - list(APPEND OPTIONS --build=${BUILD_ARCH}-pc-mingw32) - list(APPEND OPTIONS --host=${HOST_ARCH}-pc-mingw32) -endif() - -if(VCPKG_TARGET_IS_UWP) - list(APPEND OPTIONS --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) - list(APPEND OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) -endif() - - vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - NO_ADDITIONAL_PATHS OPTIONS - ${OPTIONS} --enable-strip --disable-lavf --disable-swscale @@ -39,17 +24,21 @@ vcpkg_configure_make( --disable-lsmash --disable-asm --enable-debug - ) vcpkg_install_make() -vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN) +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/lib/pkgconfig + ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig + ${CURRENT_PACKAGES_DIR}/debug/bin/x264.exe + ${CURRENT_PACKAGES_DIR}/debug/include +) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/x264.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/x264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib) else() # force U_STATIC_IMPLEMENTATION macro file(READ ${CURRENT_PACKAGES_DIR}/include/x264.h HEADER_CONTENTS) @@ -62,8 +51,6 @@ else() ) endif() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) - vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/xbyak/CONTROL b/ports/xbyak/CONTROL index 5239d99c4b20d7..05a1956cfbd798 100644 --- a/ports/xbyak/CONTROL +++ b/ports/xbyak/CONTROL @@ -1,5 +1,5 @@ Source: xbyak -Version: 5.93 +Version: 5.911 Description: Xbyak is a JIT assembler for x86(IA-32)/x64(AMD64, x86-64). Homepage: https://github.com/herumi/xbyak Supports: !(arm|uwp) diff --git a/ports/xbyak/portfile.cmake b/ports/xbyak/portfile.cmake index b365c38fc29302..b07b372f307168 100644 --- a/ports/xbyak/portfile.cmake +++ b/ports/xbyak/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO herumi/xbyak - REF v5.93 - SHA512 0c7052b2aeffc1aec541991a644753327232428ba7d8719e250a3afcc66b26beca2b92476f17af8121ceaacd822515e65d082e94b9f72fa29b4a005e32065843 + REF v5.911 + SHA512 3cb6b1e73d7dc2a23dcb31310720f0d4b83b62cfc69ff09eeefafe032e58e04574419f668d5ca957e8fc21e679e25da059f6e93724949e0ff1fcaa6779b88bdd HEAD_REF master ) diff --git a/ports/xeus/Fix-Compile-nlohmann-json.patch b/ports/xeus/Fix-Compile-nlohmann-json.patch deleted file mode 100644 index 7381d14caaedfb..00000000000000 --- a/ports/xeus/Fix-Compile-nlohmann-json.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/xmessage.cpp b/src/xmessage.cpp -index 0d6ad99..621d838 100644 ---- a/src/xmessage.cpp -+++ b/src/xmessage.cpp -@@ -12,6 +12,7 @@ - #include - #include - #include -+#include - - #include "xeus/xguid.hpp" - #include "xeus/xmessage.hpp" diff --git a/ports/xeus/portfile.cmake b/ports/xeus/portfile.cmake index 577dbff1cb02c5..5dd646d7fa0fa8 100644 --- a/ports/xeus/portfile.cmake +++ b/ports/xeus/portfile.cmake @@ -4,9 +4,7 @@ vcpkg_from_github( REF 8408f237f33514610a59d19a5ff045ee70dfa02b SHA512 41282addbe5519b6d357e802c48483834cd951604bfeb8c99d96f02d03dec2fc66ea4c091f40ec09348bb60587e8a6efef5e6eb2bb950ba720fc8ceb7a107960 HEAD_REF master - PATCHES - Fix-TypeConversion.patch - Fix-Compile-nlohmann-json.patch + PATCHES Fix-TypeConversion.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) diff --git a/ports/xframe/CONTROL b/ports/xframe/CONTROL deleted file mode 100644 index a9b7721c116cd3..00000000000000 --- a/ports/xframe/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: xframe -Version: 0.3.0 -Description: xframe is a dataframe for C++, based on xtensor and xtl. -Homepage: https://github.com/xtensor-stack/xframe -Build-Depends: xtensor, xtl diff --git a/ports/xframe/portfile.cmake b/ports/xframe/portfile.cmake deleted file mode 100644 index cb3111bd984d20..00000000000000 --- a/ports/xframe/portfile.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# header-only library - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO xtensor-stack/xframe - REF 0.3.0 - SHA512 880fe8ca00bd189a197cc71e5f32539562db69433fdfa03db5f0db8211230db36eb96757a5ca3c667ae1d4edc96eae38393718e7a1e3f7c1827130cf21579b07 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/xframe) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) - -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index 3196577b552b85..b02b948ad50f87 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,5 +1,5 @@ Source: zlib Version: 1.2.11 -Port-Version: 8 +Port-Version: 7 Homepage: https://www.zlib.net/ Description: A compression library diff --git a/ports/zlib/add_debug_postfix_on_mingw.patch b/ports/zlib/add_debug_postfix_on_mingw.patch deleted file mode 100644 index 22172ccfcaaef0..00000000000000 --- a/ports/zlib/add_debug_postfix_on_mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..e4fc213 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,7 +59,7 @@ endif() - # - check_include_file(unistd.h Z_HAVE_UNISTD_H) - --if(MSVC) -+if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 14faef4c8f3512..c05e7e252aceab 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -12,7 +12,6 @@ vcpkg_extract_source_archive_ex( REF ${VERSION} PATCHES "cmake_dont_build_more_than_needed.patch" - "add_debug_postfix_on_mingw.patch" ) # This is generated during the cmake build diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index cda29f7e6aa051..80c547633e3a11 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -23,9 +23,6 @@ stages: displayName: Check the formatting of port manifests pool: $(windows-pool) dependsOn: [] - variables: - - name: VCPKG_DOWNLOADS - value: D:\downloads jobs: - job: workspace: @@ -35,7 +32,7 @@ stages: displayName: 'Check port manifest Formatting' inputs: filePath: 'scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1' - arguments: '-Root .' + arguments: '-Root . -Downloads D:\Downloads' - stage: run_port_ci displayName: 'Run the Port CI' dependsOn: diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 index 43ec7aa73ede28..b0e44765750b7e 100644 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -158,13 +158,8 @@ Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" Require-FileNotExists "$buildtreesRoot/rapidjson/src" Require-FileExists "$TestingRoot/packages.config" -if ($IsLinux -or $IsMacOS) { - mono $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" - Throw-IfFailed -} else { - & $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" - Throw-IfFailed -} +& $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" +Throw-IfFailed Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue mkdir $NuGetRoot @@ -182,15 +177,3 @@ Require-FileExists "$buildtreesRoot/tinyxml/src" if ((Get-ChildItem $NuGetRoot -Filter '*.nupkg' | Measure-Object).Count -ne 1) { throw "In '$CurrentTest': did not create exactly 1 NuGet package" } - -# Test export -$args = $commonArgs + @("export","rapidjson","tinyxml","--nuget","--nuget-id=vcpkg-export","--nuget-version=1.0.0","--output=vcpkg-export-output","--raw","--zip","--output-dir=$TestingRoot") -$CurrentTest = "./vcpkg $($args -join ' ')" -Write-Host $CurrentTest -Require-FileNotExists "$TestingRoot/vcpkg-export-output" -Require-FileNotExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" -Require-FileNotExists "$TestingRoot/vcpkg-export-output.zip" -./vcpkg @args -Require-FileExists "$TestingRoot/vcpkg-export-output" -Require-FileExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" -Require-FileExists "$TestingRoot/vcpkg-export-output.zip" diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index 969348980b779c..4d4eada627cbca 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -9,12 +9,6 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day - variables: - - name: WORKING_ROOT - value: /mnt/vcpkg-ci - - name: VCPKG_DOWNLOADS - value: /mnt/vcpkg-ci/downloads - steps: - bash: df -h displayName: 'Report on Disk Space' @@ -25,15 +19,17 @@ jobs: displayName: 'Create /home/agent' # Note: /mnt is the Azure machines' temporary disk. - bash: | - sudo mkdir ${{ variables.WORKING_ROOT }} -m=777 - sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} -m=777 + sudo mkdir /mnt/vcpkg-ci -m=777 + sudo mkdir /mnt/vcpkg-ci/downloads -m=777 exit 0 - displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' + displayName: 'Create /mnt/vcpkg-ci/downloads' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh arguments: "-buildTests" + env: + VCPKG_DOWNLOADS: '/mnt/vcpkg-ci/downloads' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' - task: PowerShell@2 @@ -41,7 +37,7 @@ jobs: inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot /mnt/vcpkg-ci -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md index 0395908f0174f0..b0fdde43464c6b 100644 --- a/scripts/azure-pipelines/osx/README.md +++ b/scripts/azure-pipelines/osx/README.md @@ -25,7 +25,7 @@ and `Setup-VagrantMachines.ps1`, and make sure to push any changes! Before anything else, one must download `brew` and `powershell`. ```sh -$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ brew cask install powershell ``` diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 index 5600cb1ed6fc84..fb153a28ab26b5 100755 --- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 +++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -19,7 +19,7 @@ The username for the archives share. .PARAMETER ArchivesAccessKey The access key for the archives share. -.PARAMETER ArchivesUrn +.PARAMETER ArchivesUri The URN of the archives share; looks like `foo.windows.core.net`. .PARAMETER ArchivesShare @@ -105,7 +105,7 @@ $configuration = @{ archives = @{ username = $ArchivesUsername; access_key = $ArchivesAccessKey; - urn = $ArchivesUrn; + url = $ArchivesUri; share = $ArchivesShare; }; } diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 index b7ad489bb7995a..6fffa15225944d 100644 --- a/scripts/azure-pipelines/osx/Utilities.psm1 +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -31,7 +31,7 @@ function Get-CommandExists [String]$Name ) - $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) + $null -ne (Get-Command -Name $Command -ErrorAction SilentlyContinue) } <# @@ -124,7 +124,6 @@ function Get-InstalledVirtualBoxExtensionPacks $currentString = "" $lines | ForEach-Object { - $Line = $_ if ($Line[0] -eq ' ') { $currentString += "`n$($Line.Trim())" } else { diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 6e48238a7e2a7b..cbf401fd353644 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -10,12 +10,6 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day - variables: - - name: WORKING_ROOT - value: /Users/vagrant/Data - - name: VCPKG_DOWNLOADS - value: /Users/vagrant/Data/downloads - steps: - bash: | df -h @@ -28,32 +22,27 @@ jobs: brew list libtool || brew install libtool brew list bison || brew install bison brew list gfortran || brew cask install gfortran - brew list mono || brew install mono - brew list yasm || brew install yasm displayName: 'Install brew dependencies' - bash: | - sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} || 0 - sudo chmod 777 ${{ variables.VCPKG_DOWNLOADS }} || 0 + sudo mkdir /Users/vagrant/Data/downloads || 0 + sudo chmod 777 /Users/vagrant/Data/downloads || 0 exit 0 - displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' + displayName: 'Create /Users/vagrant/Data/downloads' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh arguments: '-buildTests' + env: + VCPKG_DOWNLOADS: '/Users/vagrant/Data/downloads' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' - - task: PowerShell@2 - displayName: 'Run vcpkg end-to-end tests' - inputs: - filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' - arguments: '-Triplet x64-osx -WorkingRoot ${{ variables.WORKING_ROOT }}' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot ${{ variables.WORKING_ROOT }}/archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot /Users/vagrant/Data/archives -WorkingRoot /Users/vagrant/Data -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index 1e1cce50f06c99..b142b8189a95c2 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -29,7 +29,7 @@ devops_url = 'https://dev.azure.com/vcpkg' agent_pool = 'vcpkgAgentPool' pat = configuration['pat'] archives = configuration['archives'] -archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" +archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['url']}/#{archives['share']}" Vagrant.configure('2') do |config| # give them extra time to boot up @@ -42,25 +42,7 @@ Vagrant.configure('2') do |config| node.vm.hostname = machine[:hostname] node.vm.synced_folder '.', '/vagrant', disabled: true - diskname = "#{machine[:hostname]}-data.vmdk" - - # I don't like this, but as far as I can tell, it's the only way - # to do this. When vagrant finishes the `disk` feature, switch - # over to that -- Nicole Mazzuca - if (not File.exists? diskname) then - system "VBoxManage createmedium --filename #{diskname} --size #{1024 * 220}" - end - - node.vm.provider 'virtualbox' do |vb| - vb.memory = machine[:ram] - vb.cpus = machine[:cpu] - vb.customize ['modifyvm', :id, '--ioapic', 'on'] - vb.customize ['storageattach', :id, - '--storagectl', 'SATA Controller', - '--port', '1', '--device', '0', '--type', 'hdd', - '--medium', "#{diskname}" - ] - end + node.vm.disk :disk, name: "#{machine[:hostname]}-data", size: "#{config['disk_size']}GB" node.vm.provision 'shell', run: 'once', @@ -89,7 +71,7 @@ Vagrant.configure('2') do |config| node.vm.provision 'shell', run: 'once', name: 'Install brew and xcode command line tools', - inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', + inline: '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', privileged: false node.vm.provision 'shell', diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json index f0abc1673419ce..0518df3b6f1f43 100644 --- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -34,13 +34,13 @@ "required": [ "username", "access_key", - "urn", + "url", "share" ], "properties": { "username": { "type": "string" }, "access_key": { "type": "string" }, - "urn": { "type": "string" }, + "url": { "type": "string" }, "share": { "type": "string" } } } diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index 27ff3290ca0d27..9a30321b4637be 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -52,8 +52,7 @@ $commonArgs = @( '--binarycaching', "--x-buildtrees-root=$buildtreesRoot", "--x-install-root=$installRoot", - "--x-packages-root=$packagesRoot", - "--overlay-ports=scripts/test_ports" + "--x-packages-root=$packagesRoot" ) $binaryCachingMode = 'readwrite' diff --git a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 index 2adeeae45cdb19..7f300164f6b060 100644 --- a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 @@ -32,9 +32,9 @@ try $msg = @( "", "The formatting of the C++ files didn't match our expectation.", - "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#vcpkg-internal-code for solution." + "If your build fails here, you need to format the following files with:" ) - $msg += "File list:" + $msg += " $(& $clangFormat -version)" $msg += " $changedFiles" $msg += "" diff --git a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 index 6e97ba35c7f74f..e4f52ae7b44627 100644 --- a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 @@ -3,6 +3,8 @@ Param( [Parameter(Mandatory=$True)] [string]$Root, [Parameter()] + [string]$DownloadsDirectory, + [Parameter()] [switch]$IgnoreErrors # allows one to just format ) @@ -14,6 +16,11 @@ if (-not (Test-Path "$Root/.vcpkg-root")) throw } +if (-not [string]::IsNullOrEmpty($DownloadsDirectory)) +{ + $env:VCPKG_DOWNLOADS = $DownloadsDirectory +} + if (-not (Test-Path "$Root/vcpkg.exe")) { & "$Root/bootstrap-vcpkg.bat" @@ -25,20 +32,15 @@ if (-not (Test-Path "$Root/vcpkg.exe")) } & "$Root/vcpkg.exe" 'x-format-manifest' '--all' -if (-not $?) -{ - Write-Error "Failed formatting manifests; are they well-formed?" - throw -} - $changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $portsTree if (-not $IgnoreErrors -and $null -ne $changedFiles) { $msg = @( "", "The formatting of the manifest files didn't match our expectation.", - "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifest for solution." + "If your build fails here, you need to run:" ) + $msg += " vcpkg x-format-manifest --all" $msg += "" $msg += "vcpkg should produce the following diff:" diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 340138e124ac7f..5ec0b300c290b0 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -9,11 +9,6 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day - variables: - - name: WORKING_ROOT - value: D:\ - - name: VCPKG_DOWNLOADS - value: D:\downloads steps: - task: PowerShell@2 @@ -26,35 +21,35 @@ jobs: inputs: filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' # Note: D: is the Azure machines' temporary disk. - - script: .\bootstrap-vcpkg.bat + - task: CmdLine@2 displayName: 'Build vcpkg' + inputs: + script: | + set VCPKG_DOWNLOADS=D:\downloads + .\bootstrap-vcpkg.bat - task: CmdLine@2 displayName: "Build vcpkg with CMake and Run Tests" condition: eq('${{ parameters.triplet }}', 'x86-windows') inputs: script: | :: TRANSITION, get these tools on the VMs next time we roll them + set VCPKG_DOWNLOADS=D:\downloads .\vcpkg.exe fetch cmake .\vcpkg.exe fetch ninja - set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.0-windows;%PATH% + set PATH=D:\downloads\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;D:\downloads\tools\ninja-1.10.0-windows;%PATH% call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 rmdir /s /q build.x86.debug > nul 2> nul cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc ninja.exe -C build.x86.debug build.x86.debug\vcpkg-test.exe + powershell.exe -NoProfile -ExecutionPolicy Bypass "scripts\azure-pipelines\end-to-end-tests.ps1 -WorkingRoot \"%cd%\testing\" -triplet x86-windows" failOnStderr: true - - task: PowerShell@2 - displayName: 'Run vcpkg end-to-end tests' - condition: eq('${{ parameters.triplet }}', 'x86-windows') - inputs: - filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' - arguments: '-Triplet ${{ parameters.triplet }} -WorkingRoot ${{ variables.WORKING_ROOT }}' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot D:\ -ArtifactsDirectory $(System.ArtifactsDirectory)' - task: PowerShell@2 displayName: 'Report on Disk Space After Build' condition: always() @@ -73,6 +68,7 @@ jobs: inputs: targetType: inline script: | + $env:VCPKG_DOWNLOADS = "D:\downloads" ./vcpkg.exe fetch python3 & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\ - task: PublishBuildArtifacts@1 diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 8136a9799eb8aa..992cf37a29981a 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -11,68 +11,25 @@ if ($null -eq $portsDir) $portsDir = "$scriptsDir/../../ports" } -# Optionally clear this array when moving to a new boost version -$port_versions = @{ - "asio" = 1; - "context" = 1; - "coroutine" = 1; - "fiber" = 1; - "filesystem" = 1; - "graph-parallel" = 1; - "iostreams" = 1; - "locale" = 1; - "log" = 1; - "mpi" = 1; - "parameter-python" = 1; - "poly-collection" = 1; - "python" = 1; - "safe-numerics" = 1; - "stacktrace" = 1; - "test" = 1; - "wave" = 1; - "boost" = 1 -} - -$per_port_data = @{ - "fiber" = @{ "supports" = "windows&!uwp&!arm" }; - "filesystem" = @{ "supports" = "!uwp" }; - "iostreams" = @{ "supports" = "!uwp" }; - "context" = @{ "supports" = "!uwp" }; - "stacktrace" = @{ "supports" = "!uwp" }; - "coroutine" = @{ "supports" = "!arm&!uwp" }; - "test" = @{ "supports" = "!uwp" }; - "wave" = @{ "supports" = "!uwp" }; - "log" = @{ "supports" = "!uwp" }; - "locale" = @{ - "supports" = "!uwp"; - "features" = @( - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Locale" - )}; - "python" = @{ - "supports" = "!uwp&!(arm&windows)"; - "features" = @( - "Feature: python2" - "Build-Depends: python2 (windows)" - "Description: Build with Python2 support" - )}; - "regex" = @{ "features" = @( - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Regex" - )} -} - function TransformReference() { param ( [string]$library ) - if ($per_port_data[$library].supports) + if ($library -match "fiber") + { + # these only work on windows desktop + "$library (windows)" + } + elseif ($library -match "type[_-]erasure|contract") { - "$library ($($per_port_data[$library].supports))" + # These only work on x86-derived processors + "$library (!arm)" + } + elseif ($library -match "iostreams|filesystem|context|stacktrace|coroutine`$|locale|test|wave|log`$") + { + "$library (!uwp)" } else { @@ -92,28 +49,48 @@ function Generate() $controlDeps = ($Depends | sort) -join ", " + $versionSuffix = "" + + # if ($PortName -eq "") + # { + # $versionSuffix = "-1" + # } + mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null $controlLines = @( "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost-$PortName" - "Version: $version" - ) - if ($port_versions[$PortName]) - { - $controlLines += @("Port-Version: $($port_versions[$PortName])") - } - $controlLines += @( + "Version: $version$versionSuffix" "Build-Depends: $controlDeps" "Homepage: https://github.com/boostorg/$Name" "Description: Boost $Name module" ) - if ($per_port_data[$PortName].supports) + if ($PortName -eq "locale") { - $controlLines += @("Supports: $($per_port_data[$PortName].supports)") + $controlLines += @( + "" + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Locale" + ) + } + if ($PortName -eq "python") + { + $controlLines += @( + "" + "Feature: python2" + "Build-Depends: python2 (windows)" + "Description: Build with Python2 support" + ) } - if ($per_port_data[$PortName].features) + if ($PortName -eq "regex") { - $controlLines += @("") + $per_port_data[$PortName].features + $controlLines += @( + "" + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Regex" + ) } $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL" @@ -138,21 +115,23 @@ function Generate() " SHA512 $Hash" " HEAD_REF master" ) - $patches = ls $portsDir/boost-$PortName/*.patch - if ($patches.Count -eq 0) + if ($PortName -eq "asio") { + $portfileLines += @(" PATCHES windows_alloca_header.patch") } - elseif ($patches.Count -eq 1) + if ($PortName -eq "iostreams") { - $portfileLines += @(" PATCHES $($patches.name)") + $portfileLines += @(" PATCHES Removeseekpos.patch") } - else + if ($PortName -eq "outcome") { - $portfileLines += @(" PATCHES") - foreach ($patch in $patches) - { - $portfileLines += @(" $($patches.name)") - } + # 1.73 Known Issue + $portfileLines += @(" PATCHES 0001-outcome-assert.patch") + } + if ($PortName -eq "beast") + { + # 1.73 Known Issue + $portfileLines += @(" PATCHES 0002-beast-coroutines.patch") } $portfileLines += @( ")" @@ -298,7 +277,6 @@ foreach ($library in $libraries) if ($_ -match "aligned_storage") { "type_traits" } elseif ($_ -match "noncopyable|ref|swap|get_pointer|checked_delete|visit_each") { "core" } elseif ($_ -eq "type") { "core" } - elseif ($_ -eq "concept") { "concept_check" } elseif ($_ -match "unordered_") { "unordered" } elseif ($_ -match "cstdint|integer_fwd|integer_traits") { "integer" } elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" } @@ -362,8 +340,8 @@ foreach ($library in $libraries) (($library -notmatch "iostreams") -or ($_ -notmatch "random"))` -and ` (($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator")) - } | % { $_ -replace "_","-" } | % { - "boost-" + (TransformReference $_) + } | % { "boost-$_" -replace "_","-" } | % { + TransformReference $_ }) $deps += @("boost-vcpkg-helpers") @@ -423,7 +401,6 @@ if ($libraries_in_boost_port.length -gt 1) { "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost" "Version: $version" - "Port-Version: $($port_versions.boost)" "Homepage: https://boost.org" "Description: Peer-reviewed portable C++ source libraries" "Build-Depends: $boostDependsList" diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 0d87d6ee8939fb..c062e58daa47fc 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -57,11 +57,11 @@ while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) } Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" -$vcpkgBootstrapPath = "$vcpkgRootDir\toolsrc\windows-bootstrap" +$vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" -if (-not (Test-Path $vcpkgBootstrapPath)) +if (!(Test-Path $vcpkgSourcesPath)) { - Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist." + Write-Error "Unable to determine vcpkg sources directory. '$vcpkgSourcesPath' does not exist." throw } @@ -339,7 +339,7 @@ if ($disableMetrics) } $platform = "x86" -$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x86.release" +$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release" if($PSVersionTable.PSVersion.Major -le 2) { $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture @@ -356,7 +356,7 @@ if ($win64) } $platform = "x64" - $vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x64.release" + $vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release" } if ($architecture -like "*64*") @@ -379,7 +379,7 @@ $arguments = ( "/verbosity:minimal", "/m", "/nologo", -"`"$vcpkgBootstrapPath\dirs.proj`"") -join " " +"`"$vcpkgSourcesPath\dirs.proj`"") -join " " function vcpkgInvokeCommandClean() { diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index c43837e53c8a67..e27fd39f91a03e 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -91,8 +91,8 @@ - - + + diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7eb6d474ae5ed1..4ee79d179be9c4 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -151,8 +151,6 @@ else() endif() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") - set(_VCPKG_TARGET_TRIPLET_ARCH s390x) else() if( _CMAKE_IN_TRY_COMPILE ) message(STATUS "Unable to determine target architecture, continuing without vcpkg.") @@ -308,23 +306,13 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE) message(STATUS "Running vcpkg install") - set(_VCPKG_MANIFEST_FEATURES) - foreach(feature ${VCPKG_MANIFEST_FEATURES}) - list(APPEND _VCPKG_MANIFEST_FEATURES "--x-feature=${feature}") - endforeach() - - if(VCPKG_MANIFEST_NO_DEFAULT_FEATURES) - set(_VCPKG_MANIFEST_NO_DEFAULT_FEATURES "--x-no-default-features") - endif() - execute_process( COMMAND "${_VCPKG_EXECUTABLE}" install - --triplet "${VCPKG_TARGET_TRIPLET}" - --vcpkg-root "${_VCPKG_ROOT_DIR}" - "--x-manifest-root=${_VCPKG_MANIFEST_DIR}" - "--x-install-root=${_VCPKG_INSTALLED_DIR}" - ${_VCPKG_MANIFEST_FEATURES} - ${_VCPKG_MANIFEST_NO_DEFAULT_FEATURES} + --triplet ${VCPKG_TARGET_TRIPLET} + --vcpkg-root ${_VCPKG_ROOT_DIR} + --x-manifest-root=${_VCPKG_MANIFEST_DIR} + --x-install-root=${_VCPKG_INSTALLED_DIR} + --binarycaching RESULT_VARIABLE _VCPKG_INSTALL_RESULT) if (NOT _VCPKG_INSTALL_RESULT EQUAL 0) @@ -411,11 +399,7 @@ macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_NO_BOOST_CMAKE ON) unset(Boost_USE_STATIC_RUNTIME CACHE) - if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v120") - set(Boost_COMPILER "-vc120") - else() - set(Boost_COMPILER "-vc140") - endif() + set(Boost_COMPILER "-vc140") _find_package(${ARGV}) elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 0ca4b30d9e6370..5546c1f1ae9aec 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -74,6 +74,8 @@ asiosdk:x64-osx=fail asiosdk:x64-uwp=fail asiosdk:arm64-windows=fail asiosdk:arm-uwp=fail +asmjit:arm64-windows=fail +asmjit:arm-uwp=fail asyncplusplus:arm-uwp=fail asyncplusplus:x64-uwp=fail atk:x64-osx=fail @@ -88,7 +90,6 @@ avisynthplus:x64-windows-static=fail avro-c:arm-uwp=fail avro-c:x64-osx=fail avro-c:x64-uwp=fail -avro-cpp:x64-windows-static=fail aws-c-common:arm64-windows=fail aws-c-common:arm-uwp=fail aws-c-common:x64-uwp=fail @@ -102,10 +103,6 @@ aws-lambda-cpp:x86-windows=fail aws-lambda-cpp:x64-osx=fail azure-c-shared-utility:arm-uwp=fail azure-c-shared-utility:x64-uwp=fail -azure-kinect-sensor-sdk:x64-linux=fail -azure-kinect-sensor-sdk:x64-osx=fail -# Requires ATL for ARM64 to be installed in CI -azure-storage-cpp:arm64-windows=fail bde:arm64-windows=fail bde:arm-uwp=fail bde:x64-uwp=fail @@ -140,6 +137,26 @@ blosc:x64-uwp=fail bond:arm-uwp=fail bond:x64-osx=fail bond:x64-uwp=fail +boost-coroutine:arm-uwp=fail +boost-coroutine:arm64-windows=fail +boost-fiber:arm-uwp=fail +boost-fiber:arm64-windows=fail +boost-fiber:x64-osx=fail +boost-fiber:x64-uwp=fail +boost-filesystem:arm-uwp=fail +boost-filesystem:x64-uwp=fail +boost-iostreams:arm-uwp=fail +boost-iostreams:x64-uwp=fail +boost-locale:arm-uwp=fail +boost-locale:x64-uwp=fail +boost-log:arm-uwp=fail +boost-log:x64-uwp=fail +boost-stacktrace:arm-uwp=fail +boost-stacktrace:x64-uwp=fail +boost-test:arm-uwp=fail +boost-test:x64-uwp=fail +boost-wave:arm-uwp=fail +boost-wave:x64-uwp=fail botan:arm64-windows=fail botan:arm-uwp=fail botan:x64-uwp=fail @@ -208,11 +225,6 @@ chmlib:x64-uwp=fail civetweb:arm64-windows = skip civetweb:arm-uwp = skip civetweb:x64-uwp = skip -# clapack is replaced by lapack-reference. -clapack:x64-linux = skip -clapack:x64-windows = skip -clapack:x64-windows-static = skip -clapack:x86-windows = skip clapack:x64-uwp=fail clblas:arm64-windows=fail clblast:x64-linux=fail @@ -232,7 +244,6 @@ coin:arm64-windows=fail coin:arm-uwp=fail coin:x64-uwp=fail collada-dom:x64-windows-static=fail -constexpr-contracts:x64-linux=fail coolprop:arm-uwp=fail coolprop:x64-linux=fail coolprop:x64-osx=fail @@ -282,15 +293,6 @@ cudnn:arm-uwp=fail cudnn:x64-uwp=fail cudnn:x64-windows-static=fail cudnn:x86-windows=fail -# Since pipeline cannot automatically install dbghelp dependency, skip this detection -dbghelp:arm-uwp=skip -dbghelp:arm64-windows=skip -dbghelp:x64-linux=fail -dbghelp:x64-osx=fail -dbghelp:x64-uwp=skip -dbghelp:x64-windows-static=skip -dbghelp:x64-windows=skip -dbghelp:x86-windows=skip dbow2:x64-osx=fail dcmtk:arm-uwp=fail dcmtk:arm64-windows=fail @@ -445,8 +447,6 @@ freeglut:arm64-windows=fail freeglut:arm-uwp=fail freeglut:x64-uwp=fail freeglut:x64-osx=fail -# Needs /bigobj -freeopcua:arm64-windows=fail freetds:arm-uwp=fail freetds:x64-linux=fail freetds:x64-osx=fail @@ -534,6 +534,9 @@ graphqlparser:x64-uwp=fail gsl:arm-uwp=fail gsl:x64-uwp=fail # https://github.com/microsoft/vcpkg/pull/11048 +gsoap:x64-linux=fail +gsoap:x64-osx=fail +gsoap:x64-uwp=fail gtk:x64-linux=fail guetzli:x64-osx=fail h3:arm64-windows=fail @@ -608,6 +611,9 @@ isal:x64-uwp=fail isal:x64-windows=fail isal:x64-windows-static=fail isal:x86-windows=fail +itk:x64-windows=fail +itk:x64-windows-static=fail +itk:x86-windows=fail jack2:arm-uwp=fail jack2:x64-uwp=fail jaeger-client-cpp:arm64-windows=fail @@ -623,9 +629,9 @@ jinja2cpplight:arm-uwp=fail jinja2cpplight:x64-uwp=fail keystone:arm-uwp=fail keystone:x64-uwp=fail -kfr:arm64-windows=fail +kfr:arm64-windows=fail kfr:arm-uwp=fail -kfr:x64-linux=fail +kfr:x64-linux=fail kinectsdk1:arm64-windows=fail kinectsdk1:arm-uwp=fail kinectsdk1:x64-linux=fail @@ -646,6 +652,7 @@ leveldb:arm-uwp=fail leveldb:x64-uwp=fail libaiff:x64-linux=fail libarchive:arm-uwp=fail +libass:x64-windows-static=fail libbf:arm64-windows=fail libbf:arm-uwp=fail libbf:x64-uwp=fail @@ -696,8 +703,6 @@ libfabric:x64-uwp=fail libfabric:x64-windows=fail libfabric:x64-windows-static=fail libfreenect2:arm64-windows=fail -libfreenect2:x64-linux=fail -libfreenect2:x64-osx=fail libgit2:arm-uwp=fail libgit2:x64-uwp=fail libgo:arm-uwp=fail @@ -764,6 +769,8 @@ libmesh:x64-windows-static=skip libmesh:x86-windows=skip libmesh:x64-osx=skip libmesh:x64-linux=skip +libmodbus:arm-uwp=fail +libmodbus:x64-uwp=fail libmodman:arm-uwp=fail libmodman:x64-uwp=fail libmodman:x64-windows-static=fail @@ -866,6 +873,8 @@ libtins:arm-uwp=fail libtins:x64-uwp=fail libtomcrypt:arm64-windows=fail libtomcrypt:arm-uwp=fail +libtorrent:arm-uwp=fail +libtorrent:x64-uwp=fail libudis86:arm-uwp=fail libudis86:x64-linux=fail libudis86:x64-osx=fail @@ -881,6 +890,8 @@ libui:arm-uwp=fail libui:x64-linux=fail libui:x64-uwp=fail libusb:arm-uwp=fail +libusb:x64-linux=fail +libusb:x64-osx=fail libusb:x64-uwp=fail libusbmuxd:arm-uwp=fail libusbmuxd:x64-uwp=fail @@ -940,6 +951,8 @@ lmdb:arm-uwp=fail lmdb:x64-uwp=fail log4cplus:arm-uwp=fail log4cplus:x64-uwp=fail +log4cpp:arm-uwp=fail +log4cpp:x64-uwp=fail log4cxx:arm64-windows=fail log4cxx:arm-uwp=fail log4cxx:x64-linux=fail @@ -960,12 +973,6 @@ luasocket:x64-linux=fail luasocket:x64-osx=fail lzfse:arm-uwp=fail magnum:arm64-windows=skip -marble:x64-windows-static=fail -marble:arm64-windows=fail -marble:arm-uwp=fail -marble:x64-linux=fail -marble:x64-osx=fail -marble:x86-windows=fail marl:arm-uwp=fail marl:x64-uwp=fail mathgl:x64-osx=fail @@ -1068,7 +1075,6 @@ moos-core:x86-windows=fail moos-essential:arm64-windows=fail moos-essential:x64-windows=fail moos-essential:x86-windows=fail -# Conflicts with libjpeg-turbo mozjpeg:arm64-windows = skip mozjpeg:arm-uwp = skip mozjpeg:x64-linux = skip @@ -1083,6 +1089,8 @@ mpir:x86-windows=skip mpir:x64-windows=skip mpir:x64-windows-static=skip mpir:arm64-windows=skip +mpir:arm-uwp=skip +mpir:x64-uwp=skip mpir:x64-osx=skip mpir:x64-linux=skip msix:x64-linux=fail @@ -1138,7 +1146,6 @@ networkdirect-sdk:x64-linux=fail networkdirect-sdk:x64-osx=fail networkdirect-sdk:x64-uwp=fail networkdirect-sdk:x86-windows=fail -ngspice:x64-windows-static=fail nmslib:arm64-windows=fail nmslib:arm-uwp=fail nmslib:x64-uwp=fail @@ -1297,6 +1304,10 @@ osgearth:x64-windows-static=fail osg-qt:x64-windows-static=fail paho-mqtt:arm-uwp=fail paho-mqtt:x64-uwp=fail +pangolin:x64-linux=fail +pangolin:x64-osx=fail +pangolin:x64-uwp=fail +pangolin:x64-windows-static=fail pangomm:x64-osx=fail pangomm:arm64-windows=fail parmetis:x64-linux=fail @@ -1354,6 +1365,11 @@ pmdk:x64-windows-static=fail pmdk:x86-windows=fail pngwriter:arm-uwp=fail pngwriter:x64-uwp=fail +polyhook2:arm64-windows=fail +polyhook2:arm-uwp=fail +polyhook2:x64-linux=fail +polyhook2:x64-uwp=fail +polyhook2:x64-osx=fail portable-snippets:arm-uwp=fail # Portaudio was broken by Ninja 1.9.0 https://github.com/ninja-build/ninja/pull/1406 portaudio:arm-uwp=fail @@ -1405,7 +1421,7 @@ qpid-proton:x64-uwp=fail qpid-proton:x64-windows-static=fail qt5-activeqt:x64-linux=fail qt5-activeqt:x64-osx=fail -# Skip deprecated Qt module +# Skip deprecated Qt module # (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) qt5-canvas3d:x64-linux=skip qt5-canvas3d:x64-osx=skip @@ -1430,7 +1446,6 @@ qt5-webengine:x64-osx=fail # Fail due to outdated protoc headers. # D:\buildtrees\qt5-webengine\x64-windows-dbg\src\core\debug\gen\net/third_party/quiche/src/quic/core/proto/cached_network_parameters.pb.h(17): # fatal error C1189: #error: This file was generated by an older version of protoc which is -# Succesful built requires protobuf to be installed after qt5-webengine not before. Otherwise the build picks up the wrong headers from inside vcpkg. qt5-webengine:x64-windows=skip qt5-webengine:x86-windows=skip # Static builds of qt5-webengine are not supported by the port itself @@ -1441,12 +1456,18 @@ qt5-x11extras:x64-osx=fail qt5-x11extras:x86-windows=fail qt5-x11extras:x64-windows=fail qt5-x11extras:x64-windows-static=fail +# Broken by VS2019 16.6 and throws a ton of dialogs attempting to build +# fixed by https://github.com/microsoft/vcpkg/pull/11596 +qt5-translations:x64-windows-static=skip quickfix:arm-uwp=fail quickfix:arm64-windows=fail quickfix:x64-uwp=fail quickfix:x64-windows-static=fail quickfix:x64-windows=fail quickfix:x86-windows=fail +quill:arm64-windows=fail +quill:arm-uwp=fail +quill:x64-uwp=fail quirc:arm64-windows = skip quirc:arm-uwp = skip quirc:x64-linux = skip @@ -1507,8 +1528,6 @@ rocksdb:x64-uwp=fail rpclib:arm64-windows=fail rpclib:arm-uwp=fail rpclib:x64-uwp=fail -rsocket:x64-windows=fail -rsocket:x64-windows-static=fail rtlsdr:x64-uwp=fail rtlsdr:arm64-windows=fail rtlsdr:arm-uwp=fail @@ -1560,6 +1579,8 @@ sdl2-net:x64-uwp=fail # https://github.com/microsoft/vcpkg/issues/10918 seal:arm-uwp=fail seal:x64-uwp=fail +secp256k1:x64-linux=fail +secp256k1:x64-osx=fail sentencepiece:arm64-windows=fail sentencepiece:arm-uwp=fail sentencepiece:x64-uwp=fail @@ -1747,7 +1768,6 @@ torch-th:x64-uwp=fail torch-th:x64-windows-static=fail tre:x64-osx=fail treehopper:x64-windows-static=fail -treehopper:x64-linux=fail turbobase64:arm64-windows=fail turbobase64:arm-uwp=fail turbobase64:x64-uwp=fail @@ -1809,6 +1829,9 @@ vxl:x64-windows = skip vxl:x64-windows-static = skip vxl:x86-windows = skip wampcc:arm64-windows=fail +wavpack:arm64-windows=fail +wavpack:x64-linux=fail +wavpack:x64-osx=fail wepoll:arm-uwp=fail wepoll:x64-uwp=fail wepoll:x64-linux=fail @@ -1911,4 +1934,4 @@ ctp:x64-windows=skip ctp:x64-windows-static=skip ctp:x86-windows=skip protozero:arm-uwp=fail -protozero:x64-uwp=fail +protozero:x64-uwp=fail \ No newline at end of file diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index c7d0e8d9506ac9..1b045985906da7 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -36,8 +36,7 @@ ## * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) - set(TIMESTAMP 20200812) - set(TOOLPATH ${DOWNLOADS}/tools/msys2-${TIMESTAMP}) + set(TOOLPATH ${DOWNLOADS}/tools/msys2) cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) if(NOT CMAKE_HOST_WIN32) @@ -82,19 +81,6 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 ${HASH} ) - # download the new keyring, without it new packages and package updates - # might not install - vcpkg_download_distfile(KEYRING_PATH - URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz - FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz - SHA512 a5023fd17ccf6364bc6e27c5e63aea25f1fc264a5247cbae4008864c828c38c3e0b4de09ded650e28d2e24e319b5fcf7a9c0da0fa3a8ac81679470fc6bd120c9 - ) - vcpkg_download_distfile(KEYRING_SIG_PATH - URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig - FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig - SHA512 c326fefd13f58339afe0d0dc78306aa6ab27cafa8c4d792c2d34aa81fdd1f759d490990ab79daa9664a03a6dfa14ffd2b2ad828bf19a883410112d01f5ed6c4c - ) - file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) _execute_process( @@ -105,19 +91,6 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) - # install the new keyring - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --verify ${KEYRING_SIG_PATH}" - WORKING_DIRECTORY ${TOOLPATH} - RESULT_VARIABLE _vam_error_code - ) - if(_vam_error_code) - message(FATAL_ERROR "Cannot verify MSYS2 keyring.") - endif() - _execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -U ${KEYRING_PATH} --noconfirm" - WORKING_DIRECTORY ${TOOLPATH} - ) # we have to kill all GnuPG daemons otherwise bash would potentially not be # able to start after the core system upgrade, additionally vcpkg would # likely hang waiting for spawned processes to exit @@ -146,7 +119,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) endif() if(_am_PACKAGES) - message(STATUS "Acquiring MSYS Packages from ${TOOLPATH}...") + message(STATUS "Acquiring MSYS Packages...") string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}") set(_ENV_ORIGINAL $ENV{PATH}) diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 545e6d7653ebb6..17a755890f6360 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -59,9 +59,17 @@ function(vcpkg_build_make) set(INSTALL_OPTS ) if (CMAKE_HOST_WIN32) set(PATH_GLOBAL "$ENV{PATH}") + # These should be moved into the portfile! + # vcpkg_find_acquire_program(YASM) + # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) + # vcpkg_add_to_path("${YASM_EXE_PATH}") + # vcpkg_find_acquire_program(PERL) + # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + # vcpkg_add_to_path("${PERL_EXE_PATH}") + vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") vcpkg_acquire_msys(MSYS_ROOT) - find_program(MAKE make REQUIRED) + find_program(MAKE make REQUIRED) #mingw32-make set(MAKE_COMMAND "${MAKE}") set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f Makefile ${_bc_BUILD_TARGET}) @@ -71,6 +79,7 @@ function(vcpkg_build_make) #TODO: optimize for install-data (release) and install-exec (release/debug) else() # Compiler requriements + # set(MAKE_BASH) find_program(MAKE make REQUIRED) set(MAKE_COMMAND "${MAKE}") # Set make command and install command @@ -78,8 +87,41 @@ function(vcpkg_build_make) set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR}) endif() - # Since includes are buildtype independent those are setup by vcpkg_configure_make - _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + # Backup enviromnent variables + set(C_FLAGS_BACKUP "$ENV{CFLAGS}") + set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") + set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") + set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") + set(INCLUDE_BACKUP "$ENV{INCLUDE}") + set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") + set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") + _vcpkg_backup_env_variable(LD_LIBRARY_PATH) + _vcpkg_backup_env_variable(LIBRARY_PATH) + set(LIBPATH_BACKUP "$ENV{LIBPATH}") + + # Setup include enviromnent + set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") + set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") + set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") + set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") + + # Setup global flags + set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") + set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") + set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") + if(NOT VCPKG_TARGET_IS_WINDOWS) + string(APPEND C_FLAGS_GLOBAL " -fPIC") + string(APPEND CXX_FLAGS_GLOBAL " -fPIC") + else() + string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + string(APPEND LD_FLAGS_GLOBAL " /machine:x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + string(APPEND LD_FLAGS_GLOBAL " /machine:x86") + endif() + endif() foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) @@ -90,7 +132,6 @@ function(vcpkg_build_make) endif() set(SHORT_BUILDTYPE "-dbg") set(CMAKE_BUILDTYPE "DEBUG") - set(PATH_SUFFIX "/debug") else() # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory. if (_VCPKG_NO_DEBUG) @@ -99,21 +140,56 @@ function(vcpkg_build_make) set(SHORT_BUILDTYPE "-rel") endif() set(CMAKE_BUILDTYPE "RELEASE") - set(PATH_SUFFIX "") endif() set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}") message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") - set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") - set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") - #set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX}/bin") + if(BUILDTYPE STREQUAL "debug") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") + else() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") + endif() + endif() + + if (CMAKE_HOST_WIN32) + set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") + string(REGEX REPLACE "[ \t]+/" " -" TMP_CFLAGS "${TMP_CFLAGS}") + set(ENV{CFLAGS} ${TMP_CFLAGS}) + + set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") + string(REGEX REPLACE "[ \t]+/" " -" TMP_CXXFLAGS "${TMP_CXXFLAGS}") + set(ENV{CXXFLAGS} ${TMP_CXXFLAGS}) + + set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") + string(REGEX REPLACE "[ \t]+/" " -" TMP_LDFLAGS "${TMP_LDFLAGS}") + set(ENV{LDFLAGS} ${TMP_LDFLAGS}) + + string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") + string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") + if(BUILDTYPE STREQUAL "debug") + set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}/debug) + else() + set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}) + endif() + + else() + set(ENV{CFLAGS} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") + set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") + + if(BUILDTYPE STREQUAL "debug") + set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/debug/lib/ -L${_VCPKG_INSTALLED}/debug/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") + set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + else() + set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/lib/ -L${_VCPKG_INSTALLED}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") + set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + endif() endif() if(MAKE_BASH) @@ -175,9 +251,21 @@ function(vcpkg_build_make) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") endif() + # Restore enviromnent + set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") + set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") + set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") + + set(ENV{INCLUDE} "${INCLUDE_BACKUP}") + set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") + set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") + set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") + _vcpkg_restore_env_variable(LIBRARY_PATH) + _vcpkg_restore_env_variable(LD_LIBRARY_PATH) + if (CMAKE_HOST_WIN32) set(ENV{PATH} "${PATH_GLOBAL}") endif() - _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index deecf4f061a2ee..6f3c871de561dc 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -28,9 +28,8 @@ function(vcpkg_build_qmake) function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") - vcpkg_execute_build_process( + vcpkg_execute_required_process( COMMAND ${INVOKE} -j ${VCPKG_CONCURRENCY} ${TARGETS} - NO_PARALLEL_COMMAND ${INVOKE} -j 1 ${TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} ) diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 2414b5df6c0487..ee6f3484991fb1 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -32,8 +32,6 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor endif() elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(VCPKG_TARGET_IS_OSX 1) -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(VCPKG_TARGET_IS_IOS 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") set(VCPKG_TARGET_IS_LINUX 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -131,5 +129,5 @@ endif() # Windows system libs if(VCPKG_TARGET_IS_WINDOWS) list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) - list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) + list(APPEND VCPKG_SYSTEM_LIBRARIES ws2_32) endif() diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 52000e36d85e0c..0e47b948b8a296 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -7,11 +7,6 @@ ## vcpkg_configure_make( ## SOURCE_PATH <${SOURCE_PATH}> ## [AUTOCONFIG] -## [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] -## [NO_ADDITIONAL_PATHS] -## [CONFIG_DEPENDENT_ENVIRONMENT ...] -## [CONFIGURE_ENVIRONMENT_VARIABLES ...] -## [ADD_BIN_TO_PATH] ## [NO_DEBUG] ## [SKIP_CONFIGURE] ## [PROJECT_SUBPATH <${PROJ_SUBPATH}>] @@ -34,24 +29,12 @@ ## ### SKIP_CONFIGURE ## Skip configure process ## -## ### BUILD_TRIPLET -## Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET -## -## ### NO_ADDITIONAL_PATHS -## Don't pass any additional paths except for --prefix to the configure call -## ## ### AUTOCONFIG ## Need to use autoconfig to generate configure file. ## ## ### PRERUN_SHELL ## Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure) ## -## ### ADD_BIN_TO_PATH -## Adds the appropriate Release and Debug `bin\` directories to the path during configure such that executables can run against the in-tree DLLs. -## -## ## DISABLE_VERBOSE_FLAGS -## do not pass '--disable-silent-rules --verbose' to configure -## ## ### OPTIONS ## Additional options passed to configure during the configuration. ## @@ -61,14 +44,6 @@ ## ### OPTIONS_DEBUG ## Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`. ## -## ### CONFIG_DEPENDENT_ENVIRONMENT -## List of additional configuration dependent environment variables to set. -## Pass SOMEVAR to set the environment and have SOMEVAR_(DEBUG|RELEASE) set in the portfile to the appropriate values -## General environment variables can be set from within the portfile itself. -## -## ### CONFIGURE_ENVIRONMENT_VARIABLES -## List of additional environment variables to pass via the configure call. -## ## ## Notes ## This command supplies many common arguments to configure. To see the full list, examine the source. ## @@ -78,145 +53,96 @@ ## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake) ## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) -macro(_vcpkg_determine_host_mingw out_var) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) - endif() +macro(_vcpkg_determine_host) + # --build: the machine you are building on + # --host: the machine you are building for + # --target: the machine that GCC will produce binary for + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + set(MINGW_W w64) + set(MINGW_PACKAGES) + #message(STATUS "${HOST_ARCH}") if(HOST_ARCH MATCHES "(amd|AMD)64") - set(${out_var} mingw64) + set(MSYS_HOST x86_64) + set(HOST_ARCH x64) + set(BITS 64) + #list(APPEND MINGW_PACKAGES mingw-w64-x86_64-cccl) elseif(HOST_ARCH MATCHES "(x|X)86") - set(${out_var} mingw32) - else() - message(FATAL_ERROR "Unsupported mingw architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) - endif() - unset(HOST_ARCH) -endmacro() - -macro(_vcpkg_determine_autotools_host_cpu out_var) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) - endif() - if(HOST_ARCH MATCHES "(amd|AMD)64") - set(${out_var} x86_64) - elseif(HOST_ARCH MATCHES "(x|X)86") - set(${out_var} i686) + set(MSYS_HOST i686) + set(HOST_ARCH x86) + set(BITS 32) + #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) elseif(HOST_ARCH MATCHES "^(ARM|arm)64$") - set(${out_var} aarch64) + set(MSYS_HOST arm) + set(HOST_ARCH arm) + set(BITS 32) + #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) elseif(HOST_ARCH MATCHES "^(ARM|arm)$") - set(${out_var} arm) + set(MSYS_HOST arm) + set(HOST_ARCH arm) + set(BITS 32) + #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) else() - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) - endif() - unset(HOST_ARCH) -endmacro() - -macro(_vcpkg_determine_autotools_target_cpu out_var) - if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") - set(${out_var} x86_64) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") - set(${out_var} i686) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$") - set(${out_var} aarch64) - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$") - set(${out_var} arm) - else() - message(FATAL_ERROR "Unsupported VCPKG_TARGET_ARCHITECTURE architecture ${VCPKG_TARGET_ARCHITECTURE} in _vcpkg_determine_autotools_target_cpu!" ) + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) endif() + set(TARGET_ARCH ${VCPKG_TARGET_ARCHITECTURE}) endmacro() macro(_vcpkg_backup_env_variable envvar) - if(DEFINED ENV{${envvar}}) + if(ENV{${envvar}}) set(${envvar}_BACKUP "$ENV{${envvar}}") set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}") else() - set(${envvar}_BACKUP) set(${envvar}_PATHLIKE_CONCAT) endif() endmacro() -macro(_vcpkg_backup_env_variables) - foreach(_var ${ARGV}) - _vcpkg_backup_env_variable(${_var}) - endforeach() -endmacro() - macro(_vcpkg_restore_env_variable envvar) if(${envvar}_BACKUP) - set(ENV{${envvar}} "${${envvar}_BACKUP}") + set(ENV{${envvar}} ${${envvar}_BACKUP}) else() unset(ENV{${envvar}}) endif() endmacro() -macro(_vcpkg_restore_env_variables) - foreach(_var ${ARGV}) - _vcpkg_restore_env_variable(${_var}) - endforeach() -endmacro() function(vcpkg_configure_make) cmake_parse_arguments(_csc - "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH" - "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT" + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE" + "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN} ) - if(DEFINED VCPKG_MAKE_BUILD_TRIPLET) - set(_csc_BUILD_TRIPLET ${VCPKG_MAKE_BUILD_TRIPLET}) # Triplet overwrite for crosscompiling - endif() - - set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") - - set(REQUIRES_AUTOGEN FALSE) # use autogen.sh - set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac - if(EXISTS "${SRC_DIR}/configure" AND "${SRC_DIR}/configure.ac") # remove configure; rerun autoconf - if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time - set(REQUIRES_AUTOCONFIG TRUE) - file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts - set(_csc_AUTOCONFIG ON) - endif() - elseif(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) # run normally; no autoconf or autgen required - elseif(EXISTS "${SRC_DIR}/configure.ac") # Run autoconfig - set(REQUIRES_AUTOCONFIG TRUE) - set(_csc_AUTOCONFIG ON) - elseif(EXISTS "${SRC_DIR}/autogen.sh") # Run autogen - set(REQUIRES_AUTOGEN TRUE) - else() - message(FATAL_ERROR "Could not determine method to configure make") - endif() - - debug_message("REQUIRES_AUTOGEN:${REQUIRES_AUTOGEN}") - debug_message("REQUIRES_AUTOCONFIG:${REQUIRES_AUTOCONFIG}") - # Backup environment variables - # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y - set(FLAGPREFIXES CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y) - foreach(_prefix IN LISTS FLAGPREFIXES) - _vcpkg_backup_env_variable(${prefix}FLAGS) - endforeach() - - # FC fotran compiler | FF Fortran 77 compiler - # LDFLAGS -> pass -L flags - # LIBS -> pass -l flags - - #Used by gcc/linux - _vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) - - #Used by cl - _vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) - - if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ") - + # Backup enviromnent variables + set(C_FLAGS_BACKUP "$ENV{CFLAGS}") + set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") + set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") + set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") + set(INCLUDE_BACKUP "$ENV{INCLUDE}") + set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") + set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") + #set(LD_LIBRARY_PATH_BACKUP "$ENV{LD_LIBRARY_PATH}") + _vcpkg_backup_env_variable(LD_LIBRARY_PATH) + #set(LIBRARY_PATH_BACKUP "$ENV{LIBRARY_PATH}") + _vcpkg_backup_env_variable(LIBRARY_PATH) + set(LIBPATH_BACKUP "$ENV{LIBPATH}") + + if(${CURRENT_PACKAGES_DIR} MATCHES " " OR ${CURRENT_INSTALLED_DIR} MATCHES " ") # Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)! message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail") endif() # Pre-processing windows configure requirements if (CMAKE_HOST_WIN32) - _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= + # YASM and PERL are not strictly required by all ports. + # So this should probably be moved into the portfile + # vcpkg_find_acquire_program(YASM) + # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) + # vcpkg_add_to_path("${YASM_EXE_PATH}") + + # vcpkg_find_acquire_program(PERL) + # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + # vcpkg_add_to_path("${PERL_EXE_PATH}") list(APPEND MSYS_REQUIRE_PACKAGES diffutils pkg-config @@ -224,36 +150,16 @@ function(vcpkg_configure_make) libtool gettext gettext-devel - ) - list(APPEND MSYS_REQUIRE_PACKAGES make) + make) if (_csc_AUTOCONFIG) list(APPEND MSYS_REQUIRE_PACKAGES autoconf autoconf-archive automake m4 ) - # --build: the machine you are building on - # --host: the machine you are building for - # --target: the machine that CC will produce binaries for - # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler - # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host - if(NOT _csc_BUILD_TRIPLET) - set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-pc-mingw32") # This is required since we are running in a msys - # shell which will be otherwise identified as ${BUILD_ARCH}-pc-msys - _vcpkg_determine_autotools_target_cpu(TARGET_ARCH) - if(NOT TARGET_ARCH MATCHES "${BUILD_ARCH}") # we do not need to specify the additional flags if we build nativly. - string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-pc-mingw32") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target) - endif() - if(VCPKG_TARGET_IS_UWP AND NOT _csc_BUILD_TRIPLET MATCHES "--host") - # Needs to be different from --build to enable cross builds. - string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-unknown-mingw32") - endif() - endif() - debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}") endif() vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") - set(BASH "${MSYS_ROOT}/usr/bin/bash.exe") # This is required because PATH contains sort and find from Windows but the MSYS versions are needed @@ -261,42 +167,40 @@ function(vcpkg_configure_make) file(CREATE_LINK "${MSYS_ROOT}/usr/bin/sort.exe" "${SCRIPTS}/buildsystems/make_wrapper/sort.exe" COPY_ON_ERROR) file(CREATE_LINK "${MSYS_ROOT}/usr/bin/find.exe" "${SCRIPTS}/buildsystems/make_wrapper/find.exe" COPY_ON_ERROR) vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there - vcpkg_add_to_path(PREPEND "${MSYS_ROOT}/usr/share/automake-1.16") # Required wrappers are located here (compile ar-lib) + # --build: the machine you are building on + # --host: the machine you are building for + # --target: the machine that CC will produce binaries for + _vcpkg_determine_host() # VCPKG_HOST => machine you are building on => --build= + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=i686-pc-mingw32 --host=i686-pc-mingw32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) + set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=arm-pc-mingw32 --host=i686-pc-mingw32") + endif() + macro(_vcpkg_append_to_configure_environment inoutstring var defaultval) - # Allows to overwrite settings in custom triplets via the environment - if(DEFINED ENV{${var}}) + # Allows to overwrite settings in custom triplets via the enviromnent + if(ENV{${var}}) string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") else() string(APPEND ${inoutstring} " ${var}='${defaultval}'") endif() endmacro() - set(CONFIGURE_ENV "V=1") - if (_csc_AUTOCONFIG) # without autotools we assume a custom configure script which correctly handles cl and lib. Otherwise the port needs to set CC|CXX|AR and probably CPP - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "compile cl.exe -nologo -E") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "compile cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "compile cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "ar-lib lib.exe -verbose") - else() - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "cl.exe -nologo -E") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "lib.exe -verbose") - endif() + set(CONFIGURE_ENV "") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") _vcpkg_append_to_configure_environment(CONFIGURE_ENV LD "link.exe -verbose") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "${MSYS_ROOT}/usr/share/automake-1.16/ar-lib lib.exe -verbose") _vcpkg_append_to_configure_environment(CONFIGURE_ENV RANLIB ":") # Trick to ignore the RANLIB call - #_vcpkg_append_to_configure_environment(CONFIGURE_ENV OBJDUMP ":") ' Objdump is required to make shared libraries. Otherwise define lt_cv_deplibs_check_method=pass_all _vcpkg_append_to_configure_environment(CONFIGURE_ENV CCAS ":") # If required set the ENV variable CCAS in the portfile correctly - _vcpkg_append_to_configure_environment(CONFIGURE_ENV STRIP ":") # If required set the ENV variable STRIP in the portfile correctly - _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers -all") # Would be better to have a true nm here! Some symbols (mainly exported variables) get not properly imported with dumpbin as nm # and require __declspec(dllimport) for some reason (same problem CMake has with WINDOWS_EXPORT_ALL_SYMBOLS) _vcpkg_append_to_configure_environment(CONFIGURE_ENV DLLTOOL "link.exe -verbose -dll") - - foreach(_env IN LISTS _csc_CONFIGURE_ENVIRONMENT_VARIABLES) - _vcpkg_append_to_configure_environment(CONFIGURE_ENV ${_env} "${${_env}}") - endforeach() + # Other maybe interesting variables to control # COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line. # LINK This is the command used to actually link a C program. @@ -324,11 +228,11 @@ function(vcpkg_configure_make) "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") + set(ENV{V} "1") #Enable Verbose MODE + # Set configure paths - set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}") - set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}") - if(NOT _csc_NO_ADDITIONAL_PATHS) - set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} + set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} + "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}" # Important: These should all be relative to prefix! "--bindir=${prefix_var}/tools/${PORT}/bin" "--sbindir=${prefix_var}/tools/${PORT}/sbin" @@ -337,25 +241,25 @@ function(vcpkg_configure_make) "--mandir=${prefix_var}/share/${PORT}" "--docdir=${prefix_var}/share/${PORT}" "--datarootdir=${prefix_var}/share/${PORT}") - set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} + set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} + "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}" # Important: These should all be relative to prefix! "--bindir=${prefix_var}/../tools/${PORT}/debug/bin" "--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin" #"--libdir='\${prefix}'/lib" # already the default! "--includedir=${prefix_var}/../include" "--datarootdir=${prefix_var}/share/${PORT}") - endif() + # Setup common options - if(NOT DISABLE_VERBOSE_FLAGS) - list(APPEND _csc_OPTIONS --disable-silent-rules --verbose) - endif() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - list(APPEND _csc_OPTIONS --enable-shared --disable-static) + list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-shared --disable-static) + if (VCPKG_TARGET_IS_UWP) + list(APPEND _csc_OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) + endif() else() - list(APPEND _csc_OPTIONS --disable-shared --enable-static) + list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-static --disable-shared) endif() - + file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") set(base_cmd) @@ -366,50 +270,39 @@ function(vcpkg_configure_make) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") endif() include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + if(VCPKG_TARGET_IS_UWP) + # Flags should be set in the toolchain instead + set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\") + set(_csc_OPTIONS ${_csc_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) + endif() #Join the options list as a string with spaces between options list(JOIN _csc_OPTIONS " " _csc_OPTIONS) list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE) list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG) endif() - # Setup include environment (since these are buildtype independent restoring them is unnecessary) - # Used by CL + # Setup include enviromnent set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") - # Used by GCC + set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") # Setup global flags -> TODO: Further improve with toolchain file in mind! - set(CPP_FLAGS_GLOBAL "$ENV{CPPFLAGS} -I${_VCPKG_INSTALLED}/include") set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") - # Flags should be set in the toolchain instead (Setting this up correctly requires a function named vcpkg_determined_cmake_compiler_flags which can also be used to setup CC and CXX etc.) + # Flags should be set in the toolchain instead if(NOT VCPKG_TARGET_IS_WINDOWS) string(APPEND C_FLAGS_GLOBAL " -fPIC") string(APPEND CXX_FLAGS_GLOBAL " -fPIC") else() - # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined - string(APPEND CPP_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - if(VCPKG_TARGET_IS_UWP) - # Be aware that configure thinks it is crosscompiling due to: - # error while loading shared libraries: VCRUNTIME140D_APP.dll: - # cannot open shared object file: No such file or directory - # IMPORTANT: The only way to pass linker flags through libtool AND the compile wrapper - # is to use the CL and LINK environment variables !!! - # (This is due to libtool and compiler wrapper using the same set of options to pass those variables around) - string(REPLACE "\\" "/" VCToolsInstallDir "$ENV{VCToolsInstallDir}") - set(ENV{_CL_} "$ENV{_CL_} /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"") - set(ENV{_LINK_} "$ENV{_LINK_} /MANIFEST /DYNAMICBASE WindowsApp.lib /WINMD:NO /APPCONTAINER") - endif() + string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x64") + string(APPEND LD_FLAGS_GLOBAL " /machine:x64") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x86") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) - set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM64") + string(APPEND LD_FLAGS_GLOBAL " /machine:x86") endif() endif() @@ -423,10 +316,20 @@ function(vcpkg_configure_make) debug_message("ENV{PKG_CONFIG} found! Using: $ENV{PKG_CONFIG}") set(PKGCONFIG $ENV{PKG_CONFIG}) endif() - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT PKGCONFIG STREQUAL "--static") - set(PKGCONFIG "${PKGCONFIG} --static") - endif() + + set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") + # Run autoconf if necessary + if(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) + set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac + set(REQUIRES_AUTOGEN FALSE) # use autogen.sh + elseif(EXISTS "${SRC_DIR}/configure.ac") + set(REQUIRES_AUTOCONFIG TRUE) + set(REQUIRES_AUTOGEN FALSE) + elseif(EXISTS "${SRC_DIR}/autogen.sh") + set(REQUIRES_AUTOGEN TRUE) + set(REQUIRES_AUTOCONFIG FALSE) + endif() set(_GENERATED_CONFIGURE FALSE) if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG) find_program(AUTORECONF autoreconf REQUIRED) @@ -490,12 +393,10 @@ function(vcpkg_configure_make) set(SHORT_NAME_${_VAR_SUFFIX} "dbg") list(APPEND _buildtypes ${_VAR_SUFFIX}) if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead - string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() - set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -507,13 +408,11 @@ function(vcpkg_configure_make) set(PATH_SUFFIX_${_VAR_SUFFIX} "") set(SHORT_NAME_${_VAR_SUFFIX} "rel") list(APPEND _buildtypes ${_VAR_SUFFIX}) - if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain - string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") + if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() - set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -522,13 +421,6 @@ function(vcpkg_configure_make) endif() foreach(_buildtype IN LISTS _buildtypes) - foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) - if(DEFINED ENV{${ENV_VAR}}) - set(BACKUP_CONFIG_${ENV_VAR} "$ENV{${ENV_VAR}}") - endif() - set(ENV{${ENV_VAR}} "${${ENV_VAR}_${_buildtype}}") - endforeach() - set(TAR_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") file(MAKE_DIRECTORY "${TAR_DIR}") file(RELATIVE_PATH RELATIVE_BUILD_PATH "${TAR_DIR}" "${SRC_DIR}") @@ -548,28 +440,22 @@ function(vcpkg_configure_make) set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}") endif() - # Setup environment - set(ENV{CPPFLAGS} ${CPPFLAGS_${_buildtype}}) + # Setup enviromnent set(ENV{CFLAGS} ${CFLAGS_${_buildtype}}) set(ENV{CXXFLAGS} ${CXXFLAGS_${_buildtype}}) set(ENV{LDFLAGS} ${LDFLAGS_${_buildtype}}) set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}") - - set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") - set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") + set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib${VCPKG_HOST_PATH_SEPARATOR}${LIBPATH_BACKUP}") + + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - if (CMAKE_HOST_WIN32) - set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") + if (CMAKE_HOST_WIN32) + set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${BUILD_TARGET} ${HOST_TYPE}${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") else() - set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) + set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) endif() - if(_csc_ADD_BIN_TO_PATH) - set(PATH_BACKUP $ENV{PATH}) - vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/bin") - endif() - debug_message("Configure command:'${command}'") + if (NOT _csc_SKIP_CONFIGURE) message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") vcpkg_execute_required_process( @@ -591,27 +477,20 @@ function(vcpkg_configure_make) unset(ENV{PKG_CONFIG_PATH}) endif() unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}) - - if(_csc_ADD_BIN_TO_PATH) - set(ENV{PATH} "${PATH_BACKUP}") - endif() - # Restore environment (config dependent) - foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) - if(BACKUP_CONFIG_${ENV_VAR}) - set(ENV{${ENV_VAR}} "${BACKUP_CONFIG_${ENV_VAR}}") - else() - unset(ENV{${ENV_VAR}}) - endif() - endforeach() - endforeach() - - # Restore environment - foreach(_prefix IN LISTS FLAGPREFIXES) - _vcpkg_restore_env_variable(${prefix}FLAGS) endforeach() - - _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) - + + # Restore enviromnent + set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") + set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") + set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") + + set(ENV{INCLUDE} "${INCLUDE_BACKUP}") + set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") + set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") + set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") + _vcpkg_restore_env_variable(LIBRARY_PATH) + _vcpkg_restore_env_variable(LD_LIBRARY_PATH) + set(ENV{LIBPATH} "${LIBPATH_BACKUP}") SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE) set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index 1784a4d145c6d4..396d20b41d8e1c 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -17,21 +17,14 @@ ## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake) ## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) function(vcpkg_copy_tool_dependencies TOOL_DIR) - find_program(PS_EXE powershell PATHS ${DOWNLOADS}/tool) - if (PS_EXE-NOTFOUND) - message(FATAL_ERROR "Could not find powershell in vcpkg tools, please open an issue to report this.") - endif() macro(search_for_dependencies PATH_TO_SEARCH) file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) - vcpkg_execute_required_process( - COMMAND ${PS_EXE} -noprofile -executionpolicy Bypass -nologo - -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 - -targetBinary ${TOOL} - -installedDir ${PATH_TO_SEARCH} - WORKING_DIRECTORY ${VCPKG_ROOT_DIR} - LOGNAME copy-tool-dependencies - ) + execute_process(COMMAND powershell -noprofile -executionpolicy Bypass -nologo + -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 + -targetBinary ${TOOL} + -installedDir ${PATH_TO_SEARCH} + OUTPUT_VARIABLE OUT) endforeach() endmacro() search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin) diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index 67607d768685a7..9da6cec9f57baa 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -61,11 +61,8 @@ function(vcpkg_execute_build_process) OR err_contents MATCHES "LINK : fatal error LNK1102:" OR err_contents MATCHES " fatal error C1060: " OR out_contents MATCHES "LINK : fatal error LNK1318: Unexpected PDB error; ACCESS_DENIED" OR out_contents MATCHES "LINK : fatal error LNK1104:" - OR out_contents MATCHES "LINK : fatal error LNK1201:" + OR out_contents MATCHES "LINK : fatal error LNK1201:") # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. - OR out_contents MATCHES "Cannot create parent directory" - # Multiple threads using the same directory at the same time cause conflicts, will try again. - ) message(STATUS "Restarting Build without parallelism because memory exceeded") set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err-1.log") diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 7f1f419cdca842..a5aefdc29297cd 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -33,7 +33,6 @@ ## - NINJA ## - NUGET ## - SCONS -## - SWIG ## - YASM ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). @@ -102,7 +101,7 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe") set(ARCHIVE "PortableGit-2.26.2-32-bit.7z.exe") set(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36) - set(PATHS + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin" "${DOWNLOADS}/tools/git/${SUBDIR}/mingw32/bin") else() @@ -191,8 +190,8 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME jom) set(SUBDIR "jom-1.1.3") set(PATHS ${DOWNLOADS}/tools/jom/${SUBDIR}) - set(URL - "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + set(URL + "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" "http://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip" ) set(ARCHIVE "jom_1_1_3.zip") @@ -205,30 +204,22 @@ function(vcpkg_find_acquire_program VAR) set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) - set(NINJA_VERSION 1.10.0) - set(SUBDIR "ninja-${NINJA_VERSION}") - set(_vfa_SUPPORTED ON) + set(SUBDIR "ninja-1.10.0") if(CMAKE_HOST_WIN32) - set(ARCHIVE "ninja-win-${NINJA_VERSION}.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-windows") list(APPEND PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") - set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-win.zip") - set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") - set(ARCHIVE "ninja-mac-${NINJA_VERSION}.zip") - set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-mac.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") - set(HASH 619a1924067a0b30fc5f8887f868d3ee5481838d2f0f158d031f7614a2a10b95a73d4a56b658d5d560283ebf809e2e536b968c6c01ff0108075c3f393f5780ba) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd") - set(_vfa_SUPPORTED OFF) else() - set(ARCHIVE "ninja-linux-${NINJA_VERSION}.zip") - set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") - set(HASH ffb179ab8ea315167fcc99a8f13286e1363590185b18cf819cc73e09f2a7553790e9dc45fd1ccd0bd1d2dbf543aee3f6c0951cf9ce453a7168ffd2ac873cdd29) endif() - set(VERSION_CMD --version) + set(BREW_PACKAGE_NAME "ninja") + set(APT_PACKAGE_NAME "ninja-build") + set(URL "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip") + set(ARCHIVE "ninja-win-1.10.0.zip") + set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) elseif(VAR MATCHES "NUGET") set(PROGNAME nuget) set(SUBDIR "5.5.1") @@ -240,23 +231,19 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) elseif(VAR MATCHES "MESON") - if(NOT CMAKE_HOST_APPLE) - set(PROGNAME meson) - set(REQUIRED_INTERPRETER PYTHON3) - set(APT_PACKAGE_NAME "meson") - if(CMAKE_HOST_WIN32) - set(SCRIPTNAME meson.py) - else() - set(SCRIPTNAME meson) - endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) - set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") - set(ARCHIVE "meson-0.54.2.zip") - set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(BREW_PACKAGE_NAME "meson") + set(APT_PACKAGE_NAME "meson") + if(CMAKE_HOST_WIN32) + set(SCRIPTNAME meson.py) else() - set(PROGNAME meson) - set(BREW_PACKAGE_NAME "meson") + set(SCRIPTNAME meson) endif() + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) + set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") + set(ARCHIVE "meson-0.54.2.zip") + set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") if(CMAKE_HOST_WIN32) set(SOURCEFORGE_ARGS @@ -318,32 +305,7 @@ function(vcpkg_find_acquire_program VAR) set(PATHS ${DOWNLOADS}/tools/scons) set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") set(ARCHIVE "scons-local-3.0.1.zip") - set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) - elseif(VAR MATCHES "SWIG") - set(VERSION 4.0.2) - set(PROGNAME swig) - if(CMAKE_HOST_WIN32) - set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download") - set(ARCHIVE "swigwin-${VERSION}.zip") - set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d) - set(SUBDIR "swigwin-${VERSION}") - set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}") - else() - #Not used - set(_vfa_SUPPORTED TRUE) - set(URL https://sourceforge.net/projects/swig/files/swig/swig-${VERSION}/swig-${VERSION}.tar.gz/download) - set(ARCHIVE "swig-${VERSION}.tar.gz") - set(HASH 05e7da70ce6d9a733b96c0bcfa3c1b82765bd859f48c74759bbf4bb1467acb1809caa310cba5e2b3280cd704fca249eaa0624821dffae1d2a75097c7f55d14ed) - set(SUBDIR "swig-${VERSION}") - set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}") - endif() - set(SOURCEFORGE_ARGS - REPO swig - FILENAME "${ARCHIVE}" - SHA512 "${HASH}" - NO_REMOVE_ONE_LEVEL - WORKING_DIRECTORY "${DOWNLOADS}/tools/swig" - ) + set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) elseif(VAR MATCHES "DOXYGEN") set(PROGNAME doxygen) set(DOXYGEN_VERSION 1.8.17) @@ -367,12 +329,12 @@ function(vcpkg_find_acquire_program VAR) set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(_vfa_SUPPORTED ON) - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64") set(NOEXTRACT ON) set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c) else() - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53) endif() @@ -387,36 +349,10 @@ function(vcpkg_find_acquire_program VAR) message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() - macro(do_version_check) - if(VERSION_CMD) - _execute_process( - COMMAND ${${VAR}} ${VERSION_CMD} - WORKING_DIRECTORY ${DOWNLOADS} - OUTPUT_VARIABLE ${VAR}_VERSION_OUTPUT - ) - string(STRIP "${${VAR}_VERSION_OUTPUT}" ${VAR}_VERSION_OUTPUT) - #TODO: REGEX MATCH case for more complex cases! - if(NOT ${VAR}_VERSION_OUTPUT VERSION_GREATER_EQUAL ${VAR}_VERSION) - message(STATUS "Found ${PROGNAME}('${${VAR}_VERSION_OUTPUT}') but at least version ${${VAR}_VERSION} is required! Trying to use internal version if possible!") - set(${VAR} "${VAR}-NOTFOUND" CACHE INTERNAL "") - else() - message(STATUS "Found external ${PROGNAME}('${${VAR}_VERSION_OUTPUT}').") - endif() - endif() - endmacro() - macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) find_program(${VAR} ${PROGNAME} PATHS ${PATHS} NO_DEFAULT_PATH) - if(NOT ${VAR}) - find_program(${VAR} ${PROGNAME}) - if(${VAR} AND NOT ${VAR}_VERSION_CHECKED) - do_version_check() - set(${VAR}_VERSION_CHECKED ON) - elseif(${VAR}_VERSION_CHECKED) - message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") - endif() - endif() + find_program(${VAR} ${PROGNAME}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) @@ -490,11 +426,8 @@ function(vcpkg_find_acquire_program VAR) LOGNAME ${VAR}-tool-post-install ) endif() - unset(${VAR} CACHE) + do_find() - if(NOT ${VAR}) - message(FATAL_ERROR "Unable to find ${VAR}") - endif() endif() set(${VAR} "${${VAR}}" PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_find_fortran.cmake b/scripts/cmake/vcpkg_find_fortran.cmake deleted file mode 100644 index daf63ce7279eec..00000000000000 --- a/scripts/cmake/vcpkg_find_fortran.cmake +++ /dev/null @@ -1,61 +0,0 @@ -## # vcpkg_find_fortran -## -## Checks if a Fortran compiler can be found. -## Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran -## and return required cmake args for building. -## -## ## Usage -## ```cmake -## vcpkg_find_fortran( -## ) -## ``` - -function(vcpkg_find_fortran additional_cmake_args_out) - set(ARGS_OUT) - set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}") - set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform") - include(CMakeDetermineFortranCompiler) - if(NOT CMAKE_Fortran_COMPILER AND NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - # This intentionally breaks users with a custom toolchain which do not have a Fortran compiler setup - # because they either need to use a port-overlay (for e.g. lapack), remove the toolchain for the port using fortran - # or setup fortran in their VCPKG_CHAINLOAD_TOOLCHAIN_FILE themselfs! - if(WIN32) - message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!") - # If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") # Switching to mingw toolchain - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(MINGW_PATH mingw32) - set(MSYS_TARGET i686) - set(MACHINE_FLAG -m32) - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(MINGW_PATH mingw64) - set(MSYS_TARGET x86_64) - set(MACHINE_FLAG -m64) - else() - message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!") - endif() - vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran") - set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin") - vcpkg_add_to_path(PREPEND "${MINGW_BIN}") - list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON - "-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe" - "-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe" - "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}") - set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE) - set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE) - set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran - if(VCPKG_CRT_LINKAGE STREQUAL "static") - set(VCPKG_CRT_LINKAGE dynamic PARENT_SCOPE) - message(STATUS "VCPKG_CRT_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic CRT linkage") - endif() - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(VCPKG_LIBRARY_LINKAGE dynamic PARENT_SCOPE) - message(STATUS "VCPKG_LIBRARY_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic library linkage") - endif() - else() - message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!") - endif() - endif() - set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE) -endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 0be2dfc5405e29..ec5ea05f57ce57 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -53,7 +53,11 @@ function(vcpkg_fixup_cmake_targets) set(_vfct_TARGET_PATH share/${PORT}) endif() - string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(EXECUTABLE_SUFFIX "\\.exe") + else() + set(EXECUTABLE_SUFFIX) + endif() set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) @@ -169,10 +173,6 @@ function(vcpkg_fixup_cmake_targets) "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" _contents "${_contents}") - string(REGEX REPLACE - "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\.((\\\\|/)\\.\\.)*\" ABSOLUTE\\)" - "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" - _contents "${_contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}") file(WRITE ${MAIN_CMAKE} "${_contents}") diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 24302a6af91962..6acb51360bd56c 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -8,8 +8,6 @@ ## [RELEASE_FILES ...] ## [DEBUG_FILES ...] ## [SYSTEM_LIBRARIES ...] -## [IGNORE_FLAGS ] -## [SKIP_CHECK] ## ) ## ``` ## @@ -22,6 +20,10 @@ ## Specifies a list of files to apply the fixes for debug paths. ## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ ## +## ### SYSTEM_PACKAGES +## If the *.pc file contains system packages outside vcpkg these need to be listed here. +## Since vcpkg checks the existence of all required packages within vcpkg. +## ## ### SYSTEM_LIBRARIES ## If the *.pc file contains system libraries outside vcpkg these need to be listed here. ## VCPKG checks every -l flag for the existence of the required library within vcpkg. @@ -29,237 +31,172 @@ ## ### IGNORE_FLAGS ## If the *.pc file contains flags in the lib field which are not libraries. These can be listed here ## -## ### SKIP_CHECK -## Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases. -## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them ## ## ## Examples +## ## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. -function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config _system_libs _ignore_flags) - # Setup pkg-config paths - if(CMAKE_HOST_WIN32) - # Those replacements are probably only necessary since we use pkg-config from msys - string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - string(REPLACE " " "\ " _VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") - string(REPLACE "\\" "/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") - else() - set(_VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") - set(_VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") - endif() - - set(PATH_SUFFIX_DEBUG /debug) - set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") - set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") - set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") - set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig") - - if(ENV{PKG_CONFIG_PATH}) - set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH}) - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${PKGCONFIG_PACKAGES_SHARE_DIR}:$ENV{PKG_CONFIG_PATH}") - else() - set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${PKGCONFIG_PACKAGES_SHARE_DIR}") - endif() - - # First make sure everything is ok with the package and its deps - get_filename_component(_package_name "${_file}" NAME_WLE) - debug_message("Checking package (${_config}): ${_package_name}") - execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${_package_name} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" - RESULT_VARIABLE _pkg_error_var - OUTPUT_VARIABLE _pkg_output - ERROR_VARIABLE _pkg_error_out - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(NOT _pkg_error_var EQUAL 0) - message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed") - message(STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") - message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") - message(STATUS "pkg-config output:${_pkg_output}") - message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") - else() - debug_message("pkg-config returned:${_pkg_error_var}") - debug_message("pkg-config output:${_pkg_output}") - debug_message("pkg-config error output:${_pkg_error_out}") - endif() - - # Get all required libs. --static means we get all libraries required for static linkage - # which is the worst case and includes the case without --static - # This retests already tested *.pc files since pkg-config will recursivly search for - # required packages and add there link flags to the one being tested - # as such NOT_STATIC_PKGCONFIG might be used to deactivate the --static arg to pkg-config - - execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors ${PKGCONFIG_STATIC} --libs ${_package_name} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" - RESULT_VARIABLE _pkg_error_var - OUTPUT_VARIABLE _pkg_libs_output - ERROR_VARIABLE _pkg_error_out - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(NOT _pkg_error_var EQUAL 0) - message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs ${_package_name} failed") - message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") - message(STATUS "pkg-config output:${_pkg_libs_output}") - message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") - else() - debug_message("pkg-config returned:${_pkg_error_var}") - debug_message("pkg-config output:${_pkg_libs_output}") - debug_message("pkg-config error output:${_pkg_error_out}") - endif() - - execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --static --libs-only-L ${_package_name} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" - RESULT_VARIABLE _pkg_error_var - OUTPUT_VARIABLE _pkg_lib_paths_output - ERROR_VARIABLE _pkg_error_out - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - - if(NOT _pkg_error_var EQUAL 0) - message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs-only-L ${_package_name} failed") - message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") - message(STATUS "pkg-config output:${_pkg_lib_paths_output}") - message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") - else() - debug_message("pkg-config returned:${_pkg_error_var}") - debug_message("pkg-config output:${_pkg_lib_paths_output}") - debug_message("pkg-config error output:${_pkg_error_out}") - endif() - - string(REPLACE "\\ " "##" _pkg_lib_paths_output "${_pkg_lib_paths_output}") # Whitespace path protection - string(REGEX REPLACE "(^[\t ]*|[\t ]+)-L" ";" _pkg_lib_paths_output "${_pkg_lib_paths_output}") - debug_message("-L LIST TRANSFORMATION:'${_pkg_lib_paths_output}'") - string(REGEX REPLACE "^[\t ]*;" "" _pkg_lib_paths_output "${_pkg_lib_paths_output}") - string(REPLACE "##" "\\ " _pkg_lib_paths_output "${_pkg_lib_paths_output}") - - list(REMOVE_DUPLICATES _pkg_lib_paths_output) # We don't care about linker order and repeats - ## Remove search paths from LIBS - foreach(_search_path IN LISTS _pkg_lib_paths_output) - debug_message("REMOVING:'${_search_path}'") - debug_message("FROM:'${_pkg_libs_output}'") - string(REGEX REPLACE "(^[\t ]*|[\t ]+|;[\t ]*)-L${_search_path}([\t ]+|[\t ]*$)" ";" _pkg_libs_output "${_pkg_libs_output}") # Remove search paths from libs - endforeach() - debug_message("LIBS AFTER -L REMOVAL:'${_pkg_libs_output}'") - - #Make the remaining libs a proper CMake List - string(REPLACE "\\ " "##" _pkg_libs_output "${_pkg_libs_output}") # Whitespace path protection - string(REGEX REPLACE "(^[\t ]*|[\t ]+)-l" ";-l" _pkg_libs_output "${_pkg_libs_output}") - string(REGEX REPLACE "[\t ]*(-pthreads?)" ";\\1" _pkg_libs_output "${_pkg_libs_output}") # handle pthread without -l here (makes a lot of problems otherwise) - string(REGEX REPLACE "^[\t ]*;[\t ]*" "" _pkg_libs_output "${_pkg_libs_output}") - string(REPLACE "##" "\\ " _pkg_libs_output "${_pkg_libs_output}") - - #Windows path transformations - if(CMAKE_HOST_WIN32) - string(REGEX REPLACE "(^|;)/([a-zA-Z])/" "\\1\\2:/" _pkg_lib_paths_output "${_pkg_lib_paths_output}") - string(REGEX REPLACE " /([a-zA-Z])/" ";\\1:/" _pkg_libs_output "${_pkg_libs_output}") - string(REGEX REPLACE "-l/([a-zA-Z])/" "-l\\1:/" _pkg_libs_output "${_pkg_libs_output}") - debug_message("pkg-config output lib paths after replacement (cmake style):${_pkg_lib_paths_output}") - debug_message("pkg-config output lib after replacement (cmake style):${_pkg_libs_output}") - endif() - +function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages _ignore_flags) + set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) + list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a;.a") + #message(STATUS "Checking configuration: ${_config}") if("${_config}" STREQUAL "DEBUG") - set(lib_suffixes d _d _debug -s -sd _s _sd -static -staticd _static _staticd) + set(prefix "${CURRENT_INSTALLED_DIR}/debug/") + set(libprefix "${CURRENT_INSTALLED_DIR}/debug/lib/") + set(installprefix "${CURRENT_PACKAGES_DIR}/debug/") + set(installlibprefix "${CURRENT_PACKAGES_DIR}/debug/lib/") + set(lib_suffixes d _d _debug) elseif("${_config}" STREQUAL "RELEASE") - set(lib_suffixes -s _s -static _static) + set(prefix "${CURRENT_INSTALLED_DIR}") + set(libprefix "${CURRENT_INSTALLED_DIR}/lib/") + set(installprefix "${CURRENT_PACKAGES_DIR}/") + set(installlibprefix "${CURRENT_PACKAGES_DIR}/lib/") + set(lib_suffixes "") else() message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") endif() - - debug_message("IGNORED FLAGS:'${_ignore_flags}'") - debug_message("BEFORE IGNORE FLAGS REMOVAL: ${_pkg_libs_output}") - foreach(_ignore IN LISTS _ignore_flags) # Remove ignore with whitespace - debug_message("REMOVING FLAG:'${_ignore}'") - string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_ignore}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") - debug_message("AFTER REMOVAL: ${_pkg_libs_output}") + debug_message("Default library search paths: ${libprefix} --- ${installlibprefix} --- ${PKG_LIB_SEARCH_PATH}") + set(_contents "${${_contents_var}}") + #message(STATUS "Contents: ${_contents}") + set(_system_lib_normalized) + foreach(_system_lib ${_system_libs}) + string(REPLACE "-l" "" _system_lib "${_system_lib}") + list(APPEND _system_lib_normalized "${_system_lib}") endforeach() - string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal - - debug_message("SYSTEM LIBRARIES:'${_system_libs}'") - debug_message("LIBRARIES in PC:'${_pkg_libs_output}'") - foreach(_system_lib IN LISTS _system_libs) # Remove system libs with whitespace - debug_message("REMOVING:'${_system_lib}'") - debug_message("FROM:'${_pkg_libs_output}'") - string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") - string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") - string(TOLOWER "${_system_lib}" _system_lib_lower) - string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") - string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") - debug_message("AFTER REMOVAL:'${_pkg_libs_output}'") - endforeach() - list(REMOVE_DUPLICATES _pkg_libs_output) # We don't care about linker order and repeats + ## Extra libraries: + string(REGEX MATCH "Libs:[^\n#]+" _libs "${_contents}") + #message(STATUS "LIB LINE: ${_libs}") + # The path to the library is either quoted and can not contain a quote or it is unqouted and cannot contain a single unescaped space + string(REGEX REPLACE "Libs:" "" _libs_list_tmp "${_libs}") + string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") - string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal + string(REGEX MATCH "Libs.private:[^\n#]+" _libs_private "${_contents}") + string(REGEX REPLACE "Libs.private:" "" _libs_private_list_tmp "${_libs_private}") + string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") - debug_message("Library search paths:${_pkg_lib_paths_output}") - debug_message("Libraries to search:${_pkg_libs_output}") - set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a) - foreach(_lib IN LISTS _pkg_libs_output) - if(EXISTS "${_lib}" OR "x${_lib}x" STREQUAL "xx" ) # eat; all ok _lib is a fullpath to a library or empty + #message(STATUS "Found libraries: ${_libs_list_tmp}") + #message(STATUS "Found private libraries: ${_libs_private_list_tmp}") + list(APPEND _all_libs "${_libs_list_tmp}" "${_libs_private_list_tmp}") + list(REMOVE_DUPLICATES _all_libs) + foreach(_lib ${_all_libs}) + string(REGEX REPLACE "(^[\t ]+|[\t ]+$)" "" _lib "${_lib}") # Remove whitespaces at begin & end + if( "x${_lib}x" STREQUAL "xx") #Empty String + continue() + endif() + unset(CHECK_LIB CACHE) + unset(NO_CHECK_LIB) + #message(STATUS "CHECKING: x${_lib}z") + if("${_lib}" MATCHES "^-L((\\ |[^ ]+)+)$") + debug_message("Search path for libraries (unused): ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix continue() - elseif (_lib MATCHES "^-l(.+)$") - debug_message("Library match: CMAKE_MATCH_1:${CMAKE_MATCH_1}") - set(_libname "${CMAKE_MATCH_1}") - if(EXISTS "${_libname}") - debug_message("${_libname} detected as an existing full path!") - continue() # fullpath in -l argument and exists; all ok + elseif("${_lib}" MATCHES [[^-l("[^"]+"|(\\ |[^ ]+)+)$]] ) + set(_libname ${CMAKE_MATCH_1}) + debug_message("Searching for library: ${_libname}") + #debug_message("System libraries: ${_system_libs}") + foreach(_system_lib ${_system_libs}) + string(REPLACE "^[\t ]*-l" "" _libname_norm "${_libname}") + string(REGEX REPLACE "[\t ]+$" "" _libname_norm "${_libname_norm}") + #debug_message("${_libname_norm} vs ${_system_lib}") + if("${_libname_norm}" MATCHES "${_system_lib}" OR "-l${_libname_norm}" MATCHES "${_system_lib}") + set(NO_CHECK_LIB ON) + debug_message("${_libname} is SYSTEM_LIBRARY") + break() + endif() + endforeach() + if(NO_CHECK_LIB) + break() endif() - debug_message("CHECK_LIB_${_libname}_${_config} before: ${CHECK_LIB_${_libname}_${_config}}") - find_library(CHECK_LIB_${_libname}_${_config} NAMES ${_libname} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) - debug_message("CHECK_LIB_${_libname}_${_config} after: ${CHECK_LIB_${_libname}_${_config}}") - if(CHECK_LIB_${_libname}_${_config}) - unset(CHECK_LIB_${_libname}_${_config} CACHE) # need to unset or else other configurations will not check correctly - debug_message("CHECK_LIB_${_libname}_${_config} after unset: ${CHECK_LIB_${_libname}_${_config}}") - continue() # found library; all ok + #debug_message("Searching for library ${_libname} in ${libprefix}") + if(EXISTS "${_libname}") #full path + set(CHECK_LIB_${_libname} "${_libname}" CACHE INTERNAL FORCE) endif() - debug_message("Searching with additional suffixes: '${lib_suffixes}'") - foreach(_lib_suffix IN LISTS lib_suffixes) - string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") - set(search_name ${_name_without_extension}${_lib_suffix}) - debug_message("Search name: '${search_name}'") - debug_message("CHECK_LIB_${search_name}_${_config} before: ${CHECK_LIB_${search_name}_${_config}}") - debug_message("Search paths:'${_pkg_lib_paths_output}' '${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib'") - find_library(CHECK_LIB_${search_name}_${_config} NAMES ${search_name} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) - debug_message("CHECK_LIB_${search_name}_${_config} after: ${CHECK_LIB_${search_name}_${_config}}") - if(CHECK_LIB_${search_name}_${_config}) - message(FATAL_ERROR "Found ${CHECK_LIB_${search_name}_${_config}} with additional '${_lib_suffix}' suffix! Please correct the *.pc file!") - unset(CHECK_LIB_${search_name}_${_config} CACHE) # need to unset or else other configurations will not check correctly + find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}" NO_DEFAULT_PATH) + if(NOT CHECK_LIB_${_libname} AND "${_config}" STREQUAL "DEBUG") + #message(STATUS "Unable to locate ${_libname}. Trying with debug suffix") + foreach(_lib_suffix ${lib_suffixes}) + string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") + find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}") + if(CHECK_LIB_${_libname}) + message(FATAL_ERROR "Found ${CHECK_LIB_${_libname}} with additional debug suffix! Please correct the *.pc file!") + string(REGEX REPLACE "(-l${_name_without_extension})(\.dll\.a|\.a|\.lib|\.so)" "\\1${_lib_suffix}\\2" _contents ${_contents}) + endif() + endforeach() + if(NOT CHECK_LIB_${_libname}) + message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") endif() - endforeach() - # Reaching here means error! - message(STATUS "CHECK_LIB_${_libname}_${_config}:${CHECK_LIB_${_libname}_${_config}}") - message(FATAL_ERROR "Library \"${_libname}\" was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file") - else () - message(FATAL_ERROR "Unhandled string \"${_lib}\" was found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file or add the case to vcpkg_fixup_pkgconfig") + elseif(NOT CHECK_LIB_${_libname}) + message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + else() + debug_message("Found ${_libname} at ${CHECK_LIB_${_libname}}") + endif() + else() + #handle special cases + if(_lib STREQUAL "-pthread" OR _lib STREQUAL "-pthreads") + # Replace with VCPKG version? + #VCPKG should probably rename one of the pthread versions to avoid linking against system pthread? + # set(PTHREAD_SUFFIX ) + # if("${_config}" STREQUAL "DEBUG") + # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/debug/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3d.*") + # elseif("${_config}" STREQUAL "RELEASE") + # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3.*") + # endif() + # get_filename_component(PTHREAD_LIB "${PTHREAD_LIB}" NAME_WE) + # string(REPLACE "Libs: -pthread" "Libs: -L\${libdir} -l${PTHREAD_LIB}" _contents ${_contents}) + elseif(_lib STREQUAL _ignore_flags) + message(STATUS "${_lib} found in *.pc file and ignored!") + else() + message(FATAL_ERROR "Found ${_lib} and no rule to analyse the flag! Please check the *.pc file") + endif() endif() + unset(CHECK_LIB_${_libname} CACHE) + unset(NO_CHECK_LIB) endforeach() + ## Packages: + string(REGEX MATCH "Requires:[^\n#]+" _pkg_list_tmp "${_contents}") + string(REGEX REPLACE "Requires:[\t ]" "" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" "" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE " " ";" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX MATCH "Requires.private:[^\n#]+" _pkg_private_list_tmp "${_contents}") + string(REGEX REPLACE "Requires.private:[\t ]" "" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]+" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + + debug_message("Required packages: ${_pkg_list_tmp}") + debug_message("Required private packages: ${_pkg_private_list_tmp}") + + #message(STATUS "System packages: ${_system_packages}") + foreach(_package ${_pkg_list_tmp} ${_pkg_private_list_tmp}) + debug_message("Searching for package: ${_package}") + set(PKG_CHECK ON) + if(NOT "${_system_packages}" STREQUAL "") + #message(STATUS "Checking ${_package} for SYSTEM PACKAGE: ${_system_packages}") + if("${_system_packages}" MATCHES "${_package}" ) + debug_message("Package ${_package} is SYSTEM PACKAGE!") + set(PKG_CHECK OFF) + endif() + endif() + if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc" OR EXISTS "${PKG_LIB_SEARCH_PATH}/pkgconfig/${_package}.pc")) + message(FATAL_ERROR "Package ${_package} not found! If it is a system package add it to the SYSTEM_PACKAGES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + else() + debug_message("Found package ${_package}!") + endif() + endforeach() + ## Push modifications up in scope + set(${_contents_var} "${_contents}" PARENT_SCOPE) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) endfunction() function(vcpkg_fixup_pkgconfig) - cmake_parse_arguments(_vfpkg "SKIP_CHECK;NOT_STATIC_PKGCONFIG" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) + cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) - # Note about SYSTEM_PACKAGES: pkg-config requires all packages mentioned in pc files to exists. Otherwise pkg-config will fail to find the pkg. - # As such naming any SYSTEM_PACKAGES is damned to fail which is why it is not mentioned in the docs at the beginning. if(VCPKG_SYSTEM_LIBRARIES) list(APPEND _vfpkg_SYSTEM_LIBRARIES ${VCPKG_SYSTEM_LIBRARIES}) endif() - - if(_vfpkg_NOT_STATIC_PKGCONFIG) - set(PKGCONFIG_STATIC) - else() - set(PKGCONFIG_STATIC --static) - endif() - message(STATUS "Fixing pkgconfig") if(_vfpkg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") @@ -275,20 +212,7 @@ function(vcpkg_fixup_pkgconfig) list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") endif() - if(NOT PKGCONFIG) - find_program(PKGCONFIG pkg-config PATHS "bin" "/usr/bin" "/usr/local/bin") - if(NOT PKGCONFIG AND CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) - find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) - endif() - debug_message("Using pkg-config from: ${PKGCONFIG}") - if(NOT PKGCONFIG AND NOT _vfpkg_SKIP_CHECK) - message(WARNING "Unable to find pkg-config to validate *.pc files. Skipping checkes!") - set(_vfpkg_SKIP_CHECK TRUE) - endif() - endif() - - #Absolute Unix like paths + #Absolute Unix like paths string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}") @@ -299,24 +223,19 @@ function(vcpkg_fixup_pkgconfig) get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") - #Correct *.pc file + string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - string(REGEX REPLACE "^prefix=(\")?(\\\\)?\\\${prefix}(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + + string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") file(WRITE "${_file}" "${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() - if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! - foreach(_file ${_vfpkg_RELEASE_FILES}) - vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "RELEASE" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") - endforeach() - endif() - message(STATUS "Fixing pkgconfig - debug") debug_message("Files: ${_vfpkg_DEBUG_FILES}") foreach(_file ${_vfpkg_DEBUG_FILES}) @@ -325,29 +244,24 @@ function(vcpkg_fixup_pkgconfig) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") - #Correct *.pc file file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "debug/include" "../include" _contents "${_contents}") string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") string(REPLACE "debug/share" "../share" _contents "${_contents}") string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword - string(REGEX REPLACE "^prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. + + string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}(/debug)?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. + vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") file(WRITE "${_file}" "${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() - - if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! - foreach(_file ${_vfpkg_DEBUG_FILES}) - vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "DEBUG" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") - endforeach() - endif() message(STATUS "Fixing pkgconfig --- finished") set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 44581ac6f061f6..05253289ea24b9 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -91,22 +91,9 @@ function(vcpkg_from_gitlab) set(VCPKG_USE_HEAD_VERSION OFF) endif() - string(REPLACE "/" ";" GITLAB_REPO_LINK ${_vdud_REPO}) - - list(LENGTH GITLAB_REPO_LINK len) - if(${len} EQUAL "2") - list(GET GITLAB_REPO_LINK 0 ORG_NAME) - list(GET GITLAB_REPO_LINK 1 REPO_NAME) - set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}) - endif() - - if(${len} EQUAL "3") - list(GET GITLAB_REPO_LINK 0 ORG_NAME) - list(GET GITLAB_REPO_LINK 1 GROUP_NAME) - list(GET GITLAB_REPO_LINK 2 REPO_NAME) - set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${GROUP_NAME}/${REPO_NAME}) - endif() - + string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) + string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) + # Handle --no-head scenarios if(NOT VCPKG_USE_HEAD_VERSION) if(NOT _vdud_REF) @@ -116,7 +103,7 @@ function(vcpkg_from_gitlab) string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") vcpkg_download_distfile(ARCHIVE - URLS "${GITLAB_LINK}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" + URLS "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" SHA512 "${_vdud_SHA512}" FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) @@ -133,7 +120,7 @@ function(vcpkg_from_gitlab) endif() # The following is for --head scenarios - set(URL "${GITLAB_LINK}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") + set(URL "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz") set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") @@ -164,7 +151,7 @@ function(vcpkg_from_gitlab) # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision _execute_process(COMMAND ${GIT} ls-remote - "${GITLAB_LINK}.git" "${_vdud_HEAD_REF}" + "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output ) diff --git a/scripts/cmake/vcpkg_prettify_command.cmake b/scripts/cmake/vcpkg_prettify_command.cmake index c12332b7a5965b..ca04f9120e18b9 100644 --- a/scripts/cmake/vcpkg_prettify_command.cmake +++ b/scripts/cmake/vcpkg_prettify_command.cmake @@ -16,10 +16,10 @@ macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR) set(${OUTPUT_VAR} "") foreach(v ${${INPUT_VAR}}) - if(v MATCHES "( )") - list(APPEND ${OUTPUT_VAR} "\"${v}\"") + if(${v} MATCHES "( )") + list(APPEND ${OUTPUT_VAR} \"${v}\") else() - list(APPEND ${OUTPUT_VAR} "${v}") + list(APPEND ${OUTPUT_VAR} ${v}) endif() endforeach() list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR}) diff --git a/scripts/test_ports/cmake/CONTROL b/scripts/test_ports/cmake/CONTROL deleted file mode 100644 index ba5848dbcb7386..00000000000000 --- a/scripts/test_ports/cmake/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: cmake -Version: 3.17.2 -Build-Depends: qt5-base, qt5-winextras (windows), bzip2, expat, jsoncpp, liblzma, zlib, zstd, libarchive, curl, libuv, nghttp2 -Homepage: https://cmake.org/ -Description: CMake is an open-source, cross-platform family of tools designed to build, test and package software. diff --git a/scripts/test_ports/cmake/portfile.cmake b/scripts/test_ports/cmake/portfile.cmake deleted file mode 100644 index 9f41be53c16a39..00000000000000 --- a/scripts/test_ports/cmake/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) -vcpkg_from_gitlab( - GITLAB_URL https://gitlab.kitware.com/ - OUT_SOURCE_PATH SOURCE_PATH - REPO cmake/cmake - REF 615129f3ebd308abeaaee7f5f0689e7fc4616c28 - SHA512 5f02e05b7e6119c9c165c868d0679e0fbe5cc6b4f081a4e63a87d663c029bc378327ec042ae6bfd16bf48737bfaa5bae3be33a6dd33648e1f47cdc1a2370c366 - HEAD_REF master -) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DBUILD_TESTING=OFF - #-DCMAKE_USE_SYSTEM_LIBRARIES=ON - -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON - -DCMAKE_USE_SYSTEM_CURL=ON - -DCMAKE_USE_SYSTEM_EXPAT=ON - -DCMAKE_USE_SYSTEM_ZLIB=ON - -DCMAKE_USE_SYSTEM_BZIP2=ON - -DCMAKE_USE_SYSTEM_ZSTD=ON - -DCMAKE_USE_SYSTEM_FORM=ON - -DCMAKE_USE_SYSTEM_JSONCPP=ON - -DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG - -DCMAKE_USE_SYSTEM_LIBUV=ON - -DBUILD_QtDialog=ON # Just to test Qt with CMake -) - -vcpkg_install_cmake(ADD_BIN_TO_PATH) -vcpkg_copy_pdbs() - -if(NOT VCPKG_TARGET_IS_OSX) - set(_tools cmake cmake-gui ctest cpack) - if(VCPKG_TARGET_IS_WINDOWS) - list(APPEND _tools cmcldeps) - endif() - vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN) -else() - # On OSX everything is within a CMake.app folder - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) - file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app") - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app") - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/debug) - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app") - endif() -endif() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) - -# Handle copyright -configure_file(${SOURCE_PATH}/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file diff --git a/scripts/test_ports/vcpkg-ci-paraview/CONTROL b/scripts/test_ports/vcpkg-ci-paraview/CONTROL deleted file mode 100644 index d4816dbf383660..00000000000000 --- a/scripts/test_ports/vcpkg-ci-paraview/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: vcpkg-ci-paraview -Version: 1 -Port-Version: 1 -Homepage: https://github.com/microsoft/vcpkg -Description: Port to force features of certain ports within CI -Build-Depends: paraview[vtkm, tools] diff --git a/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake b/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake deleted file mode 100644 index 0015715fb66c72..00000000000000 --- a/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/scripts/toolchains/android.cmake b/scripts/toolchains/android.cmake index a7a7ea2d0cae41..8ffe9fbbc478f9 100644 --- a/scripts/toolchains/android.cmake +++ b/scripts/toolchains/android.cmake @@ -5,13 +5,13 @@ set(ANDROID_TOOLCHAIN clang CACHE STRING "") set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "") set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "") -if (VCPKG_TARGET_TRIPLET MATCHES "^arm64-android") +if (VCPKG_TARGET_TRIPLET STREQUAL "arm64-android") set(ANDROID_ABI arm64-v8a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-android") +elseif(VCPKG_TARGET_TRIPLET STREQUAL "arm-android") set(ANDROID_ABI armeabi-v7a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET MATCHES "^x64-android") +elseif(VCPKG_TARGET_TRIPLET STREQUAL "x64-android") set(ANDROID_ABI x86_64 CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET MATCHES "^x86-android") +elseif(VCPKG_TARGET_TRIPLET STREQUAL "x86-android") set(ANDROID_ABI x86 CACHE STRING "") else() message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}") @@ -26,11 +26,7 @@ endif() if(DEFINED ENV{ANDROID_NDK_HOME}) set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME}) else() - set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") - if(NOT EXISTS "${ANDROID_NDK_HOME}") - # Use Xamarin default installation folder - set(ANDROID_NDK_HOME "$ENV{ProgramFiles\(x86\)}/Android/android-sdk/ndk-bundle") - endif() + set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") endif() if(NOT EXISTS "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") @@ -43,14 +39,14 @@ if(NOT _VCPKG_ANDROID_TOOLCHAIN) set(_VCPKG_ANDROID_TOOLCHAIN 1) get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if(NOT _CMAKE_IN_TRY_COMPILE) - string(APPEND CMAKE_C_FLAGS " -fPIC ${VCPKG_C_FLAGS} ") - string(APPEND CMAKE_CXX_FLAGS " -fPIC ${VCPKG_CXX_FLAGS} ") - string(APPEND CMAKE_C_FLAGS_DEBUG " ${VCPKG_C_FLAGS_DEBUG} ") - string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${VCPKG_CXX_FLAGS_DEBUG} ") - string(APPEND CMAKE_C_FLAGS_RELEASE " ${VCPKG_C_FLAGS_RELEASE} ") - string(APPEND CMAKE_CXX_FLAGS_RELEASE " ${VCPKG_CXX_FLAGS_RELEASE} ") - - string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") - string(APPEND CMAKE_EXE_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") + string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") + string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") + string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ") + string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ") + + string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") endif() endif() diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 62cb3740db265f..10a280faacbd30 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -1,172 +1,161 @@ -cmake_minimum_required(VERSION 3.14) - -project(vcpkg CXX) -include(cmake/utilities.cmake) - -# =============== -# === Options === -# =============== - -include(CMakeDependentOption) - -option(BUILD_TESTING "Option for enabling testing" ON) -option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) -option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) -option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) -option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) -option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) - -CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF - "BUILD_TESTING" OFF) - -if(WERROR) - message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") -endif() -if(DEFINE_DISABLE_METRICS) - message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") - set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) -endif() - -# ============= -# === Files === -# ============= - -file(GLOB VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) -file(GLOB VCPKGLIB_BASE_SOURCES CONFIGURE_DEPENDS src/vcpkg/base/*.cpp) -file(GLOB VCPKGLIB_INCLUDES CONFIGURE_DEPENDS include/vcpkg/*.h) -file(GLOB VCPKGLIB_BASE_INCLUDES CONFIGURE_DEPENDS include/vcpkg/base/*.h) - -set(VCPKG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkg.cpp) - -set(VCPKGMETRICSUPLOADER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkgmetricsuploader.cpp) - -file(GLOB VCPKG_TEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) -file(GLOB VCPKG_TEST_INCLUDES CONFIGURE_DEPENDS include/vcpkg-test/*.h) - -file(GLOB VCPKG_FUZZ_SOURCES CONFIGURE_DEPENDS src/vcpkg-fuzz/*.cpp) - -# ======================== -# === System detection === -# ======================== - -vcpkg_detect_compiler() -vcpkg_detect_standard_library() -vcpkg_detect_std_filesystem() - -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 17) -if(MSVC) - string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -endif() - -# =============== -# === Targets === -# =============== - -# === Target: vcpkglib === - -add_library(vcpkglib - ${VCPKGLIB_BASE_SOURCES} - ${VCPKGLIB_SOURCES} - ${VCPKGLIB_BASE_INCLUDES} - ${VCPKGLIB_INCLUDES}) -target_include_directories(vcpkglib PUBLIC include) - -vcpkg_target_add_warning_options(vcpkglib) -target_compile_definitions(vcpkglib PUBLIC - VCPKG_USE_STD_FILESYSTEM=$) - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) -target_link_libraries(vcpkglib PRIVATE Threads::Threads) - -if(VCPKG_CXXFS_LIBRARY) - target_link_libraries(vcpkglib PRIVATE ${VCPKG_CXXFS_LIBRARY}) -endif() - -if(MSVC) - get_target_property(_srcs vcpkglib SOURCES) - - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() - - set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") - target_sources(vcpkglib PRIVATE src/pch.cpp) - target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) -else() - target_compile_options(vcpkglib PRIVATE -include "${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h") -endif() - -if (MINGW) - target_compile_definitions(vcpkglib - PUBLIC - UNICODE - _WIN32_WINNT=0x0601 - WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 - __fastfail=exit) - target_link_libraries(vcpkglib PUBLIC winhttp bcrypt version ole32 uuid) -endif() - -# === Target: vcpkg === - -add_executable(vcpkg ${VCPKG_SOURCES}) -target_link_libraries(vcpkg PRIVATE vcpkglib) -vcpkg_target_add_warning_options(vcpkg) - -# === Target: vcpkgmetricsuploader === - -if(WIN32 AND NOT VCPKG_DISABLE_METRICS) - add_executable(vcpkgmetricsuploader WIN32 ${VCPKGMETRICSUPLOADER_SOURCES}) - target_link_libraries(vcpkgmetricsuploader PRIVATE vcpkglib) - vcpkg_target_add_warning_options(vcpkgmetricsuploader) -endif() - -# === Target: vcpkg-test === - -if (BUILD_TESTING) - enable_testing() - - add_executable(vcpkg-test - ${VCPKG_TEST_SOURCES} - ${VCPKG_TEST_INCLUDES}) - target_link_libraries(vcpkg-test PRIVATE vcpkglib) - vcpkg_target_add_warning_options(vcpkg-test) - - add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) - - if (VCPKG_BUILD_BENCHMARKING) - target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) - endif() -endif() - -# === Target: vcpkg-fuzz === - -if(VCPKG_BUILD_FUZZING) - add_executable(vcpkg-fuzz ${VCPKG_FUZZ_SOURCES}) - target_link_libraries(vcpkg-fuzz PRIVATE vcpkglib) - vcpkg_target_add_warning_options(vcpkg-fuzz) -endif() - -# === Target: format === - -find_program(CLANG_FORMAT clang-format) -if(CLANG_FORMAT) - add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose - ${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp - ${VCPKGLIB_BASE_SOURCES} - ${VCPKGLIB_NON_PCH_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h - ${VCPKGLIB_BASE_INCLUDES} - ${VCPKGLIB_NON_PCH_INCLUDES} - - ${VCPKG_SOURCES} - ${VCPKGMETRICSUPLOADER_SOURCES} - - ${VCPKG_TEST_SOURCES} - ${VCPKG_TEST_INCLUDES} - - ${VCPKG_FUZZ_SOURCES}) -endif() +cmake_minimum_required(VERSION 3.14) + +project(vcpkg CXX) +include(cmake/utilities.cmake) + +# =============== +# === Options === +# =============== + +include(CMakeDependentOption) + +option(BUILD_TESTING "Option for enabling testing" ON) +option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) +option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) +option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) +option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) +option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) + +CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF + "BUILD_TESTING" OFF) + +if(WERROR) + message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") +endif() +if(DEFINE_DISABLE_METRICS) + message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") + set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) +endif() + +vcpkg_detect_compiler() +vcpkg_detect_standard_library() +vcpkg_detect_std_filesystem() + +# ====================== +# === Compiler Flags === +# ====================== + +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) + +if(MSVC) + # either MSVC, or clang-cl + add_compile_options(-FC) + + if (MSVC_VERSION GREATER 1900) + # Visual Studio 2017 or later + add_compile_options(-permissive- -utf-8) + endif() + + if(VCPKG_DEVELOPMENT_WARNINGS) + string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + + add_compile_options(-W4) + if(VCPKG_COMPILER STREQUAL "clang") + add_compile_options(-Wmissing-prototypes -Wno-missing-field-initializers) + else() + add_compile_options(-analyze) + endif() + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + add_compile_options(-WX) + endif() +else() + if(VCPKG_DEVELOPMENT_WARNINGS) + add_compile_options(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) + + # GCC and clang have different names for the same warning + if(VCPKG_COMPILER STREQUAL "gcc") + add_compile_options(-Wmissing-declarations) + elseif(VCPKG_COMPILER STREQUAL "clang") + add_compile_options(-Wmissing-prototypes) + endif() + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + add_compile_options(-Werror) + endif() +endif() + +# ======================== +# === System Libraries === +# ======================== + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +link_libraries(Threads::Threads) + +add_compile_definitions(VCPKG_USE_STD_FILESYSTEM=$) +if(VCPKG_REQUIRE_LINK_CXXFS) + if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") + link_libraries(stdc++fs) + elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") + link_libraries(c++fs) + endif() +endif() + +if (MINGW) + add_compile_definitions( + UNICODE + _WIN32_WINNT=0x0601 + WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 + __fastfail=exit) + link_libraries(winhttp bcrypt version ole32 uuid) +endif() + + +# =============== +# === Targets === +# =============== + +add_compile_definitions(VCPKG_DISABLE_METRICS=$) +include_directories(include) +file(GLOB_RECURSE VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) +add_library(vcpkglib OBJECT ${VCPKGLIB_SOURCES}) + +add_executable(vcpkg src/vcpkg.cpp $) +if(WIN32 AND NOT VCPKG_DISABLE_METRICS) + add_executable(vcpkgmetricsuploader WIN32 src/vcpkgmetricsuploader.cpp $) +endif() + +if (BUILD_TESTING) + file(GLOB_RECURSE VCPKGTEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) + + enable_testing() + add_executable(vcpkg-test ${VCPKGTEST_SOURCES} $) + add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) + + if (VCPKG_BUILD_BENCHMARKING) + target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) + endif() +endif() + +if(VCPKG_BUILD_FUZZING) + file(GLOB_RECURSE VCPKGFUZZ_SOURCES src/vcpkg-fuzz/*.cpp) + add_executable(vcpkg-fuzz ${VCPKGFUZZ_SOURCES} $) +endif() + +find_program(CLANG_FORMAT clang-format) +if(CLANG_FORMAT) + file(GLOB_RECURSE VCPKG_FORMAT_SOURCES CONFIGURE_DEPENDS src/*.cpp include/pch.h include/vcpkg/*.h include/vcpkg-test/*.h) + add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FORMAT_SOURCES}) +endif() + +# =========== +# === PCH === +# =========== + +if(MSVC) + get_target_property(_srcs vcpkglib SOURCES) + + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") + set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + endif() + + set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") + target_sources(vcpkglib PRIVATE src/pch.cpp) + target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) +endif() diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake index f04c1ddbb771b5..b99063a658ad9c 100644 --- a/toolsrc/cmake/utilities.cmake +++ b/toolsrc/cmake/utilities.cmake @@ -77,7 +77,7 @@ int main() {} _VCPKG_STANDARD_LIBRARY_LIBCXX) check_cxx_source_compiles([[ #include -#if !defined(_MSVC_STL_VERSION) && !(defined(_MSC_VER) && _MSC_VER <= 1900) +#if !defined(_MSVC_STL_VERSION) #error "not MSVC stl" #endif int main() {} @@ -101,7 +101,7 @@ int main() {} endif() endfunction() -# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_CXXFS_LIBRARY +# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_REQUIRE_LINK_CXXFS function(vcpkg_detect_std_filesystem) vcpkg_detect_standard_library() @@ -129,14 +129,10 @@ int main() {} int main() {} ]] _VCPKG_USE_STD_FILESYSTEM) - - if(_VCPKG_REQUIRE_LINK_CXXFS) - set(_VCPKG_CXXFS_LIBRARY "stdc++fs") - endif() elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") # AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0 - set(_VCPKG_CXXFS_LIBRARY OFF) + set(_VCPKG_REQUIRE_LINK_CXXFS OFF) else() check_cxx_source_compiles([[ #include @@ -146,10 +142,6 @@ int main() {} int main() {} ]] _VCPKG_REQUIRE_LINK_CXXFS) - - if(_VCPKG_REQUIRE_LINK_CXXFS) - set(_VCPKG_CXXFS_LIBRARY "c++fs") - endif() endif() # We don't support versions of libc++ < 7.0.0, and libc++ 7.0.0 has @@ -163,16 +155,16 @@ int main() {} int main() {}" _VCPKG_USE_STD_FILESYSTEM) - set(_VCPKG_CXXFS_LIBRARY OFF) + set(_VCPKG_REQUIRE_LINK_CXXFS OFF) endif() set(VCPKG_USE_STD_FILESYSTEM ${_VCPKG_USE_STD_FILESYSTEM} CACHE BOOL "Whether to use , as opposed to " FORCE) - set(VCPKG_CXXFS_LIBRARY ${_VCPKG_CXXFS_LIBRARY} - CACHE STRING - "Library to link (if any) in order to use " + set(VCPKG_REQUIRE_LINK_CXXFS ${_VCPKG_REQUIRE_LINK_CXXFS} + CACHE BOOL + "Whether it's required to pass -l[std]c++fs in order to use " FORCE) if(VCPKG_USE_STD_FILESYSTEM) @@ -180,54 +172,10 @@ int main() {} else() set(msg "") endif() - if(VCPKG_CXXFS_LIBRARY) - set(msg "${msg} with -l${VCPKG_CXXFS_LIBRARY}") + if(VCPKG_REQUIRE_LINK_CXXFS) + set(msg "${msg} with -l[std]c++fs") endif() message(STATUS "Detecting how to use the C++ filesystem library - ${msg}") endif() endfunction() - -function(vcpkg_target_add_warning_options TARGET) - if(MSVC) - # either MSVC, or clang-cl - target_compile_options(${TARGET} PRIVATE -FC) - - if (MSVC_VERSION GREATER 1900) - # Visual Studio 2017 or later - target_compile_options(${TARGET} PRIVATE -permissive- -utf-8) - endif() - - if(VCPKG_DEVELOPMENT_WARNINGS) - target_compile_options(${TARGET} PRIVATE -W4) - if(VCPKG_COMPILER STREQUAL "clang") - target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes -Wno-missing-field-initializers) - else() - target_compile_options(${TARGET} PRIVATE -analyze) - endif() - else() - target_compile_options(${TARGET} PRIVATE -W3) - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - target_compile_options(${TARGET} PRIVATE -WX) - endif() - else() - if(VCPKG_DEVELOPMENT_WARNINGS) - target_compile_options(${TARGET} PRIVATE - -Wall -Wextra -Wpedantic - -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) - - # GCC and clang have different names for the same warning - if(VCPKG_COMPILER STREQUAL "gcc") - target_compile_options(${TARGET} PRIVATE -Wmissing-declarations) - elseif(VCPKG_COMPILER STREQUAL "clang") - target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - target_compile_options(${TARGET} PRIVATE -Werror) - endif() - endif() -endfunction() diff --git a/toolsrc/windows-bootstrap/dirs.proj b/toolsrc/dirs.proj similarity index 100% rename from toolsrc/windows-bootstrap/dirs.proj rename to toolsrc/dirs.proj diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h index d2c512f9bf0eae..ce403c308095d8 100644 --- a/toolsrc/include/vcpkg-test/util.h +++ b/toolsrc/include/vcpkg-test/util.h @@ -18,22 +18,6 @@ } \ } while (0) -namespace Catch -{ - template<> - struct StringMaker - { - static std::string convert(vcpkg::FullPackageSpec const& value) - { - return vcpkg::Strings::concat(value.package_spec.name(), - '[', - vcpkg::Strings::join(",", value.features), - "]:", - value.package_spec.triplet()); - } - }; -} - namespace vcpkg::Test { std::unique_ptr make_control_file( @@ -64,12 +48,6 @@ namespace vcpkg::Test const char* depends = "", const char* triplet = "x86-windows"); - extern const Triplet X86_WINDOWS; - extern const Triplet X64_WINDOWS; - extern const Triplet X86_UWP; - extern const Triplet ARM_UWP; - extern const Triplet X64_ANDROID; - /// /// Map of source control files by their package name. /// @@ -77,7 +55,7 @@ namespace vcpkg::Test { std::unordered_map map; Triplet triplet; - PackageSpecMap(Triplet t = X86_WINDOWS) noexcept : triplet(t) { } + PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) { } PackageSpec emplace(const char* name, const char* depends = "", diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h index a4ad44ebd07259..3195c223a72601 100644 --- a/toolsrc/include/vcpkg/base/json.h +++ b/toolsrc/include/vcpkg/base/json.h @@ -88,11 +88,11 @@ namespace vcpkg::Json { Value() noexcept; // equivalent to Value::null() Value(Value&&) noexcept; - Value(const Value&); Value& operator=(Value&&) noexcept; - Value& operator=(const Value&); ~Value(); + Value clone() const noexcept; + ValueKind kind() const noexcept; bool is_null() const noexcept; @@ -124,12 +124,7 @@ namespace vcpkg::Json static Value number(double d) noexcept; static Value string(StringView) noexcept; static Value array(Array&&) noexcept; - static Value array(const Array&) noexcept; static Value object(Object&&) noexcept; - static Value object(const Object&) noexcept; - - friend bool operator==(const Value& lhs, const Value& rhs); - friend bool operator!=(const Value& lhs, const Value& rhs) { return !(lhs == rhs); } private: friend struct impl::ValueImpl; @@ -143,12 +138,14 @@ namespace vcpkg::Json public: Array() = default; - Array(Array const&) = default; + Array(Array const&) = delete; Array(Array&&) = default; - Array& operator=(Array const&) = default; + Array& operator=(Array const&) = delete; Array& operator=(Array&&) = default; ~Array() = default; + Array clone() const noexcept; + using iterator = underlying_t::iterator; using const_iterator = underlying_t::const_iterator; @@ -180,45 +177,37 @@ namespace vcpkg::Json const_iterator cbegin() const { return underlying_.cbegin(); } const_iterator cend() const { return underlying_.cend(); } - friend bool operator==(const Array& lhs, const Array& rhs); - friend bool operator!=(const Array& lhs, const Array& rhs) { return !(lhs == rhs); } - private: underlying_t underlying_; }; struct Object { private: - using value_type = std::pair; - using underlying_t = std::vector; + using underlying_t = std::vector>; underlying_t::const_iterator internal_find_key(StringView key) const noexcept; public: // these are here for better diagnostics Object() = default; - Object(Object const&) = default; + Object(Object const&) = delete; Object(Object&&) = default; - Object& operator=(Object const&) = default; + Object& operator=(Object const&) = delete; Object& operator=(Object&&) = default; ~Object() = default; + Object clone() const noexcept; + // asserts if the key is found Value& insert(std::string key, Value&& value); - Value& insert(std::string key, const Value& value); Object& insert(std::string key, Object&& value); - Object& insert(std::string key, const Object& value); Array& insert(std::string key, Array&& value); - Array& insert(std::string key, const Array& value); // replaces the value if the key is found, otherwise inserts a new // value. Value& insert_or_replace(std::string key, Value&& value); - Value& insert_or_replace(std::string key, const Value& value); Object& insert_or_replace(std::string key, Object&& value); - Object& insert_or_replace(std::string key, const Object& value); Array& insert_or_replace(std::string key, Array&& value); - Array& insert_or_replace(std::string key, const Array& value); // returns whether the key existed bool remove(StringView key) noexcept; @@ -227,13 +216,13 @@ namespace vcpkg::Json Value& operator[](StringView key) noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); return *res; } const Value& operator[](StringView key) const noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); return *res; } @@ -242,12 +231,8 @@ namespace vcpkg::Json bool contains(StringView key) const noexcept { return this->get(key); } - bool is_empty() const noexcept { return size() == 0; } std::size_t size() const noexcept { return this->underlying_.size(); } - // sorts keys alphabetically - void sort_keys(); - struct const_iterator { using value_type = std::pair; @@ -282,9 +267,6 @@ namespace vcpkg::Json const_iterator cbegin() const noexcept { return const_iterator{this->underlying_.begin()}; } const_iterator cend() const noexcept { return const_iterator{this->underlying_.end()}; } - friend bool operator==(const Object& lhs, const Object& rhs); - friend bool operator!=(const Object& lhs, const Object& rhs) { return !(lhs == rhs); } - private: underlying_t underlying_; }; diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 5042dd15883149..cd48380290d675 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -185,8 +185,6 @@ namespace vcpkg::Strings std::string trim(std::string&& s); - StringView trim(StringView sv); - void trim_all_and_remove_whitespace_strings(std::vector* strings); std::vector split(StringView s, const char delimiter); diff --git a/toolsrc/include/vcpkg/base/stringview.h b/toolsrc/include/vcpkg/base/stringview.h index 405142c3683f53..6a5503e1c3e29d 100644 --- a/toolsrc/include/vcpkg/base/stringview.h +++ b/toolsrc/include/vcpkg/base/stringview.h @@ -37,9 +37,6 @@ namespace vcpkg constexpr const char* begin() const { return m_ptr; } constexpr const char* end() const { return m_ptr + m_size; } - std::reverse_iterator rbegin() const { return std::make_reverse_iterator(end()); } - std::reverse_iterator rend() const { return std::make_reverse_iterator(begin()); } - constexpr const char* data() const { return m_ptr; } constexpr size_t size() const { return m_size; } diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 2340728fd032ce..0a2e745c468c11 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -25,7 +25,6 @@ namespace vcpkg::System X64, ARM, ARM64, - S390X, }; Optional to_cpu_architecture(StringView arch); diff --git a/toolsrc/include/vcpkg/base/system.process.h b/toolsrc/include/vcpkg/base/system.process.h index b9184c05cd7440..91faa59854b4e2 100644 --- a/toolsrc/include/vcpkg/base/system.process.h +++ b/toolsrc/include/vcpkg/base/system.process.h @@ -27,12 +27,6 @@ namespace vcpkg::System { CmdLineBuilder& path_arg(const fs::path& p) { return string_arg(p.u8string()); } CmdLineBuilder& string_arg(StringView s); - CmdLineBuilder& ampersand() - { - buf.push_back('&'); - buf.push_back('&'); - return *this; - } std::string extract() noexcept { return std::move(buf); } operator ZStringView() const { return buf; } diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index f10c41af07bc01..2d2e4cf200de52 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -39,7 +39,7 @@ namespace vcpkg std::vector default_features; std::vector dependencies; std::string abi; - Type type = {Type::UNKNOWN}; + Type type; }; bool operator==(const BinaryParagraph&, const BinaryParagraph&); diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 83d797fd1df216..0fac8222c07e27 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -347,11 +346,4 @@ namespace vcpkg::Build bool m_compiler_tracking; }; - - struct BuildCommand : Commands::TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; } diff --git a/toolsrc/include/vcpkg/commands.autocomplete.h b/toolsrc/include/vcpkg/commands.autocomplete.h deleted file mode 100644 index 4f518d0f0c6029..00000000000000 --- a/toolsrc/include/vcpkg/commands.autocomplete.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Autocomplete -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct AutocompleteCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.buildexternal.h b/toolsrc/include/vcpkg/commands.buildexternal.h deleted file mode 100644 index b4e1aa669bf5d0..00000000000000 --- a/toolsrc/include/vcpkg/commands.buildexternal.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::BuildExternal -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct BuildExternalCommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.cache.h b/toolsrc/include/vcpkg/commands.cache.h deleted file mode 100644 index 5d18a3f99f49e1..00000000000000 --- a/toolsrc/include/vcpkg/commands.cache.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Cache -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct CacheCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.ci.h b/toolsrc/include/vcpkg/commands.ci.h deleted file mode 100644 index 4657741c926d2f..00000000000000 --- a/toolsrc/include/vcpkg/commands.ci.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::CI -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct CICommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.ciclean.h b/toolsrc/include/vcpkg/commands.ciclean.h deleted file mode 100644 index ed9e2f005b209f..00000000000000 --- a/toolsrc/include/vcpkg/commands.ciclean.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::CIClean -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct CICleanCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.contact.h b/toolsrc/include/vcpkg/commands.contact.h deleted file mode 100644 index f0af41c14aef4e..00000000000000 --- a/toolsrc/include/vcpkg/commands.contact.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Contact -{ - extern const CommandStructure COMMAND_STRUCTURE; - const std::string& email(); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - - struct ContactCommand : BasicCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.create.h b/toolsrc/include/vcpkg/commands.create.h deleted file mode 100644 index a8eb99b273d0dd..00000000000000 --- a/toolsrc/include/vcpkg/commands.create.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Create -{ - extern const CommandStructure COMMAND_STRUCTURE; - int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct CreateCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.dependinfo.h b/toolsrc/include/vcpkg/commands.dependinfo.h deleted file mode 100644 index 81301b6d9c6c9c..00000000000000 --- a/toolsrc/include/vcpkg/commands.dependinfo.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::DependInfo -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct DependInfoCommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.edit.h b/toolsrc/include/vcpkg/commands.edit.h deleted file mode 100644 index 9a37d2ee3d2cfe..00000000000000 --- a/toolsrc/include/vcpkg/commands.edit.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Edit -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct EditCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.env.h b/toolsrc/include/vcpkg/commands.env.h deleted file mode 100644 index 5ba58d081daedf..00000000000000 --- a/toolsrc/include/vcpkg/commands.env.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Env -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct EnvCommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.fetch.h b/toolsrc/include/vcpkg/commands.fetch.h deleted file mode 100644 index c41965903e9571..00000000000000 --- a/toolsrc/include/vcpkg/commands.fetch.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Fetch -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct FetchCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.format-manifest.h b/toolsrc/include/vcpkg/commands.format-manifest.h deleted file mode 100644 index 1317bbc705febc..00000000000000 --- a/toolsrc/include/vcpkg/commands.format-manifest.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::FormatManifest -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct FormatManifestCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 948d4b5e84f78b..cec9237f5737f4 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -1,9 +1,10 @@ #pragma once #include -#include #include #include +#include +#include #include #include @@ -11,6 +12,162 @@ namespace vcpkg::Commands { + using CommandTypeA = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + using CommandTypeC = void (*)(const VcpkgCmdArguments& args, Files::Filesystem& fs); + + enum class DryRun : bool + { + No, + Yes, + }; + + namespace BuildExternal + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + + namespace CI + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + + namespace CIClean + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Env + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + + namespace Create + { + extern const CommandStructure COMMAND_STRUCTURE; + int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Upgrade + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + + namespace Edit + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace DependInfo + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + + namespace Search + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace List + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Owns + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Cache + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Integrate + { + extern const CommandStructure COMMAND_STRUCTURE; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void append_helpstring(HelpTableFormatter& table); + std::string get_helpstring(); + } + + namespace PortsDiff + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace PortHistory + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Autocomplete + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Version + { + const char* base_version(); + const std::string& version(); + void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + } + + namespace Contact + { + extern const CommandStructure COMMAND_STRUCTURE; + const std::string& email(); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + } + + namespace X_VSInstances + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Hash + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Fetch + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace FormatManifest + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace SetInstalled + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit_ex(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binary_provider, + const CMakeVars::CMakeVarProvider& cmake_vars, + const std::vector& specs, + const Build::BuildPackageOptions& install_plan_options, + DryRun dry_run, + const Optional& pkgsconfig_path); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + } + template struct PackageNameAndFunction { @@ -18,12 +175,12 @@ namespace vcpkg::Commands T function; }; - Span> get_available_basic_commands(); - Span> get_available_paths_commands(); - Span> get_available_triplet_commands(); + Span> get_available_commands_type_a(); + Span> get_available_commands_type_b(); + Span> get_available_commands_type_c(); template - T find(StringView command_name, Span> available_commands) + T find(const std::string& command_name, const std::vector> available_commands) { for (const PackageNameAndFunction& cmd : available_commands) { diff --git a/toolsrc/include/vcpkg/commands.hash.h b/toolsrc/include/vcpkg/commands.hash.h deleted file mode 100644 index aa9b11c056c984..00000000000000 --- a/toolsrc/include/vcpkg/commands.hash.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Hash -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct HashCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.info.h b/toolsrc/include/vcpkg/commands.info.h deleted file mode 100644 index 556d1eb012da82..00000000000000 --- a/toolsrc/include/vcpkg/commands.info.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Info -{ - extern const CommandStructure COMMAND_STRUCTURE; - - struct InfoCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.integrate.h b/toolsrc/include/vcpkg/commands.integrate.h deleted file mode 100644 index 162f49a3c34baf..00000000000000 --- a/toolsrc/include/vcpkg/commands.integrate.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Integrate -{ - extern const CommandStructure COMMAND_STRUCTURE; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void append_helpstring(HelpTableFormatter& table); - std::string get_helpstring(); - - struct IntegrateCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h deleted file mode 100644 index 10d213522007bc..00000000000000 --- a/toolsrc/include/vcpkg/commands.interface.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include -#include - -namespace vcpkg::Commands -{ - enum class DryRun : bool - { - No, - Yes, - }; - - struct BasicCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const = 0; - virtual ~BasicCommand() = default; - }; - - struct PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const = 0; - virtual ~PathsCommand() = default; - }; - - struct TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const = 0; - virtual ~TripletCommand() = default; - }; -} diff --git a/toolsrc/include/vcpkg/commands.list.h b/toolsrc/include/vcpkg/commands.list.h deleted file mode 100644 index 77a5f41bdb3217..00000000000000 --- a/toolsrc/include/vcpkg/commands.list.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::List -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct ListCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h deleted file mode 100644 index 13676b2bd96a36..00000000000000 --- a/toolsrc/include/vcpkg/commands.owns.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Owns -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct OwnsCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.porthistory.h b/toolsrc/include/vcpkg/commands.porthistory.h deleted file mode 100644 index 3ca5325320f4e7..00000000000000 --- a/toolsrc/include/vcpkg/commands.porthistory.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::PortHistory -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct PortHistoryCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.portsdiff.h b/toolsrc/include/vcpkg/commands.portsdiff.h deleted file mode 100644 index 8cd1b094c68742..00000000000000 --- a/toolsrc/include/vcpkg/commands.portsdiff.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::PortsDiff -{ - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct PortsDiffCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h deleted file mode 100644 index 6220a886630e5c..00000000000000 --- a/toolsrc/include/vcpkg/commands.search.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Search -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct SearchCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.setinstalled.h b/toolsrc/include/vcpkg/commands.setinstalled.h deleted file mode 100644 index c5723669bd7307..00000000000000 --- a/toolsrc/include/vcpkg/commands.setinstalled.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace vcpkg::Commands::SetInstalled -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit_ex(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - const PortFileProvider::PathsPortFileProvider& provider, - IBinaryProvider& binary_provider, - const CMakeVars::CMakeVarProvider& cmake_vars, - Dependencies::ActionPlan action_plan, - DryRun dry_run, - const Optional& pkgsconfig_path); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct SetInstalledCommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.upgrade.h b/toolsrc/include/vcpkg/commands.upgrade.h deleted file mode 100644 index 340a70c97cd42b..00000000000000 --- a/toolsrc/include/vcpkg/commands.upgrade.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Upgrade -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct UpgradeCommand : TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.version.h b/toolsrc/include/vcpkg/commands.version.h deleted file mode 100644 index 0f1717c7462dd0..00000000000000 --- a/toolsrc/include/vcpkg/commands.version.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::Version -{ - const char* base_version(); - const std::string& version(); - void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - - struct VersionCommand : BasicCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; - }; -} diff --git a/toolsrc/include/vcpkg/commands.xvsinstances.h b/toolsrc/include/vcpkg/commands.xvsinstances.h deleted file mode 100644 index fc7a39b98bc5ba..00000000000000 --- a/toolsrc/include/vcpkg/commands.xvsinstances.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace vcpkg::Commands::X_VSInstances -{ - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct VSInstancesCommand : PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; -} diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 76ff89e7a4f077..a9021355f570d6 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -161,12 +161,6 @@ namespace vcpkg::Dependencies const StatusParagraphs& status_db, const CreateInstallPlanOptions& options = {}); - // `features` should have "default" instead of missing "core". This is only exposed for testing purposes. - std::vector resolve_deps_as_top_level(const SourceControlFile& scf, - Triplet triplet, - std::vector features, - CMakeVars::CMakeVarProvider& var_provider); - void print_plan(const ActionPlan& action_plan, const bool is_recursive = true, const fs::path& default_ports_dir = {}); diff --git a/toolsrc/include/vcpkg/export.h b/toolsrc/include/vcpkg/export.h index 0dd5b1aacdf930..3605081e3a8367 100644 --- a/toolsrc/include/vcpkg/export.h +++ b/toolsrc/include/vcpkg/export.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace vcpkg::Export { @@ -9,11 +9,4 @@ namespace vcpkg::Export void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths); - - struct ExportCommand : Commands::TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; } diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h index 3e1ef381e41317..97bc1186409833 100644 --- a/toolsrc/include/vcpkg/help.h +++ b/toolsrc/include/vcpkg/help.h @@ -1,6 +1,7 @@ #pragma once -#include +#include +#include #include @@ -11,9 +12,4 @@ namespace vcpkg::Help void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); void help_topic_valid_triplet(const VcpkgPaths& paths); - - struct HelpCommand : Commands::PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; } diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index f85d48d8d14513..2c674e7de6727a 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -2,7 +2,6 @@ #include -#include #include #include #include @@ -91,24 +90,7 @@ namespace vcpkg::Install const Build::IBuildLogsRecorder& build_logs_recorder, const CMakeVars::CMakeVarProvider& var_provider); - struct CMakeUsageInfo - { - std::string message; - bool usage_file = false; - Optional header_only; - std::map> cmake_targets_map; - }; - - CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths); - extern const CommandStructure COMMAND_STRUCTURE; void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - - struct InstallCommand : Commands::TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; } diff --git a/toolsrc/include/vcpkg/packagespec.h b/toolsrc/include/vcpkg/packagespec.h index a362d80680eb38..495056884b0b08 100644 --- a/toolsrc/include/vcpkg/packagespec.h +++ b/toolsrc/include/vcpkg/packagespec.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include @@ -48,9 +47,6 @@ namespace vcpkg Triplet m_triplet; }; - bool operator==(const PackageSpec& left, const PackageSpec& right); - inline bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } - /// /// /// Full specification of a feature. Contains all information to reference @@ -112,12 +108,6 @@ namespace vcpkg const std::vector& all_features) const; static ExpectedS from_string(const std::string& spec_as_string, Triplet default_triplet); - - bool operator==(const FullPackageSpec& o) const - { - return package_spec == o.package_spec && features == o.features; - } - bool operator!=(const FullPackageSpec& o) const { return !(*this == o); } }; /// @@ -138,11 +128,6 @@ namespace vcpkg std::string name; std::vector features; PlatformExpression::Expr platform; - - Json::Object extra_info; - - friend bool operator==(const Dependency& lhs, const Dependency& rhs); - friend bool operator!=(const Dependency& lhs, const Dependency& rhs) { return !(lhs == rhs); } }; struct ParsedQualifiedSpecifier @@ -157,6 +142,9 @@ namespace vcpkg Optional parse_package_name(Parse::ParserBase& parser); ExpectedS parse_qualified_specifier(StringView input); Optional parse_qualified_specifier(Parse::ParserBase& parser); + + bool operator==(const PackageSpec& left, const PackageSpec& right); + bool operator!=(const PackageSpec& left, const PackageSpec& right); } namespace std diff --git a/toolsrc/include/vcpkg/paragraphparseresult.h b/toolsrc/include/vcpkg/paragraphparseresult.h new file mode 100644 index 00000000000000..558715bbcc8233 --- /dev/null +++ b/toolsrc/include/vcpkg/paragraphparseresult.h @@ -0,0 +1,36 @@ +#pragma once + +#include + +namespace vcpkg +{ + enum class ParagraphParseResult + { + SUCCESS = 0, + EXPECTED_ONE_PARAGRAPH + }; + + struct ParagraphParseResultCategoryImpl final : std::error_category + { + virtual const char* name() const noexcept override; + + virtual std::string message(int ev) const noexcept override; + }; + + const std::error_category& paragraph_parse_result_category(); + + std::error_code make_error_code(ParagraphParseResult e); + + ParagraphParseResult to_paragraph_parse_result(int i); + + ParagraphParseResult to_paragraph_parse_result(std::error_code ec); +} + +namespace std +{ + // Enable implicit conversion to std::error_code + template<> + struct is_error_code_enum : ::std::true_type + { + }; +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg/platform-expression.h b/toolsrc/include/vcpkg/platform-expression.h index 43ae6e89de5c85..fd2bb85898d5ee 100644 --- a/toolsrc/include/vcpkg/platform-expression.h +++ b/toolsrc/include/vcpkg/platform-expression.h @@ -38,31 +38,6 @@ namespace vcpkg::PlatformExpression bool evaluate(const Context& context) const; bool is_empty() const { return !static_cast(underlying_); } - // returns: - // - 0 for empty - // - 1 for identifiers - // - 1 + complexity(inner) for ! - // - 1 + sum(complexity(inner)) for & and | - int complexity() const; - - // these two are friends so that they're only findable via ADL - - // this does a structural equality, so, for example: - // !structurally_equal((x & y) & z, x & y & z) - // !structurally_equal((x & y) | z, (x | z) & (y | z)) - // even though these expressions are equivalent - friend bool structurally_equal(const Expr& lhs, const Expr& rhs); - - // returns 0 if and only if structurally_equal(lhs, rhs) - // Orders via the following: - // - If complexity(a) < complexity(b) => a < b - // - Otherwise, if to_string(a).size() < to_string(b).size() => a < b - // - Otherwise, if to_string(a) < to_string(b) => a < b - // - else, they must be structurally equal - friend int compare(const Expr& lhs, const Expr& rhs); - - friend std::string to_string(const Expr& expr); - private: std::unique_ptr underlying_; }; diff --git a/toolsrc/include/vcpkg/remove.h b/toolsrc/include/vcpkg/remove.h index f68e8bd9f980b3..c43bc73c20cdaa 100644 --- a/toolsrc/include/vcpkg/remove.h +++ b/toolsrc/include/vcpkg/remove.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include namespace vcpkg::Remove { @@ -22,11 +23,4 @@ namespace vcpkg::Remove void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); - - struct RemoveCommand : Commands::TripletCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const override; - }; } diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index ac3699ca983d63..b2743645c856a4 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -40,11 +40,6 @@ namespace vcpkg std::string name; std::vector description; std::vector dependencies; - - Json::Object extra_info; - - friend bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs); - friend bool operator!=(const FeatureParagraph& lhs, const FeatureParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -65,11 +60,6 @@ namespace vcpkg Type type; PlatformExpression::Expr supports_expression; - - Json::Object extra_info; - - friend bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs); - friend bool operator!=(const SourceParagraph& lhs, const SourceParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -83,7 +73,7 @@ namespace vcpkg { for (const auto& feat_ptr : scf.feature_paragraphs) { - feature_paragraphs.push_back(std::make_unique(*feat_ptr)); + feature_paragraphs.emplace_back(std::make_unique(*feat_ptr)); } } @@ -99,14 +89,8 @@ namespace vcpkg Optional find_feature(const std::string& featurename) const; Optional&> find_dependencies_for_feature(const std::string& featurename) const; - - friend bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs); - friend bool operator!=(const SourceControlFile& lhs, const SourceControlFile& rhs) { return !(lhs == rhs); } }; - Json::Object serialize_manifest(const SourceControlFile& scf); - Json::Object serialize_debug_manifest(const SourceControlFile& scf); - /// /// Full metadata of a package: core and other features. As well as the location the SourceControlFile was /// loaded from. diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index cf4c3c0466758a..dde4ecb19866cc 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -61,6 +61,4 @@ namespace vcpkg const StatusParagraph* core; std::vector features; }; - - Json::Value serialize_ipv(const InstalledPackageView& ipv, const struct VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h index d5c0a5c23db572..b57ca2918919b9 100644 --- a/toolsrc/include/vcpkg/tools.h +++ b/toolsrc/include/vcpkg/tools.h @@ -9,21 +9,6 @@ namespace vcpkg { struct VcpkgPaths; - namespace Tools - { - static const std::string SEVEN_ZIP = "7zip"; - static const std::string SEVEN_ZIP_ALT = "7z"; - static const std::string MAVEN = "mvn"; - static const std::string CMAKE = "cmake"; - static const std::string GIT = "git"; - static const std::string MONO = "mono"; - static const std::string NINJA = "ninja"; - static const std::string NUGET = "nuget"; - static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; - static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; - static const std::string IFW_REPOGEN = "ifw_repogen"; - } - struct ToolCache { virtual ~ToolCache() { } diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index 42d99dc3e12f1c..736b22a2d11b14 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -3,12 +3,13 @@ #include #include +#include + #include namespace vcpkg { struct TripletInstance; - struct VcpkgCmdArguments; struct Triplet { @@ -17,6 +18,20 @@ namespace vcpkg static Triplet from_canonical_name(std::string&& triplet_as_string); + static const Triplet X86_WINDOWS; + static const Triplet X64_WINDOWS; + static const Triplet ARM_WINDOWS; + static const Triplet ARM64_WINDOWS; + static const Triplet X86_UWP; + static const Triplet X64_UWP; + static const Triplet ARM_UWP; + static const Triplet ARM64_UWP; + + static const Triplet ARM_ANDROID; + static const Triplet ARM64_ANDROID; + static const Triplet X86_ANDROID; + static const Triplet X64_ANDROID; + const std::string& canonical_name() const; const std::string& to_string() const; void to_string(std::string& out) const; diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h index 2c05e489ea3e69..6091da7783792f 100644 --- a/toolsrc/include/vcpkg/update.h +++ b/toolsrc/include/vcpkg/update.h @@ -1,9 +1,10 @@ #pragma once -#include #include #include #include +#include +#include #include namespace vcpkg::Update @@ -20,9 +21,4 @@ namespace vcpkg::Update const StatusParagraphs& status_db); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - struct UpdateCommand : Commands::PathsCommand - { - virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; - }; } diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index 84cd7c59925f07..ddc407a35a4aff 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -130,7 +130,6 @@ namespace vcpkg constexpr static StringLiteral TRIPLET_ENV = "VCPKG_DEFAULT_TRIPLET"; constexpr static StringLiteral TRIPLET_ARG = "triplet"; std::unique_ptr triplet; - constexpr static StringLiteral OVERLAY_PORTS_ENV = "VCPKG_OVERLAY_PORTS"; constexpr static StringLiteral OVERLAY_PORTS_ARG = "overlay-ports"; std::vector overlay_ports; constexpr static StringLiteral OVERLAY_TRIPLETS_ARG = "overlay-triplets"; @@ -153,9 +152,6 @@ namespace vcpkg constexpr static StringLiteral WAIT_FOR_LOCK_SWITCH = "x-wait-for-lock"; Optional wait_for_lock = nullopt; - constexpr static StringLiteral JSON_SWITCH = "x-json"; - Optional json = nullopt; - // feature flags constexpr static StringLiteral FEATURE_FLAGS_ENV = "VCPKG_FEATURE_FLAGS"; constexpr static StringLiteral FEATURE_FLAGS_ARG = "feature-flags"; @@ -172,7 +168,6 @@ namespace vcpkg bool binary_caching_enabled() const { return binary_caching.value_or(true); } bool compiler_tracking_enabled() const { return compiler_tracking.value_or(true); } - bool output_json() const { return json.value_or(false); } std::string command; std::vector command_arguments; diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 721b59606943f2..594407c4b32194 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -4,11 +4,30 @@ #include #include #include -#include #include +#include +#include +#include +#include + namespace vcpkg { + namespace Tools + { + static const std::string SEVEN_ZIP = "7zip"; + static const std::string SEVEN_ZIP_ALT = "7z"; + static const std::string MAVEN = "mvn"; + static const std::string CMAKE = "cmake"; + static const std::string GIT = "git"; + static const std::string MONO = "mono"; + static const std::string NINJA = "ninja"; + static const std::string NUGET = "nuget"; + static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; + static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; + static const std::string IFW_REPOGEN = "ifw_repogen"; + } + struct ToolsetArchOption { CStringView name; @@ -42,11 +61,6 @@ namespace vcpkg struct VcpkgPathsImpl; } - struct BinaryParagraph; - struct VcpkgCmdArguments; - struct PackageSpec; - struct Triplet; - struct VcpkgPaths : Util::MoveOnlyBase { struct TripletFile diff --git a/toolsrc/src/pch.cpp b/toolsrc/src/pch.cpp index ebc3d89049e924..17305716aacd2a 100644 --- a/toolsrc/src/pch.cpp +++ b/toolsrc/src/pch.cpp @@ -1,2 +1 @@ -// This file intentionally left blank. It exists to be a target for pch compilation, -// but `#include "pch.h"` is already injected by the compiler. \ No newline at end of file +#include "pch.h" \ No newline at end of file diff --git a/toolsrc/src/vcpkg-test/binarycaching.cpp b/toolsrc/src/vcpkg-test/binarycaching.cpp index 55532d14df3409..a8204f9c2add0e 100644 --- a/toolsrc/src/vcpkg-test/binarycaching.cpp +++ b/toolsrc/src/vcpkg-test/binarycaching.cpp @@ -11,8 +11,6 @@ #include -#include - using namespace vcpkg; TEST_CASE ("reformat_version semver-ish", "[reformat_version]") @@ -67,7 +65,7 @@ Build-Depends: bzip REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; - Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Test::X64_WINDOWS}, + Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Triplet::X64_WINDOWS}, scfl, Dependencies::RequestType::USER_REQUESTED, {{"a", {}}, {"b", {}}}); @@ -179,7 +177,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[0].spec = PackageSpec("zlib", Test::X64_ANDROID); + plan.install_actions[0].spec = PackageSpec("zlib", Triplet::X64_ANDROID); plan.install_actions[0].source_control_file_location = scfl; plan.install_actions[0].abi_info = Build::AbiInfo{}; plan.install_actions[0].abi_info.get()->package_abi = "packageabi"; @@ -202,7 +200,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf2.has_value()); SourceControlFileLocation scfl2{std::move(*maybe_scf2.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[1].spec = PackageSpec("zlib2", Test::X64_ANDROID); + plan.install_actions[1].spec = PackageSpec("zlib2", Triplet::X64_ANDROID); plan.install_actions[1].source_control_file_location = scfl2; plan.install_actions[1].abi_info = Build::AbiInfo{}; plan.install_actions[1].abi_info.get()->package_abi = "packageabi2"; diff --git a/toolsrc/src/vcpkg-test/commands.cpp b/toolsrc/src/vcpkg-test/commands.cpp deleted file mode 100644 index 2c37798770c3c2..00000000000000 --- a/toolsrc/src/vcpkg-test/commands.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include - -#include -#include -#include - -using namespace vcpkg; - -TEST_CASE ("test commands are constructible", "[commands]") -{ - Commands::Contact::ContactCommand contact{}; - Commands::Version::VersionCommand version{}; -} - -TEST_CASE ("get_available_basic_commands works", "[commands]") -{ - auto commands_list = Commands::get_available_basic_commands(); - CHECK(commands_list.size() == 2); - CHECK(Commands::find("version", commands_list) != nullptr); - CHECK(Commands::find("contact", commands_list) != nullptr); - CHECK(Commands::find("aang", commands_list) == nullptr); -} - -TEST_CASE ("get_available_paths_commands works", "[commands]") -{ - auto commands_list = Commands::get_available_paths_commands(); - CHECK(commands_list.size() == 19); - - CHECK(Commands::find("/?", commands_list) != nullptr); - CHECK(Commands::find("help", commands_list) != nullptr); - CHECK(Commands::find("search", commands_list) != nullptr); - CHECK(Commands::find("list", commands_list) != nullptr); - CHECK(Commands::find("integrate", commands_list) != nullptr); - CHECK(Commands::find("owns", commands_list) != nullptr); - CHECK(Commands::find("update", commands_list) != nullptr); - CHECK(Commands::find("edit", commands_list) != nullptr); - CHECK(Commands::find("create", commands_list) != nullptr); - CHECK(Commands::find("cache", commands_list) != nullptr); - CHECK(Commands::find("portsdiff", commands_list) != nullptr); - CHECK(Commands::find("autocomplete", commands_list) != nullptr); - CHECK(Commands::find("hash", commands_list) != nullptr); - CHECK(Commands::find("fetch", commands_list) != nullptr); - CHECK(Commands::find("x-ci-clean", commands_list) != nullptr); - CHECK(Commands::find("x-history", commands_list) != nullptr); - CHECK(Commands::find("x-package-info", commands_list) != nullptr); - CHECK(Commands::find("x-vsinstances", commands_list) != nullptr); - CHECK(Commands::find("x-format-manifest", commands_list) != nullptr); - - CHECK(Commands::find("korra", commands_list) == nullptr); -} - -TEST_CASE ("get_available_commands_type_a works", "[commands]") -{ - auto commands_list = Commands::get_available_triplet_commands(); - CHECK(commands_list.size() == 10); - - CHECK(Commands::find("install", commands_list) != nullptr); - CHECK(Commands::find("x-set-installed", commands_list) != nullptr); - CHECK(Commands::find("ci", commands_list) != nullptr); - CHECK(Commands::find("remove", commands_list) != nullptr); - CHECK(Commands::find("upgrade", commands_list) != nullptr); - CHECK(Commands::find("build", commands_list) != nullptr); - CHECK(Commands::find("env", commands_list) != nullptr); - CHECK(Commands::find("build-external", commands_list) != nullptr); - CHECK(Commands::find("export", commands_list) != nullptr); - CHECK(Commands::find("depend-info", commands_list) != nullptr); - - CHECK(Commands::find("mai", commands_list) == nullptr); -} diff --git a/toolsrc/src/vcpkg-test/commands.create.cpp b/toolsrc/src/vcpkg-test/commands.create.cpp index 0cc93bd57652fb..4d8b2fd5098f0a 100644 --- a/toolsrc/src/vcpkg-test/commands.create.cpp +++ b/toolsrc/src/vcpkg-test/commands.create.cpp @@ -2,7 +2,7 @@ #include -#include +#include #include #include diff --git a/toolsrc/src/vcpkg-test/dependencies.cpp b/toolsrc/src/vcpkg-test/dependencies.cpp index ef39bd1efb63fb..6bd9dfc42b4c4f 100644 --- a/toolsrc/src/vcpkg-test/dependencies.cpp +++ b/toolsrc/src/vcpkg-test/dependencies.cpp @@ -33,12 +33,12 @@ TEST_CASE ("filter depends", "[dependencies]") auto deps_ = parse_dependencies_list("liba (!uwp), libb, libc (uwp)"); REQUIRE(deps_); auto& deps = *deps_.get(); - auto v = filter_dependencies(deps, Test::X64_WINDOWS, x64_win_cmake_vars); + auto v = filter_dependencies(deps, Triplet::X64_WINDOWS, x64_win_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v.at(0).package_spec.name() == "liba"); REQUIRE(v.at(1).package_spec.name() == "libb"); - auto v2 = filter_dependencies(deps, Test::ARM_UWP, arm_uwp_cmake_vars); + auto v2 = filter_dependencies(deps, Triplet::ARM_UWP, arm_uwp_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v2.at(0).package_spec.name() == "libb"); REQUIRE(v2.at(1).package_spec.name() == "libc"); @@ -85,67 +85,3 @@ TEST_CASE ("qualified dependency", "[dependencies]") REQUIRE(plan2.install_actions.size() == 2); REQUIRE(plan2.install_actions.at(0).feature_list == std::vector{"b1", "core"}); } - -TEST_CASE ("resolve_deps_as_top_level", "[dependencies]") -{ - using namespace Test; - PackageSpecMap spec_map; - FullPackageSpec spec_a{spec_map.emplace("a", "b, b[b1] (linux)"), {}}; - FullPackageSpec spec_b{spec_map.emplace("b", "", {{"b1", ""}}), {}}; - FullPackageSpec spec_c{spec_map.emplace("c", "b", {{"c1", "b[b1]"}, {"c2", "c[c1], a"}}, {"c1"}), {"core"}}; - FullPackageSpec spec_d{spec_map.emplace("d", "c[core]"), {}}; - - PortFileProvider::MapPortFileProvider map_port{spec_map.map}; - MockCMakeVarProvider var_provider; - Triplet t_linux = Triplet::from_canonical_name("x64-linux"); - var_provider.dep_info_vars[{"a", t_linux}].emplace("VCPKG_CMAKE_SYSTEM_NAME", "Linux"); - { - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("a").source_control_file, Test::X86_WINDOWS, {}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == spec_b); - } - { - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("a").source_control_file, t_linux, {}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == FullPackageSpec({"b", t_linux}, {"b1"})); - } - { - // without defaults - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == spec_b); - } - FullPackageSpec spec_b_with_b1{spec_b.package_spec, {"b1"}}; - { - // with defaults of c (c1) - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"default"}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == spec_b_with_b1); - } - { - // with c1 - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c1"}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == spec_b_with_b1); - } - { - // with c2 implying c1 - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c2"}, var_provider); - REQUIRE(deps.size() == 2); - REQUIRE(deps.at(0) == spec_a); - REQUIRE(deps.at(1) == spec_b_with_b1); - } - { - // d -> c[core] - auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( - *spec_map.map.at("d").source_control_file, Test::X86_WINDOWS, {}, var_provider); - REQUIRE(deps.size() == 1); - REQUIRE(deps.at(0) == spec_c); - } -} diff --git a/toolsrc/src/vcpkg-test/json.cpp b/toolsrc/src/vcpkg-test/json.cpp index 0b9941861e4221..90a3537aba4636 100644 --- a/toolsrc/src/vcpkg-test/json.cpp +++ b/toolsrc/src/vcpkg-test/json.cpp @@ -80,49 +80,6 @@ TEST_CASE ("JSON parse strings", "[json]") REQUIRE(res.get()->first.string() == grin); } -TEST_CASE ("JSON parse strings with escapes", "[json]") -{ - auto res = Json::parse(R"("\t")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\t"); - - res = Json::parse(R"("\\")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\\"); - - res = Json::parse(R"("\/")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "/"); - - res = Json::parse(R"("\b")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\b"); - - res = Json::parse(R"("\f")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\f"); - - res = Json::parse(R"("\n")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\n"); - - res = Json::parse(R"("\r")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == "\r"); - - res = Json::parse(R"("This is a \"test\", hopefully it worked")"); - REQUIRE(res); - REQUIRE(res.get()->first.is_string()); - REQUIRE(res.get()->first.string() == R"(This is a "test", hopefully it worked)"); -} - TEST_CASE ("JSON parse integers", "[json]") { auto res = Json::parse("0"); diff --git a/toolsrc/src/vcpkg-test/manifests.cpp b/toolsrc/src/vcpkg-test/manifests.cpp index 95a0b149b16663..108b2d0c5aad65 100644 --- a/toolsrc/src/vcpkg-test/manifests.cpp +++ b/toolsrc/src/vcpkg-test/manifests.cpp @@ -5,14 +5,9 @@ #include #include -#include #include -#if defined(_MSC_VER) -#pragma warning(disable : 6237) -#endif - using namespace vcpkg; using namespace vcpkg::Paragraphs; using namespace vcpkg::Test; @@ -73,10 +68,10 @@ TEST_CASE ("manifest construct maximum", "[manifests]") "name": "iroh", "description": "zuko's uncle", "dependencies": [ - "firebending", { "name": "tea" }, + "firebending", { "name": "order.white-lotus", "features": [ "the-ancient-ways" ], @@ -110,20 +105,18 @@ TEST_CASE ("manifest construct maximum", "[manifests]") REQUIRE(pgh.feature_paragraphs[0]->description.size() == 1); REQUIRE(pgh.feature_paragraphs[0]->description[0] == "zuko's uncle"); REQUIRE(pgh.feature_paragraphs[0]->dependencies.size() == 3); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "firebending"); - - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "order.white-lotus"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features.size() == 1); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features[0] == "the-ancient-ways"); - REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "tea"); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "firebending"); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "order.white-lotus"); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features.size() == 1); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features[0] == "the-ancient-ways"); + REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "arm"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", "Linux"}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "tea"); - REQUIRE(pgh.feature_paragraphs[1]->name == "zuko"); REQUIRE(pgh.feature_paragraphs[1]->description.size() == 2); REQUIRE(pgh.feature_paragraphs[1]->description[0] == "son of the fire lord"); @@ -141,8 +134,8 @@ TEST_CASE ("SourceParagraph manifest two dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); } TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") @@ -156,10 +149,9 @@ TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - // should be ordered - REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); } TEST_CASE ("SourceParagraph manifest construct qualified dependencies", "[manifests]") @@ -247,50 +239,3 @@ TEST_CASE ("SourceParagraph manifest empty supports", "[manifests]") true); REQUIRE_FALSE(m_pgh.has_value()); } - -TEST_CASE ("Serialize all the ports", "[manifests]") -{ - std::vector args_list = {"x-format-manifest"}; - auto& fs = Files::get_real_filesystem(); - auto args = VcpkgCmdArguments::create_from_arg_sequence(args_list.data(), args_list.data() + args_list.size()); - VcpkgPaths paths{fs, args}; - - std::vector scfs; - - for (auto dir : fs::directory_iterator(paths.ports)) - { - const auto control = dir / fs::u8path("CONTROL"); - const auto manifest = dir / fs::u8path("vcpkg.json"); - if (fs.exists(control)) - { - auto contents = fs.read_contents(control, VCPKG_LINE_INFO); - auto pghs = Paragraphs::parse_paragraphs(contents, control.u8string()); - REQUIRE(pghs); - - scfs.push_back(std::move( - *SourceControlFile::parse_control_file(control, std::move(pghs).value_or_exit(VCPKG_LINE_INFO)) - .value_or_exit(VCPKG_LINE_INFO))); - } - else if (fs.exists(manifest)) - { - std::error_code ec; - auto contents = Json::parse_file(fs, manifest, ec); - REQUIRE_FALSE(ec); - REQUIRE(contents); - - auto scf = SourceControlFile::parse_manifest_file(manifest, - contents.value_or_exit(VCPKG_LINE_INFO).first.object()); - REQUIRE(scf); - - scfs.push_back(std::move(*scf.value_or_exit(VCPKG_LINE_INFO))); - } - } - - for (auto& scf : scfs) - { - auto serialized = serialize_manifest(scf); - auto serialized_scf = SourceControlFile::parse_manifest_file({}, serialized).value_or_exit(VCPKG_LINE_INFO); - - REQUIRE(*serialized_scf == scf); - } -} diff --git a/toolsrc/src/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index 05ba8cfba3d803..2638a3900df61f 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -87,9 +87,8 @@ TEST_CASE ("SourceParagraph two dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - // should be ordered - REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); } TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") @@ -103,10 +102,9 @@ TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - // should be ordered - REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); } TEST_CASE ("SourceParagraph construct qualified dependencies", "[paragraph]") diff --git a/toolsrc/src/vcpkg-test/plan.cpp b/toolsrc/src/vcpkg-test/plan.cpp index 55c6740da40acf..09c377ecc1da57 100644 --- a/toolsrc/src/vcpkg-test/plan.cpp +++ b/toolsrc/src/vcpkg-test/plan.cpp @@ -28,7 +28,7 @@ using Test::PackageSpecMap; static void features_check(Dependencies::InstallPlanAction& plan, std::string pkg_name, std::vector expected_features, - Triplet triplet = Test::X86_WINDOWS) + Triplet triplet = Triplet::X86_WINDOWS) { const auto& feature_list = plan.feature_list; @@ -54,7 +54,7 @@ static void features_check(Dependencies::InstallPlanAction& plan, /// static void remove_plan_check(Dependencies::RemovePlanAction& plan, std::string pkg_name, - Triplet triplet = Test::X86_WINDOWS) + Triplet triplet = Triplet::X86_WINDOWS) { REQUIRE(plan.spec.triplet().to_string() == triplet.to_string()); REQUIRE(pkg_name == plan.spec.name()); @@ -381,14 +381,14 @@ TEST_CASE ("basic feature test 8", "[plan]") std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; - spec_map.triplet = Test::X86_WINDOWS; + spec_map.triplet = Triplet::X86_WINDOWS; auto spec_a_86 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_86 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_86 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; @@ -401,14 +401,14 @@ TEST_CASE ("basic feature test 8", "[plan]") {spec_c_64, spec_a_86, spec_a_64, spec_c_86}, StatusParagraphs(std::move(status_paragraphs))); - remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); remove_plan_check(plan.remove_actions.at(1), "a"); auto& install_plan = plan.install_actions; - features_check(install_plan.at(0), "b", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.at(1), "a", {"a1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.at(0), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.at(1), "a", {"a1", "core"}, Triplet::X64_WINDOWS); features_check(install_plan.at(2), "b", {"core"}); features_check(install_plan.at(3), "a", {"a1", "core"}); - features_check(install_plan.at(4), "c", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.at(4), "c", {"core"}, Triplet::X64_WINDOWS); features_check(install_plan.at(5), "c", {"core"}); } @@ -416,10 +416,10 @@ TEST_CASE ("install all features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -432,7 +432,7 @@ TEST_CASE ("install all features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features test 1", "[plan]") @@ -440,11 +440,11 @@ TEST_CASE ("install default features test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" with default features "1" and features "0" and "1". - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -456,23 +456,23 @@ TEST_CASE ("install default features test 1", "[plan]") // Expect the default feature "1" to be installed, but not "0" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features test 2", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); // Add a port "a" of which "core" is already installed, but we will // install the default features "explicitly" // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -485,8 +485,8 @@ TEST_CASE ("install default features test 2", "[plan]") // Expect "a" to get removed for rebuild and then installed with default // features. REQUIRE(install_plan.size() == 2); - remove_plan_check(install_plan.remove_actions.at(0), "a", Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Test::X64_WINDOWS); + remove_plan_check(install_plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features test 3", "[plan]") @@ -494,11 +494,11 @@ TEST_CASE ("install default features test 3", "[plan]") std::vector> status_paragraphs; // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Explicitly install "a" without default features - auto install_specs = FullPackageSpec::from_string("a[core]", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[core]", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -510,7 +510,7 @@ TEST_CASE ("install default features test 3", "[plan]") // Expect the default feature not to get installed. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 1", "[plan]") @@ -518,13 +518,13 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -536,8 +536,8 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("do not install default features of dependency test 1", "[plan]") @@ -545,14 +545,14 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -565,8 +565,8 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 2", "[plan]") @@ -574,14 +574,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -593,14 +593,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("do not install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); @@ -608,10 +608,10 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -622,13 +622,13 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") // Expect "a" to get installed, but not require rebuilding "b" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has a default feature spec_map.emplace("b", "", {{"b1", ""}}, {"b1"}); @@ -636,10 +636,10 @@ TEST_CASE ("install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b", "", "b1")); - status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -650,24 +650,24 @@ TEST_CASE ("install default features of existing dependency", "[plan]") // Expect "b" to be rebuilt REQUIRE(install_plan.install_actions.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 3", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -679,7 +679,7 @@ TEST_CASE ("install default features of dependency test 3", "[plan]") // Expect "a" to get installed, not the defaults of "b", as the required // dependencies are already there, installed explicitly by the user. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("install plan action dependencies", "[plan]") @@ -688,13 +688,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -704,13 +704,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); // TODO: Figure out what to do with these tests - features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b}); } @@ -720,13 +720,13 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "c, b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -736,12 +736,12 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b, // spec_c}); } @@ -752,11 +752,11 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", "a[0]"}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -766,7 +766,7 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Triplet::X64_WINDOWS); // REQUIRE(install_plan.at(0).install_action.get()->computed_dependencies == std::vector{}); } @@ -827,7 +827,7 @@ TEST_CASE ("upgrade with default features 2", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); auto spec_b = spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0", "b1"}); @@ -837,10 +837,10 @@ TEST_CASE ("upgrade with default features 2", "[plan]") // The upgrade should install the new default feature b1 but not b0 REQUIRE(plan.size() == 4); - remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); - remove_plan_check(plan.remove_actions.at(1), "b", Test::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(1), "b", Triplet::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("upgrade with default features 3", "[plan]") @@ -852,7 +852,7 @@ TEST_CASE ("upgrade with default features 3", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0"}); @@ -862,9 +862,9 @@ TEST_CASE ("upgrade with default features 3", "[plan]") // The upgrade should install the default feature REQUIRE(plan.size() == 3); - remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Test::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Triplet::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); } TEST_CASE ("upgrade with new default feature", "[plan]") @@ -883,20 +883,20 @@ TEST_CASE ("upgrade with new default feature", "[plan]") // The upgrade should install the new default feature but not the old default feature 0 REQUIRE(plan.size() == 2); - remove_plan_check(plan.remove_actions.at(0), "a", Test::X86_WINDOWS); - features_check(plan.install_actions.at(0), "a", {"core", "1"}, Test::X86_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X86_WINDOWS); + features_check(plan.install_actions.at(0), "a", {"core", "1"}, Triplet::X86_WINDOWS); } TEST_CASE ("transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -908,21 +908,21 @@ TEST_CASE ("transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("no transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", ""}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -933,21 +933,21 @@ TEST_CASE ("no transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("only transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Test::X64_WINDOWS); + PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -958,9 +958,9 @@ TEST_CASE ("only transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); } TEST_CASE ("basic remove scheme", "[plan]") @@ -969,7 +969,7 @@ TEST_CASE ("basic remove scheme", "[plan]") pghs.push_back(make_status_pgh("a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 1); REQUIRE(remove_plan.at(0).spec.name() == "a"); @@ -982,7 +982,7 @@ TEST_CASE ("recurse remove scheme", "[plan]") pghs.push_back(make_status_pgh("b", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -997,7 +997,7 @@ TEST_CASE ("features depend remove scheme", "[plan]") pghs.push_back(make_status_feature_pgh("b", "0", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -1013,7 +1013,7 @@ TEST_CASE ("features depend remove scheme once removed", "[plan]") pghs.push_back(make_status_feature_pgh("opencv", "vtk", "vtk")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"expat", Test::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"expat", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 3); REQUIRE(remove_plan.at(0).spec.name() == "opencv"); diff --git a/toolsrc/src/vcpkg-test/specifier.cpp b/toolsrc/src/vcpkg-test/specifier.cpp index f750f4144f28f3..f350ff60132b41 100644 --- a/toolsrc/src/vcpkg-test/specifier.cpp +++ b/toolsrc/src/vcpkg-test/specifier.cpp @@ -5,8 +5,6 @@ #include -#include - using namespace vcpkg; TEST_CASE ("specifier conversion", "[specifier]") @@ -15,8 +13,8 @@ TEST_CASE ("specifier conversion", "[specifier]") { constexpr std::size_t SPEC_SIZE = 6; - PackageSpec a_spec("a", Test::X64_WINDOWS); - PackageSpec b_spec("b", Test::X64_WINDOWS); + PackageSpec a_spec("a", Triplet::X64_WINDOWS); + PackageSpec b_spec("b", Triplet::X64_WINDOWS); auto fspecs = FullPackageSpec{a_spec, {"0", "1"}}.to_feature_specs({}, {}); auto fspecs2 = FullPackageSpec{b_spec, {"2", "3"}}.to_feature_specs({}, {}); @@ -96,18 +94,19 @@ TEST_CASE ("specifier parsing", "[specifier]") SECTION ("expand wildcards") { - auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); - auto openssl = vcpkg::FullPackageSpec::from_string("openssl[*]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto openssl = + vcpkg::FullPackageSpec::from_string("openssl[*]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); auto specs = zlib.to_feature_specs({}, {}); auto specs2 = openssl.to_feature_specs({}, {}); Util::Vectors::append(&specs, specs2); Util::sort(specs); std::vector spectargets{ - {{"openssl", Test::X86_UWP}, "core"}, - {{"zlib", Test::X86_UWP}, "core"}, - {{"zlib", Test::X86_UWP}, "0"}, - {{"zlib", Test::X86_UWP}, "1"}, + {{"openssl", Triplet::X86_UWP}, "core"}, + {{"zlib", Triplet::X86_UWP}, "core"}, + {{"zlib", Triplet::X86_UWP}, "0"}, + {{"zlib", Triplet::X86_UWP}, "1"}, }; Util::sort(spectargets); REQUIRE(specs.size() == spectargets.size()); diff --git a/toolsrc/src/vcpkg-test/statusparagraphs.cpp b/toolsrc/src/vcpkg-test/statusparagraphs.cpp index f647484e603062..382eab1a72fcdd 100644 --- a/toolsrc/src/vcpkg-test/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg-test/statusparagraphs.cpp @@ -28,7 +28,7 @@ Status: install ok installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); REQUIRE(it != status_db.end()); } @@ -49,7 +49,7 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); REQUIRE(it == status_db.end()); } @@ -78,11 +78,11 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); REQUIRE(it != status_db.end()); // Feature "openssl" is not installed and should not be found - auto it1 = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); + auto it1 = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); REQUIRE(it1 == status_db.end()); } @@ -111,6 +111,6 @@ Status: install ok installed Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); // Feature "openssl" is installed and should therefore be found - auto it = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); + auto it = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); REQUIRE(it != status_db.end()); } diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index cc45365e691a73..95a6de2af9d086 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -8,10 +8,6 @@ #include #include -#if defined(_MSC_VER) -#pragma warning(disable : 6237) -#endif - TEST_CASE ("b32 encoding", "[strings]") { using u64 = uint64_t; diff --git a/toolsrc/src/vcpkg-test/system.cpp b/toolsrc/src/vcpkg-test/system.cpp index dec7b576917d9c..01540635816275 100644 --- a/toolsrc/src/vcpkg-test/system.cpp +++ b/toolsrc/src/vcpkg-test/system.cpp @@ -11,10 +11,6 @@ #include -#if defined(_MSC_VER) -#pragma warning(disable : 6237) -#endif - using vcpkg::nullopt; using vcpkg::Optional; using vcpkg::StringView; diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index 2841aefa035571..74ade3aeb89220 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -39,12 +39,6 @@ namespace vcpkg::Test { - const Triplet X86_WINDOWS = Triplet::from_canonical_name("x86-windows"); - const Triplet X64_WINDOWS = Triplet::from_canonical_name("x64-windows"); - const Triplet X86_UWP = Triplet::from_canonical_name("x86-uwp"); - const Triplet ARM_UWP = Triplet::from_canonical_name("arm-uwp"); - const Triplet X64_ANDROID = Triplet::from_canonical_name("x64-android"); - std::unique_ptr make_control_file( const char* name, const char* depends, diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index d0df8749fde733..40ccb1668470ee 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -8,9 +8,7 @@ #include #include -#include #include -#include #include #include #include @@ -68,18 +66,16 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } }; - if (const auto command_function = find_command(Commands::get_available_basic_commands())) + if (const auto command_function = find_command(Commands::get_available_commands_type_c())) { - return command_function->function->perform_and_exit(args, fs); + return command_function->function(args, fs); } const VcpkgPaths paths(fs, args); paths.track_feature_flag_metrics(); fs.current_path(paths.root, VCPKG_LINE_INFO); - if ((args.command == "install" || args.command == "remove" || args.command == "export" || - args.command == "update") && - !args.output_json()) + if (args.command == "install" || args.command == "remove" || args.command == "export" || args.command == "update") { Commands::Version::warn_if_vcpkg_version_mismatch(paths); std::string surveydate = *GlobalState::g_surveydate.lock(); @@ -106,17 +102,17 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } } - if (const auto command_function = find_command(Commands::get_available_paths_commands())) + if (const auto command_function = find_command(Commands::get_available_commands_type_b())) { - return command_function->function->perform_and_exit(args, paths); + return command_function->function(args, paths); } Triplet default_triplet = vcpkg::default_triplet(args); Input::check_triplet(default_triplet, paths); - if (const auto command_function = find_command(Commands::get_available_triplet_commands())) + if (const auto command_function = find_command(Commands::get_available_commands_type_a())) { - return command_function->function->perform_and_exit(args, paths, default_triplet); + return command_function->function(args, paths, default_triplet); } return invalid_command(args.command); diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index c90706928eeea6..ca82b3100f29ac 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -1,8 +1,9 @@ +#include "pch.h" + #include #include #include -#include namespace vcpkg::Archives { diff --git a/toolsrc/src/vcpkg/base/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index c0075e33f546a9..42e0835c6bcdeb 100644 --- a/toolsrc/src/vcpkg/base/checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/chrono.cpp b/toolsrc/src/vcpkg/base/chrono.cpp index 971d5f37e04a2d..86dc590f8ffad2 100644 --- a/toolsrc/src/vcpkg/base/chrono.cpp +++ b/toolsrc/src/vcpkg/base/chrono.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/base/cofffilereader.cpp b/toolsrc/src/vcpkg/base/cofffilereader.cpp index 30e0f8588a87fa..cb75e084750911 100644 --- a/toolsrc/src/vcpkg/base/cofffilereader.cpp +++ b/toolsrc/src/vcpkg/base/cofffilereader.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 59669749990115..051e8306fa0a8a 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/enums.cpp b/toolsrc/src/vcpkg/base/enums.cpp index 8b99ddf7bacb3f..aa124f3aa9b427 100644 --- a/toolsrc/src/vcpkg/base/enums.cpp +++ b/toolsrc/src/vcpkg/base/enums.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index e4c821eaeaa294..902b482d2acb32 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -139,12 +141,7 @@ namespace vcpkg::Files const auto target = read_symlink_implementation(oldpath, ec); if (ec) return; - const DWORD flags = -#if defined(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE) - SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; -#else - 0; -#endif + const DWORD flags = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; if (!CreateSymbolicLinkW(newpath.c_str(), target.c_str(), flags)) { const auto err = GetLastError(); @@ -1039,7 +1036,7 @@ namespace vcpkg::Files return res; } - Debug::print("Waiting to take filesystem lock on ", path.u8string(), "...\n"); + System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); auto wait = std::chrono::milliseconds(100); // waits, at most, a second and a half. while (wait < std::chrono::milliseconds(1000)) diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 0070a5f72647c3..58e17e1ad47803 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/json.cpp b/toolsrc/src/vcpkg/base/json.cpp index 0a9422d6664aeb..75b917523e57f3 100644 --- a/toolsrc/src/vcpkg/base/json.cpp +++ b/toolsrc/src/vcpkg/base/json.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -35,11 +37,8 @@ namespace vcpkg::Json ValueImpl(ValueKindConstant vk, int64_t i) : tag(vk), integer(i) { } ValueImpl(ValueKindConstant vk, double d) : tag(vk), number(d) { } ValueImpl(ValueKindConstant vk, std::string&& s) : tag(vk), string(std::move(s)) { } - ValueImpl(ValueKindConstant vk, const std::string& s) : tag(vk), string(s) { } ValueImpl(ValueKindConstant vk, Array&& arr) : tag(vk), array(std::move(arr)) { } - ValueImpl(ValueKindConstant vk, const Array& arr) : tag(vk), array(arr) { } ValueImpl(ValueKindConstant vk, Object&& obj) : tag(vk), object(std::move(obj)) { } - ValueImpl(ValueKindConstant vk, const Object& obj) : tag(vk), object(obj) { } ValueImpl& operator=(ValueImpl&& other) noexcept { @@ -141,30 +140,30 @@ namespace vcpkg::Json } StringView Value::string() const noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string(), "json value is not string"); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string()); return underlying_->string; } const Array& Value::array() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); return underlying_->array; } Array& Value::array() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); return underlying_->array; } Array&& Value::array() && noexcept { return std::move(this->array()); } const Object& Value::object() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); return underlying_->object; } Object& Value::object() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); return underlying_->object; } Object&& Value::object() && noexcept { return std::move(this->object()); } @@ -172,65 +171,23 @@ namespace vcpkg::Json Value::Value() noexcept = default; Value::Value(Value&&) noexcept = default; Value& Value::operator=(Value&&) noexcept = default; + Value::~Value() = default; - Value::Value(const Value& other) - { - switch (other.kind()) - { - case ValueKind::Null: return; // default construct underlying_ - case ValueKind::Boolean: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); - break; - case ValueKind::Integer: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); - break; - case ValueKind::Number: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); - break; - case ValueKind::String: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); - break; - case ValueKind::Array: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); - break; - case ValueKind::Object: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); - break; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - Value& Value::operator=(const Value& other) + Value Value::clone() const noexcept { - switch (other.kind()) + switch (kind()) { - case ValueKind::Null: underlying_.reset(); break; - case ValueKind::Boolean: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); - break; - case ValueKind::Integer: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); - break; - case ValueKind::Number: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); - break; - case ValueKind::String: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); - break; - case ValueKind::Array: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); - break; - case ValueKind::Object: - underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); - break; - default: Checks::unreachable(VCPKG_LINE_INFO); + case ValueKind::Null: return Value::null(nullptr); + case ValueKind::Boolean: return Value::boolean(boolean()); + case ValueKind::Integer: return Value::integer(integer()); + case ValueKind::Number: return Value::number(number()); + case ValueKind::String: return Value::string(string()); + case ValueKind::Array: return Value::array(array().clone()); + case ValueKind::Object: return Value::object(object().clone()); + default: Checks::exit_fail(VCPKG_LINE_INFO); } - - return *this; } - Value::~Value() = default; - Value Value::null(std::nullptr_t) noexcept { return Value(); } Value Value::boolean(bool b) noexcept { @@ -268,43 +225,25 @@ namespace vcpkg::Json val.underlying_ = std::make_unique(ValueKindConstant(), std::move(arr)); return val; } - Value Value::array(const Array& arr) noexcept - { - Value val; - val.underlying_ = std::make_unique(ValueKindConstant(), arr); - return val; - } Value Value::object(Object&& obj) noexcept { Value val; val.underlying_ = std::make_unique(ValueKindConstant(), std::move(obj)); return val; } - Value Value::object(const Object& obj) noexcept - { - Value val; - val.underlying_ = std::make_unique(ValueKindConstant(), obj); - return val; - } - - bool operator==(const Value& lhs, const Value& rhs) + // } struct Value + // struct Array { + Array Array::clone() const noexcept { - if (lhs.kind() != rhs.kind()) return false; - - switch (lhs.kind()) + Array arr; + arr.underlying_.reserve(size()); + for (const auto& el : *this) { - case ValueKind::Null: return true; - case ValueKind::Boolean: return lhs.underlying_->boolean == rhs.underlying_->boolean; - case ValueKind::Integer: return lhs.underlying_->integer == rhs.underlying_->integer; - case ValueKind::Number: return lhs.underlying_->number == rhs.underlying_->number; - case ValueKind::String: return lhs.underlying_->string == rhs.underlying_->string; - case ValueKind::Array: return lhs.underlying_->string == rhs.underlying_->string; - case ValueKind::Object: return lhs.underlying_->string == rhs.underlying_->string; - default: Checks::unreachable(VCPKG_LINE_INFO); + arr.underlying_.push_back(el.clone()); } + return arr; } - // } struct Value - // struct Array { + Value& Array::push_back(Value&& value) { underlying_.push_back(std::move(value)); @@ -326,7 +265,6 @@ namespace vcpkg::Json { return insert_before(it, Value::array(std::move(arr))).array(); } - bool operator==(const Array& lhs, const Array& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Array // struct Object { Value& Object::insert(std::string key, Value&& value) @@ -335,29 +273,14 @@ namespace vcpkg::Json underlying_.push_back({std::move(key), std::move(value)}); return underlying_.back().second; } - Value& Object::insert(std::string key, const Value& value) - { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, !contains(key)); - underlying_.push_back({std::move(key), value}); - return underlying_.back().second; - } Array& Object::insert(std::string key, Array&& value) { return insert(std::move(key), Value::array(std::move(value))).array(); } - Array& Object::insert(std::string key, const Array& value) - { - return insert(std::move(key), Value::array(value)).array(); - } Object& Object::insert(std::string key, Object&& value) { return insert(std::move(key), Value::object(std::move(value))).object(); } - Object& Object::insert(std::string key, const Object& value) - { - return insert(std::move(key), Value::object(value)).object(); - } - Value& Object::insert_or_replace(std::string key, Value&& value) { auto v = get(key); @@ -372,36 +295,14 @@ namespace vcpkg::Json return underlying_.back().second; } } - Value& Object::insert_or_replace(std::string key, const Value& value) - { - auto v = get(key); - if (v) - { - *v = value; - return *v; - } - else - { - underlying_.push_back({std::move(key), std::move(value)}); - return underlying_.back().second; - } - } Array& Object::insert_or_replace(std::string key, Array&& value) { return insert_or_replace(std::move(key), Value::array(std::move(value))).array(); } - Array& Object::insert_or_replace(std::string key, const Array& value) - { - return insert_or_replace(std::move(key), Value::array(value)).array(); - } Object& Object::insert_or_replace(std::string key, Object&& value) { return insert_or_replace(std::move(key), Value::object(std::move(value))).object(); } - Object& Object::insert_or_replace(std::string key, const Object& value) - { - return insert_or_replace(std::move(key), Value::object(value)).object(); - } auto Object::internal_find_key(StringView key) const noexcept -> underlying_t::const_iterator { @@ -449,14 +350,16 @@ namespace vcpkg::Json } } - void Object::sort_keys() + Object Object::clone() const noexcept { - std::sort(underlying_.begin(), underlying_.end(), [](const value_type& lhs, const value_type& rhs) { - return lhs.first < rhs.first; - }); + Object obj; + obj.underlying_.reserve(size()); + for (const auto& el : *this) + { + obj.insert(el.first.to_string(), el.second.clone()); + } + return obj; } - - bool operator==(const Object& lhs, const Object& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Object // auto parse() { @@ -508,7 +411,7 @@ namespace vcpkg::Json } else { - vcpkg::Checks::unreachable(VCPKG_LINE_INFO); + vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); } } @@ -545,14 +448,14 @@ namespace vcpkg::Json switch (current) { - case '"': next(); return '"'; - case '\\': next(); return '\\'; - case '/': next(); return '/'; - case 'b': next(); return '\b'; - case 'f': next(); return '\f'; - case 'n': next(); return '\n'; - case 'r': next(); return '\r'; - case 't': next(); return '\t'; + case '"': return '"'; + case '\\': return '\\'; + case '/': return '/'; + case 'b': return '\b'; + case 'f': return '\f'; + case 'n': return '\n'; + case 'r': return '\r'; + case 't': return '\t'; case 'u': { char16_t code_unit = 0; @@ -754,7 +657,7 @@ namespace vcpkg::Json rest = U"ull"; val = Value::null(nullptr); break; - default: vcpkg::Checks::unreachable(VCPKG_LINE_INFO); + default: vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); } for (const char32_t* rest_it = rest; *rest_it != '\0'; ++rest_it) diff --git a/toolsrc/src/vcpkg/base/machinetype.cpp b/toolsrc/src/vcpkg/base/machinetype.cpp index 243fa70864537a..237e1eb8bfcba9 100644 --- a/toolsrc/src/vcpkg/base/machinetype.cpp +++ b/toolsrc/src/vcpkg/base/machinetype.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/base/parse.cpp b/toolsrc/src/vcpkg/base/parse.cpp index 669321c05621e2..7d6576f4168caa 100644 --- a/toolsrc/src/vcpkg/base/parse.cpp +++ b/toolsrc/src/vcpkg/base/parse.cpp @@ -1,7 +1,12 @@ +#include "pch.h" + #include #include #include +#include +#include + #include using namespace vcpkg; @@ -101,4 +106,128 @@ namespace vcpkg::Parse // Avoid error loops by skipping to the end skip_to_eof(); } + + static Optional> remove_field(Paragraph* fields, const std::string& fieldname) + { + auto it = fields->find(fieldname); + if (it == fields->end()) + { + return nullopt; + } + + auto value = std::move(it->second); + fields->erase(it); + return value; + } + + void ParagraphParser::required_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (const auto field = maybe_field.get()) + out = std::move(*field); + else + missing_fields.push_back(fieldname); + } + void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (auto field = maybe_field.get()) out = std::move(*field); + } + void ParagraphParser::required_field(const std::string& fieldname, std::string& out) + { + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + } + std::string ParagraphParser::optional_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + optional_field(fieldname, {out, ignore}); + return out; + } + std::string ParagraphParser::required_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + return out; + } + + std::unique_ptr ParagraphParser::error_info(const std::string& name) const + { + if (!fields.empty() || !missing_fields.empty()) + { + auto err = std::make_unique(); + err->name = name; + err->extra_fields["CONTROL"] = Util::extract_keys(fields); + err->missing_fields["CONTROL"] = std::move(missing_fields); + err->expected_types = std::move(expected_types); + return err; + } + return nullptr; + } + + template + static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) + { + std::vector ret; + parser.skip_whitespace(); + if (parser.at_eof()) return std::vector{}; + do + { + auto item = f(parser); + if (!item) return nullopt; + ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); + parser.skip_whitespace(); + if (parser.at_eof()) return {std::move(ret)}; + if (parser.cur() != ',') + { + parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); + return nullopt; + } + parser.next(); + parser.skip_whitespace(); + } while (true); + } + + ExpectedS> parse_default_features_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_qualified_specifier_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof( + "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_dependencies_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { + auto loc = parser.cur_loc(); + return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { + if (pqs.triplet) + { + parser.add_error("triplet specifier not allowed in this context", loc); + return nullopt; + } + return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; + }); + }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } } diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 8e1bbdc22431ba..44fc3ebd114857 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -144,13 +146,6 @@ std::string Strings::trim(std::string&& s) return std::move(s); } -StringView Strings::trim(StringView sv) -{ - auto last = std::find_if_not(sv.rbegin(), sv.rend(), details::is_space).base(); - auto first = std::find_if_not(sv.begin(), sv.end(), details::is_space); - return StringView(first, last); -} - void Strings::trim_all_and_remove_whitespace_strings(std::vector* strings) { for (std::string& s : *strings) diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index 6e03ba543eabf8..8ab114a5e4efce 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index 800a0a23b3c747..63674963e384e3 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -17,7 +19,6 @@ namespace vcpkg if (Strings::case_insensitive_ascii_equals(arch, "amd64")) return CPUArchitecture::X64; if (Strings::case_insensitive_ascii_equals(arch, "arm")) return CPUArchitecture::ARM; if (Strings::case_insensitive_ascii_equals(arch, "arm64")) return CPUArchitecture::ARM64; - if (Strings::case_insensitive_ascii_equals(arch, "s390x")) return CPUArchitecture::S390X; return nullopt; } @@ -29,7 +30,6 @@ namespace vcpkg case CPUArchitecture::X64: return "x64"; case CPUArchitecture::ARM: return "arm"; case CPUArchitecture::ARM64: return "arm64"; - case CPUArchitecture::S390X: return "s390x"; default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::System::CPUArchitecture"); } } @@ -45,14 +45,12 @@ namespace vcpkg #else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv #if defined(__x86_64__) || defined(_M_X64) return CPUArchitecture::X64; -#elif defined(__x86__) || defined(_M_X86) || defined(__i386__) +#elif defined(__x86__) || defined(_M_X86) return CPUArchitecture::X86; #elif defined(__arm__) || defined(_M_ARM) return CPUArchitecture::ARM; #elif defined(__aarch64__) || defined(_M_ARM64) return CPUArchitecture::ARM64; -#elif defined(__s390x__) - return CPUArchitecture::S390X; #else // choose architecture #error "Unknown host architecture" #endif // choose architecture diff --git a/toolsrc/src/vcpkg/base/system.print.cpp b/toolsrc/src/vcpkg/base/system.print.cpp index 885269eef7038b..fc8e4184c8dad7 100644 --- a/toolsrc/src/vcpkg/base/system.print.cpp +++ b/toolsrc/src/vcpkg/base/system.print.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index ee2dd1b3f2ea4b..300e318df0d167 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/base/unicode.cpp b/toolsrc/src/vcpkg/base/unicode.cpp index 92b964ed83fa18..149bad20f9180a 100644 --- a/toolsrc/src/vcpkg/base/unicode.cpp +++ b/toolsrc/src/vcpkg/base/unicode.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/binarycaching.cpp b/toolsrc/src/vcpkg/binarycaching.cpp index 2c6f0fe989ade7..d63d6b3d498ce5 100644 --- a/toolsrc/src/vcpkg/binarycaching.cpp +++ b/toolsrc/src/vcpkg/binarycaching.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -9,7 +11,6 @@ #include #include #include -#include using namespace vcpkg; @@ -662,24 +663,6 @@ namespace const ExpectedS& default_cache_path() { static auto cachepath = System::get_platform_cache_home().then([](fs::path p) -> ExpectedS { - auto maybe_cachepath = System::get_environment_variable("VCPKG_DEFAULT_BINARY_CACHE"); - if (auto p_str = maybe_cachepath.get()) - { - const auto path = fs::u8path(*p_str); - const auto status = fs::stdfs::status(path); - if (!fs::stdfs::exists(status)) - return {"Path to VCPKG_DEFAULT_BINARY_CACHE does not exist: " + path.u8string(), - expected_right_tag}; - if (!fs::stdfs::is_directory(status)) - return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not a directory: " + - path.u8string(), - expected_right_tag}; - if (!path.is_absolute()) - return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not absolute: " + - path.u8string(), - expected_right_tag}; - return ExpectedS(path); - } p /= fs::u8path("vcpkg/archives"); if (p.is_absolute()) { @@ -690,10 +673,6 @@ namespace return {"default path was not absolute: " + p.u8string(), expected_right_tag}; } }); - if (cachepath.has_value()) - Debug::print("Default binary cache path is: ", cachepath.get()->u8string(), '\n'); - else - Debug::print("No binary cache path. Reason: ", cachepath.error(), '\n'); return cachepath; } diff --git a/toolsrc/src/vcpkg/binaryparagraph.cpp b/toolsrc/src/vcpkg/binaryparagraph.cpp index 4d3bcbc973ac8b..0b0819fd718f3e 100644 --- a/toolsrc/src/vcpkg/binaryparagraph.cpp +++ b/toolsrc/src/vcpkg/binaryparagraph.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 92dedd8dba16e0..bcd0a7f89c012f 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -14,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include using namespace vcpkg; @@ -187,13 +187,6 @@ namespace vcpkg::Build Build::null_build_logs_recorder(), paths); } - - void BuildCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Build::Command::perform_and_exit(args, paths, default_triplet); - } } namespace vcpkg::Build diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp index 09d84d0e88075b..9ef330e660df58 100644 --- a/toolsrc/src/vcpkg/buildenvironment.cpp +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -1,5 +1,6 @@ +#include "pch.h" + #include -#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg/cmakevars.cpp b/toolsrc/src/vcpkg/cmakevars.cpp index 7c5078d3b80fa3..ee718d40822993 100644 --- a/toolsrc/src/vcpkg/cmakevars.cpp +++ b/toolsrc/src/vcpkg/cmakevars.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index ae01302cb93e1d..17d38f395f87ac 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -1,9 +1,8 @@ +#include "pch.h" + #include -#include -#include -#include -#include +#include #include #include #include @@ -176,9 +175,4 @@ namespace vcpkg::Commands::Autocomplete Checks::exit_success(VCPKG_LINE_INFO); } - - void AutocompleteCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Autocomplete::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.buildexternal.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp index 02861918253fd1..79a8dd3c4b6895 100644 --- a/toolsrc/src/vcpkg/commands.buildexternal.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -1,7 +1,9 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include @@ -41,11 +43,4 @@ namespace vcpkg::Commands::BuildExternal Build::null_build_logs_recorder(), paths); } - - void BuildExternalCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - BuildExternal::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp index 555b70859e19a3..e7802498c703f5 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include @@ -69,9 +71,4 @@ namespace vcpkg::Commands::Cache Checks::exit_success(VCPKG_LINE_INFO); } - - void CacheCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Cache::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 4dffcfd3c8f9dd..50336a4c183d24 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -7,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -577,11 +579,4 @@ namespace vcpkg::Commands::CI Checks::exit_success(VCPKG_LINE_INFO); } - - void CICommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - CI::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 21ae756ed43294..980e17da8f4a7b 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include using namespace vcpkg; @@ -37,9 +39,4 @@ namespace vcpkg::Commands::CIClean print2("Completed vcpkg CI clean\n"); Checks::exit_success(VCPKG_LINE_INFO); } - - void CICleanCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - CIClean::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp index 2c8c7b1b2857b1..ce83fab80eff00 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include @@ -56,9 +58,4 @@ namespace vcpkg::Commands::Contact } Checks::exit_success(VCPKG_LINE_INFO); } - - void ContactCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const - { - Contact::perform_and_exit(args, fs); - } } diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp index 466cc11c073f49..be6d553047c20b 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -1,31 +1,10 @@ +#include "pch.h" + +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -34,87 +13,104 @@ namespace vcpkg::Commands { - Span> get_available_basic_commands() + Span> get_available_commands_type_a() { - static const Version::VersionCommand version{}; - static const Contact::ContactCommand contact{}; - static std::vector> t = { - {"version", &version}, - {"contact", &contact}, + static std::vector> t = { + {"install", &Install::perform_and_exit}, + {"x-set-installed", &SetInstalled::perform_and_exit}, + {"ci", &CI::perform_and_exit}, + {"remove", &Remove::perform_and_exit}, + {"upgrade", &Upgrade::perform_and_exit}, + {"build", &Build::Command::perform_and_exit}, + {"env", &Env::perform_and_exit}, + {"build-external", &BuildExternal::perform_and_exit}, + {"export", &Export::perform_and_exit}, + {"depend-info", &DependInfo::perform_and_exit}, }; return t; } - Span> get_available_paths_commands() + Span> get_available_commands_type_b() { - static const Help::HelpCommand help{}; - static const Search::SearchCommand search{}; - static const List::ListCommand list{}; - static const Info::InfoCommand info{}; - static const Integrate::IntegrateCommand integrate{}; - static const Owns::OwnsCommand owns{}; - static const Update::UpdateCommand update{}; - static const Edit::EditCommand edit{}; - static const Create::CreateCommand create{}; - static const Cache::CacheCommand cache{}; - static const PortsDiff::PortsDiffCommand portsdiff{}; - static const Autocomplete::AutocompleteCommand autocomplete{}; - static const Hash::HashCommand hash{}; - static const Fetch::FetchCommand fetch{}; - static const CIClean::CICleanCommand ciclean{}; - static const PortHistory::PortHistoryCommand porthistory{}; - static const X_VSInstances::VSInstancesCommand vsinstances{}; - static const FormatManifest::FormatManifestCommand format_manifest{}; - - static std::vector> t = { - {"/?", &help}, - {"help", &help}, - {"search", &search}, - {"list", &list}, - {"integrate", &integrate}, - {"owns", &owns}, - {"update", &update}, - {"edit", &edit}, - {"create", &create}, - {"cache", &cache}, - {"portsdiff", &portsdiff}, - {"autocomplete", &autocomplete}, - {"hash", &hash}, - {"fetch", &fetch}, - {"x-ci-clean", &ciclean}, - {"x-package-info", &info}, - {"x-history", &porthistory}, - {"x-vsinstances", &vsinstances}, - {"x-format-manifest", &format_manifest}, + static std::vector> t = { + {"/?", &Help::perform_and_exit}, + {"help", &Help::perform_and_exit}, + {"search", &Search::perform_and_exit}, + {"list", &List::perform_and_exit}, + {"integrate", &Integrate::perform_and_exit}, + {"owns", &Owns::perform_and_exit}, + {"update", &Update::perform_and_exit}, + {"edit", &Edit::perform_and_exit}, + {"create", &Create::perform_and_exit}, + {"cache", &Cache::perform_and_exit}, + {"portsdiff", &PortsDiff::perform_and_exit}, + {"autocomplete", &Autocomplete::perform_and_exit}, + {"hash", &Hash::perform_and_exit}, + {"fetch", &Fetch::perform_and_exit}, + {"x-ci-clean", &CIClean::perform_and_exit}, + {"x-history", &PortHistory::perform_and_exit}, + {"x-vsinstances", &X_VSInstances::perform_and_exit}, + {"x-format-manifest", &FormatManifest::perform_and_exit}, }; return t; } - Span> get_available_triplet_commands() + Span> get_available_commands_type_c() { - static const Install::InstallCommand install{}; - static const SetInstalled::SetInstalledCommand set_installed{}; - static const CI::CICommand ci{}; - static const Remove::RemoveCommand remove{}; - static const Upgrade::UpgradeCommand upgrade{}; - static const Build::BuildCommand build{}; - static const Env::EnvCommand env{}; - static const BuildExternal::BuildExternalCommand build_external{}; - static const Export::ExportCommand export_command{}; - static const DependInfo::DependInfoCommand depend_info{}; - - static std::vector> t = { - {"install", &install}, - {"x-set-installed", &set_installed}, - {"ci", &ci}, - {"remove", &remove}, - {"upgrade", &upgrade}, - {"build", &build}, - {"env", &env}, - {"build-external", &build_external}, - {"export", &export_command}, - {"depend-info", &depend_info}, + static std::vector> t = { + {"version", &Version::perform_and_exit}, + {"contact", &Contact::perform_and_exit}, }; return t; } } + +namespace vcpkg::Commands::Fetch +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), + 1, + 1, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + + const std::string tool = args.command_arguments[0]; + const fs::path tool_path = paths.get_tool_exe(tool); + System::print2(tool_path.u8string(), '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } +} + +namespace vcpkg::Commands::Hash +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), + 1, + 2, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + + const fs::path file_to_hash = args.command_arguments[0]; + + auto algorithm = vcpkg::Hash::Algorithm::Sha512; + if (args.command_arguments.size() == 2) + { + algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); + } + + const std::string hash = + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); + System::print2(hash, '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } +} diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index a7cfbc9318e626..83d2e109d5dffa 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include namespace vcpkg::Commands::Create @@ -42,9 +44,4 @@ namespace vcpkg::Commands::Create { Checks::exit_with_code(VCPKG_LINE_INFO, perform(args, paths)); } - - void CreateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Create::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.dependinfo.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp index 0f1e431e58fa85..ba6da1aa3fbde7 100644 --- a/toolsrc/src/vcpkg/commands.dependinfo.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include #include @@ -326,11 +328,4 @@ namespace vcpkg::Commands::DependInfo } Checks::exit_success(VCPKG_LINE_INFO); } - - void DependInfoCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - DependInfo::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index b66e8c6808c759..a433af8ecf8feb 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include @@ -265,9 +267,4 @@ namespace vcpkg::Commands::Edit #endif Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line)); } - - void EditCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Edit::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.env.cpp b/toolsrc/src/vcpkg/commands.env.cpp index a825230601d6cc..bcde9916671c1d 100644 --- a/toolsrc/src/vcpkg/commands.env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -1,9 +1,11 @@ +#include "pch.h" + #include #include #include #include -#include +#include #include namespace vcpkg::Commands::Env @@ -97,11 +99,4 @@ namespace vcpkg::Commands::Env #endif Checks::exit_with_code(VCPKG_LINE_INFO, rc); } - - void EnvCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Env::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/export.ifw.cpp b/toolsrc/src/vcpkg/commands.exportifw.cpp similarity index 99% rename from toolsrc/src/vcpkg/export.ifw.cpp rename to toolsrc/src/vcpkg/commands.exportifw.cpp index 45b600801cc45a..8356313cf3f94f 100644 --- a/toolsrc/src/vcpkg/export.ifw.cpp +++ b/toolsrc/src/vcpkg/commands.exportifw.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include @@ -5,7 +7,6 @@ #include #include #include -#include namespace vcpkg::Export::IFW { diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp deleted file mode 100644 index e6e59a30c15c10..00000000000000 --- a/toolsrc/src/vcpkg/commands.fetch.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include - -#include - -namespace vcpkg::Commands::Fetch -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), - 1, - 1, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - - const std::string tool = args.command_arguments[0]; - const fs::path tool_path = paths.get_tool_exe(tool); - System::print2(tool_path.u8string(), '\n'); - Checks::exit_success(VCPKG_LINE_INFO); - } - - void FetchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Fetch::perform_and_exit(args, paths); - } -} diff --git a/toolsrc/src/vcpkg/commands.format-manifest.cpp b/toolsrc/src/vcpkg/commands.format-manifest.cpp index 656e1799647a0f..f234722457b286 100644 --- a/toolsrc/src/vcpkg/commands.format-manifest.cpp +++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp @@ -1,184 +1,18 @@ +#include "pch.h" + #include #include #include #include -#include -#include +#include #include -#include - -namespace -{ - using namespace vcpkg; - - struct ToWrite - { - SourceControlFile scf; - fs::path file_to_write; - fs::path original_path; - std::string original_source; - }; - - Optional read_manifest(Files::Filesystem& fs, fs::path&& manifest_path) - { - auto path_string = manifest_path.u8string(); - Debug::print("Reading ", path_string, "\n"); - auto contents = fs.read_contents(manifest_path, VCPKG_LINE_INFO); - auto parsed_json_opt = Json::parse(contents, manifest_path); - if (!parsed_json_opt.has_value()) - { - System::printf( - System::Color::error, "Failed to parse %s: %s\n", path_string, parsed_json_opt.error()->format()); - return nullopt; - } - - const auto& parsed_json = parsed_json_opt.value_or_exit(VCPKG_LINE_INFO).first; - if (!parsed_json.is_object()) - { - System::printf(System::Color::error, "The file %s is not an object\n", path_string); - return nullopt; - } - - auto scf = SourceControlFile::parse_manifest_file(manifest_path, parsed_json.object()); - if (!scf.has_value()) - { - System::printf(System::Color::error, "Failed to parse manifest file: %s\n", path_string); - print_error_message(scf.error()); - return nullopt; - } - - return ToWrite{ - std::move(*scf.value_or_exit(VCPKG_LINE_INFO)), - manifest_path, - manifest_path, - std::move(contents), - }; - } - - Optional read_control_file(Files::Filesystem& fs, fs::path&& control_path) - { - std::error_code ec; - auto control_path_string = control_path.u8string(); - Debug::print("Reading ", control_path_string, "\n"); - - auto manifest_path = control_path.parent_path(); - manifest_path /= fs::u8path("vcpkg.json"); - - auto contents = fs.read_contents(control_path, VCPKG_LINE_INFO); - auto paragraphs = Paragraphs::parse_paragraphs(contents, control_path_string); - - if (!paragraphs) - { - System::printf(System::Color::error, - "Failed to read paragraphs from %s: %s\n", - control_path_string, - paragraphs.error()); - return {}; - } - auto scf_res = - SourceControlFile::parse_control_file(control_path, std::move(paragraphs).value_or_exit(VCPKG_LINE_INFO)); - if (!scf_res) - { - System::printf(System::Color::error, "Failed to parse control file: %s\n", control_path_string); - print_error_message(scf_res.error()); - return {}; - } - - return ToWrite{ - std::move(*scf_res.value_or_exit(VCPKG_LINE_INFO)), - manifest_path, - control_path, - std::move(contents), - }; - } - - void write_file(Files::Filesystem& fs, const ToWrite& data) - { - auto original_path_string = data.original_path.u8string(); - auto file_to_write_string = data.file_to_write.u8string(); - if (data.file_to_write == data.original_path) - { - Debug::print("Formatting ", file_to_write_string, "\n"); - } - else - { - Debug::print("Converting ", file_to_write_string, " -> ", original_path_string, "\n"); - } - auto res = serialize_manifest(data.scf); - - auto check = SourceControlFile::parse_manifest_file(fs::path{}, res); - if (!check) - { - System::printf(System::Color::error, - R"([correctness check] Failed to parse serialized manifest file of %s -Please open an issue at https://github.com/microsoft/vcpkg, with the following output: -Error:)", - data.scf.core_paragraph->name); - print_error_message(check.error()); - Checks::exit_with_message(VCPKG_LINE_INFO, - R"( -=== Serialized manifest file === -%s -)", - Json::stringify(res, {})); - } - - auto check_scf = std::move(check).value_or_exit(VCPKG_LINE_INFO); - if (*check_scf != data.scf) - { - Checks::exit_with_message( - VCPKG_LINE_INFO, - R"([correctness check] The serialized manifest SCF was different from the original SCF. -Please open an issue at https://github.com/microsoft/vcpkg, with the following output: - -=== Original File === -%s - -=== Serialized File === -%s - -=== Original SCF === -%s - -=== Serialized SCF === -%s -)", - data.original_source, - Json::stringify(res, {}), - Json::stringify(serialize_debug_manifest(data.scf), {}), - Json::stringify(serialize_debug_manifest(*check_scf), {})); - } - - // the manifest scf is correct - std::error_code ec; - fs.write_contents(data.file_to_write, Json::stringify(res, {}), ec); - if (ec) - { - Checks::exit_with_message( - VCPKG_LINE_INFO, "Failed to write manifest file %s: %s\n", file_to_write_string, ec.message()); - } - if (data.original_path != data.file_to_write) - { - fs.remove(data.original_path, ec); - if (ec) - { - Checks::exit_with_message( - VCPKG_LINE_INFO, "Failed to remove control file %s: %s\n", original_path_string, ec.message()); - } - } - } -} namespace vcpkg::Commands::FormatManifest { static constexpr StringLiteral OPTION_ALL = "all"; - static constexpr StringLiteral OPTION_CONVERT_CONTROL = "convert-control"; - const CommandSwitch FORMAT_SWITCHES[] = { - {OPTION_ALL, "Format all ports' manifest files."}, - {OPTION_CONVERT_CONTROL, "Convert CONTROL files to manifest files."}, - }; + const CommandSwitch FORMAT_SWITCHES[] = {{OPTION_ALL, "Format all ports' manifest files."}}; const CommandStructure COMMAND_STRUCTURE = { create_example_string(R"###(x-format-manifest --all)###"), @@ -192,35 +26,23 @@ namespace vcpkg::Commands::FormatManifest { auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE); + std::vector files_to_format; + auto& fs = paths.get_filesystem(); bool has_error = false; - const bool format_all = Util::Sets::contains(parsed_args.switches, OPTION_ALL); - const bool convert_control = Util::Sets::contains(parsed_args.switches, OPTION_CONVERT_CONTROL); - - if (!format_all && convert_control) - { - System::print2(System::Color::warning, R"(x-format-manifest was passed '--convert-control' without '--all'. - This doesn't do anything: - we will automatically convert all control files passed explicitly.)"); - } - - if (!format_all && args.command_arguments.empty()) + if (Util::Sets::contains(parsed_args.switches, OPTION_ALL)) { - Checks::exit_with_message( - VCPKG_LINE_INFO, - "No files to format; please pass either --all, or the explicit files to format or convert."); + for (const auto& dir : fs::directory_iterator(paths.ports)) + { + auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); + if (fs.exists(manifest_path)) + { + files_to_format.push_back(std::move(manifest_path)); + } + } } - std::vector to_write; - - const auto add_file = [&to_write, &has_error](Optional&& opt) { - if (auto t = opt.get()) - to_write.push_back(std::move(*t)); - else - has_error = true; - }; - for (const auto& arg : args.command_arguments) { auto path = fs::u8path(arg); @@ -228,47 +50,40 @@ namespace vcpkg::Commands::FormatManifest { path = paths.original_cwd / path; } + files_to_format.push_back(std::move(path)); + } - if (path.filename() == fs::u8path("CONTROL")) + for (const auto& path : files_to_format) + { + std::error_code ec; + Debug::print("Formatting ", path.u8string(), "\n"); + auto parsed_json_opt = Json::parse_file(fs, path, ec); + if (ec) + { + System::printf(System::Color::error, "Failed to read %s: %s\n", path.u8string(), ec.message()); + has_error = true; + } + + if (auto pr = parsed_json_opt.get()) { - add_file(read_control_file(fs, std::move(path))); + fs.write_contents(path, Json::stringify(pr->first, Json::JsonStyle{}), ec); } else { - add_file(read_manifest(fs, std::move(path))); + System::printf(System::Color::error, + "Failed to parse %s: %s\n", + path.u8string(), + parsed_json_opt.error()->format()); + has_error = true; } - } - if (format_all) - { - for (const auto& dir : fs::directory_iterator(paths.ports)) + if (ec) { - auto control_path = dir.path() / fs::u8path("CONTROL"); - auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); - auto manifest_exists = fs.exists(manifest_path); - auto control_exists = fs.exists(control_path); - - Checks::check_exit(VCPKG_LINE_INFO, - !manifest_exists || !control_exists, - "Both a manifest file and a CONTROL file exist in port directory: %s", - dir.path().u8string()); - - if (manifest_exists) - { - add_file(read_manifest(fs, std::move(manifest_path))); - } - if (convert_control && control_exists) - { - add_file(read_control_file(fs, std::move(control_path))); - } + System::printf(System::Color::error, "Failed to write %s: %s\n", path.u8string(), ec.message()); + has_error = true; } } - for (auto const& el : to_write) - { - write_file(fs, el); - } - if (has_error) { Checks::exit_fail(VCPKG_LINE_INFO); @@ -279,9 +94,4 @@ namespace vcpkg::Commands::FormatManifest Checks::exit_success(VCPKG_LINE_INFO); } } - - void FormatManifestCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - FormatManifest::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp deleted file mode 100644 index 5ac5e8aa6d4f1a..00000000000000 --- a/toolsrc/src/vcpkg/commands.hash.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#include - -namespace vcpkg::Commands::Hash -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), - 1, - 2, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - - const fs::path file_to_hash = args.command_arguments[0]; - - auto algorithm = vcpkg::Hash::Algorithm::Sha512; - if (args.command_arguments.size() == 2) - { - algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); - } - - const std::string hash = - vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); - System::print2(hash, '\n'); - Checks::exit_success(VCPKG_LINE_INFO); - } - - void HashCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Hash::perform_and_exit(args, paths); - } -} diff --git a/toolsrc/src/vcpkg/commands.info.cpp b/toolsrc/src/vcpkg/commands.info.cpp deleted file mode 100644 index afb2642c6e9396..00000000000000 --- a/toolsrc/src/vcpkg/commands.info.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include "pch.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace vcpkg::Commands::Info -{ - static constexpr StringLiteral OPTION_TRANSITIVE = "x-transitive"; - static constexpr StringLiteral OPTION_INSTALLED = "x-installed"; - - static constexpr CommandSwitch INFO_SWITCHES[] = { - {OPTION_INSTALLED, "(experimental) Report on installed packages instead of available"}, - {OPTION_TRANSITIVE, "(experimental) Also report on dependencies of installed packages"}, - }; - - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("Display detailed information on packages.\n%s", - create_example_string("x-package-info zlib openssl:x64-windows")), - 1, - SIZE_MAX, - {INFO_SWITCHES, {}}, - nullptr, - }; - - void InfoCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); - if (!args.output_json()) - { - Checks::exit_with_message( - VCPKG_LINE_INFO, "This command currently requires --%s", VcpkgCmdArguments::JSON_SWITCH); - } - - const bool installed = Util::Sets::contains(options.switches, OPTION_INSTALLED); - const bool transitive = Util::Sets::contains(options.switches, OPTION_TRANSITIVE); - - if (transitive && !installed) - { - Checks::exit_with_message(VCPKG_LINE_INFO, "--%s requires --%s", OPTION_TRANSITIVE, OPTION_INSTALLED); - } - - if (installed) - { - const StatusParagraphs status_paragraphs = database_load_check(paths); - std::set specs_written; - std::vector specs_to_write; - for (auto&& arg : args.command_arguments) - { - Parse::ParserBase parser(arg, ""); - auto maybe_qpkg = parse_qualified_specifier(parser); - if (!parser.at_eof() || !maybe_qpkg) - { - parser.add_error("expected a package specifier"); - } - else if (!maybe_qpkg.get()->triplet) - { - parser.add_error("expected an explicit triplet"); - } - else if (maybe_qpkg.get()->features) - { - parser.add_error("unexpected list of features"); - } - else if (maybe_qpkg.get()->platform) - { - parser.add_error("unexpected qualifier"); - } - if (auto err = parser.get_error()) - { - System::print2(err->format(), "\n"); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - auto& qpkg = *maybe_qpkg.get(); - auto t = Triplet::from_canonical_name(std::string(*qpkg.triplet.get())); - Input::check_triplet(t, paths); - specs_to_write.emplace_back(qpkg.name, t); - } - Json::Object response; - Json::Object results; - while (!specs_to_write.empty()) - { - auto spec = std::move(specs_to_write.back()); - specs_to_write.pop_back(); - if (!specs_written.insert(spec).second) continue; - auto maybe_ipv = status_paragraphs.get_installed_package_view(spec); - if (auto ipv = maybe_ipv.get()) - { - results.insert(spec.to_string(), serialize_ipv(*ipv, paths)); - if (transitive) - { - auto deps = ipv->dependencies(); - specs_to_write.insert(specs_to_write.end(), - std::make_move_iterator(deps.begin()), - std::make_move_iterator(deps.end())); - } - } - } - response.insert("results", std::move(results)); - System::print2(Json::stringify(response, {})); - } - else - { - Json::Object response; - Json::Object results; - PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); - - for (auto&& arg : args.command_arguments) - { - Parse::ParserBase parser(arg, ""); - auto maybe_pkg = parse_package_name(parser); - if (!parser.at_eof() || !maybe_pkg) - { - parser.add_error("expected only a package identifier"); - } - if (auto err = parser.get_error()) - { - System::print2(err->format(), "\n"); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - auto& pkg = *maybe_pkg.get(); - - if (results.contains(pkg)) continue; - - auto maybe_scfl = provider.get_control_file(pkg); - - Json::Object obj; - if (auto pscfl = maybe_scfl.get()) - { - results.insert(pkg, serialize_manifest(*pscfl->source_control_file)); - } - } - response.insert("results", std::move(results)); - System::print2(Json::stringify(response, {})); - } - } -} diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index 1aa7d58649bf57..a7ef5a012226c3 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -5,9 +7,8 @@ #include #include -#include +#include #include -#include #include namespace vcpkg::Commands::Integrate @@ -558,9 +559,4 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown parameter %s for integrate", args.command_arguments[0]); } - - void IntegrateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Integrate::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp index fcd2919ff172c5..f65ba9497974ae 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -1,6 +1,8 @@ +#include "pch.h" + #include -#include +#include #include #include #include @@ -9,6 +11,8 @@ namespace vcpkg::Commands::List { static constexpr StringLiteral OPTION_FULLDESC = "x-full-desc"; // TODO: This should find a better home, eventually + static constexpr StringLiteral OPTION_JSON = "--x-json"; + static void do_print_json(std::vector installed_packages) { Json::Object obj; @@ -71,8 +75,9 @@ namespace vcpkg::Commands::List } } - static constexpr std::array LIST_SWITCHES = {{ + static constexpr std::array LIST_SWITCHES = {{ {OPTION_FULLDESC, "Do not truncate long text"}, + {OPTION_JSON, "List libraries in JSON format"}, }}; const CommandStructure COMMAND_STRUCTURE = { @@ -110,6 +115,7 @@ namespace vcpkg::Commands::List }); const auto enable_fulldesc = Util::Sets::contains(options.switches, OPTION_FULLDESC.to_string()); + const auto enable_json = Util::Sets::contains(options.switches, OPTION_JSON.to_string()); if (!args.command_arguments.empty()) { @@ -120,7 +126,7 @@ namespace vcpkg::Commands::List installed_packages = pghs; } - if (args.output_json()) + if (enable_json) { do_print_json(installed_packages); } @@ -134,9 +140,4 @@ namespace vcpkg::Commands::List Checks::exit_success(VCPKG_LINE_INFO); } - - void ListCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - List::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp index 29cfe3a2300e87..a71a56ed30153e 100644 --- a/toolsrc/src/vcpkg/commands.owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -1,6 +1,8 @@ +#include "pch.h" + #include -#include +#include #include #include @@ -38,9 +40,4 @@ namespace vcpkg::Commands::Owns search_file(paths, args.command_arguments[0], status_db); Checks::exit_success(VCPKG_LINE_INFO); } - - void OwnsCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Owns::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp index 6f45e26ed0f115..b1bf29f5f3e0b7 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -1,10 +1,11 @@ +#include "pch.h" + #include #include #include -#include +#include #include -#include namespace vcpkg::Commands::PortHistory { @@ -93,9 +94,4 @@ namespace vcpkg::Commands::PortHistory } Checks::exit_success(VCPKG_LINE_INFO); } - - void PortHistoryCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - PortHistory::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp index ad27599fbbeaeb..94c6e490b410cd 100644 --- a/toolsrc/src/vcpkg/commands.portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -1,12 +1,13 @@ +#include "pch.h" + #include #include #include #include -#include +#include #include #include -#include #include namespace vcpkg::Commands::PortsDiff @@ -189,9 +190,4 @@ namespace vcpkg::Commands::PortsDiff Checks::exit_success(VCPKG_LINE_INFO); } - - void PortsDiffCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - PortsDiff::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.search.cpp b/toolsrc/src/vcpkg/commands.search.cpp index 836acfffeea1f5..b78420b4db2ccf 100644 --- a/toolsrc/src/vcpkg/commands.search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -1,6 +1,8 @@ +#include "pch.h" + #include -#include +#include #include #include #include @@ -142,9 +144,4 @@ namespace vcpkg::Commands::Search Checks::exit_success(VCPKG_LINE_INFO); } - - void SearchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Search::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/commands.setinstalled.cpp b/toolsrc/src/vcpkg/commands.setinstalled.cpp index 6ef5099dc6f5ef..82e1c763f14f9a 100644 --- a/toolsrc/src/vcpkg/commands.setinstalled.cpp +++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp @@ -1,7 +1,9 @@ +#include "pch.h" + #include #include -#include +#include #include #include #include @@ -37,10 +39,21 @@ namespace vcpkg::Commands::SetInstalled const PortFileProvider::PathsPortFileProvider& provider, IBinaryProvider& binary_provider, const CMakeVars::CMakeVarProvider& cmake_vars, - Dependencies::ActionPlan action_plan, + const std::vector& specs, + const Build::BuildPackageOptions& install_plan_options, DryRun dry_run, const Optional& maybe_pkgsconfig) { + // We have a set of user-requested specs. + // We need to know all the specs which are required to fulfill dependencies for those specs. + // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. + auto action_plan = Dependencies::create_feature_install_plan(provider, cmake_vars, specs, {}); + + for (auto&& action : action_plan.install_actions) + { + action.build_options = install_plan_options; + } + cmake_vars.load_tag_vars(action_plan, provider); Build::compute_all_abis(paths, action_plan, cmake_vars, {}); @@ -142,31 +155,14 @@ namespace vcpkg::Commands::SetInstalled { pkgsconfig = it_pkgsconfig->second; } - - // We have a set of user-requested specs. - // We need to know all the specs which are required to fulfill dependencies for those specs. - // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. - auto action_plan = Dependencies::create_feature_install_plan(provider, *cmake_vars, specs, {}); - - for (auto&& action : action_plan.install_actions) - { - action.build_options = Build::default_build_package_options; - } - perform_and_exit_ex(args, paths, provider, *binary_provider, *cmake_vars, - std::move(action_plan), + specs, + vcpkg::Build::default_build_package_options, dry_run ? DryRun::Yes : DryRun::No, pkgsconfig); } - - void SetInstalledCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - SetInstalled::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 391192038a9f27..25fb0de9895aac 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -1,8 +1,10 @@ +#include "pch.h" + #include #include #include -#include +#include #include #include #include @@ -190,11 +192,4 @@ namespace vcpkg::Commands::Upgrade Checks::exit_success(VCPKG_LINE_INFO); } - - void UpgradeCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Upgrade::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp index d366a42b83a85e..273b4f10a64e20 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -1,6 +1,8 @@ +#include "pch.h" + #include -#include +#include #include #include @@ -91,9 +93,4 @@ namespace vcpkg::Commands::Version "See LICENSE.txt for license information.\n"); Checks::exit_success(VCPKG_LINE_INFO); } - - void VersionCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const - { - Version::perform_and_exit(args, fs); - } } diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp index 4ad9744c90e557..718c73ec015604 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -1,6 +1,8 @@ +#include "pch.h" + #include -#include +#include #include #include @@ -31,9 +33,4 @@ namespace vcpkg::Commands::X_VSInstances Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); #endif } - - void VSInstancesCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - X_VSInstances::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index f7671ceef20789..e9af12929f9601 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -592,70 +594,6 @@ namespace vcpkg::Dependencies m_graph->get(spec).request_type = RequestType::USER_REQUESTED; } - // `features` should have "default" instead of missing "core" - std::vector resolve_deps_as_top_level(const SourceControlFile& scf, - Triplet triplet, - std::vector features, - CMakeVars::CMakeVarProvider& var_provider) - { - PackageSpec spec{scf.core_paragraph->name, triplet}; - std::map> specs_to_features; - - Optional ctx_storage = var_provider.get_dep_info_vars(spec); - auto ctx = [&]() -> const PlatformExpression::Context& { - if (!ctx_storage) - { - var_provider.load_dep_info_vars({{spec}}); - ctx_storage = var_provider.get_dep_info_vars(spec); - } - return ctx_storage.value_or_exit(VCPKG_LINE_INFO); - }; - - auto handle_deps = [&](View deps) { - for (auto&& dep : deps) - { - if (dep.platform.is_empty() || dep.platform.evaluate(ctx())) - { - if (dep.name == spec.name()) - Util::Vectors::append(&features, dep.features); - else - Util::Vectors::append(&specs_to_features[dep.name], dep.features); - } - } - }; - - handle_deps(scf.core_paragraph->dependencies); - enum class State - { - NotVisited = 0, - Visited, - }; - std::map feature_state; - while (!features.empty()) - { - auto feature = std::move(features.back()); - features.pop_back(); - - if (feature_state[feature] == State::Visited) continue; - feature_state[feature] = State::Visited; - if (feature == "default") - { - Util::Vectors::append(&features, scf.core_paragraph->default_features); - } - else - { - auto it = - Util::find_if(scf.feature_paragraphs, [&feature](const std::unique_ptr& ptr) { - return ptr->name == feature; - }); - if (it != scf.feature_paragraphs.end()) handle_deps(it->get()->dependencies); - } - } - return Util::fmap(specs_to_features, [triplet](std::pair>& p) { - return FullPackageSpec({p.first, triplet}, Util::sort_unique_erase(std::move(p.second))); - }); - } - ActionPlan create_feature_install_plan(const PortFileProvider::PortFileProvider& port_provider, const CMakeVars::CMakeVarProvider& var_provider, const std::vector& specs, @@ -689,9 +627,7 @@ namespace vcpkg::Dependencies } pgraph.install(feature_specs); - auto res = pgraph.serialize(options); - - return res; + return pgraph.serialize(options); } void PackageGraph::mark_for_reinstall(const PackageSpec& first_remove_spec, diff --git a/toolsrc/src/vcpkg/export.chocolatey.cpp b/toolsrc/src/vcpkg/export.chocolatey.cpp index abaea6921f874d..40564ae135d163 100644 --- a/toolsrc/src/vcpkg/export.chocolatey.cpp +++ b/toolsrc/src/vcpkg/export.chocolatey.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include @@ -5,7 +7,6 @@ #include #include #include -#include namespace vcpkg::Export::Chocolatey { @@ -38,24 +39,24 @@ namespace vcpkg::Export::Chocolatey const std::map& packages_version, const Options& chocolatey_options) { - static constexpr auto CONTENT_TEMPLATE = R"( - - - @PACKAGE_ID@ - @PACKAGE_VERSION@ - @PACKAGE_MAINTAINER@ - - - @PACKAGE_DEPENDENCIES@ - - - - - - - + static constexpr auto CONTENT_TEMPLATE = R"( + + + @PACKAGE_ID@ + @PACKAGE_VERSION@ + @PACKAGE_MAINTAINER@ + + + @PACKAGE_DEPENDENCIES@ + + + + + + + )"; auto package_version = packages_version.find(binary_paragraph.spec.name()); if (package_version == packages_version.end()) @@ -80,68 +81,68 @@ namespace vcpkg::Export::Chocolatey static std::string create_chocolatey_install_contents() { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$installedDir = Join-Path $rootDir 'installed' - -$whereToInstall = (pwd).path -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Set-Content -Path $whereToInstallCache -Value $whereToInstall -Copy-Item $installedDir -destination $whereToInstall -recurse -force + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$installedDir = Join-Path $rootDir 'installed' + +$whereToInstall = (pwd).path +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Set-Content -Path $whereToInstallCache -Value $whereToInstall +Copy-Item $installedDir -destination $whereToInstall -recurse -force )###"; return CONTENT_TEMPLATE; } static std::string create_chocolatey_uninstall_contents(const BinaryParagraph& binary_paragraph) { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' - -$whereToInstall = $null -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Get-Content $whereToInstallCache | Foreach-Object { - $whereToInstall = $_ -} - -$installedDir = Join-Path $whereToInstall 'installed' -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Leaf) { - Remove-Item $fileToRemove - } -} - -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Container) { - $folderToDelete = Join-Path $fileToRemove * - if (-Not (Test-Path $folderToDelete)) - { - Remove-Item $fileToRemove - } - } -} - -$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' -Remove-Item $listFileToRemove - -if (Test-Path $installedDir) -{ - while ( - $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { - $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 - } - ) { $empties | Remove-Item } -} + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' + +$whereToInstall = $null +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Get-Content $whereToInstallCache | Foreach-Object { + $whereToInstall = $_ +} + +$installedDir = Join-Path $whereToInstall 'installed' +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Leaf) { + Remove-Item $fileToRemove + } +} + +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Container) { + $folderToDelete = Join-Path $fileToRemove * + if (-Not (Test-Path $folderToDelete)) + { + Remove-Item $fileToRemove + } + } +} + +$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' +Remove-Item $listFileToRemove + +if (Test-Path $installedDir) +{ + while ( + $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { + $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 + } + ) { $empties | Remove-Item } +} )###"; std::string chocolatey_uninstall_content = Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_FULLSTEM@", binary_paragraph.fullstem()); diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index f8691aa0405780..54a1180c1fb8be 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -13,7 +15,6 @@ #include #include #include -#include #include namespace vcpkg::Export @@ -149,19 +150,13 @@ namespace vcpkg::Export fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); // -NoDefaultExcludes is needed for ".vcpkg-root" - System::CmdLineBuilder cmd; -#ifndef _WIN32 - cmd.path_arg(paths.get_tool_exe(Tools::MONO)); -#endif - cmd.path_arg(nuget_exe) - .string_arg("pack") - .path_arg(nuspec_file_path) - .string_arg("-OutputDirectory") - .path_arg(output_dir) - .string_arg("-NoDefaultExcludes"); + const auto cmd_line = Strings::format(R"("%s" pack -OutputDirectory "%s" "%s" -NoDefaultExcludes)", + nuget_exe.u8string(), + output_dir.u8string(), + nuspec_file_path.u8string()); const int exit_code = - System::cmd_execute_and_capture_output(cmd.extract(), System::get_clean_environment()).exit_code; + System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: NuGet package creation failed"); const fs::path output_path = output_dir / (nuget_id + "." + nuget_version + ".nupkg"); @@ -211,26 +206,14 @@ namespace vcpkg::Export Strings::format("%s.%s", exported_dir_filename, format.extension()); const fs::path exported_archive_path = (output_dir / exported_archive_filename); - System::CmdLineBuilder cmd; - cmd.string_arg("cd").path_arg(raw_exported_dir.parent_path()); - cmd.ampersand(); - cmd.path_arg(cmake_exe) - .string_arg("-E") - .string_arg("tar") - .string_arg("cf") - .path_arg(exported_archive_path) - .string_arg(Strings::concat("--format=", format.cmake_option())) - .string_arg("--") - .path_arg(raw_exported_dir); - - auto cmdline = cmd.extract(); -#ifdef WIN32 - // Invoke through `cmd` to support `&&` - cmdline.insert(0, "cmd /c \""); - cmdline.push_back('"'); -#endif + // -NoDefaultExcludes is needed for ".vcpkg-root" + const auto cmd_line = Strings::format(R"("%s" -E tar "cf" "%s" --format=%s -- "%s")", + cmake_exe.u8string(), + exported_archive_path.u8string(), + format.cmake_option(), + raw_exported_dir.u8string()); - const int exit_code = System::cmd_execute_clean(cmdline); + const int exit_code = System::cmd_execute_clean(cmd_line); Checks::check_exit( VCPKG_LINE_INFO, exit_code == 0, "Error: %s creation failed", exported_archive_path.generic_string()); return exported_archive_path; @@ -279,7 +262,6 @@ namespace vcpkg::Export bool all_installed = false; Optional maybe_output; - fs::path output_dir; Optional maybe_nuget_id; Optional maybe_nuget_version; @@ -291,7 +273,6 @@ namespace vcpkg::Export }; static constexpr StringLiteral OPTION_OUTPUT = "output"; - static constexpr StringLiteral OPTION_OUTPUT_DIR = "output-dir"; static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; static constexpr StringLiteral OPTION_RAW = "raw"; static constexpr StringLiteral OPTION_NUGET = "nuget"; @@ -333,9 +314,8 @@ namespace vcpkg::Export {OPTION_ALL_INSTALLED, "Export all installed packages"}, }}; - static constexpr std::array EXPORT_SETTINGS = {{ + static constexpr std::array EXPORT_SETTINGS = {{ {OPTION_OUTPUT, "Specify the output name (used to construct filename)"}, - {OPTION_OUTPUT_DIR, "Specify the output directory for produced artifacts"}, {OPTION_NUGET_ID, "Specify the id for the exported NuGet package (overrides --output)"}, {OPTION_NUGET_VERSION, "Specify the version for the exported NuGet package"}, {OPTION_IFW_REPOSITORY_URL, "Specify the remote repository URL for the online installer"}, @@ -362,8 +342,7 @@ namespace vcpkg::Export nullptr, }; - static ExportArguments handle_export_command_arguments(const VcpkgPaths& paths, - const VcpkgCmdArguments& args, + static ExportArguments handle_export_command_arguments(const VcpkgCmdArguments& args, Triplet default_triplet, const StatusParagraphs& status_db) { @@ -382,15 +361,6 @@ namespace vcpkg::Export ret.prefab_options.enable_maven = options.switches.find(OPTION_PREFAB_ENABLE_MAVEN) != options.switches.cend(); ret.prefab_options.enable_debug = options.switches.find(OPTION_PREFAB_ENABLE_DEBUG) != options.switches.cend(); ret.maybe_output = maybe_lookup(options.settings, OPTION_OUTPUT); - auto maybe_output_dir = maybe_lookup(options.settings, OPTION_OUTPUT_DIR); - if (auto output_dir = maybe_output_dir.get()) - { - ret.output_dir = Files::combine(paths.original_cwd, fs::u8path(*output_dir)); - } - else - { - ret.output_dir = paths.root; - } ret.all_installed = options.switches.find(OPTION_ALL_INSTALLED) != options.switches.end(); if (ret.all_installed) @@ -509,7 +479,8 @@ namespace vcpkg::Export const VcpkgPaths& paths) { Files::Filesystem& fs = paths.get_filesystem(); - const fs::path raw_exported_dir_path = opts.output_dir / export_id; + const fs::path export_to_path = paths.root; + const fs::path raw_exported_dir_path = export_to_path / export_id; fs.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); // TODO: error handling @@ -567,7 +538,7 @@ namespace vcpkg::Export const std::string nuget_id = opts.maybe_nuget_id.value_or(raw_exported_dir_path.filename().string()); const std::string nuget_version = opts.maybe_nuget_version.value_or("1.0.0"); const fs::path output_path = - do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, opts.output_dir); + do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, export_to_path); System::print2(System::Color::success, "NuGet package exported at: ", output_path.u8string(), "\n"); System::printf(R"( @@ -583,7 +554,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { System::print2("Creating zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::ZIP); + do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::ZIP); System::print2(System::Color::success, "Zip archive exported at: ", output_path.u8string(), "\n"); print_next_step_info("[...]"); } @@ -592,7 +563,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { System::print2("Creating 7zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::SEVEN_ZIP); + do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::SEVEN_ZIP); System::print2(System::Color::success, "7zip archive exported at: ", output_path.u8string(), "\n"); print_next_step_info("[...]"); } @@ -613,7 +584,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console "may use export in classic mode by running vcpkg outside of a manifest-based project."); } const StatusParagraphs status_db = database_load_check(paths); - const auto opts = handle_export_command_arguments(paths, args, default_triplet, status_db); + const auto opts = handle_export_command_arguments(args, default_triplet, status_db); for (auto&& spec : opts.specs) Input::check_triplet(spec.triplet(), paths); @@ -688,11 +659,4 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_success(VCPKG_LINE_INFO); } - - void ExportCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Export::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/export.prefab.cpp b/toolsrc/src/vcpkg/export.prefab.cpp index 51ac868c721068..7dd516ac55702b 100644 --- a/toolsrc/src/vcpkg/export.prefab.cpp +++ b/toolsrc/src/vcpkg/export.prefab.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -9,7 +11,6 @@ #include #include #include -#include namespace vcpkg::Export::Prefab { diff --git a/toolsrc/src/vcpkg/globalstate.cpp b/toolsrc/src/vcpkg/globalstate.cpp index b07690bbd31741..037232f11e8e25 100644 --- a/toolsrc/src/vcpkg/globalstate.cpp +++ b/toolsrc/src/vcpkg/globalstate.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include namespace vcpkg diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index 1719e5f6cce2ae..d341b32ab790e5 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -1,14 +1,9 @@ +#include "pch.h" + #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include #include @@ -134,9 +129,4 @@ namespace vcpkg::Help help_topics(paths); Checks::exit_fail(VCPKG_LINE_INFO); } - - void HelpCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Help::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/input.cpp b/toolsrc/src/vcpkg/input.cpp index b82dc44fb7f153..f9184983c67947 100644 --- a/toolsrc/src/vcpkg/input.cpp +++ b/toolsrc/src/vcpkg/input.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 03ae77d9823ff3..da4248c39e1953 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -6,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -510,8 +512,6 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_USE_ARIA2 = "x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "clean-after-build"; static constexpr StringLiteral OPTION_WRITE_PACKAGES_CONFIG = "x-write-nuget-packages-config"; - static constexpr StringLiteral OPTION_MANIFEST_NO_DEFAULT_FEATURES = "x-no-default-features"; - static constexpr StringLiteral OPTION_MANIFEST_FEATURE = "x-feature"; static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, @@ -524,19 +524,6 @@ namespace vcpkg::Install {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, }}; - static constexpr std::array MANIFEST_INSTALL_SWITCHES = {{ - {OPTION_DRY_RUN, "Do not actually build or install"}, - {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, - {OPTION_NO_DOWNLOADS, "Do not download new sources"}, - {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, - {OPTION_RECURSE, "Allow removal of packages as part of installation"}, - {OPTION_KEEP_GOING, "Continue installing packages on failure"}, - {OPTION_EDITABLE, "Disable source re-extraction and binary caching for libraries on the command line"}, - {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, - {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, - {OPTION_MANIFEST_NO_DEFAULT_FEATURES, "Don't install the default features from the manifest."}, - }}; - static constexpr std::array INSTALL_SETTINGS = {{ {OPTION_XUNIT, "File to output results in XUnit format (Internal use)"}, {OPTION_WRITE_PACKAGES_CONFIG, @@ -544,10 +531,6 @@ namespace vcpkg::Install "binarycaching` for more information."}, }}; - static constexpr std::array MANIFEST_INSTALL_MULTISETTINGS = {{ - {OPTION_MANIFEST_FEATURE, "A feature from the manifest to install."}, - }}; - std::vector get_all_port_names(const VcpkgPaths& paths) { auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports); @@ -568,40 +551,26 @@ namespace vcpkg::Install create_example_string("install --triplet x64-windows"), 0, 0, - {MANIFEST_INSTALL_SWITCHES, INSTALL_SETTINGS, MANIFEST_INSTALL_MULTISETTINGS}, + {INSTALL_SWITCHES, INSTALL_SETTINGS}, nullptr, }; static void print_cmake_information(const BinaryParagraph& bpgh, const VcpkgPaths& paths) - { - auto usage = get_cmake_usage(bpgh, paths); - - if (!usage.message.empty()) - { - System::print2(usage.message); - } - } - - CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths) { static const std::regex cmake_library_regex(R"(\badd_library\(([^\$\s\)]+)\s)", std::regex_constants::ECMAScript); - CMakeUsageInfo ret; - auto& fs = paths.get_filesystem(); auto usage_file = paths.installed / bpgh.spec.triplet().canonical_name() / "share" / bpgh.spec.name() / "usage"; if (fs.exists(usage_file)) { - ret.usage_file = true; auto maybe_contents = fs.read_contents(usage_file); if (auto p_contents = maybe_contents.get()) { - ret.message = std::move(*p_contents); - ret.message.push_back('\n'); + System::print2(*p_contents, '\n'); } - return ret; + return; } auto files = fs.read_lines(paths.listfile_path(bpgh)); @@ -666,8 +635,6 @@ namespace vcpkg::Install } } - ret.header_only = is_header_only; - if (library_targets.empty()) { if (is_header_only && !header_path.empty()) @@ -686,21 +653,20 @@ namespace vcpkg::Install "The package ", bpgh.spec, " is header only and can be used from CMake via:\n\n"); Strings::append(msg, " find_path(", name, "_INCLUDE_DIRS \"", header_path, "\")\n"); Strings::append(msg, " target_include_directories(main PRIVATE ${", name, "_INCLUDE_DIRS})\n\n"); - - ret.message = std::move(msg); + System::print2(msg); } } else { - auto msg = Strings::concat("The package ", bpgh.spec, " provides CMake targets:\n\n"); + System::print2("The package ", bpgh.spec, " provides CMake targets:\n\n"); for (auto&& library_target_pair : library_targets) { auto config_it = config_files.find(library_target_pair.first); if (config_it != config_files.end()) - Strings::append(msg, " find_package(", config_it->second, " CONFIG REQUIRED)\n "); + System::printf(" find_package(%s CONFIG REQUIRED)\n", config_it->second); else - Strings::append(msg, " find_package(", library_target_pair.first, " CONFIG REQUIRED)\n "); + System::printf(" find_package(%s CONFIG REQUIRED)\n", library_target_pair.first); std::sort(library_target_pair.second.begin(), library_target_pair.second.end(), @@ -712,27 +678,22 @@ namespace vcpkg::Install if (library_target_pair.second.size() <= 4) { - Strings::append(msg, - " target_link_libraries(main PRIVATE ", - Strings::join(" ", library_target_pair.second), - ")\n\n"); + System::printf(" target_link_libraries(main PRIVATE %s)\n\n", + Strings::join(" ", library_target_pair.second)); } else { auto omitted = library_target_pair.second.size() - 4; library_target_pair.second.erase(library_target_pair.second.begin() + 4, library_target_pair.second.end()); - msg += Strings::format(" # Note: %zd target(s) were omitted.\n" - " target_link_libraries(main PRIVATE %s)\n\n", - omitted, - Strings::join(" ", library_target_pair.second)); + System::printf(" # Note: %zd target(s) were omitted.\n" + " target_link_libraries(main PRIVATE %s)\n\n", + omitted, + Strings::join(" ", library_target_pair.second)); } } - ret.message = std::move(msg); } - ret.cmake_targets_map = std::move(library_targets); } - return ret; } /// @@ -782,62 +743,48 @@ namespace vcpkg::Install if (paths.manifest_mode_enabled()) { - Optional pkgsconfig; - auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); - if (it_pkgsconfig != options.settings.end()) - { - pkgsconfig = fs::u8path(it_pkgsconfig->second); - } - std::error_code ec; - auto manifest_path = paths.manifest_root_dir / fs::u8path("vcpkg.json"); - auto maybe_manifest_scf = Paragraphs::try_load_manifest(fs, "manifest", manifest_path, ec); + const auto path_to_manifest = paths.manifest_root_dir / "vcpkg.json"; + auto res = Paragraphs::try_load_manifest(paths.get_filesystem(), "user manifest", path_to_manifest, ec); + if (ec) { - Checks::exit_with_message( - VCPKG_LINE_INFO, "Failed to read manifest %s: %s", manifest_path.u8string(), ec.message()); + Checks::exit_with_message(VCPKG_LINE_INFO, + "Failed to load manifest file (%s): %s\n", + path_to_manifest.u8string(), + ec.message()); } - else if (!maybe_manifest_scf) - { - print_error_message(maybe_manifest_scf.error()); - Checks::exit_with_message(VCPKG_LINE_INFO, "Failed to read manifest %s.", manifest_path.u8string()); - } - auto& manifest_scf = *maybe_manifest_scf.value_or_exit(VCPKG_LINE_INFO); - std::vector features; - auto manifest_feature_it = options.multisettings.find(OPTION_MANIFEST_FEATURE); - if (manifest_feature_it != options.multisettings.end()) - { - features.insert(features.end(), manifest_feature_it->second.begin(), manifest_feature_it->second.end()); - } - auto core_it = Util::find(features, "core"); - if (core_it == features.end()) + std::vector specs; + if (auto val = res.get()) { - if (!Util::Sets::contains(options.switches, OPTION_MANIFEST_NO_DEFAULT_FEATURES)) - features.push_back("default"); + for (auto& dep : (*val)->core_paragraph->dependencies) + { + specs.push_back(FullPackageSpec{ + {std::move(dep.name), default_triplet}, + std::move(dep.features), + }); + } } else { - // remove "core" because resolve_deps_as_top_level uses default-inversion - features.erase(core_it); + print_error_message(res.error()); + Checks::exit_fail(VCPKG_LINE_INFO); } - auto specs = resolve_deps_as_top_level(manifest_scf, default_triplet, features, var_provider); - - auto install_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, {}); - for (InstallPlanAction& action : install_plan.install_actions) + Optional pkgsconfig; + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) { - action.build_options = install_plan_options; - action.build_options.use_head_version = Build::UseHeadVersion::NO; - action.build_options.editable = Build::Editable::NO; + pkgsconfig = fs::u8path(it_pkgsconfig->second); } - Commands::SetInstalled::perform_and_exit_ex(args, paths, provider, *binaryprovider, var_provider, - std::move(install_plan), + specs, + install_plan_options, dry_run ? Commands::DryRun::Yes : Commands::DryRun::No, pkgsconfig); } @@ -980,13 +927,6 @@ namespace vcpkg::Install Checks::exit_success(VCPKG_LINE_INFO); } - void InstallCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Install::perform_and_exit(args, paths, default_triplet); - } - SpecSummary::SpecSummary(const PackageSpec& spec, const Dependencies::InstallPlanAction* action) : spec(spec), build_result{BuildResult::NULLVALUE, nullptr}, action(action) { diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 79a33a0d7421c9..f348e32c0fb8ce 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -6,7 +8,6 @@ #include #include -#include #include #if defined(_WIN32) @@ -178,11 +179,11 @@ namespace vcpkg::Metrics std::string format_event_data_template() const { - auto props_plus_buildtimes = properties; + auto props_plus_buildtimes = properties.clone(); if (buildtime_names.size() > 0) { - props_plus_buildtimes.insert("buildnames_1", buildtime_names); - props_plus_buildtimes.insert("buildtimes", buildtime_times); + props_plus_buildtimes.insert("buildnames_1", Json::Value::array(buildtime_names.clone())); + props_plus_buildtimes.insert("buildtimes", Json::Value::array(buildtime_times.clone())); } Json::Array arr = Json::Array(); @@ -231,9 +232,9 @@ namespace vcpkg::Metrics base_data.insert("ver", Json::Value::integer(2)); base_data.insert("name", Json::Value::string("commandline_test7")); - base_data.insert("properties", std::move(props_plus_buildtimes)); - base_data.insert("measurements", measurements); - base_data.insert("feature-flags", feature_flags); + base_data.insert("properties", Json::Value::object(std::move(props_plus_buildtimes))); + base_data.insert("measurements", Json::Value::object(measurements.clone())); + base_data.insert("feature-flags", Json::Value::object(feature_flags.clone())); } return Json::stringify(arr, vcpkg::Json::JsonStyle()); diff --git a/toolsrc/src/vcpkg/packagespec.cpp b/toolsrc/src/vcpkg/packagespec.cpp index 0feb8412a418a1..d4c293b46f5221 100644 --- a/toolsrc/src/vcpkg/packagespec.cpp +++ b/toolsrc/src/vcpkg/packagespec.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -91,6 +93,8 @@ namespace vcpkg return left.name() == right.name() && left.triplet() == right.triplet(); } + bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } + ExpectedS Features::from_string(const std::string& name) { return parse_qualified_specifier(name).then([&](ParsedQualifiedSpecifier&& pqs) -> ExpectedS { @@ -258,15 +262,4 @@ namespace vcpkg parser.skip_tabs_spaces(); return ret; } - - bool operator==(const Dependency& lhs, const Dependency& rhs) - { - if (lhs.name != rhs.name) return false; - if (lhs.features != rhs.features) return false; - if (!structurally_equal(lhs.platform, rhs.platform)) return false; - if (lhs.extra_info != rhs.extra_info) return false; - - return true; - } - bool operator!=(const Dependency& lhs, const Dependency& rhs); } diff --git a/toolsrc/src/vcpkg/paragraphparseresult.cpp b/toolsrc/src/vcpkg/paragraphparseresult.cpp new file mode 100644 index 00000000000000..8bd5c0d7ac1068 --- /dev/null +++ b/toolsrc/src/vcpkg/paragraphparseresult.cpp @@ -0,0 +1,35 @@ +#include "pch.h" + +#include + +#include + +namespace vcpkg +{ + const char* ParagraphParseResultCategoryImpl::name() const noexcept { return "ParagraphParseResult"; } + + std::string ParagraphParseResultCategoryImpl::message(int ev) const noexcept + { + switch (static_cast(ev)) + { + case ParagraphParseResult::SUCCESS: return "OK"; + case ParagraphParseResult::EXPECTED_ONE_PARAGRAPH: return "There should be exactly one paragraph"; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + const std::error_category& paragraph_parse_result_category() + { + static ParagraphParseResultCategoryImpl instance; + return instance; + } + + std::error_code make_error_code(ParagraphParseResult e) + { + return std::error_code(static_cast(e), paragraph_parse_result_category()); + } + + ParagraphParseResult to_paragraph_parse_result(int i) { return static_cast(i); } + + ParagraphParseResult to_paragraph_parse_result(std::error_code ec) { return to_paragraph_parse_result(ec.value()); } +} diff --git a/toolsrc/src/vcpkg/paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp index a1d6970630465b..20a82ee0c09f32 100644 --- a/toolsrc/src/vcpkg/paragraphs.cpp +++ b/toolsrc/src/vcpkg/paragraphs.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -5,139 +7,12 @@ #include #include -#include +#include #include using namespace vcpkg::Parse; using namespace vcpkg; -namespace vcpkg::Parse -{ - static Optional> remove_field(Paragraph* fields, const std::string& fieldname) - { - auto it = fields->find(fieldname); - if (it == fields->end()) - { - return nullopt; - } - - auto value = std::move(it->second); - fields->erase(it); - return value; - } - - void ParagraphParser::required_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (const auto field = maybe_field.get()) - out = std::move(*field); - else - missing_fields.push_back(fieldname); - } - void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (auto field = maybe_field.get()) out = std::move(*field); - } - void ParagraphParser::required_field(const std::string& fieldname, std::string& out) - { - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - } - std::string ParagraphParser::optional_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - optional_field(fieldname, {out, ignore}); - return out; - } - std::string ParagraphParser::required_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - return out; - } - - std::unique_ptr ParagraphParser::error_info(const std::string& name) const - { - if (!fields.empty() || !missing_fields.empty()) - { - auto err = std::make_unique(); - err->name = name; - err->extra_fields["CONTROL"] = Util::extract_keys(fields); - err->missing_fields["CONTROL"] = std::move(missing_fields); - err->expected_types = std::move(expected_types); - return err; - } - return nullptr; - } - - template - static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) - { - std::vector ret; - parser.skip_whitespace(); - if (parser.at_eof()) return std::vector{}; - do - { - auto item = f(parser); - if (!item) return nullopt; - ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); - parser.skip_whitespace(); - if (parser.at_eof()) return {std::move(ret)}; - if (parser.cur() != ',') - { - parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); - return nullopt; - } - parser.next(); - parser.skip_whitespace(); - } while (true); - } - - ExpectedS> parse_default_features_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_qualified_specifier_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof( - "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_dependencies_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { - auto loc = parser.cur_loc(); - return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { - if (pqs.triplet) - { - parser.add_error("triplet specifier not allowed in this context", loc); - return nullopt; - } - return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; - }); - }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } -} - namespace vcpkg::Paragraphs { struct PghParser : private Parse::ParserBase @@ -218,7 +93,7 @@ namespace vcpkg::Paragraphs if (auto p = pghs.get()) { - if (p->size() != 1) return {"There should be exactly one paragraph", expected_right_tag}; + if (p->size() != 1) return std::error_code(ParagraphParseResult::EXPECTED_ONE_PARAGRAPH).message(); return std::move(p->front()); } else diff --git a/toolsrc/src/vcpkg/platform-expression.cpp b/toolsrc/src/vcpkg/platform-expression.cpp index 3490dbbe266e4c..fadb548c1802cd 100644 --- a/toolsrc/src/vcpkg/platform-expression.cpp +++ b/toolsrc/src/vcpkg/platform-expression.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -5,7 +7,6 @@ #include -#include #include #include @@ -414,28 +415,6 @@ namespace vcpkg::PlatformExpression return Visitor{context, override_ctxt}.visit(*this->underlying_); } - int Expr::complexity() const - { - if (is_empty()) return 0; - - struct Impl - { - int operator()(const std::unique_ptr& expr) const { return (*this)(*expr); } - int operator()(const detail::ExprImpl& expr) const - { - if (expr.kind == ExprKind::identifier) return 1; - - if (expr.kind == ExprKind::op_not) return 1 + (*this)(expr.exprs.at(0)); - - return 1 + std::accumulate(expr.exprs.begin(), expr.exprs.end(), 0, [](int acc, const auto& el) { - return acc + Impl{}(el); - }); - } - }; - - return Impl{}(underlying_); - } - ExpectedS parse_platform_expression(StringView expression, MultipleBinaryOperators multiple_binary_operators) { auto parser = ExpressionParser(expression, multiple_binary_operators); @@ -450,100 +429,4 @@ namespace vcpkg::PlatformExpression return res; } } - - bool structurally_equal(const Expr& lhs, const Expr& rhs) - { - struct Impl - { - bool operator()(const std::unique_ptr& lhs, - const std::unique_ptr& rhs) const - { - return (*this)(*lhs, *rhs); - } - bool operator()(const detail::ExprImpl& lhs, const detail::ExprImpl& rhs) const - { - if (lhs.kind != rhs.kind) return false; - - if (lhs.kind == ExprKind::identifier) - { - return lhs.identifier == rhs.identifier; - } - else - { - const auto& exprs_l = lhs.exprs; - const auto& exprs_r = rhs.exprs; - return std::equal(exprs_l.begin(), exprs_l.end(), exprs_r.begin(), exprs_r.end(), *this); - } - } - }; - - if (lhs.is_empty()) - { - return rhs.is_empty(); - } - if (rhs.is_empty()) - { - return false; - } - return Impl{}(lhs.underlying_, rhs.underlying_); - } - - int compare(const Expr& lhs, const Expr& rhs) - { - auto lhs_platform_complexity = lhs.complexity(); - auto rhs_platform_complexity = lhs.complexity(); - - if (lhs_platform_complexity < rhs_platform_complexity) return -1; - if (rhs_platform_complexity < lhs_platform_complexity) return 1; - - auto lhs_platform = to_string(lhs); - auto rhs_platform = to_string(rhs); - - if (lhs_platform.size() < rhs_platform.size()) return -1; - if (rhs_platform.size() < lhs_platform.size()) return 1; - - auto platform_cmp = lhs_platform.compare(rhs_platform); - if (platform_cmp < 0) return -1; - if (platform_cmp > 0) return 1; - - return 0; - } - - std::string to_string(const Expr& expr) - { - struct Impl - { - std::string operator()(const std::unique_ptr& expr) const - { - return (*this)(*expr, false); - } - std::string operator()(const detail::ExprImpl& expr, bool outer) const - { - const char* join = nullptr; - switch (expr.kind) - { - case ExprKind::identifier: return expr.identifier; - case ExprKind::op_and: join = " & "; break; - case ExprKind::op_or: join = " | "; break; - case ExprKind::op_not: return Strings::format("!%s", (*this)(expr.exprs.at(0))); - default: Checks::unreachable(VCPKG_LINE_INFO); - } - - if (outer) - { - return Strings::join(join, expr.exprs, *this); - } - else - { - return Strings::format("(%s)", Strings::join(join, expr.exprs, *this)); - } - } - }; - - if (expr.is_empty()) - { - return std::string{}; - } - return Impl{}(*expr.underlying_, true); - } } diff --git a/toolsrc/src/vcpkg/portfileprovider.cpp b/toolsrc/src/vcpkg/portfileprovider.cpp index 1376ad3bc89b06..707b763a414ef7 100644 --- a/toolsrc/src/vcpkg/portfileprovider.cpp +++ b/toolsrc/src/vcpkg/portfileprovider.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include @@ -86,7 +88,7 @@ namespace vcpkg::PortFileProvider { vcpkg::print_error_message(maybe_scf.error()); Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Failed to load port %s from %s", spec, ports_dir.u8string()); + VCPKG_LINE_INFO, "Error: Failed to load port from %s", spec, ports_dir.u8string()); } continue; @@ -128,7 +130,6 @@ namespace vcpkg::PortFileProvider // Reload cache with ports contained in all ports_dirs cache.clear(); std::vector ret; - for (auto&& ports_dir : ports_dirs) { // Try loading individual port diff --git a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp index 182625b7834ec1..e9215ed8ccb69e 100644 --- a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index a384cea0a9450c..f70876c2ed7dc3 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index 0d5b84280e932b..62e203b432c923 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include @@ -330,11 +332,4 @@ namespace vcpkg::Remove Checks::exit_success(VCPKG_LINE_INFO); } - - void RemoveCommand::perform_and_exit(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - Triplet default_triplet) const - { - Remove::perform_and_exit(args, paths, default_triplet); - } } diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index a336db7d184b51..8c86f167716ba1 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -14,57 +16,6 @@ namespace vcpkg { using namespace vcpkg::Parse; - template - static bool paragraph_equal(const Lhs& lhs, const Rhs& rhs) - { - return std::equal( - lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](const std::string& lhs, const std::string& rhs) { - return Strings::trim(StringView(lhs)) == Strings::trim(StringView(rhs)); - }); - } - - bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs) - { - if (lhs.name != rhs.name) return false; - if (lhs.version != rhs.version) return false; - if (lhs.port_version != rhs.port_version) return false; - if (!paragraph_equal(lhs.description, rhs.description)) return false; - if (!paragraph_equal(lhs.maintainers, rhs.maintainers)) return false; - if (lhs.homepage != rhs.homepage) return false; - if (lhs.documentation != rhs.documentation) return false; - if (lhs.dependencies != rhs.dependencies) return false; - if (lhs.default_features != rhs.default_features) return false; - if (lhs.license != rhs.license) return false; - - if (lhs.type != rhs.type) return false; - if (!structurally_equal(lhs.supports_expression, rhs.supports_expression)) return false; - - if (lhs.extra_info != rhs.extra_info) return false; - - return true; - } - - bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs) - { - if (lhs.name != rhs.name) return false; - if (lhs.dependencies != rhs.dependencies) return false; - if (!paragraph_equal(lhs.description, rhs.description)) return false; - if (lhs.extra_info != rhs.extra_info) return false; - - return true; - } - - bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs) - { - if (*lhs.core_paragraph != *rhs.core_paragraph) return false; - return std::equal(lhs.feature_paragraphs.begin(), - lhs.feature_paragraphs.end(), - rhs.feature_paragraphs.begin(), - rhs.feature_paragraphs.end(), - [](const std::unique_ptr& lhs, - const std::unique_ptr& rhs) { return *lhs == *rhs; }); - } - namespace SourceParagraphFields { static const std::string BUILD_DEPENDS = "Build-Depends"; @@ -246,117 +197,6 @@ namespace vcpkg } } - namespace - { - constexpr static struct Canonicalize - { - struct FeatureLess - { - bool operator()(const std::unique_ptr& lhs, - const std::unique_ptr& rhs) const - { - return (*this)(*lhs, *rhs); - } - bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const - { - return lhs.name < rhs.name; - } - }; - struct FeatureEqual - { - bool operator()(const std::unique_ptr& lhs, - const std::unique_ptr& rhs) const - { - return (*this)(*lhs, *rhs); - } - bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const - { - return lhs.name == rhs.name; - } - }; - - // assume canonicalized feature list - struct DependencyLess - { - bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) const - { - return (*this)(*lhs, *rhs); - } - bool operator()(const Dependency& lhs, const Dependency& rhs) const - { - auto cmp = lhs.name.compare(rhs.name); - if (cmp < 0) return true; - if (cmp > 0) return false; - - // same dependency name - - // order by platform string: - auto platform_cmp = compare(lhs.platform, rhs.platform); - if (platform_cmp < 0) return true; - if (platform_cmp > 0) return false; - - // then order by features - // smaller list first, then lexicographical - if (lhs.features.size() < rhs.features.size()) return true; - if (rhs.features.size() < lhs.features.size()) return false; - - // then finally order by feature list - if (std::lexicographical_compare( - lhs.features.begin(), lhs.features.end(), rhs.features.begin(), rhs.features.end())) - { - return true; - } - return false; - } - }; - - template - void operator()(std::unique_ptr& ptr) const - { - (*this)(*ptr); - } - - void operator()(Dependency& dep) const - { - std::sort(dep.features.begin(), dep.features.end()); - dep.extra_info.sort_keys(); - } - void operator()(SourceParagraph& spgh) const - { - std::for_each(spgh.dependencies.begin(), spgh.dependencies.end(), *this); - std::sort(spgh.dependencies.begin(), spgh.dependencies.end(), DependencyLess{}); - - std::sort(spgh.default_features.begin(), spgh.default_features.end()); - - spgh.extra_info.sort_keys(); - } - void operator()(FeatureParagraph& fpgh) const - { - std::for_each(fpgh.dependencies.begin(), fpgh.dependencies.end(), *this); - std::sort(fpgh.dependencies.begin(), fpgh.dependencies.end(), DependencyLess{}); - - fpgh.extra_info.sort_keys(); - } - void operator()(SourceControlFile& scf) const - { - (*this)(*scf.core_paragraph); - std::for_each(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), *this); - std::sort(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureLess{}); - - auto adjacent_equal = - std::adjacent_find(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureEqual{}); - if (adjacent_equal != scf.feature_paragraphs.end()) - { - Checks::exit_with_message(VCPKG_LINE_INFO, - R"(Multiple features with the same name for port %s: %s - This is invalid; please make certain that features have distinct names.)", - scf.core_paragraph->name, - (*adjacent_equal)->name); - } - } - } canonicalize{}; - } - static ParseExpected parse_source_paragraph(const fs::path& path_to_control, Paragraph&& fields) { auto origin = path_to_control.u8string(); @@ -471,7 +311,6 @@ namespace vcpkg return std::move(maybe_feature).error(); } - canonicalize(*control_file); return control_file; } @@ -512,21 +351,6 @@ namespace vcpkg StringView type_name_; }; - struct NaturalNumberField : Json::VisitorCrtpBase - { - using type = int; - StringView type_name() { return "a natural number"; } - - Optional visit_integer(Json::Reader&, StringView, int64_t value) - { - if (value > std::numeric_limits::max() || value < 0) - { - return nullopt; - } - return static_cast(value); - } - }; - struct BooleanField : Json::VisitorCrtpBase { using type = bool; @@ -600,12 +424,6 @@ namespace vcpkg // strings with uppercase letters from the basic check static const std::regex RESERVED = std::regex(R"(prn|aux|nul|con|(lpt|com)[1-9]|core|default)"); - // back-compat - if (sv == "all_modules") - { - return true; - } - if (!std::regex_match(sv.begin(), sv.end(), BASIC_IDENTIFIER)) { return false; // we're not even in the shape of an identifier @@ -833,11 +651,11 @@ namespace vcpkg using type = Dependency; StringView type_name() { return "a dependency"; } - constexpr static StringLiteral NAME = "name"; - constexpr static StringLiteral FEATURES = "features"; - constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; - constexpr static StringLiteral PLATFORM = "platform"; - const static StringView KNOWN_FIELDS[4]; // not constexpr in MSVC 2015 + constexpr static StringView NAME = "name"; + constexpr static StringView FEATURES = "features"; + constexpr static StringView DEFAULT_FEATURES = "default-features"; + constexpr static StringView PLATFORM = "platform"; + constexpr static StringView KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; Optional visit_string(Json::Reader&, StringView, StringView sv) { @@ -862,15 +680,6 @@ namespace vcpkg } Dependency dep; - - for (const auto& el : obj) - { - if (Strings::starts_with(el.first, "$")) - { - dep.extra_info.insert_or_replace(el.first.to_string(), el.second); - } - } - r.required_object_field(type_name(), obj, NAME, dep.name, PackageNameField{}); r.optional_object_field( obj, FEATURES, dep.features, ArrayField{"an array of identifiers", AllowEmpty::Yes}); @@ -887,38 +696,20 @@ namespace vcpkg return dep; } }; - const StringView DependencyField::KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; struct FeatureField : Json::VisitorCrtpBase { using type = std::unique_ptr; StringView type_name() { return "a feature"; } - constexpr static StringLiteral NAME = "name"; - constexpr static StringLiteral DESCRIPTION = "description"; - constexpr static StringLiteral DEPENDENCIES = "dependencies"; - const static StringView KNOWN_FIELDS[3]; // Not constexpr in MSVC 2015 + constexpr static StringView NAME = "name"; + constexpr static StringView DESCRIPTION = "description"; + constexpr static StringView DEPENDENCIES = "dependencies"; Optional> visit_object(Json::Reader& r, StringView, const Json::Object& obj) { - { - auto extra_fields = invalid_json_fields(obj, KNOWN_FIELDS); - if (!extra_fields.empty()) - { - r.error().add_extra_fields(type_name().to_string(), std::move(extra_fields)); - } - } - auto feature = std::make_unique(); - for (const auto& el : obj) - { - if (Strings::starts_with(el.first, "$")) - { - feature->extra_info.insert_or_replace(el.first.to_string(), el.second); - } - } - r.required_object_field(type_name(), obj, NAME, feature->name, IdentifierField{}); r.required_object_field(type_name(), obj, DESCRIPTION, feature->description, ParagraphField{}); r.optional_object_field(obj, @@ -929,7 +720,6 @@ namespace vcpkg return std::move(feature); } }; - const StringView FeatureField::KNOWN_FIELDS[] = {NAME, DESCRIPTION, DEPENDENCIES}; Parse::ParseExpected SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest, const Json::Object& manifest) @@ -978,21 +768,11 @@ namespace vcpkg control_file->core_paragraph = std::make_unique(); auto& spgh = control_file->core_paragraph; - spgh->type = Type{Type::PORT}; - - for (const auto& el : manifest) - { - if (Strings::starts_with(el.first, "$")) - { - spgh->extra_info.insert_or_replace(el.first.to_string(), el.second); - } - } constexpr static StringView type_name = "vcpkg.json"; visit.required_object_field(type_name, manifest, ManifestFields::NAME, spgh->name, IdentifierField{}); visit.required_object_field( type_name, manifest, ManifestFields::VERSION, spgh->version, StringField{"a version"}); - visit.optional_object_field(manifest, ManifestFields::PORT_VERSION, spgh->port_version, NaturalNumberField{}); visit.optional_object_field(manifest, ManifestFields::MAINTAINERS, spgh->maintainers, ParagraphField{}); visit.optional_object_field(manifest, ManifestFields::DESCRIPTION, spgh->description, ParagraphField{}); visit.optional_object_field(manifest, ManifestFields::HOMEPAGE, spgh->homepage, StringField{"a url"}); @@ -1026,7 +806,6 @@ namespace vcpkg return std::make_unique(std::move(err.pcei)); } - canonicalize(*control_file); return std::move(control_file); } @@ -1066,147 +845,4 @@ namespace vcpkg } return ret; } - - static Json::Object serialize_manifest_impl(const SourceControlFile& scf, bool debug) - { - auto serialize_paragraph = - [&](Json::Object& obj, StringLiteral name, const std::vector& pgh, bool always = false) { - if (!debug) - { - if (pgh.empty()) - { - if (always) - { - obj.insert(name, Json::Array()); - } - return; - } - if (pgh.size() == 1) - { - obj.insert(name, Json::Value::string(pgh.front())); - return; - } - } - - auto& arr = obj.insert(name, Json::Array()); - for (const auto& s : pgh) - { - arr.push_back(Json::Value::string(s)); - } - }; - auto serialize_optional_array = - [&](Json::Object& obj, StringLiteral name, const std::vector& pgh) { - if (pgh.empty() && !debug) return; - - auto& arr = obj.insert(name, Json::Array()); - for (const auto& s : pgh) - { - arr.push_back(Json::Value::string(s)); - } - }; - auto serialize_optional_string = [&](Json::Object& obj, StringLiteral name, const std::string& s) { - if (!s.empty() || debug) - { - obj.insert(name, Json::Value::string(s)); - } - }; - auto serialize_dependency = [&](Json::Array& arr, const Dependency& dep) { - if (dep.features.empty() && dep.platform.is_empty() && dep.extra_info.is_empty()) - { - arr.push_back(Json::Value::string(dep.name)); - } - else - { - auto& dep_obj = arr.push_back(Json::Object()); - for (const auto& el : dep.extra_info) - { - dep_obj.insert(el.first.to_string(), el.second); - } - - dep_obj.insert(DependencyField::NAME, Json::Value::string(dep.name)); - - auto features_copy = dep.features; - auto core_it = std::find(features_copy.begin(), features_copy.end(), "core"); - if (core_it != features_copy.end()) - { - dep_obj.insert(DependencyField::DEFAULT_FEATURES, Json::Value::boolean(false)); - features_copy.erase(core_it); - } - - serialize_optional_array(dep_obj, DependencyField::FEATURES, features_copy); - serialize_optional_string(dep_obj, DependencyField::PLATFORM, to_string(dep.platform)); - } - }; - - Json::Object obj; - - for (const auto& el : scf.core_paragraph->extra_info) - { - obj.insert(el.first.to_string(), el.second); - } - - obj.insert(ManifestFields::NAME, Json::Value::string(scf.core_paragraph->name)); - obj.insert(ManifestFields::VERSION, Json::Value::string(scf.core_paragraph->version)); - - if (scf.core_paragraph->port_version != 0 || debug) - { - obj.insert(ManifestFields::PORT_VERSION, Json::Value::integer(scf.core_paragraph->port_version)); - } - - serialize_paragraph(obj, ManifestFields::MAINTAINERS, scf.core_paragraph->maintainers); - serialize_paragraph(obj, ManifestFields::DESCRIPTION, scf.core_paragraph->description); - - serialize_optional_string(obj, ManifestFields::HOMEPAGE, scf.core_paragraph->homepage); - serialize_optional_string(obj, ManifestFields::DOCUMENTATION, scf.core_paragraph->documentation); - serialize_optional_string(obj, ManifestFields::LICENSE, scf.core_paragraph->license); - serialize_optional_string(obj, ManifestFields::SUPPORTS, to_string(scf.core_paragraph->supports_expression)); - - if (!scf.core_paragraph->dependencies.empty() || debug) - { - auto& deps = obj.insert(ManifestFields::DEPENDENCIES, Json::Array()); - - for (const auto& dep : scf.core_paragraph->dependencies) - { - serialize_dependency(deps, dep); - } - } - - serialize_optional_array(obj, ManifestFields::DEFAULT_FEATURES, scf.core_paragraph->default_features); - - if (!scf.feature_paragraphs.empty() || debug) - { - auto& arr = obj.insert(ManifestFields::FEATURES, Json::Array()); - for (const auto& feature : scf.feature_paragraphs) - { - auto& feature_obj = arr.push_back(Json::Object()); - for (const auto& el : feature->extra_info) - { - feature_obj.insert(el.first.to_string(), el.second); - } - - feature_obj.insert(FeatureField::NAME, Json::Value::string(feature->name)); - serialize_paragraph(feature_obj, FeatureField::DESCRIPTION, feature->description, true); - - if (!feature->dependencies.empty() || debug) - { - auto& deps = feature_obj.insert(FeatureField::DEPENDENCIES, Json::Array()); - for (const auto& dep : feature->dependencies) - { - serialize_dependency(deps, dep); - } - } - } - } - - if (debug) - { - obj.insert("TYPE", Json::Value::string(Type::to_string(scf.core_paragraph->type))); - } - - return obj; - } - - Json::Object serialize_debug_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, true); } - - Json::Object serialize_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, false); } } diff --git a/toolsrc/src/vcpkg/statusparagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp index ba4b6f9bdb586e..398129a0484a51 100644 --- a/toolsrc/src/vcpkg/statusparagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/statusparagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp index ba181522483bbb..d282a5ccbea959 100644 --- a/toolsrc/src/vcpkg/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -1,8 +1,8 @@ +#include "pch.h" + #include -#include #include -#include namespace vcpkg { @@ -145,42 +145,4 @@ namespace vcpkg out_str.push_back('\n'); } } - - Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths) - { - const auto& fs = paths.get_filesystem(); - Json::Object iobj; - iobj.insert("version-string", Json::Value::string(ipv.core->package.version)); - iobj.insert("port-version", Json::Value::integer(ipv.core->package.port_version)); - iobj.insert("triplet", Json::Value::string(ipv.spec().triplet().to_string())); - iobj.insert("abi", Json::Value::string(ipv.core->package.abi)); - Json::Array deps; - for (auto&& dep : ipv.dependencies()) - deps.push_back(Json::Value::string(dep.to_string())); - if (deps.size() != 0) - { - iobj.insert("dependencies", std::move(deps)); - } - Json::Array features; - for (auto&& feature : ipv.features) - { - features.push_back(Json::Value::string(feature->package.feature)); - } - if (features.size() != 0) - { - iobj.insert("features", std::move(features)); - } - auto usage = Install::get_cmake_usage(ipv.core->package, paths); - if (!usage.message.empty()) - { - iobj.insert("usage", Json::Value::string(std::move(usage.message))); - } - auto owns_files = fs.read_lines(paths.listfile_path(ipv.core->package)).value_or_exit(VCPKG_LINE_INFO); - Json::Array owns; - for (auto&& owns_file : owns_files) - owns.push_back(Json::Value::string(std::move(owns_file))); - - iobj.insert("owns", std::move(owns)); - return Json::Value::object(std::move(iobj)); - } } diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 1d5a682c6c8f6a..9098cb135fd0cc 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -81,12 +83,8 @@ namespace vcpkg const bool has_tool_entry = std::regex_search(XML.cbegin(), XML.cend(), match_tool_entry, tool_regex); if (!has_tool_entry) { - return Strings::format("Could not automatically acquire %s because there is no entry in %s for os=%s. You " - "may be able to install %s via your system package manager.", - tool, - XML_PATH.u8string(), - OS_STRING, - tool); + return Strings::format( + "Could not find entry for tool %s in %s for os=%s", tool, XML_PATH.u8string(), OS_STRING); } const std::string tool_data = diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp index c9ae7497042625..f9438c00afe871 100644 --- a/toolsrc/src/vcpkg/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -1,7 +1,8 @@ +#include "pch.h" + #include #include -#include namespace vcpkg { @@ -28,9 +29,25 @@ namespace std namespace vcpkg { + static std::unordered_set g_triplet_instances; + + const Triplet Triplet::X86_WINDOWS = from_canonical_name("x86-windows"); + const Triplet Triplet::X64_WINDOWS = from_canonical_name("x64-windows"); + const Triplet Triplet::ARM_WINDOWS = from_canonical_name("arm-windows"); + const Triplet Triplet::ARM64_WINDOWS = from_canonical_name("arm64-windows"); + const Triplet Triplet::X86_UWP = from_canonical_name("x86-uwp"); + const Triplet Triplet::X64_UWP = from_canonical_name("x64-uwp"); + const Triplet Triplet::ARM_UWP = from_canonical_name("arm-uwp"); + const Triplet Triplet::ARM64_UWP = from_canonical_name("arm64-uwp"); + + // + const Triplet Triplet::ARM_ANDROID = from_canonical_name("arm-android"); + const Triplet Triplet::ARM64_ANDROID = from_canonical_name("arm64-android"); + const Triplet Triplet::X86_ANDROID = from_canonical_name("x86-android"); + const Triplet Triplet::X64_ANDROID = from_canonical_name("x64-android"); + Triplet Triplet::from_canonical_name(std::string&& triplet_as_string) { - static std::unordered_set g_triplet_instances; std::string s(Strings::ascii_to_lowercase(std::move(triplet_as_string))); const auto p = g_triplet_instances.emplace(std::move(s)); return &*p.first; @@ -45,19 +62,19 @@ namespace vcpkg Optional Triplet::guess_architecture() const noexcept { using System::CPUArchitecture; - if (Strings::starts_with(this->canonical_name(), "x86-")) + if (*this == X86_WINDOWS || *this == X86_UWP || *this == X86_ANDROID) { return CPUArchitecture::X86; } - if (Strings::starts_with(this->canonical_name(), "x64-")) + else if (*this == X64_WINDOWS || *this == X64_UWP || *this == X64_ANDROID) { return CPUArchitecture::X64; } - if (Strings::starts_with(this->canonical_name(), "arm-")) + else if (*this == ARM_WINDOWS || *this == ARM_UWP || *this == ARM_ANDROID) { return CPUArchitecture::ARM; } - if (Strings::starts_with(this->canonical_name(), "arm64-")) + else if (*this == ARM64_WINDOWS || *this == ARM64_UWP || *this == ARM64_ANDROID) { return CPUArchitecture::ARM64; } @@ -81,7 +98,7 @@ namespace vcpkg else { #if defined(_WIN32) - return Triplet::from_canonical_name("x86-windows"); + return Triplet::X86_WINDOWS; #elif defined(__APPLE__) return Triplet::from_canonical_name("x64-osx"); #elif defined(__FreeBSD__) diff --git a/toolsrc/src/vcpkg/update.cpp b/toolsrc/src/vcpkg/update.cpp index 48471e26c399c4..3a269ea7aeac29 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include @@ -85,9 +87,4 @@ namespace vcpkg::Update Checks::exit_success(VCPKG_LINE_INFO); } - - void UpdateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const - { - Update::perform_and_exit(args, paths); - } } diff --git a/toolsrc/src/vcpkg/userconfig.cpp b/toolsrc/src/vcpkg/userconfig.cpp index 5236a3c3b62c28..32588b2bbfbc7d 100644 --- a/toolsrc/src/vcpkg/userconfig.cpp +++ b/toolsrc/src/vcpkg/userconfig.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 7377baafb33b71..280faae0d80f19 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -1,8 +1,9 @@ +#include "pch.h" + #include #include #include -#include #include #include #include @@ -308,7 +309,6 @@ namespace vcpkg {FEATURE_PACKAGES_SWITCH, &VcpkgCmdArguments::feature_packages}, {BINARY_CACHING_SWITCH, &VcpkgCmdArguments::binary_caching}, {WAIT_FOR_LOCK_SWITCH, &VcpkgCmdArguments::wait_for_lock}, - {JSON_SWITCH, &VcpkgCmdArguments::json}, }; bool found = false; @@ -605,13 +605,12 @@ namespace vcpkg void VcpkgCmdArguments::append_common_options(HelpTableFormatter& table) { static auto opt = [](StringView arg, StringView joiner, StringView value) { - return Strings::concat("--", arg, joiner, value); + return Strings::format("--%s%s%s", arg, joiner, value); }; table.format(opt(TRIPLET_ARG, " ", ""), "Specify the target architecture triplet. See 'vcpkg help triplet'"); table.format("", "(default: " + format_environment_variable("VCPKG_DEFAULT_TRIPLET") + ')'); table.format(opt(OVERLAY_PORTS_ARG, "=", ""), "Specify directories to be used when searching for ports"); - table.format("", "(also: " + format_environment_variable("VCPKG_OVERLAY_PORTS") + ')'); table.format(opt(OVERLAY_TRIPLETS_ARG, "=", ""), "Specify directories containing triplets files"); table.format(opt(BINARY_SOURCES_ARG, "=", ""), "Add sources for binary caching. See 'vcpkg help binarycaching'"); @@ -624,7 +623,6 @@ namespace vcpkg table.format(opt(INSTALL_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the install root directory"); table.format(opt(PACKAGES_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the packages root directory"); table.format(opt(SCRIPTS_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the scripts root directory"); - table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output"); } void VcpkgCmdArguments::imbue_from_environment() @@ -647,19 +645,6 @@ namespace vcpkg } } - { - const auto vcpkg_overlay_ports_env = System::get_environment_variable(OVERLAY_PORTS_ENV); - if (const auto unpacked = vcpkg_overlay_ports_env.get()) - { -#ifdef WIN32 - auto overlays = Strings::split(*unpacked, ';'); -#else - auto overlays = Strings::split(*unpacked, ':'); -#endif - overlay_ports.insert(std::end(overlay_ports), std::begin(overlays), std::end(overlays)); - } - } - if (!vcpkg_root_dir) { const auto vcpkg_root_env = System::get_environment_variable(VCPKG_ROOT_DIR_ENV); diff --git a/toolsrc/src/vcpkg/vcpkglib.cpp b/toolsrc/src/vcpkg/vcpkglib.cpp index a158cf74ba5349..ce9c6273418867 100644 --- a/toolsrc/src/vcpkg/vcpkglib.cpp +++ b/toolsrc/src/vcpkg/vcpkglib.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -172,6 +174,7 @@ namespace vcpkg { std::map ipv_map; + std::vector installed_packages; for (auto&& pgh : status_db) { if (!pgh->is_installed()) continue; diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index 4f7ef7141e4551..4837c4b713083e 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include #include @@ -5,14 +7,11 @@ #include #include -#include #include #include #include #include #include -#include -#include #include #include @@ -166,7 +165,7 @@ namespace vcpkg else { // we ignore the manifest root dir if the user requests -manifest - if (!manifest_root_dir.empty() && !args.manifest_mode.has_value() && !args.output_json()) + if (!manifest_root_dir.empty() && !args.manifest_mode.has_value()) { System::print2(System::Color::warning, "Warning: manifest-root detected at ", diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp index c419745c2837f1..b3e5b2590fea6b 100644 --- a/toolsrc/src/vcpkg/versiont.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #include #include diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index 023844d0b91dd0..a9a5d5565fed2e 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -1,3 +1,5 @@ +#include "pch.h" + #if defined(_WIN32) #include diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln new file mode 100644 index 00000000000000..7f51e701fad235 --- /dev/null +++ b/toolsrc/vcpkg.sln @@ -0,0 +1,105 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgtest", "vcpkgtest\vcpkgtest.vcxproj", "{F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F5893B21-EA71-4432-84D6-5FB0E0461A2A}" + ProjectSection(SolutionItems) = preProject + ..\scripts\bootstrap.ps1 = ..\scripts\bootstrap.ps1 + ..\scripts\get_triplet_environment.cmake = ..\scripts\get_triplet_environment.cmake + ..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1 + ..\scripts\ports.cmake = ..\scripts\ports.cmake + ..\scripts\vcpkgTools.xml = ..\scripts\vcpkgTools.xml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}" + ProjectSection(SolutionItems) = preProject + ..\scripts\cmake\vcpkg_acquire_msys.cmake = ..\scripts\cmake\vcpkg_acquire_msys.cmake + ..\scripts\cmake\vcpkg_apply_patches.cmake = ..\scripts\cmake\vcpkg_apply_patches.cmake + ..\scripts\cmake\vcpkg_build_cmake.cmake = ..\scripts\cmake\vcpkg_build_cmake.cmake + ..\scripts\cmake\vcpkg_build_msbuild.cmake = ..\scripts\cmake\vcpkg_build_msbuild.cmake + ..\scripts\cmake\vcpkg_build_qmake.cmake = ..\scripts\cmake\vcpkg_build_qmake.cmake + ..\scripts\cmake\vcpkg_common_functions.cmake = ..\scripts\cmake\vcpkg_common_functions.cmake + ..\scripts\cmake\vcpkg_configure_cmake.cmake = ..\scripts\cmake\vcpkg_configure_cmake.cmake + ..\scripts\cmake\vcpkg_configure_meson.cmake = ..\scripts\cmake\vcpkg_configure_meson.cmake + ..\scripts\cmake\vcpkg_configure_qmake.cmake = ..\scripts\cmake\vcpkg_configure_qmake.cmake + ..\scripts\cmake\vcpkg_copy_pdbs.cmake = ..\scripts\cmake\vcpkg_copy_pdbs.cmake + ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake = ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake + ..\scripts\cmake\vcpkg_download_distfile.cmake = ..\scripts\cmake\vcpkg_download_distfile.cmake + ..\scripts\cmake\vcpkg_execute_required_process.cmake = ..\scripts\cmake\vcpkg_execute_required_process.cmake + ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake = ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake + ..\scripts\cmake\vcpkg_extract_source_archive.cmake = ..\scripts\cmake\vcpkg_extract_source_archive.cmake + ..\scripts\cmake\vcpkg_find_acquire_program.cmake = ..\scripts\cmake\vcpkg_find_acquire_program.cmake + ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake = ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake + ..\scripts\cmake\vcpkg_from_bitbucket.cmake = ..\scripts\cmake\vcpkg_from_bitbucket.cmake + ..\scripts\cmake\vcpkg_from_github.cmake = ..\scripts\cmake\vcpkg_from_github.cmake + ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake = ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake + ..\scripts\cmake\vcpkg_get_windows_sdk.cmake = ..\scripts\cmake\vcpkg_get_windows_sdk.cmake + ..\scripts\cmake\vcpkg_install_cmake.cmake = ..\scripts\cmake\vcpkg_install_cmake.cmake + ..\scripts\cmake\vcpkg_install_meson.cmake = ..\scripts\cmake\vcpkg_install_meson.cmake + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BCE555DF-F471-4ACC-98E5-76CBE8E8F79E}" + ProjectSection(SolutionItems) = preProject + vcpkg.natvis = vcpkg.natvis + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.ActiveCfg = Debug|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.Build.0 = Debug|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.ActiveCfg = Debug|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.Build.0 = Debug|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.ActiveCfg = Release|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.Build.0 = Debug|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.ActiveCfg = Release|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.Build.0 = Debug|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.ActiveCfg = Release|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.Build.0 = Release|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.ActiveCfg = Release|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.Build.0 = Release|Win32 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.ActiveCfg = Debug|x64 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.Build.0 = Debug|x64 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.ActiveCfg = Debug|Win32 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.Build.0 = Debug|Win32 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.ActiveCfg = Release|x64 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.Build.0 = Release|x64 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.ActiveCfg = Release|Win32 + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A0122231-04D5-420B-81CA-7960946E5E65} = {F5893B21-EA71-4432-84D6-5FB0E0461A2A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DEDCC7AF-0FE6-4387-9FFE-495D6C1AEE1B} + EndGlobalSection +EndGlobal diff --git a/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj similarity index 92% rename from toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj rename to toolsrc/vcpkg/vcpkg.vcxproj index b6229d9a3fb115..917cd3b9c86123 100644 --- a/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\..\include + ..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\..\include + ..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\..\include + ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\..\include + ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -139,10 +139,10 @@ - + - + diff --git a/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters similarity index 88% rename from toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters rename to toolsrc/vcpkg/vcpkg.vcxproj.filters index 3710939ca920b3..3821d89b399d94 100644 --- a/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters @@ -15,12 +15,12 @@ - + Source Files - + Source Files diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj new file mode 100644 index 00000000000000..b955e435783794 --- /dev/null +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -0,0 +1,301 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {B98C92B7-2874-4537-9D46-D14E5C237F04} + vcpkglib + 8.1 + v140 + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + 0 + + + + + + + + + $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x86.debug\ + + + $(SolutionDir)msbuild.x86.release\ + $(SolutionDir)msbuild.x86.release\$(ProjectName)\ + + + $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x64.debug\ + + + $(SolutionDir)msbuild.x64.release\$(ProjectName)\ + $(SolutionDir)msbuild.x64.release\ + + + + Level4 + Disabled + true + ..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + false + + + + + Level4 + Disabled + true + ..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + false + + + + + Level3 + MaxSpeed + true + true + true + ..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + + + true + true + + + + + Level3 + MaxSpeed + true + true + true + ..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters new file mode 100644 index 00000000000000..5c5beb540527a4 --- /dev/null +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -0,0 +1,462 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {69f6b6e6-5ac4-4419-a256-b8a6b0392720} + + + {4a229410-0d09-4dab-953b-f434d6483f96} + + + {75592043-ab63-4905-beee-568a6ab8bf93} + + + {fa1f10e7-58d2-4f7c-ac26-a979baa70061} + + + + + Source Files + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + + + Header Files + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + diff --git a/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj similarity index 93% rename from toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj rename to toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 027ef1917b50fe..9e2e8c08ac122e 100644 --- a/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\..\include + ..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\..\include + ..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\..\include + ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\..\include + ..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -134,7 +134,7 @@ - + diff --git a/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters similarity index 90% rename from toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters rename to toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters index d103d50c26ed8b..ad56c0c7214e35 100644 --- a/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj new file mode 100644 index 00000000000000..07e10e1a431b56 --- /dev/null +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + {b98c92b7-2874-4537-9d46-d14e5c237f04} + + + + + + + + + {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D} + Win32Proj + vcpkgtest + 8.1 + v140 + + + + Application + true + Unicode + false + + + Application + false + true + Unicode + false + + + Application + true + Unicode + false + + + Application + false + true + Unicode + false + + + + + + + + + $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x86.debug\ + + + $(SolutionDir)msbuild.x86.release\ + $(SolutionDir)msbuild.x86.release\$(ProjectName)\ + + + $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x64.debug\ + + + $(SolutionDir)msbuild.x64.release\$(ProjectName)\ + $(SolutionDir)msbuild.x64.release\ + + + true + + + true + + + + + + Level4 + Disabled + ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + true + /std:c++latest %(AdditionalOptions) + true + false + + + Console + $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) + + + + + Level4 + Disabled + ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) + _DEBUG;%(PreprocessorDefinitions) + true + /std:c++latest %(AdditionalOptions) + true + false + + + Console + $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + true + /std:c++latest %(AdditionalOptions) + true + false + + + Console + true + true + $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) + NDEBUG;%(PreprocessorDefinitions) + true + /std:c++latest %(AdditionalOptions) + true + false + + + Console + true + true + $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) + + + + + + diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters new file mode 100644 index 00000000000000..481fe3b6e79ba5 --- /dev/null +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters @@ -0,0 +1,69 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/toolsrc/windows-bootstrap/vcpkg.sln b/toolsrc/windows-bootstrap/vcpkg.sln deleted file mode 100644 index 51dc3649eb5cbd..00000000000000 --- a/toolsrc/windows-bootstrap/vcpkg.sln +++ /dev/null @@ -1,56 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30330.147 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E4FAF582-0DB7-4CF5-BAE0-E2D38C48593B}" - ProjectSection(SolutionItems) = preProject - ..\vcpkg.natvis = ..\vcpkg.natvis - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.ActiveCfg = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.Build.0 = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.ActiveCfg = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.Build.0 = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.ActiveCfg = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.Build.0 = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.ActiveCfg = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.Build.0 = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.ActiveCfg = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.Build.0 = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.ActiveCfg = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {030760DE-1214-461B-B241-39608AD6FB66} - EndGlobalSection -EndGlobal diff --git a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj deleted file mode 100644 index 909f6e87064083..00000000000000 --- a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj +++ /dev/null @@ -1,331 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {B98C92B7-2874-4537-9D46-D14E5C237F04} - vcpkglib - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - 0 - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - - Level4 - Disabled - true - ..\..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - pch.h - false - - - - - Level4 - Disabled - true - ..\..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - pch.h - false - - - - - Level3 - MaxSpeed - true - true - true - ..\..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - pch.h - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - pch.h - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters deleted file mode 100644 index f1772fa5f8ceb6..00000000000000 --- a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters +++ /dev/null @@ -1,540 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {69f6b6e6-5ac4-4419-a256-b8a6b0392720} - - - {4a229410-0d09-4dab-953b-f434d6483f96} - - - {75592043-ab63-4905-beee-568a6ab8bf93} - - - {fa1f10e7-58d2-4f7c-ac26-a979baa70061} - - - - - Source Files - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - - - Header Files - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - diff --git a/triplets/community/arm64-osx.cmake b/triplets/community/arm64-osx.cmake index 62325a696759f3..44c0b2852af1e1 100644 --- a/triplets/community/arm64-osx.cmake +++ b/triplets/community/arm64-osx.cmake @@ -3,4 +3,3 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/triplets/community/s390x-linux.cmake b/triplets/community/s390x-linux.cmake deleted file mode 100644 index 0aaefda4e34d16..00000000000000 --- a/triplets/community/s390x-linux.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(VCPKG_TARGET_ARCHITECTURE s390x) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Linux) From 98ecc0c407375912059811efded8e22cd996e7eb Mon Sep 17 00:00:00 2001 From: jgehw <44170764+jgehw@users.noreply.github.com> Date: Tue, 18 Aug 2020 19:24:07 +0200 Subject: [PATCH 10/95] Revert "Revert "incorporate changes from microsoft:master"" --- .gitattributes | 4 + .gitignore | 56 +- README.md | 2 +- .../examples/installing-and-using-packages.md | 8 +- .../overlay-triplets-linux-dynamic.md | 8 +- docs/maintainers/maintainer-guide.md | 28 + docs/maintainers/vcpkg_check_linkage.md | 4 +- docs/users/config-environment.md | 10 +- ports/3fd/vcpkg.json | 4 +- .../abseil/fix-cmake-threads-dependency.patch | 13 + ports/abseil/portfile.cmake | 5 +- ports/abseil/vcpkg.json | 4 +- ports/akali/CONTROL | 3 +- ports/alembic/CONTROL | 2 +- ports/alembic/fix-C1083.patch | 49 - ports/alembic/fix-find-openexr-ilmbase.patch | 351 +-- ports/alembic/portfile.cmake | 20 +- ports/apr/CONTROL | 3 +- ports/apr/portfile.cmake | 2 +- ports/argparse/vcpkg.json | 4 +- ports/argtable3/CONTROL | 4 - ports/argtable3/fix-cmake.patch | 98 - ports/argtable3/portfile.cmake | 25 +- ports/argtable3/vcpkg.json | 6 + ports/armadillo/CONTROL | 5 +- ports/arrow/CONTROL | 4 +- ports/arrow/all.patch | 146 +- ports/arrow/portfile.cmake | 14 +- ports/asiosdk/CONTROL | 2 +- ports/asiosdk/vcpkg-cmake-wrapper.cmake | 4 +- ports/asmjit/CONTROL | 2 +- ports/asmjit/portfile.cmake | 20 +- ports/audiofile/portfile.cmake | 13 + ports/audiofile/vcpkg.json | 7 + ports/avisynthplus/vcpkg.json | 2 +- ports/avro-cpp/CONTROL | 9 + ports/avro-cpp/install.patch | 100 + ports/avro-cpp/portfile.cmake | 35 + ports/azure-c-shared-utility/CONTROL | 4 +- ports/azure-c-shared-utility/portfile.cmake | 4 +- ports/azure-iot-sdk-c/CONTROL | 3 +- ports/azure-iot-sdk-c/portfile.cmake | 6 +- ports/azure-uamqp-c/CONTROL | 2 +- ports/azure-uamqp-c/portfile.cmake | 4 +- ports/azure-uhttp-c/CONTROL | 2 +- ports/azure-uhttp-c/portfile.cmake | 4 +- ports/azure-umqtt-c/CONTROL | 2 +- ports/azure-umqtt-c/portfile.cmake | 4 +- ports/blaze/CONTROL | 3 +- ports/blend2d/portfile.cmake | 8 +- ports/blend2d/vcpkg.json | 17 +- ports/bond/CONTROL | 2 +- ports/bond/fix-install-path.patch | 6 +- ports/bond/portfile.cmake | 6 +- ports/boost-asio/CONTROL | 3 +- ports/boost-build/CONTROL | 3 +- ports/boost-build/portfile.cmake | 2 +- ports/boost-context/CONTROL | 4 +- ports/boost-coroutine/CONTROL | 2 + ports/boost-fiber/CONTROL | 2 + ports/boost-filesystem/CONTROL | 2 + ports/boost-graph-parallel/CONTROL | 3 +- ports/boost-iostreams/CONTROL | 2 + ports/boost-locale/CONTROL | 4 +- ports/boost-log/CONTROL | 2 + .../boost-modular-build-helper/CMakeLists.txt | 13 +- ports/boost-modular-build-helper/CONTROL | 2 +- ports/boost-modular-build-helper/Jamroot.jam | 33 +- .../boost-modular-build.cmake | 39 +- ports/boost-mpi/CONTROL | 3 +- ports/boost-parameter-python/CONTROL | 3 +- ports/boost-poly-collection/CONTROL | 3 +- ports/boost-python/CONTROL | 2 + ports/boost-safe-numerics/CONTROL | 3 +- ports/boost-stacktrace/CONTROL | 2 + ports/boost-test/CONTROL | 2 + ports/boost-wave/CONTROL | 2 + ports/boost/CONTROL | 4 +- ports/brotli/CONTROL | 3 +- ports/brotli/pkgconfig.patch | 73 + ports/brotli/portfile.cmake | 3 + ports/brpc/CONTROL | 6 + ports/brpc/fix_boost_ptr.patch | 14 + ports/brpc/fix_thrift.patch | 28 + ports/brpc/portfile.cmake | 31 + ports/bzip2/CONTROL | 9 +- ports/bzip2/bzip2.pc.in | 11 + ports/bzip2/portfile.cmake | 95 +- ports/cairo/CMakeLists.txt | 2 +- ports/cairo/CONTROL | 3 +- ports/cairomm/CMakeLists.txt | 3 +- ports/cairomm/CONTROL | 3 +- ports/ceres/CONTROL | 5 +- ports/cgal/CONTROL | 2 +- ports/cgal/portfile.cmake | 4 +- ports/clapack/CONTROL | 3 +- ports/clapack/portfile.cmake | 6 +- ports/colmap/portfile.cmake | 89 + ports/colmap/usage | 10 + ports/colmap/vcpkg.json | 55 + ports/constexpr-contracts/CONTROL | 4 + ports/constexpr-contracts/portfile.cmake | 20 + ports/coroutine/CONTROL | 6 - ports/coroutine/fix-errorC7651.patch | 68 + ports/coroutine/portfile.cmake | 1 + ports/coroutine/vcpkg.json | 11 + ports/cppad/CONTROL | 5 + ports/cppad/pkgconfig-fix.patch | 63 + ports/cppad/portfile.cmake | 42 + ports/cppad/windows-fix.patch | 105 + ...001-add-install-target-and-find-deps.patch | 809 +++++++ ports/crashrpt/CONTROL | 16 + ports/crashrpt/portfile.cmake | 53 + ports/cudnn/CONTROL | 1 + ports/cudnn/FindCUDNN.cmake | 5 + ports/cudnn/vcpkg-cmake-wrapper.cmake | 4 +- ports/curl/0002_fix_uwp.patch | 10 +- ports/curl/0008_fix_tools_path.patch | 13 - ports/curl/0011_fix_static_build.patch | 13 + ports/curl/CONTROL | 1 + ports/curl/portfile.cmake | 4 +- ports/darknet/CONTROL | 2 +- ports/darknet/fix_shared_static.patch | 20 + ports/darknet/portfile.cmake | 46 +- ports/date/0003-find-dependency-pthread.patch | 15 + ports/date/CONTROL | 1 + ports/date/portfile.cmake | 7 +- ports/date/usage | 4 - ports/date/vcpkg-cmake-wrapper.cmake | 11 - ports/dbghelp/CONTROL | 4 + ports/dbghelp/portfile.cmake | 27 + ports/directxsdk/portfile.cmake | 60 + ports/directxsdk/vcpkg.json | 7 + ports/dlib/CONTROL | 5 +- ports/embree3/CONTROL | 2 +- ports/embree3/fix-InstallPath.patch | 15 - ports/embree3/fix-cmake-path.patch | 163 -- ports/embree3/fix-embree-path.patch | 26 - ports/embree3/fix-path.patch | 117 + ports/embree3/portfile.cmake | 48 +- ports/embree3/usage | 4 + ports/ensmallen/CONTROL | 3 +- ports/evpp/CONTROL | 3 +- ports/evpp/fix-linux-build.patch | 20 +- ports/farmhash/CONTROL | 3 +- ports/farmhash/portfile.cmake | 1 + ports/ffmpeg/CONTROL | 23 +- ports/ffmpeg/FindFFMPEG.cmake.in | 78 +- ports/ffmpeg/portfile.cmake | 50 + ports/ffmpeg/vcpkg-cmake-wrapper.cmake | 4 +- ports/field3d/0001_fix_build_errors.patch | 148 ++ .../0002_improve_win_compatibility.patch | 43 + ports/field3d/0003_hdf5_api.patch | 12 + ports/field3d/CONTROL | 5 +- ports/field3d/fix-build_error.patch | 13 - ports/field3d/hdf5.api.patch | 14 - ports/field3d/portfile.cmake | 22 +- ports/fizz/CONTROL | 3 +- ports/fizz/fix-build_error.patch | 13 - ports/fizz/portfile.cmake | 4 +- ports/fltk/CONTROL | 3 +- ports/fltk/config-path.patch | 13 + ports/fltk/include.patch | 13 + ports/fltk/portfile.cmake | 60 +- ports/fmt/CONTROL | 2 +- ports/fmt/portfile.cmake | 26 +- ports/freeimage/CMakeLists.txt | 7 +- ports/freeimage/CONTROL | 3 +- ports/freetype-gl/CONTROL | 3 +- ports/freetype-gl/glew.patch | 13 + ports/freetype-gl/portfile.cmake | 1 + .../0002-Add-CONFIG_INSTALL_PATH-option.patch | 22 - ports/freetype/CONTROL | 4 +- ports/freetype/brotli-static.patch | 21 + ports/freetype/pkgconfig.patch | 20 + ports/freetype/portfile.cmake | 48 +- ports/freetype/vcpkg-cmake-wrapper.cmake | 11 + ports/freexl/CONTROL | 3 +- ports/freexl/portfile.cmake | 1 + ports/fribidi/CONTROL | 2 +- ports/fribidi/fix-win-static-suffix.patch | 42 +- ports/fribidi/portfile.cmake | 23 +- ports/g2o/CONTROL | 3 +- ports/gamedev-framework/CONTROL | 7 + ports/gamedev-framework/portfile.cmake | 48 + ports/geogram/CONTROL | 4 +- .../fix-cmake-config-and-install.patch | 26 +- ports/geogram/portfile.cmake | 43 +- ports/geographiclib/vcpkg.json | 2 +- ports/glew/CONTROL | 2 +- ports/glew/portfile.cmake | 2 +- ports/gmp/CONTROL | 5 - ports/gmp/portfile.cmake | 15 +- ports/gmp/vcpkg.json | 13 + ports/google-cloud-cpp/CONTROL | 2 +- ports/google-cloud-cpp/portfile.cmake | 4 +- ports/grpc/00011-fix-csharp_plugin.patch | 33 + ports/grpc/CONTROL | 1 + ports/grpc/portfile.cmake | 1 + ports/gsoap/CONTROL | 4 +- ports/gsoap/portfile.cmake | 7 +- ports/gtkmm/CONTROL | 3 +- ports/gtkmm/fix_treeviewcolumn.patch | 15 + ports/gtkmm/portfile.cmake | 1 + ports/healpix/CONTROL | 3 +- ports/healpix/portfile.cmake | 1 + ports/ignition-modularscripts/CONTROL | 1 + .../ignition_modular_library.cmake | 5 +- ports/ignition-msgs5/CONTROL | 1 + ports/ignition-msgs5/portfile.cmake | 2 +- ports/imgui/CMakeLists.txt | 8 +- ports/imgui/CONTROL | 2 +- ports/imgui/portfile.cmake | 4 + ports/implot/CONTROL | 2 +- ports/implot/portfile.cmake | 4 +- ports/itk/CONTROL | 34 +- ports/itk/cufftw.patch | 58 + ports/itk/double-conversion.patch | 16 + ports/itk/fix_libminc_config_path.patch | 13 - ports/itk/fix_openjpeg_search.patch | 13 - ports/itk/hdf5.patch | 20 + ports/itk/opencl.patch | 176 ++ ports/itk/openjpeg.patch | 548 +++++ ports/itk/openjpeg2.patch | 58 + ports/itk/portfile.cmake | 194 +- ports/itk/python_gpu_wrapping.patch | 178 ++ ports/itk/rtk/already_defined.patch | 100 + ports/itk/rtk/unresolved.patch | 213 ++ ports/itk/var_libraries.patch | 27 + ports/itk/wrapping.patch | 19 + ports/josuttis-jthread/CONTROL | 4 + ports/josuttis-jthread/portfile.cmake | 15 + ports/jsoncons/CONTROL | 4 +- ports/jsoncons/portfile.cmake | 4 +- ports/jxrlib/CONTROL | 2 +- ports/jxrlib/vcpkg-cmake-wrapper.cmake | 4 +- ports/kf5archive/CONTROL | 1 + ports/kf5archive/portfile.cmake | 12 +- ports/kf5completion/CONTROL | 5 + .../add-qdbus-to-required-libraries.patch | 13 + ports/kf5completion/portfile.cmake | 33 + ports/kf5config/CONTROL | 5 + ports/kf5config/portfile.cmake | 53 + ports/kf5coreaddons/CONTROL | 5 + ports/kf5coreaddons/portfile.cmake | 42 + ports/kf5crash/CONTROL | 6 + ports/kf5crash/add_x11extras.patch | 13 + ports/kf5crash/portfile.cmake | 31 + ports/kf5guiaddons/CONTROL | 5 + ports/kf5guiaddons/portfile.cmake | 29 + ports/kf5i18n/CONTROL | 5 + ports/kf5i18n/portfile.cmake | 35 + ports/kf5itemmodels/CONTROL | 5 + ports/kf5itemmodels/portfile.cmake | 28 + ports/kf5itemviews/CONTROL | 5 + ports/kf5itemviews/portfile.cmake | 29 + ports/kf5widgetsaddons/CONTROL | 5 + ports/kf5widgetsaddons/portfile.cmake | 30 + ports/kf5windowsystem/CONTROL | 5 + ports/kf5windowsystem/portfile.cmake | 29 + ports/lapack-reference/CONTROL | 16 + ports/lapack-reference/FindLAPACK.cmake | 568 +++++ ports/lapack-reference/portfile.cmake | 123 + .../vcpkg-cmake-wrapper.cmake | 2 + ports/lapack/CMakeLists.txt | 5 + ports/lapack/CONTROL | 4 + ports/{ => lapack}/clapack/FindLAPACK.cmake | 0 .../clapack/vcpkg-cmake-wrapper.cmake | 0 ports/lapack/portfile.cmake | 10 + ports/libass/CMakeLists.txt | 44 +- ports/libass/CONTROL | 4 - ports/libass/portfile.cmake | 11 +- ports/libass/vcpkg.json | 16 + ports/libb2/portfile.cmake | 1 + ports/libb2/vcpkg.json | 2 +- ports/libcrafter/CONTROL | 5 +- ports/libcrafter/portfile.cmake | 1 + ports/libde265/CONTROL | 5 + ports/libde265/portfile.cmake | 24 + ports/libepoxy/CONTROL | 1 + ports/libepoxy/portfile.cmake | 19 +- ports/libevent/CONTROL | 2 +- .../fix-LibeventConfig_cmake_in_path.patch | 18 +- ports/libevent/fix-crt_linkage.patch | 13 - ports/libevent/fix-file_path.patch | 42 +- ports/libevent/portfile.cmake | 32 +- ports/libffi/CONTROL | 3 +- ports/libffi/portfile.cmake | 3 + .../win32-disable-stackframe-check.patch | 50 + .../win64-disable-stackframe-check.patch | 43 + ports/libflac/CONTROL | 3 +- ports/libflac/portfile.cmake | 41 +- ports/libftdi1/CONTROL | 2 +- ports/libftdi1/portfile.cmake | 10 +- ports/libgpod/CMakeLists.txt | 4 +- ports/libgpod/CONTROL | 1 + ports/libheif/CONTROL | 6 + .../dont_build_examples_and_gdk_pixbuf.patch | 13 + ports/libheif/install-extra-headers.patch | 12 + ports/libheif/portfile.cmake | 21 + ports/libheif/remove_finding_pkgconfig.patch | 18 + ports/libigl/CONTROL | 15 +- ports/libigl/fix-dependency.patch | 128 +- ports/libigl/portfile.cmake | 23 +- ports/liblzma/CONTROL | 1 + ports/liblzma/portfile.cmake | 8 +- ports/libmagic/CONTROL | 5 +- ports/libmagic/portfile.cmake | 1 + ports/libmariadb/CONTROL | 12 +- ports/libmariadb/portfile.cmake | 9 +- ports/libmodbus/CMakeLists.txt | 3 +- ports/libmodbus/CONTROL | 3 - ports/libmodbus/fix-static-linkage.patch | 13 + ports/libmodbus/portfile.cmake | 29 +- ports/libmodbus/vcpkg.json | 8 + ports/libmodman/CONTROL | 2 +- ports/libmodman/vcpkg-cmake-wrapper.cmake | 4 +- ports/libodb-sqlite/CMakeLists.txt | 4 +- ports/libodb-sqlite/CONTROL | 3 +- ports/libpng/CONTROL | 3 +- ports/libpng/pkgconfig.2.patch | 48 + ports/libpng/pkgconfig.patch | 24 + ports/libpng/portfile.cmake | 66 +- ports/libpq/CONTROL | 2 +- ports/libpq/portfile.cmake | 6 +- ports/libproxy/CONTROL | 2 +- ports/libproxy/vcpkg-cmake-wrapper.cmake | 4 +- ports/libraqm/CMakeLists.txt | 2 +- ports/libraqm/CONTROL | 3 +- ports/librdkafka/CONTROL | 2 +- ports/librdkafka/portfile.cmake | 9 +- ports/libressl/CONTROL | 3 +- ports/libressl/portfile.cmake | 31 +- ports/libsndfile/CONTROL | 3 +- ports/libsndfile/portfile.cmake | 4 - ports/libtorrent/CONTROL | 4 +- ports/libtorrent/portfile.cmake | 4 +- ports/libu2f-server/CONTROL | 3 + ports/libu2f-server/portfile.cmake | 6 + ports/libusb/CONTROL | 2 + ports/libusb/portfile.cmake | 82 +- ports/libvpx/CONTROL | 2 +- ports/libvpx/portfile.cmake | 9 +- ports/libwandio/CONTROL | 6 +- ports/libwandio/configure.lib.patch | 18 - ports/libwandio/configure.patch | 14 + ports/libwandio/curl.patch | 22 + ports/libwandio/openssl.patch | 22 + ports/libwandio/portfile.cmake | 11 + ports/libzip/CONTROL | 1 + ports/libzip/fix-findpackage.patch | 35 + ports/libzip/portfile.cmake | 1 + ports/log4cpp/CONTROL | 3 +- ports/log4cpp/fix-includepath.patch | 31 + ports/log4cpp/portfile.cmake | 10 +- ports/lzokay/portfile.cmake | 23 + ports/lzokay/vcpkg.json | 6 + ports/marble/CONTROL | 6 + ports/marble/portfile.cmake | 45 + ports/marble/qtfix.patch | 97 + ports/minc/CONTROL | 9 + ports/minc/build.patch | 67 + ports/minc/config.patch | 15 + ports/minc/portfile.cmake | 47 + ports/mlpack/CONTROL | 5 +- ports/mlpack/cmakelists.patch | 18 +- ports/monkeys-audio/CONTROL | 2 +- ports/monkeys-audio/portfile.cmake | 4 +- ports/mosquitto/CONTROL | 6 - ports/mosquitto/portfile.cmake | 5 +- ports/mosquitto/usage | 5 + ports/mosquitto/vcpkg-cmake-wrapper.cmake | 15 + ports/mosquitto/vcpkg.json | 13 + ports/mozjpeg/CONTROL | 3 +- ports/mozjpeg/fix-install-error.patch | 117 +- ports/mozjpeg/portfile.cmake | 33 +- ports/mpg123/CONTROL | 3 +- ports/mpg123/portfile.cmake | 111 +- ports/mpir/CONTROL | 5 - ports/mpir/portfile.cmake | 128 +- ports/mpir/vcpkg.json | 8 + ports/nana/CMakeLists.txt | 4 +- ports/nana/CONTROL | 3 +- ports/neargye-semver/CONTROL | 4 + ports/neargye-semver/portfile.cmake | 13 + ports/netcdf-c/CONTROL | 3 +- ports/netcdf-c/fix-dependency-libmath.patch | 13 + ports/netcdf-c/portfile.cmake | 1 + ports/netcdf-c/usage | 2 +- ports/netcdf-cxx4/CONTROL | 1 + ports/netcdf-cxx4/fix-dependecy-hdf5.patch | 43 +- ports/netcdf-cxx4/portfile.cmake | 4 +- ports/nettle/CONTROL | 2 +- ports/ngspice/CONTROL | 5 + ports/ngspice/portfile.cmake | 50 + ports/ngspice/use-winbison-global.patch | 13 + ports/nifticlib/CONTROL | 25 + ports/nifticlib/portfile.cmake | 48 + ports/nifticlib/zlib_include.patch | 12 + ports/nlohmann-json/CONTROL | 3 +- ports/nlohmann-json/portfile.cmake | 7 +- ports/ocilib/CONTROL | 3 +- ports/ocilib/portfile.cmake | 74 +- ports/ogre/CONTROL | 18 - ports/ogre/fix-dependency.patch | 45 + ports/ogre/fix-findimgui.patch | 35 + ports/ogre/portfile.cmake | 6 +- ports/ogre/toolchain_fixes.patch | 40 +- ports/ogre/vcpkg.json | 41 + ports/ompl/CONTROL | 3 +- ports/ompl/portfile.cmake | 1 + ports/openal-soft/CONTROL | 2 +- ports/openal-soft/fix-mingw-build.patch | 14 + ports/openal-soft/portfile.cmake | 1 + ports/openblas/CONTROL | 5 +- ports/openblas/portfile.cmake | 32 +- ports/opencl/CONTROL | 3 +- ports/opencl/vcpkg-cmake-wrapper.cmake | 3 + .../0001-lcms-dependency-search.patch | 40 + .../0002-msvc-cpluscplus.patch | 84 + .../0003-osx-self-assign-field.patch | 13 + .../0004-yaml-dependency-search.patch | 108 + .../0005-tinyxml-dependency-search.patch | 18 + .../0006-oiio-dependency-search.patch | 14 + ports/opencolorio-tools/CONTROL | 5 + ports/opencolorio-tools/portfile.cmake | 68 + .../0001-lcms-dependency-search.patch | 5 +- .../0006-oiio-dependency-search.patch | 14 + ports/opencolorio/CONTROL | 9 +- ports/opencolorio/portfile.cmake | 36 +- ports/opencv/CONTROL | 204 +- ports/opencv2/CONTROL | 3 +- ports/opencv2/FindCUDA.cmake | 2026 +++++++++++++++++ ports/opencv2/portfile.cmake | 10 +- ports/opencv3/0001-disable-downloading.patch | 11 +- ports/opencv3/0002-install-options.patch | 134 +- .../0003-force-package-requirements.patch | 40 +- .../0004-add-missing-stdexcept-include.patch | 12 + ports/opencv3/0009-fix-uwp.patch | 74 +- ports/opencv3/CONTROL | 14 +- ports/opencv3/FindCUDA.cmake | 2026 +++++++++++++++++ ports/opencv3/portfile.cmake | 102 +- ports/opencv4/0001-disable-downloading.patch | 11 +- ports/opencv4/0002-install-options.patch | 34 +- .../0003-force-package-requirements.patch | 27 +- ports/opencv4/0004-fix-policy-CMP0057.patch | 2 +- .../0005-add-missing-stdexcept-include.patch | 12 + ports/opencv4/0009-fix-uwp.patch | 48 +- ports/opencv4/CONTROL | 18 +- ports/opencv4/FindCUDA.cmake | 2026 +++++++++++++++++ ports/opencv4/portfile.cmake | 102 +- ports/openexr/CONTROL | 7 +- ports/openexr/FindOpenEXR.cmake | 94 - ...x_clang_not_setting_modern_cplusplus.patch | 13 - ports/openexr/fix_install_ilmimf.patch | 19 - .../fix_linux_static_library_names.patch | 109 - ports/openexr/fixup_cmake_exports_path.patch | 78 + ports/openexr/portfile.cmake | 78 +- ports/openexr/remove_find_package_macro.patch | 87 + ports/openexr/remove_symlinks.patch | 40 + ports/openexr/vcpkg-cmake-wrapper.cmake | 40 +- ports/openimageio/CONTROL | 3 +- ports/openimageio/portfile.cmake | 6 +- ports/openimageio/vcpkg-cmake-wrapper.cmake | 4 +- ports/openjpeg/CONTROL | 15 +- ports/openjpeg/dll.location.patch | 32 + ports/openjpeg/portfile.cmake | 49 +- ports/openmpi/CONTROL | 1 + ports/openmpi/portfile.cmake | 1 + ports/openssl-unix/CMakeLists.txt | 23 + ports/openssl-unix/CONTROL | 1 + ports/openssl-unix/portfile.cmake | 4 +- ports/openssl-windows/CONTROL | 1 + ports/openssl-windows/portfile.cmake | 34 +- ports/orocos-kdl/CONTROL | 3 +- ports/orocos-kdl/portfile.cmake | 7 +- ports/osg/CONTROL | 4 +- ports/osg/portfile.cmake | 4 +- ports/osg/remove-prefix.patch | 9 - ports/osgearth/CONTROL | 3 +- ports/osgearth/RocksDB.patch | 163 +- ports/osgearth/portfile.cmake | 15 +- ports/outcome/CONTROL | 4 +- ports/outcome/portfile.cmake | 13 +- ports/pango/CMakeLists.txt | 8 +- ports/pango/CONTROL | 3 +- ports/pangolin/CONTROL | 4 +- ports/pangolin/fix-dependency-python.patch | 14 + ports/pangolin/fix-dependeny-ffmpeg.patch | 50 + ports/pangolin/portfile.cmake | 34 +- ports/paraview/CONTROL | 5 +- ports/paraview/portfile.cmake | 16 +- ports/pbc/CONTROL | 7 +- ports/pbc/portfile.cmake | 45 +- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 62 +- ports/physx/CONTROL | 3 +- ports/physx/internalMBP_symbols.patch | 49 + ports/physx/portfile.cmake | 39 +- ports/pngpp/portfile.cmake | 15 + ports/pngpp/vcpkg.json | 8 + ports/podofo/CONTROL | 3 +- ports/podofo/freetype.patch | 18 + ports/podofo/portfile.cmake | 1 + ports/polyhook2/CONTROL | 2 +- ports/polyhook2/portfile.cmake | 4 +- ports/proj4/CONTROL | 5 +- .../proj4/fix-sqlite-dependency-export.patch | 2 +- ports/proj4/portfile.cmake | 1 + ports/proj4/use-sqlite3-config.patch | 57 + ports/protobuf/CONTROL | 1 + ports/protobuf/portfile.cmake | 17 +- ports/qt5-base/CONTROL | 3 +- ports/qt5-base/cmake/install_qt.cmake | 4 +- ports/qt5-base/portfile.cmake | 15 +- ports/qt5-connectivity/CONTROL | 1 + ports/qt5-imageformats/CONTROL | 1 + ports/qt5-location/CONTROL | 1 + ports/qt5-webengine/CONTROL | 1 + ports/qt5-webengine/portfile.cmake | 7 +- ports/qt5-webengine/vs2017.patch | 12 + ports/qt5/CONTROL | 75 +- ports/quazip/CONTROL | 5 + ports/quazip/portfile.cmake | 20 + ports/quazip/vcpkg_remove_extra_static.patch | 30 + ports/quill/CONTROL | 2 +- ports/quill/portfile.cmake | 4 +- ports/qwt/CONTROL | 1 + ports/qwt/portfile.cmake | 2 +- ports/qwtw/CONTROL | 7 + ports/qwtw/portfile.cmake | 19 + ports/raylib/CONTROL | 10 +- ports/raylib/portfile.cmake | 18 +- ports/raylib/usage | 4 +- ports/raylib/vcpkg-cmake-wrapper.cmake | 17 +- ports/restinio/CONTROL | 2 +- ports/restinio/portfile.cmake | 4 +- ports/robin-hood-hashing/CONTROL | 2 +- ports/robin-hood-hashing/portfile.cmake | 4 +- ports/rsocket/CONTROL | 6 + ports/rsocket/fix-cmake-config.patch | 26 + ports/rsocket/fix-find-dependencies.patch | 94 + ports/rsocket/portfile.cmake | 44 + ports/rtmidi/CMakeLists.txt | 27 - ports/rtmidi/CONTROL | 2 + ports/rtmidi/portfile.cmake | 21 +- ports/sdl1/CONTROL | 3 +- ports/sdl1/portfile.cmake | 6 +- ports/sdl2-mixer/CMakeLists.txt | 2 +- ports/sdl2-mixer/CONTROL | 7 +- ports/sdl2-mixer/portfile.cmake | 1 + ports/secp256k1/CMakeLists.txt | 21 +- ports/secp256k1/CONTROL | 3 +- ports/secp256k1/portfile.cmake | 8 +- ports/secp256k1/secp256k1-config.cmake | 1 + ports/sfml/CONTROL | 3 +- ports/sfml/portfile.cmake | 1 + ports/sfml/stb_include.patch | 14 + ports/shapelib/CONTROL | 2 +- ports/shapelib/portfile.cmake | 9 +- ports/simple-fft/CONTROL | 4 + ports/simple-fft/portfile.cmake | 20 + ports/spdlog/CONTROL | 2 +- ports/spdlog/portfile.cmake | 4 +- ports/sqlite3/CMakeLists.txt | 13 +- ports/sqlite3/CONTROL | 7 + ports/sqlite3/portfile.cmake | 7 +- ports/sqlite3/sqlite3-config.in.cmake | 2 +- .../0001-Find-external-sqlite3.patch | 4 +- ports/sqlitecpp/CONTROL | 1 + ports/stb/CONTROL | 2 +- ports/stb/vcpkg-cmake-wrapper.cmake | 4 +- ports/stx/CMakeLists.patch | 71 + ports/stx/CONTROL | 8 + ports/stx/portfile.cmake | 35 + ports/suitesparse/CONTROL | 5 +- ports/teemo/CONTROL | 4 +- ports/teemo/portfile.cmake | 4 +- ports/tensorflow-cc/CONTROL | 3 +- ports/tensorflow-cc/portfile.cmake | 3 +- ports/tiff/CONTROL | 2 +- ports/tiff/cmakelists.patch | 15 - ports/tiff/portfile.cmake | 8 +- ports/tlx/CONTROL | 4 + ports/tlx/portfile.cmake | 38 + ports/tomlplusplus/CONTROL | 5 + ports/tomlplusplus/portfile.cmake | 25 + ports/treehopper/CONTROL | 2 +- ports/treehopper/portfile.cmake | 7 +- ports/vc/CONTROL | 5 + ports/vc/correct_cmake_config_path.patch | 22 + ports/vc/portfile.cmake | 26 + ports/vcpkg-gfortran/CONTROL | 4 + ports/vcpkg-gfortran/portfile.cmake | 53 + ports/vtk/6811.patch | 26 + ports/vtk/portfile.cmake | 1 + ports/vxl/CONTROL | 3 +- ports/vxl/fix_dependency.patch | 26 +- ports/vxl/portfile.cmake | 17 +- ports/wavpack/CONTROL | 4 +- ports/wavpack/portfile.cmake | 11 +- ports/winpcap/CONTROL | 3 +- ports/winpcap/portfile.cmake | 53 +- ports/wpilib/CONTROL | 3 +- ports/wpilib/portfile.cmake | 56 +- ports/wtl/CONTROL | 2 +- ports/wtl/portfile.cmake | 6 +- ports/wxwidgets/CONTROL | 5 +- .../wxwidgets/disable-platform-lib-dir.patch | 8 +- ports/wxwidgets/fix-macos-clipboard.patch | 26 - .../wxwidgets/fix-stl-build-vs2019-16.6.patch | 202 ++ ports/wxwidgets/portfile.cmake | 19 +- ports/x264/CONTROL | 5 +- ports/x264/portfile.cmake | 31 +- ports/xbyak/CONTROL | 2 +- ports/xbyak/portfile.cmake | 4 +- ports/xeus/Fix-Compile-nlohmann-json.patch | 12 + ports/xeus/portfile.cmake | 4 +- ports/xframe/CONTROL | 5 + ports/xframe/portfile.cmake | 22 + ports/zlib/CONTROL | 2 +- ports/zlib/add_debug_postfix_on_mingw.patch | 13 + ports/zlib/portfile.cmake | 1 + scripts/azure-pipelines/azure-pipelines.yml | 5 +- scripts/azure-pipelines/end-to-end-tests.ps1 | 21 +- .../azure-pipelines/linux/azure-pipelines.yml | 16 +- scripts/azure-pipelines/osx/README.md | 2 +- .../osx/Setup-VagrantMachines.ps1 | 4 +- scripts/azure-pipelines/osx/Utilities.psm1 | 3 +- .../azure-pipelines/osx/azure-pipelines.yml | 23 +- .../osx/configuration/VagrantFile | 24 +- .../vagrant-configuration.schema.json | 4 +- .../azure-pipelines/test-modified-ports.ps1 | 3 +- .../windows/Check-CxxFormatting.ps1 | 4 +- .../windows/Check-ManifestFormatting.ps1 | 16 +- .../windows/azure-pipelines.yml | 24 +- scripts/boost/generate-ports.ps1 | 137 +- scripts/bootstrap.ps1 | 12 +- scripts/buildsystems/msbuild/vcpkg.targets | 4 +- scripts/buildsystems/vcpkg.cmake | 28 +- scripts/ci.baseline.txt | 103 +- scripts/cmake/vcpkg_acquire_msys.cmake | 31 +- scripts/cmake/vcpkg_build_make.cmake | 112 +- scripts/cmake/vcpkg_build_qmake.cmake | 3 +- scripts/cmake/vcpkg_common_definitions.cmake | 4 +- scripts/cmake/vcpkg_configure_make.cmake | 397 ++-- .../cmake/vcpkg_copy_tool_dependencies.cmake | 17 +- .../cmake/vcpkg_execute_build_process.cmake | 5 +- .../cmake/vcpkg_find_acquire_program.cmake | 117 +- scripts/cmake/vcpkg_find_fortran.cmake | 61 + scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 10 +- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 388 ++-- scripts/cmake/vcpkg_from_gitlab.cmake | 25 +- scripts/cmake/vcpkg_prettify_command.cmake | 6 +- scripts/test_ports/cmake/CONTROL | 5 + scripts/test_ports/cmake/portfile.cmake | 53 + scripts/test_ports/vcpkg-ci-paraview/CONTROL | 6 + .../vcpkg-ci-paraview/portfile.cmake | 1 + scripts/toolchains/android.cmake | 32 +- toolsrc/CMakeLists.txt | 333 +-- toolsrc/cmake/utilities.cmake | 70 +- toolsrc/include/vcpkg-test/util.h | 24 +- toolsrc/include/vcpkg/base/json.h | 44 +- toolsrc/include/vcpkg/base/strings.h | 2 + toolsrc/include/vcpkg/base/stringview.h | 3 + toolsrc/include/vcpkg/base/system.h | 1 + toolsrc/include/vcpkg/base/system.process.h | 6 + toolsrc/include/vcpkg/binaryparagraph.h | 2 +- toolsrc/include/vcpkg/build.h | 8 + toolsrc/include/vcpkg/commands.autocomplete.h | 13 + .../include/vcpkg/commands.buildexternal.h | 15 + toolsrc/include/vcpkg/commands.cache.h | 13 + toolsrc/include/vcpkg/commands.ci.h | 16 + toolsrc/include/vcpkg/commands.ciclean.h | 13 + toolsrc/include/vcpkg/commands.contact.h | 15 + toolsrc/include/vcpkg/commands.create.h | 15 + toolsrc/include/vcpkg/commands.dependinfo.h | 16 + toolsrc/include/vcpkg/commands.edit.h | 14 + toolsrc/include/vcpkg/commands.env.h | 16 + toolsrc/include/vcpkg/commands.fetch.h | 13 + .../include/vcpkg/commands.format-manifest.h | 14 + toolsrc/include/vcpkg/commands.h | 167 +- toolsrc/include/vcpkg/commands.hash.h | 13 + toolsrc/include/vcpkg/commands.info.h | 13 + toolsrc/include/vcpkg/commands.integrate.h | 17 + toolsrc/include/vcpkg/commands.interface.h | 33 + toolsrc/include/vcpkg/commands.list.h | 14 + toolsrc/include/vcpkg/commands.owns.h | 14 + toolsrc/include/vcpkg/commands.porthistory.h | 13 + toolsrc/include/vcpkg/commands.portsdiff.h | 13 + toolsrc/include/vcpkg/commands.search.h | 14 + toolsrc/include/vcpkg/commands.setinstalled.h | 26 + toolsrc/include/vcpkg/commands.upgrade.h | 16 + toolsrc/include/vcpkg/commands.version.h | 16 + toolsrc/include/vcpkg/commands.xvsinstances.h | 14 + toolsrc/include/vcpkg/dependencies.h | 6 + toolsrc/include/vcpkg/export.h | 9 +- toolsrc/include/vcpkg/help.h | 8 +- toolsrc/include/vcpkg/install.h | 18 + toolsrc/include/vcpkg/packagespec.h | 18 +- toolsrc/include/vcpkg/paragraphparseresult.h | 36 - toolsrc/include/vcpkg/platform-expression.h | 25 + toolsrc/include/vcpkg/remove.h | 10 +- toolsrc/include/vcpkg/sourceparagraph.h | 18 +- toolsrc/include/vcpkg/statusparagraph.h | 2 + toolsrc/include/vcpkg/tools.h | 15 + toolsrc/include/vcpkg/triplet.h | 17 +- toolsrc/include/vcpkg/update.h | 8 +- toolsrc/include/vcpkg/vcpkgcmdarguments.h | 5 + toolsrc/include/vcpkg/vcpkgpaths.h | 26 +- toolsrc/src/pch.cpp | 3 +- toolsrc/src/vcpkg-test/binarycaching.cpp | 8 +- toolsrc/src/vcpkg-test/commands.cpp | 69 + toolsrc/src/vcpkg-test/commands.create.cpp | 2 +- toolsrc/src/vcpkg-test/dependencies.cpp | 68 +- toolsrc/src/vcpkg-test/json.cpp | 43 + toolsrc/src/vcpkg-test/manifests.cpp | 83 +- toolsrc/src/vcpkg-test/paragraph.cpp | 12 +- toolsrc/src/vcpkg-test/plan.cpp | 184 +- toolsrc/src/vcpkg-test/specifier.cpp | 19 +- toolsrc/src/vcpkg-test/statusparagraphs.cpp | 10 +- toolsrc/src/vcpkg-test/strings.cpp | 4 + toolsrc/src/vcpkg-test/system.cpp | 4 + toolsrc/src/vcpkg-test/util.cpp | 6 + toolsrc/src/vcpkg.cpp | 18 +- toolsrc/src/vcpkg/archives.cpp | 3 +- toolsrc/src/vcpkg/base/checks.cpp | 2 - toolsrc/src/vcpkg/base/chrono.cpp | 2 - toolsrc/src/vcpkg/base/cofffilereader.cpp | 2 - toolsrc/src/vcpkg/base/downloads.cpp | 2 - toolsrc/src/vcpkg/base/enums.cpp | 2 - toolsrc/src/vcpkg/base/files.cpp | 11 +- toolsrc/src/vcpkg/base/hash.cpp | 2 - toolsrc/src/vcpkg/base/json.cpp | 187 +- toolsrc/src/vcpkg/base/machinetype.cpp | 2 - toolsrc/src/vcpkg/base/parse.cpp | 129 -- toolsrc/src/vcpkg/base/strings.cpp | 9 +- toolsrc/src/vcpkg/base/stringview.cpp | 2 - toolsrc/src/vcpkg/base/system.cpp | 8 +- toolsrc/src/vcpkg/base/system.print.cpp | 2 - toolsrc/src/vcpkg/base/system.process.cpp | 2 - toolsrc/src/vcpkg/base/unicode.cpp | 2 - toolsrc/src/vcpkg/binarycaching.cpp | 25 +- toolsrc/src/vcpkg/binaryparagraph.cpp | 2 - toolsrc/src/vcpkg/build.cpp | 11 +- toolsrc/src/vcpkg/buildenvironment.cpp | 3 +- toolsrc/src/vcpkg/cmakevars.cpp | 2 - toolsrc/src/vcpkg/commands.autocomplete.cpp | 12 +- toolsrc/src/vcpkg/commands.buildexternal.cpp | 11 +- toolsrc/src/vcpkg/commands.cache.cpp | 9 +- toolsrc/src/vcpkg/commands.ci.cpp | 11 +- toolsrc/src/vcpkg/commands.ciclean.cpp | 9 +- toolsrc/src/vcpkg/commands.contact.cpp | 9 +- toolsrc/src/vcpkg/commands.cpp | 182 +- toolsrc/src/vcpkg/commands.create.cpp | 9 +- toolsrc/src/vcpkg/commands.dependinfo.cpp | 11 +- toolsrc/src/vcpkg/commands.edit.cpp | 9 +- toolsrc/src/vcpkg/commands.env.cpp | 11 +- toolsrc/src/vcpkg/commands.fetch.cpp | 29 + .../src/vcpkg/commands.format-manifest.cpp | 266 ++- toolsrc/src/vcpkg/commands.hash.cpp | 38 + toolsrc/src/vcpkg/commands.info.cpp | 146 ++ toolsrc/src/vcpkg/commands.integrate.cpp | 10 +- toolsrc/src/vcpkg/commands.list.cpp | 17 +- toolsrc/src/vcpkg/commands.owns.cpp | 9 +- toolsrc/src/vcpkg/commands.porthistory.cpp | 10 +- toolsrc/src/vcpkg/commands.portsdiff.cpp | 10 +- toolsrc/src/vcpkg/commands.search.cpp | 9 +- toolsrc/src/vcpkg/commands.setinstalled.cpp | 38 +- toolsrc/src/vcpkg/commands.upgrade.cpp | 11 +- toolsrc/src/vcpkg/commands.version.cpp | 9 +- toolsrc/src/vcpkg/commands.xvsinstances.cpp | 9 +- toolsrc/src/vcpkg/dependencies.cpp | 70 +- toolsrc/src/vcpkg/export.chocolatey.cpp | 151 +- toolsrc/src/vcpkg/export.cpp | 80 +- ...{commands.exportifw.cpp => export.ifw.cpp} | 3 +- toolsrc/src/vcpkg/export.prefab.cpp | 3 +- toolsrc/src/vcpkg/globalstate.cpp | 2 - toolsrc/src/vcpkg/help.cpp | 16 +- toolsrc/src/vcpkg/input.cpp | 2 - toolsrc/src/vcpkg/install.cpp | 140 +- toolsrc/src/vcpkg/metrics.cpp | 15 +- toolsrc/src/vcpkg/packagespec.cpp | 15 +- toolsrc/src/vcpkg/paragraphparseresult.cpp | 35 - toolsrc/src/vcpkg/paragraphs.cpp | 133 +- toolsrc/src/vcpkg/platform-expression.cpp | 121 +- toolsrc/src/vcpkg/portfileprovider.cpp | 5 +- toolsrc/src/vcpkg/postbuildlint.buildtype.cpp | 2 - toolsrc/src/vcpkg/postbuildlint.cpp | 2 - toolsrc/src/vcpkg/remove.cpp | 9 +- toolsrc/src/vcpkg/sourceparagraph.cpp | 384 +++- toolsrc/src/vcpkg/statusparagraph.cpp | 2 - toolsrc/src/vcpkg/statusparagraphs.cpp | 42 +- toolsrc/src/vcpkg/tools.cpp | 10 +- toolsrc/src/vcpkg/triplet.cpp | 31 +- toolsrc/src/vcpkg/update.cpp | 7 +- toolsrc/src/vcpkg/userconfig.cpp | 2 - toolsrc/src/vcpkg/vcpkgcmdarguments.cpp | 21 +- toolsrc/src/vcpkg/vcpkglib.cpp | 3 - toolsrc/src/vcpkg/vcpkgpaths.cpp | 7 +- toolsrc/src/vcpkg/versiont.cpp | 2 - toolsrc/src/vcpkg/visualstudio.cpp | 2 - toolsrc/vcpkg.sln | 105 - toolsrc/vcpkglib/vcpkglib.vcxproj | 301 --- toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 462 ---- toolsrc/vcpkgtest/vcpkgtest.vcxproj | 189 -- toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters | 69 - toolsrc/{ => windows-bootstrap}/dirs.proj | 0 toolsrc/windows-bootstrap/vcpkg.sln | 56 + .../vcpkg/vcpkg.vcxproj | 12 +- .../vcpkg/vcpkg.vcxproj.filters | 4 +- .../vcpkglib/vcpkglib.vcxproj | 331 +++ .../vcpkglib/vcpkglib.vcxproj.filters | 540 +++++ .../vcpkgmetricsuploader.vcxproj | 10 +- .../vcpkgmetricsuploader.vcxproj.filters | 2 +- triplets/community/arm64-osx.cmake | 1 + triplets/community/s390x-linux.cmake | 5 + 817 files changed, 21997 insertions(+), 6714 deletions(-) create mode 100644 ports/abseil/fix-cmake-threads-dependency.patch delete mode 100644 ports/alembic/fix-C1083.patch delete mode 100644 ports/argtable3/CONTROL delete mode 100644 ports/argtable3/fix-cmake.patch create mode 100644 ports/argtable3/vcpkg.json create mode 100644 ports/audiofile/portfile.cmake create mode 100644 ports/audiofile/vcpkg.json create mode 100644 ports/avro-cpp/CONTROL create mode 100644 ports/avro-cpp/install.patch create mode 100644 ports/avro-cpp/portfile.cmake create mode 100644 ports/brotli/pkgconfig.patch create mode 100644 ports/brpc/CONTROL create mode 100644 ports/brpc/fix_boost_ptr.patch create mode 100644 ports/brpc/fix_thrift.patch create mode 100644 ports/brpc/portfile.cmake create mode 100644 ports/bzip2/bzip2.pc.in create mode 100644 ports/colmap/portfile.cmake create mode 100644 ports/colmap/usage create mode 100644 ports/colmap/vcpkg.json create mode 100644 ports/constexpr-contracts/CONTROL create mode 100644 ports/constexpr-contracts/portfile.cmake delete mode 100644 ports/coroutine/CONTROL create mode 100644 ports/coroutine/fix-errorC7651.patch create mode 100644 ports/coroutine/vcpkg.json create mode 100644 ports/cppad/CONTROL create mode 100644 ports/cppad/pkgconfig-fix.patch create mode 100644 ports/cppad/portfile.cmake create mode 100644 ports/cppad/windows-fix.patch create mode 100644 ports/crashrpt/001-add-install-target-and-find-deps.patch create mode 100644 ports/crashrpt/CONTROL create mode 100644 ports/crashrpt/portfile.cmake delete mode 100644 ports/curl/0008_fix_tools_path.patch create mode 100644 ports/curl/0011_fix_static_build.patch create mode 100644 ports/darknet/fix_shared_static.patch create mode 100644 ports/date/0003-find-dependency-pthread.patch delete mode 100644 ports/date/usage delete mode 100644 ports/date/vcpkg-cmake-wrapper.cmake create mode 100644 ports/dbghelp/CONTROL create mode 100644 ports/dbghelp/portfile.cmake create mode 100644 ports/directxsdk/portfile.cmake create mode 100644 ports/directxsdk/vcpkg.json mode change 100644 => 100755 ports/embree3/CONTROL delete mode 100644 ports/embree3/fix-InstallPath.patch delete mode 100644 ports/embree3/fix-cmake-path.patch delete mode 100644 ports/embree3/fix-embree-path.patch create mode 100755 ports/embree3/fix-path.patch mode change 100644 => 100755 ports/embree3/portfile.cmake create mode 100755 ports/embree3/usage create mode 100644 ports/field3d/0001_fix_build_errors.patch create mode 100644 ports/field3d/0002_improve_win_compatibility.patch create mode 100644 ports/field3d/0003_hdf5_api.patch delete mode 100644 ports/field3d/fix-build_error.patch delete mode 100644 ports/field3d/hdf5.api.patch delete mode 100644 ports/fizz/fix-build_error.patch create mode 100644 ports/fltk/config-path.patch create mode 100644 ports/fltk/include.patch create mode 100644 ports/freetype-gl/glew.patch delete mode 100644 ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch create mode 100644 ports/freetype/brotli-static.patch create mode 100644 ports/freetype/pkgconfig.patch create mode 100644 ports/gamedev-framework/CONTROL create mode 100644 ports/gamedev-framework/portfile.cmake delete mode 100644 ports/gmp/CONTROL create mode 100644 ports/gmp/vcpkg.json create mode 100644 ports/grpc/00011-fix-csharp_plugin.patch create mode 100644 ports/gtkmm/fix_treeviewcolumn.patch create mode 100644 ports/itk/cufftw.patch create mode 100644 ports/itk/double-conversion.patch delete mode 100644 ports/itk/fix_libminc_config_path.patch delete mode 100644 ports/itk/fix_openjpeg_search.patch create mode 100644 ports/itk/hdf5.patch create mode 100644 ports/itk/opencl.patch create mode 100644 ports/itk/openjpeg.patch create mode 100644 ports/itk/openjpeg2.patch create mode 100644 ports/itk/python_gpu_wrapping.patch create mode 100644 ports/itk/rtk/already_defined.patch create mode 100644 ports/itk/rtk/unresolved.patch create mode 100644 ports/itk/var_libraries.patch create mode 100644 ports/itk/wrapping.patch create mode 100644 ports/josuttis-jthread/CONTROL create mode 100644 ports/josuttis-jthread/portfile.cmake create mode 100644 ports/kf5completion/CONTROL create mode 100644 ports/kf5completion/add-qdbus-to-required-libraries.patch create mode 100644 ports/kf5completion/portfile.cmake create mode 100644 ports/kf5config/CONTROL create mode 100644 ports/kf5config/portfile.cmake create mode 100644 ports/kf5coreaddons/CONTROL create mode 100644 ports/kf5coreaddons/portfile.cmake create mode 100644 ports/kf5crash/CONTROL create mode 100644 ports/kf5crash/add_x11extras.patch create mode 100644 ports/kf5crash/portfile.cmake create mode 100644 ports/kf5guiaddons/CONTROL create mode 100644 ports/kf5guiaddons/portfile.cmake create mode 100644 ports/kf5i18n/CONTROL create mode 100644 ports/kf5i18n/portfile.cmake create mode 100644 ports/kf5itemmodels/CONTROL create mode 100644 ports/kf5itemmodels/portfile.cmake create mode 100644 ports/kf5itemviews/CONTROL create mode 100644 ports/kf5itemviews/portfile.cmake create mode 100644 ports/kf5widgetsaddons/CONTROL create mode 100644 ports/kf5widgetsaddons/portfile.cmake create mode 100644 ports/kf5windowsystem/CONTROL create mode 100644 ports/kf5windowsystem/portfile.cmake create mode 100644 ports/lapack-reference/CONTROL create mode 100644 ports/lapack-reference/FindLAPACK.cmake create mode 100644 ports/lapack-reference/portfile.cmake create mode 100644 ports/lapack-reference/vcpkg-cmake-wrapper.cmake create mode 100644 ports/lapack/CMakeLists.txt create mode 100644 ports/lapack/CONTROL rename ports/{ => lapack}/clapack/FindLAPACK.cmake (100%) rename ports/{ => lapack}/clapack/vcpkg-cmake-wrapper.cmake (100%) create mode 100644 ports/lapack/portfile.cmake delete mode 100644 ports/libass/CONTROL create mode 100644 ports/libass/vcpkg.json create mode 100644 ports/libde265/CONTROL create mode 100644 ports/libde265/portfile.cmake delete mode 100644 ports/libevent/fix-crt_linkage.patch create mode 100644 ports/libffi/win32-disable-stackframe-check.patch create mode 100644 ports/libffi/win64-disable-stackframe-check.patch create mode 100644 ports/libheif/CONTROL create mode 100644 ports/libheif/dont_build_examples_and_gdk_pixbuf.patch create mode 100644 ports/libheif/install-extra-headers.patch create mode 100644 ports/libheif/portfile.cmake create mode 100644 ports/libheif/remove_finding_pkgconfig.patch delete mode 100644 ports/libmodbus/CONTROL create mode 100644 ports/libmodbus/fix-static-linkage.patch create mode 100644 ports/libmodbus/vcpkg.json create mode 100644 ports/libpng/pkgconfig.2.patch create mode 100644 ports/libpng/pkgconfig.patch create mode 100644 ports/libwandio/configure.patch create mode 100644 ports/libwandio/curl.patch create mode 100644 ports/libwandio/openssl.patch create mode 100644 ports/libzip/fix-findpackage.patch create mode 100644 ports/log4cpp/fix-includepath.patch create mode 100644 ports/lzokay/portfile.cmake create mode 100644 ports/lzokay/vcpkg.json create mode 100644 ports/marble/CONTROL create mode 100644 ports/marble/portfile.cmake create mode 100644 ports/marble/qtfix.patch create mode 100644 ports/minc/CONTROL create mode 100644 ports/minc/build.patch create mode 100644 ports/minc/config.patch create mode 100644 ports/minc/portfile.cmake delete mode 100644 ports/mosquitto/CONTROL create mode 100644 ports/mosquitto/usage create mode 100644 ports/mosquitto/vcpkg-cmake-wrapper.cmake create mode 100644 ports/mosquitto/vcpkg.json delete mode 100644 ports/mpir/CONTROL create mode 100644 ports/mpir/vcpkg.json create mode 100644 ports/neargye-semver/CONTROL create mode 100644 ports/neargye-semver/portfile.cmake create mode 100644 ports/netcdf-c/fix-dependency-libmath.patch create mode 100644 ports/ngspice/CONTROL create mode 100644 ports/ngspice/portfile.cmake create mode 100644 ports/ngspice/use-winbison-global.patch create mode 100644 ports/nifticlib/CONTROL create mode 100644 ports/nifticlib/portfile.cmake create mode 100644 ports/nifticlib/zlib_include.patch delete mode 100644 ports/ogre/CONTROL create mode 100644 ports/ogre/fix-dependency.patch create mode 100644 ports/ogre/fix-findimgui.patch create mode 100644 ports/ogre/vcpkg.json create mode 100644 ports/openal-soft/fix-mingw-build.patch create mode 100644 ports/opencolorio-tools/0001-lcms-dependency-search.patch create mode 100644 ports/opencolorio-tools/0002-msvc-cpluscplus.patch create mode 100644 ports/opencolorio-tools/0003-osx-self-assign-field.patch create mode 100644 ports/opencolorio-tools/0004-yaml-dependency-search.patch create mode 100644 ports/opencolorio-tools/0005-tinyxml-dependency-search.patch create mode 100644 ports/opencolorio-tools/0006-oiio-dependency-search.patch create mode 100644 ports/opencolorio-tools/CONTROL create mode 100644 ports/opencolorio-tools/portfile.cmake create mode 100644 ports/opencolorio/0006-oiio-dependency-search.patch create mode 100644 ports/opencv2/FindCUDA.cmake create mode 100644 ports/opencv3/0004-add-missing-stdexcept-include.patch create mode 100644 ports/opencv3/FindCUDA.cmake create mode 100644 ports/opencv4/0005-add-missing-stdexcept-include.patch create mode 100644 ports/opencv4/FindCUDA.cmake delete mode 100644 ports/openexr/FindOpenEXR.cmake delete mode 100644 ports/openexr/fix_clang_not_setting_modern_cplusplus.patch delete mode 100644 ports/openexr/fix_install_ilmimf.patch delete mode 100644 ports/openexr/fix_linux_static_library_names.patch create mode 100644 ports/openexr/fixup_cmake_exports_path.patch create mode 100644 ports/openexr/remove_find_package_macro.patch create mode 100644 ports/openexr/remove_symlinks.patch create mode 100644 ports/openjpeg/dll.location.patch create mode 100644 ports/pangolin/fix-dependency-python.patch create mode 100644 ports/pangolin/fix-dependeny-ffmpeg.patch create mode 100644 ports/physx/internalMBP_symbols.patch create mode 100644 ports/pngpp/portfile.cmake create mode 100644 ports/pngpp/vcpkg.json create mode 100644 ports/podofo/freetype.patch create mode 100644 ports/proj4/use-sqlite3-config.patch create mode 100644 ports/qt5-webengine/vs2017.patch create mode 100644 ports/quazip/CONTROL create mode 100644 ports/quazip/portfile.cmake create mode 100644 ports/quazip/vcpkg_remove_extra_static.patch create mode 100644 ports/qwtw/CONTROL create mode 100644 ports/qwtw/portfile.cmake create mode 100644 ports/rsocket/CONTROL create mode 100644 ports/rsocket/fix-cmake-config.patch create mode 100644 ports/rsocket/fix-find-dependencies.patch create mode 100644 ports/rsocket/portfile.cmake delete mode 100644 ports/rtmidi/CMakeLists.txt create mode 100644 ports/secp256k1/secp256k1-config.cmake create mode 100644 ports/sfml/stb_include.patch create mode 100644 ports/simple-fft/CONTROL create mode 100644 ports/simple-fft/portfile.cmake create mode 100644 ports/stx/CMakeLists.patch create mode 100644 ports/stx/CONTROL create mode 100644 ports/stx/portfile.cmake create mode 100644 ports/tlx/CONTROL create mode 100644 ports/tlx/portfile.cmake create mode 100644 ports/tomlplusplus/CONTROL create mode 100644 ports/tomlplusplus/portfile.cmake create mode 100644 ports/vc/CONTROL create mode 100644 ports/vc/correct_cmake_config_path.patch create mode 100644 ports/vc/portfile.cmake create mode 100644 ports/vcpkg-gfortran/CONTROL create mode 100644 ports/vcpkg-gfortran/portfile.cmake create mode 100644 ports/vtk/6811.patch delete mode 100644 ports/wxwidgets/fix-macos-clipboard.patch create mode 100644 ports/wxwidgets/fix-stl-build-vs2019-16.6.patch create mode 100644 ports/xeus/Fix-Compile-nlohmann-json.patch create mode 100644 ports/xframe/CONTROL create mode 100644 ports/xframe/portfile.cmake create mode 100644 ports/zlib/add_debug_postfix_on_mingw.patch create mode 100644 scripts/cmake/vcpkg_find_fortran.cmake create mode 100644 scripts/test_ports/cmake/CONTROL create mode 100644 scripts/test_ports/cmake/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-paraview/CONTROL create mode 100644 scripts/test_ports/vcpkg-ci-paraview/portfile.cmake create mode 100644 toolsrc/include/vcpkg/commands.autocomplete.h create mode 100644 toolsrc/include/vcpkg/commands.buildexternal.h create mode 100644 toolsrc/include/vcpkg/commands.cache.h create mode 100644 toolsrc/include/vcpkg/commands.ci.h create mode 100644 toolsrc/include/vcpkg/commands.ciclean.h create mode 100644 toolsrc/include/vcpkg/commands.contact.h create mode 100644 toolsrc/include/vcpkg/commands.create.h create mode 100644 toolsrc/include/vcpkg/commands.dependinfo.h create mode 100644 toolsrc/include/vcpkg/commands.edit.h create mode 100644 toolsrc/include/vcpkg/commands.env.h create mode 100644 toolsrc/include/vcpkg/commands.fetch.h create mode 100644 toolsrc/include/vcpkg/commands.format-manifest.h create mode 100644 toolsrc/include/vcpkg/commands.hash.h create mode 100644 toolsrc/include/vcpkg/commands.info.h create mode 100644 toolsrc/include/vcpkg/commands.integrate.h create mode 100644 toolsrc/include/vcpkg/commands.interface.h create mode 100644 toolsrc/include/vcpkg/commands.list.h create mode 100644 toolsrc/include/vcpkg/commands.owns.h create mode 100644 toolsrc/include/vcpkg/commands.porthistory.h create mode 100644 toolsrc/include/vcpkg/commands.portsdiff.h create mode 100644 toolsrc/include/vcpkg/commands.search.h create mode 100644 toolsrc/include/vcpkg/commands.setinstalled.h create mode 100644 toolsrc/include/vcpkg/commands.upgrade.h create mode 100644 toolsrc/include/vcpkg/commands.version.h create mode 100644 toolsrc/include/vcpkg/commands.xvsinstances.h delete mode 100644 toolsrc/include/vcpkg/paragraphparseresult.h create mode 100644 toolsrc/src/vcpkg-test/commands.cpp create mode 100644 toolsrc/src/vcpkg/commands.fetch.cpp create mode 100644 toolsrc/src/vcpkg/commands.hash.cpp create mode 100644 toolsrc/src/vcpkg/commands.info.cpp rename toolsrc/src/vcpkg/{commands.exportifw.cpp => export.ifw.cpp} (99%) delete mode 100644 toolsrc/src/vcpkg/paragraphparseresult.cpp delete mode 100644 toolsrc/vcpkg.sln delete mode 100644 toolsrc/vcpkglib/vcpkglib.vcxproj delete mode 100644 toolsrc/vcpkglib/vcpkglib.vcxproj.filters delete mode 100644 toolsrc/vcpkgtest/vcpkgtest.vcxproj delete mode 100644 toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters rename toolsrc/{ => windows-bootstrap}/dirs.proj (100%) create mode 100644 toolsrc/windows-bootstrap/vcpkg.sln rename toolsrc/{ => windows-bootstrap}/vcpkg/vcpkg.vcxproj (92%) rename toolsrc/{ => windows-bootstrap}/vcpkg/vcpkg.vcxproj.filters (88%) create mode 100644 toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj create mode 100644 toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters rename toolsrc/{ => windows-bootstrap}/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj (93%) rename toolsrc/{ => windows-bootstrap}/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters (90%) create mode 100644 triplets/community/s390x-linux.cmake diff --git a/.gitattributes b/.gitattributes index fa1385d99a319b..d0c3b3e9ccf66d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,5 @@ * -text +ports/** -linguist-detectable + +# Declare files that will always have LF line endings on checkout. +scripts/ci.baseline.txt text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index d3be89f6075413..b971df79de29c6 100644 --- a/.gitignore +++ b/.gitignore @@ -289,47 +289,25 @@ __pycache__/ /packages/ /scripts/buildsystems/tmp/ /toolsrc/build.rel/ -/toolsrc/msbuild.x86.debug/ -/toolsrc/msbuild.x86.release/ -/toolsrc/msbuild.x64.debug/ -/toolsrc/msbuild.x64.release/ +/toolsrc/windows-bootstrap/msbuild.x86.debug/ +/toolsrc/windows-bootstrap/msbuild.x86.release/ +/toolsrc/windows-bootstrap/msbuild.x64.debug/ +/toolsrc/windows-bootstrap/msbuild.x64.release/ +#ignore custom triplets /triplets/* #add vcpkg-designed triplets back in -!triplets/community/arm64-mingw-dynamic.cmake -!triplets/community/arm64-mingw-static.cmake -!triplets/community/arm64-uwp.cmake -!triplets/community/arm64-windows-static.cmake -!triplets/community/arm-mingw-dynamic.cmake -!triplets/community/arm-mingw-static.cmake -!triplets/community/arm-windows.cmake -!triplets/community/x64-mingw-dynamic.cmake -!triplets/community/x64-mingw-static.cmake -!triplets/community/x64-windows-static-md.cmake -!triplets/community/x86-mingw-dynamic.cmake -!triplets/community/x86-mingw-static.cmake -!triplets/community/x86-uwp.cmake -!triplets/community/x86-windows-static.cmake -!triplets/community/x86-windows-static-md.cmake -!triplets/community/x64-osx-dynamic.cmake -!triplets/community/x64-android.cmake -!triplets/community/x86-android.cmake -!triplets/community/arm-android.cmake -!triplets/community/arm64-android.cmake -!triplets/community/arm64-ios.cmake -!triplets/community/arm-ios.cmake -!triplets/community/x64-ios.cmake -!triplets/community/x86-ios.cmake -!triplets/community/wasm32-emscripten.cmake -!triplets/community/arm64-osx.cmake -!triplets/arm-uwp.cmake -!triplets/x64-uwp.cmake -!triplets/x64-windows.cmake -!triplets/x64-windows-static.cmake -!triplets/x86-windows.cmake -!triplets/arm64-windows.cmake -!triplets/x64-linux.cmake -!triplets/x64-osx.cmake -#ignore custom triplets +!/triplets/arm-uwp.cmake +!/triplets/arm64-windows.cmake +!/triplets/x64-linux.cmake +!/triplets/x64-osx.cmake +!/triplets/x64-uwp.cmake +!/triplets/x64-windows-static.cmake +!/triplets/x64-windows.cmake +!/triplets/x86-windows.cmake + +!/triplets/community +!/triplets/community/** + *.exe *.zip diff --git a/README.md b/README.md index 1764b5a1137a9b..f3e19058477270 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ you may use a simple `vcpkg install --feature-flags=manifests` For more information, check out the [manifest][getting-started:manifest-spec] specification. -[getting-started:using-a-package]: docs/examples/intalling-and-using-packages.md +[getting-started:using-a-package]: docs/examples/installing-and-using-packages.md [getting-started:integration]: docs/users/integration.md [getting-started:git]: https://git-scm.com/downloads [getting-started:cmake-tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools diff --git a/docs/examples/installing-and-using-packages.md b/docs/examples/installing-and-using-packages.md index f98de78ab14917..011df93a4cc9f9 100644 --- a/docs/examples/installing-and-using-packages.md +++ b/docs/examples/installing-and-using-packages.md @@ -47,8 +47,8 @@ Total elapsed time: 12.04 s The package sqlite3:x86-windows provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)) ``` @@ -118,11 +118,11 @@ Now let's make a simple CMake project with a main file. cmake_minimum_required(VERSION 3.0) project(test) -find_package(sqlite3 CONFIG REQUIRED) +find_package(unofficial-sqlite3 CONFIG REQUIRED) add_executable(main main.cpp) -target_link_libraries(main PRIVATE sqlite3) +target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` ```cpp // main.cpp diff --git a/docs/examples/overlay-triplets-linux-dynamic.md b/docs/examples/overlay-triplets-linux-dynamic.md index 7d0540927d4c49..5d79013377afb1 100644 --- a/docs/examples/overlay-triplets-linux-dynamic.md +++ b/docs/examples/overlay-triplets-linux-dynamic.md @@ -55,8 +55,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux-dynamic provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` Overlay triplets enables your custom triplet files when using `vcpkg install`, `vcpkg update`, `vcpkg upgrade`, and `vcpkg remove`. @@ -115,8 +115,8 @@ Total elapsed time: 44.82 s The package sqlite3:x64-linux provides CMake targets: - find_package(sqlite3 CONFIG REQUIRED) - target_link_libraries(main PRIVATE sqlite3) + find_package(unofficial-sqlite3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) ``` Note that the default triplet is masked by your custom triplet: diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 0b653225802bfd..e0fde7e6885c63 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -208,6 +208,34 @@ Note that if a library generates CMake integration files (`foo-config.cmake`), r Finally, DLL files on Windows should never be renamed post-build because it breaks the generated LIBs. +## Code format + +### Vcpkg internal code + +We require the c/c++ code inside vcpkg to follow the clang-format, if you change them. Please perform the following steps after modification: + +- Use Visual Studio: +1. Configure your [clang-format tools](https://devblogs.microsoft.com/cppblog/clangformat-support-in-visual-studio-2017-15-7-preview-1/). +2. Open the modified file. +3. Use shortcut keys Ctrl+K, Ctrl+D to format the current file. + +- Use tools: +1. Install [llvm clang-format](https://releases.llvm.org/download.html#10.0.0) +2. Run command: +```cmd +> LLVM_PATH/bin/clang-format.exe -style=file -i changed_file.cpp +``` + +### Manifest + +We require that the manifest file needs to be formatted, perform the following steps to solve this issue: + +1. Format all changed manifest files. +```cmd +> vcpkg x-format-manifest --all +``` +2. Commit changes to your branch. + ## Useful implementation notes ### Portfiles are run in Script Mode diff --git a/docs/maintainers/vcpkg_check_linkage.md b/docs/maintainers/vcpkg_check_linkage.md index 406325dba08f84..eb20e97c861919 100644 --- a/docs/maintainers/vcpkg_check_linkage.md +++ b/docs/maintainers/vcpkg_check_linkage.md @@ -28,7 +28,7 @@ This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail, ## Examples -* [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake) +* [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake) ## Source -[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) +[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) diff --git a/docs/users/config-environment.md b/docs/users/config-environment.md index ffa988cbc38346..22f7ff84a2d3e1 100644 --- a/docs/users/config-environment.md +++ b/docs/users/config-environment.md @@ -38,11 +38,19 @@ Example: `D:\2017` This environment variable can be set to a triplet name which will be used for unqualified triplet references in command lines. +#### VCPKG_OVERLAY_PORTS + +This environment variable allows users to override ports with alternate versions according to the +[ports overlay](../specifications/ports-overlay.md) specification. List paths to overlays using +the platform dependent PATH seperator (Windows `;` | others `:`) + +Example (Windows): `C:\custom-ports\boost;C:\custom-ports\sqlite3` + #### VCPKG_FORCE_SYSTEM_BINARIES This environment variable, if set, suppresses the downloading of CMake and Ninja and forces the use of the system binaries. -### VCPKG_KEEP_ENV_VARS +#### VCPKG_KEEP_ENV_VARS This environment variable can be set to a list of environment variables, separated by `;`, which will be propagated to the build environment. diff --git a/ports/3fd/vcpkg.json b/ports/3fd/vcpkg.json index f183916e6613ff..92c53d327f5a79 100644 --- a/ports/3fd/vcpkg.json +++ b/ports/3fd/vcpkg.json @@ -16,7 +16,7 @@ "name": "poco", "platform": "windows" }, - "sqlite3", - "rapidxml" + "rapidxml", + "sqlite3" ] } diff --git a/ports/abseil/fix-cmake-threads-dependency.patch b/ports/abseil/fix-cmake-threads-dependency.patch new file mode 100644 index 00000000000000..0dda75e36ab3d4 --- /dev/null +++ b/ports/abseil/fix-cmake-threads-dependency.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/abslConfig.cmake.in b/CMake/abslConfig.cmake.in +index 60847fa77..6d23f63d3 100644 +--- a/CMake/abslConfig.cmake.in ++++ b/CMake/abslConfig.cmake.in +@@ -1,6 +1,7 @@ + # absl CMake configuration file. + +-include(FindThreads) ++include(CMakeFindDependencyMacro) ++find_dependency(Threads) + + @PACKAGE_INIT@ + diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 8fcf0bb7630b42..0b62c6c2e25407 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -7,9 +7,12 @@ set(ABSEIL_PATCHES # This patch is an upstream commit, the related PR: https://github.com/abseil/abseil-cpp/pull/637 fix-MSVCbuildfail.patch - + # Remove this patch in next update, see https://github.com/google/cctz/pull/145 fix-arm-build.patch + + # This patch is an upstream commit: https://github.com/abseil/abseil-cpp/commit/68494aae959dfbbf781cdf03a988d2f5fc7e4802 + fix-cmake-threads-dependency.patch ) if("cxx17" IN_LIST FEATURES) diff --git a/ports/abseil/vcpkg.json b/ports/abseil/vcpkg.json index cfc1022ea4f9cc..79e6c308b5d097 100644 --- a/ports/abseil/vcpkg.json +++ b/ports/abseil/vcpkg.json @@ -1,14 +1,14 @@ { "name": "abseil", "version-string": "2020-03-03", - "port-version": 7, - "homepage": "https://github.com/abseil/abseil-cpp", + "port-version": 8, "description": [ "an open-source collection designed to augment the C++ standard library.", "Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.", "In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.", "Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole." ], + "homepage": "https://github.com/abseil/abseil-cpp", "features": [ { "name": "cxx17", diff --git a/ports/akali/CONTROL b/ports/akali/CONTROL index a7acd59194766c..35f86f28ce02e9 100644 --- a/ports/akali/CONTROL +++ b/ports/akali/CONTROL @@ -1,4 +1,5 @@ Source: akali Version: 1.41 +Port-Version: 1 Description: C++ Common Library. -Homepage: https://github.com/winsoft666/akali \ No newline at end of file +Homepage: https://github.com/winsoft666/akali diff --git a/ports/alembic/CONTROL b/ports/alembic/CONTROL index 54442f2e444166..9c2b40ff63460b 100644 --- a/ports/alembic/CONTROL +++ b/ports/alembic/CONTROL @@ -1,5 +1,5 @@ Source: alembic -Version: 1.7.12-1 +Version: 1.7.13 Build-Depends: ilmbase, hdf5 Description: Alembic is an open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications. Homepage: https://alembic.io/ diff --git a/ports/alembic/fix-C1083.patch b/ports/alembic/fix-C1083.patch deleted file mode 100644 index 15de9f514f9f26..00000000000000 --- a/ports/alembic/fix-C1083.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/lib/Alembic/Abc/Foundation.h b/lib/Alembic/Abc/Foundation.h -index 9760c49..fbab6a0 100644 ---- a/lib/Alembic/Abc/Foundation.h -+++ b/lib/Alembic/Abc/Foundation.h -@@ -40,11 +40,11 @@ - #include - #include - --#include --#include --#include --#include --#include -+#include -+#include -+#include -+#include -+#include - - #include - #include -diff --git a/lib/Alembic/AbcGeom/Foundation.h b/lib/Alembic/AbcGeom/Foundation.h -index 301efc3..2bb0f6b 100644 ---- a/lib/Alembic/AbcGeom/Foundation.h -+++ b/lib/Alembic/AbcGeom/Foundation.h -@@ -39,8 +39,8 @@ - - #include - --#include --#include -+#include -+#include - - - namespace Alembic { -diff --git a/lib/Alembic/Util/Foundation.h b/lib/Alembic/Util/Foundation.h -index d7f40dd..a41bb97 100644 ---- a/lib/Alembic/Util/Foundation.h -+++ b/lib/Alembic/Util/Foundation.h -@@ -63,7 +63,7 @@ - - #include - --#include -+#include - - #include - #include diff --git a/ports/alembic/fix-find-openexr-ilmbase.patch b/ports/alembic/fix-find-openexr-ilmbase.patch index 6a72711f425964..f35f17df35ec4f 100644 --- a/ports/alembic/fix-find-openexr-ilmbase.patch +++ b/ports/alembic/fix-find-openexr-ilmbase.patch @@ -2,7 +2,7 @@ diff --git a/cmake/AlembicIlmBase.cmake b/cmake/AlembicIlmBase.cmake index cd00d70..0e50512 100644 --- a/cmake/AlembicIlmBase.cmake +++ b/cmake/AlembicIlmBase.cmake -@@ -33,11 +33,25 @@ +@@ -33,11 +33,17 @@ ## ##-***************************************************************************** @@ -16,17 +16,9 @@ index cd00d70..0e50512 100644 + set(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${OpenEXR_INCLUDE_DIRS}/OpenEXR) + set(ALEMBIC_ILMBASE_HALF_LIB ${OPENEXR_HALF_LIBRARY}) + set(ALEMBIC_ILMBASE_IEX_LIB ${OPENEXR_IEX_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OpenEXR_IEXMATH_LIBRARY}) ++ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IMATH_LIBRARY}) + set(ALEMBIC_ILMBASE_ILMTHREAD_LIB ${OPENEXR_ILMTHREAD_LIBRARY}) -+ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) -+ -+ MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) -+ MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) -+ MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) -+ MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) -+ MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) -+ MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) -+ ++ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY}) SET(ALEMBIC_ILMBASE_LIBS ${ALEMBIC_ILMBASE_IMATH_LIB} ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} @@ -46,348 +38,13 @@ diff --git a/cmake/AlembicOpenEXR.cmake b/cmake/AlembicOpenEXR.cmake index 0833b32..a9180cd 100644 --- a/cmake/AlembicOpenEXR.cmake +++ b/cmake/AlembicOpenEXR.cmake -@@ -38,8 +38,12 @@ +@@ -38,8 +38,8 @@ FIND_PACKAGE( OpenEXR ) IF( OPENEXR_FOUND ) - SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS} ) + SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS}/OpenEXR ) SET( ALEMBIC_OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ) -+ -+ MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) -+ MESSAGE( STATUS "OPENEXR LIB: ${ALEMBIC_OPENEXR_LIBRARIES}" ) -+ # SET( ALEMBIC_OPENEXR_DEFINITIONS ${OPENEXR_DEFINITIONS} ) SET( ALEMBIC_OPENEXR_FOUND 1 CACHE STRING "Set to 1 if OpenEXR is found, 0 otherwise" ) -diff --git a/cmake/Modules/FindIlmBase.cmake b/cmake/Modules/FindIlmBase.cmake -deleted file mode 100644 -index 679a02f..0000000 ---- a/cmake/Modules/FindIlmBase.cmake -+++ /dev/null -@@ -1,190 +0,0 @@ --##-***************************************************************************** --## --## Copyright (c) 2009-2016, --## Sony Pictures Imageworks Inc. and --## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. --## --## All rights reserved. --## --## Redistribution and use in source and binary forms, with or without --## modification, are permitted provided that the following conditions are --## met: --## * Redistributions of source code must retain the above copyright --## notice, this list of conditions and the following disclaimer. --## * Redistributions in binary form must reproduce the above --## copyright notice, this list of conditions and the following disclaimer --## in the documentation and/or other materials provided with the --## distribution. --## * Neither the name of Industrial Light & Magic nor the names of --## its contributors may be used to endorse or promote products derived --## from this software without specific prior written permission. --## --## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --## --##-***************************************************************************** -- --#-****************************************************************************** --#-****************************************************************************** --# FIRST, ILMBASE STUFF --#-****************************************************************************** --#-****************************************************************************** -- --# If ILMBASE_ROOT was defined in the environment, use it. --IF(NOT ILMBASE_ROOT AND NOT $ENV{ILMBASE_ROOT} STREQUAL "") -- SET(ILMBASE_ROOT $ENV{ILMBASE_ROOT}) --ENDIF() -- --IF(NOT DEFINED ILMBASE_ROOT) -- MESSAGE(STATUS "ILMBASE_ROOT is undefined" ) -- IF ( ${CMAKE_HOST_UNIX} ) -- IF( ${DARWIN} ) -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) -- ELSE() -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_ILMBASE_ROOT "/usr/local/ilmbase-1.0.1/" ) -- ENDIF() -- ELSE() -- IF ( ${WINDOWS} ) -- # TODO: set to 32-bit or 64-bit path -- SET( ALEMBIC_ILMBASE_ROOT "C:/Program Files (x86)/ilmbase-1.0.1/" ) -- ELSE() -- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND ) -- ENDIF() -- ENDIF() --ELSE() -- SET( ALEMBIC_ILMBASE_ROOT ${ILMBASE_ROOT} ) --ENDIF() -- --SET(_ilmbase_FIND_COMPONENTS -- Half -- Iex -- IexMath -- IlmThread -- Imath --) -- --SET(_ilmbase_SEARCH_DIRS -- ${ALEMBIC_ILMBASE_ROOT} -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local -- /usr -- /sw -- /opt/local -- /opt/csw -- /opt -- /usr/freeware --) -- --FIND_PATH(ILMBASE_INCLUDE_DIR -- NAMES -- IlmBaseConfig.h -- HINTS -- ${_ilmbase_SEARCH_DIRS} -- PATH_SUFFIXES -- include -- include/OpenEXR --) -- --# If the headers were found, get the version from config file, if not already set. --IF(ILMBASE_INCLUDE_DIR) -- SET(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${ILMBASE_INCLUDE_DIR}) -- IF(NOT ILMBASE_VERSION) -- -- FIND_FILE(_ilmbase_CONFIG -- NAMES -- IlmBaseConfig.h -- PATHS -- "${ILMBASE_INCLUDE_DIR}" -- "${ILMBASE_INCLUDE_DIR}/OpenEXR" -- ) -- -- IF(_ilmbase_CONFIG) -- FILE(STRINGS "${_ilmbase_CONFIG}" ILMBASE_BUILD_SPECIFICATION -- REGEX "^[ \t]*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"[.0-9]+\".*$") -- ELSE() -- MESSAGE(WARNING "Could not find \"OpenEXRConfig.h\" in \"${ILMBASE_INCLUDE_DIR}\"") -- ENDIF() -- -- IF(ILMBASE_BUILD_SPECIFICATION) -- STRING(REGEX REPLACE ".*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"([.0-9]+)\".*" -- "\\2" _ilmbase_libs_ver_init ${ILMBASE_BUILD_SPECIFICATION}) -- ELSE() -- MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_ilmbase_libs_ver_init}.") -- ENDIF() -- -- UNSET(_ilmbase_CONFIG CACHE) -- -- ENDIF() -- -- SET("ILMBASE_VERSION" ${_ilmbase_libs_ver_init} CACHE STRING "Version of OpenEXR lib") -- UNSET(_ilmbase_libs_ver_init) -- -- STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION}) --ENDIF() -- -- --SET(_ilmbase_LIBRARIES) --FOREACH(COMPONENT ${_ilmbase_FIND_COMPONENTS}) -- STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) -- -- FIND_LIBRARY(ALEMBIC_ILMBASE_${UPPERCOMPONENT}_LIB -- NAMES -- ${COMPONENT}-${_ilmbase_libs_ver} ${COMPONENT} -- HINTS -- ${_ilmbase_SEARCH_DIRS} -- PATH_SUFFIXES -- lib64 lib -- ) -- LIST(APPEND _ilmbase_LIBRARIES "${ILMBASE_${UPPERCOMPONENT}_LIBRARY}") --ENDFOREACH() -- --UNSET(_ilmbase_libs_ver) -- --IF ( ${ALEMBIC_ILMBASE_HALF_LIB} STREQUAL "ALEMBIC_ILMBASE_HALF_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_IEX_LIB} STREQUAL "ALEMBIC_ILMBASE_IEX_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( DEFINED USE_IEXMATH AND USE_IEXMATH ) -- IF ( ${ALEMBIC_ILMBASE_IEXMATH_LIB} STREQUAL -- "ALEMBIC_ILMBASE_IEXMATH_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IexMath, IlmThread, Imath) not found, required" ) -- ENDIF() --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} STREQUAL "ALEMBIC_ILMBASE_ILMTHREAD_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_IMATH_LIB} STREQUAL "ALEMBIC_ILMBASE_IMATH_LIB-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" ) --ENDIF() -- --IF ( ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY} STREQUAL "ALEMBIC_ILMBASE_INCLUDE_DIRECTORY-NOTFOUND" ) -- MESSAGE( FATAL_ERROR "ilmbase header files not found, required: ALEMBIC_ILMBASE_ROOT: ${ALEMBIC_ILMBASE_ROOT}" ) --ENDIF() -- -- --MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" ) --MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" ) --MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" ) --MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" ) --MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" ) --MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" ) -- --SET( ILMBASE_FOUND TRUE ) -diff --git a/cmake/Modules/FindOpenEXR.cmake b/cmake/Modules/FindOpenEXR.cmake -deleted file mode 100644 -index 935fe6f..0000000 ---- a/cmake/Modules/FindOpenEXR.cmake -+++ /dev/null -@@ -1,129 +0,0 @@ --##-***************************************************************************** --## --## Copyright (c) 2009-2011, --## Sony Pictures Imageworks Inc. and --## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. --## --## All rights reserved. --## --## Redistribution and use in source and binary forms, with or without --## modification, are permitted provided that the following conditions are --## met: --## * Redistributions of source code must retain the above copyright --## notice, this list of conditions and the following disclaimer. --## * Redistributions in binary form must reproduce the above --## copyright notice, this list of conditions and the following disclaimer --## in the documentation and/or other materials provided with the --## distribution. --## * Neither the name of Industrial Light & Magic nor the names of --## its contributors may be used to endorse or promote products derived --## from this software without specific prior written permission. --## --## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --## --##-***************************************************************************** -- -- --# We shall worry about windowsification later. -- --#-****************************************************************************** --#-****************************************************************************** --# NOW, OPENEXR STUFF. EXR IS OPTIONAL, WHERASE ILMBASE IS NOT --#-****************************************************************************** --#-****************************************************************************** -- --IF(NOT DEFINED OPENEXR_ROOT) -- IF ( ${CMAKE_HOST_UNIX} ) -- IF( ${DARWIN} ) -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ELSE() -- # TODO: set to default install path when shipping out -- SET( ALEMBIC_OPENEXR_ROOT "/usr/local/openexr-1.6.1/" ) -- ENDIF() -- ELSE() -- IF ( ${WINDOWS} ) -- # TODO: set to 32-bit or 64-bit path -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ELSE() -- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND ) -- ENDIF() -- ENDIF() --ELSE() -- SET( ALEMBIC_OPENEXR_ROOT ${OPENEXR_ROOT} ) --ENDIF() -- --IF(NOT $ENV{OPENEXR_ROOT}x STREQUAL "x") -- SET( ALEMBIC_OPENEXR_ROOT $ENV{OPENEXR_ROOT}) --ELSE() -- SET( ENV{OPENEXR_ROOT} ${OPENEXR_ROOT} ) --ENDIF() -- -- --SET(LIBRARY_PATHS -- ${ALEMBIC_OPENEXR_ROOT}/lib -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local/lib -- /usr/lib -- /sw/lib -- /opt/local/lib -- /opt/csw/lib -- /opt/lib -- /usr/freeware/lib64 --) -- --SET(INCLUDE_PATHS -- ${ALEMBIC_OPENEXR_ROOT}/include/OpenEXR/ -- ~/Library/Frameworks -- /Library/Frameworks -- /usr/local/include/OpenEXR/ -- /usr/local/include -- /usr/include -- /sw/include # Fink -- /opt/local/include # DarwinPorts -- /opt/csw/include # Blastwave -- /opt/include -- /usr/freeware/include --) -- --FIND_PATH( ALEMBIC_OPENEXR_INCLUDE_PATH ImfRgba.h -- PATHS -- ${INCLUDE_PATHS} -- DOC "The directory where ImfRgba.h resides" ) -- --FIND_LIBRARY( ALEMBIC_OPENEXR_ILMIMF_LIB IlmImf -- PATHS -- ${LIBRARY_PATHS} -- DOC "The IlmImf library" ) -- -- --SET( OPENEXR_FOUND TRUE ) -- --IF ( ${ALEMBIC_OPENEXR_INCLUDE_PATH} STREQUAL "ALEMBIC_OPENEXR_INCLUDE_PATH-NOTFOUND" ) -- MESSAGE( STATUS "OpenEXR include path not found, disabling" ) -- SET( OPENEXR_FOUND FALSE ) --ENDIF() -- --IF ( ${ALEMBIC_OPENEXR_ILMIMF_LIB} STREQUAL "ALEMBIC_OPENEXR_ILMIMF_LIB-NOTFOUND" ) -- MESSAGE( STATUS "OpenEXR libraries not found, disabling" ) -- SET( OPENEXR_FOUND FALSE ) -- SET( ALEMBIC_OPENEXR_LIBS NOTFOUND ) --ENDIF() -- --IF (OPENEXR_FOUND) -- MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" ) -- SET( ALEMBIC_OPENEXR_LIBS ${ALEMBIC_OPENEXR_ILMIMF_LIB} ) --ENDIF() -- -- diff --git a/ports/alembic/portfile.cmake b/ports/alembic/portfile.cmake index ecd1974940e0a3..58ad015dba5085 100644 --- a/ports/alembic/portfile.cmake +++ b/ports/alembic/portfile.cmake @@ -5,14 +5,16 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO alembic/alembic - REF 1.7.12 - SHA512 e05e0b24056c17f01784ced1f9606a269974de195f1aca8a6fce2123314e7ee609f70df77ac7fe18dc7f0c04fb883d38cc7de9b963caacf9586aaa24d4ac6210 + REF cfe114639ef7ad084d61e71ab86a17e708d838ae #v1.7.13 + SHA512 38b797c1179e759870f10afc4a2182bc3e874eacecc9627c879d3a5cf35e49c83cae80600678427e5c22d6576d0e6280ce3cf0a2ac505f1df74ec4a8bdb083b5 HEAD_REF master PATCHES - fix-C1083.patch fix-find-openexr-ilmbase.patch ) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindIlmBase.cmake) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindOpenEXR.cmake) + if(NOT VCPKG_TARGET_IS_WINDOWS) # In debug mode with g++, alembic defines -Werror # so we need to disable some warnings to avoid build errors @@ -49,20 +51,20 @@ if(VCPKG_TARGET_IS_WINDOWS) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/bin/Alembic.dll) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Alembic.dll ${CURRENT_PACKAGES_DIR}/debug/bin/Alembic.dll) - file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake DEBUG_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake DEBUG_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/Alembic.dll" "\${_IMPORT_PREFIX}/debug/bin/Alembic.dll" DEBUG_CONFIG "${DEBUG_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-debug.cmake "${DEBUG_CONFIG}") - file(READ ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake RELEASE_CONFIG) + file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake RELEASE_CONFIG) string(REPLACE "\${_IMPORT_PREFIX}/lib/Alembic.dll" "\${_IMPORT_PREFIX}/bin/Alembic.dll" RELEASE_CONFIG "${RELEASE_CONFIG}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/alembic/AlembicTargets-release.cmake "${RELEASE_CONFIG}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/AlembicTargets-release.cmake "${RELEASE_CONFIG}") else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/alembic) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/alembic RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/apr/CONTROL b/ports/apr/CONTROL index 607f6c4d4abbe2..2c9c0c691cae7c 100644 --- a/ports/apr/CONTROL +++ b/ports/apr/CONTROL @@ -1,5 +1,6 @@ Source: apr -Version: 1.7.0-1 +Version: 1.7.0 +Port-Version: 2 Homepage: https://apr.apache.org/ Description: The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems. Supports: !uwp diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index b3ede1a1da2243..39f2370018299a 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -82,7 +82,7 @@ else() vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/lib/pkgconfig/apr-1.pc "-lapr-\${APR_MAJOR_VERSION}" "-lapr-1" ) - vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl) + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread rt dl uuid crypt) endif() # Handle copyright diff --git a/ports/argparse/vcpkg.json b/ports/argparse/vcpkg.json index 9137c655f6866d..438522292049c3 100644 --- a/ports/argparse/vcpkg.json +++ b/ports/argparse/vcpkg.json @@ -2,6 +2,6 @@ "name": "argparse", "version-string": "2.1", "description": "Argument parser for modern C++", - "license": "MIT", - "homepage": "https://github.com/p-ranav/argparse" + "homepage": "https://github.com/p-ranav/argparse", + "license": "MIT" } diff --git a/ports/argtable3/CONTROL b/ports/argtable3/CONTROL deleted file mode 100644 index f894b4fc5ba7f9..00000000000000 --- a/ports/argtable3/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: argtable3 -Version: 2019-08-21 -Description: A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options -Homepage: www.argtable.org diff --git a/ports/argtable3/fix-cmake.patch b/ports/argtable3/fix-cmake.patch deleted file mode 100644 index 320e6385e939a3..00000000000000 --- a/ports/argtable3/fix-cmake.patch +++ /dev/null @@ -1,98 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 57bd7a1..e19e677 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -65,10 +65,6 @@ if(ARGTABLE3_ENABLE_CONAN AND EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${LINK_FLAGS}") - endif() - --if(ARGTABLE3_ENABLE_TESTS) -- enable_testing() --endif() -- - set(ARGTABLE3_AMALGAMATION_SRC_FILE ${PROJECT_SOURCE_DIR}/dist/argtable3.c) - set(ARGTABLE3_SRC_FILES - ${PROJECT_SOURCE_DIR}/src/arg_cmd.c -@@ -88,18 +84,11 @@ set(ARGTABLE3_SRC_FILES - ${PROJECT_SOURCE_DIR}/src/getopt_long.c - ) - --# Platform specific settings for installation --if(UNIX) -- include(GNUInstallDirs) -- set(ARGTABLE3_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) -- set(ARGTABLE3_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) -- set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) --elseif(WIN32) -- set(ARGTABLE3_INSTALL_LIBDIR "lib") -- set(ARGTABLE3_INSTALL_INCLUDEDIR "include") -- set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") --endif(UNIX) -- - add_subdirectory(src) --add_subdirectory(tests) -+ -+if(ARGTABLE3_ENABLE_TESTS) -+ enable_testing() -+ add_subdirectory(tests) -+endif() -+ - add_subdirectory(examples) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 429b143..f45c071 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -28,9 +28,19 @@ - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ################################################################################ - --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") --set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") -+include(GNUInstallDirs) -+ -+if(UNIX) -+ set(ARGTABLE3_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/argtable3) -+elseif(WIN32) -+ set(ARGTABLE3_INSTALL_CMAKEDIR "cmake") -+endif(UNIX) -+ -+if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -Wpedantic") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") -+endif() - - add_definitions(-D_XOPEN_SOURCE=700) - -@@ -46,6 +56,7 @@ if(WIN32) - "${PROJECT_BINARY_DIR}/src/version.rc" - ) - add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES} "${PROJECT_BINARY_DIR}/src/version.rc") -+ target_compile_definitions(argtable3 INTERFACE argtable3_IMPORTS) - else() - add_library(argtable3 SHARED ${ARGTABLE3_SRC_FILES}) - endif() -@@ -57,8 +68,18 @@ target_include_directories(argtable3 PRIVATE ${PROJECT_SOURCE_DIR}/src) - set_target_properties(argtable3 argtable3_static PROPERTIES - VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) -- --install(TARGETS argtable3 EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) --install(TARGETS argtable3_static EXPORT ${ARGTABLE3_PACKAGE_NAME}Config ARCHIVE DESTINATION ${ARGTABLE3_INSTALL_LIBDIR}) --install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${ARGTABLE3_INSTALL_INCLUDEDIR}) -+if(BUILD_SHARED_LIBS) -+install(TARGETS argtable3 -+ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+else() -+install(TARGETS argtable3_static -+ EXPORT ${ARGTABLE3_PACKAGE_NAME}Config -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+endif() -+install(FILES "${PROJECT_SOURCE_DIR}/src/argtable3.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - install(EXPORT ${ARGTABLE3_PACKAGE_NAME}Config DESTINATION ${ARGTABLE3_INSTALL_CMAKEDIR}) diff --git a/ports/argtable3/portfile.cmake b/ports/argtable3/portfile.cmake index 18d994cc540973..4e90c02e07b737 100644 --- a/ports/argtable3/portfile.cmake +++ b/ports/argtable3/portfile.cmake @@ -1,13 +1,9 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO argtable/argtable3 - REF bbc4ec20991e87ecf8dcf288aef777b55b78daa7 - SHA512 050f54ead2d029715d8f10e63ff555027ead61fbfa18bd955e3b99e080f9178ad5c41937c5d62477885143f27bb9e7e505a7120b95bfcd899a60719584191f1c + REF 1c1bb23b305c8cf349328fc0cacd7beb7a575ff4 # v3.1.5 + SHA512 13150c8adc1eda107b6df65a2e276510a66bd912f6067d7cc72951735a4c20307144b04cda959cdd24f160da3810ba8bb35e48992ff4281e44ed2331d030fb1d HEAD_REF master - PATCHES - fix-cmake.patch ) vcpkg_configure_cmake( @@ -29,14 +25,9 @@ elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT}) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) endif() -file(COPY - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} -) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_replace_string( @@ -46,8 +37,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME ${PORT}) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/argtable3/vcpkg.json b/ports/argtable3/vcpkg.json new file mode 100644 index 00000000000000..37c2ec78b4bf3b --- /dev/null +++ b/ports/argtable3/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "argtable3", + "version-string": "3.1.5", + "description": "A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options", + "homepage": "www.argtable.org" +} diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL index 463b8e670cf805..c266b9112f2711 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -1,4 +1,5 @@ Source: armadillo -Version: 2019-04-16-8 +Version: 2019-04-16 +Port-Version: 9 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: openblas (!osx), clapack (!osx) +Build-Depends: openblas (!osx), lapack diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index 0b171b34f919bd..dc7ea8c81e3bd8 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -1,6 +1,6 @@ Source: arrow -Version: 0.17.1 -Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl +Version: 1.0.0 +Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, bzip2, zstd, snappy, gflags, thrift, double-conversion, glog, uriparser, openssl, utf8proc Homepage: https://github.com/apache/arrow Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations. Supports: x64 diff --git a/ports/arrow/all.patch b/ports/arrow/all.patch index 4116a1e5f5b1a8..a566e2a0503b3f 100644 --- a/ports/arrow/all.patch +++ b/ports/arrow/all.patch @@ -102,65 +102,105 @@ index bb3eb5608..0b03d37d3 100644 find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include") find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin") diff --git a/cpp/cmake_modules/FindZSTD.cmake b/cpp/cmake_modules/FindZSTD.cmake -index 8e47086e8..d87906a25 100644 +index 84d21d2b5..971a9dec3 100644 --- a/cpp/cmake_modules/FindZSTD.cmake +++ b/cpp/cmake_modules/FindZSTD.cmake -@@ -19,14 +19,18 @@ if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) - set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") +@@ -24,11 +24,11 @@ if(ARROW_ZSTD_USE_SHARED) + list(APPEND ZSTD_LIB_NAMES + "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}") + else() +- if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) +- set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") ++ if(MSVC AND CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(ZSTD_MSVC_DEBUG_LIB_SUFFIX d) + endif() + set(ZSTD_STATIC_LIB_SUFFIX +- "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ "${ZSTD_MSVC_DEBUG_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) + set(ZSTD_LIB_NAMES "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}") endif() - --set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(ZSTD_LIB_NAME_DEBUG_SUFFIX d) -+endif() -+ -+set(ZSTD_STATIC_LIB_SUFFIX "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${ZSTD_LIB_NAME_DEBUG_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(ZSTD_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) - - # First, find via if specified ZTD_ROOT - if(ZSTD_ROOT) - message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}") - find_library(ZSTD_LIB -- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" -+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" - "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" - PATHS ${ZSTD_ROOT} - PATH_SUFFIXES ${LIB_PATH_SUFFIXES} -@@ -39,19 +43,18 @@ if(ZSTD_ROOT) - +@@ -49,8 +49,8 @@ if(ZSTD_ROOT) + else() # Second, find via pkg_check_modules - pkg_check_modules(ZSTD_PC libzstd) - if(ZSTD_PC_FOUND) -+ if(0) # Disabled as incompatible with vcpkg ++ #pkg_check_modules(ZSTD_PC libzstd) ++ if(0) #(ZSTD_PC_FOUND) # Disabled as sometimes incompatible with vcpkg on Linux and OSX set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}") - + list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") -- find_library(ZSTD_LIB zstd -+ find_library(ZSTD_LIB zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} - PATHS ${ZSTD_PC_LIBRARY_DIRS} - NO_DEFAULT_PATH - PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - # Third, check all other CMake paths - else() - find_library(ZSTD_LIB -- NAMES zstd "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" -+ NAMES zstd${ZSTD_LIB_NAME_DEBUG_SUFFIX} "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}" - "${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}" - PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - find_path(ZSTD_INCLUDE_DIR NAMES zstd.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) -diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake -index 6110a5aa5..3270d74a9 100644 ---- a/cpp/cmake_modules/SetupCxxFlags.cmake -+++ b/cpp/cmake_modules/SetupCxxFlags.cmake -@@ -163,7 +163,9 @@ macro(arrow_add_werror_if_debug) - if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - # Treat all compiler warnings as errors - if(MSVC) -- set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") -+ if(MSVC_VERSION VERSION_LESS 1900) -+ set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /WX") -+ endif() - else() - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Werror") - endif() +diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake +index 3b229846c..da2c6d551 100644 +--- a/cpp/cmake_modules/DefineOptions.cmake ++++ b/cpp/cmake_modules/DefineOptions.cmake +@@ -297,6 +297,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + define_option(ARROW_PROTOBUF_USE_SHARED + "Rely on Protocol Buffers shared libraries where relevant" ON) + ++ define_option(ARROW_UTF8PROC_USE_SHARED ++ "Rely on utf8proc shared libraries where relevant" ON) ++ + define_option(ARROW_ZSTD_USE_SHARED "Rely on zstd shared libraries where relevant" ON) + + define_option(ARROW_WITH_BACKTRACE "Build with backtrace support" ON) +diff --git a/cpp/cmake_modules/Findutf8proc.cmake b/cpp/cmake_modules/Findutf8proc.cmake +index ab9ae9f98..d3063827a 100644 +--- a/cpp/cmake_modules/Findutf8proc.cmake ++++ b/cpp/cmake_modules/Findutf8proc.cmake +@@ -15,11 +15,28 @@ + # specific language governing permissions and limitations + # under the License. + ++if(ARROW_UTF8PROC_USE_SHARED) ++ set(UTF8PROC_LIB_NAMES) ++ if(CMAKE_IMPORT_LIBRARY_SUFFIX) ++ list(APPEND UTF8PROC_LIB_NAMES ++ "${CMAKE_IMPORT_LIBRARY_PREFIX}utf8proc${CMAKE_IMPORT_LIBRARY_SUFFIX}") ++ endif() ++ list(APPEND UTF8PROC_LIB_NAMES ++ "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}") ++else() ++ if(MSVC AND NOT DEFINED UTF8PROC_MSVC_STATIC_LIB_SUFFIX) ++ set(UTF8PROC_MSVC_STATIC_LIB_SUFFIX "_static") ++ endif() ++ set(UTF8PROC_STATIC_LIB_SUFFIX ++ "${UTF8PROC_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ set(UTF8PROC_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}utf8proc${UTF8PROC_STATIC_LIB_SUFFIX}) ++ set(UTF8PROC_LIB_NAMES "${UTF8PROC_STATIC_LIB_NAME}" "lib${UTF8PROC_STATIC_LIB_NAME}") ++endif() ++ + if(utf8proc_ROOT) + find_library( + UTF8PROC_LIB +- NAMES utf8proc +- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" ++ NAMES ${UTF8PROC_LIB_NAMES} + PATHS ${utf8proc_ROOT} + PATH_SUFFIXES ${LIB_PATH_SUFFIXES} + NO_DEFAULT_PATH) +@@ -28,12 +45,10 @@ if(utf8proc_ROOT) + PATHS ${utf8proc_ROOT} + NO_DEFAULT_PATH + PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) +- + else() + find_library( + UTF8PROC_LIB +- NAMES utf8proc +- "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}" ++ NAMES ${UTF8PROC_LIB_NAMES} + PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) + find_path(UTF8PROC_INCLUDE_DIR NAMES utf8proc.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) + endif() +@@ -47,5 +62,8 @@ if(UTF8PROC_FOUND OR utf8proc_FOUND) + set_target_properties(utf8proc::utf8proc + PROPERTIES IMPORTED_LOCATION "${UTF8PROC_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${UTF8PROC_INCLUDE_DIR}") ++ if(NOT ARROW_UTF8PROC_USE_SHARED) ++ set_target_properties(utf8proc::utf8proc ++ PROPERTIES INTERFACE_COMPILER_DEFINITIONS "UTF8PROC_STATIC") ++ endif() + endif() +- diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index 42227dc9417c2c..dcb1d966492cfa 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/arrow - REF apache-arrow-0.17.1 - SHA512 2a1a637d6df08e19d0c8313c51e1baf8902db677b072f8787c4f9faf8bdec94357ac8af839718d449377b508fe4f6e31b011cbdc6ccf029b6a66f567172569aa + REF apache-arrow-1.0.0 + SHA512 cfbe22a7987658cce15f83c3be50435567f2b8156fa50007ae103418b969c6075dbf2858c25787a40feb391e84075905dd045300beb7fcedf4344823f8c4be20 HEAD_REF master PATCHES all.patch @@ -26,12 +26,15 @@ vcpkg_configure_cmake( OPTIONS -DARROW_DEPENDENCY_SOURCE=SYSTEM -Duriparser_SOURCE=SYSTEM - -DARROW_BUILD_TESTS=off + -DARROW_BUILD_TESTS=OFF ${FEATURE_OPTIONS} -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC} -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED} - -DARROW_GFLAGS_USE_SHARED=off - -DARROW_JEMALLOC=off + -DARROW_BROTLI_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_GFLAGS_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_UTF8PROC_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_ZSTD_USE_SHARED=${ARROW_BUILD_SHARED} + -DARROW_JEMALLOC=OFF -DARROW_BUILD_UTILITIES=OFF -DARROW_WITH_BZ2=ON -DARROW_WITH_ZLIB=ON @@ -39,6 +42,7 @@ vcpkg_configure_cmake( -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON + -DARROW_WITH_UTF8PROC=ON -DPARQUET_REQUIRE_ENCRYPTION=ON ) diff --git a/ports/asiosdk/CONTROL b/ports/asiosdk/CONTROL index 1a8c75628314a3..b97ebb689d4337 100644 --- a/ports/asiosdk/CONTROL +++ b/ports/asiosdk/CONTROL @@ -1,4 +1,4 @@ Source: asiosdk -Version: 2.3.3 +Version: 2.3.3-1 Homepage: https://www.steinberg.net/en/company/developers.html Description: ASIO is a low latency audio API from Steinberg. diff --git a/ports/asiosdk/vcpkg-cmake-wrapper.cmake b/ports/asiosdk/vcpkg-cmake-wrapper.cmake index 2fbe9725f536ec..df14d7c827e016 100644 --- a/ports/asiosdk/vcpkg-cmake-wrapper.cmake +++ b/ports/asiosdk/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(ASIOSDK_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT ASIOSDK_INCLUDE_DIR) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${ASIOSDK_PREV_MODULE_PATH}) diff --git a/ports/asmjit/CONTROL b/ports/asmjit/CONTROL index 5ec779ce70fb24..d4b46b6a5c4007 100644 --- a/ports/asmjit/CONTROL +++ b/ports/asmjit/CONTROL @@ -1,5 +1,5 @@ Source: asmjit -Version: 2020-05-08 +Version: 2020-07-22 Homepage: https://github.com/asmjit/asmjit Description: Complete x86/x64 JIT and Remote Assembler for C++ Supports: !arm diff --git a/ports/asmjit/portfile.cmake b/ports/asmjit/portfile.cmake index d95645d7e21642..812083b6d919ca 100644 --- a/ports/asmjit/portfile.cmake +++ b/ports/asmjit/portfile.cmake @@ -3,23 +3,23 @@ vcpkg_fail_port_install(ON_ARCH "arm") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO asmjit/asmjit - REF 80645e66a8ae85749937bda3b329388c8a76ea4c - SHA512 8e7b0aed14e8ce05e6e6b2eed77be23a81b9548a146aef187ac6beced3bc2a6cba92835718adb901a1ab983fab32f3e9f18061b157b2276bb1451a71ca1195b8 + REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 + SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 HEAD_REF master ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS -DASMJIT_STATIC=1 - ) + set(ASMJIT_STATIC 1) else() - vcpkg_configure_cmake( + set(ASMJIT_STATIC 0) +endif() + +vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - ) -endif() + OPTIONS -DASMJIT_STATIC=${ASMJIT_STATIC} + ) + vcpkg_install_cmake() vcpkg_copy_pdbs() diff --git a/ports/audiofile/portfile.cmake b/ports/audiofile/portfile.cmake new file mode 100644 index 00000000000000..49f9a67d279426 --- /dev/null +++ b/ports/audiofile/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO adamstark/AudioFile + REF ccb64bd86881099e65a329f104733679ae03f63e # 1.0.7 + SHA512 f172f9df95a028c9c3da29cd530dd4b55acad76ee7503000f96ba10c5d014abd219fcd145cea4b7ca7a902c38d968518b39de285d25f7e3ccc56d1ba3769d7b8 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/AudioFile.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/audiofile/vcpkg.json b/ports/audiofile/vcpkg.json new file mode 100644 index 00000000000000..d779642030d20b --- /dev/null +++ b/ports/audiofile/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "audiofile", + "version-string": "1.0.7", + "description": "A simple header-only C++ library for reading and writing audio files.", + "homepage": "https://github.com/adamstark/AudioFile", + "license": "GPL-3.0" +} diff --git a/ports/avisynthplus/vcpkg.json b/ports/avisynthplus/vcpkg.json index 1af0142ea4d4bb..c8a8d77b0de7ed 100644 --- a/ports/avisynthplus/vcpkg.json +++ b/ports/avisynthplus/vcpkg.json @@ -1,7 +1,7 @@ { "name": "avisynthplus", "version-string": "3.6.0", - "homepage": "http://avs-plus.net/", "description": "An improved version of the AviSynth frameserver, with improved features and developer friendliness", + "homepage": "http://avs-plus.net/", "supports": "!(uwp | arm | static)" } diff --git a/ports/avro-cpp/CONTROL b/ports/avro-cpp/CONTROL new file mode 100644 index 00000000000000..0f75d7e24cdd2e --- /dev/null +++ b/ports/avro-cpp/CONTROL @@ -0,0 +1,9 @@ +Source: avro-cpp +Version: 1.9.2 +Homepage: https://github.com/apache/avro +Description: Apache Avro is a data serialization system +Build-Depends: boost-format, boost-thread, boost-filesystem, boost-iostreams, boost-program-options, boost-random, boost-crc, boost-test, libzip, bzip2, liblzma, zlib, zstd + +Feature: snappy +Build-Depends: snappy +Description: Support Snappy for compression diff --git a/ports/avro-cpp/install.patch b/ports/avro-cpp/install.patch new file mode 100644 index 00000000000000..12ead28612157d --- /dev/null +++ b/ports/avro-cpp/install.patch @@ -0,0 +1,100 @@ +diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt +index 30a5d66..f7f2b94 100644 +--- a/lang/c++/CMakeLists.txt ++++ b/lang/c++/CMakeLists.txt +@@ -40,6 +40,8 @@ set (AVRO_VERSION_MINOR "0") + project (Avro-cpp) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}) + ++find_package(ZLIB REQUIRED) ++ + if (WIN32 AND NOT CYGWIN AND NOT MSYS) + add_definitions (/EHa) + add_definitions ( +@@ -118,11 +120,11 @@ set_target_properties (avrocpp PROPERTIES + set_target_properties (avrocpp_s PROPERTIES + VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR}) + +-target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + + add_executable (precompile test/precompile.cc) + +-target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + + macro (gen file ns) + add_custom_command (OUTPUT ${file}.hh +@@ -151,34 +153,40 @@ gen (crossref cr) + gen (primitivetypes pt) + + add_executable (avrogencpp impl/avrogencpp.cc) +-target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++target_link_libraries (avrogencpp avrocpp_s ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) ++ + +-enable_testing() ++if(BUILD_TESTING) ++ enable_testing() ++endif() + + macro (unittest name) + add_executable (${name} test/${name}.cc) +- target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES}) ++ target_link_libraries (${name} avrocpp ${Boost_LIBRARIES} ${SNAPPY_LIBRARIES} ZLIB::ZLIB) + add_test (NAME ${name} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${name}) + endmacro (unittest) + +-unittest (buffertest) +-unittest (unittest) +-unittest (SchemaTests) +-unittest (LargeSchemaTests) +-unittest (CodecTests) +-unittest (StreamTests) +-unittest (SpecificTests) +-unittest (DataFileTests) +-unittest (JsonTests) +-unittest (AvrogencppTests) +-unittest (CompilerTests) +- +-add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh +- tweet_hh +- union_array_union_hh union_map_union_hh union_conflict_hh +- recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh +- primitivetypes_hh empty_record_hh) ++if(BUILD_TESTING) ++ unittest (buffertest) ++ unittest (unittest) ++ unittest (SchemaTests) ++ unittest (LargeSchemaTests) ++ unittest (CodecTests) ++ unittest (StreamTests) ++ unittest (SpecificTests) ++ unittest (DataFileTests) ++ unittest (JsonTests) ++ unittest (AvrogencppTests) ++ unittest (CompilerTests) ++ ++ add_dependencies (AvrogencppTests bigrecord_hh bigrecord_r_hh bigrecord2_hh ++ tweet_hh ++ union_array_union_hh union_map_union_hh union_conflict_hh ++ recursive_hh reuse_hh circulardep_hh tree1_hh tree2_hh crossref_hh ++ primitivetypes_hh empty_record_hh) ++ ++endif() + + include (InstallRequiredSystemLibraries) + +@@ -189,9 +197,9 @@ include (CPack) + install (TARGETS avrocpp avrocpp_s + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +- RUNTIME DESTINATION lib) ++ RUNTIME DESTINATION bin) + +-install (TARGETS avrogencpp RUNTIME DESTINATION bin) ++install (TARGETS avrogencpp RUNTIME DESTINATION tools/bin) + + install (DIRECTORY api/ DESTINATION include/avro + FILES_MATCHING PATTERN *.hh) diff --git a/ports/avro-cpp/portfile.cmake b/ports/avro-cpp/portfile.cmake new file mode 100644 index 00000000000000..49f0af20ce77b2 --- /dev/null +++ b/ports/avro-cpp/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/avro + REF release-1.9.2 + SHA512 6a6980901eea964c050eb3d61fadf28712e2f02c36985bf8e5176b668bba48985f6a666554a1964435448de29b18d790ab86b787d0288a22fd9cba00746a7846 + HEAD_REF master + PATCHES + install.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + snappy CMAKE_DISABLE_FIND_PACKAGE_Snappy +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/lang/c++ + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DBUILD_TESTING=OFF + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DAVRO_ADD_PROTECTOR_FLAGS=1 +) + +vcpkg_install_cmake(ADD_BIN_TO_PATH) + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/lang/c++/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/azure-c-shared-utility/CONTROL b/ports/azure-c-shared-utility/CONTROL index 253ed721c95d1b..6546575b1f0f68 100644 --- a/ports/azure-c-shared-utility/CONTROL +++ b/ports/azure-c-shared-utility/CONTROL @@ -1,5 +1,5 @@ Source: azure-c-shared-utility -Version: 2020-06-17-1 +Version: 2020-07-19 Description: Azure C SDKs common code Homepage: https://github.com/Azure/azure-c-shared-utility Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c, umock-c @@ -7,4 +7,4 @@ Supports: !uwp Feature: public-preview Description: Azure C SDKs common code (public preview) -Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] \ No newline at end of file +Build-Depends: curl (linux), openssl (linux), azure-macro-utils-c[public-preview], umock-c[public-preview] diff --git a/ports/azure-c-shared-utility/portfile.cmake b/ports/azure-c-shared-utility/portfile.cmake index b38a835ce0b550..ccc9b681d10e87 100644 --- a/ports/azure-c-shared-utility/portfile.cmake +++ b/ports/azure-c-shared-utility/portfile.cmake @@ -16,8 +16,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-c-shared-utility - REF 30211c742f082082c127c0f284257119131a96ab - SHA512 c46493a82a6879d501a0261ca61fb91594ac554928794ef96fd96570fed2ba5e0533a4e00a02e3826d7dfacc22bff3ac8e0a2696a7b46c766d317f29207ec062 + REF 65c27eb4ab9a8bbe36b4d7c5a0e9ad305becb8b4 + SHA512 48c65111b12e895f9c2087964d7291e6d1629242194fed9b33ead8ca438f16c803786cd55761eabdd12d47c9920542cff0e510bf16f16cac1d60049ba205df0e HEAD_REF master PATCHES fix-utilityFunctions-conditions.patch diff --git a/ports/azure-iot-sdk-c/CONTROL b/ports/azure-iot-sdk-c/CONTROL index 0c6aef0a1ead6f..6344bdeabad213 100644 --- a/ports/azure-iot-sdk-c/CONTROL +++ b/ports/azure-iot-sdk-c/CONTROL @@ -1,5 +1,6 @@ Source: azure-iot-sdk-c -Version: 2020-06-17-2 +Version: 2020-07-19 +Port-Version: 1 Build-Depends: azure-uamqp-c, azure-umqtt-c, azure-c-shared-utility, parson, azure-uhttp-c, azure-macro-utils-c, umock-c Description: A C99 SDK for connecting devices to Microsoft Azure IoT services Homepage: https://github.com/Azure/azure-iot-sdk-c diff --git a/ports/azure-iot-sdk-c/portfile.cmake b/ports/azure-iot-sdk-c/portfile.cmake index 6d0bec58a192c7..db460aaecf7547 100644 --- a/ports/azure-iot-sdk-c/portfile.cmake +++ b/ports/azure-iot-sdk-c/portfile.cmake @@ -15,8 +15,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-iot-sdk-c - REF 989f1dc66c7de53cb14d29eb051003eec0de798e - SHA512 876e846cdef699ee3635e5191a697c56c7c40b2110d2468cfbbe204cff59d42a0d930861fda7229dbba163a329de9d8f06276228bab516ef92c88feebfcfbc13 + REF f464326f10cbba497b71c4aa263b6a22e1b375fe + SHA512 32dfb2ac697755af3646b07259298fc2f27007ab1a0a27da0be4f597c82dd2f8bbad6f07b4ed01dfbb62d86649d4be913c59e1e76b33efec112beaaba550d375 HEAD_REF master PATCHES improve-external-deps.patch @@ -25,6 +25,7 @@ else() endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + use-prov-client hsm_type_symm_key use-prov-client use_prov_client ) @@ -40,7 +41,6 @@ vcpkg_configure_cmake( -Duse_default_uuid=ON -Dbuild_as_dynamic=OFF -Duse_edge_modules=ON - -Dhsm_type_symm_key=${use_prov_client} ) vcpkg_install_cmake() diff --git a/ports/azure-uamqp-c/CONTROL b/ports/azure-uamqp-c/CONTROL index c2a59448dad988..ddd6fe2da1bb8e 100644 --- a/ports/azure-uamqp-c/CONTROL +++ b/ports/azure-uamqp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uamqp-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: AMQP library for C Homepage: https://github.com/Azure/azure-uamqp-c diff --git a/ports/azure-uamqp-c/portfile.cmake b/ports/azure-uamqp-c/portfile.cmake index 39b45e8cd18819..e154414fc2d6b6 100644 --- a/ports/azure-uamqp-c/portfile.cmake +++ b/ports/azure-uamqp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uamqp-c - REF cd11c2591ada765f23669bce62dbfaf503b3108e - SHA512 a2879afcc6417ebe81bae0ca12e0ebcae90749637446917168a3356bfdd8fa2f3d73fb1ce2def907b26f7d6c0fcc4f7bd72463ed9dba4d0f8a5a287f4307ae0c + REF 9e851bd6db08d6d2d08d1ef469d1e6fc4795382d + SHA512 efe0b9ed8a949af67e958b1516f499f57a0838a847e92d6c932058e931d2536038e7d49d63597e21de0a6f2af22bc179a6d99c8b8077451f906118b0b65e1417 HEAD_REF master ) endif() diff --git a/ports/azure-uhttp-c/CONTROL b/ports/azure-uhttp-c/CONTROL index 5f26022c4c7e60..b64573024fb0f7 100644 --- a/ports/azure-uhttp-c/CONTROL +++ b/ports/azure-uhttp-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-uhttp-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: Azure HTTP Library written in C Homepage: https://github.com/Azure/azure-uhttp-c diff --git a/ports/azure-uhttp-c/portfile.cmake b/ports/azure-uhttp-c/portfile.cmake index ff8c03e90f816d..1e05b1cfa93c54 100644 --- a/ports/azure-uhttp-c/portfile.cmake +++ b/ports/azure-uhttp-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-uhttp-c - REF 6bf59b9057f653aaa57e6539627085f41c2dfe33 - SHA512 96437df9f249e2a551e9890b4d476ae032384a067d845b86893013138380802592f70139e2b4f4c0d543c464ef98008d0b2f025ce6f0341181e431b53e311dc5 + REF ef8ba1591b0f825315b78380331ff9290197db02 + SHA512 3e0434272de684a43189d491c16ab7e20ffcfd08f8addb01f64caa446211faa67e45aa51c403520df6a105cc9ac50b85de1b9e0954510fd4232c0f19d01fea9c HEAD_REF master ) endif() diff --git a/ports/azure-umqtt-c/CONTROL b/ports/azure-umqtt-c/CONTROL index 9f8f637e23b9fd..755b0160e9bc3f 100644 --- a/ports/azure-umqtt-c/CONTROL +++ b/ports/azure-umqtt-c/CONTROL @@ -1,5 +1,5 @@ Source: azure-umqtt-c -Version: 2020-06-17-1 +Version: 2020-07-19 Build-Depends: azure-c-shared-utility, azure-macro-utils-c, umock-c Description: General purpose library for communication over the mqtt protocol Homepage: https://github.com/Azure/azure-umqtt-c diff --git a/ports/azure-umqtt-c/portfile.cmake b/ports/azure-umqtt-c/portfile.cmake index 80779f03e55195..84fba09b62871a 100644 --- a/ports/azure-umqtt-c/portfile.cmake +++ b/ports/azure-umqtt-c/portfile.cmake @@ -12,8 +12,8 @@ else() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Azure/azure-umqtt-c - REF 349a2bffc1addfdc4b61d30f80adc1e15b336fbd - SHA512 887ece4d9cbb32059c84d776d88ce05fa8474289afb1cd5873a672fc926024a416ac50a829c671fd2aae6b4eaa984f05196a3fff6a56011585d875f116a0a764 + REF 165f6f52f8b2aec54a28ea5ede41736589726cd0 + SHA512 af56db89ddbae1a8067d3b1c7f85ecf085fb6bf529d01f74dd301e6994b20e6f1a821fd7d5116b53d1a8911ccc463149a53a5611e650c3aeb63893012206ffb8 HEAD_REF master ) endif() diff --git a/ports/blaze/CONTROL b/ports/blaze/CONTROL index d9198b970beb8b..5f613205c240bd 100644 --- a/ports/blaze/CONTROL +++ b/ports/blaze/CONTROL @@ -1,5 +1,6 @@ Source: blaze Version: 3.7 -Build-Depends: clapack (!osx), boost-exception +Port-Version: 1 +Build-Depends: lapack, boost-exception Homepage: https://bitbucket.org/blaze-lib/blaze Description: Blaze is an open-source, high-performance C++ math library for dense and sparse arithmetic. diff --git a/ports/blend2d/portfile.cmake b/ports/blend2d/portfile.cmake index 8862ba28be0a7e..0addc0e0ab056a 100644 --- a/ports/blend2d/portfile.cmake +++ b/ports/blend2d/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_ARCH "wasm32" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO blend2d/blend2d - REF 9e6686c0760135cc54dfd3e9e239ceac07cddb78 - SHA512 475a7fa4de4728e0c41d97e759d5c74fe5d66d28169614a9081a461fdc27e1f1c4db438d7e2a5cd9170489bbb7e352d73ec46d8bde45ff7c4a024c35fdb43e5f + REF ee5c52aa5fcaaf9910dd2ef566a741d998bdfb98 + SHA512 e33e9418be13d239feb2a88d52538e0a86b920b9bcb0473ac21b27fbd54f7c683e23c1f8a6dbcbcf24fdc85bfc1b5884ebea4a9a5e4ec1fcfbfaa006807e3d59 HEAD_REF master ) @@ -21,8 +21,8 @@ if(NOT BLEND2D_BUILD_NO_JIT) vcpkg_from_github( OUT_SOURCE_PATH ASMJIT_SOURCE_PATH REPO asmjit/asmjit - REF 2de7e742443e23b925b830c415268ce1470341ce - SHA512 40ec1ec5540a20530e795c0e425322ed027d2e6e400f8f1ee1426e256ea0f3cf2e241972cdbda2f2d8e9fad06ba0ba12f0dcff9a09aa5da65cb3d01e19079966 + REF 8474400e82c3ea65bd828761539e5d9b25f6bd83 + SHA512 435be4ed22abbbbcdea3869b31bc2fc27aae969775773c24155d7490bca9591f51613fa3319cce54200c6d18dbe73a6be2d5449c49afb46934d93760501e98f6 HEAD_REF master ) diff --git a/ports/blend2d/vcpkg.json b/ports/blend2d/vcpkg.json index e8940a0eeb5c1a..163843a0a357c7 100644 --- a/ports/blend2d/vcpkg.json +++ b/ports/blend2d/vcpkg.json @@ -1,10 +1,15 @@ { "name": "blend2d", - "version-string": "beta_2020-07-09", - "port-version": 0, + "version-string": "beta_2020-07-31", "description": "Beta 2D Vector Graphics Powered by a JIT Compiler", "homepage": "https://github.com/blend2d/blend2d", "documentation": "https://blend2d.com/doc/index.html", + "supports": "!(arm | uwp)", + "default-features": [ + "jit", + "logging", + "tls" + ], "features": [ { "name": "jit", @@ -18,11 +23,5 @@ "name": "tls", "description": "Default feature. Enables use of thread_local feature. Disable for platforms where thread local storage is expensive or not supported." } - ], - "default-features": [ - "jit", - "logging", - "tls" - ], - "supports": "!(arm|uwp)" + ] } diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index eaf174e23e5962..94d5cd3f7a1284 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,5 +1,5 @@ Source: bond -Version: 9.0.0 +Version: 9.0.2 Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. Homepage: https://github.com/Microsoft/bond Build-Depends: rapidjson, boost-config, boost-utility, boost-assign diff --git a/ports/bond/fix-install-path.patch b/ports/bond/fix-install-path.patch index e5fa270c192374..643e0cfbfbf0d3 100644 --- a/ports/bond/fix-install-path.patch +++ b/ports/bond/fix-install-path.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f8eaa..1b0c01c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -18,7 +18,7 @@ set (BOND_FIND_RAPIDJSON +@@ -23,7 +23,7 @@ set (BOND_FIND_RAPIDJSON # settings so that we don't apply our settings to third-party code. add_subdirectory (thirdparty) @@ -11,7 +11,7 @@ index f2f8eaa..1b0c01c 100644 set (BOND_IDL ${CMAKE_CURRENT_SOURCE_DIR}/idl) set (BOND_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/cpp/inc) -@@ -80,6 +80,6 @@ if (BOND_GBC_PATH) +@@ -85,6 +85,6 @@ if (BOND_GBC_PATH) install ( FILES ${BOND_GBC_PATH} @@ -35,7 +35,7 @@ index 1dff9d0..9a11575 100644 @@ -130,7 +130,7 @@ endif() install (FILES ${output} - PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION bin) + DESTINATION ${completion_dir}) diff --git a/ports/bond/portfile.cmake b/ports/bond/portfile.cmake index 903ca0f462372a..9a1485baca272b 100644 --- a/ports/bond/portfile.cmake +++ b/ports/bond/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -set(BOND_VER 9.0.0) +set(BOND_VER 9.0.2) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/bond REF ${BOND_VER} - SHA512 b6bed9be8b5dd2a7d50c6bd275b94c62050b83717907522a07279cccc50e209306792c6f3c7f206afcb3226aed21b43b115b63dccc806eff5d9cd4e12b355461 + SHA512 ece636bc06e7bac4208d373610e689f19b394cae4eaa869f32b098924a6e7034e4d804d4831d7f6fd2540a619daf77f4ab43c49aa442a9cd26161b0a8a2db000 HEAD_REF master PATCHES fix-install-path.patch skip-grpc-compilation.patch ) @@ -15,7 +15,7 @@ if (VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile(GBC_ARCHIVE URLS "https://github.com/microsoft/bond/releases/download/${BOND_VER}/gbc-${BOND_VER}-amd64.zip" FILENAME "gbc-${BOND_VER}-amd64.zip" - SHA512 f4480a3eb7adedfd3da554ef3cdc64b6e7da5c699bde0ccd86b2dd6a159ccacbb1df2b84b6bc80bc8475f30b904cba98085609e42aad929b2b23258eaff52048 + SHA512 661d63a82284d3ecbc7b50d5f4972dadeb607f96612108a4a0887c6684a418e8b265516354504ca3440a182d1e31f2eb5861531133b455d8b6c01aec45ade5d3 ) # Clear the generator to prevent it from updating diff --git a/ports/boost-asio/CONTROL b/ports/boost-asio/CONTROL index 641ca4aa91d2c5..63823d2a448593 100644 --- a/ports/boost-asio/CONTROL +++ b/ports/boost-asio/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-asio Version: 1.73.0 -Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl +Port-Version: 1 +Build-Depends: boost-array, boost-assert, boost-bind, boost-chrono, boost-compatibility, boost-config, boost-coroutine (!arm&!uwp), boost-date-time, boost-detail, boost-function, boost-integer, boost-regex, boost-smart-ptr, boost-system, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, openssl Homepage: https://github.com/boostorg/asio Description: Boost asio module diff --git a/ports/boost-build/CONTROL b/ports/boost-build/CONTROL index 087970deab9dc7..f6ab98cf82b77d 100644 --- a/ports/boost-build/CONTROL +++ b/ports/boost-build/CONTROL @@ -1,4 +1,5 @@ Source: boost-build -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 2 Homepage: https://github.com/boostorg/build Description: Boost.Build diff --git a/ports/boost-build/portfile.cmake b/ports/boost-build/portfile.cmake index 7633f51aaa1fbf..9b06d0074eb18a 100644 --- a/ports/boost-build/portfile.cmake +++ b/ports/boost-build/portfile.cmake @@ -2,7 +2,7 @@ include(vcpkg_common_functions) set(VCPKG_POLICY_EMPTY_PACKAGE enabled) -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") +if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") return() elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") return() diff --git a/ports/boost-context/CONTROL b/ports/boost-context/CONTROL index 2180441f3a062d..a6ba3fa04eb571 100644 --- a/ports/boost-context/CONTROL +++ b/ports/boost-context/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-context -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-detail, boost-integer, boost-modular-build-helper, boost-pool, boost-predef, boost-smart-ptr, boost-thread, boost-vcpkg-helpers Homepage: https://github.com/boostorg/context Description: Boost context module +Supports: !uwp diff --git a/ports/boost-coroutine/CONTROL b/ports/boost-coroutine/CONTROL index b8a67d5b823c18..95851da832e5f3 100644 --- a/ports/boost-coroutine/CONTROL +++ b/ports/boost-coroutine/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-coroutine Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-context (!uwp), boost-detail, boost-exception, boost-integer, boost-modular-build-helper, boost-move, boost-range, boost-system, boost-thread, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/coroutine Description: Boost coroutine module +Supports: !arm&!uwp diff --git a/ports/boost-fiber/CONTROL b/ports/boost-fiber/CONTROL index 22acacfbe5fb5e..4db73b41e91174 100644 --- a/ports/boost-fiber/CONTROL +++ b/ports/boost-fiber/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-fiber Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-build, boost-config, boost-context (!uwp), boost-core, boost-detail, boost-filesystem (!uwp), boost-format, boost-intrusive, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-vcpkg-helpers Homepage: https://github.com/boostorg/fiber Description: Boost fiber module +Supports: !osx&!uwp&!arm diff --git a/ports/boost-filesystem/CONTROL b/ports/boost-filesystem/CONTROL index 09e2a8e6ce7299..3a2b3239089846 100644 --- a/ports/boost-filesystem/CONTROL +++ b/ports/boost-filesystem/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-filesystem Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-core, boost-detail, boost-functional, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-predef, boost-smart-ptr, boost-system, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/filesystem Description: Boost filesystem module +Supports: !uwp diff --git a/ports/boost-graph-parallel/CONTROL b/ports/boost-graph-parallel/CONTROL index d08ab59fb44772..cd05cb7de8d9f8 100644 --- a/ports/boost-graph-parallel/CONTROL +++ b/ports/boost-graph-parallel/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-graph-parallel Version: 1.73.0 -Build-Depends: boost-assert, boost-compatibility, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-assert, boost-compatibility, boost-concept-check, boost-config, boost-container-hash, boost-detail, boost-dynamic-bitset, boost-filesystem (!uwp), boost-foreach, boost-function, boost-graph, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-optional, boost-property-map, boost-random, boost-serialization, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-variant, boost-vcpkg-helpers Homepage: https://github.com/boostorg/graph_parallel Description: Boost graph_parallel module diff --git a/ports/boost-iostreams/CONTROL b/ports/boost-iostreams/CONTROL index b62a07c060aa07..7f521ec3476d82 100644 --- a/ports/boost-iostreams/CONTROL +++ b/ports/boost-iostreams/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-iostreams Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-bind, boost-build, boost-config, boost-core, boost-detail, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-range, boost-regex, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, bzip2, liblzma, zlib, zstd Homepage: https://github.com/boostorg/iostreams Description: Boost iostreams module +Supports: !uwp diff --git a/ports/boost-locale/CONTROL b/ports/boost-locale/CONTROL index d7c8d7c0fa7097..5260cea4c5aacd 100644 --- a/ports/boost-locale/CONTROL +++ b/ports/boost-locale/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-locale -Version: 1.73.0-1 +Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-config, boost-function, boost-integer, boost-iterator, boost-modular-build-helper, boost-smart-ptr, boost-static-assert, boost-system, boost-thread, boost-type-traits, boost-unordered, boost-vcpkg-helpers, libiconv (!uwp&!windows) Homepage: https://github.com/boostorg/locale Description: Boost locale module +Supports: !uwp Feature: icu Build-Depends: icu diff --git a/ports/boost-log/CONTROL b/ports/boost-log/CONTROL index c4aa6be65d0b2f..33fc046e7b4c35 100644 --- a/ports/boost-log/CONTROL +++ b/ports/boost-log/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-log Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-align, boost-array, boost-asio, boost-assert, boost-atomic, boost-bind, boost-build, boost-compatibility, boost-config, boost-container, boost-core, boost-date-time, boost-detail, boost-exception, boost-filesystem (!uwp), boost-function-types, boost-fusion, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iterator, boost-lexical-cast, boost-locale (!uwp), boost-math, boost-modular-build-helper, boost-move, boost-mpl, boost-optional, boost-parameter, boost-phoenix, boost-predef, boost-preprocessor, boost-property-tree, boost-proto, boost-random, boost-range, boost-regex, boost-smart-ptr, boost-spirit, boost-static-assert, boost-system, boost-thread, boost-throw-exception, boost-type-index, boost-type-traits, boost-utility, boost-vcpkg-helpers, boost-winapi, boost-xpressive Homepage: https://github.com/boostorg/log Description: Boost log module +Supports: !uwp diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index 05a1762a037b99..629e01f6d372d0 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -35,6 +35,12 @@ else() list(APPEND B2_OPTIONS address-model=32) endif() +if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + list(APPEND B2_OPTIONS architecture=s390x) +else() + list(APPEND B2_OPTIONS architecture=x86) +endif() + if(APPLE) list(APPEND B2_OPTIONS target-os=darwin toolset=clang) elseif(WIN32) @@ -91,7 +97,11 @@ if(CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILE_OPTIONS_TARGET) endif() endif() if(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) - set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + else() + set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN} ${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") + endif() endif() if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT) set(CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") @@ -158,7 +168,6 @@ add_custom_target(boost ALL --hash -q - architecture=x86 threading=multi debug-symbols=on diff --git a/ports/boost-modular-build-helper/CONTROL b/ports/boost-modular-build-helper/CONTROL index 29c1d24c81f078..f1794db5d17cb4 100644 --- a/ports/boost-modular-build-helper/CONTROL +++ b/ports/boost-modular-build-helper/CONTROL @@ -1,3 +1,3 @@ Source: boost-modular-build-helper Version: 1.73.0 -Port-Version: 2 +Port-Version: 3 diff --git a/ports/boost-modular-build-helper/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam index 884284b499510b..8d7d1e35019cf5 100644 --- a/ports/boost-modular-build-helper/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam @@ -36,8 +36,7 @@ if "@PORT@" != "boost-system" { use-project /boost/system : . ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_system : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_system : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_system@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_system ; use-project /boost : . ; @@ -48,8 +47,7 @@ if "@PORT@" != "boost-chrono" { use-project /boost/chrono : . ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_chrono : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_chrono@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_chrono ; } @@ -57,8 +55,7 @@ if "@PORT@" != "boost-regex" { use-project /boost/regex : . ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_regex : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_regex : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_regex@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_regex ; } @@ -66,8 +63,7 @@ if "@PORT@" != "boost-date-time" { use-project /boost/date_time : . ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_RELEASE_SUFFIX@" release -/boost/date_time//boost_date_time ; - lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_DEBUG_SUFFIX@" debug -/boost/date_time//boost_date_time ; + lib boost_date_time : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_date_time@BOOST_LIB_SUFFIX@" @VARIANT@ -/boost/date_time//boost_date_time ; explicit boost_date_time ; } @@ -75,8 +71,7 @@ if "@PORT@" != "boost-thread" { use-project /boost/thread : . ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/date_time//boost_date_time ; - lib boost_thread : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/date_time//boost_date_time ; + lib boost_thread : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_thread@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/date_time//boost_date_time ; explicit boost_thread ; } @@ -84,8 +79,7 @@ if "@PORT@" != "boost-timer" { use-project /boost/timer : . ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_timer : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_timer : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_timer@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_timer ; } @@ -93,8 +87,7 @@ if "@PORT@" != "boost-filesystem" { use-project /boost/filesystem : . ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_RELEASE_SUFFIX@" release : : /boost/system//boost_system ; - lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_DEBUG_SUFFIX@" debug : : /boost/system//boost_system ; + lib boost_filesystem : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_filesystem@BOOST_LIB_SUFFIX@" @VARIANT@ : : /boost/system//boost_system ; explicit boost_filesystem ; } @@ -102,8 +95,7 @@ if "@PORT@" != "boost-atomic" { use-project /boost/atomic : . ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_atomic : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_atomic@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_atomic ; } @@ -114,8 +106,7 @@ if "@PORT@" != "boost-context" use-project /boost/context : . ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_context : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_context : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_context@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_context ; } @@ -123,8 +114,7 @@ if "@PORT@" != "boost-test" { use-project /boost/test : . ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_unit_test_framework : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_unit_test_framework@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_unit_test_framework ; } @@ -132,8 +122,7 @@ if "@PORT@" != "boost-serialization" { use-project /boost/serialization : . ; - lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_RELEASE_SUFFIX@" release ; - lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/debug/lib/@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_DEBUG_SUFFIX@" debug ; + lib boost_serialization : : "@CURRENT_INSTALLED_DIR@/@BUILD_LIB_PATH@@BOOST_LIB_PREFIX@boost_serialization@BOOST_LIB_SUFFIX@" @VARIANT@ ; explicit boost_serialization ; } diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index 1ce6ad1cc72da3..b77581fa311ad7 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -4,7 +4,7 @@ function(boost_modular_build) if(NOT DEFINED _bm_SOURCE_PATH) message(FATAL_ERROR "SOURCE_PATH is a required argument to boost_modular_build.") endif() - + # Next CMake variables may be overridden in the file specified in ${_bm_BOOST_CMAKE_FRAGMENT} set(B2_OPTIONS) set(B2_OPTIONS_DBG) @@ -21,7 +21,7 @@ function(boost_modular_build) set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build") elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) - elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE) else() set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/tools/boost-build") @@ -29,7 +29,7 @@ function(boost_modular_build) if(NOT EXISTS "${BOOST_BUILD_PATH}") if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") + message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.") else() message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.") endif() @@ -81,15 +81,20 @@ function(boost_modular_build) file(WRITE ${_bm_SOURCE_PATH}/build/Jamfile.v2 "${_contents}") endif() - configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-config/checks") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${_bm_SOURCE_PATH}/build/config") # endif() # if(EXISTS "${CURRENT_INSTALLED_DIR}/share/boost-predef/check") # file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${_bm_SOURCE_PATH}/build/predef") # endif() - - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + + function(unix_build BOOST_LIB_SUFFIX BUILD_TYPE BUILD_LIB_PATH) + message(STATUS "Building ${BUILD_TYPE}...") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_SUFFIX}) + set(VARIANT ${BUILD_TYPE}) + set(BUILD_LIB_PATH ${BUILD_LIB_PATH}) + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) + set(configure_option) if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) list(APPEND configure_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}") @@ -107,6 +112,16 @@ function(boost_modular_build) ${configure_option} ) vcpkg_install_cmake() + endfunction() + + if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + unix_build(${BOOST_LIB_RELEASE_SUFFIX} "release" "lib/") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + unix_build(${BOOST_LIB_DEBUG_SUFFIX} "debug" "debug/lib/") + endif() if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/lib) message(FATAL_ERROR "No libraries were produced. This indicates a failure while building the boost library.") @@ -184,7 +199,7 @@ function(boost_modular_build) -sZSTD_BINARY=zstdd "-sZSTD_LIBPATH=${CURRENT_INSTALLED_DIR}/debug/lib" ) - + set(B2_OPTIONS_REL -sZLIB_BINARY=zlib "-sZLIB_LIBPATH=${CURRENT_INSTALLED_DIR}/lib" @@ -252,6 +267,8 @@ function(boost_modular_build) list(APPEND B2_OPTIONS address-model=32 architecture=arm) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") list(APPEND B2_OPTIONS address-model=64 architecture=arm) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x") + list(APPEND B2_OPTIONS address-model=64 architecture=s390x) else() list(APPEND B2_OPTIONS address-model=32 architecture=x86) endif() @@ -293,6 +310,10 @@ function(boost_modular_build) ###################### if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${TARGET_TRIPLET}-rel") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_RELEASE_SUFFIX}) + set(VARIANT "release") + set(BUILD_LIB_PATH "lib/") + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" @@ -311,6 +332,10 @@ function(boost_modular_build) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Building ${TARGET_TRIPLET}-dbg") + set(BOOST_LIB_SUFFIX ${BOOST_LIB_DEBUG_SUFFIX}) + set(VARIANT debug) + set(BUILD_LIB_PATH "debug/lib/") + configure_file(${_bm_DIR}/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(ENV{BOOST_BUILD_PATH} "${BOOST_BUILD_PATH}") vcpkg_execute_required_process( COMMAND "${B2_EXE}" diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index e50c43848c4f46..afd55f519a2293 100644 --- a/ports/boost-mpi/CONTROL +++ b/ports/boost-mpi/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpi Version: 1.73.0 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python, boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi +Port-Version: 1 +Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-python (!uwp&!(arm&windows)), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi Homepage: https://github.com/boostorg/mpi Description: Boost mpi module diff --git a/ports/boost-parameter-python/CONTROL b/ports/boost-parameter-python/CONTROL index 2b33da28798f84..cba56b9e662722 100644 --- a/ports/boost-parameter-python/CONTROL +++ b/ports/boost-parameter-python/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-parameter-python Version: 1.73.0 -Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-mpl, boost-parameter, boost-preprocessor, boost-python (!uwp&!(arm&windows)), boost-vcpkg-helpers Homepage: https://github.com/boostorg/parameter_python Description: Boost parameter_python module diff --git a/ports/boost-poly-collection/CONTROL b/ports/boost-poly-collection/CONTROL index 9c98aae6cfa3ac..30d96babe6e14a 100644 --- a/ports/boost-poly-collection/CONTROL +++ b/ports/boost-poly-collection/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-poly-collection Version: 1.73.0 -Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure (!arm), boost-type-traits, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-assert, boost-config, boost-core, boost-detail, boost-iterator, boost-mp11, boost-mpl, boost-type-erasure, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/poly_collection Description: Boost poly_collection module diff --git a/ports/boost-python/CONTROL b/ports/boost-python/CONTROL index 011f68fcde437c..a8698deaaf6bca 100644 --- a/ports/boost-python/CONTROL +++ b/ports/boost-python/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-python Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-bind, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-property-map, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, python3 Homepage: https://github.com/boostorg/python Description: Boost python module +Supports: !uwp&!(arm&windows) Feature: python2 Build-Depends: python2 (windows) diff --git a/ports/boost-safe-numerics/CONTROL b/ports/boost-safe-numerics/CONTROL index ec3fb47d42f988..1cbd56ef8dccc1 100644 --- a/ports/boost-safe-numerics/CONTROL +++ b/ports/boost-safe-numerics/CONTROL @@ -1,6 +1,7 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-safe-numerics Version: 1.73.0 -Build-Depends: boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers +Port-Version: 1 +Build-Depends: boost-concept-check, boost-config, boost-core, boost-integer, boost-logic, boost-mp11, boost-vcpkg-helpers Homepage: https://github.com/boostorg/safe_numerics Description: Boost safe_numerics module diff --git a/ports/boost-stacktrace/CONTROL b/ports/boost-stacktrace/CONTROL index 6b726dbad7ff8c..17cd4eb40c8cdc 100644 --- a/ports/boost-stacktrace/CONTROL +++ b/ports/boost-stacktrace/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-stacktrace Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-array, boost-build, boost-config, boost-container-hash, boost-core, boost-modular-build-helper, boost-predef, boost-static-assert, boost-type-traits, boost-vcpkg-helpers, boost-winapi Homepage: https://github.com/boostorg/stacktrace Description: Boost stacktrace module +Supports: !uwp diff --git a/ports/boost-test/CONTROL b/ports/boost-test/CONTROL index e20a2c343015f0..8ef2c2b11236b6 100644 --- a/ports/boost-test/CONTROL +++ b/ports/boost-test/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-test Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-algorithm, boost-assert, boost-bind, boost-build, boost-compatibility, boost-config, boost-core, boost-detail, boost-exception, boost-function, boost-integer, boost-io, boost-iterator, boost-modular-build-helper, boost-mpl, boost-numeric-conversion, boost-optional, boost-preprocessor, boost-smart-ptr, boost-static-assert, boost-type-traits, boost-utility, boost-vcpkg-helpers Homepage: https://github.com/boostorg/test Description: Boost test module +Supports: !uwp diff --git a/ports/boost-wave/CONTROL b/ports/boost-wave/CONTROL index 538e8772caee4f..7ed072e39b7179 100644 --- a/ports/boost-wave/CONTROL +++ b/ports/boost-wave/CONTROL @@ -1,6 +1,8 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-wave Version: 1.73.0 +Port-Version: 1 Build-Depends: boost-assert, boost-build, boost-concept-check, boost-config, boost-core, boost-detail, boost-filesystem (!uwp), boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-multi-index, boost-pool, boost-preprocessor, boost-serialization, boost-smart-ptr, boost-spirit, boost-static-assert, boost-throw-exception, boost-type-traits, boost-vcpkg-helpers Homepage: https://github.com/boostorg/wave Description: Boost wave module +Supports: !uwp diff --git a/ports/boost/CONTROL b/ports/boost/CONTROL index 5094237daa2e0c..fda7b12ced9b32 100644 --- a/ports/boost/CONTROL +++ b/ports/boost/CONTROL @@ -1,9 +1,11 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost Version: 1.73.0 +Port-Version: 1 Homepage: https://boost.org Description: Peer-reviewed portable C++ source libraries -Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract (!arm), boost-conversion, boost-convert, boost-core, boost-coroutine (!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (windows), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python, boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure (!arm), boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap +Build-Depends: boost-accumulators, boost-algorithm, boost-align, boost-any, boost-array, boost-asio, boost-assert, boost-assign, boost-atomic, boost-beast, boost-bimap, boost-bind, boost-callable-traits, boost-chrono, boost-circular-buffer, boost-compatibility, boost-compute, boost-concept-check, boost-config, boost-container, boost-container-hash, boost-context (!uwp), boost-contract, boost-conversion, boost-convert, boost-core, boost-coroutine (!arm&!uwp), boost-coroutine2, boost-crc, boost-date-time, boost-detail, boost-dll, boost-dynamic-bitset, boost-endian, boost-exception, boost-fiber (!osx&!uwp&!arm), boost-filesystem (!uwp), boost-flyweight, boost-foreach, boost-format, boost-function, boost-functional, boost-function-types, boost-fusion, boost-geometry, boost-gil, boost-graph, boost-graph-parallel, boost-hana, boost-heap, boost-histogram, boost-hof, boost-icl, boost-integer, boost-interprocess, boost-intrusive, boost-io, boost-iostreams (!uwp), boost-iterator, boost-lambda, boost-lexical-cast, boost-locale (!uwp), boost-local-function, boost-lockfree, boost-log (!uwp), boost-logic, boost-math, boost-metaparse, boost-move, boost-mp11, boost-mpl, boost-msm, boost-multiprecision, boost-multi-array, boost-multi-index, boost-nowide, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-optional, boost-outcome, boost-parameter, boost-parameter-python, boost-phoenix, boost-polygon, boost-poly-collection, boost-pool, boost-predef, boost-preprocessor, boost-process, boost-program-options, boost-property-map, boost-property-tree, boost-proto, boost-ptr-container, boost-python (!uwp&!(arm&windows)), boost-qvm, boost-random, boost-range, boost-ratio, boost-rational, boost-regex, boost-numeric-conversion, boost-interval, boost-odeint, boost-ublas, boost-safe-numerics, boost-scope-exit, boost-serialization, boost-signals2, boost-smart-ptr, boost-sort, boost-spirit, boost-stacktrace (!uwp), boost-statechart, boost-static-assert, boost-static-string, boost-system, boost-test (!uwp), boost-thread, boost-throw-exception, boost-timer, boost-tokenizer, boost-tti, boost-tuple, boost-typeof, boost-type-erasure, boost-type-index, boost-type-traits, boost-units, boost-unordered, boost-utility, boost-uuid, boost-variant, boost-variant2, boost-vmd, boost-wave (!uwp), boost-winapi, boost-xpressive, boost-yap + Feature: mpi Description: Build with MPI support diff --git a/ports/brotli/CONTROL b/ports/brotli/CONTROL index ff152f83bd8274..7db9ffb6c56736 100644 --- a/ports/brotli/CONTROL +++ b/ports/brotli/CONTROL @@ -1,4 +1,5 @@ Source: brotli -Version: 1.0.7-1 +Version: 1.0.7 +Port-Version: 3 Homepage: https://github.com/google/brotli Description: a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. diff --git a/ports/brotli/pkgconfig.patch b/ports/brotli/pkgconfig.patch new file mode 100644 index 00000000000000..8ceafe1b10125a --- /dev/null +++ b/ports/brotli/pkgconfig.patch @@ -0,0 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c4b757f9..eed560c1d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -351,7 +351,7 @@ function(generate_pkg_config_path outvar path) + set("${outvar}" "${${outvar}}" PARENT_SCOPE) + endfunction(generate_pkg_config_path) + +-function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) ++function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION SHARED_TARGET STATIC_TARGET) + file(READ ${INPUT_FILE} TEXT) + + set(PREFIX "${CMAKE_INSTALL_PREFIX}") +@@ -366,14 +366,21 @@ function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) + + string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT}) + ++ if(BUILD_SHARED_LIBS) ++ set(LIB_NAME "${SHARED_TARGET}") ++ else() ++ set(LIB_NAME "${STATIC_TARGET}") ++ endif() ++ string(REGEX REPLACE "@lib_name@" "${LIB_NAME}" TEXT ${TEXT}) ++ + file(WRITE ${OUTPUT_FILE} ${TEXT}) + endfunction() + +-transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}" brotlicommon brotlicommon-static) + +-transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}" brotlidec brotlidec-static) + +-transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}" brotlienc brotlienc-static) + + if(NOT BROTLI_BUNDLED_MODE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" +diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in +index 2a8cf7a35..464a21292 100644 +--- a/scripts/libbrotlicommon.pc.in ++++ b/scripts/libbrotlicommon.pc.in +@@ -7,5 +7,5 @@ Name: libbrotlicommon + URL: https://github.com/google/brotli + Description: Brotli common dictionary library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlicommon ++Libs: -L${libdir} -l@lib_name@ + Cflags: -I${includedir} +diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in +index 6f8ef2e41..f87d3f65f 100644 +--- a/scripts/libbrotlidec.pc.in ++++ b/scripts/libbrotlidec.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlidec + URL: https://github.com/google/brotli + Description: Brotli decoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlidec ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} +diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in +index 2098afe2c..7b6371bcb 100644 +--- a/scripts/libbrotlienc.pc.in ++++ b/scripts/libbrotlienc.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlienc + URL: https://github.com/google/brotli + Description: Brotli encoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlienc ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} diff --git a/ports/brotli/portfile.cmake b/ports/brotli/portfile.cmake index 6fa75937c1fce4..81960a9ee83ce7 100644 --- a/ports/brotli/portfile.cmake +++ b/ports/brotli/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES install.patch fix-arm-uwp.patch + pkgconfig.patch ) vcpkg_configure_cmake( @@ -21,6 +22,8 @@ vcpkg_copy_pdbs() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/brotli) vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-brotli TARGET_PATH share/unofficial-brotli) +vcpkg_fixup_pkgconfig() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-brotli) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/brpc/CONTROL b/ports/brpc/CONTROL new file mode 100644 index 00000000000000..39860698135c2b --- /dev/null +++ b/ports/brpc/CONTROL @@ -0,0 +1,6 @@ +Source: brpc +Version: 0.9.7 +Homepage: https://github.com/apache/incubator-brpc +Description: Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called "baidu-rpc" inside Baidu. +Build-Depends: leveldb, gflags, glog, protobuf[zlib], openssl, thrift +Supports: !windows diff --git a/ports/brpc/fix_boost_ptr.patch b/ports/brpc/fix_boost_ptr.patch new file mode 100644 index 00000000000000..4ced79422bc7ce --- /dev/null +++ b/ports/brpc/fix_boost_ptr.patch @@ -0,0 +1,14 @@ +diff --git a/src/brpc/policy/thrift_protocol.cpp b/src/brpc/policy/thrift_protocol.cpp +index eae081a0..39c92338 100755 +--- a/src/brpc/policy/thrift_protocol.cpp ++++ b/src/brpc/policy/thrift_protocol.cpp +@@ -45,8 +45,7 @@ + #if defined(_THRIFT_STDCXX_H_) + # define THRIFT_STDCXX apache::thrift::stdcxx + #else +- # define THRIFT_STDCXX boost +- # include ++ # define THRIFT_STDCXX std + #endif + #endif + diff --git a/ports/brpc/fix_thrift.patch b/ports/brpc/fix_thrift.patch new file mode 100644 index 00000000000000..699f42fb0aa0b9 --- /dev/null +++ b/ports/brpc/fix_thrift.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3deb7342..737f6a70 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -62,8 +62,10 @@ if(WITH_DEBUG_SYMBOLS) + endif() + + if(WITH_THRIFT) ++ find_package(Thrift CONFIG REQUIRED) ++ # target_link_libraries(main PRIVATE thrift::thrift thriftz::thriftz thriftnb::thriftnb) + set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") +- set(THRIFT_LIB "thrift") ++ set(THRIFT_LIB "thrift::thrift") + endif() + + include(GNUInstallDirs) +@@ -196,9 +198,10 @@ set(DYNAMIC_LIB + ${LEVELDB_LIB} + ${PROTOC_LIB} + ${CMAKE_THREAD_LIBS_INIT} ++ ${OPENSSL_CRYPTO_LIBRARY} ++ ${OPENSSL_SSL_LIBRARY} + ${THRIFT_LIB} + ${THRIFTNB_LIB} +- ${OPENSSL_CRYPTO_LIBRARY} + dl + z) + diff --git a/ports/brpc/portfile.cmake b/ports/brpc/portfile.cmake new file mode 100644 index 00000000000000..3a1c1dce73eb00 --- /dev/null +++ b/ports/brpc/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_fail_port_install(ON_TARGET "windows") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/incubator-brpc + REF 1d6510aa50075cade5ed539ee09a11a1b8d7f990 # 0.9.7 + SHA512 9c9dbe2a202e58586010c56634bd371f6a9e3ff0d8c5341abbabd1f1dd204a3aec5e89061fa326b4fc8ae7202f9fc33f93a5acd845d18dab3915a3e2b81cbaf3 + HEAD_REF master + PATCHES + fix_boost_ptr.patch + fix_thrift.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DWITH_THRIFT=ON + -DWITH_MESALINK=OFF + -DWITH_GLOG=ON +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/butil/third_party/superfasthash") + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/bzip2/CONTROL b/ports/bzip2/CONTROL index 695925c073b7c5..bdc70fcf4c9edb 100644 --- a/ports/bzip2/CONTROL +++ b/ports/bzip2/CONTROL @@ -1,4 +1,5 @@ -Source: bzip2 -Version: 1.0.6-5 -Homepage: http://www.bzip.org/ -Description: High-quality data compressor. +Source: bzip2 +Version: 1.0.6 +Port-Version: 7 +Homepage: http://www.bzip.org/ +Description: High-quality data compressor. diff --git a/ports/bzip2/bzip2.pc.in b/ports/bzip2/bzip2.pc.in new file mode 100644 index 00000000000000..91153c13b532be --- /dev/null +++ b/ports/bzip2/bzip2.pc.in @@ -0,0 +1,11 @@ +prefix=@BZIP2_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: bzip2 +Description: bzip2 +Version: 1.0.6 +Requires: +Libs: -L${libdir} -l@bzname@ +Cflags: -I${includedir} \ No newline at end of file diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake index 0462d53eb6f809..d6b70bacb4381a 100644 --- a/ports/bzip2/portfile.cmake +++ b/ports/bzip2/portfile.cmake @@ -1,43 +1,52 @@ -include(vcpkg_common_functions) -set(BZIP2_VERSION 1.0.6) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" - FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" - SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF ${BZIP2_VERSION} - PATCHES - fix-import-export-macros.patch - fix-windows-include.patch -) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS_DEBUG - -DBZIP2_SKIP_HEADERS=ON - -DBZIP2_SKIP_TOOLS=ON -) - -vcpkg_install_cmake() -vcpkg_copy_pdbs() - -file(READ ${CURRENT_PACKAGES_DIR}/include/bzlib.h BZLIB_H) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") -else() - string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") -endif() -file(WRITE ${CURRENT_PACKAGES_DIR}/include/bzlib.h "${BZLIB_H}") - -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/bzip2) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/bzip2/LICENSE ${CURRENT_PACKAGES_DIR}/share/bzip2/copyright) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - -vcpkg_test_cmake(PACKAGE_NAME BZip2 MODULE) +set(BZIP2_VERSION 1.0.6) # TODO: Update to 1.0.8 +vcpkg_download_distfile(ARCHIVE # TODO: switch to vcpkg_from_git with https://sourceware.org/git/?p=bzip2.git;a=summary + URLS "https://github.com/past-due/bzip2-mirror/releases/download/v${BZIP2_VERSION}/bzip2-${BZIP2_VERSION}.tar.gz" + FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" + SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${BZIP2_VERSION} + PATCHES + fix-import-export-macros.patch + fix-windows-include.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DBZIP2_SKIP_HEADERS=ON + -DBZIP2_SKIP_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(READ "${CURRENT_PACKAGES_DIR}/include/bzlib.h" BZLIB_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") +else() + string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") +endif() +file(WRITE "${CURRENT_PACKAGES_DIR}/include/bzlib.h" "${BZLIB_H}") + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}") + set(bzname bz2) + configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/bzip2.pc" @ONLY) +endif() + +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}/debug") + set(bzname bz2d) + configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/bzip2.pc" @ONLY) +endif() + +vcpkg_fixup_pkgconfig() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index 6470d8d09d5ab8..e333f304d23ce6 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -210,7 +210,7 @@ add_library(cairo ${SOURCES}) if (WITH_X11) target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1) endif() - +target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS}) target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig) if(WIN32) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 0eda86fac3f26b..6c26c77a250d5f 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,5 +1,6 @@ Source: cairo -Version: 1.16.0-6 +Version: 1.16.0 +Port-Version: 7 Homepage: https://cairographics.org Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. Build-Depends: zlib, libpng, pixman, freetype, fontconfig diff --git a/ports/cairomm/CMakeLists.txt b/ports/cairomm/CMakeLists.txt index 1274a643167533..1cc02978601678 100644 --- a/ports/cairomm/CMakeLists.txt +++ b/ports/cairomm/CMakeLists.txt @@ -15,6 +15,7 @@ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CAIROMM_MICRO_VERSION ${ message(STATUS "Ciaromm version: ${CAIROMM_MAJOR_VERSION}.${CAIROMM_MINOR_VERSION}.${CAIROMM_MICRO_VERSION}") find_package(Cairo REQUIRED) +find_package(Freetype REQUIRED) find_package(SigC++ REQUIRED) #configure @@ -87,7 +88,7 @@ set(cairomm_rc ${CMAKE_BINARY_DIR}/cairomm.rc) add_library(cairomm-1.0 ${cairomm_cc} ${cairomm_rc}) -target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} ) +target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} Freetype::Freetype) target_include_directories(cairomm-1.0 PRIVATE ${CAIRO_INCLUDE_DIR} ${SIGC++_INCLUDE_DIR} diff --git a/ports/cairomm/CONTROL b/ports/cairomm/CONTROL index e9d9d9b5fd1a7c..7a89c9ec1de468 100644 --- a/ports/cairomm/CONTROL +++ b/ports/cairomm/CONTROL @@ -1,5 +1,6 @@ Source: cairomm -Version: 1.15.3-4 +Version: 1.15.3 +Port-Version: 5 Homepage: https://www.cairographics.org Description: A C++ wrapper for the cairo graphics library Build-Depends: cairo, libsigcpp diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index a0a7a72e02faf8..ecd8f1de63bc79 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,11 +1,12 @@ Source: ceres -Version: 1.14.0-7 +Version: 1.14.0 +Port-Version: 8 Build-Depends: glog, eigen3 Homepage: https://github.com/ceres-solver/ceres-solver Description: non-linear optimization package Feature: lapack -Build-Depends: clapack (!osx) +Build-Depends: lapack Description: Use Lapack in Ceres Feature: suitesparse diff --git a/ports/cgal/CONTROL b/ports/cgal/CONTROL index 60452db0f2dd46..1cb5e38bc9854d 100644 --- a/ports/cgal/CONTROL +++ b/ports/cgal/CONTROL @@ -1,5 +1,5 @@ Source: cgal -Version: 5.0.2-2 +Version: 5.0.3 Build-Depends: mpfr, mpir, zlib, boost-format, boost-container, boost-ptr-container, boost-iterator, boost-variant, boost-any, boost-unordered, boost-random, boost-foreach, boost-graph, boost-heap, boost-logic, boost-multiprecision, boost-interval Homepage: https://github.com/CGAL/cgal Description: The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry. diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 04e3271361d729..a7106503876ed5 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF releases/CGAL-5.0.2 - SHA512 108f1d6f68674e123fd90143049f30a7e7965827468828f75ba7ae0b7ba174690520bafdf0648853c1b28895d6a9a0c7349c03e678c13395a84ffe7397c97e99 + REF releases/CGAL-5.0.3 + SHA512 e163276264d8aeb3a546392f87d898bcbc59a4e2f10c23327f0c8e3d41f0d3d8200f872230da3f077d3a564acfa4b3fa4c6a101db0b3cd8d4a4028fffa8110df HEAD_REF master ) diff --git a/ports/clapack/CONTROL b/ports/clapack/CONTROL index ce3610044aeff6..bbabc6ad89f306 100644 --- a/ports/clapack/CONTROL +++ b/ports/clapack/CONTROL @@ -1,5 +1,6 @@ Source: clapack -Version: 3.2.1-13 +Version: 3.2.1 +Port-Version: 14 Homepage: https://www.netlib.org/clapack Description: CLAPACK (f2c'ed version of LAPACK) Build-Depends: openblas (!osx) diff --git a/ports/clapack/portfile.cmake b/ports/clapack/portfile.cmake index 1de30b1093869a..8fdbe7c42efc24 100644 --- a/ports/clapack/portfile.cmake +++ b/ports/clapack/portfile.cmake @@ -11,7 +11,7 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES remove_internal_blas.patch - fix-ConfigFile.patch + fix-ConfigFile.patch fix-install.patch support-uwp.patch ) @@ -37,10 +37,6 @@ vcpkg_copy_pdbs() #TODO: fix the official exported targets, since they are broken (luckily it seems that no-one uses them for now) vcpkg_fixup_cmake_targets(CONFIG_PATH share/clapack) -#we install a cmake wrapper since the official FindLAPACK module in cmake does find clapack easily, unfortunately... -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright diff --git a/ports/colmap/portfile.cmake b/ports/colmap/portfile.cmake new file mode 100644 index 00000000000000..6b9bf3284c4af2 --- /dev/null +++ b/ports/colmap/portfile.cmake @@ -0,0 +1,89 @@ +set(COLMAP_REF "3.6") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO colmap/colmap + REF ${COLMAP_REF} + SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632 + HEAD_REF dev +) + +if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES)) + message(FATAL_ERROR "Feature cuda and cuda-redist require x64 triplet.") +endif() + +# set GIT_COMMIT_ID and GIT_COMMIT_DATE +if(DEFINED VCPKG_HEAD_VERSION) + set(GIT_COMMIT_ID "${VCPKG_HEAD_VERSION}") +else() + set(GIT_COMMIT_ID "${COLMAP_REF}") +endif() + +string(TIMESTAMP COLMAP_GIT_COMMIT_DATE "%Y-%m-%d") + +set(CUDA_ENABLED OFF) +set(TESTS_ENABLED OFF) + +if("cuda" IN_LIST FEATURES) + set(CUDA_ENABLED ON) +endif() + +if("cuda-redist" IN_LIST FEATURES) + set(CUDA_ENABLED ON) + set(CUDA_ARCHS "Common") +endif() + +if("tests" IN_LIST FEATURES) + set(TESTS_ENABLED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCUDA_ENABLED=${CUDA_ENABLED} + -DCUDA_ARCHS=${CUDA_ARCHS} + -DTESTS_ENABLED=${TESTS_ENABLED} + -DGIT_COMMIT_ID=${GIT_COMMIT_ID} + -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*") +foreach(TOOL_FILENAME ${TOOL_FILENAMES}) + get_filename_component(TEST_TOOL_NAME ${TOOL_FILENAME} NAME_WLE) + list(APPEND COLMAP_TOOL_NAMES "${TEST_TOOL_NAME}") +endforeach() + +vcpkg_copy_tools(TOOL_NAMES ${COLMAP_TOOL_NAMES} AUTO_CLEAN) + +# remove empty folders and unused files +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/lib/Graclus/multilevelLib + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/tools + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/media + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/shaders + ${CURRENT_PACKAGES_DIR}/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib + ${CURRENT_PACKAGES_DIR}/include/colmap/tools + ${CURRENT_PACKAGES_DIR}/include/colmap/ui/media + ${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders + ${CURRENT_PACKAGES_DIR}/COLMAP.bat + ${CURRENT_PACKAGES_DIR}/RUN_TESTS.bat + ${CURRENT_PACKAGES_DIR}/debug/COLMAP.bat + ${CURRENT_PACKAGES_DIR}/debug/RUN_TESTS.bat + ${CURRENT_PACKAGES_DIR}/debug/bin +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) diff --git a/ports/colmap/usage b/ports/colmap/usage new file mode 100644 index 00000000000000..b71316b3cf81a3 --- /dev/null +++ b/ports/colmap/usage @@ -0,0 +1,10 @@ +For example, under Windows, execute COLMAP as: + + \packages\colmap_\tools\colmap\colmap.exe gui + \packages\colmap_\tools\colmap\colmap.exe mapper + \packages\colmap_\tools\colmap\colmap.exe ... + +The package colmap provides CMake integration: + + find_package(COLMAP REQUIRED) + target_link_libraries(main ${COLMAP_LIBRARIES}) diff --git a/ports/colmap/vcpkg.json b/ports/colmap/vcpkg.json new file mode 100644 index 00000000000000..565e945baba8e5 --- /dev/null +++ b/ports/colmap/vcpkg.json @@ -0,0 +1,55 @@ +{ + "name": "colmap", + "version-string": "3.6", + "description": "COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. It offers a wide range of features for reconstruction of ordered and unordered image collections. The software is licensed under the new BSD license.", + "homepage": "https://colmap.github.io/", + "license": "BSD-3-Clause", + "dependencies": [ + "boost-filesystem", + "boost-graph", + "boost-program-options", + "boost-regex", + "boost-system", + "boost-test", + { + "name": "ceres", + "features": [ + "lapack", + "suitesparse" + ] + }, + { + "name": "cgal", + "features": [ + "qt" + ] + }, + "eigen3", + "freeimage", + "gflags", + "glew", + "glog", + "qt5-base", + "suitesparse" + ], + "features": [ + { + "name": "cuda", + "description": "CUDA support for current compute architecture of this machine.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "cuda-redist", + "description": "Redistributable CUDA support for common supported compute architectures.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "tests", + "description": "Enable TESTS." + } + ] +} diff --git a/ports/constexpr-contracts/CONTROL b/ports/constexpr-contracts/CONTROL new file mode 100644 index 00000000000000..515b9b2b56907f --- /dev/null +++ b/ports/constexpr-contracts/CONTROL @@ -0,0 +1,4 @@ +Source: constexpr-contracts +Version: 2020-08-09 +Homepage: https://github.com/cjdb/constexpr-contracts +Description: A constexpr-friendly, optimisation-friendly contracts library. diff --git a/ports/constexpr-contracts/portfile.cmake b/ports/constexpr-contracts/portfile.cmake new file mode 100644 index 00000000000000..0a6e167b5d699d --- /dev/null +++ b/ports/constexpr-contracts/portfile.cmake @@ -0,0 +1,20 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cjdb/constexpr-contracts + REF 58154e9010cb80aad4e95ef6f1835ebd7db3780a # commit 2020-05-25 + SHA512 b634267a4044cd712c8e52f65cd305f437864cab591f2b22104581f70b305ba52889dd46724e6047386463a010ee78fdd951411ea3691b5725d52d13f7adda76 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/constexpr-contracts) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/coroutine/CONTROL b/ports/coroutine/CONTROL deleted file mode 100644 index 13fa58ab2a58f2..00000000000000 --- a/ports/coroutine/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: coroutine -Homepage: https://github.com/luncliff/coroutine -Version: 1.5.0 -Build-Depends: ms-gsl -Description: C++ 20 Coroutines helper/example library -Supports: !uwp diff --git a/ports/coroutine/fix-errorC7651.patch b/ports/coroutine/fix-errorC7651.patch new file mode 100644 index 00000000000000..42c4291a500006 --- /dev/null +++ b/ports/coroutine/fix-errorC7651.patch @@ -0,0 +1,68 @@ +diff --git a/modules/portable/frame.cpp b/modules/portable/frame.cpp +index 2cedf81..f413f28 100644 +--- a/modules/portable/frame.cpp ++++ b/modules/portable/frame.cpp +@@ -77,13 +77,31 @@ size_t _coro_done(void*); + // + // intrinsic: Clang/GCC + // +-extern "C" { +-bool __builtin_coro_done(void*); +-void __builtin_coro_resume(void*); +-void __builtin_coro_destroy(void*); +-// void* __builtin_coro_promise(void* ptr, int align, bool p); ++//extern "C" { ++template ++void resume_wrapper(void *p) ++{ ++ if constexpr (B) ++ __builtin_coro_resume(p); ++} ++ ++template ++void destroy_wrapper(void *p) ++{ ++ if constexpr(B) ++ __builtin_coro_destroy(p); + } + ++template ++bool done_wrapper(void *p) ++{ ++ if constexpr(B) ++ return __builtin_coro_done(p); ++ return false; ++} ++// void* __builtin_coro_promise(void* ptr, int align, bool p); ++//} ++ + bool _coro_finished(portable_coro_prefix* _Handle); + + #if defined(__clang__) +@@ -124,7 +142,7 @@ bool portable_coro_done(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + return _coro_finished(_Handle); + } else if constexpr (is_clang) { +- return __builtin_coro_done(_Handle); ++ return done_wrapper(_Handle); + } + return false; // follow `noop_coroutine` + } +@@ -133,7 +151,7 @@ void portable_coro_resume(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + _coro_resume(_Handle); + } else if constexpr (is_clang) { +- __builtin_coro_resume(_Handle); ++ resume_wrapper(_Handle); + } + } + +@@ -141,7 +159,7 @@ void portable_coro_destroy(portable_coro_prefix* _Handle) { + if constexpr (is_msvc) { + _coro_destroy(_Handle); + } else if constexpr (is_clang) { +- __builtin_coro_destroy(_Handle); ++ destroy_wrapper(_Handle); + } + } + diff --git a/ports/coroutine/portfile.cmake b/ports/coroutine/portfile.cmake index 26abb7bf7a3ffe..3c5f27b72caaab 100644 --- a/ports/coroutine/portfile.cmake +++ b/ports/coroutine/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( REF 1.5.0 SHA512 61b91fdc641b6905b884e99c5bf193ec2cf6962144ab3baafdb9432115757d96f3797f116b30356f0d21417b23082bc908f75042721caeab3329c4910b654594 HEAD_REF master + PATCHES fix-errorC7651.patch ) vcpkg_configure_cmake( diff --git a/ports/coroutine/vcpkg.json b/ports/coroutine/vcpkg.json new file mode 100644 index 00000000000000..4e71341284ef76 --- /dev/null +++ b/ports/coroutine/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "coroutine", + "version-string": "1.5.0", + "port-version": 1, + "description": "C++ 20 Coroutines helper/example library", + "homepage": "https://github.com/luncliff/coroutine", + "supports": "!uwp", + "dependencies": [ + "ms-gsl" + ] +} diff --git a/ports/cppad/CONTROL b/ports/cppad/CONTROL new file mode 100644 index 00000000000000..f38cfd121b4da8 --- /dev/null +++ b/ports/cppad/CONTROL @@ -0,0 +1,5 @@ +Source: cppad +Version: 20200000.3 +Homepage: https://github.com/coin-or/CppAD +Description: CppAD: A Package for Differentiation of C++ Algorithms +Supports: !(arm|uwp) diff --git a/ports/cppad/pkgconfig-fix.patch b/ports/cppad/pkgconfig-fix.patch new file mode 100644 index 00000000000000..6688fc9d7f90f1 --- /dev/null +++ b/ports/cppad/pkgconfig-fix.patch @@ -0,0 +1,63 @@ +diff --git a/pkgconfig/CMakeLists.txt b/pkgconfig/CMakeLists.txt +index db8b65902..b1224a01d 100644 +--- a/pkgconfig/CMakeLists.txt ++++ b/pkgconfig/CMakeLists.txt +@@ -42,8 +42,9 @@ ENDIF( cppad_has_ipopt ) + # cppad_pkgconfig_cflags + # cppad_pkgconfig_cflags_uninstalled + # +-SET(cppad_pkgconfig_cflags "-I${cppad_abs_includedir}" ) +-SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) ++SET(cppad_pkgconfig_includedir "${cmake_install_includedirs}" ) ++SET(cppad_pkgconfig_cflags_uninstalled "-I${cppad_SOURCE_DIR}" ) ++SET(cppad_pkgconfig_libdir "${cmake_install_libdirs}" ) + # ---------------------------------------------------------------------------- + # cppad_pkgconfig_libs + # cppad_pkgconfig_libs_uninstalled +@@ -74,7 +75,7 @@ IF( "${libs}" STREQUAL "" ) + SET(cppad_pkgconfig_libs "") + SET(cppad_pkgconfig_libs_uninstalled "") + ELSE( "${libs}" STREQUAL "" ) +- SET(cppad_pkgconfig_libs "-L${cppad_abs_libdir} ${libs}") ++ SET(cppad_pkgconfig_libs "-L\${libdir} ${libs}") + SET(cppad_pkgconfig_libs_uninstalled "${uninstalled} ${libs}") + ENDIF( "${libs}" STREQUAL "" ) + # +@@ -84,10 +85,12 @@ ENDIF( "${libs}" STREQUAL "" ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/cppad.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc ++ @ONLY + ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/cppad-uninstalled.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/cppad-uninstalled.pc ++ @ONLY + ) + # During install copy cppad.pc to datadir and libdir + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc +diff --git a/pkgconfig/cppad.pc.in b/pkgconfig/cppad.pc.in +index a202e3fb3..1c34c1e08 100644 +--- a/pkgconfig/cppad.pc.in ++++ b/pkgconfig/cppad.pc.in +@@ -12,12 +12,19 @@ + # This file is used with pkg-config to include CppAD after it is installed + # + # Entries set by top source directory CMakeLists.txt file ++ ++prefix=${pcfiledir}/../.. ++exec_prefix=${prefix} ++libdir=${exec_prefix}/@cppad_pkgconfig_libdir@ ++includedir=${prefix}/@cppad_pkgconfig_includedir@ ++ + Name: cppad + Description: @cppad_description@ + Version: @cppad_version@ + URL: @cppad_url@ ++ + # + # Entries set by pkgconfig/CMakeLists.txt file +-Cflags: @cppad_pkgconfig_cflags@ ++Cflags: -I${includedir} + Libs: @cppad_pkgconfig_libs@ + Requires: @cppad_pkgconfig_requires@ diff --git a/ports/cppad/portfile.cmake b/ports/cppad/portfile.cmake new file mode 100644 index 00000000000000..1c9fc8ddf4e45e --- /dev/null +++ b/ports/cppad/portfile.cmake @@ -0,0 +1,42 @@ +# the compilation fails on arm and uwp. Please check the related issue: +# https://github.com/microsoft/vcpkg/pull/12560#issuecomment-668412073 +vcpkg_fail_port_install(ON_TARGET "uwp" and "arm") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO coin-or/CppAD + REF 20200000.3 + SHA512 4e980665a21c76cf355d1c5597c65fbfba7ac3e15c43a88ccfe3ba0267b85b4e9aa7c6e8a0ed7a728f8cf2c6e1424625d5cbcdd295a6c0a08b47b4b121572d13 + HEAD_REF master + PATCHES + windows-fix.patch + pkgconfig-fix.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -Dcppad_prefix=${CURRENT_PACKAGES_DIR} + OPTIONS_RELEASE + -Dcmake_install_libdirs=lib + -Dcppad_debug_which:STRING=debug_none + OPTIONS_DEBUG + -Dcmake_install_libdirs=debug/lib +) + +vcpkg_install_cmake() + +# Install the pkgconfig file +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +endif() + +vcpkg_fixup_pkgconfig() + +# Add the copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cppad/windows-fix.patch b/ports/cppad/windows-fix.patch new file mode 100644 index 00000000000000..50c38ca12307e6 --- /dev/null +++ b/ports/cppad/windows-fix.patch @@ -0,0 +1,105 @@ +diff --git a/cppad_lib/cppad_colpack.cpp b/cppad_lib/cppad_colpack.cpp +index dc3327053..739363292 100644 +--- a/cppad_lib/cppad_colpack.cpp ++++ b/cppad_lib/cppad_colpack.cpp +@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + + # if CPPAD_HAS_COLPACK == 0 + namespace CppAD { namespace local { +- CPPAD_LIB_EXPORT void this_routine_should_never_get_called(void) ++ void this_routine_should_never_get_called(void) + { CPPAD_ASSERT_UNKNOWN(false); } + } } + # else // CPPAD_HAS_COLPACK +@@ -52,7 +52,7 @@ the entry with index (i, adolc_pattern[i][k]) is a non-zero + in the sparsity pattern for the matrix. + */ + // ---------------------------------------------------------------------- +-CPPAD_LIB_EXPORT void cppad_colpack_general( ++void cppad_colpack_general( + CppAD::vector& color , + size_t m , + size_t n , +@@ -164,7 +164,7 @@ For i = 0 , ... , m-1, and for k = 1, ... ,adolc_pattern[i][0], + the entry with index (i, adolc_pattern[i][k]) is + in the sparsity pattern for the symmetric matrix. + */ +-CPPAD_LIB_EXPORT void cppad_colpack_symmetric( ++void cppad_colpack_symmetric( + CppAD::vector& color , + size_t m , + const CppAD::vector& adolc_pattern ) +diff --git a/cppad_lib/json_parser.cpp b/cppad_lib/json_parser.cpp +index fac417d9f..ac0910cee 100644 +--- a/cppad_lib/json_parser.cpp ++++ b/cppad_lib/json_parser.cpp +@@ -20,7 +20,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + // documentation for this routine is in the file below + # include + +-CPPAD_LIB_EXPORT void CppAD::local::graph::json_parser( ++void CppAD::local::graph::json_parser( + const std::string& json , + cpp_graph& graph_obj ) + { using std::string; +diff --git a/cppad_lib/json_writer.cpp b/cppad_lib/json_writer.cpp +index 250345c6e..add4b20a9 100644 +--- a/cppad_lib/json_writer.cpp ++++ b/cppad_lib/json_writer.cpp +@@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: + // documentation for this routine is in the file below + # include + +-CPPAD_LIB_EXPORT void CppAD::local::graph::json_writer( ++void CppAD::local::graph::json_writer( + std::string& json , + const cpp_graph& graph_obj ) + { using std::string; +diff --git a/include/cppad/local/cppad_colpack.hpp b/include/cppad/local/cppad_colpack.hpp +index ee96ab5fe..6dd022180 100644 +--- a/include/cppad/local/cppad_colpack.hpp ++++ b/include/cppad/local/cppad_colpack.hpp +@@ -59,7 +59,7 @@ it is not the case that both + This routine tries to minimize, with respect to the choice of colors, + the number of colors. + */ +-extern void cppad_colpack_general( ++CPPAD_LIB_EXPORT void cppad_colpack_general( + CppAD::vector& color , + size_t m , + size_t n , +@@ -91,7 +91,7 @@ The properties of this coloring have not yet been determined; see + Efficient Computation of Sparse Hessians Using Coloring + and Automatic Differentiation (pdf/ad/gebemedhin14.pdf) + */ +-extern void cppad_colpack_symmetric( ++CPPAD_LIB_EXPORT void cppad_colpack_symmetric( + CppAD::vector& color , + size_t n , + const CppAD::vector& adolc_pattern +diff --git a/include/cppad/local/graph/json_parser.hpp b/include/cppad/local/graph/json_parser.hpp +index 17bcc7c7e..a28d2c045 100644 +--- a/include/cppad/local/graph/json_parser.hpp ++++ b/include/cppad/local/graph/json_parser.hpp +@@ -42,7 +42,7 @@ Upon return it is a $cref cpp_ad_graph$$ representation of this function. + $head Prototype$$ + $srccode%hpp% */ + namespace CppAD { namespace local { namespace graph { +- void json_parser( ++ CPPAD_LIB_EXPORT void json_parser( + const std::string& json , + cpp_graph& graph_obj + ); +diff --git a/include/cppad/local/graph/json_writer.hpp b/include/cppad/local/graph/json_writer.hpp +index 36a4cb39f..299c56cc0 100644 +--- a/include/cppad/local/graph/json_writer.hpp ++++ b/include/cppad/local/graph/json_writer.hpp +@@ -41,7 +41,7 @@ This is a $code cpp_graph$$ object. + $head Prototype$$ + $srccode%hpp% */ + namespace CppAD { namespace local { namespace graph { +- void json_writer( ++ CPPAD_LIB_EXPORT void json_writer( + std::string& json , + const cpp_graph& graph_obj + ); diff --git a/ports/crashrpt/001-add-install-target-and-find-deps.patch b/ports/crashrpt/001-add-install-target-and-find-deps.patch new file mode 100644 index 00000000000000..2d983800d4a58a --- /dev/null +++ b/ports/crashrpt/001-add-install-target-and-find-deps.patch @@ -0,0 +1,809 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 44d7df0..ed9e3d3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,6 +17,9 @@ set (CRASHRPT_VER 1403) + # Build options + option(CRASHRPT_BUILD_SHARED_LIBS "If set (default), CrashRpt modules are built as dynamic-link libraries, otherwise as static libs." ON) + option(CRASHRPT_LINK_CRT_AS_DLL "If set (default), CrashRpt modules link C run-time (CRT) as multi-threaded dynamic libraries, otherwise as multi-threaded static libs." ON) ++option(CRASHRPT_BUILD_PROBE "If set (default), CrashRpt builds the CrashRptProbe project." ON) ++option(CRASHRPT_BUILD_DEMOS "If set (default), CrashRpt builds the demo projects." ON) ++option(CRASHRPT_BUILD_TESTS "If set (default), CrashRpt builds the test projects." ON) + + # Set output directory for executable files + if(CMAKE_CL_64) +@@ -94,19 +97,65 @@ macro(fix_default_compiler_settings_) + + endmacro() + ++find_package(ZLIB REQUIRED) ++find_package(PNG REQUIRED) ++find_package(Ogg REQUIRED) ++find_package(JPEG REQUIRED) ++ ++find_library(THEORA_LIBRARY theora) ++if(NOT THEORA_LIBRARY) ++ message(FATAL_ERROR "theora library not found") ++endif() ++ ++find_path(THEORA_INCLUDE_DIR theora/theora.h) ++if(NOT THEORA_INCLUDE_DIR) ++ message(FATAL_ERROR "theora include dir not found") ++endif() ++ ++find_library(TINYXML_LIBRARY NAMES tinyxml) ++if(NOT TINYXML_LIBRARY) ++ message(FATAL_ERROR "tinyxml library not found") ++endif() ++ ++find_path(TINYXML_INCLUDE_DIR tinyxml.h) ++if(NOT TINYXML_INCLUDE_DIR) ++ message(FATAL_ERROR "tinyxml include dir not found") ++endif() ++ ++find_path(WTL_INCLUDE_DIR wtl/atlapp.h) ++if(NOT WTL_INCLUDE_DIR) ++ message(FATAL_ERROR "WTL include dir not found") ++endif() ++ ++find_library(DBGHELP_LIBRARY dbghelp) ++if(NOT DBGHELP_LIBRARY) ++ message(FATAL_ERROR "dbghelp library not found") ++endif() ++ ++find_path(DBGHELP_INCLUDE_DIR dbghelp.h) ++if(NOT DBGHELP_INCLUDE_DIR) ++ message(FATAL_ERROR "dbghelp include dir not found") ++endif() ++ + # Other CMakeLists are located in project subdirectories + ++if(CRASHRPT_BUILD_DEMOS) + add_subdirectory("demos/ConsoleDemo") + add_subdirectory("demos/WTLDemo") + add_subdirectory("demos/MFCDemo") ++endif() + + add_subdirectory("reporting/crashrpt") + add_subdirectory("reporting/crashsender") + ++if(CRASHRPT_BUILD_PROBE) + add_subdirectory("processing/crashrptprobe") + add_subdirectory("processing/crprober") ++endif() + ++if(CRASHRPT_BUILD_TESTS) + add_subdirectory("tests") ++endif() + + # Set output directory for LIB files + if(CMAKE_CL_64) +@@ -117,13 +166,13 @@ else(CMAKE_CL_64) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/thirdparty/lib) + endif(CMAKE_CL_64) + +-add_subdirectory("thirdparty/tinyxml") +-add_subdirectory("thirdparty/jpeg") +-add_subdirectory("thirdparty/libpng") ++#add_subdirectory("thirdparty/tinyxml") ++#add_subdirectory("thirdparty/jpeg") ++#add_subdirectory("thirdparty/libpng") + add_subdirectory("thirdparty/minizip") +-add_subdirectory("thirdparty/zlib") +-add_subdirectory("thirdparty/libogg") +-add_subdirectory("thirdparty/libtheora") ++#add_subdirectory("thirdparty/zlib") ++#add_subdirectory("thirdparty/libogg") ++#add_subdirectory("thirdparty/libtheora") + + + +diff --git a/demos/ConsoleDemo/CMakeLists.txt b/demos/ConsoleDemo/CMakeLists.txt +index e47ef4c..4df7b12 100644 +--- a/demos/ConsoleDemo/CMakeLists.txt ++++ b/demos/ConsoleDemo/CMakeLists.txt +@@ -12,12 +12,12 @@ fix_default_compiler_settings_() + # Add include dir + include_directories(${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg +- ${CMAKE_SOURCE_DIR}/thirdparty/libpng +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml ) ++ ${JPEG_INCLUDE_DIR} ++ ${PNG_INCLUDE_DIRS} ++ ${TINYXML_INCLUDE_DIR} ) + + # Add executable build target + add_executable(ConsoleDemo ${source_files} ${header_files}) +@@ -26,3 +26,7 @@ add_executable(ConsoleDemo ${source_files} ${header_files}) + target_link_libraries(ConsoleDemo CrashRpt) + + set_target_properties(ConsoleDemo PROPERTIES DEBUG_POSTFIX d ) ++ ++install(TARGETS ConsoleDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/MFCDemo/CMakeLists.txt b/demos/MFCDemo/CMakeLists.txt +index a250ecc..ade93cb 100644 +--- a/demos/MFCDemo/CMakeLists.txt ++++ b/demos/MFCDemo/CMakeLists.txt +@@ -44,7 +44,7 @@ if(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" +@@ -53,9 +53,13 @@ else(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" + ) +-endif(CMAKE_CL_64) +\ No newline at end of file ++endif(CMAKE_CL_64) ++ ++install(TARGETS MFCDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/WTLDemo/AboutDlg.h b/demos/WTLDemo/AboutDlg.h +index 83eaac0..e96d1c2 100644 +--- a/demos/WTLDemo/AboutDlg.h ++++ b/demos/WTLDemo/AboutDlg.h +@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #pragma once + #include "stdafx.h" + #include +-#include ++#include + #include "CrashRpt.h" + + class CAboutDlg : public CDialogImpl +diff --git a/demos/WTLDemo/CMakeLists.txt b/demos/WTLDemo/CMakeLists.txt +index 40aaefb..42c0f5a 100644 +--- a/demos/WTLDemo/CMakeLists.txt ++++ b/demos/WTLDemo/CMakeLists.txt +@@ -19,7 +19,7 @@ fix_default_compiler_settings_() + + # Add include dir + include_directories(${CMAKE_SOURCE_DIR}/include +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl) ++ ${WTL_INCLUDE_DIR}) + + # Add executable build target + add_executable(WTLDemo WIN32 ${source_files} ${header_files}) +@@ -36,7 +36,7 @@ if(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\\x64\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\x64\\crashrpt_lang.ini\"" +@@ -45,9 +45,13 @@ else(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET WTLDemo + POST_BUILD +- COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" ++ #COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/bin\\dbghelp.dll\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.ini\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/demos/WTLDemo\\dummy.log\" \"${CMAKE_BINARY_DIR}/bin\"" + COMMAND copy ARGS "\"${CMAKE_SOURCE_DIR}/lang_files\\crashrpt_lang_EN.ini\" \"${CMAKE_BINARY_DIR}/bin\\crashrpt_lang.ini\"" + ) +-endif(CMAKE_CL_64) +\ No newline at end of file ++endif(CMAKE_CL_64) ++ ++install(TARGETS WTLDemo ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/demos/WTLDemo/DocumentDlg.h b/demos/WTLDemo/DocumentDlg.h +index afce8fe..9b47728 100644 +--- a/demos/WTLDemo/DocumentDlg.h ++++ b/demos/WTLDemo/DocumentDlg.h +@@ -33,7 +33,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #pragma once + #include "stdafx.h" + #include +-#include ++#include + #include "CrashRpt.h" + + class CDocumentDlg : public CDialogImpl +diff --git a/demos/WTLDemo/WTLDemo.rc b/demos/WTLDemo/WTLDemo.rc +index c651841..71f4b39 100644 +--- a/demos/WTLDemo/WTLDemo.rc ++++ b/demos/WTLDemo/WTLDemo.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/demos/WTLDemo/stdafx.h b/demos/WTLDemo/stdafx.h +index a601446..658d9e5 100644 +--- a/demos/WTLDemo/stdafx.h ++++ b/demos/WTLDemo/stdafx.h +@@ -16,10 +16,10 @@ be found in the Authors.txt file in the root of the source tree. + #pragma once + + // Change these values to use different versions +-#define WINVER 0x0500 ++#define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 +-#define _WIN32_IE 0x0501 +-#define _RICHEDIT_VER 0x0200 ++#define _WIN32_IE 0x0600 ++#define _RICHEDIT_VER 0x0300 + + #include + #if ( _ATL_VER < 0x0800 ) +@@ -52,18 +52,18 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include ++#include ++#include ++#include + + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER>=1400 + #if defined _M_IX86 +diff --git a/processing/crashrptprobe/CMakeLists.txt b/processing/crashrptprobe/CMakeLists.txt +index a6c692a..c513c6d 100644 +--- a/processing/crashrptprobe/CMakeLists.txt ++++ b/processing/crashrptprobe/CMakeLists.txt +@@ -21,11 +21,11 @@ fix_default_compiler_settings_() + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/crashrpt + ${CMAKE_SOURCE_DIR}/reporting/crashsender +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} ++ ${ZLIB_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml +- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include) ++ ${TINYXML_INCLUDE_DIR} ++ ${DBGHELP_INCLUDE_DIR}) + + # Add library build target + if(CRASHRPT_BUILD_SHARED_LIBS) +@@ -34,15 +34,15 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + add_library(CrashRptProbe STATIC ${source_files} ${header_files}) + endif(CRASHRPT_BUILD_SHARED_LIBS) + +-if(CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) +- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) +-else(CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) +- target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) +-endif(CMAKE_CL_64) ++#if(CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) ++# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64/dbghelp.lib) ++#else(CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) ++# target_link_libraries(CrashRptProbe ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/dbghelp.lib) ++#endif(CMAKE_CL_64) + +-target_link_libraries(CrashRptProbe zlib minizip tinyxml Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) ++target_link_libraries(CrashRptProbe ZLIB::ZLIB minizip ${TINYXML_LIBRARY} ${DBGHELP_LIBRARY} Rpcrt4.lib shell32.lib gdi32.lib version.lib psapi.lib) + + if(CRASHRPT_BUILD_SHARED_LIBS) + +@@ -58,4 +58,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + + endif(CRASHRPT_BUILD_SHARED_LIBS) + ++set_target_properties(CrashRptProbe PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRptProbe.h) + ++INSTALL(TARGETS CrashRptProbe ++ PUBLIC_HEADER DESTINATION include/crashrpt ++ LIBRARY ++ ARCHIVE ++ RUNTIME ++) +diff --git a/processing/crashrptprobe/CrashRptProbe.rc b/processing/crashrptprobe/CrashRptProbe.rc +index a08f63e..e12b8e9 100644 +--- a/processing/crashrptprobe/CrashRptProbe.rc ++++ b/processing/crashrptprobe/CrashRptProbe.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/processing/crashrptprobe/stdafx.h b/processing/crashrptprobe/stdafx.h +index 2b027b2..0b60659 100644 +--- a/processing/crashrptprobe/stdafx.h ++++ b/processing/crashrptprobe/stdafx.h +@@ -70,13 +70,13 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + extern CAppModule _Module; + #include + + // CString-related includes + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER<1400 + #define WCSNCPY_S(strDest, sizeInBytes, strSource, count) wcsncpy(strDest, strSource, count) +diff --git a/processing/crprober/CMakeLists.txt b/processing/crprober/CMakeLists.txt +index 046ba57..255e200 100644 +--- a/processing/crprober/CMakeLists.txt ++++ b/processing/crprober/CMakeLists.txt +@@ -18,4 +18,8 @@ add_executable(crprober ${source_files} ${header_files}) + # Add input link libraries + target_link_libraries(crprober CrashRptProbe) + +-set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file ++set_target_properties(crprober PROPERTIES DEBUG_POSTFIX d ) ++ ++install(TARGETS crprober ++ RUNTIME DESTINATION tools/crashrpt ++) +diff --git a/reporting/crashrpt/CMakeLists.txt b/reporting/crashrpt/CMakeLists.txt +index 42d40e2..c7e4fd6 100644 +--- a/reporting/crashrpt/CMakeLists.txt ++++ b/reporting/crashrpt/CMakeLists.txt +@@ -18,7 +18,7 @@ add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE) + fix_default_compiler_settings_() + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl) ++include_directories( ${CMAKE_SOURCE_DIR}/include ${WTL_INCLUDE_DIR}) + + # Add library build target + if(CRASHRPT_BUILD_SHARED_LIBS) +@@ -55,3 +55,11 @@ else(CRASHRPT_BUILD_SHARED_LIBS) + RELEASE_POSTFIX LIB ) + endif(CRASHRPT_BUILD_SHARED_LIBS) + ++set_target_properties(CrashRpt PROPERTIES PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/include/CrashRpt.h) ++ ++INSTALL(TARGETS CrashRpt ++ PUBLIC_HEADER DESTINATION include/crashrpt ++ LIBRARY ++ ARCHIVE ++ RUNTIME ++) +diff --git a/reporting/crashrpt/CrashRpt.rc b/reporting/crashrpt/CrashRpt.rc +index 95e7502..a8c821b 100644 +--- a/reporting/crashrpt/CrashRpt.rc ++++ b/reporting/crashrpt/CrashRpt.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -32,7 +32,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/reporting/crashrpt/StdAfx.h b/reporting/crashrpt/StdAfx.h +index 77d8c36..13bbe50 100644 +--- a/reporting/crashrpt/StdAfx.h ++++ b/reporting/crashrpt/StdAfx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + #include + #include +@@ -54,12 +54,12 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + extern CAppModule _Module; + #include + // CString-related includes + #define _WTL_USE_CSTRING +-#include ++#include + #include + #include + #include +diff --git a/reporting/crashsender/CMakeLists.txt b/reporting/crashsender/CMakeLists.txt +index 9b444c5..aa4ab8a 100644 +--- a/reporting/crashsender/CMakeLists.txt ++++ b/reporting/crashsender/CMakeLists.txt +@@ -22,27 +22,27 @@ fix_default_compiler_settings_() + # Add include dir + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl +- ${CMAKE_SOURCE_DIR}/thirdparty/zlib ++ ${WTL_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/thirdparty/minizip +- ${CMAKE_SOURCE_DIR}/thirdparty/jpeg +- ${CMAKE_SOURCE_DIR}/thirdparty/libpng +- ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml +- ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/include +- ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include +- ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) +- +-if(NOT CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) +-else(NOT CMAKE_CL_64) +- link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) +-endif(NOT CMAKE_CL_64) ++ ${ZLIB_INCLUDE_DIRS} ++ ${JPEG_INCLUDE_DIR} ++ ${PNG_INCLUDE_DIRS} ++ ${TINYXML_INCLUDE_DIR} ++ ${DBGHELP_INCLUDE_DIR} ++ ${OGG_INCLUDE_DIRS} ++ ${THEORA_INCLUDE_DIR}) ++ ++#if(NOT CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib ) ++#else(NOT CMAKE_CL_64) ++# link_directories( ${CMAKE_SOURCE_DIR}/thirdparty/dbghelp/lib/amd64 ) ++#endif(NOT CMAKE_CL_64) + + # Add executable build target + add_executable(CrashSender WIN32 ${source_files} ${header_files}) + + # Add input link libraries +-target_link_libraries(CrashSender zlib minizip libjpeg libpng tinyxml libogg libtheora WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) ++target_link_libraries(CrashSender ZLIB::ZLIB minizip ${JPEG_LIBRARIES} PNG::PNG ${TINYXML_LIBRARY} Ogg::ogg ${THEORA_LIBRARY} WS2_32.lib Dnsapi.lib wininet.lib Rpcrt4.lib Gdi32.lib shell32.lib Comdlg32.lib version.lib psapi.lib) + + # Add compiler flags (/MP for multi-processor compilation, /Os to favor small code) + set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") +@@ -52,4 +52,12 @@ set_target_properties(CrashRpt PROPERTIES COMPILE_FLAGS "/Os") + + set_target_properties(CrashSender PROPERTIES + DEBUG_POSTFIX ${CRASHRPT_VER}d +- RELEASE_POSTFIX ${CRASHRPT_VER} ) +\ No newline at end of file ++ RELEASE_POSTFIX ${CRASHRPT_VER} ) ++ ++install(TARGETS CrashSender ++ RUNTIME DESTINATION tools/crashrpt ++) ++ ++file(GLOB LANG_FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_*.ini") ++install(FILES ${LANG_FILES} DESTINATION tools/crashrpt) ++install(FILES "${CMAKE_SOURCE_DIR}/lang_files/crashrpt_lang_EN.ini" DESTINATION tools/crashrpt RENAME crashrpt_lang.ini) +diff --git a/reporting/crashsender/CrashSender.rc b/reporting/crashsender/CrashSender.rc +index 0502962..e10e269 100644 +--- a/reporting/crashsender/CrashSender.rc ++++ b/reporting/crashsender/CrashSender.rc +@@ -7,7 +7,7 @@ + // + // Generated from the TEXTINCLUDE 2 resource. + // +-#include "atlres.h" ++#include "wtl/atlres.h" + + ///////////////////////////////////////////////////////////////////////////// + #undef APSTUDIO_READONLY_SYMBOLS +@@ -243,7 +243,7 @@ END + + 2 TEXTINCLUDE + BEGIN +- "#include ""atlres.h""\r\n" ++ "#include ""wtl/atlres.h""\r\n" + "\0" + END + +diff --git a/reporting/crashsender/ErrorReportSender.cpp b/reporting/crashsender/ErrorReportSender.cpp +index ac9603c..64cf2b5 100644 +--- a/reporting/crashsender/ErrorReportSender.cpp ++++ b/reporting/crashsender/ErrorReportSender.cpp +@@ -722,9 +722,9 @@ BOOL CErrorReportSender::CreateMiniDump() + CompiledApiVer.Reserved = 0; + LPAPI_VERSION pActualApiVer = lpImagehlpApiVersionEx(&CompiledApiVer); + pActualApiVer; +- ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); +- ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); +- ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); ++ //ATLASSERT(CompiledApiVer.MajorVersion==pActualApiVer->MajorVersion); ++ //ATLASSERT(CompiledApiVer.MinorVersion==pActualApiVer->MinorVersion); ++ //ATLASSERT(CompiledApiVer.Revision==pActualApiVer->Revision); + } + + // Write minidump to the file +@@ -1086,7 +1086,7 @@ BOOL CErrorReportSender::CreateCrashDescriptionXML(CErrorReportInfo& eri) + goto cleanup; + } + +- doc.useMicrosoftBOM = true; ++ //doc.useMicrosoftBOM = true; + bool bSave = doc.SaveFile(f); + if(!bSave) + { +diff --git a/reporting/crashsender/FilePreviewCtrl.cpp b/reporting/crashsender/FilePreviewCtrl.cpp +index e71aafc..5650291 100644 +--- a/reporting/crashsender/FilePreviewCtrl.cpp ++++ b/reporting/crashsender/FilePreviewCtrl.cpp +@@ -365,7 +365,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + if (!png_ptr) + goto cleanup; + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + goto cleanup; + + info_ptr = png_create_info_struct(png_ptr); +@@ -389,7 +389,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + width = png_get_image_width(png_ptr, info_ptr); + height = png_get_image_height(png_ptr, info_ptr); + +- if(info_ptr->channels==3) ++ if (png_get_channels(png_ptr, info_ptr) == 3) + { + png_set_strip_16(png_ptr); + png_set_packing(png_ptr); +@@ -408,14 +408,14 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + pBMI = (BITMAPINFO*)new BYTE[sizeof(BITMAPINFO)+256*4]; + memset(pBMI, 0, sizeof(BITMAPINFO)+256*4); + pBMI->bmiHeader.biSize = sizeof(BITMAPINFO); +- pBMI->bmiHeader.biBitCount = 8*info_ptr->channels; ++ pBMI->bmiHeader.biBitCount = 8 * png_get_channels(png_ptr, info_ptr); + pBMI->bmiHeader.biWidth = width; + pBMI->bmiHeader.biHeight = height; + pBMI->bmiHeader.biPlanes = 1; + pBMI->bmiHeader.biCompression = BI_RGB; + pBMI->bmiHeader.biSizeImage = rowbytes*height; + +- if( info_ptr->channels == 1 ) ++ if (png_get_channels(png_ptr, info_ptr) == 1) + { + RGBQUAD* palette = pBMI->bmiColors; + +@@ -431,7 +431,7 @@ BOOL CImage::LoadBitmapFromPNGFile(LPTSTR szFileName) + + for(y=height-1; y>=0; y--) + { +- png_read_rows(png_ptr, &row, png_bytepp_NULL, 1); ++ png_read_rows(png_ptr, &row, NULL, 1); + + { + CAutoLock lock(&m_csLock); +diff --git a/reporting/crashsender/ScreenCap.cpp b/reporting/crashsender/ScreenCap.cpp +index c183c19..8f5643d 100644 +--- a/reporting/crashsender/ScreenCap.cpp ++++ b/reporting/crashsender/ScreenCap.cpp +@@ -11,6 +11,7 @@ be found in the Authors.txt file in the root of the source tree. + #include "stdafx.h" + #include "ScreenCap.h" + #include "Utility.h" ++#include "zlib.h" + + // Disable warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable + #pragma warning(disable:4611) +diff --git a/reporting/crashsender/stdafx.h b/reporting/crashsender/stdafx.h +index f087ff4..4494d3a 100644 +--- a/reporting/crashsender/stdafx.h ++++ b/reporting/crashsender/stdafx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + typedef __int64 off_t, _off_t; + #define _OFF_T_DEFINED +@@ -61,19 +61,19 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + #define _WTL_USE_CSTRING +-#include ++#include + + #include + #include +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index f7bfede..9358bef 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -32,7 +32,7 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG") + # Add include dir + include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/reporting/CrashRpt +- ${CMAKE_SOURCE_DIR}/thirdparty/wtl ) ++ ${WTL_INCLUDE_DIR} ) + + # Add executable build target + add_executable(Tests ${source_files} ${header_files}) +@@ -42,3 +42,10 @@ target_link_libraries(Tests CrashRpt CrashRptProbe) + + set_target_properties(Tests PROPERTIES DEBUG_POSTFIX d ) + #set_target_properties(Tests PROPERTIES COMPILE_FLAGS "/Zi" LINK_FLAGS "/DEBUG") ++ ++install(TARGETS Tests ++ RUNTIME DESTINATION tools/crashrpt ++) ++ ++install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.ini" DESTINATION tools/crashrpt) ++install(FILES "${CMAKE_SOURCE_DIR}/demos/WTLDemo/dummy.log" DESTINATION tools/crashrpt) +diff --git a/tests/stdafx.h b/tests/stdafx.h +index f12675b..0ec2117 100644 +--- a/tests/stdafx.h ++++ b/tests/stdafx.h +@@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree. + #define WINVER 0x0501 + #define _WIN32_WINNT 0x0501 + #define _WIN32_IE 0x0600 +-#define _RICHEDIT_VER 0x0200 ++#define _RICHEDIT_VER 0x0300 + + #include + #include +@@ -58,15 +58,15 @@ namespace ATL + }; + #endif // _WTL_SUPPORT_SDK_ATL3 + +-#include ++#include + + extern CAppModule _Module; + + #include + +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + #include +@@ -75,7 +75,7 @@ extern CAppModule _Module; + #include + + #define _WTL_USE_CSTRING +-#include ++#include + + #if _MSC_VER<1400 + #define _TCSCPY_S(strDestination, numberOfElements, strSource) _tcscpy(strDestination, strSource) +diff --git a/thirdparty/libpng/CMakeLists.txt b/thirdparty/libpng/CMakeLists.txt +index b358c4e..e0f7a33 100644 +--- a/thirdparty/libpng/CMakeLists.txt ++++ b/thirdparty/libpng/CMakeLists.txt +@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4267) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) ++include_directories( ${ZLIB_INCLUDE_DIRS} ) + + fix_default_compiler_settings_() + +@@ -15,6 +15,6 @@ fix_default_compiler_settings_() + add_library(libpng STATIC ${source_files}) + + # Add linker input libraries +-target_link_libraries(libpng zlib) ++target_link_libraries(libpng ZLIB::ZLIB) + + set_target_properties(libpng PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file +diff --git a/thirdparty/libtheora/CMakeLists.txt b/thirdparty/libtheora/CMakeLists.txt +index 896fb47..f3cf5eb 100644 +--- a/thirdparty/libtheora/CMakeLists.txt ++++ b/thirdparty/libtheora/CMakeLists.txt +@@ -8,7 +8,7 @@ aux_source_directory( ./lib/x86_vc x86_source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4244 /wd4700 /wd4214 /wd4554 /wd4018 /wd4100 /wd4132 /wd4389 /wd4127 /wd4701 /wd4245 /wd4267 /wd4334) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/libogg/include ++include_directories( ${OGG_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR}/thirdparty/libtheora/include) + + fix_default_compiler_settings_() +diff --git a/thirdparty/minizip/CMakeLists.txt b/thirdparty/minizip/CMakeLists.txt +index 5f4d0af..2b015c9 100644 +--- a/thirdparty/minizip/CMakeLists.txt ++++ b/thirdparty/minizip/CMakeLists.txt +@@ -7,7 +7,7 @@ aux_source_directory( . source_files ) + add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE /wd4127 /wd4131 /wd4100 /wd4189 /wd4244) + + # Add include dir +-include_directories( ${CMAKE_SOURCE_DIR}/thirdparty/zlib ) ++include_directories( ${ZLIB_INCLUDE_DIRS} ) + + fix_default_compiler_settings_() + +@@ -15,6 +15,6 @@ fix_default_compiler_settings_() + add_library(minizip STATIC ${source_files}) + + # Add linker input libraries +-target_link_libraries(minizip zlib) ++target_link_libraries(minizip ZLIB::ZLIB) + + set_target_properties(minizip PROPERTIES DEBUG_POSTFIX d ) +\ No newline at end of file diff --git a/ports/crashrpt/CONTROL b/ports/crashrpt/CONTROL new file mode 100644 index 00000000000000..4b15e9d2336243 --- /dev/null +++ b/ports/crashrpt/CONTROL @@ -0,0 +1,16 @@ +Source: crashrpt +Version: 1.4.3 +Description: A crash reporting system for Windows applications +Homepage: http://crashrpt.sourceforge.net/ +Build-Depends: dbghelp, libjpeg-turbo, libogg, libpng, libtheora, tinyxml, wtl, zlib +Default-Features: + +Feature: probe +Description: The CrashRptProbe library + +Feature: tests +Description: Test application for crashrpt +Build-Depends: crashrpt[core,probe] + +Feature: demos +Description: Demo applications for CrashRptProbe diff --git a/ports/crashrpt/portfile.cmake b/ports/crashrpt/portfile.cmake new file mode 100644 index 00000000000000..f52f8e19a24b8f --- /dev/null +++ b/ports/crashrpt/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux" "UWP") + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(ARCH_DIR "") +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(ARCH_DIR "x64/") +else() + vcpkg_fail_port_install(MESSAGE "${PORT} only supports x86 and x64 architectures" ALWAYS) +endif() + +vcpkg_from_git( + OUT_SOURCE_PATH SOURCE_PATH + URL https://git.code.sf.net/p/crashrpt/code + REF 4616504670be5a425a525376648d912a72ce18f2 + PATCHES + 001-add-install-target-and-find-deps.patch +) + +# Remove vendored dependencies to ensure they are not picked up by the build +# Vendored minizip is still used since it contains modifications needed for CrashRpt +foreach(DEPENDENCY dbghelp jpeg libogg libpng libtheora tinyxml wtl zlib) + if(EXISTS ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) + file(REMOVE_RECURSE ${SOURCE_PATH}/thirdparty/${DEPENDENCY}) + endif() +endforeach() + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CRASHRPT_BUILD_SHARED_LIBS) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" CRASHRPT_LINK_CRT_AS_DLL) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + probe CRASHRPT_BUILD_PROBE + tests CRASHRPT_BUILD_TESTS + demos CRASHRPT_BUILD_DEMOS +) + +# PREFER_NINJA is not used below since CrashSender fails to build with errors like this one: +# C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\ATLMFC\include\atlconv.h(788): error C2440: 'return': cannot convert from 'LPCTSTR' to 'LPCOLESTR' +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # PREFER_NINJA + OPTIONS + -DCRASHRPT_BUILD_SHARED_LIBS=${CRASHRPT_BUILD_SHARED_LIBS} + -DCRASHRPT_LINK_CRT_AS_DLL=${CRASHRPT_LINK_CRT_AS_DLL} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cudnn/CONTROL b/ports/cudnn/CONTROL index 4ab7c941b9d053..24714f97fd2a87 100644 --- a/ports/cudnn/CONTROL +++ b/ports/cudnn/CONTROL @@ -1,5 +1,6 @@ Source: cudnn Version: 7.6 +Port-Version: 2 Description: NVIDIA's cuDNN deep neural network acceleration library Build-Depends: cuda Supports: (windows|linux)&x64 diff --git a/ports/cudnn/FindCUDNN.cmake b/ports/cudnn/FindCUDNN.cmake index 1b6916577ffd25..5dc2e339266a74 100644 --- a/ports/cudnn/FindCUDNN.cmake +++ b/ports/cudnn/FindCUDNN.cmake @@ -38,6 +38,11 @@ endif() if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn.h") file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS) + if(EXISTS "${CUDNN_INCLUDE_DIR}/cudnn_version.h") + file(READ "${CUDNN_INCLUDE_DIR}/cudnn_version.h" CUDNN_VERSION_H_CONTENTS) + string(APPEND CUDNN_HEADER_CONTENTS "${CUDNN_VERSION_H_CONTENTS}") + unset(CUDNN_VERSION_H_CONTENTS) + endif() string(REGEX MATCH "define CUDNN_MAJOR * +([0-9]+)" CUDNN_VERSION_MAJOR "${CUDNN_HEADER_CONTENTS}") string(REGEX REPLACE "define CUDNN_MAJOR * +([0-9]+)" "\\1" diff --git a/ports/cudnn/vcpkg-cmake-wrapper.cmake b/ports/cudnn/vcpkg-cmake-wrapper.cmake index bbda1d04d68e9a..5a69edec56201c 100644 --- a/ports/cudnn/vcpkg-cmake-wrapper.cmake +++ b/ports/cudnn/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(CUDNN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT CUDNN_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${CUDNN_PREV_MODULE_PATH}) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index ae36158755b964..16c00db4f76d9c 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,15 +1,15 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 62b7b33..9b0e2e1 100644 +index 62b7b33..8a4bd71 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -107,7 +107,9 @@ endif() +@@ -107,6 +107,10 @@ endif() target_link_libraries(${LIB_NAME} ${CURL_LIBS}) --if(WIN32) +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) -+elseif(WIN32) ++endif() ++ + if(WIN32) add_definitions(-D_USRDLL) endif() - diff --git a/ports/curl/0008_fix_tools_path.patch b/ports/curl/0008_fix_tools_path.patch deleted file mode 100644 index 7c411bf8004f8e..00000000000000 --- a/ports/curl/0008_fix_tools_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 5838805..d2ca468 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -103,7 +103,7 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) - - #INCLUDE(ModuleInstall OPTIONAL) - --install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(TARGETS ${EXE_NAME} DESTINATION tools) - #export(TARGETS ${EXE_NAME} - # APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake - # NAMESPACE ${PROJECT_NAME}:: diff --git a/ports/curl/0011_fix_static_build.patch b/ports/curl/0011_fix_static_build.patch new file mode 100644 index 00000000000000..a50fa287f54cfe --- /dev/null +++ b/ports/curl/0011_fix_static_build.patch @@ -0,0 +1,13 @@ +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 8a4bd71..1927fb0 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -111,7 +111,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) + endif() + +-if(WIN32) ++if(WIN32 AND BUILD_SHARED_LIBS) + add_definitions(-D_USRDLL) + endif() + diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 079b75d83f2d37..6f50966de0290e 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,5 +1,6 @@ Source: curl Version: 7.71.1 +Port-Version: 2 Build-Depends: zlib Homepage: https://github.com/curl/curl Description: A library for transferring data with URLs diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index d34441170d0c53..0ad9cd7a2dcae2 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -10,9 +10,9 @@ vcpkg_from_github( 0005_remove_imp_suffix.patch 0006_fix_tool_depends.patch 0007_disable_tool_export_curl_target.patch - 0008_fix_tools_path.patch 0009_fix_openssl_config.patch 0010_fix_othertests_cmake.patch + 0011_fix_static_build.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) @@ -78,7 +78,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() if ("tool" IN_LIST FEATURES) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/curl) + vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN) endif() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CURL) diff --git a/ports/darknet/CONTROL b/ports/darknet/CONTROL index 3f22eeb31e3c3a..ea0b5ce26b5c88 100644 --- a/ports/darknet/CONTROL +++ b/ports/darknet/CONTROL @@ -1,5 +1,5 @@ Source: darknet -Version: 2020-03-02 +Version: 2020-06-29 Description: Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities. Build-Depends: pthreads (windows), stb diff --git a/ports/darknet/fix_shared_static.patch b/ports/darknet/fix_shared_static.patch new file mode 100644 index 00000000000000..5b9670f4174f5d --- /dev/null +++ b/ports/darknet/fix_shared_static.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.12) ++cmake_minimum_required(VERSION 3.17) + + set(Darknet_MAJOR_VERSION 0) + set(Darknet_MINOR_VERSION 2) +@@ -77,6 +77,11 @@ if(CMAKE_CUDA_COMPILER AND ENABLE_CUDA) + else() + message(STATUS "Your setup supports half precision (it requires CC >= 7.0)") + endif() ++ endif() ++ if(BUILD_SHARED_LIBS) ++ set(CMAKE_CUDA_RUNTIME_LIBRARY "Shared") ++ else() ++ set(CMAKE_CUDA_RUNTIME_LIBRARY "Static") + endif() + else() + set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA support" FORCE) diff --git a/ports/darknet/portfile.cmake b/ports/darknet/portfile.cmake index 9d15802b00f7f1..ed8a41a720d436 100644 --- a/ports/darknet/portfile.cmake +++ b/ports/darknet/portfile.cmake @@ -1,9 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO AlexeyAB/darknet - REF 81290b07376c5abb4988a492dda70913bb90133d - SHA512 094197cde851dfdd1e102a3ffaed34d67a789dd75dc288bde611144dc9aa484ca0b9e3468abc297d075d3753553f7f09a214be279af9e58ccb642aa757909f79 + REF 320e6fd8d29f6f7825ef668f15f955f90131f782 + SHA512 f95ac04c1c4e1b3f28aa835a64d969ffee064a3681a7966b255981722d562aa1eb91c30a378cad2f1bccd4581b74d8c2ec641c57763bc0fa97bfce8b1c222480 HEAD_REF master + PATCHES + fix_shared_static.patch ) # enable CUDA inside DARKNET @@ -51,11 +53,31 @@ if ("cuda" IN_LIST FEATURES) endif() if("weights" IN_LIST FEATURES) + vcpkg_download_distfile(YOLOV4-TINY_WEIGHTS + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights" + FILENAME "darknet-cache/yolov4-tiny.weights" + SHA512 804ca2ab8e3699d31c95bf773d22f901f186703487c7945f30dc2dbb808094793362cb6f5da5cd0b4b83f820c8565a3cba22fafa069ee6ca2a925677137d95f4 + ) + vcpkg_download_distfile(YOLOV4_WEIGHTS + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights" + FILENAME "darknet-cache/yolov4.weights" + SHA512 77f779c58df67975b187cfead99c1e62d72c57e76c3715e35b97a1c7aba1c7b092be97ffb17907099543ac3957085a0fe9688df4a653ea62dfe8322afca53e40 + ) + vcpkg_download_distfile(YOLOV3-TINY-PRN_WEIGHTS + URLS "https://drive.google.com/u/0/uc?id=18yYZWyKbo4XSDVyztmsEcF9B_6bxrhUY&export=download" + FILENAME "darknet-cache/yolov3-tiny-prn.weights" + SHA512 0be26786103866868751bb8c5cc0b5147b3e8528d0cf5b387f5aefc72807fd7f1bf8049d5b0a47e9b4445d34e773ea8e3abc95330edb2a3ecd6103e158df2677 + ) vcpkg_download_distfile(YOLOV3_WEIGHTS URLS "https://pjreddie.com/media/files/yolov3.weights" FILENAME "darknet-cache/yolov3.weights" SHA512 293c70e404ff0250d7c04ca1e5e053fc21a78547e69b5b329d34f25981613e59b982d93fff2c352915ef7531d6c3b02a9b0b38346d05c51d6636878d8883f2c1 ) + vcpkg_download_distfile(YOLOV3-OPENIMAGES_WEIGHTS + URLS "https://pjreddie.com/media/files/yolov3-openimages.weights" + FILENAME "darknet-cache/yolov3-openimages.weights" + SHA512 616e90057946c9588d045cff6ec36b63254660af4377201dc02642e798d62f392e8f3cdb5b10a1c4bcbe5c056e690275dca35b68db7fd802783a0c6bbd959ba8 + ) vcpkg_download_distfile(YOLOV2_WEIGHTS URLS "https://pjreddie.com/media/files/yolov2.weights" FILENAME "darknet-cache/yolov2.weights" @@ -74,12 +96,22 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) - vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V3 + vcpkg_download_distfile(YOLOV4-TINY-CONV-29 + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.conv.29" + FILENAME "darknet-cache/yolov4-tiny.conv.29" + SHA512 318e47f4bdf43b7f4eff8f3669bc9ba66cd7bd8ffb31df5bc1978682c85fec8e63a8349958022fd933cc676cbf5241953f2181bf4d1789f7cf9d371e012e3e49 + ) + vcpkg_download_distfile(YOLOV4-CONV-137 + URLS "https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.conv.137" + FILENAME "darknet-cache/yolov4.conv.137" + SHA512 d146a61762bf6ef91deb6c627ede475f63b3975fbeeb1ff5e0949470b29be8fc28ee81280041937e7ded49679276fbabacdb92d02fa246cc622853633fd3d992 + ) + vcpkg_download_distfile(DARKNET53-CONV-74 URLS "https://pjreddie.com/media/files/darknet53.conv.74" FILENAME "darknet-cache/darknet53.conv.74" SHA512 8983e1c129e2d6e8e3da0cc0781ecb7a07813830ef5a87c24b53100df6a5f23db6c6e6a402aec78025a93fe060b75d1958f1b8f7439a04b54a3f19c81e2ae99b ) - vcpkg_download_distfile(IMAGENET_CONV_WEIGHTS_V2 + vcpkg_download_distfile(DARKNET19-448-CONV-23 URLS "https://pjreddie.com/media/files/darknet19_448.conv.23" FILENAME "darknet-cache/darknet19_448.conv.23" SHA512 8016f5b7ddc15c5d7dad231592f5351eea65f608ebdb204f545034dde904e11962f693080dfeb5a4510e7b71bdda151a9121ba0f8a243018d680f01b1efdbd31 @@ -133,6 +165,10 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if("weights" IN_LIST FEATURES) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny-prn.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-openimages.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov2.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov3-tiny.weights DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -140,6 +176,8 @@ if("weights" IN_LIST FEATURES) endif() if("weights-train" IN_LIST FEATURES) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4-tiny.conv.29 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/yolov4.conv.137 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet53.conv.74 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(COPY ${VCPKG_ROOT_DIR}/downloads/darknet-cache/darknet19_448.conv.23 DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() diff --git a/ports/date/0003-find-dependency-pthread.patch b/ports/date/0003-find-dependency-pthread.patch new file mode 100644 index 00000000000000..72c6c765a15b54 --- /dev/null +++ b/ports/date/0003-find-dependency-pthread.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/dateConfig.cmake b/cmake/dateConfig.cmake +index 20f86e8..2198ad1 100644 +--- a/cmake/dateConfig.cmake ++++ b/cmake/dateConfig.cmake +@@ -1,8 +1,8 @@ + include( CMakeFindDependencyMacro ) + include( "${CMAKE_CURRENT_LIST_DIR}/dateTargets.cmake" ) +-if( NOT MSVC AND TARGET date::tz ) ++if( NOT MSVC AND TARGET date::date-tz ) + find_dependency( Threads REQUIRED) +- get_target_property( _tzill date::tz INTERFACE_LINK_LIBRARIES ) ++ get_target_property( _tzill date::date-tz INTERFACE_LINK_LIBRARIES ) + if( _tzill AND "${_tzill}" MATCHES "libcurl" ) + find_dependency( CURL ) + endif( ) diff --git a/ports/date/CONTROL b/ports/date/CONTROL index c912bd283e9856..b44b024cdb7d8c 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,5 +1,6 @@ Source: date Version: 3.0.0 +Port-Version: 1 Homepage: https://github.com/HowardHinnant/date Description: A date and time library based on the C++17 header diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index 3fd9121c4b346c..4dd5a40eb470db 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( PATCHES 0001-fix-uwp.patch 0002-fix-cmake-3.14.patch + 0003-find-dependency-pthread.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS INVERTED_FEATURES @@ -39,9 +40,5 @@ endif() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) -# Remove the wrapper when backwards compatibility when the unofficial::date::date and unofficial::date::tz -# targets are no longer required. -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright) diff --git a/ports/date/usage b/ports/date/usage deleted file mode 100644 index 82f42f7f2d1469..00000000000000 --- a/ports/date/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package date provides CMake targets: - - find_package(date CONFIG REQUIRED) - target_link_libraries(main PRIVATE date::date date::tz) diff --git a/ports/date/vcpkg-cmake-wrapper.cmake b/ports/date/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 317c49b8c049e3..00000000000000 --- a/ports/date/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,11 +0,0 @@ -_find_package(${ARGS}) - -if(NOT TARGET unofficial::date::date AND TARGET date::date) - add_library(unofficial::date::date INTERFACE IMPORTED) - target_link_libraries(unofficial::date::date INTERFACE date::date) -endif() - -if(NOT TARGET unofficial::date::tz AND TARGET date::tz) - add_library(unofficial::date::tz INTERFACE IMPORTED) - target_link_libraries(unofficial::date::tz INTERFACE date::tz) -endif() diff --git a/ports/dbghelp/CONTROL b/ports/dbghelp/CONTROL new file mode 100644 index 00000000000000..e92599d577c28e --- /dev/null +++ b/ports/dbghelp/CONTROL @@ -0,0 +1,4 @@ +Source: dbghelp +Version: 0.0 +Description: Windows Debug Help Library +Supports: windows \ No newline at end of file diff --git a/ports/dbghelp/portfile.cmake b/ports/dbghelp/portfile.cmake new file mode 100644 index 00000000000000..832bec6d74c498 --- /dev/null +++ b/ports/dbghelp/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_fail_port_install(ON_TARGET "OSX" "Linux") +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_get_windows_sdk(WINDOWS_SDK) + +if (WINDOWS_SDK VERSION_GREATER "10") + set(LIBFILEPATH "$ENV{WindowsSdkDir}Debuggers\\lib\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.lib") + message("LIBFILEPATH: ${LIBFILEPATH}") + set(DLLFILEPATH "$ENV{WindowsSdkDir}Debuggers\\${TRIPLET_SYSTEM_ARCH}\\dbghelp.dll") + message("DLLFILEPATH: ${DLLFILEPATH}") + set(HEADERPATH "$ENV{WindowsSdkDir}Debuggers\\inc\\dbghelp.h") + message("HEADERPATH: ${HEADERPATH}") +else() + message(FATAL_ERROR "Portfile not yet configured for Windows SDK with version: ${WINDOWS_SDK}") +endif() + +if (NOT EXISTS "${LIBFILEPATH}" OR NOT EXISTS "${DLLFILEPATH}" OR NOT EXISTS "${HEADERPATH}") + message(FATAL_ERROR "Cannot find debugging tools in Windows SDK ${WINDOWS_SDK}. Please reinstall the Windows SDK and select \"Debugging Tools\".") +endif() + +file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(INSTALL ${LIBFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(INSTALL ${DLLFILEPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +file(INSTALL ${HEADERPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "See https://developer.microsoft.com/windows/downloads/windows-10-sdk for the Windows 10 SDK license") diff --git a/ports/directxsdk/portfile.cmake b/ports/directxsdk/portfile.cmake new file mode 100644 index 00000000000000..86fa8a14914d14 --- /dev/null +++ b/ports/directxsdk/portfile.cmake @@ -0,0 +1,60 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm") + +vcpkg_download_distfile(ARCHIVE + URLS "https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe" + FILENAME "DXSDK_Jun10.exe" + SHA512 4869ac947a35cd0d6949fbda17547256ea806fef36f48474dda63651f751583e9902641087250b6e8ccabaab85e51effccd9235dc6cdf64e21ec2b298227fe19 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + + +set(LIB_DIR "${SOURCE_PATH}/Lib/${VCPKG_TARGET_ARCHITECTURE}") +set(DEBUG_LIBS + ${LIB_DIR}/D3DCSXd.lib + ${LIB_DIR}/d3dx10d.lib + ${LIB_DIR}/d3dx11d.lib + ${LIB_DIR}/d3dx9d.lib + ${LIB_DIR}/xapobased.lib +) +set(RELEASE_LIBS + ${LIB_DIR}/D3DCSX.lib + ${LIB_DIR}/d3dx10.lib + ${LIB_DIR}/d3dx11.lib + ${LIB_DIR}/d3dx9.lib + ${LIB_DIR}/xapobase.lib +) +# Libs without a debug part +set(OTHER_LIBS + ${LIB_DIR}/d2d1.lib + ${LIB_DIR}/d3d10.lib + ${LIB_DIR}/d3d10_1.lib + ${LIB_DIR}/d3d11.lib + ${LIB_DIR}/d3d9.lib + ${LIB_DIR}//d3dcompiler.lib + ${LIB_DIR}/d3dxof.lib + ${LIB_DIR}/dinput8.lib + ${LIB_DIR}/dsound.lib + ${LIB_DIR}/dwrite.lib + ${LIB_DIR}/DxErr.lib + ${LIB_DIR}/dxgi.lib + ${LIB_DIR}/dxguid.lib + ${LIB_DIR}/X3DAudio.lib + ${LIB_DIR}/XAPOFX.lib + ${LIB_DIR}/XInput.lib +) +if(${VCPKG_TARGET_ARCHITECTURE} STREQUAL "x86") + list(APPEND OTHER_LIBS ${LIB_DIR}/dsetup.lib) +endif() + +#install(DIRECTORY "${SOURCE_PATH}/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY "${SOURCE_PATH}/Include/" DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) +file(COPY ${RELEASE_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${DEBUG_LIBS} ${OTHER_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + +# # Handle copyright +file(INSTALL "${SOURCE_PATH}/Documentation/License Agreements/DirectX SDK EULA.txt" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/directxsdk/vcpkg.json b/ports/directxsdk/vcpkg.json new file mode 100644 index 00000000000000..fa1f7a348d81bd --- /dev/null +++ b/ports/directxsdk/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "directxsdk", + "version-string": "jun10", + "description": "DirectX SDK", + "homepage": "https://www.microsoft.com/en-us/download/details.aspx?id=6812", + "supports": "windows & !arm & !uwp" +} diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 9828f97265b278..61df74294412f1 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,6 +1,7 @@ Source: dlib -Version: 19.19-1 -Build-Depends: libjpeg-turbo, libpng, openblas (!osx), clapack (!osx) +Version: 19.19 +Port-Version: 2 +Build-Depends: libjpeg-turbo, libpng, openblas (!osx), lapack Homepage: https://github.com/davisking/dlib Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ Default-Features: fftw3, sqlite3 diff --git a/ports/embree3/CONTROL b/ports/embree3/CONTROL old mode 100644 new mode 100755 index d7013ff75b12a3..824e892e6c1ef6 --- a/ports/embree3/CONTROL +++ b/ports/embree3/CONTROL @@ -1,5 +1,5 @@ Source: embree3 -Version: 3.8.0 +Version: 3.11.0 Homepage: https://github.com/embree/embree Description: High Performance Ray Tracing Kernels. Build-Depends: tbb diff --git a/ports/embree3/fix-InstallPath.patch b/ports/embree3/fix-InstallPath.patch deleted file mode 100644 index 316fa594d0a5db..00000000000000 --- a/ports/embree3/fix-InstallPath.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake -index 3c3980d..0c365ac 100644 ---- a/common/cmake/package.cmake -+++ b/common/cmake/package.cmake -@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm - # create a config file for the build directory - CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) - --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} RENAME "embree-config.cmake" COMPONENT devel) --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) - - ############################################################## - # CPack specific stuff diff --git a/ports/embree3/fix-cmake-path.patch b/ports/embree3/fix-cmake-path.patch deleted file mode 100644 index e1e65eda37d3d8..00000000000000 --- a/ports/embree3/fix-cmake-path.patch +++ /dev/null @@ -1,163 +0,0 @@ -diff --git a/common/lexers/CMakeLists.txt b/common/lexers/CMakeLists.txt -index 10c8caf..95d96dc 100644 ---- a/common/lexers/CMakeLists.txt -+++ b/common/lexers/CMakeLists.txt -@@ -23,7 +23,7 @@ SET_PROPERTY(TARGET lexers PROPERTY FOLDER common) - SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT lexers-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS lexers EXPORT lexers-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT lexers-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(lexers) - ENDIF() -diff --git a/common/math/CMakeLists.txt b/common/math/CMakeLists.txt -index e7ed3b1..13247ca 100644 ---- a/common/math/CMakeLists.txt -+++ b/common/math/CMakeLists.txt -@@ -19,8 +19,8 @@ SET_PROPERTY(TARGET math PROPERTY FOLDER common) - SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT math-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS math EXPORT math-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT math-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(math) - ENDIF() - -diff --git a/common/simd/CMakeLists.txt b/common/simd/CMakeLists.txt -index 5b1658c..81d7c80 100644 ---- a/common/simd/CMakeLists.txt -+++ b/common/simd/CMakeLists.txt -@@ -19,7 +19,7 @@ SET_PROPERTY(TARGET simd PROPERTY FOLDER common) - SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT simd-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS simd EXPORT simd-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT simd-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(simd) - ENDIF() -diff --git a/common/sys/CMakeLists.txt b/common/sys/CMakeLists.txt -index e0e0848..b57e6be 100644 ---- a/common/sys/CMakeLists.txt -+++ b/common/sys/CMakeLists.txt -@@ -35,7 +35,7 @@ SET_PROPERTY(TARGET sys PROPERTY FOLDER common) - SET_PROPERTY(TARGET sys APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS sys EXPORT sys-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT sys-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS sys EXPORT sys-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT sys-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(sys) - ENDIF() -diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt -index f5db33f..b96671a 100644 ---- a/common/tasking/CMakeLists.txt -+++ b/common/tasking/CMakeLists.txt -@@ -28,7 +28,7 @@ SET_PROPERTY(TARGET tasking PROPERTY FOLDER common) - SET_PROPERTY(TARGET tasking APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") - - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS tasking EXPORT tasking-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT tasking-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS tasking EXPORT tasking-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT tasking-targets DESTINATION share/embree3 COMPONENT devel) - SIGN_TARGET(tasking) - ENDIF() -diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt -index a5774d2..b637321 100644 ---- a/kernels/CMakeLists.txt -+++ b/kernels/CMakeLists.txt -@@ -255,8 +255,8 @@ IF (EMBREE_ISA_SSE42 AND EMBREE_LIBRARY_FILES_SSE42) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_sse42) - CheckGlobals(embree_sse42) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_sse42-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_sse42 EXPORT embree_sse42-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_sse42-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF () - -@@ -268,8 +268,8 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx) - CheckGlobals(embree_avx) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx EXPORT embree_avx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx EXPORT embree_avx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -281,8 +281,8 @@ IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx2) - CheckGlobals(embree_avx2) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx2-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx2 EXPORT embree_avx2-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx2-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -294,8 +294,8 @@ IF (EMBREE_ISA_AVX512KNL AND EMBREE_LIBRARY_FILES_AVX512KNL) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512knl) - CheckGlobals(embree_avx512knl) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx512knl-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx512knl EXPORT embree_avx512knl-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx512knl-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -307,8 +307,8 @@ IF (EMBREE_ISA_AVX512SKX AND EMBREE_LIBRARY_FILES_AVX512SKX) - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} embree_avx512skx) - CheckGlobals(embree_avx512skx) - IF (EMBREE_STATIC_LIB) -- INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -- INSTALL(EXPORT embree_avx512skx-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(TARGETS embree_avx512skx EXPORT embree_avx512skx-targets DESTINATION share/embree3 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel) -+ INSTALL(EXPORT embree_avx512skx-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - ENDIF() - -@@ -331,7 +331,7 @@ ELSE() - SET_TARGET_PROPERTIES(embree PROPERTIES VERSION ${EMBREE_VERSION} SOVERSION ${EMBREE_VERSION_MAJOR}) - ENDIF() - --INSTALL(TARGETS embree EXPORT embree-targets -+INSTALL(TARGETS embree EXPORT embree-targets DESTINATION share/embree3 - LIBRARY NAMELINK_SKIP DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib - # on Windows put the dlls into bin - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples -@@ -340,7 +340,7 @@ INSTALL(TARGETS embree EXPORT embree-targets - ) - - IF (EMBREE_STATIC_LIB) -- INSTALL(EXPORT embree-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel) -+ INSTALL(EXPORT embree-targets DESTINATION share/embree3 COMPONENT devel) - ENDIF() - - IF (NOT EMBREE_STATIC_LIB) -diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake -index 0c365ac..7b140a5 100644 ---- a/common/cmake/package.cmake -+++ b/common/cmake/package.cmake -@@ -124,8 +124,8 @@ CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cm - # create a config file for the build directory - CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY) - --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 RENAME "embree-config.cmake" COMPONENT devel) --INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR}/share/embree3 COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION share/embree3 RENAME "embree-config.cmake" COMPONENT devel) -+INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION share/embree3 COMPONENT devel) - - ############################################################## - # CPack specific stuff diff --git a/ports/embree3/fix-embree-path.patch b/ports/embree3/fix-embree-path.patch deleted file mode 100644 index 31611275549eff..00000000000000 --- a/ports/embree3/fix-embree-path.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake -index cab4d41..da84d3d 100644 ---- a/common/cmake/embree-config.cmake -+++ b/common/cmake/embree-config.cmake -@@ -14,11 +14,19 @@ - ## limitations under the License. ## - ## ======================================================================== ## - --SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) -+SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../@EMBREE_RELATIV_ROOT_DIR@) - GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) - - SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) --SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ -+IF (CMAKE_BUILD_TYPE STREQUAL Debug) -+ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/debug/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ENDIF () -+ -+IF (CMAKE_BUILD_TYPE STREQUAL Release) -+ SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) -+ENDIF () -+ - SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) - - MARK_AS_ADVANCED(embree_DIR) diff --git a/ports/embree3/fix-path.patch b/ports/embree3/fix-path.patch new file mode 100755 index 00000000000000..ff25a43aad5a89 --- /dev/null +++ b/ports/embree3/fix-path.patch @@ -0,0 +1,117 @@ +diff --git a/common/algorithms/CMakeLists.txt b/common/algorithms/CMakeLists.txt +index 5667d2bd3..cb26776a4 100644 +--- a/common/algorithms/CMakeLists.txt ++++ b/common/algorithms/CMakeLists.txt +@@ -17,11 +17,4 @@ ADD_LIBRARY(algorithms OBJECT + SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common) + SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") + +-# ideally we would use target_link_libraries to provide the algorithms target +-# with the TBB include directory information. Howeve, this is only possible in +-# very recent versions of TBB and therefore we use the target property instead +-GET_TARGET_PROPERTY(tasking_include_dirs tasking INCLUDE_DIRECTORIES) +-if (tasking_include_dirs) +- TARGET_INCLUDE_DIRECTORIES(algorithms PUBLIC "${tasking_include_dirs}") +- GET_TARGET_PROPERTY(algorithms_include_dirs algorithms INCLUDE_DIRECTORIES) +-endif() ++TARGET_LINK_LIBRARIES(algorithms PUBLIC tasking) +diff --git a/common/cmake/embree-config.cmake b/common/cmake/embree-config.cmake +index 9b7370ccd..14ce929d6 100644 +--- a/common/cmake/embree-config.cmake ++++ b/common/cmake/embree-config.cmake +@@ -5,8 +5,6 @@ SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@) + GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE) + + SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) +-SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@) +-SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) + + SET(EMBREE_VERSION @EMBREE_VERSION@) + SET(EMBREE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@) +@@ -22,7 +20,6 @@ SET(EMBREE_ISA_AVX2 @EMBREE_ISA_AVX2@) + SET(EMBREE_ISA_AVX512KNL @EMBREE_ISA_AVX512KNL@) + SET(EMBREE_ISA_AVX512SKX @EMBREE_ISA_AVX512SKX@) + +-SET(EMBREE_BUILD_TYPE @CMAKE_BUILD_TYPE@) + SET(EMBREE_ISPC_SUPPORT @EMBREE_ISPC_SUPPORT@) + SET(EMBREE_STATIC_LIB @EMBREE_STATIC_LIB@) + SET(EMBREE_TUTORIALS @EMBREE_TUTORIALS@) +@@ -53,10 +50,6 @@ IF (EMBREE_STATIC_LIB) + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/simd-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/lexers-targets.cmake") + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake") +- +- add_library(TBB::tbb SHARED IMPORTED) +- set_target_properties(TBB::tbb PROPERTIES IMPORTED_LOCATION "${EMBREE_ROOT_DIR}/@EMBREE_INSTALLED_TBB@") +- + ENDIF() + + INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake") +diff --git a/common/cmake/package.cmake b/common/cmake/package.cmake +index a4da0001a..b6f82e981 100644 +--- a/common/cmake/package.cmake ++++ b/common/cmake/package.cmake +@@ -20,16 +20,6 @@ ELSE() + ENDIF() + ENDIF() + +-############################################################## +-# Install MSVC runtime +-############################################################## +- +-IF (WIN32) +- SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) +- INCLUDE(InstallRequiredSystemLibraries) +- LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll") +- INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT lib) +-ENDIF() + + ############################################################## + # Install Headers +@@ -106,18 +96,9 @@ ELSE() + ENDIF() + ENDIF() + +-IF (WIN32 OR EMBREE_ZIP_MODE) +- # for local "installs" and on Windows we want the cmake config files placed +- # in the install root, such that users can point the CMake variable +- # embree_DIR just to the install folder +- SET(EMBREE_CMAKECONFIG_DIR ".") +- SET(EMBREE_CMAKEEXPORT_DIR "cmake") +- SET(EMBREE_RELATIV_ROOT_DIR ".") +-ELSE() +- SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") +- SET(EMBREE_CMAKEEXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}") +- FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/") +-ENDIF() ++SET(EMBREE_CMAKECONFIG_DIR "share/embree") ++SET(EMBREE_CMAKEEXPORT_DIR "share/embree3") ++SET(EMBREE_RELATIV_ROOT_DIR "../..") + + CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY) + CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY) +diff --git a/common/tasking/CMakeLists.txt b/common/tasking/CMakeLists.txt +index 71ef29612..c846004e3 100644 +--- a/common/tasking/CMakeLists.txt ++++ b/common/tasking/CMakeLists.txt +@@ -10,7 +10,7 @@ ELSEIF (TASKING_TBB) + if (NOT ${EMBREE_TBB_ROOT} STREQUAL "") + set(TBB_ROOT ${EMBREE_TBB_ROOT}) + endif() +- FIND_PACKAGE(TBB REQUIRED tbb) ++ FIND_PACKAGE(TBB CONFIG REQUIRED tbb) + + ############################################################## + # Create tasking target and link against TBB. Also set include directory +@@ -18,10 +18,7 @@ ELSEIF (TASKING_TBB) + # with the TBB header files + ############################################################## + ADD_LIBRARY(tasking STATIC taskschedulertbb.cpp) +- TARGET_LINK_LIBRARIES(tasking PUBLIC TBB) +- TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}") +- +- include(installTBB) ++ TARGET_LINK_LIBRARIES(tasking PUBLIC TBB::tbb) + + ELSEIF (TASKING_PPL) + ADD_LIBRARY(tasking STATIC taskschedulerppl.cpp) diff --git a/ports/embree3/portfile.cmake b/ports/embree3/portfile.cmake old mode 100644 new mode 100755 index af320ffc1480b9..6832847ddc35e8 --- a/ports/embree3/portfile.cmake +++ b/ports/embree3/portfile.cmake @@ -1,64 +1,40 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO embree/embree - REF 539d4eec716085484f957d7b0d697b1891dafec4 # v3.8.0 - SHA512 77ab07cc7283f1a0c50d7cec07d1cbe4a24a41482b8b043f79a045953fccfa41a854bbc29a76beb67385d1bbb6d43097287ccfd3e1d2c84c1a5d55a2696d0815 + REF v3.11.0 + SHA512 a20acb07103d322eebc85d41152210466f8d9b97e7a332589c692f649ee02079465f89561748ddc8448fb40bc63f2595d728cc31a927f7b95bea13446c5c775d HEAD_REF master PATCHES - fix-InstallPath.patch - fix-cmake-path.patch - fix-embree-path.patch + fix-path.patch ) -file(REMOVE ${SOURCE_PATH}/common/cmake/FindTBB.cmake) - -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(EMBREE_STATIC_RUNTIME ON) -else() - set(EMBREE_STATIC_RUNTIME OFF) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(EMBREE_STATIC_LIB ON) -else() - set(EMBREE_STATIC_LIB OFF) -endif() +string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} static EMBREE_STATIC_LIB) +string(COMPARE EQUAL ${VCPKG_CRT_LINKAGE} static EMBREE_STATIC_RUNTIME) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE - PREFER_NINJA # Disable this option if project cannot be built with Ninja + PREFER_NINJA OPTIONS -DEMBREE_ISPC_SUPPORT=OFF -DEMBREE_TUTORIALS=OFF -DEMBREE_STATIC_RUNTIME=${EMBREE_STATIC_RUNTIME} -DEMBREE_STATIC_LIB=${EMBREE_STATIC_LIB} - "-DTBB_LIBRARIES=TBB::tbb" - "-DTBB_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include" ) -# just wait, the release build of embree is insanely slow in MSVC -# a single file will took about 2-10 min vcpkg_install_cmake() vcpkg_copy_pdbs() - -vcpkg_fixup_cmake_targets(CONFIG_PATH share/embree3 TARGET_PATH share/embree) +vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -if (EXISTS ${CURRENT_PACKAGES_DIR}/uninstall.command) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/uninstall.command) +if(APPLE) + file(REMOVE ${CURRENT_PACKAGES_DIR}/uninstall.command ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) endif() -if (EXISTS ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/uninstall.command) -endif() - -file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/embree/doc) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc ${CURRENT_PACKAGES_DIR}/share/${PORT}/doc) -# Handle copyright +file(COPY ${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/ports/embree3/usage b/ports/embree3/usage new file mode 100755 index 00000000000000..8622f121d74664 --- /dev/null +++ b/ports/embree3/usage @@ -0,0 +1,4 @@ +The package embree3 provides CMake targets: + + find_package(embree 3 CONFIG REQUIRED) + target_link_libraries(main PRIVATE embree) diff --git a/ports/ensmallen/CONTROL b/ports/ensmallen/CONTROL index 2a93222c607da1..bf13812e416277 100644 --- a/ports/ensmallen/CONTROL +++ b/ports/ensmallen/CONTROL @@ -1,6 +1,7 @@ Source: ensmallen Version: 2.11.2 +Port-Version: 1 Homepage: https://github.com/mlpack/ensmallen Description: A header-only C++ library for mathematical optimization. -Build-Depends: openblas (!osx), clapack (!osx), armadillo +Build-Depends: openblas (!osx), lapack, armadillo diff --git a/ports/evpp/CONTROL b/ports/evpp/CONTROL index 68244157bf24e1..047c77a4404031 100644 --- a/ports/evpp/CONTROL +++ b/ports/evpp/CONTROL @@ -1,5 +1,6 @@ Source: evpp -Version: 0.7.0-3 +Version: 0.7.0 +Port-Version: 4 Homepage: https://github.com/Qihoo360/evpp Description: A modern C++ network library based on libevent for developing high performance network services in TCP/UDP/HTTP protocols. Build-Depends: glog, libevent (windows), libevent[openssl] (!windows), rapidjson, concurrentqueue (!windows), boost-lockfree (!windows) \ No newline at end of file diff --git a/ports/evpp/fix-linux-build.patch b/ports/evpp/fix-linux-build.patch index 2b772a145a49ea..b5673b27c49cd3 100644 --- a/ports/evpp/fix-linux-build.patch +++ b/ports/evpp/fix-linux-build.patch @@ -11,7 +11,7 @@ index 7872fc8..2a06614 100644 + find_path(GLOG_INCLUDE_DIRS logging.h PATH_SUFFIXES glog) + find_package(Libevent CONFIG REQUIRED) + list(APPEND DEPENDENT_INCLUDE_DIRS "${GLOG_INCLUDE_DIRS}/../") -+ SET(DEPENDENT_LIBRARIES event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) ++ SET(DEPENDENT_LIBRARIES libevent::core libevent::extra libevent::openssl glog::glog pthread) else (UNIX) SET(DEPENDENT_LIBRARIES event glog) endif (UNIX) @@ -24,7 +24,7 @@ index 469ed1c..8219424 100644 if (UNIX) -set(LIBRARIES evpp_concurrentqueue event glog pthread) -+set(LIBRARIES evpp_concurrentqueue event_static event_core_static event_extra_static event_openssl_static glog::glog pthread) ++set(LIBRARIES evpp_concurrentqueue libevent::core libevent::extra libevent::openssl glog::glog pthread) link_directories("/home/s/safe/lib" ${PROJECT_BUILD_DIR}/lib) else(UNIX) set(LIBRARIES evpp_static event glog) @@ -36,7 +36,7 @@ index 1148616..0356b71 100644 add_executable(benchmark_http_libevent libevent_http_bench.c) -target_link_libraries(benchmark_http_libevent event) -+target_link_libraries(benchmark_http_libevent event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_http_libevent libevent::core libevent::extra libevent::openssl) diff --git a/benchmark/ioevent/libevent/CMakeLists.txt b/benchmark/ioevent/libevent/CMakeLists.txt index dfa51a3..de4849d 100644 --- a/benchmark/ioevent/libevent/CMakeLists.txt @@ -45,7 +45,7 @@ index dfa51a3..de4849d 100644 add_executable(benchmark_ioevent_libevent libevent_ioevent_bench.c) -target_link_libraries(benchmark_ioevent_libevent event) -+target_link_libraries(benchmark_ioevent_libevent event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_ioevent_libevent libevent::core libevent::extra libevent::openssl) diff --git a/benchmark/throughput/libevent/CMakeLists.txt b/benchmark/throughput/libevent/CMakeLists.txt index 21dab84..aefe698 100644 --- a/benchmark/throughput/libevent/CMakeLists.txt @@ -53,11 +53,11 @@ index 21dab84..aefe698 100644 @@ -1,5 +1,5 @@ add_executable(benchmark_tcp_libevent_client client.c) -target_link_libraries(benchmark_tcp_libevent_client event) -+target_link_libraries(benchmark_tcp_libevent_client event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_tcp_libevent_client libevent::core libevent::extra libevent::openssl) add_executable(benchmark_tcp_libevent_server server.c) -target_link_libraries(benchmark_tcp_libevent_server event) -+target_link_libraries(benchmark_tcp_libevent_server event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(benchmark_tcp_libevent_server libevent::core libevent::extra libevent::openssl) diff --git a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt index 7834db4..82294c5 100644 --- a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt @@ -67,7 +67,7 @@ index 7834db4..82294c5 100644 add_executable(example_recipes_self_control_timer_basic_01 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_01 event) -+target_link_libraries(example_recipes_self_control_timer_basic_01 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_basic_01 libevent::core libevent::extra libevent::openssl) @@ -80,7 +80,7 @@ index a8be419..0329ccc 100644 add_executable(example_recipes_self_control_timer_basic_02 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_basic_02 event) -+target_link_libraries(example_recipes_self_control_timer_basic_02 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_basic_02 libevent::core libevent::extra libevent::openssl) @@ -93,7 +93,7 @@ index 1cae9bb..218b771 100644 add_executable(example_recipes_self_control_timer_cancel_03 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_cancel_03 event) -+target_link_libraries(example_recipes_self_control_timer_cancel_03 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_cancel_03 libevent::core libevent::extra libevent::openssl) @@ -106,7 +106,7 @@ index 749c584..e7c658e 100644 add_executable(example_recipes_self_control_timer_periodic_04 ${SRCS}) -target_link_libraries(example_recipes_self_control_timer_periodic_04 event) -+target_link_libraries(example_recipes_self_control_timer_periodic_04 event_static event_core_static event_extra_static event_openssl_static) ++target_link_libraries(example_recipes_self_control_timer_periodic_04 libevent::core libevent::extra libevent::openssl) diff --git a/ports/farmhash/CONTROL b/ports/farmhash/CONTROL index f27140fbd01d5a..7d7f4d386f528c 100644 --- a/ports/farmhash/CONTROL +++ b/ports/farmhash/CONTROL @@ -1,5 +1,6 @@ Source: farmhash -Version: 1.1-1 +Version: 1.1 +Port-Version: 2 Homepage: https://github.com/google/farmhash Description: FarmHash, a family of hash functions. Supports: !arm diff --git a/ports/farmhash/portfile.cmake b/ports/farmhash/portfile.cmake index d9bcc924063610..801e0570651319 100644 --- a/ports/farmhash/portfile.cmake +++ b/ports/farmhash/portfile.cmake @@ -14,6 +14,7 @@ if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This endif() file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index fadb1a29c892c4..a2a905b2cc2b7e 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,10 +1,11 @@ Source: ffmpeg -Version: 4.2-13 +Version: 4.2 +Port-Version: 18 Build-Depends: zlib Homepage: https://ffmpeg.org Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. -Default-Features: avresample +Default-Features: avresample, avcodec, avformat, avdevice, avfilter, swresample, swscale Feature: ffmpeg Description: build the ffmpeg.exe application @@ -54,6 +55,24 @@ Description: upgrade (L)GPL to version 3 Feature: avresample Description: Libav audio resampling library support in ffmpeg +Feature: avcodec +Description: Codec support in ffmpeg + +Feature: avformat +Description: Format support in ffmpeg + +Feature: avdevice +Description: Device support in ffmpeg + +Feature: avfilter +Description: Filter support in ffmpeg + +Feature: swresample +Description: Swresample support in ffmpeg + +Feature: swscale +Description: Swscale support in ffmpeg + Feature: nvcodec Build-Depends: ffnvcodec, cuda Description: Hardware accelerated codecs diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index cd61ffcc85604b..5fbd9963de8c7a 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,7 +33,11 @@ set(FFMPEG_VERSION "4.2") find_dependency(Threads) if(UNIX) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lX11) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread) +endif() + +if(UNIX AND NOT APPLE) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11) endif() if(@ENABLE_BZIP2@) @@ -127,30 +131,68 @@ if(APPLE) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) endif() -FFMPEG_FIND(libavcodec avcodec avcodec.h) -FFMPEG_FIND(libavdevice avdevice avdevice.h) -FFMPEG_FIND(libavfilter avfilter avfilter.h) -FFMPEG_FIND(libavformat avformat avformat.h) -FFMPEG_FIND(libavresample avresample avresample.h) +if(@ENABLE_AVCODEC@) + FFMPEG_FIND(libavcodec avcodec avcodec.h) +endif() +if(@ENABLE_AVDEVICE@) + FFMPEG_FIND(libavdevice avdevice avdevice.h) +endif() +if(@ENABLE_AVFILTER@) + FFMPEG_FIND(libavfilter avfilter avfilter.h) +endif() +if(@ENABLE_AVFORMAT@) + FFMPEG_FIND(libavformat avformat avformat.h) +endif() +if(@ENABLE_AVRESAMPLE@) + FFMPEG_FIND(libavresample avresample avresample.h) +endif() FFMPEG_FIND(libavutil avutil avutil.h) -FFMPEG_FIND(libswresample swresample swresample.h) -FFMPEG_FIND(libswscale swscale swscale.h) - -if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS}) +if(@ENABLE_SWRESAMPLE@) + FFMPEG_FIND(libswresample swresample swresample.h) +endif() +if(@ENABLE_SWSCALE@) + FFMPEG_FIND(libswscale swscale swscale.h) +endif(@ENABLE_SWSCALE@) + +if (FFMPEG_libavutil_FOUND AND FFMPEG_libzlib_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavutil_INCLUDE_DIRS}) + if(FFMPEG_libavcodec_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavcodec_INCLUDE_DIRS}) + endif() + if(FFMPEG_libavdevice_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavdevice_INCLUDE_DIRS}) + endif() + if(FFMPEG_libavformat_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS}) + endif() + if(FFMPEG_libswscale_FOUND) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libswscale_INCLUDE_DIRS}) + endif() list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + if(FFMPEG_libavcodec_FOUND) + set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavdevice_FOUND) + set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavfilter_FOUND) + set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libavformat_FOUND) + set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() if(FFMPEG_libavresample_FOUND) set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") endif() set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + if(FFMPEG_libswresample_FOUND) + set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() + if(FFMPEG_libswscale_FOUND) + set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + endif() list(APPEND FFMPEG_LIBRARIES ${FFMPEG_libavdevice_LIBRARY} @@ -160,7 +202,7 @@ if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_ ${FFMPEG_libavcodec_LIBRARY} ${FFMPEG_libswresample_LIBRARY} ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} + ${FFMPEG_libavutil_LIBRARY} ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 14eb4ae100299b..86fd3e5d9880b1 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -127,8 +127,58 @@ else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() +set(ENABLE_AVRESAMPLE OFF) if("avresample" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-avresample") + set(ENABLE_AVRESAMPLE ON) #necessary for configuring FFMPEG CMake Module +endif() + +if("avcodec" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avcodec") + set(ENABLE_AVCODEC ON) +else() + set(OPTIONS "${OPTIONS} --disable-avcodec") + set(ENABLE_AVCODEC OFF) +endif() + +if("avdevice" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avdevice") + set(ENABLE_AVDEVICE ON) +else() + set(OPTIONS "${OPTIONS} --disable-avdevice") + set(ENABLE_AVDEVICE OFF) +endif() + +if("avformat" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avformat") + set(ENABLE_AVFORMAT ON) +else() + set(OPTIONS "${OPTIONS} --disable-avformat") + set(ENABLE_AVFORMAT OFF) +endif() + +if("avfilter" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avfilter") + set(ENABLE_AVFILTER ON) +else() + set(OPTIONS "${OPTIONS} --disable-avfilter") + set(ENABLE_AVFILTER OFF) +endif() + +if("swresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-swresample") + set(ENABLE_SWRESAMPLE ON) +else() + set(OPTIONS "${OPTIONS} --disable-swresample") + set(ENABLE_SWRESAMPLE OFF) +endif() + +if("swscale" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-swscale") + set(ENABLE_SWSCALE ON) +else() + set(OPTIONS "${OPTIONS} --disable-swscale") + set(ENABLE_SWSCALE OFF) endif() if (VCPKG_TARGET_IS_OSX) diff --git a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake index 322387565d03e8..8e2dd44d008eb1 100644 --- a/ports/ffmpeg/vcpkg-cmake-wrapper.cmake +++ b/ports/ffmpeg/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT FFMPEG_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH}) diff --git a/ports/field3d/0001_fix_build_errors.patch b/ports/field3d/0001_fix_build_errors.patch new file mode 100644 index 00000000000000..95149e39d893fd --- /dev/null +++ b/ports/field3d/0001_fix_build_errors.patch @@ -0,0 +1,148 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1610c2e..b012008 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,25 +31,17 @@ + + # Author : Nicholas Yue yue.nicholas@gmail.com + +-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) ++CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) + + PROJECT ( field3d ) + + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) + + FIND_PACKAGE (Doxygen) +-FIND_PACKAGE (HDF5 COMPONENTS C) +-IF ( CMAKE_HOST_WIN32 ) +-# f3dinfo relies on program_options but don't include it, since +-# for some reason, unlike all the other boost components, a link is +-# forced via a pragma. +-FIND_PACKAGE (Boost COMPONENTS regex thread) +-ELSE () +-FIND_PACKAGE (Boost COMPONENTS regex thread program_options system) +-FIND_PACKAGE (MPI) +-ENDIF () ++FIND_PACKAGE (HDF5 COMPONENTS C REQUIRED) ++FIND_PACKAGE (Boost COMPONENTS regex thread program_options system REQUIRED) + +-FIND_PACKAGE (ILMBase) ++FIND_PACKAGE (OpenEXR REQUIRED) + + # Allow the developer to select if Dynamic or Static libraries are built + OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON) +@@ -79,26 +71,14 @@ IF ( CMAKE_HOST_UNIX ) + ENDIF ( ) + IF ( CMAKE_HOST_WIN32 ) + ADD_DEFINITIONS ( +- -D_HAS_ITERATOR_DEBUGGING=0 + -D_CRT_SECURE_NO_WARNINGS=1 + ) + ENDIF ( ) + + SET ( LIB_TYPE SHARED ) + IF ( NOT BUILD_SHARED_LIBS ) +- IF ( CMAKE_HOST_WIN32 ) +- # User wants to build static libraries, so change the LIB_TYPE variable to CMake keyword 'STATIC' + SET ( LIB_TYPE STATIC ) + ADD_DEFINITIONS( -DFIELD3D_STATIC ) +- ENDIF() +-ELSE () +- IF ( CMAKE_HOST_WIN32 ) +- ADD_DEFINITIONS ( +- -DOPENEXR_DLL +- -D_HDF5USEDLL_ +- -DHDF5CPP_USEDLL +- ) +- ENDIF() + ENDIF ( NOT BUILD_SHARED_LIBS ) + + ADD_LIBRARY ( Field3D ${LIB_TYPE} +@@ -147,24 +128,22 @@ IF ( CMAKE_HOST_UNIX ) + ${MPI_LIBRARIES} ) + ENDIF ( MPI_FOUND ) + LIST ( APPEND Field3D_Libraries_Shared +- Iex Half IlmThread Imath + pthread dl z ) + SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) + SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} + ${Boost_LIBRARIES} ) + ENDIF ( ) + IF ( CMAKE_HOST_WIN32 ) +- # Add OpenEXR and zlib release/debug +- FOREACH ( lib Iex Half IlmThread Imath zdll ) ++ FOREACH ( lib zlib ) + LIST ( APPEND Field3D_Libraries_Shared + optimized ${lib} +- debug ${lib}_d ) ++ debug ${lib}d ) + ENDFOREACH() + SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} Shlwapi.lib) + SET ( Field3D_BIN_Libraries Field3D ${Boost_LIBRARIES} ) + ENDIF () + +-TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES}) ++TARGET_LINK_LIBRARIES ( Field3D ${Field3D_DSO_Libraries} ${Boost_LIBRARIES} OpenEXR::IlmImf) + + # Parase version and soversion from export/ns.h + +@@ -214,33 +193,7 @@ ADD_EXECUTABLE ( f3dinfo + + TARGET_LINK_LIBRARIES ( f3dinfo ${Field3D_BIN_Libraries} ) + +-# field3d - sparse_field_io +-ADD_EXECUTABLE ( sparse_field_io +- apps/sample_code/sparse_field_io/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( sparse_field_io ${Field3D_BIN_Libraries} ) +- +-# field3d - read +-ADD_EXECUTABLE ( read +- apps/sample_code/read/main.cpp +- ) + +-TARGET_LINK_LIBRARIES ( read ${Field3D_BIN_Libraries} ) +- +-# field3d - mixed_types +-ADD_EXECUTABLE ( mixed_types +- apps/sample_code/mixed_types/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( mixed_types ${Field3D_BIN_Libraries} ) +- +-# field3d - create_and_write +-ADD_EXECUTABLE ( create_and_write +- apps/sample_code/create_and_write/main.cpp +- ) +- +-TARGET_LINK_LIBRARIES ( create_and_write ${Field3D_BIN_Libraries} ) + + IF (DOXYGEN_FOUND) + ADD_CUSTOM_TARGET ( doc +@@ -249,7 +202,7 @@ IF (DOXYGEN_FOUND) + WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} + ) + IF (INSTALL_DOCS) +- INSTALL (DIRECTORY ++ INSTALL (DIRECTORY + ${CMAKE_HOME_DIRECTORY}/docs + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) +@@ -263,12 +216,11 @@ INSTALL ( TARGETS + + FILE(GLOB Field3d_Includes "${CMAKE_CURRENT_SOURCE_DIR}/export/*.h") + +-INSTALL ( FILES +- ${Field3d_Includes} ++INSTALL ( FILES ++ ${Field3d_Includes} + DESTINATION include/Field3D + ) + +-INSTALL ( TARGETS f3dinfo ++INSTALL ( TARGETS f3dinfo + RUNTIME DESTINATION bin + ) +- diff --git a/ports/field3d/0002_improve_win_compatibility.patch b/ports/field3d/0002_improve_win_compatibility.patch new file mode 100644 index 00000000000000..08167be692f4c0 --- /dev/null +++ b/ports/field3d/0002_improve_win_compatibility.patch @@ -0,0 +1,43 @@ +diff --git a/include/UtilFoundation.h b/include/UtilFoundation.h +index 2eb6290..a449b5b 100644 +--- a/include/UtilFoundation.h ++++ b/include/UtilFoundation.h +@@ -90,6 +90,9 @@ + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif ++#ifndef NOMINMAX ++#define NOMINMAX ++#endif + + // needed for mutex stuff + #include +diff --git a/src/FieldMapping.cpp b/src/FieldMapping.cpp +index b1f1a1f..90612b1 100644 +--- a/src/FieldMapping.cpp ++++ b/src/FieldMapping.cpp +@@ -49,9 +49,6 @@ + #include "FieldMapping.h" + #include "Types.h" + +-#ifdef WIN32 +-#define isnan(__x__) _isnan(__x__) +-#endif + + //----------------------------------------------------------------------------// + +diff --git a/src/Log.cpp b/src/Log.cpp +index f78229c..d095a50 100644 +--- a/src/Log.cpp ++++ b/src/Log.cpp +@@ -40,8 +40,9 @@ + */ + + //----------------------------------------------------------------------------// +- ++#ifndef _WIN32 + #include ++#endif + #include + #include + diff --git a/ports/field3d/0003_hdf5_api.patch b/ports/field3d/0003_hdf5_api.patch new file mode 100644 index 00000000000000..183a49c9e6e071 --- /dev/null +++ b/ports/field3d/0003_hdf5_api.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b57057f..e809880 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,6 +35,7 @@ CMAKE_MINIMUM_REQUIRED( VERSION 3.17 ) + + PROJECT ( field3d ) + ++add_definitions(-DH5_USE_110_API) + set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) + + FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/CONTROL b/ports/field3d/CONTROL index 965ad7477fe62c..d16bd4cb4839de 100644 --- a/ports/field3d/CONTROL +++ b/ports/field3d/CONTROL @@ -1,6 +1,7 @@ Source: field3d Version: 1.7.3 +Port-Version: 1 Homepage: https://github.com/imageworks/Field3D Description: An open source library for storing voxel data. It provides C++ classes that handle in-memory storage and a file format based on HDF5 that allows the C++ objects to be written to and read from disk. -Build-Depends: hdf5[core], boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format -Supports: !(windows|arm|uwp) \ No newline at end of file +Build-Depends: hdf5, boost-regex, boost-thread, boost-program-options, boost-system, openexr, boost-foreach, boost-test, boost-timer, boost-format +Supports: !(uwp) diff --git a/ports/field3d/fix-build_error.patch b/ports/field3d/fix-build_error.patch deleted file mode 100644 index e2f44c093e5c5a..00000000000000 --- a/ports/field3d/fix-build_error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e9ad44f..45f3fad 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -147,7 +147,7 @@ IF ( CMAKE_HOST_UNIX ) - ${MPI_LIBRARIES} ) - ENDIF ( MPI_FOUND ) - LIST ( APPEND Field3D_Libraries_Shared -- Iex Half IlmThread Imath -+ Iex-2_3 Half-2_3 IlmThread-2_3 Imath-2_3 - pthread dl z ) - SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} ) - SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared} diff --git a/ports/field3d/hdf5.api.patch b/ports/field3d/hdf5.api.patch deleted file mode 100644 index 21a08baebe419a..00000000000000 --- a/ports/field3d/hdf5.api.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1e608b3ec..5ff2c3c31 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -34,7 +34,8 @@ - CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) - - PROJECT ( field3d ) -- -+add_definitions(-UH5_USE_112_API_DEFAULT) -+add_definitions(-DH5_USE_110_API_DEFAULT) - set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ) - - FIND_PACKAGE (Doxygen) diff --git a/ports/field3d/portfile.cmake b/ports/field3d/portfile.cmake index ccbfcd95a34c41..a23e042494b94a 100644 --- a/ports/field3d/portfile.cmake +++ b/ports/field3d/portfile.cmake @@ -1,21 +1,23 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") -if (TRIPLET_SYSTEM_ARCH MATCHES "arm") - message(FATAL_ERROR "ARM is currently not supported.") -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - message(FATAL_ERROR "Error: UWP builds are currently not supported.") +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO imageworks/Field3D - REF v1.7.3 - SHA512 de3f10ff120420925de67064b2169f2a30c9180e308acc9090d70567b45be5423f4b1f7eb32bb376c887cea1364803cf7b2db66c2bc49f8a39a1037bbf0e5f39 + REF 0cf75ad982917e0919f59e5cb3d483517d06d7da + SHA512 e6f137013dd7b64b51b2ec3cc3ed8f4dbfadb85858946f08393653d78136cf8f93ae124716db11358e325c5e64ba04802afd4b89ca36ad65a14dd3db17f3072c HEAD_REF master PATCHES - fix-build_error.patch - hdf5.api.patch # Switches the HDF5 default API for this port to 1.10 + 0001_fix_build_errors.patch + 0002_improve_win_compatibility.patch + 0003_hdf5_api.patch # Switches the HDF5 default API for this port to 1.10 ) +file(REMOVE ${SOURCE_PATH}/cmake/FindILMBase.cmake) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -30,6 +32,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle copyright -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/fizz/CONTROL b/ports/fizz/CONTROL index 9ad27acd8c1c66..152f53ad56d48f 100644 --- a/ports/fizz/CONTROL +++ b/ports/fizz/CONTROL @@ -1,4 +1,5 @@ Source: fizz -Version: 2020.02.03.00 +Version: 2020.02.03.00 +Port-Version: 1 Build-Depends: folly, openssl, libsodium, zlib, fmt Description: a TLS 1.3 implementation by Facebook \ No newline at end of file diff --git a/ports/fizz/fix-build_error.patch b/ports/fizz/fix-build_error.patch deleted file mode 100644 index c6bafbb15e581f..00000000000000 --- a/ports/fizz/fix-build_error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt -index ccbbbb6..ee10c90 100644 ---- a/fizz/CMakeLists.txt -+++ b/fizz/CMakeLists.txt -@@ -86,7 +86,7 @@ if(TARGET event) - message(STATUS "Found libevent from package config") - list(APPEND FIZZ_SHINY_DEPENDENCIES event) - else() -- find_package(Libevent MODULE REQUIRED) -+ find_package(Libevent CONFIG REQUIRED) - list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - endif() diff --git a/ports/fizz/portfile.cmake b/ports/fizz/portfile.cmake index 1dc4fa30c2d080..869dfcd2e57e94 100644 --- a/ports/fizz/portfile.cmake +++ b/ports/fizz/portfile.cmake @@ -3,18 +3,16 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebookincubator/fizz - REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 + REF c0bafd67140e8c6f4f585c1077f2fd89102e4582 # v2020.02.03.00 SHA512 7db706ffdd79f6d753c5530eb67646747d1e7b8b380387f34bd1fc7a06b289a68a6bb4c13faa74e108d4dede72bb2d993d7ad8f60fabcfb3b48abbf4326291c2 HEAD_REF master PATCHES find-zlib.patch - fix-build_error.patch ) # Prefer installed config files file(REMOVE ${SOURCE_PATH}/fizz/cmake/FindGflags.cmake - ${SOURCE_PATH}/fizz/cmake/FindLibevent.cmake ${SOURCE_PATH}/fizz/cmake/FindGlog.cmake ) diff --git a/ports/fltk/CONTROL b/ports/fltk/CONTROL index c9d660cee9f7bc..c6db1c1bbdcbb7 100644 --- a/ports/fltk/CONTROL +++ b/ports/fltk/CONTROL @@ -1,5 +1,6 @@ Source: fltk -Version: 1.3.5-2 +Version: 1.3.5 +Port-Version: 3 Homepage: https://www.fltk.org/ Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation. Build-Depends: zlib, libpng, libjpeg-turbo diff --git a/ports/fltk/config-path.patch b/ports/fltk/config-path.patch new file mode 100644 index 00000000000000..b308f750f50655 --- /dev/null +++ b/ports/fltk/config-path.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/setup.cmake b/CMake/setup.cmake +index 4d960a5..194887d 100644 +--- a/CMake/setup.cmake ++++ b/CMake/setup.cmake +@@ -88,6 +88,8 @@ else() + set(FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk) + endif(WIN32 AND NOT CYGWIN) + ++set(FLTK_CONFIG_PATH share/fltk) ++ + include(TestBigEndian) + TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + diff --git a/ports/fltk/include.patch b/ports/fltk/include.patch new file mode 100644 index 00000000000000..27207fdbd7ed24 --- /dev/null +++ b/ports/fltk/include.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/macros.cmake b/CMake/macros.cmake +index ca03371..bde2c7e 100644 +--- a/CMake/macros.cmake ++++ b/CMake/macros.cmake +@@ -36,6 +36,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES) + + add_library(${LIBRARY_NAME} ${LIBTYPE} ${LIBFILES}) + ++ target_include_directories(${LIBRARY_NAME} PUBLIC $) ++ + set_target_properties(${LIBRARY_NAME} + PROPERTIES + OUTPUT_NAME ${LIBRARY_NAME} diff --git a/ports/fltk/portfile.cmake b/ports/fltk/portfile.cmake index 905b140bbb15be..1721c9072ba26c 100644 --- a/ports/fltk/portfile.cmake +++ b/ports/fltk/portfile.cmake @@ -4,20 +4,19 @@ vcpkg_download_distfile(ARCHIVE SHA512 db7ea7c5f3489195a48216037b9371a50f1119ae7692d66f71b6711e5ccf78814670581bae015e408dee15c4bba921728309372c1cffc90113cdc092e8540821 ) +# FLTK has many improperly shared global variables that get duplicated into every DLL +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} PATCHES findlibsfix.patch add-link-libraries.patch + config-path.patch + include.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(BUILD_SHARED ON) -else() - set(BUILD_SHARED OFF) -endif() - if (VCPKG_TARGET_ARCHITECTURE MATCHES "arm" OR VCPKG_TARGET_ARCHITECTURE MATCHES "arm64") set(OPTION_USE_GL "-DOPTION_USE_GL=OFF") else() @@ -34,55 +33,36 @@ vcpkg_configure_cmake( -DOPTION_USE_SYSTEM_ZLIB=ON -DOPTION_USE_SYSTEM_LIBPNG=ON -DOPTION_USE_SYSTEM_LIBJPEG=ON - -DOPTION_BUILD_SHARED_LIBS=${BUILD_SHARED} + -DOPTION_BUILD_SHARED_LIBS=OFF + -DFLTK_CONFIG_PATH=share/fltk ${OPTION_USE_GL} ) vcpkg_install_cmake() -if (VCPKG_TARGET_IS_LINUX) - vcpkg_fixup_cmake_targets(CONFIG_PATH share/${PORT} TARGET_PATH share/${PORT}) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid) -elseif (VCPKG_TARGET_IS_OSX) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.app DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.app) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.app) -else() - vcpkg_fixup_cmake_targets(CONFIG_PATH CMake) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/fluid.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/fltk) - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fluid.exe) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fluid.exe) -endif() - -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - ${CURRENT_PACKAGES_DIR}/debug/share -) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/fltk) -file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) +if(VCPKG_TARGET_IS_OSX) + vcpkg_copy_tools(TOOL_NAMES fluid.app fltk-config AUTO_CLEAN) +elseif(VCPKG_TARGET_IS_WINDOWS) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/fltk-config ${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config) + vcpkg_copy_tools(TOOL_NAMES fluid AUTO_CLEAN) +else() + vcpkg_copy_tools(TOOL_NAMES fluid fltk-config AUTO_CLEAN) +endif() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/fltk) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin ) -else() - file(GLOB SHARED_LIBS "${CURRENT_PACKAGES_DIR}/lib/*_SHARED.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*_SHAREDd.lib") - file(GLOB STATIC_LIBS "${CURRENT_PACKAGES_DIR}/lib/*.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/*.lib") - list(FILTER STATIC_LIBS EXCLUDE REGEX "_SHAREDd?\\.lib\$") - file(REMOVE ${STATIC_LIBS}) - foreach(SHARED_LIB ${SHARED_LIBS}) - string(REGEX REPLACE "_SHARED(d?)\\.lib\$" "\\1.lib" NEWNAME ${SHARED_LIB}) - file(RENAME ${SHARED_LIB} ${NEWNAME}) - endforeach() endif() +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) foreach(FILE Fl_Export.H fl_utf8.h) file(READ ${CURRENT_PACKAGES_DIR}/include/FL/${FILE} FLTK_HEADER) diff --git a/ports/fmt/CONTROL b/ports/fmt/CONTROL index ce04fe4371a0b8..8a5c423eb729ad 100644 --- a/ports/fmt/CONTROL +++ b/ports/fmt/CONTROL @@ -1,4 +1,4 @@ Source: fmt -Version: 6.2.1 +Version: 7.0.3 Homepage: https://github.com/fmtlib/fmt Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake index c44da534a6654c..f6126cd2634ce4 100644 --- a/ports/fmt/portfile.cmake +++ b/ports/fmt/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fmtlib/fmt - REF 19bd751020a1f3c3363b2eb67a039852f139a8d3#version 6.2.1 - SHA512 5d03445c64c3b7973bdf4e445238c63fa41bf0fa8c2d5b32cd56f0a6b3036b039d9c303a06300f3af87795a07f80f2ed28b90ddbf9c3f7398796d77906c21f40 + REF cd4af11efc9c622896a3e4cb599fa28668ca3d05#version 7.0.3 + SHA512 24b42288be97849533dc82282fc08833d74642ad2afeb511e65c6389d88c709cf25345dec5b550c18af3705f4c0847fa0d4066308b51cd41ccfdda1a2c3babd0 HEAD_REF master PATCHES fix-warning4189.patch ) @@ -33,10 +33,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() endif() - # Force FMT_SHARED to 1 - file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/core.h FMT_CORE_H) - string(REPLACE "defined(FMT_SHARED)" "1" FMT_CORE_H "${FMT_CORE_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/core.h "${FMT_CORE_H}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h + "defined(FMT_SHARED)" + "1" + ) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -45,14 +45,16 @@ vcpkg_fixup_pkgconfig() if(VCPKG_TARGET_IS_WINDOWS) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE) - string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake + "lib/fmtd.dll" + "bin/fmtd.dll" + ) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE) - string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE}) - file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake + "lib/fmt.dll" + "bin/fmt.dll" + ) endif() endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/freeimage/CMakeLists.txt b/ports/freeimage/CMakeLists.txt index f8fd969297db71..2e73e9b26709d7 100644 --- a/ports/freeimage/CMakeLists.txt +++ b/ports/freeimage/CMakeLists.txt @@ -9,10 +9,6 @@ if(MSVC) set(CMAKE_CXX_FLAGS "/wd4828 ${CMAKE_CXX_FLAGS}") endif() -if(BUILD_SHARED_LIBS) - add_definitions("-DOPENEXR_DLL") -endif() - find_package(ZLIB REQUIRED) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) @@ -100,7 +96,6 @@ target_include_directories(FreeImage PRIVATE ${REAL_SOURCE_DIR} ${WEBP_INCLUDE_DIRS} ${JXR_INCLUDE_DIRS} ${LibRaw_INCLUDE_DIRS} - ${OpenEXR_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) @@ -112,7 +107,7 @@ target_link_libraries(FreeImage ${ZLIB_LIBRARIES} ${WEBP_LIBRARIES} ${JXR_LIBRARIES} ${LibRaw_LIBRARIES} - ${OpenEXR_LIBRARIES}) + OpenEXR::IlmImf) target_compile_definitions(FreeImage PRIVATE ${PNG_DEFINITIONS}) diff --git a/ports/freeimage/CONTROL b/ports/freeimage/CONTROL index 36829adc7a51bf..643c7b39877548 100644 --- a/ports/freeimage/CONTROL +++ b/ports/freeimage/CONTROL @@ -1,5 +1,6 @@ Source: freeimage -Version: 3.18.0-12 +Version: 3.18.0 +Port-Version: 13 Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr Homepage: https://sourceforge.net/projects/freeimage/ Description: Support library for graphics image formats diff --git a/ports/freetype-gl/CONTROL b/ports/freetype-gl/CONTROL index 5419d6596b336c..a4081715e36f10 100644 --- a/ports/freetype-gl/CONTROL +++ b/ports/freetype-gl/CONTROL @@ -1,5 +1,6 @@ Source: freetype-gl -Version: 2019-03-29-3 +Version: 2019-03-29 +Port-Version: 4 Homepage: https://github.com/rougier/freetype-gl Description: OpenGL text using one vertex buffer, one texture and FreeType Build-Depends: glew, freetype diff --git a/ports/freetype-gl/glew.patch b/ports/freetype-gl/glew.patch new file mode 100644 index 00000000000000..01b7f616d9c940 --- /dev/null +++ b/ports/freetype-gl/glew.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c2e89fba..9e2d112c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -92,7 +92,7 @@ include_directories( + ${OPENGL_INCLUDE_DIRS} + ${FREETYPE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +- ${GLEW_INCLUDE_PATH} ++ ${GLEW_INCLUDE_DIRS} + ) + + if(MSVC) diff --git a/ports/freetype-gl/portfile.cmake b/ports/freetype-gl/portfile.cmake index 5d931ced5d3b63..9dfd38719ae7b6 100644 --- a/ports/freetype-gl/portfile.cmake +++ b/ports/freetype-gl/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF a91a3dda326ceaf66b7279bf64ba07014d3f81b8 SHA512 8e04573dfb400e14e2c1d3a2cd851a66f8218ccfdaa4f701ed9369d7f040d7028582e72af9b236af42d9d3c6c128014670e8ae0261c6f4770affd1aea1454b1e HEAD_REF master + PATCHES glew.patch ) # make sure that no "internal" libraries are used by removing them diff --git a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch b/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch deleted file mode 100644 index 1120cd096319cb..00000000000000 --- a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c00902521..b24508654 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -176,6 +176,8 @@ option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) - option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF) - option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF) - -+# vcpkg config install path -+option(CONFIG_INSTALL_PATH "location to install cmake config files" lib/cmake/freetype) - - # Disallow in-source builds - if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") -@@ -559,7 +561,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - COMPONENT libraries) - install( - EXPORT freetype-targets -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype -+ DESTINATION ${CONFIG_INSTALL_PATH} - FILE freetype-config.cmake - COMPONENT headers) - endif () diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 7ba2032bf3107f..dcec495d7b07c6 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,7 +1,7 @@ Source: freetype Version: 2.10.2 -Port-Version: 1 -Build-Depends: zlib +Port-Version: 2 +Build-Depends: zlib, brotli Homepage: https://www.freetype.org/ Description: A library to render fonts. Default-Features: bzip2, png diff --git a/ports/freetype/brotli-static.patch b/ports/freetype/brotli-static.patch new file mode 100644 index 00000000000000..0e15648920ab7f --- /dev/null +++ b/ports/freetype/brotli-static.patch @@ -0,0 +1,21 @@ +diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake +index 7c484c7df..0bd49b825 100644 +--- a/builds/cmake/FindBrotliDec.cmake ++++ b/builds/cmake/FindBrotliDec.cmake +@@ -34,14 +34,14 @@ find_path(BROTLIDEC_INCLUDE_DIRS + PATH_SUFFIXES brotli) + + find_library(BROTLIDEC_LIBRARIES +- NAMES brotlidec ++ NAMES brotlidec brotlidec-static + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( +- brotlidec ++ BrotliDec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR BROTLIDEC_VERSION) diff --git a/ports/freetype/pkgconfig.patch b/ports/freetype/pkgconfig.patch new file mode 100644 index 00000000000000..615434a34bbc6e --- /dev/null +++ b/ports/freetype/pkgconfig.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 65839ac58..54f2ce8ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -517,7 +517,6 @@ endif () + + if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + # Generate the pkg-config file +- if (UNIX) + file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN) + + string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}") +@@ -551,7 +550,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + FILES ${PROJECT_BINARY_DIR}/freetype2.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + COMPONENT pkgconfig) +- endif () + + install( + TARGETS freetype diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index eddc993da16511..f62f34728ffc9a 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,8 +11,9 @@ vcpkg_extract_source_archive_ex( REF ${FT_VERSION} PATCHES 0001-Fix-install-command.patch - 0002-Add-CONFIG_INSTALL_PATH-option.patch 0003-Fix-UWP.patch + pkgconfig.patch + brotli-static.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -28,41 +29,46 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCONFIG_INSTALL_PATH=share/freetype -DFT_WITH_ZLIB=ON # Force system zlib. - ${FEATURE_OPTIONS} + -DFT_WITH_BROTLI=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype) +# Rename for easy usage (VS integration; CMake and autotools will not care) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config-debug.cmake DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-debug.cmake "${DEBUG_MODULE}") -endif() +# Fix the include dir [freetype2 -> freetype] +file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include" CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec-static.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake RELEASE_MODULE) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake "${RELEASE_MODULE}") +find_library(FREETYPE_DEBUG NAMES freetyped PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/" NO_DEFAULT_PATH) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc") + file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents) + if(FREETYPE_DEBUG) + string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}") + endif() + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}") endif() - -# Fix the include dir [freetype2 -> freetype] -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config.cmake CONFIG_MODULE) -else() #if(VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc") + file(READ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" _contents) + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" "${_contents}") endif() -string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") +vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY diff --git a/ports/freetype/vcpkg-cmake-wrapper.cmake b/ports/freetype/vcpkg-cmake-wrapper.cmake index 01da0b1dc271fb..355ddbcf575eeb 100644 --- a/ports/freetype/vcpkg-cmake-wrapper.cmake +++ b/ports/freetype/vcpkg-cmake-wrapper.cmake @@ -10,6 +10,14 @@ if(@USE_PNG@) find_package(PNG) endif() +find_library(BROTLIDEC_LIBRARY_RELEASE NAMES brotlidec brotlidec-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLIDEC_LIBRARY_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +include(SelectLibraryConfigurations) +select_library_configurations(BROTLIDEC) +select_library_configurations(BROTLICOMMON) + if(TARGET Freetype::Freetype) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) @@ -20,6 +28,7 @@ if(TARGET Freetype::Freetype) if(@USE_PNG@) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES PNG::PNG) endif() + target_link_libraries(Freetype::Freetype INTERFACE ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() if(FREETYPE_LIBRARIES) @@ -32,4 +41,6 @@ if(FREETYPE_LIBRARIES) if(@USE_PNG@) list(APPEND FREETYPE_LIBRARIES ${PNG_LIBRARIES}) endif() + + list(APPEND FREETYPE_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() diff --git a/ports/freexl/CONTROL b/ports/freexl/CONTROL index 68d0d291fc6b88..1a887b1932ad42 100644 --- a/ports/freexl/CONTROL +++ b/ports/freexl/CONTROL @@ -1,5 +1,6 @@ Source: freexl -Version: 1.0.4-9 +Version: 1.0.4 +Port-Version: 10 Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet Build-Depends: libiconv diff --git a/ports/freexl/portfile.cmake b/ports/freexl/portfile.cmake index 3c4629dce5137f..6a79451dd77d95 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -64,6 +64,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX ) file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS_DEBUG INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" diff --git a/ports/fribidi/CONTROL b/ports/fribidi/CONTROL index edfb9c77707406..570fd13621e5b2 100644 --- a/ports/fribidi/CONTROL +++ b/ports/fribidi/CONTROL @@ -1,4 +1,4 @@ Source: fribidi -Version: 1.0.9-1 +Version: 1.0.10 Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) Build-Depends: tool-meson diff --git a/ports/fribidi/fix-win-static-suffix.patch b/ports/fribidi/fix-win-static-suffix.patch index 87f288e939641a..953b1b91be7d19 100644 --- a/ports/fribidi/fix-win-static-suffix.patch +++ b/ports/fribidi/fix-win-static-suffix.patch @@ -1,39 +1,25 @@ diff --git a/lib/meson.build b/lib/meson.build -index 573d47f..c9b249e 100644 +index aaf2aed..3fe8937 100644 --- a/lib/meson.build +++ b/lib/meson.build -@@ -71,14 +71,26 @@ fribidi_sources = [ +@@ -71,6 +71,10 @@ fribidi_sources = [ 'fribidi-shape.c', ] --libfribidi = library('fribidi', -- fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -- generated_tab_include_files, config_h, -- include_directories: incs, -- c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -- version: libversion, -- soversion: soversion, -- install: true) ++libsuffix = [] +if host_machine.system() == 'windows' and get_option('default_library') == 'static' -+ libfribidi = library('fribidi', -+ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -+ generated_tab_include_files, config_h, -+ include_directories: incs, -+ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -+ version: libversion, -+ soversion: soversion, -+ install: true, -+ name_suffix: 'lib') -+else -+ libfribidi = library('fribidi', -+ fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, -+ generated_tab_include_files, config_h, -+ include_directories: incs, -+ c_args: ['-DHAVE_CONFIG_H'] + visibility_args, -+ version: libversion, -+ soversion: soversion, -+ install: true) ++ libsuffix = 'lib' +endif + libfribidi = library('fribidi', + fribidi_sources, fribidi_unicode_version_h, fribidi_config_h, + generated_tab_include_files, config_h, +@@ -78,7 +82,8 @@ libfribidi = library('fribidi', + c_args: ['-DHAVE_CONFIG_H', '-DFRIBIDI_BUILD'] + fribidi_static_cargs + visibility_args, + version: libversion, + soversion: soversion, +- install: true) ++ install: true, ++ name_suffix: libsuffix) libfribidi_dep = declare_dependency(link_with: libfribidi, include_directories: incs, diff --git a/ports/fribidi/portfile.cmake b/ports/fribidi/portfile.cmake index 342b4d3c5786c6..740502bdd8c88d 100644 --- a/ports/fribidi/portfile.cmake +++ b/ports/fribidi/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fribidi/fribidi - REF abea9f626732a9b10499d76c1cd69ce5457950cc # v1.0.9 - SHA512 5cb28f9e35d0df205c9fb88a56776d371fdd8bca12c211cec282334cfbf12a05e3324cd14a3ae71bcc06e15ce07b06cbe97eaafe1c7368e517a4ce5a4c3a2bcc + REF 5464c284034da9c058269377b7f5013bb089f553 # v1.0.10 + SHA512 82e42b022f23d6ecebac5071f997c9f46db6aa41c36f87a7f1a28a79b4ccaada10d68b233bbf687c552fc94d91f4b47161e0ef4909fd1de0b483089f1d1377f9 HEAD_REF master PATCHES fix-win-static-suffix.patch ) @@ -11,23 +11,22 @@ vcpkg_configure_meson( SOURCE_PATH ${SOURCE_PATH} OPTIONS -Ddocs=false + -Dbin=false + -Dtests=false --backend=ninja ) vcpkg_install_meson() vcpkg_copy_pdbs() -file(GLOB EXE_FILES - "${CURRENT_PACKAGES_DIR}/bin/*.exe" - "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe" -) -if (EXE_FILES) - file(REMOVE ${EXE_FILES}) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +# Define static macro +file(READ ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h FRIBIDI_COMMON_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 0" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") +else() + string(REPLACE "#ifndef FRIBIDI_LIB_STATIC" "#if 1" FRIBIDI_COMMON_H "${FRIBIDI_COMMON_H}") endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/fribidi/fribidi-common.h "${FRIBIDI_COMMON_H}") # Handle copyright file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/g2o/CONTROL b/ports/g2o/CONTROL index 80b321d5bd7e15..5234914a2de257 100644 --- a/ports/g2o/CONTROL +++ b/ports/g2o/CONTROL @@ -1,5 +1,6 @@ Source: g2o Version: 2020-02-07 -Build-Depends: suitesparse, eigen3, clapack (!osx), ceres +Port-Version: 1 +Build-Depends: suitesparse, eigen3, lapack, ceres Description: g2o: A General Framework for Graph Optimization Homepage: https://openslam.org/g2o.html diff --git a/ports/gamedev-framework/CONTROL b/ports/gamedev-framework/CONTROL new file mode 100644 index 00000000000000..d152e8426fc981 --- /dev/null +++ b/ports/gamedev-framework/CONTROL @@ -0,0 +1,7 @@ +Source: gamedev-framework +Version: 0.17 +Port-Version: 1 +Homepage: https://github.com/GamedevFramework/gf +Description: gf is a framework to build 2D games in C++14. +Build-Depends: sdl2, freetype, zlib, boost-algorithm, boost-filesystem, boost-heap, boost-container, stb, pugixml +Supports: !arm diff --git a/ports/gamedev-framework/portfile.cmake b/ports/gamedev-framework/portfile.cmake new file mode 100644 index 00000000000000..511bf9c23f42e9 --- /dev/null +++ b/ports/gamedev-framework/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_fail_port_install( + ON_ARCH "arm" +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO GamedevFramework/gf + HEAD_REF master + REF v0.17.4 + SHA512 b35e0fef3c9dc397ec43132dcd6ca87f78217c55d72fc1117b1f530d568ad3537a0f682e285840471faa4e06eb7f396b784da767e83686519d0694b198a86379 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DGF_VCPKG=ON + -DGF_USE_EMBEDDED_LIBS=OFF + -DGF_BUILD_GAMES=OFF + -DGF_BUILD_EXAMPLES=OFF + -DGF_BUILD_TESTS=OFF + -DGF_BUILD_DOCUMENTATION=OFF + -DGF_SINGLE_COMPILTATION_UNIT=ON + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + OPTIONS_RELEASE -DGF_DEBUG=OFF + OPTIONS_DEBUG -DGF_DEBUG=ON +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/gf TARGET_PATH share/gf) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/share/doc" + "${CURRENT_PACKAGES_DIR}/debug/bin/gf_info.exe" + "${CURRENT_PACKAGES_DIR}/bin/gf_info.exe" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/bin" + "${CURRENT_PACKAGES_DIR}/debug/bin" + ) +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/geogram/CONTROL b/ports/geogram/CONTROL index 4eb40eee04619b..8661aa1e4f086b 100644 --- a/ports/geogram/CONTROL +++ b/ports/geogram/CONTROL @@ -1,8 +1,8 @@ Source: geogram -Version: 1.6.9-7 +Version: 1.7.5 Homepage: https://gforge.inria.fr/projects/geogram/ Description: Geogram is a programming library of geometric algorithms. -Build-Depends: openblas (!osx), clapack (!osx) +Build-Depends: openblas (!osx), lapack Feature: graphics Description: Build viewers and geogram_gfx library. diff --git a/ports/geogram/fix-cmake-config-and-install.patch b/ports/geogram/fix-cmake-config-and-install.patch index 2c7790923f1426..8eb16c364bec17 100644 --- a/ports/geogram/fix-cmake-config-and-install.patch +++ b/ports/geogram/fix-cmake-config-and-install.patch @@ -1,9 +1,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 17dc02e..e489d75 100644 +index 2e54997..169e33c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -42,7 +42,7 @@ set(VORPALINE_VERSION_MINOR 6) - set(VORPALINE_VERSION_PATCH 9) +@@ -51,7 +51,7 @@ set(VORPALINE_VERSION_MINOR 7) + set(VORPALINE_VERSION_PATCH 5) set(VORPALINE_VERSION ${VORPALINE_VERSION_MAJOR}.${VORPALINE_VERSION_MINOR}.${VORPALINE_VERSION_PATCH}) -set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR}) @@ -11,7 +11,7 @@ index 17dc02e..e489d75 100644 # Determine the current Build-OS (Build-platform without the compiler info) string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM}) -@@ -106,6 +106,11 @@ if(GEOGRAM_WITH_VORPALINE) +@@ -113,6 +113,11 @@ if(GEOGRAM_WITH_VORPALINE) add_subdirectory(src/lib/vorpalib) endif() @@ -23,7 +23,7 @@ index 17dc02e..e489d75 100644 add_subdirectory(src/lib/third_party) if(GEOGRAM_WITH_GRAPHICS) -@@ -138,8 +143,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) +@@ -145,8 +150,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt) # FindGeogram.cmake @@ -70,10 +70,10 @@ index 17dc02e..e489d75 100644 # Configure CPack diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt -index d90bc48..927f857 100644 +index 49cb2ba..82c2f39 100755 --- a/src/lib/geogram/CMakeLists.txt +++ b/src/lib/geogram/CMakeLists.txt -@@ -47,7 +47,14 @@ if(WIN32) +@@ -62,7 +62,14 @@ if(WIN32) endif() # Install the library @@ -90,10 +90,10 @@ index d90bc48..927f857 100644 # Install include files for the standard devkit install( diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt -index f319b93..e24039d 100644 +index b155975..ad66440 100755 --- a/src/lib/geogram_gfx/CMakeLists.txt +++ b/src/lib/geogram_gfx/CMakeLists.txt -@@ -33,14 +33,21 @@ if(VORPALINE_BUILD_DYNAMIC) +@@ -47,14 +47,21 @@ if(VORPALINE_BUILD_DYNAMIC) endif() # Install the library @@ -117,7 +117,7 @@ index f319b93..e24039d 100644 ) # Install include files for the full devkit -@@ -48,7 +55,7 @@ install( +@@ -62,7 +69,7 @@ install( DIRECTORY . DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx COMPONENT devkit-full @@ -127,7 +127,7 @@ index f319b93..e24039d 100644 install( diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt -index 5789cd2..e4262e3 100644 +index c9c3a6e..f16d7ec 100644 --- a/src/lib/third_party/numerics/CMakeLists.txt +++ b/src/lib/third_party/numerics/CMakeLists.txt @@ -10,16 +10,19 @@ endif() @@ -154,7 +154,7 @@ index 5789cd2..e4262e3 100644 target_link_libraries(geogram_num_3rdparty m) endif() diff --git a/src/lib/third_party/numerics/LIBF2C/getarg_.c b/src/lib/third_party/numerics/LIBF2C/getarg_.c -index 2b69a1e..a504538 100644 +index 2b69a1e..1cde8b6 100755 --- a/src/lib/third_party/numerics/LIBF2C/getarg_.c +++ b/src/lib/third_party/numerics/LIBF2C/getarg_.c @@ -17,20 +17,20 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls; @@ -193,7 +193,7 @@ index 2b69a1e..a504538 100644 } #endif diff --git a/src/lib/third_party/numerics/LIBF2C/iargc_.c b/src/lib/third_party/numerics/LIBF2C/iargc_.c -index 2f29da0..50b00de 100644 +index 2f29da0..50b00de 100755 --- a/src/lib/third_party/numerics/LIBF2C/iargc_.c +++ b/src/lib/third_party/numerics/LIBF2C/iargc_.c @@ -9,8 +9,9 @@ ftnint iargc_() diff --git a/ports/geogram/portfile.cmake b/ports/geogram/portfile.cmake index 3bf583d51245f3..9aee74e6f7172e 100644 --- a/ports/geogram/portfile.cmake +++ b/ports/geogram/portfile.cmake @@ -1,11 +1,9 @@ -include(vcpkg_common_functions) - -set(GEOGRAM_VERSION 1.6.9) +set(GEOGRAM_VERSION 1.7.5) vcpkg_download_distfile(ARCHIVE - URLS "https://gforge.inria.fr/frs/download.php/file/37779/geogram_${GEOGRAM_VERSION}.tar.gz" + URLS "https://gforge.inria.fr/frs/download.php/file/38314/geogram_${GEOGRAM_VERSION}.tar.gz" FILENAME "geogram_${GEOGRAM_VERSION}.tar.gz" - SHA512 1b5c7540bef734c1908f213f26780aba63b4911a8022d5eb3f7c90eabe2cb69efd1f298b30cdc8e2c636a5b37c8c25832dd4aad0b7c2ff5f0a5b5caa17970136 + SHA512 47dcbb8a5c4e5f791feb8d9b209b04b575b0757e8b89de09c82ef2324a36d4056a1f3001537038c8a752045b0e6b6eedf5421ad49132214c0f60163ff095c36f ) vcpkg_extract_source_archive_ex( @@ -18,35 +16,36 @@ vcpkg_extract_source_archive_ex( file(COPY ${CURRENT_PORT_DIR}/Config.cmake.in DESTINATION ${SOURCE_PATH}/cmake) -set(GEOGRAM_WITH_GRAPHICS OFF) -if("graphics" IN_LIST FEATURES) - set(GEOGRAM_WITH_GRAPHICS ON) -endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "graphics" GEOGRAM_WITH_GRAPHICS +) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(VORPALINE_BUILD_DYNAMIC FALSE) - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + if (VCPKG_TARGET_IS_WINDOWS) set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") + if (VCPKG_TARGET_IS_LINUX) message("geogram on Linux only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") + if (VCPKG_TARGET_IS_OSX) message("geogram on Darwin only supports dynamic library linkage. Building dynamic.") set(VCPKG_LIBRARY_LINKAGE dynamic) set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() else() set(VORPALINE_BUILD_DYNAMIC TRUE) - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") + if (VCPKG_TARGET_IS_WINDOWS) set(VORPALINE_PLATFORM Win-vs-generic) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Linux") + if (VCPKG_TARGET_IS_LINUX) set(VORPALINE_PLATFORM Linux64-gcc-dynamic ) endif() - if (VCPKG_CMAKE_SYSTEM_NAME MATCHES "Darwin") + if (VCPKG_TARGET_IS_OSX) set(VORPALINE_PLATFORM Darwin-clang-dynamic) endif() endif() @@ -57,11 +56,11 @@ vcpkg_configure_cmake( #PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DVORPALINE_BUILD_DYNAMIC=${VORPALINE_BUILD_DYNAMIC} - -DGEOGRAM_WITH_GRAPHICS=${GEOGRAM_WITH_GRAPHICS} -DGEOGRAM_LIB_ONLY=ON -DGEOGRAM_USE_SYSTEM_GLFW3=ON -DVORPALINE_PLATFORM=${VORPALINE_PLATFORM} -DGEOGRAM_WITH_VORPALINE=OFF + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -73,11 +72,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(READ ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake TARGET_CONFIG) -string(REPLACE [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] - [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] TARGET_CONFIG "${TARGET_CONFIG}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake "${TARGET_CONFIG}") +vcpkg_replace_string( + ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake + [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]] + [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] + ) # Handle copyright -file(COPY ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/geogram) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/geogram/license.dox ${CURRENT_PACKAGES_DIR}/share/geogram/copyright) +file(INSTALL ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/geographiclib/vcpkg.json b/ports/geographiclib/vcpkg.json index a60a5e7db2e1dc..8ec469c9025971 100644 --- a/ports/geographiclib/vcpkg.json +++ b/ports/geographiclib/vcpkg.json @@ -1,8 +1,8 @@ { "name": "geographiclib", "version-string": "1.50.1", - "homepage": "https://geographiclib.sourceforge.io", "description": "GeographicLib, a C++ library for performing geographic conversions", + "homepage": "https://geographiclib.sourceforge.io", "features": [ { "name": "tools", diff --git a/ports/glew/CONTROL b/ports/glew/CONTROL index 9a7fd7e9c2324e..6409f87e7f4ce9 100644 --- a/ports/glew/CONTROL +++ b/ports/glew/CONTROL @@ -1,4 +1,4 @@ Source: glew -Version: 2.1.0-7 +Version: 2.1.0-8 Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. Homepage: https://github.com/nigels-com/glew diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 504a91dcf4a976..de436818cddc67 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -26,7 +26,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glew) -if(VCPKG_TARGET_IS_WINDOWS) +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(_targets_cmake_files) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake") diff --git a/ports/gmp/CONTROL b/ports/gmp/CONTROL deleted file mode 100644 index 3f42c9d2a06d8f..00000000000000 --- a/ports/gmp/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: gmp -Version: 6.2.0-1 -Homepage: https://gmplib.org/ -Description: The GNU Multiple Precision Arithmetic Library -Build-Depends: vs-yasm (windows) \ No newline at end of file diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index ee4b51c087b56a..b8a289628dfc9f 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -1,3 +1,7 @@ +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.") +endif() + if(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -5,9 +9,10 @@ if(VCPKG_TARGET_IS_WINDOWS) REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 HEAD_REF master - PATCHES vs.build.patch - runtime.patch - prefix.patch + PATCHES + vs.build.patch + runtime.patch + prefix.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -102,6 +107,4 @@ else() # # Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -endif() - - +endif() \ No newline at end of file diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json new file mode 100644 index 00000000000000..77b237197aa826 --- /dev/null +++ b/ports/gmp/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "gmp", + "version-string": "6.2.0", + "port-version": 3, + "description": "The GNU Multiple Precision Arithmetic Library", + "homepage": "https://gmplib.org", + "dependencies": [ + { + "name": "vs-yasm", + "platform": "windows" + } + ] +} diff --git a/ports/google-cloud-cpp/CONTROL b/ports/google-cloud-cpp/CONTROL index fa905504f67a85..3591680d6a5d04 100644 --- a/ports/google-cloud-cpp/CONTROL +++ b/ports/google-cloud-cpp/CONTROL @@ -1,5 +1,5 @@ Source: google-cloud-cpp -Version: 1.15.0 +Version: 1.16.0 Build-Depends: abseil, grpc, curl[ssl], crc32c Description: C++ Client Libraries for Google Cloud Platform APIs. Homepage: https://github.com/googleapis/google-cloud-cpp diff --git a/ports/google-cloud-cpp/portfile.cmake b/ports/google-cloud-cpp/portfile.cmake index 836115f01d6529..065fe3706ad1ed 100644 --- a/ports/google-cloud-cpp/portfile.cmake +++ b/ports/google-cloud-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp - REF v1.15.0 - SHA512 193599a0ae64ee72a130417e7ce11b0e1c4af353b14124be6c781cde4f7478313460adfcf429a14195486c7d17be197410c37c2778265f08cfcba97af603b86c + REF v1.16.0 + SHA512 0e8b427d0131dfcb12d741ebd22e37e2a572ea10f3500d288c611f60f9ace8896ceb2a80213f741510d331c250bff59a38232bf967d3669c3310719ce6b0c05f HEAD_REF master ) diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch new file mode 100644 index 00000000000000..c2d1771131a87c --- /dev/null +++ b/ports/grpc/00011-fix-csharp_plugin.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 77cf3de..8bceae6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1812,10 +1812,14 @@ endif() + + if(gRPC_BUILD_CSHARP_EXT) + +-add_library(grpc_csharp_ext SHARED ++add_library(grpc_csharp_ext + src/csharp/ext/grpc_csharp_ext.c + ) + ++if (WIN32 AND BUILD_SHARED_LIBS) ++ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) ++endif() ++ + set_target_properties(grpc_csharp_ext PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +@@ -1829,6 +1833,12 @@ if(WIN32 AND MSVC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) ++ ++ install(TARGETS grpc_csharp_ext ++ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ) + endif() + endif() + diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index af06e82a490f4e..f62df066c6d239 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,5 +1,6 @@ Source: grpc Version: 1.29.1 +Port-Version: 1 Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil Homepage: https://github.com/grpc/grpc Description: An RPC library and framework diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 57fba090bd15f7..cc8fe92bec68bb 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( 00005-fix-uwp-error.patch 00009-use-system-upb.patch 00010-add-feature-absl-sync.patch + 00011-fix-csharp_plugin.patch snprintf.patch ) diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL index e5901fca747107..ff4434872abc2b 100644 --- a/ports/gsoap/CONTROL +++ b/ports/gsoap/CONTROL @@ -1,6 +1,6 @@ Source: gsoap -Version: 2.8.102-4 +Version: 2.8.105 Build-Depends: curl Homepage: https://sourceforge.net/projects/gsoap2/ Description: The gSOAP toolkit is a C and C++ software development toolkit for SOAP and REST XML Web services and generic C/C++ XML data bindings. -Supports: (x86 | x64) & windows +Supports: !(linux|osx|arm|uwp) diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake index b759fb876cca5b..1a4e75adbb63dc 100644 --- a/ports/gsoap/portfile.cmake +++ b/ports/gsoap/portfile.cmake @@ -4,8 +4,8 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO gsoap2 REF gsoap-2.8 - FILENAME "gsoap_2.8.102.zip" - SHA512 3cff65605b15f820c9d56e32575231fb6fb89927bafc1db85ac1f879acd8496d6f38b558e994d17cce475beae0976d5fafcff7f22b28cdfbec8b7ec4b08bcbe7 + FILENAME "gsoap_2.8.105.zip" + SHA512 3b7b66ef738e9ba78f0c9d5ec141faab102dc2ed7c528e84358d530ec8cb913c559438bb86ae0f22e0736c4cd9be9e74f364a44257189ccaa1e6d001317f99de PATCHES fix-build-in-windows.patch ) @@ -43,6 +43,9 @@ file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOUR # Handle import files file(COPY ${SOURCE_PATH}/gsoap/import DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +# Handle custom files +file(COPY ${SOURCE_PATH}/gsoap/custom DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + # Handle plugin files file(COPY ${SOURCE_PATH}/gsoap/plugin DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/gtkmm/CONTROL b/ports/gtkmm/CONTROL index ecdab2cc3853dc..71a648f1578a12 100644 --- a/ports/gtkmm/CONTROL +++ b/ports/gtkmm/CONTROL @@ -1,5 +1,6 @@ Source: gtkmm -Version: 3.22.2-2 +Version: 3.22.2 +Port-Version: 4 Homepage: https://www.gtkmm.org/ Description: gtkmm is the official C++ interface for the popular GUI library GTK+. Build-Depends: glib, atk, gtk, gdk-pixbuf, pango, cairo, libepoxy, gettext, glibmm, atkmm, cairomm, pangomm diff --git a/ports/gtkmm/fix_treeviewcolumn.patch b/ports/gtkmm/fix_treeviewcolumn.patch new file mode 100644 index 00000000000000..8daf91afbd00a9 --- /dev/null +++ b/ports/gtkmm/fix_treeviewcolumn.patch @@ -0,0 +1,15 @@ +diff --git a/gtk/gtkmm/treeviewcolumn.h b/gtk/gtkmm/treeviewcolumn.h +index f2a77c1..c66302a 100644 +--- a/gtk/gtkmm/treeviewcolumn.h ++++ b/gtk/gtkmm/treeviewcolumn.h +@@ -1026,9 +1026,7 @@ void TreeViewColumn::pack_end(const TreeModelColumn& column, + template inline + TreeViewColumn::TreeViewColumn(const Glib::ustring& title, + const TreeModelColumn& column) +-: +- Glib::ObjectBase(nullptr), // not (yet) a custom class +- Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), nullptr)) ++: TreeViewColumn (title) + { + pack_start(column, true /* expand */); + } diff --git a/ports/gtkmm/portfile.cmake b/ports/gtkmm/portfile.cmake index 23e939608dbe89..feedbf2886b706 100644 --- a/ports/gtkmm/portfile.cmake +++ b/ports/gtkmm/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} PATCHES fix_properties.patch + fix_treeviewcolumn.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/msvc_recommended_pragmas.h DESTINATION ${SOURCE_PATH}/MSVC_Net2013) diff --git a/ports/healpix/CONTROL b/ports/healpix/CONTROL index 629b095ee45004..8b1e856e2a947f 100644 --- a/ports/healpix/CONTROL +++ b/ports/healpix/CONTROL @@ -1,5 +1,6 @@ Source: healpix -Version: 1.12.10-5 +Version: 1.12.10 +Port-Version: 6 Homepage: http://healpix.sourceforge.net/ Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere. Build-Depends: cfitsio diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index 8b1a401517b07b..c1fa90f368a628 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_sourceforge( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx COPY_SOURCE diff --git a/ports/ignition-modularscripts/CONTROL b/ports/ignition-modularscripts/CONTROL index efde5f1b4c2357..e52ae90a5a50e4 100644 --- a/ports/ignition-modularscripts/CONTROL +++ b/ports/ignition-modularscripts/CONTROL @@ -1,3 +1,4 @@ Source: ignition-modularscripts Version: 2020-05-16 +Port-Version: 1 Description: Vcpkg helpers to package ignition libraries diff --git a/ports/ignition-modularscripts/ignition_modular_library.cmake b/ports/ignition-modularscripts/ignition_modular_library.cmake index f7b772d5f06d13..b294c097b6fcf1 100644 --- a/ports/ignition-modularscripts/ignition_modular_library.cmake +++ b/ports/ignition-modularscripts/ignition_modular_library.cmake @@ -38,7 +38,10 @@ function(ignition_modular_build_library NAME MAJOR_VERSION SOURCE_PATH CMAKE_PAC # Make pkg-config files relocatable if(NOT IML_DISABLE_PKGCONFIG_INSTALL) - vcpkg_fixup_pkgconfig() + if(VCPKG_TARGET_IS_LINUX) + set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) + endif() + vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) else() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) diff --git a/ports/ignition-msgs5/CONTROL b/ports/ignition-msgs5/CONTROL index fd7b362df7bc48..690ded1b6a60f5 100644 --- a/ports/ignition-msgs5/CONTROL +++ b/ports/ignition-msgs5/CONTROL @@ -1,5 +1,6 @@ Source: ignition-msgs5 Version: 5.1.0 +Port-Version: 1 Build-Depends: ignition-modularscripts, ignition-cmake2, ignition-math6, protobuf, tinyxml2 Description: Middleware protobuf messages for robotics Supports: !(arm|linux|uwp) \ No newline at end of file diff --git a/ports/ignition-msgs5/portfile.cmake b/ports/ignition-msgs5/portfile.cmake index 812a1bca73d394..aec3a6cd75c385 100644 --- a/ports/ignition-msgs5/portfile.cmake +++ b/ports/ignition-msgs5/portfile.cmake @@ -17,4 +17,4 @@ ignition_modular_library(NAME msgs "01-protobuf.patch") # Restore old path -set(ENV{PATH} ${path_backup}) +set(ENV{PATH} "${path_backup}") diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index a4f3cf61148290..795ce24a7c6b18 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -131,9 +131,11 @@ install( if(NOT IMGUI_SKIP_HEADERS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/imgui.h - ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_rectpack.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_truetype.h ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h DESTINATION include ) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 88fb1440cee253..e87894d5e29ac6 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,6 +1,6 @@ Source: imgui Version: 1.77 -Port-Version: 1 +Port-Version: 3 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 6ee33622b9c27b..7b8cf302614fa2 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -10,6 +10,10 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +if(("metal-binding" IN_LIST FEATURES OR "osx-binding" IN_LIST FEATURES) AND (NOT VCPKG_TARGET_IS_OSX)) + message(FATAL_ERROR "Feature metal-binding and osx-binding are only supported on osx.") +endif() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS allegro5-binding IMGUI_BUILD_ALLEGRO5_BINDING dx9-binding IMGUI_BUILD_DX9_BINDING diff --git a/ports/implot/CONTROL b/ports/implot/CONTROL index f887c457940c89..0f6633b28ffd44 100644 --- a/ports/implot/CONTROL +++ b/ports/implot/CONTROL @@ -1,5 +1,5 @@ Source: implot -Version: 0.3-1 +Version: 0.4 Homepage: https://github.com/epezent/implot Description: Advanced 2D Plotting for Dear ImGui Build-Depends: imgui diff --git a/ports/implot/portfile.cmake b/ports/implot/portfile.cmake index d9b59d430ce45b..b783f57ae595bd 100644 --- a/ports/implot/portfile.cmake +++ b/ports/implot/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO epezent/implot - REF v0.3 - SHA512 28d25a76b725879ad796249edc87910fec721fcd43b80171947e00c4983a945f82f2b555f1794882b79c96a4497da982dc45695fed5eedcf6009f87c05576817 + REF v0.4 + SHA512 ab54a97fcfcdc21c47d56e7e9ba1fbd05ae0f9e8f9bf0bd742e9daa6231931ac0c3a7cb0a1637b254df531b2611b27a301cc9f51d6caa950e20d05ab5fc31247 HEAD_REF master ) diff --git a/ports/itk/CONTROL b/ports/itk/CONTROL index 282ac4b3c6a647..d316675cb33cf0 100644 --- a/ports/itk/CONTROL +++ b/ports/itk/CONTROL @@ -1,9 +1,37 @@ Source: itk -Version: 5.0.1-2 +Version: 5.1.0 Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis. Homepage: https://github.com/InsightSoftwareConsortium/ITK -Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[cpp], openjpeg +Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc Feature: vtk Description: Build ITKVtkGlue module. -Build-Depends: vtk +Build-Depends: vtk[core] + +Feature: python +Description: Python functionality for ITK +Build-Depends: python3 + +Feature: opencl +Description: Use OpenCL +Build-Depends: opencl + +Feature: cufftw +Description: Use CUDA FFTW +Build-Depends: cuda + +Feature: cuda +Description: Build CUDA module +Build-Depends: cuda, itk[core, opencl] + +Feature: tbb +Description: Build TBB Module +Build-Depends: tbb + +Feature: rtk +Description: Build RTK Module + +Feature: tools +Description: Build RTK with tools +Build-Depends: itk[core, rtk] + diff --git a/ports/itk/cufftw.patch b/ports/itk/cufftw.patch new file mode 100644 index 00000000000000..17365fb2f1f0e3 --- /dev/null +++ b/ports/itk/cufftw.patch @@ -0,0 +1,58 @@ +From 0f47aae05217884193a39690c2beef566f4ed3b1 Mon Sep 17 00:00:00 2001 +From: Stephen Aylward +Date: Sat, 25 Apr 2020 20:15:21 -0400 +Subject: [PATCH] BUG: CUFFTW paths were not being set and unnecessary FFTW + files used + +FindFFTW sets the FFTW_INCLUDES variable. The FFTW_INCLUDE_PATH var is +specific to FFTW (not used by CUFFTW). + +FFTWGlobalConfiguration file is only needed if FFTW is being used, +not if CUFFT is being used. +--- + CMake/FindFFTW.cmake | 2 +- + Modules/Filtering/FFT/CMakeLists.txt | 2 +- + Modules/Filtering/FFT/src/CMakeLists.txt | 9 +++++---- + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake +index 785edc2b628..e1935899cab 100644 +--- a/CMake/FindFFTW.cmake ++++ b/CMake/FindFFTW.cmake +@@ -62,7 +62,7 @@ if(ITK_USE_FFTWD OR ITK_USE_FFTWF) + find_path(FFTW_INCLUDE_PATH fftw3.h ${FFTW_INC_SEARCHPATH}) + endif() + +- if(FFTW_INCLUDE_PATH) ++ if(FFTW_INCLUDE_PATH OR CUFFTW_INCLUDE_PATH) + if(ITK_USE_CUFFTW) + file(TO_CMAKE_PATH "${CUFFTW_INCLUDE_PATH}" CUFFTW_INCLUDE_PATH) + set(FFTW_INCLUDE ${CUFFTW_INCLUDE_PATH}) +diff --git a/Modules/Filtering/FFT/CMakeLists.txt b/Modules/Filtering/FFT/CMakeLists.txt +index 7d9d1900b56..713530149cb 100644 +--- a/Modules/Filtering/FFT/CMakeLists.txt ++++ b/Modules/Filtering/FFT/CMakeLists.txt +@@ -5,5 +5,5 @@ if(ITK_USE_CUFFTW) + else() + set(ITKFFT_LIBRARIES ITKFFT) + endif() +-set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE_PATH}) ++set(ITKFFT_INCLUDE_DIRS ${FFTW_INCLUDE}) + itk_module_impl() +diff --git a/Modules/Filtering/FFT/src/CMakeLists.txt b/Modules/Filtering/FFT/src/CMakeLists.txt +index 3f3137b8cd4..bde3ee906f8 100644 +--- a/Modules/Filtering/FFT/src/CMakeLists.txt ++++ b/Modules/Filtering/FFT/src/CMakeLists.txt +@@ -1,7 +1,8 @@ +-set(ITKFFT_SRCS +- itkFFTWGlobalConfiguration.cxx +- itkComplexToComplexFFTImageFilter.cxx +- ) ++set(ITKFFT_SRCS itkComplexToComplexFFTImageFilter.cxx) ++ ++if( ITK_USE_FFTWF OR ITK_USE_FFTWD AND NOT ITK_USE_CUFFTW) ++ list(APPEND ITKFFT_SRCS itkFFTWGlobalConfiguration.cxx ) ++endif() + + itk_module_add_library(ITKFFT ${ITKFFT_SRCS}) + diff --git a/ports/itk/double-conversion.patch b/ports/itk/double-conversion.patch new file mode 100644 index 00000000000000..636dd8c4c7d816 --- /dev/null +++ b/ports/itk/double-conversion.patch @@ -0,0 +1,16 @@ +diff --git a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt +index 16c611fd3..13978724c 100644 +--- a/Modules/ThirdParty/DoubleConversion/CMakeLists.txt ++++ b/Modules/ThirdParty/DoubleConversion/CMakeLists.txt +@@ -9,7 +9,10 @@ mark_as_advanced(ITK_USE_SYSTEM_DOUBLECONVERSION) + if(ITK_USE_SYSTEM_DOUBLECONVERSION) + find_package(double-conversion REQUIRED) + get_target_property(ITKDoubleConversion_INCLUDE_DIRS double-conversion::double-conversion INTERFACE_INCLUDE_DIRECTORIES) +- get_target_property(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion LOCATION) ++ get_target_property(ITKDoubleConversion_LIBRARY_RELEASE double-conversion::double-conversion LOCATION_RELEASE) ++ get_target_property(ITKDoubleConversion_LIBRARY_DEBUG double-conversion::double-conversion LOCATION_DEBUG) ++ include(SelectLibraryConfigurations) ++ select_library_configurations(ITKDoubleConversion) + else() + set(ITKDoubleConversion_INCLUDE_DIRS + ${ITKDoubleConversion_SOURCE_DIR}/src diff --git a/ports/itk/fix_libminc_config_path.patch b/ports/itk/fix_libminc_config_path.patch deleted file mode 100644 index 3ff305d4be9776..00000000000000 --- a/ports/itk/fix_libminc_config_path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -index 305b2c63..63f81a53 100644 ---- a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -+++ b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt -@@ -550,7 +550,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake - DESTINATION -- ${LIBMINC_INSTALL_LIB_DIR}/cmake -+ share/itk - COMPONENT Development) - ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) - diff --git a/ports/itk/fix_openjpeg_search.patch b/ports/itk/fix_openjpeg_search.patch deleted file mode 100644 index d17a1ab8405f03..00000000000000 --- a/ports/itk/fix_openjpeg_search.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -index 6ac16ab6..4638f13c 100644 ---- a/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -+++ b/Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt -@@ -373,7 +373,7 @@ else() - endif() - - if(GDCM_USE_SYSTEM_OPENJPEG) -- find_package(OpenJPEG 2.0.0 REQUIRED) -+ find_package(OpenJPEG REQUIRED) - set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) - else() - set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2) diff --git a/ports/itk/hdf5.patch b/ports/itk/hdf5.patch new file mode 100644 index 00000000000000..091594cda0e933 --- /dev/null +++ b/ports/itk/hdf5.patch @@ -0,0 +1,20 @@ +diff --git a/Modules/ThirdParty/HDF5/CMakeLists.txt b/Modules/ThirdParty/HDF5/CMakeLists.txt +index a700ecdfb..0a683a52b 100644 +--- a/Modules/ThirdParty/HDF5/CMakeLists.txt ++++ b/Modules/ThirdParty/HDF5/CMakeLists.txt +@@ -25,11 +25,11 @@ endif() + ") + endif() + +- set(ITKHDF5_LIBRARIES ) +- if(BUILD_SHARED_LIBS) +- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_SHARED_LIBRARY} ${HDF5_CXX_SHARED_LIBRARY}) ++ set(ITKHDF5_LIBRARIES) ++ if(HDF5_BUILD_SHARED_LIBS) ++ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-shared hdf5::hdf5-shared) + else() +- list(APPEND ITKHDF5_LIBRARIES ${HDF5_C_STATIC_LIBRARY} ${HDF5_CXX_STATIC_LIBRARY}) ++ list(APPEND ITKHDF5_LIBRARIES hdf5::hdf5_cpp-static hdf5::hdf5-static) + endif() + + set(ITKHDF5_INCLUDE_DIRS diff --git a/ports/itk/opencl.patch b/ports/itk/opencl.patch new file mode 100644 index 00000000000000..f935d09d40dade --- /dev/null +++ b/ports/itk/opencl.patch @@ -0,0 +1,176 @@ +diff --git a/Modules/Core/GPUCommon/CMakeLists.txt b/Modules/Core/GPUCommon/CMakeLists.txt +index da2d66b63..6fb476680 100644 +--- a/Modules/Core/GPUCommon/CMakeLists.txt ++++ b/Modules/Core/GPUCommon/CMakeLists.txt +@@ -24,9 +24,13 @@ if(ITK_USE_GPU AND APPLE AND NOT ITK_COMPILER_HAS_BLOCKS) + endif() + + if(ITK_USE_GPU) ++ message(STATUS "OPENCL_LIBRARIES:${OPENCL_LIBRARIES}") ++ if(TARGET OpenCL::OpenCL) ++ message(STATUS "OPENCL_LIBRARIES:${OpenCL_LIBRARIES}") ++ endif() + set(ITKGPUCommon_LIBRARIES ITKGPUCommon) +- set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUCommon_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUCommon_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Core/GPUCommon/src/CMakeLists.txt b/Modules/Core/GPUCommon/src/CMakeLists.txt +index 0b39f2a9a..160f7a752 100644 +--- a/Modules/Core/GPUCommon/src/CMakeLists.txt ++++ b/Modules/Core/GPUCommon/src/CMakeLists.txt +@@ -14,5 +14,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUCommon_Kernels}" ITKGPUCommon_SRCS) + + itk_module_add_library(ITKGPUCommon ${ITKGPUCommon_SRCS}) +- target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUCommon LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Core/GPUFiniteDifference/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/CMakeLists.txt +index c1bfde450..a642d9230 100644 +--- a/Modules/Core/GPUFiniteDifference/CMakeLists.txt ++++ b/Modules/Core/GPUFiniteDifference/CMakeLists.txt +@@ -9,8 +9,8 @@ if(NOT ITK_SOURCE_DIR) + endif() + + if (ITK_USE_GPU) +- set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUFiniteDifference_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUFiniteDifference_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + set(ITKGPUFiniteDifference_LIBRARIES ITKGPUFiniteDifference) + endif() + +diff --git a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt +index 8425cc025..8335c69a0 100644 +--- a/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt ++++ b/Modules/Core/GPUFiniteDifference/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUFiniteDifference_Kernels}" ITKGPUFiniteDifference_SRCS) + + itk_module_add_library(ITKGPUFiniteDifference ${ITKGPUFiniteDifference_SRCS}) +- target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUFiniteDifference LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt +index f36fd887d..310d983fa 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUAnisotropicSmoothing_LIBRARIES ITKGPUAnisotropicSmoothing) +- set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUAnisotropicSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUAnisotropicSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt +index 078905521..67fd7b832 100644 +--- a/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt ++++ b/Modules/Filtering/GPUImageFilterBase/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUImageFilterBase_LIBRARIES ITKGPUImageFilterBase) +- set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUImageFilterBase_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUImageFilterBase_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt +index 251493f5e..6d33fa964 100644 +--- a/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUImageFilterBase/src/CMakeLists.txt +@@ -10,5 +10,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUImageFilterBase_Kernels}" ITKGPUImageFilterBase_SRCS) + + itk_module_add_library(ITKGPUImageFilterBase ${ITKGPUImageFilterBase_SRCS}) +- target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUImageFilterBase LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUSmoothing/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/CMakeLists.txt +index 9bac40921..2ed493d40 100644 +--- a/Modules/Filtering/GPUSmoothing/CMakeLists.txt ++++ b/Modules/Filtering/GPUSmoothing/CMakeLists.txt +@@ -10,8 +10,8 @@ endif() + + if (ITK_USE_GPU) + set(ITKGPUSmoothing_LIBRARIES ITKGPUSmoothing) +- set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUSmoothing_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUSmoothing_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + if(NOT ITK_SOURCE_DIR) +diff --git a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt +index d2120e842..2c6ca4a4a 100644 +--- a/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUSmoothing/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUSmoothing_Kernels}" ITKGPUSmoothing_SRCS) + + itk_module_add_library(ITKGPUSmoothing ${ITKGPUSmoothing_SRCS}) +- target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUSmoothing LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Filtering/GPUThresholding/CMakeLists.txt b/Modules/Filtering/GPUThresholding/CMakeLists.txt +index 4390785f5..61786b7a8 100644 +--- a/Modules/Filtering/GPUThresholding/CMakeLists.txt ++++ b/Modules/Filtering/GPUThresholding/CMakeLists.txt +@@ -2,8 +2,8 @@ project(ITKGPUThresholding) + + if (ITK_USE_GPU) + set(ITKGPUThresholding_LIBRARIES ITKGPUThresholding) +- set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUThresholding_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUThresholding_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + itk_module_impl() +diff --git a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt +index 326c86859..c07c80414 100644 +--- a/Modules/Filtering/GPUThresholding/src/CMakeLists.txt ++++ b/Modules/Filtering/GPUThresholding/src/CMakeLists.txt +@@ -9,5 +9,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUThresholding_Kernels}" ITKGPUThresholding_SRCS) + + itk_module_add_library(ITKGPUThresholding ${ITKGPUThresholding_SRCS}) +- target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUThresholding LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() +diff --git a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt +index c8d70a423..097c974c5 100644 +--- a/Modules/Registration/GPUPDEDeformable/CMakeLists.txt ++++ b/Modules/Registration/GPUPDEDeformable/CMakeLists.txt +@@ -2,8 +2,8 @@ project(ITKGPUPDEDeformableRegistration) + + if (ITK_USE_GPU) + set(ITKGPUPDEDeformableRegistration_LIBRARIES ITKGPUPDEDeformableRegistration) +- set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS}) +- set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OPENCL_LIBRARIES}) ++ set(ITKGPUPDEDeformableRegistration_SYSTEM_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) ++ set(ITKGPUPDEDeformableRegistration_SYSTEM_LIBRARY_DIRS ${OpenCL_LIBRARIES}) + endif() + + itk_module_impl() +diff --git a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt +index 28b1d194c..1a049bdde 100644 +--- a/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt ++++ b/Modules/Registration/GPUPDEDeformable/src/CMakeLists.txt +@@ -10,5 +10,5 @@ if (ITK_USE_GPU) + write_gpu_kernels("${ITKGPUPDEDeformableRegistration_Kernels}" ITKGPUPDEDeformableRegistration_SRCS) + + itk_module_add_library(ITKGPUPDEDeformableRegistration ${ITKGPUPDEDeformableRegistration_SRCS}) +- target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OPENCL_LIBRARIES}) ++ target_link_libraries(ITKGPUPDEDeformableRegistration LINK_PUBLIC ${OpenCL_LIBRARIES}) + endif() diff --git a/ports/itk/openjpeg.patch b/ports/itk/openjpeg.patch new file mode 100644 index 00000000000000..0fe1f34c9c097c --- /dev/null +++ b/ports/itk/openjpeg.patch @@ -0,0 +1,548 @@ +diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +index 1b1fe9526..0da4aa0c4 100644 +--- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx ++++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +@@ -26,9 +26,9 @@ + + extern "C" + { +-#include "openjpeg.h" +-#include "j2k.h" +-#include "jp2.h" ++#include ++//#include "j2k.h" ++//##include "jp2.h" + } + + +@@ -62,8 +62,7 @@ public: + OPJ_UINT32 m_TileStartX; + OPJ_UINT32 m_TileStartY; + +- OPJ_UINT32 m_NumberOfTilesInX; +- OPJ_UINT32 m_NumberOfTilesInY; ++ OPJ_UINT32 m_NumberOfTiles; + + opj_dparameters_t m_DecompressionParameters; /* decompression parameters */ + }; +@@ -86,8 +85,7 @@ JPEG2000ImageIO::JPEG2000ImageIO() + this->m_Internal->m_TileStartX = 0; + this->m_Internal->m_TileStartY = 0; + +- this->m_Internal->m_NumberOfTilesInX = 0; +- this->m_Internal->m_NumberOfTilesInY = 0; ++ this->m_Internal->m_NumberOfTiles = 0; + + const char * extensions[] = { ".j2k", ".jp2", ".jpt" }; + +@@ -139,22 +137,16 @@ JPEG2000ImageIO::ReadImageInformation() + { + itkDebugMacro(<< "ReadImageInformation()"); + +- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); +- +- /* decompression parameters */ ++ /* set decoding parameters to default values */ ++ opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); + +- if (!l_file) ++ opj_stream_t * cio = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); ++ if (!cio) + { + itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl + << "Reason: " + << itksys::SystemTools::GetLastSystemError()); + } +- +- /* set decoding parameters to default values */ +- opj_set_default_decoder_parameters(&(this->m_Internal->m_DecompressionParameters)); +- +- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, true); +- + this->m_Internal->m_Dinfo = nullptr; /* handle to a decompressor */ + + opj_image_t * l_image = nullptr; +@@ -187,14 +179,14 @@ JPEG2000ImageIO::ReadImageInformation() + /* JPEG-2000 codestream */ + + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); + } + break; + } +@@ -202,14 +194,14 @@ JPEG2000ImageIO::ReadImageInformation() + { + /* JPEG 2000 compressed image data */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); + } + break; + } +@@ -217,20 +209,19 @@ JPEG2000ImageIO::ReadImageInformation() + { + /* JPEG 2000, JPIP */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); + if (!this->m_Internal->m_Dinfo) + { + opj_stream_destroy(cio); +- fclose(l_file); ++ // fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); + } + break; + } + default: + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl + << "Reason: " +@@ -247,27 +238,11 @@ JPEG2000ImageIO::ReadImageInformation() + << "Reason: opj_setup_decoder returns false"); + } + +- // Image parameters - first tile +- OPJ_INT32 l_tile_x0; +- OPJ_INT32 l_tile_y0; + +- // Image parameters - tile width, height and number of tiles +- OPJ_UINT32 l_tile_width; +- OPJ_UINT32 l_tile_height; +- OPJ_UINT32 l_nb_tiles_x; +- OPJ_UINT32 l_nb_tiles_y; + + itkDebugMacro(<< "Trying to read header now..."); + +- bResult = opj_read_header(this->m_Internal->m_Dinfo, +- &l_image, +- &l_tile_x0, +- &l_tile_y0, +- &l_tile_width, +- &l_tile_height, +- &l_nb_tiles_x, +- &l_nb_tiles_y, +- cio); ++ bResult = opj_read_header(cio, this->m_Internal->m_Dinfo, &l_image); + + if (!bResult) + { +@@ -283,14 +258,22 @@ JPEG2000ImageIO::ReadImageInformation() + << "Reason: Error whle reading image header"); + } + ++ // Image parameters - first tile ++ OPJ_INT32 l_tile_x0=l_image->x0; ++ OPJ_INT32 l_tile_y0=l_image->y0; ++ ++ // Image parameters - tile width, height and number of tiles ++ OPJ_UINT32 l_tile_width=l_image->x1; ++ OPJ_UINT32 l_tile_height=l_image->y1; ++ OPJ_UINT32 l_nb_tiles=l_image->numcomps; ++ + this->m_Internal->m_TileStartX = l_tile_x0; + this->m_Internal->m_TileStartY = l_tile_y0; + + this->m_Internal->m_TileWidth = l_tile_width; + this->m_Internal->m_TileHeight = l_tile_height; + +- this->m_Internal->m_NumberOfTilesInX = l_nb_tiles_x; +- this->m_Internal->m_NumberOfTilesInY = l_nb_tiles_y; ++ this->m_Internal->m_NumberOfTiles = l_nb_tiles; + + + itkDebugMacro(<< "Number of Components = " << l_image->numcomps); +@@ -319,7 +302,7 @@ JPEG2000ImageIO::ReadImageInformation() + this->SetPixelType(IOPixelEnum::SCALAR); + break; + case 3: +- if (l_image->color_space != CLRSPC_SRGB) ++ if (l_image->color_space != OPJ_CLRSPC_SRGB) + { + itkWarningMacro(<< "file does not specify color space, assuming sRGB"); + } +@@ -335,8 +318,7 @@ JPEG2000ImageIO::ReadImageInformation() + itkDebugMacro(<< "Tile Start Y = " << this->m_Internal->m_TileStartY); + itkDebugMacro(<< "Tile Width = " << this->m_Internal->m_TileWidth); + itkDebugMacro(<< "Tile Height = " << this->m_Internal->m_TileHeight); +- itkDebugMacro(<< "Number of Tiles X = " << this->m_Internal->m_NumberOfTilesInX); +- itkDebugMacro(<< "Number of Tiles Y = " << this->m_Internal->m_NumberOfTilesInY); ++ itkDebugMacro(<< "Number of Tiles = " << this->m_Internal->m_NumberOfTiles); + + itkDebugMacro(<< "image->x1 = " << l_image->x1); + itkDebugMacro(<< "image->y1 = " << l_image->y1); +@@ -349,7 +331,6 @@ JPEG2000ImageIO::ReadImageInformation() + + /* close the byte stream */ + opj_stream_destroy(cio); +- fclose(l_file); + + if (this->m_Internal->m_Dinfo) + { +@@ -368,16 +349,7 @@ JPEG2000ImageIO::Read(void * buffer) + { + itkDebugMacro(<< "JPEG2000ImageIO::Read() Begin"); + +- FILE * l_file = fopen(this->m_FileName.c_str(), "rb"); +- +- if (!l_file) +- { +- itkExceptionMacro("JPEG2000ImageIO failed to open file for reading: " << this->GetFileName() << std::endl +- << "Reason: " +- << itksys::SystemTools::GetLastSystemError()); +- } +- +- opj_stream_t * l_stream = opj_stream_create_default_file_stream(l_file, true); ++ opj_stream_t * l_stream = opj_stream_create_default_file_stream(this->m_FileName.c_str(), true); + if (!l_stream) + { + itkExceptionMacro("JPEG2000ImageIO failed to read file: " +@@ -397,12 +369,13 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG-2000 codestream */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_J2K); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_J2K) returns nullptr"); + } + break; + } +@@ -410,12 +383,13 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG 2000 compressed image data */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JP2); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JP2) returns nullptr"); + } + break; + } +@@ -423,17 +397,18 @@ JPEG2000ImageIO::Read(void * buffer) + { + /* JPEG 2000, JPIP */ + /* get a decoder handle */ +- this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); ++ this->m_Internal->m_Dinfo = opj_create_decompress(OPJ_CODEC_JPT); + if (!this->m_Internal->m_Dinfo) + { ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_decompress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_decompress(OPJ_CODEC_JPT) returns nullptr"); + } + break; + } + default: +- fclose(l_file); ++ opj_stream_destroy(l_stream); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " + << this->GetFileName() << std::endl + << "Reason: " +@@ -448,29 +423,13 @@ JPEG2000ImageIO::Read(void * buffer) + << "Reason: opj_setup_decoder returns false"); + } + +- OPJ_INT32 l_tile_x0, l_tile_y0; +- +- OPJ_UINT32 l_tile_width; +- OPJ_UINT32 l_tile_height; +- OPJ_UINT32 l_nb_tiles_x; +- OPJ_UINT32 l_nb_tiles_y; +- +- bool bResult = opj_read_header(this->m_Internal->m_Dinfo, +- &l_image, +- &l_tile_x0, +- &l_tile_y0, +- &l_tile_width, +- &l_tile_height, +- &l_nb_tiles_x, +- &l_nb_tiles_y, +- l_stream); ++ bool bResult = opj_read_header(l_stream, this->m_Internal->m_Dinfo,&l_image); + + if (!bResult) + { + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: opj_read_header returns false"); + } +@@ -499,7 +458,7 @@ JPEG2000ImageIO::Read(void * buffer) + itkDebugMacro(<< "p_end_x = " << p_end_x); + itkDebugMacro(<< "p_end_y = " << p_end_y); + +- bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, p_start_x, p_start_y, p_end_x, p_end_y); ++ bResult = opj_set_decode_area(this->m_Internal->m_Dinfo, l_image, p_start_x, p_start_y, p_end_x, p_end_y); + + itkDebugMacro(<< "opj_set_decode_area() after"); + +@@ -508,7 +467,6 @@ JPEG2000ImageIO::Read(void * buffer) + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: opj_set_decode_area returns false"); + } +@@ -525,13 +483,13 @@ JPEG2000ImageIO::Read(void * buffer) + + OPJ_UINT32 l_max_data_size = 1000; + +- bool l_go_on = true; ++ int l_go_on = true; // should be OBJ_BOOL + + auto * l_data = (OPJ_BYTE *)malloc(1000); + + while (l_go_on) + { +- bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, ++ bool tileHeaderRead = opj_read_tile_header(this->m_Internal->m_Dinfo, l_stream, + &l_tile_index, + &l_data_size, + &l_current_tile_x0, +@@ -539,14 +497,12 @@ JPEG2000ImageIO::Read(void * buffer) + &l_current_tile_x1, + &l_current_tile_y1, + &l_nb_comps, +- &l_go_on, +- l_stream); ++ &l_go_on); + + if (!tileHeaderRead) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -571,7 +527,6 @@ JPEG2000ImageIO::Read(void * buffer) + if (!l_data) + { + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -590,7 +545,6 @@ JPEG2000ImageIO::Read(void * buffer) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -654,7 +608,6 @@ JPEG2000ImageIO::Read(void * buffer) + { + free(l_data); + opj_stream_destroy(l_stream); +- fclose(l_file); + opj_destroy_codec(this->m_Internal->m_Dinfo); + opj_image_destroy(l_image); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl +@@ -666,14 +619,12 @@ JPEG2000ImageIO::Read(void * buffer) + opj_destroy_codec(this->m_Internal->m_Dinfo); + this->m_Internal->m_Dinfo = nullptr; + opj_stream_destroy(l_stream); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to read file: " << this->GetFileName() << std::endl + << "Reason: error whle reading image"); + } + + /* close the byte stream */ + opj_stream_destroy(l_stream); +- fclose(l_file); + + if (this->m_Internal->m_Dinfo) + { +@@ -840,13 +791,13 @@ JPEG2000ImageIO ::Write(const void * buffer) + + parameters.numresolution = numberOfResolutions; + +- OPJ_COLOR_SPACE color_space = CLRSPC_GRAY; ++ OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; + opj_image_cmptparm_t cmptparms[3]; + + if (this->GetNumberOfComponents() == 3) + { + +- color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? CLRSPC_SRGB : CLRSPC_UNSPECIFIED; ++ color_space = (this->GetPixelType() == IOPixelEnum::RGB) ? OPJ_CLRSPC_SRGB : OPJ_CLRSPC_UNSPECIFIED; + + /* initialize image components */ + memset(&cmptparms[0], 0, 3 * sizeof(opj_image_cmptparm_t)); +@@ -864,7 +815,7 @@ JPEG2000ImageIO ::Write(const void * buffer) + + if (this->GetNumberOfComponents() == 1) + { +- color_space = CLRSPC_GRAY; ++ color_space = OPJ_CLRSPC_GRAY; + + /* initialize image components */ + memset(&cmptparms[0], 0, sizeof(opj_image_cmptparm_t)); +@@ -940,32 +891,32 @@ JPEG2000ImageIO ::Write(const void * buffer) + opj_codec_t * cinfo = nullptr; + if (extension == ".j2k") + { +- cinfo = opj_create_compress(CODEC_J2K); ++ cinfo = opj_create_compress(OPJ_CODEC_J2K); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_J2K) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_J2K) returns nullptr"); + } + } + else if (extension == ".jp2") + { +- cinfo = opj_create_compress(CODEC_JP2); ++ cinfo = opj_create_compress(OPJ_CODEC_JP2); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_JP2) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_JP2) returns nullptr"); + } + } + else if (extension == ".jpt") + { +- cinfo = opj_create_compress(CODEC_JPT); ++ cinfo = opj_create_compress(OPJ_CODEC_JPT); + if (!cinfo) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " + << this->GetFileName() << std::endl +- << "Reason: opj_create_compress(CODEC_JPT) returns nullptr"); ++ << "Reason: opj_create_compress(OPJ_CODEC_JPT) returns nullptr"); + } + } + else +@@ -989,17 +940,9 @@ JPEG2000ImageIO ::Write(const void * buffer) + << "Reason: opj_setup_encoder returns false"); + } + +- FILE * l_file = fopen(parameters.outfile, "wb"); +- if (!l_file) +- { +- itkExceptionMacro("JPEG2000ImageIO failed to open file for writing: " << this->GetFileName() << std::endl +- << "Reason: " +- << itksys::SystemTools::GetLastSystemError()); +- } +- + /* open a byte stream for writing */ + /* allocate memory for all tiles */ +- opj_stream_t * cio = opj_stream_create_default_file_stream(l_file, false); ++ opj_stream_t * cio = opj_stream_create_default_file_stream(parameters.outfile, false); + if (!cio) + { + itkExceptionMacro("JPEG2000ImageIO failed to write file: " +@@ -1017,8 +960,7 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); +- itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl ++ itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_start_compress returns false"); + } + +@@ -1026,7 +968,6 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_encode returns false"); + } +@@ -1035,14 +976,12 @@ JPEG2000ImageIO ::Write(const void * buffer) + if (!bSuccess) + { + opj_stream_destroy(cio); +- fclose(l_file); + itkExceptionMacro("JPEG2000ImageIO failed to write file: " << this->GetFileName() << std::endl + << "Reason: opj_end_compress returns false"); + } + + /* close and free the byte stream */ + opj_stream_destroy(cio); +- fclose(l_file); + + /* free remaining compression structures */ + opj_destroy_codec(cinfo); +diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +index 103eaa9dd..eb8989135 100644 +--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +@@ -1,12 +1,25 @@ + project(ITKOpenJPEG) + set(ITKOpenJPEG_THIRD_PARTY 1) + +-set(ITKOpenJPEG_INCLUDE_DIRS +- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg +- ) +-set(ITKOpenJPEG_LIBRARIES itkopenjpeg) +-set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) ++if(ITK_USE_SYSTEM_OpenJPEG) ++ find_package(OpenJPEG REQUIRED) ++ if(TARGET openjp2) ++ set(ITKOpenJPEG_LIBRARIES ${OPENJPEG_LIBRARIES}) ++ else() ++ message(FATAL_ERROR "OpenJPEG target openjp2 missing!") ++ endif() ++ set(ITKOpenJPEG_INCLUDE_DIRS ++ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ ) ++else() ++ set(ITKOpenJPEG_INCLUDE_DIRS ++ ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ ) ++ set(ITKOpenJPEG_LIBRARIES itkopenjpeg) ++ set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) ++endif() + + itk_module_impl() + diff --git a/ports/itk/openjpeg2.patch b/ports/itk/openjpeg2.patch new file mode 100644 index 00000000000000..86631f5f99b2db --- /dev/null +++ b/ports/itk/openjpeg2.patch @@ -0,0 +1,58 @@ +diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt +index 565cc338b..c061f0721 100644 +--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt ++++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/CMakeLists.txt +@@ -194,7 +194,7 @@ mark_as_advanced(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) ++set(MANGLE_PREFIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in + ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h + @ONLY) +diff --git a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt +index c4adb91a2..89b731d88 100644 +--- a/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt ++++ b/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt +@@ -3,7 +3,7 @@ include_regular_expression("^.*$") + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX ${OPENJPEG_LIBRARY_NAME}) ++set(MANGLE_PREFIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/openjpeg_mangle.h.in + ${CMAKE_CURRENT_BINARY_DIR}/openjpeg_mangle.h + @ONLY) +diff --git a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +index 3811e52f4..a41e9264e 100644 +--- a/Modules/ThirdParty/OpenJPEG/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/CMakeLists.txt +@@ -8,10 +8,10 @@ if(ITK_USE_SYSTEM_OpenJPEG) + else() + message(FATAL_ERROR "OpenJPEG target openjp2 missing!") + endif() +- set(ITKOpenJPEG_INCLUDE_DIRS +- ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +- ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg +- ) ++ # set(ITKOpenJPEG_INCLUDE_DIRS ++ # ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg ++ # ${ITKOpenJPEG_SOURCE_DIR}/src/openjpeg ++ # ) + else() + set(ITKOpenJPEG_INCLUDE_DIRS + ${ITKOpenJPEG_BINARY_DIR}/src/openjpeg +diff --git a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt +index e62e43eda..35dc89976 100644 +--- a/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt ++++ b/Modules/ThirdParty/OpenJPEG/src/openjpeg/CMakeLists.txt +@@ -68,7 +68,7 @@ CONFIGURE_FILE(${ITK3P_OpenJPEG_SOURCE_DIR}/opj_configure.h.in + # configure name mangling to allow multiple libraries to coexist + # peacefully + if(EXISTS ${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in) +-set(MANGLE_PREFIX itk) ++#set(MANGLE_PREFIX itk) + configure_file(${ITK3P_OpenJPEG_SOURCE_DIR}/openjpeg_mangle.h.in + ${ITK3P_OpenJPEG_BINARY_DIR}/openjpeg_mangle.h + @ONLY) diff --git a/ports/itk/portfile.cmake b/ports/itk/portfile.cmake index a666b57132051c..b16ba194aa83ac 100644 --- a/ports/itk/portfile.cmake +++ b/ports/itk/portfile.cmake @@ -1,22 +1,129 @@ -include(vcpkg_common_functions) - vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO InsightSoftwareConsortium/ITK - REF v5.0.1 - SHA512 242ce66cf83f82d26f20d2099108295e28c8875e7679126ba023834bf0e94454460ba86452a94c8ddaea93d2314befc399f2b151d7294370d4b47f0e9798e77f + REF d3286c9cc04ba16cc8f73de9a98fbcd7c02f3c7b + SHA512 c358449870d580aeb10e32f8be0ca39e8a76d8dc06fda973788fafb5971333e546611c399190be49d40f5f3c18a1105d9699eef271a560aff25ce168a396926e HEAD_REF master PATCHES - fix_openjpeg_search.patch - fix_libminc_config_path.patch + hdf5.patch + double-conversion.patch + openjpeg.patch + openjpeg2.patch + var_libraries.patch + wrapping.patch + python_gpu_wrapping.patch + opencl.patch + cufftw.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "vtk" Module_ITKVtkGlue + "cuda" Module_ITKCudaCommon # Requires RTK? + #"cuda" CUDA_HAVE_GPU # Automatically set by FindCUDA? + "cufftw" ITK_USE_CUFFTW + "opencl" ITK_USE_GPU + "tbb" Module_ITKTBB + "rtk" Module_RTK + "tools" RTK_BUILD_APPLICATIONS + # There are a lot of more (remote) modules and options in ITK + # feel free to add those as a feature ) -if ("vtk" IN_LIST FEATURES) - set(ITKVtkGlue ON) -else() - set(ITKVtkGlue OFF) +if("cufftw" IN_LIST FEATURES) + # Alternativly set CUFFT_LIB and CUFFTW_LIB + if(WIN32) + file(TO_CMAKE_PATH "$ENV{CUDA_PATH}" CUDA_PATH) + set(CUDA_LIB_PATH "${CUDA_PATH}") + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + string(APPEND CUDA_LIB_PATH "/lib/x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + string(APPEND CUDA_LIB_PATH "/lib/Win32") + message(FATAL_ERROR "CUFFTW is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") + else() + message(FATAL_ERROR "Architecture ${VCPKG_TARGET_ARCHITECTURE} not supported !") + endif() + + list(APPEND ADDITIONAL_OPTIONS + "-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}" + "-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include" + "-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include" + ) + endif() +endif() + +if("rtk" IN_LIST FEATURES) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + message(FATAL_ERROR "RTK is not supported on architecture ${VCPKG_TARGET_ARCHITECTURE}") + endif() + SET(BUILD_RTK ON) + list(APPEND ADDITIONAL_OPTIONS + "-DModule_RTK_GIT_TAG=8099212f715231d093f7d6a1114daecf45d871ed" # RTK latest versions (11.05.2020) + ) + if("cuda" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS "-DRTK_USE_CUDA=ON") + #RTK + CUDA + PYTHON + dynamic library linkage will fail and needs upstream fixes. + endif() +endif() +file(REMOVE_RECURSE "${SOURCE_PATH}/Modules/Remote/RTK") + +if("opencl" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS # Wrapping options required by OpenCL if build with Python Wrappers + -DITK_WRAP_unsigned_long_long=ON + -DITK_WRAP_signed_long_long=ON + ) +endif() +if("tools" IN_LIST FEATURES) + + if("rtk" IN_LIST FEATURES) + list(APPEND TOOL_NAMES rtkadmmtotalvariation rtkadmmwavelets rtkamsterdamshroud rtkbackprojections rtkbioscangeometry rtkcheckimagequality rtkconjugategradient + rtkdigisensgeometry rtkdrawgeometricphantom rtkdrawshepploganphantom rtkdualenergysimplexdecomposition rtkelektasynergygeometry rtkextractphasesignal + rtkextractshroudsignal rtkfdk rtkfdktwodweights rtkfieldofview rtkforwardprojections rtkfourdconjugategradient rtkfourdfdk rtkfourdrooster rtkfourdsart + rtkgaincorrection rtki0estimation rtkimagxgeometry rtkiterativefdk rtklagcorrection rtklastdimensionl0gradientdenoising rtklut rtkmaskcollimation rtkmcrooster + rtkmotioncompensatedfourdconjugategradient rtkorageometry rtkosem rtkoverlayphaseandshroud rtkparkershortscanweighting rtkprojectgeometricphantom + rtkprojectionmatrix rtkprojections rtkprojectshepploganphantom rtkramp rtkrayboxintersection rtkrayquadricintersection rtkregularizedconjugategradient + rtksart rtkscatterglarecorrection rtksimulatedgeometry rtkspectraldenoiseprojections rtkspectralforwardmodel rtkspectralonestep rtkspectralrooster rtkspectralsimplexdecomposition + rtksubselect rtktotalnuclearvariationdenoising rtktotalvariationdenoising rtktutorialapplication rtkvarianobigeometry rtkvarianprobeamgeometry rtkvectorconjugategradient + rtkwangdisplaceddetectorweighting rtkwarpedbackprojectsequence rtkwarpedforwardprojectsequence rtkwaveletsdenoising rtkxradgeometry) + endif() +endif() +if("vtk" IN_LIST FEATURES) + vcpkg_find_acquire_program(PYTHON3) + list(APPEND ADDITIONAL_OPTIONS + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by mvtk if vtk[python] was build + ) +endif() +if("python" IN_LIST FEATURES) + message(STATUS "${PORT} builds a long time (>1h) with python wrappers enabled!") + vcpkg_find_acquire_program(PYTHON3) + vcpkg_find_acquire_program(SWIG) # Swig is only required for wrapping! + get_filename_component(SWIG_DIR "${SWIG}" DIRECTORY) + list(APPEND ADDITIONAL_OPTIONS + -DITK_WRAP_PYTHON=ON + -DPython3_FIND_REGISTRY=NEVER + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature + "-DSWIG_EXECUTABLE=${SWIG}" + "-DSWIG_DIR=${SWIG_DIR}" + ) + # Due to ITKs internal shenanigans with the variables ...... + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib" + "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib" + "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8") + list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib") + list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib") + elseif(VCPKG_TARGET_IS_LINUX) + list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a" + "-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a" + "-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m") + list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a") + list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a") + elseif(VCPKG_TARGET_IS_OSX) + #Need Python3 information on OSX within VCPKG + endif() + #ITK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages within vcpkg endif() set(USE_64BITS_IDS OFF) @@ -24,6 +131,7 @@ if (VCPKG_TARGET_ARCHITECTURE STREQUAL x64 OR VCPKG_TARGET_ARCHITECTURE STREQUAL set(USE_64BITS_IDS ON) endif() +file(REMOVE_RECURSE "${SOURCE_PATH}/CMake/FindOpenCL.cmake") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -31,7 +139,10 @@ vcpkg_configure_cmake( OPTIONS -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF + -DBUILD_PKGCONFIG_FILES=OFF + -DITK_DOXYGEN_HTML=OFF -DDO_NOT_INSTALL_ITK_TEST_DRIVER=ON + -DITK_SKIP_PATH_LENGTH_CHECKS=ON -DITK_INSTALL_DATA_DIR=share/itk/data -DITK_INSTALL_DOC_DIR=share/itk/doc -DITK_INSTALL_PACKAGE_DIR=share/itk @@ -45,31 +156,58 @@ vcpkg_configure_cmake( -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_EIGEN=ON - # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break - -DITK_FORBID_DOWNLOADS=OFF - - -DITK_SKIP_PATH_LENGTH_CHECKS=ON - - # I haven't tried Python wrapping in vcpkg - #-DITK_WRAP_PYTHON=ON - #-DITK_PYTHON_VERSION=3 + -DITK_USE_SYSTEM_FFTW=ON + -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past and still is. ITK still has not figured out how to do it correctly! + -DITK_USE_SYSTEM_GDCM=ON + -DITK_USE_SYSTEM_OpenJPEG=ON # Added by VCPKG + -DITK_USE_SYSTEM_DCMTK=ON + -DDCMTK_USE_ICU=ON + -DITK_USE_SYSTEM_ICU=ON + #-DITK_USE_SYSTEM_VXL=ON + #-DITK_USE_SYSTEM_CASTXML=ON # needs to be added to vcpkg_find_acquire_program https://data.kitware.com/api/v1/file/hashsum/sha512/b8b6f0aff11fe89ab2fcd1949cc75f2c2378a7bc408827a004396deb5ff5a9976bffe8a597f8db1b74c886ea39eb905e610dce8f5bd7586a4d6c196d7349da8d/download + -DITK_USE_SYSTEM_MINC=ON + -DITK_USE_SYSTEM_SWIG=ON + -DITK_FORBID_DOWNLOADS=OFF # This should be turned on some day, however for now ITK does download specific versions so it shouldn't spontaneously break. Remote Modules would probably break with this! + -DINSTALL_GTEST=OFF + -DITK_USE_SYSTEM_GOOGLETEST=ON + -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} + + # TODO + #-DVXL_USE_GEOTIFF=ON + -DVXL_USE_LFS=ON + + -DITK_MINIMUM_COMPLIANCE_LEVEL:STRING=1 # To Display all remote modules within cmake-gui + #-DModule_IOSTL=ON # example how to turn on a non-default module + #-DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module + #-DModule_RLEImage=ON # example how to turn on a remote module + + # Some additional wraping options + #-DITK_WRAP_double=ON + #-DITK_WRAP_complex_double=ON + #-DITK_WRAP_covariant_vector_double=ON + #-DITK_WRAP_vector_double=ON - -DITK_USE_SYSTEM_HDF5=ON # HDF5 was problematic in the past - -DModule_ITKVtkGlue=${ITKVtkGlue} # optional feature - - -DModule_IOSTL=ON # example how to turn on a non-default module - -DModule_MorphologicalContourInterpolation=ON # example how to turn on a remote module - -DModule_RLEImage=ON # example how to turn on a remote module - -DGDCM_USE_SYSTEM_OPENJPEG=ON #Use port openjpeg instead of own third-party + ${FEATURE_OPTIONS} ${ADDITIONAL_OPTIONS} + + OPTIONS_DEBUG ${OPTIONS_DEBUG} + OPTIONS_RELEASE ${OPTIONS_RELEASE} ) - +if(BUILD_RTK) # Remote Modules are only downloaded on configure. + # TODO: In the future try to download via vcpkg_from_github and move the files. That way patching does not need this workaround + vcpkg_apply_patches(SOURCE_PATH "${SOURCE_PATH}/Modules/Remote/RTK" QUIET PATCHES rtk/already_defined.patch rtk/unresolved.patch) +endif() vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/itk/python_gpu_wrapping.patch b/ports/itk/python_gpu_wrapping.patch new file mode 100644 index 00000000000000..37367d979e0fb8 --- /dev/null +++ b/ports/itk/python_gpu_wrapping.patch @@ -0,0 +1,178 @@ +diff --git a/CMake/itkOpenCL.cmake b/CMake/itkOpenCL.cmake +index 0ccbe144d..fa381524f 100644 +--- a/CMake/itkOpenCL.cmake ++++ b/CMake/itkOpenCL.cmake +@@ -48,7 +48,7 @@ if(ITK_USE_GPU) + ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE} + PROPERTIES GENERATED ON) +- set(${SRC_VAR} ${${SRC_VAR}} ${OUTPUT_FILE}) ++ set(${SRC_VAR} ${${SRC_VAR}} ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}) + endmacro() + + macro(write_gpu_kernels GPUKernels GPU_SRC) +diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h +index 1816f722a..3a6a8aee5 100644 +--- a/Modules/Core/Common/include/itkMacro.h ++++ b/Modules/Core/Common/include/itkMacro.h +@@ -1141,7 +1141,7 @@ compilers. + #define itkGetVectorMacro(name, type, count) \ + virtual type * Get##name() const { return this->m_##name; } + +-/**\def itkGPUKernelClassMacro ++/**\def class itkGPUKernelClassMacro + * Construct a non-templatized helper class that + * provides the GPU kernel source code as a const char* + */ +@@ -1150,7 +1150,7 @@ compilers. + * Workaround KWstyle bug \ \ + * \ingroup ITKCommon \ \ + */ \ +- class kernel \ ++ kernel \ + { \ + public: \ + static const char * \ +diff --git a/Modules/Core/GPUCommon/include/itkGPUImageOps.h b/Modules/Core/GPUCommon/include/itkGPUImageOps.h +index f4eb8f33b..fbdf3d757 100644 +--- a/Modules/Core/GPUCommon/include/itkGPUImageOps.h ++++ b/Modules/Core/GPUCommon/include/itkGPUImageOps.h +@@ -23,7 +23,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUImageOps */ +-itkGPUKernelClassMacro(GPUImageOpsKernel); ++class itkGPUKernelClassMacro(GPUImageOpsKernel); + + /** \class GPUImageOps + * +diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.h b/Modules/Core/GPUCommon/include/itkGPUReduction.h +index 524a5cd01..1b3ce91e9 100644 +--- a/Modules/Core/GPUCommon/include/itkGPUReduction.h ++++ b/Modules/Core/GPUCommon/include/itkGPUReduction.h +@@ -26,7 +26,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUReduction */ +-itkGPUKernelClassMacro(GPUReductionKernel); ++class itkGPUKernelClassMacro(GPUReductionKernel); + + /** + * \class GPUReduction +diff --git a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h +index 853801cec..2fccf0bc5 100644 +--- a/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h ++++ b/Modules/Core/GPUFiniteDifference/include/itkGPUDenseFiniteDifferenceImageFilter.h +@@ -24,7 +24,7 @@ + namespace itk + { + /** Create a helper GPU Kernel class for GPUDenseFiniteDifferenceImageFilter */ +-itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); ++class ITKGPUFiniteDifference_EXPORT itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel); + + /** + * \class GPUDenseFiniteDifferenceImageFilter +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h +index 4245ff914..1b21b709e 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.h +@@ -54,7 +54,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUGradientNDAnisotropicDiffusionFunction */ +-itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); ++class itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUGradientNDAnisotropicDiffusionFunction +diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h +index 305f6490e..d0d433080 100644 +--- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h ++++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUScalarAnisotropicDiffusionFunction.h +@@ -32,7 +32,7 @@ namespace itk + * */ + + /** Create a helper GPU Kernel class for GPUScalarAnisotropicDiffusionFunction */ +-itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); ++class itkGPUKernelClassMacro(GPUScalarAnisotropicDiffusionFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUScalarAnisotropicDiffusionFunction : public GPUAnisotropicDiffusionFunction +diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h +index 23530ac5c..e1b83f696 100644 +--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h ++++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.h +@@ -29,7 +29,7 @@ namespace itk + { + + /** Create a helper GPU Kernel class for GPUCastImageFilter */ +-itkGPUKernelClassMacro(GPUCastImageFilterKernel); ++class itkGPUKernelClassMacro(GPUCastImageFilterKernel); + + /** \class GPUCastImageFilter + * \brief GPU version of CastImageFilter. +diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h +index c4adc2967..69aeac6db 100644 +--- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h ++++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUNeighborhoodOperatorImageFilter.h +@@ -41,7 +41,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUNeighborhoodOperatorImageFilter */ +-itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); ++class itkGPUKernelClassMacro(GPUNeighborhoodOperatorImageFilterKernel); + + template + class ITK_TEMPLATE_EXPORT GPUMeanImageFilter +diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h +index 8d26dcfc5..613bc623f 100644 +--- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h ++++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h +@@ -85,7 +85,7 @@ private: + } // end of namespace Functor + + /** Create a helper GPU Kernel class for GPUBinaryThresholdImageFilter */ +-itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); ++class itkGPUKernelClassMacro(GPUBinaryThresholdImageFilterKernel); + + /** + * \class GPUBinaryThresholdImageFilter +diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h +index 28b21d592..0b46e27b8 100644 +--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h ++++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.h +@@ -51,7 +51,7 @@ namespace itk + * \ingroup ITKGPUPDEDeformableRegistration + */ + /** Create a helper GPU Kernel class for GPUDemonsRegistrationFunction */ +-itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); ++class itkGPUKernelClassMacro(GPUDemonsRegistrationFunctionKernel); + + template + class ITK_TEMPLATE_EXPORT GPUDemonsRegistrationFunction +diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h +index 93ab975ec..0afd84871 100644 +--- a/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h ++++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUPDEDeformableRegistrationFilter.h +@@ -73,7 +73,7 @@ namespace itk + */ + + /** Create a helper GPU Kernel class for GPUPDEDeformableRegistrationFilter */ +-itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); ++class itkGPUKernelClassMacro(GPUPDEDeformableRegistrationFilterKernel); + + template + ++#include "RTKExport.h" + #include "rtkMacro.h" + + namespace rtk +@@ -67,25 +68,18 @@ public: + * with the i-th matrix provides the physical coordinate on + * the i-th projection. + */ +- const std::vector & +- GetMatrices() const +- { +- return this->m_Matrices; +- } ++ itkGetConstReferenceMacro(Matrices,std::vector) + + /** Get the i-th projection matrix. */ + MatrixType +- GetMatrix(const unsigned int i) const +- { +- return this->m_Matrices[i]; +- } ++ GetMatrix(const unsigned int i) const; + + /** Empty the geometry object. */ + virtual void + Clear(); + + protected: +- ProjectionGeometry() = default; ++ ProjectionGeometry(); + ~ProjectionGeometry() override = default; + + void +@@ -93,11 +87,7 @@ protected: + + /** Add projection matrix */ + virtual void +- AddMatrix(const MatrixType & m) +- { +- this->m_Matrices.push_back(m); +- this->Modified(); +- } ++ AddMatrix(const MatrixType & m); + + private: + /** Projection matrices */ +@@ -105,6 +95,9 @@ private: + }; + } // namespace rtk + +-#include "rtkProjectionGeometry.hxx" ++#ifndef ITK_MANUAL_INSTANTIATION ++# include "rtkProjectionGeometry.hxx" ++#endif ++ + + #endif // rtkProjectionGeometry_h +diff --git a/include/rtkProjectionGeometry.hxx b/include/rtkProjectionGeometry.hxx +index 192265812..97dfe8c3a 100644 +--- a/include/rtkProjectionGeometry.hxx ++++ b/include/rtkProjectionGeometry.hxx +@@ -23,6 +23,8 @@ + + namespace rtk + { ++template ++ProjectionGeometry::ProjectionGeometry() = default; + + template + void +@@ -43,6 +45,21 @@ ProjectionGeometry::Clear() + this->Modified(); + } + ++template ++typename ProjectionGeometry::MatrixType ++ProjectionGeometry::GetMatrix(const unsigned int i) const ++{ ++ return this->m_Matrices[i]; ++} ++ ++template ++void ++ProjectionGeometry::AddMatrix(const typename ProjectionGeometry::MatrixType & m) ++{ ++ this->m_Matrices.push_back(m); ++ this->Modified(); ++} ++ + } // namespace rtk + + #endif // rtkProjectionGeometry_hxx diff --git a/ports/itk/rtk/unresolved.patch b/ports/itk/rtk/unresolved.patch new file mode 100644 index 00000000000000..e2209ec7574070 --- /dev/null +++ b/ports/itk/rtk/unresolved.patch @@ -0,0 +1,213 @@ +diff --git a/include/rtkDCMImagXImageIO.h b/include/rtkDCMImagXImageIO.h +index 2a70ae046..69abb409e 100644 +--- a/include/rtkDCMImagXImageIO.h ++++ b/include/rtkDCMImagXImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkDCMImagXImageIO_h + #define rtkDCMImagXImageIO_h +- ++#include "RTKExport.h" + #include + + #include "rtkMacro.h" +@@ -32,7 +32,7 @@ namespace rtk + * + * \ingroup RTK + */ +-class DCMImagXImageIO : public itk::GDCMImageIO ++class RTK_EXPORT DCMImagXImageIO : public itk::GDCMImageIO + { + public: + ITK_DISALLOW_COPY_AND_ASSIGN(DCMImagXImageIO); +diff --git a/include/rtkEdfImageIO.h b/include/rtkEdfImageIO.h +index 66499c56b..7b16fbc5a 100644 +--- a/include/rtkEdfImageIO.h ++++ b/include/rtkEdfImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkEdfImageIO_h + #define rtkEdfImageIO_h +- ++#include "RTKExport.h" + #include + #include + #include +@@ -36,7 +36,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class EdfImageIO : public itk::ImageIOBase ++class RTK_EXPORT EdfImageIO : public itk::ImageIOBase + { + public: + ITK_DISALLOW_COPY_AND_ASSIGN(EdfImageIO); +diff --git a/include/rtkHisImageIO.h b/include/rtkHisImageIO.h +index 2ef2005dd..95449b8a6 100644 +--- a/include/rtkHisImageIO.h ++++ b/include/rtkHisImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkHisImageIO_h + #define rtkHisImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include + #include "rtkMacro.h" +@@ -35,7 +37,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HisImageIO : public itk::ImageIOBase ++class RTK_EXPORT HisImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHncImageIO.h b/include/rtkHncImageIO.h +index 7b9539bde..dc9dca759 100644 +--- a/include/rtkHncImageIO.h ++++ b/include/rtkHncImageIO.h +@@ -19,9 +19,11 @@ + #ifndef rtkHncImageIO_h + #define rtkHncImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include +-#include "itksys/SystemTools.hxx" ++//#include "itksys/SystemTools.hxx" + + #if defined(_MSC_VER) && (_MSC_VER < 1600) + // SR: taken from +@@ -43,7 +45,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HncImageIO : public itk::ImageIOBase ++class RTK_EXPORT HncImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHncImageIOFactory.h b/include/rtkHncImageIOFactory.h +index 2bca8f77e..1d5a97938 100644 +--- a/include/rtkHncImageIOFactory.h ++++ b/include/rtkHncImageIOFactory.h +@@ -38,7 +38,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HncImageIOFactory : public itk::ObjectFactoryBase ++class RTK_EXPORT HncImageIOFactory : public itk::ObjectFactoryBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkHndImageIO.h b/include/rtkHndImageIO.h +index 5a07897cc..5f843362a 100644 +--- a/include/rtkHndImageIO.h ++++ b/include/rtkHndImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkHndImageIO_h + #define rtkHndImageIO_h + ++#include "RTKExport.h" ++ + // itk include + #include + +@@ -43,7 +45,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class HndImageIO : public itk::ImageIOBase ++class RTK_EXPORT HndImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkImagXImageIO.h b/include/rtkImagXImageIO.h +index d69e9a790..d6cc8388e 100644 +--- a/include/rtkImagXImageIO.h ++++ b/include/rtkImagXImageIO.h +@@ -18,7 +18,7 @@ + + #ifndef rtkImagXImageIO_h + #define rtkImagXImageIO_h +- ++#include "RTKExport.h" + #include + #include + #include +@@ -34,7 +34,7 @@ namespace rtk + * + * \ingroup RTK + */ +-class ImagXImageIO : public itk::ImageIOBase ++class RTK_EXPORT ImagXImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkOraImageIO.h b/include/rtkOraImageIO.h +index ece525a42..2d5332872 100644 +--- a/include/rtkOraImageIO.h ++++ b/include/rtkOraImageIO.h +@@ -19,6 +19,8 @@ + #ifndef rtkOraImageIO_h + #define rtkOraImageIO_h + ++#include "RTKExport.h" ++ + // This is done to avoid any interference with zlib + #ifdef OF + # undef OF +@@ -41,7 +43,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class OraImageIO : public itk::MetaImageIO ++class RTK_EXPORT OraImageIO : public itk::MetaImageIO + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkXRadImageIO.h b/include/rtkXRadImageIO.h +index a72c934e4..0a92afa22 100644 +--- a/include/rtkXRadImageIO.h ++++ b/include/rtkXRadImageIO.h +@@ -19,6 +19,7 @@ + #ifndef rtkXRadImageIO_h + #define rtkXRadImageIO_h + ++#include "RTKExport.h" + #include + #include + #include +@@ -37,7 +38,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class XRadImageIO : public itk::ImageIOBase ++class RTK_EXPORT XRadImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ +diff --git a/include/rtkXimImageIO.h b/include/rtkXimImageIO.h +index ae789dbf9..741f05183 100644 +--- a/include/rtkXimImageIO.h ++++ b/include/rtkXimImageIO.h +@@ -19,6 +19,7 @@ + #ifndef rtkXimImageIO_h + #define rtkXimImageIO_h + ++#include "RTKExport.h" + #include "rtkMacro.h" + + // itk include +@@ -43,7 +44,7 @@ namespace rtk + * + * \ingroup RTK IOFilters + */ +-class XimImageIO : public itk::ImageIOBase ++class RTK_EXPORT XimImageIO : public itk::ImageIOBase + { + public: + /** Standard class type alias. */ diff --git a/ports/itk/var_libraries.patch b/ports/itk/var_libraries.patch new file mode 100644 index 00000000000000..738fa980f131ca --- /dev/null +++ b/ports/itk/var_libraries.patch @@ -0,0 +1,27 @@ +diff --git a/CMake/ITKModuleMacros.cmake b/CMake/ITKModuleMacros.cmake +index da9f3a902..60420bb0a 100644 +--- a/CMake/ITKModuleMacros.cmake ++++ b/CMake/ITKModuleMacros.cmake +@@ -162,9 +162,6 @@ macro(itk_module_impl) + foreach(dep IN LISTS ITK_MODULE_${itk-module}_DEPENDS) + list(APPEND ${itk-module}_LIBRARIES "${${dep}_LIBRARIES}") + endforeach() +- if(${itk-module}_LIBRARIES) +- list(REMOVE_DUPLICATES ${itk-module}_LIBRARIES) +- endif() + endif() + + if(EXISTS ${${itk-module}_SOURCE_DIR}/include) +diff --git a/CMake/ITKModuleAPI.cmake b/CMake/ITKModuleAPI.cmake +index af64d96dc..809335e6d 100644 +--- a/CMake/ITKModuleAPI.cmake ++++ b/CMake/ITKModuleAPI.cmake +@@ -133,7 +133,7 @@ macro(itk_module_config ns) + endforeach() + unset(_${ns}_USED_MODULES) + +- foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS ++ foreach(v ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS + ${ns}_RUNTIME_LIBRARY_DIRS ${ns}_FACTORY_NAMES ${ns}_FACTORY_LIST) + if(${v}) + list(REMOVE_DUPLICATES ${v}) diff --git a/ports/itk/wrapping.patch b/ports/itk/wrapping.patch new file mode 100644 index 00000000000000..1e2e531504eb23 --- /dev/null +++ b/ports/itk/wrapping.patch @@ -0,0 +1,19 @@ +diff --git a/Wrapping/TypedefMacros.cmake b/Wrapping/TypedefMacros.cmake +index e6f8d0bf3..6c000dba8 100644 +--- a/Wrapping/TypedefMacros.cmake ++++ b/Wrapping/TypedefMacros.cmake +@@ -57,13 +57,12 @@ macro(itk_wrap_module library_name) + + # WRAPPER_LIBRARY_DEPENDS. List of names of other wrapper libraries that + # define symbols used by this wrapper library. + INTERSECTION(WRAPPER_LIBRARY_DEPENDS "${ITK_MODULE_${library_name}_DEPENDS}" "${WRAP_ITK_MODULES}") + # set(WRAPPER_LIBRARY_DEPENDS ${ITK_MODULE_${library_name}_DEPENDS}) + + # WRAPPER_LIBRARY_LINK_LIBRARIES. List of other libraries that should + # be linked to the wrapper library. +- set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${itk-module}_LIBRARIES}) +- ++ set(WRAPPER_LIBRARY_LINK_LIBRARIES ${ITK_LIBRARIES} ${${library_name}_LIBRARIES}) + # WRAPPER_SUBMODULE_ORDER. List of *.wrap submodules in the source dir + # that should be included/wrapped before the rest in the given order. + # Just the submodule group name is needed, not the full path or file name. diff --git a/ports/josuttis-jthread/CONTROL b/ports/josuttis-jthread/CONTROL new file mode 100644 index 00000000000000..760fb6eb716f0e --- /dev/null +++ b/ports/josuttis-jthread/CONTROL @@ -0,0 +1,4 @@ +Source: josuttis-jthread +Version: 2020-07-21 +Homepage: https://github.com/josuttis/jthread +Description: C++ class for a joining and cooperative interruptible thread (std::jthread) with stop_token helper diff --git a/ports/josuttis-jthread/portfile.cmake b/ports/josuttis-jthread/portfile.cmake new file mode 100644 index 00000000000000..e01c165855d732 --- /dev/null +++ b/ports/josuttis-jthread/portfile.cmake @@ -0,0 +1,15 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO josuttis/jthread + REF 3e1908f3bbaba6d2195bb423840c23e107c9e8b2 + SHA512 b6e4df35b364848a433eb31023a8b5b5045b2445aaf9a81406a6b3ce7cfdda08bcdb486be9201f5b1e54df38884c1763fae336fdcb9ad79f11658a92c535055d + HEAD_REF master +) + +file(INSTALL ${SOURCE_PATH}/source/jthread.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/source/stop_token.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${SOURCE_PATH}/source/condition_variable_any2.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include}) + +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/jsoncons/CONTROL b/ports/jsoncons/CONTROL index 4063d9323c2be2..a867c1b42c365c 100644 --- a/ports/jsoncons/CONTROL +++ b/ports/jsoncons/CONTROL @@ -1,4 +1,4 @@ Source: jsoncons -Version: 0.153.3 -Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, CSV, MessagePack, CBOR, BSON, UBJSON +Version: 0.155.1 +Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON Homepage: https://github.com/danielaparker/jsoncons diff --git a/ports/jsoncons/portfile.cmake b/ports/jsoncons/portfile.cmake index 7da19ced61374b..960e199d54dcae 100644 --- a/ports/jsoncons/portfile.cmake +++ b/ports/jsoncons/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danielaparker/jsoncons - REF 41302e394917a71e7e73db9a50f7d496d2862fd3 # v0.153.3 - SHA512 8b1859f484eada1db02c7f146efd1a53b412f06e4b4c2b0a1aaf4b96242a839093c5eb5b588e1e29b56830223e07b6d0b6418cca616d901316d9cb30de4e803e + REF 0fd102277ca361b8a82cdab97df67d18fe335409 # v0.155.1 + SHA512 77c64bd0f8ce681a5b517c4a94fbe718e15fa4c5047e718c93413dfa173614818f435419d64313555653966d3a2c35deec15702d9d3768eeba6aba129625fea4 HEAD_REF master ) diff --git a/ports/jxrlib/CONTROL b/ports/jxrlib/CONTROL index ac2559064dbef2..c92324b4ffce53 100644 --- a/ports/jxrlib/CONTROL +++ b/ports/jxrlib/CONTROL @@ -1,4 +1,4 @@ Source: jxrlib -Version: 2019.10.9 +Version: 2019.10.9-1 Homepage: https://github.com/4creators/jxrlib Description: Open source implementation of the jpegxr image format standard. diff --git a/ports/jxrlib/vcpkg-cmake-wrapper.cmake b/ports/jxrlib/vcpkg-cmake-wrapper.cmake index e95a66bdc4ed6a..4bee9171d8197c 100644 --- a/ports/jxrlib/vcpkg-cmake-wrapper.cmake +++ b/ports/jxrlib/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(JXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT JXR_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${JXR_PREV_MODULE_PATH}) diff --git a/ports/kf5archive/CONTROL b/ports/kf5archive/CONTROL index a8f1d30ab2cbb6..16592e34e80d1d 100644 --- a/ports/kf5archive/CONTROL +++ b/ports/kf5archive/CONTROL @@ -1,4 +1,5 @@ Source: kf5archive Version: 5.64.0-1 +Homepage: https://api.kde.org/frameworks/karchive/html/index.html Description: File compression Build-Depends: ecm, qt5-base[core], zlib, bzip2 diff --git a/ports/kf5archive/portfile.cmake b/ports/kf5archive/portfile.cmake index aaaa48de0bbce0..c7b99e8526c8de 100644 --- a/ports/kf5archive/portfile.cmake +++ b/ports/kf5archive/portfile.cmake @@ -9,10 +9,11 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DBUILD_HTML_DOCS=OFF - -DBUILD_MAN_DOCS=OFF - -DBUILD_QTHELP_DOCS=OFF - -DBUILD_TESTING=OFF + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF ) vcpkg_install_cmake() @@ -22,4 +23,5 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) -file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/kf5archive RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5completion/CONTROL b/ports/kf5completion/CONTROL new file mode 100644 index 00000000000000..fb1f4309acea58 --- /dev/null +++ b/ports/kf5completion/CONTROL @@ -0,0 +1,5 @@ +Source: kf5completion +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcompletion/html/index.html +Description: Text completion helpers and widgets +Build-Depends: ecm, qt5-tools, kf5config, kf5widgetsaddons \ No newline at end of file diff --git a/ports/kf5completion/add-qdbus-to-required-libraries.patch b/ports/kf5completion/add-qdbus-to-required-libraries.patch new file mode 100644 index 00000000000000..b5c285a652b693 --- /dev/null +++ b/ports/kf5completion/add-qdbus-to-required-libraries.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a86a05e..688bae2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,7 +32,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KCOMPLETION + # Dependencies + set(REQUIRED_QT_VERSION 5.11.0) + +-find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets) ++find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets DBus) + + find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) + find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED) diff --git a/ports/kf5completion/portfile.cmake b/ports/kf5completion/portfile.cmake new file mode 100644 index 00000000000000..d9e697dcf3cd34 --- /dev/null +++ b/ports/kf5completion/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcompletion + REF v5.64.0 + SHA512 1d597bc0e82d1570b1ff7b254425ab18d4d505a0b7f475a43b51d70566b91e763b86675837421c3f09073544efa77e673e9d2cfef586c12684fc9fe7b0c6a0cc + HEAD_REF master + # reported issue, just a manual workaround until the issue is fixed upstream + PATCHES + "add-qdbus-to-required-libraries.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Completion) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5config/CONTROL b/ports/kf5config/CONTROL new file mode 100644 index 00000000000000..8c0c49e3114d5d --- /dev/null +++ b/ports/kf5config/CONTROL @@ -0,0 +1,5 @@ +Source: kf5config +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kconfig/html/index.html +Description: Configuration system +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5config/portfile.cmake b/ports/kf5config/portfile.cmake new file mode 100644 index 00000000000000..444b1aed5abe24 --- /dev/null +++ b/ports/kf5config/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kconfig + REF v5.64.0 + SHA512 b8919e552a35ed3f4882d2d15205c5576be985e9f6e4e834d26587c9288e85a2ab27504a1531d1af70e8db4dc7ed71a6b0caf91c7310dace81177b68aa6a97e5 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconfig_compiler_kf5.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconfig_compiler_kf5.exe) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin/kconf_update.exe ${CURRENT_PACKAGES_DIR}/tools/${PORT}/kconf_update.exe) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5.exe) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5.exe) + file (GLOB EXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) + file(REMOVE ${EXES}) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kreadconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/kwriteconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kreadconfig5) + file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/kwriteconfig5) +endif() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Config) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") +vcpkg_copy_pdbs() + +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/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5coreaddons/CONTROL b/ports/kf5coreaddons/CONTROL new file mode 100644 index 00000000000000..03d14a3545db45 --- /dev/null +++ b/ports/kf5coreaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5coreaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcoreaddons/html/index.html +Description: Addons to QtCore +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5coreaddons/portfile.cmake b/ports/kf5coreaddons/portfile.cmake new file mode 100644 index 00000000000000..14862e07f1188c --- /dev/null +++ b/ports/kf5coreaddons/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcoreaddons + REF v5.64.0 + SHA512 b6849c072aa33cd2d93477e7a08ffc8ec7034f7d8530b6492faa9a53e4e15af0da778fc54e5d865e68b36c32aa6559f3d178a03046f5120d11dcb61d35ed7a60 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_DATAROOTDIR=data +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5CoreAddons) +vcpkg_copy_pdbs() + +vcpkg_copy_tools( + TOOL_NAMES desktoptojson + AUTO_CLEAN +) + +file(APPEND ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "Data = ../../data") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/desktoptojson${EXECUTABLE_SUFFIX}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5crash/CONTROL b/ports/kf5crash/CONTROL new file mode 100644 index 00000000000000..927eca46cd0919 --- /dev/null +++ b/ports/kf5crash/CONTROL @@ -0,0 +1,6 @@ +Source: kf5crash +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kcrash/html/index.html +Description: KCrash provides support for intercepting and handling application crashes. +Supports: linux +Build-Depends: ecm, kf5coreaddons, kf5widgetsaddons diff --git a/ports/kf5crash/add_x11extras.patch b/ports/kf5crash/add_x11extras.patch new file mode 100644 index 00000000000000..a6ff6fc66ce412 --- /dev/null +++ b/ports/kf5crash/add_x11extras.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a9d1c6..0d5fb3f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKA + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + + set(REQUIRED_QT_VERSION 5.11.0) +-find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) ++find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core X11Extras) + include(KDEInstallDirs) + include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + include(KDECMakeSettings) diff --git a/ports/kf5crash/portfile.cmake b/ports/kf5crash/portfile.cmake new file mode 100644 index 00000000000000..dc608d37153250 --- /dev/null +++ b/ports/kf5crash/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_fail_port_install(ON_TARGET "osx" "uwp" "windows") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kcrash + REF v5.64.0 + SHA512 28749b220002fef756dbd8436cf684b7e3eb1d72ae00ae8b1bfded5c4a446683dc925a3be9beb55ad0872e71d3c23411d32b4fab935909816efa339cedaeda3d + HEAD_REF master + PATCHES + add_x11extras.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5Crash) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) + +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5guiaddons/CONTROL b/ports/kf5guiaddons/CONTROL new file mode 100644 index 00000000000000..a364eecc1d79d3 --- /dev/null +++ b/ports/kf5guiaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5guiaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kguiaddons/html/index.html +Description: Addons to QtGui +Build-Depends: ecm, qt5-winextras (windows), qt5-x11extras (linux), qt5-tools diff --git a/ports/kf5guiaddons/portfile.cmake b/ports/kf5guiaddons/portfile.cmake new file mode 100644 index 00000000000000..8234e4cd8787ea --- /dev/null +++ b/ports/kf5guiaddons/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kguiaddons + REF v5.64.0 + SHA512 98d07360f02b473997cdbf9e9b832ea8c4a459a73669eff1db5276dfbd63e9a9088e3c1ed99d70cc1433468e1efcbce43d22fefdf75a399f4812e0fc4a4f13b1 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5GuiAddons) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5i18n/CONTROL b/ports/kf5i18n/CONTROL new file mode 100644 index 00000000000000..4cb5ce4d594c39 --- /dev/null +++ b/ports/kf5i18n/CONTROL @@ -0,0 +1,5 @@ +Source: kf5i18n +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/ki18n/html/index.html +Description: Advanced internationalization framework +Build-Depends: ecm, qt5-declarative, qt5-tools, gettext diff --git a/ports/kf5i18n/portfile.cmake b/ports/kf5i18n/portfile.cmake new file mode 100644 index 00000000000000..efa22a577c9f82 --- /dev/null +++ b/ports/kf5i18n/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/ki18n + REF v5.64.0 + SHA512 13b5d701003edea704ffc86a886d86b27ff2198d4cde4ee732b9241cf04dba0fba403f1f78b45facd7c2d3b543f8f0a098369035270a61b347331eb495fae1d3 +) + +if(CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES mingw-w64-i686-gettext) + set(GETTEXT_PATH ${MSYS_ROOT}/mingw32/bin) + vcpkg_add_to_path(${GETTEXT_PATH}) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_PLUGINDIR=plugins +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5I18n) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemmodels/CONTROL b/ports/kf5itemmodels/CONTROL new file mode 100644 index 00000000000000..f94f20fa9d9fa4 --- /dev/null +++ b/ports/kf5itemmodels/CONTROL @@ -0,0 +1,5 @@ +Source: kf5itemmodels +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kitemmodels/html/index.html +Description: Models for Qt Model/View system +Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemmodels/portfile.cmake b/ports/kf5itemmodels/portfile.cmake new file mode 100644 index 00000000000000..9facbb120bea25 --- /dev/null +++ b/ports/kf5itemmodels/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kitemmodels + REF v5.64.0 + SHA512 c29911b5ff521a8d1dae9b72250be59267da7bf059aeb1efec6a7361204957c12a1ae95fd34a00067b277ce3a61d88930326501c361341a316d6c0afb109b7ed +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemModels) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5itemviews/CONTROL b/ports/kf5itemviews/CONTROL new file mode 100644 index 00000000000000..8d83844ebeae86 --- /dev/null +++ b/ports/kf5itemviews/CONTROL @@ -0,0 +1,5 @@ +Source: kf5itemviews +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kitemviews/html/index.html +Description: Widget addons for Qt Model/View +Build-Depends: ecm, qt5-tools, qt5-base diff --git a/ports/kf5itemviews/portfile.cmake b/ports/kf5itemviews/portfile.cmake new file mode 100644 index 00000000000000..f134b477ceb43a --- /dev/null +++ b/ports/kf5itemviews/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kitemviews + REF v5.64.0 + SHA512 c40d1dee94badac2e58098138522d72be00082ac9ce70e8f5690b5bd5ae0705fa79a7edc3af391230a86d08a4a8b7dac1c28f148758f7ee8c09195a178e35bcb +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5ItemViews) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/kf5widgetsaddons/CONTROL b/ports/kf5widgetsaddons/CONTROL new file mode 100644 index 00000000000000..2e5f2eb515d499 --- /dev/null +++ b/ports/kf5widgetsaddons/CONTROL @@ -0,0 +1,5 @@ +Source: kf5widgetsaddons +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kwidgetsaddons/html/index.html +Description: Addons to QtWidgets +Build-Depends: ecm, qt5-base, qt5-tools diff --git a/ports/kf5widgetsaddons/portfile.cmake b/ports/kf5widgetsaddons/portfile.cmake new file mode 100644 index 00000000000000..fe7106e224bd09 --- /dev/null +++ b/ports/kf5widgetsaddons/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kwidgetsaddons + REF v5.64.0 + SHA512 f49bade85b97468ad4c2faa34b71c6d04ff95c720c27e5b7adfb9a7b5acf8ff30b91d2beca7472dec6b8241f918b4fb15bddc1429be86a62bcefefe918311307 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DBUILD_DESIGNERPLUGIN=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WidgetsAddons) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/kf5windowsystem/CONTROL b/ports/kf5windowsystem/CONTROL new file mode 100644 index 00000000000000..d5cb904870e089 --- /dev/null +++ b/ports/kf5windowsystem/CONTROL @@ -0,0 +1,5 @@ +Source: kf5windowsystem +Version: 5.64.0 +Homepage: https://api.kde.org/frameworks/kwindowsystem/html/ +Description: Access to the windowing system +Build-Depends: ecm, qt5-winextras (windows), qt5-tools diff --git a/ports/kf5windowsystem/portfile.cmake b/ports/kf5windowsystem/portfile.cmake new file mode 100644 index 00000000000000..0284c7408e5205 --- /dev/null +++ b/ports/kf5windowsystem/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kwindowsystem + REF v5.64.0 + SHA512 7e1033ac383042b76254f35676c8aa011f02192e80ac2eb0554014a483749b13002062e7e928884f95dc7cb2a1c390bd2a93a7871d3f107b7042f7219dadecf5 +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF + -DKDE_INSTALL_PLUGINDIR=plugins +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/KF5WindowSystem) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/data) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/etc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/lapack-reference/CONTROL b/ports/lapack-reference/CONTROL new file mode 100644 index 00000000000000..493e7f50e4cd36 --- /dev/null +++ b/ports/lapack-reference/CONTROL @@ -0,0 +1,16 @@ +Source: lapack-reference +Version: 3.8.0 +Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/ +Default-Features: blas-select +Build-Depends: vcpkg-gfortran (windows) + +Feature: cblas +Description: Builds CBLAS + +Feature: noblas +Build-Depends: openblas +Description: Use external optimized BLAS + +Feature: blas-select +Build-Depends: lapack-reference[core, noblas](!windows|(windows&!static)) +Description: Use external optimized BLAS diff --git a/ports/lapack-reference/FindLAPACK.cmake b/ports/lapack-reference/FindLAPACK.cmake new file mode 100644 index 00000000000000..1edaa0f831a5f9 --- /dev/null +++ b/ports/lapack-reference/FindLAPACK.cmake @@ -0,0 +1,568 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindLAPACK +---------- + +Find Linear Algebra PACKage (LAPACK) library + +This module finds an installed Fortran library that implements the +LAPACK linear-algebra interface (see http://www.netlib.org/lapack/). + +The approach follows that taken for the ``autoconf`` macro file, +``acx_lapack.m4`` (distributed at +http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). + +Input Variables +^^^^^^^^^^^^^^^ + +The following variables may be set to influence this module's behavior: + +``BLA_STATIC`` + if ``ON`` use static linkage + +``BLA_VENDOR`` + If set, checks only the specified vendor, if not set checks all the + possibilities. List of vendors valid in this module: + + * ``OpenBLAS`` + * ``FLAME`` + * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) + * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) + * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) + * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model) + * ``Intel10_64_dyn`` (intel mkl v10+ 64 bit, single dynamic library) + * ``Intel`` (obsolete versions of mkl 32 and 64 bit) + * ``ACML`` + * ``Apple`` + * ``NAS`` + * ``Arm`` + * ``Arm_mp`` + * ``Arm_ilp64`` + * ``Arm_ilp64_mp`` + * ``Generic`` + +``BLA_F95`` + if ``ON`` tries to find the BLAS95/LAPACK95 interfaces + +Imported targets +^^^^^^^^^^^^^^^^ + +This module defines the following :prop_tgt:`IMPORTED` target: + +``LAPACK::LAPACK`` + The libraries to use for LAPACK, if found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +``LAPACK_FOUND`` + library implementing the LAPACK interface is found +``LAPACK_LINKER_FLAGS`` + uncached list of required linker flags (excluding ``-l`` and ``-L``). +``LAPACK_LIBRARIES`` + uncached list of libraries (using full path name) to link against + to use LAPACK +``LAPACK95_LIBRARIES`` + uncached list of libraries (using full path name) to link against + to use LAPACK95 +``LAPACK95_FOUND`` + library implementing the LAPACK95 interface is found + +.. note:: + + C, CXX or Fortran must be enabled to detect a BLAS/LAPACK library. + C or CXX must be enabled to use Intel Math Kernel Library (MKL). + + For example, to use Intel MKL libraries and/or Intel compiler: + + .. code-block:: cmake + + set(BLA_VENDOR Intel10_64lp) + find_package(LAPACK) +#]=======================================================================] + +# Check the language being used +if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED)) + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.") + else() + message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)") + return() + endif() +endif() + +if(CMAKE_Fortran_COMPILER_LOADED) + include(${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +else() + include(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +endif() +include(${CMAKE_ROOT}/Modules/CMakePushCheckState.cmake) + +cmake_push_check_state() +set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY}) + +set(LAPACK_FOUND FALSE) +set(LAPACK95_FOUND FALSE) + +set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) +if(BLA_STATIC) + if(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() +else() + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # for ubuntu's libblas3gf and liblapack3gf packages + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) + endif() +endif() + +# TODO: move this stuff to a separate module + +macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _addlibdir _subdirs _blas) + # This macro checks for the existence of the combination of fortran libraries + # given by _list. If the combination is found, this macro checks (using the + # Check_Fortran_Function_Exists macro) whether can link against that library + # combination using the name of a routine given by _name using the linker + # flags given by _flags. If the combination of libraries is found and passes + # the link test, LIBRARIES is set to the list of complete library paths that + # have been found. Otherwise, LIBRARIES is set to FALSE. + + # N.B. _prefix is the prefix applied to the names of all cached variables that + # are generated internally and marked advanced by this macro. + # _addlibdir is a list of additional search paths. _subdirs is a list of path + # suffixes to be used by find_library(). + + set(_libraries_work TRUE) + set(${LIBRARIES}) + set(_combined_name) + + set(_extaddlibdir "${_addlibdir}") + if(WIN32) + list(APPEND _extaddlibdir ENV LIB) + elseif(APPLE) + list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH) + else() + list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH) + endif() + list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + + foreach(_library ${_list}) + if(_library MATCHES "^-Wl,--(start|end)-group$") + # Respect linker flags like --start/end-group (required by MKL) + set(${LIBRARIES} ${${LIBRARIES}} "${_library}") + else() + set(_combined_name ${_combined_name}_${_library}) + if(_libraries_work) + find_library(${_prefix}_${_library}_LIBRARY + NAMES ${_library} + PATHS ${_extaddlibdir} + PATH_SUFFIXES ${_subdirs} + ) + #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}") + mark_as_advanced(${_prefix}_${_library}_LIBRARY) + set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) + set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) + endif() + endif() + endforeach() + + if(_libraries_work) + # Test this combination of libraries. + set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threadlibs}) + #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") + if(CMAKE_Fortran_COMPILER_LOADED) + check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) + else() + check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) + endif() + set(CMAKE_REQUIRED_LIBRARIES) + set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) + endif() + + if(_libraries_work) + if("${_list}${_blas}" STREQUAL "") + set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + else() + set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threadlibs}) + endif() + else() + set(${LIBRARIES} FALSE) + endif() + #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") +endmacro() + +set(LAPACK_LINKER_FLAGS) +set(LAPACK_LIBRARIES) +set(LAPACK95_LIBRARIES) + +if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + find_package(BLAS) +else() + find_package(BLAS REQUIRED) +endif() + +if(BLAS_FOUND) + set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) + if(NOT $ENV{BLA_VENDOR} STREQUAL "") + set(BLA_VENDOR $ENV{BLA_VENDOR}) + else() + if(NOT BLA_VENDOR) + set(BLA_VENDOR "All") + endif() + endif() + + # LAPACK in the Intel MKL 10+ library? + if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + if(CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED) + # System-specific settings + if(NOT WIN32) + set(LAPACK_mkl_LM "-lm") + set(LAPACK_mkl_LDL "-ldl") + endif() + + if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) + find_package(Threads) + else() + find_package(Threads REQUIRED) + endif() + + if(BLA_VENDOR MATCHES "_64ilp") + set(LAPACK_mkl_ILP_MODE "ilp64") + else() + set(LAPACK_mkl_ILP_MODE "lp64") + endif() + + set(LAPACK_SEARCH_LIBS "") + + if(BLA_F95) + set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95") + set(_LIBRARIES LAPACK95_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) + + # old + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95") + # new >= 10.3 + list(APPEND LAPACK_SEARCH_LIBS + "mkl_intel_c") + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack95_${LAPACK_mkl_ILP_MODE}") + else() + set(LAPACK_mkl_SEARCH_SYMBOL "cheev") + set(_LIBRARIES LAPACK_LIBRARIES) + set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) + + # old and new >= 10.3 + list(APPEND LAPACK_SEARCH_LIBS + "mkl_lapack") + endif() + + # MKL uses a multitude of partially platform-specific subdirectories: + if(BLA_VENDOR STREQUAL "Intel10_32") + set(LAPACK_mkl_ARCH_NAME "ia32") + else() + set(LAPACK_mkl_ARCH_NAME "intel64") + endif() + if(WIN32) + set(LAPACK_mkl_OS_NAME "win") + elseif(APPLE) + set(LAPACK_mkl_OS_NAME "mac") + else() + set(LAPACK_mkl_OS_NAME "lin") + endif() + if(DEFINED ENV{MKLROOT}) + file(TO_CMAKE_PATH "$ENV{MKLROOT}" LAPACK_mkl_MKLROOT) + # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead + # so we can better detect other relevant libraries in 'compiler' or 'tbb': + get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME) + if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl") + get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY) + endif() + endif() + set(LAPACK_mkl_LIB_PATH_SUFFIXES + "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}") + + # First try empty lapack libs + if(NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "" + "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" + "${LAPACK_mkl_MKLROOT}" + "${LAPACK_mkl_LIB_PATH_SUFFIXES}" + "${_BLAS_LIBRARIES}" + ) + endif() + + # Then try the search libs + foreach(IT ${LAPACK_SEARCH_LIBS}) + string(REPLACE " " ";" SEARCH_LIBS ${IT}) + if(NOT ${_LIBRARIES}) + check_lapack_libraries( + ${_LIBRARIES} + LAPACK + ${LAPACK_mkl_SEARCH_SYMBOL} + "" + "${SEARCH_LIBS}" + "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}" + "${LAPACK_mkl_MKLROOT}" + "${LAPACK_mkl_LIB_PATH_SUFFIXES}" + "${_BLAS_LIBRARIES}" + ) + endif() + endforeach() + + unset(LAPACK_mkl_ILP_MODE) + unset(LAPACK_mkl_SEARCH_SYMBOL) + unset(LAPACK_mkl_LM) + unset(LAPACK_mkl_LDL) + unset(LAPACK_mkl_MKLROOT) + unset(LAPACK_mkl_ARCH_NAME) + unset(LAPACK_mkl_OS_NAME) + unset(LAPACK_mkl_LIB_PATH_SUFFIXES) + endif() + endif() + endif() + + # gotoblas? (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) + if(BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "goto2" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # OpenBLAS? (http://www.openblas.net) + if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "openblas" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # ArmPL? (https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries) + if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All") + + # Check for 64bit Integer support + if(BLA_VENDOR MATCHES "_ilp64") + set(LAPACK_armpl_LIB "armpl_ilp64") + else() + set(LAPACK_armpl_LIB "armpl_lp64") + endif() + + # Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp + if(BLA_VENDOR MATCHES "_mp") + set(LAPACK_armpl_LIB "${LAPACK_armpl_LIB}_mp") + endif() + + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "${LAPACK_armpl_LIB}" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # FLAME's blis library? (https://github.com/flame/blis) + if(BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "flame" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # BLAS in acml library? + if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") + if(BLAS_LIBRARIES MATCHES ".+acml.+") + set(LAPACK_LIBRARIES ${BLAS_LIBRARIES}) + endif() + endif() + + # Apple LAPACK library? + if(BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "Accelerate" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # Apple NAS (vecLib) library? + if(BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "vecLib" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() + + # Generic LAPACK library? + if(BLA_VENDOR STREQUAL "Generic" OR + BLA_VENDOR STREQUAL "ATLAS" OR + BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "lapack" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + if(NOT LAPACK_LIBRARIES AND NOT WIN32) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "lapack;-lm;-lgfortran" + "" + "" + "" + "${BLAS_LIBRARIES}" + ) + endif() + endif() +else() + message(STATUS "LAPACK requires BLAS") +endif() + +if(BLA_F95) + if(LAPACK95_LIBRARIES) + set(LAPACK95_FOUND TRUE) + else() + set(LAPACK95_FOUND FALSE) + endif() + if(NOT LAPACK_FIND_QUIETLY) + if(LAPACK95_FOUND) + message(STATUS "A library with LAPACK95 API found.") + else() + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR + "A required library with LAPACK95 API not found. Please specify library location." + ) + else() + message(STATUS + "A library with LAPACK95 API not found. Please specify library location." + ) + endif() + endif() + endif() + set(LAPACK_FOUND "${LAPACK95_FOUND}") + set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") +else() + if(LAPACK_LIBRARIES) + set(LAPACK_FOUND TRUE) + else() + set(LAPACK_FOUND FALSE) + endif() + + if(NOT LAPACK_FIND_QUIETLY) + if(LAPACK_FOUND) + message(STATUS "A library with LAPACK API found.") + else() + if(LAPACK_FIND_REQUIRED) + message(FATAL_ERROR + "A required library with LAPACK API not found. Please specify library location." + ) + else() + message(STATUS + "A library with LAPACK API not found. Please specify library location." + ) + endif() + endif() + endif() +endif() + +# On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines) +# we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above. +if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + set(LAPACK_LIBRARIES "") +endif() + +if(NOT TARGET LAPACK::LAPACK) + add_library(LAPACK::LAPACK INTERFACE IMPORTED) + set(_lapack_libs "${LAPACK_LIBRARIES}") + if(_lapack_libs AND TARGET BLAS::BLAS) + # remove the ${BLAS_LIBRARIES} from the interface and replace it + # with the BLAS::BLAS target + list(REMOVE_ITEM _lapack_libs "${BLAS_LIBRARIES}") + endif() + + if(_lapack_libs) + set_target_properties(LAPACK::LAPACK PROPERTIES + INTERFACE_LINK_LIBRARIES "${_lapack_libs}" + ) + endif() + unset(_lapack_libs) +endif() + +cmake_pop_check_state() +set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/ports/lapack-reference/portfile.cmake b/ports/lapack-reference/portfile.cmake new file mode 100644 index 00000000000000..1e3f8d6b653539 --- /dev/null +++ b/ports/lapack-reference/portfile.cmake @@ -0,0 +1,123 @@ +#TODO: Features to add: +# USE_XBLAS??? extended precision blas. needs xblas +# LAPACKE should be its own PORT +# USE_OPTIMIZED_LAPACK (Probably not what we want. Does a find_package(LAPACK): probably for LAPACKE only builds _> own port?) +# LAPACKE Builds LAPACKE +# LAPACKE_WITH_TMG Build LAPACKE with tmglib routines +include(vcpkg_find_fortran) +SET(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +set(lapack_ver 3.8.0) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Reference-LAPACK/lapack" + REF "v${lapack_ver}" + SHA512 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f + HEAD_REF master +) + +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(ENV{FFLAGS} "$ENV{FFLAGS} -fPIC") +endif() + +set(CBLAS OFF) +if("cblas" IN_LIST FEATURES) + set(CBLAS ON) +endif() + +set(USE_OPTIMIZED_BLAS OFF) +if("noblas" IN_LIST FEATURES) + set(USE_OPTIMIZED_BLAS ON) + set(pcfile "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/openblas.pc") + if(EXISTS "${pcfile}") + file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) + endif() + set(pcfile "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig/openblas.pc") + if(EXISTS "${pcfile}") + file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) + endif() +endif() + +set(VCPKG_CRT_LINKAGE_BACKUP ${VCPKG_CRT_LINKAGE}) +vcpkg_find_fortran(FORTRAN_CMAKE) +if(VCPKG_USE_INTERNAL_Fortran) + if(VCPKG_CRT_LINKAGE_BACKUP STREQUAL static) + # If openblas has been built with static crt linkage we cannot use it with gfortran! + set(USE_OPTIMIZED_BLAS OFF) + #Cannot use openblas from vcpkg if we are building with gfortran here. + if("noblas" IN_LIST FEATURES) + message(FATAL_ERROR "Feature 'noblas' cannot be used without supplying an external fortran compiler") + endif() + endif() +else() + set(USE_OPTIMIZED_BLAS ON) +endif() +vcpkg_configure_cmake( + PREFER_NINJA + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + "-DUSE_OPTIMIZED_BLAS=${USE_OPTIMIZED_BLAS}" + "-DCBLAS=${CBLAS}" + "${FORTRAN_CMAKE}" + ) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/lapack-${lapack_ver}) #Should the target path be lapack and not lapack-reference? + +set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/lapack.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") +endif() +set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/lapack.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") +endif() +if(NOT USE_OPTIMIZED_BLAS) + set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() + set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc") + if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + endif() +endif() +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +# remove debug includs +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_TARGET_IS_WINDOWS) + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/lib/lapack.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/liblapack.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/lapack.lib") + endif() + if(NOT USE_OPTIMIZED_BLAS) + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libblas.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/lib/blas.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libblas.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/blas.lib") + endif() + endif() +endif() + +if(NOT VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack) +endif() diff --git a/ports/lapack-reference/vcpkg-cmake-wrapper.cmake b/ports/lapack-reference/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..a91b040ca90298 --- /dev/null +++ b/ports/lapack-reference/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,2 @@ +message(STATUS "Using VCPKG FindLAPACK. Remove if CMake has been updated to account for -lm and -lgfortran in lapack-reference!") +include(${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake) diff --git a/ports/lapack/CMakeLists.txt b/ports/lapack/CMakeLists.txt new file mode 100644 index 00000000000000..07b2818b1a4a97 --- /dev/null +++ b/ports/lapack/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.17) + +project(Find_LAPACK_external) +find_package(LAPACK REQUIRED) +#TODO make sure that the found LAPACK is outside VCPKG \ No newline at end of file diff --git a/ports/lapack/CONTROL b/ports/lapack/CONTROL new file mode 100644 index 00000000000000..c4e27f77d36db5 --- /dev/null +++ b/ports/lapack/CONTROL @@ -0,0 +1,4 @@ +Source: lapack +Version: 1 +Description: Metapackage for packages which provide LAPACK +Build-Depends: clapack ((arm&windows)|uwp), lapack-reference(!uwp&!(arm&windows)) \ No newline at end of file diff --git a/ports/clapack/FindLAPACK.cmake b/ports/lapack/clapack/FindLAPACK.cmake similarity index 100% rename from ports/clapack/FindLAPACK.cmake rename to ports/lapack/clapack/FindLAPACK.cmake diff --git a/ports/clapack/vcpkg-cmake-wrapper.cmake b/ports/lapack/clapack/vcpkg-cmake-wrapper.cmake similarity index 100% rename from ports/clapack/vcpkg-cmake-wrapper.cmake rename to ports/lapack/clapack/vcpkg-cmake-wrapper.cmake diff --git a/ports/lapack/portfile.cmake b/ports/lapack/portfile.cmake new file mode 100644 index 00000000000000..ab7f28a0bf0f46 --- /dev/null +++ b/ports/lapack/portfile.cmake @@ -0,0 +1,10 @@ +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) +# Make sure LAPACK can be found + +if(VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + # Install clapack wrappers. + file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/clapack/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share//${PORT}) + file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/clapack/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share//${PORT}) +endif() +vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR} + OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}") diff --git a/ports/libass/CMakeLists.txt b/ports/libass/CMakeLists.txt index 32d7ef097d3a5c..aacf89d86b0b75 100644 --- a/ports/libass/CMakeLists.txt +++ b/ports/libass/CMakeLists.txt @@ -7,18 +7,30 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -# This is Windows-specific. Other acceptable values on different platforms should be -# macOS - CONFIG_CORETEXT -# linux - CONFIG_FONTCONFIG -add_compile_definitions(CONFIG_DIRECTWRITE) +if(WIN32) + add_compile_definitions(CONFIG_DIRECTWRITE) +elseif(APPLE) + add_compile_definitions(CONFIG_CORETEXT) +else() + add_compile_definitions(CONFIG_FONTCONFIG) +endif() + add_compile_definitions(CONFIG_FREETYPE) add_compile_definitions(CONFIG_FRIBIDI) add_compile_definitions(CONFIG_HARFBUZZ) file (GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/libass/*.c) -list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") -list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +if(WIN32) + list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +elseif(APPLE) + list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_fontconfig.c$") +else() + list(FILTER SOURCES EXCLUDE REGEX ".*ass_coretext.c$") + list(FILTER SOURCES EXCLUDE REGEX ".*ass_directwrite.c$") +endif() find_package(Freetype REQUIRED) @@ -30,18 +42,24 @@ find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h PATH_SUFFIXES harfbuzz) -find_library(FRIBIDI_LIBRARY NAMES fribidi) +find_path(DIRENT_INCLUDE_DIR + NAMES dirent.h) + +find_library(FRIBIDI_LIBRARY NAMES libfribidi fribidi) find_library(HARFBUZZ_LIBRARY NAMES harfbuzz) add_library(ass ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/libass.def) -target_include_directories(ass PRIVATE - ${FRIBIDI_INCLUDE_DIR} +target_include_directories(ass PRIVATE + ${FRIBIDI_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}) - -target_link_libraries(ass PRIVATE - Freetype::Freetype - ${FRIBIDI_LIBRARY} +if(DIRENT_INCLUDE_DIR) + target_include_directories(ass PRIVATE + ${DIRENT_INCLUDE_DIR}) +endif() +target_link_libraries(ass PRIVATE + Freetype::Freetype + ${FRIBIDI_LIBRARY} ${HARFBUZZ_LIBRARY}) install(TARGETS ass diff --git a/ports/libass/CONTROL b/ports/libass/CONTROL deleted file mode 100644 index ea25ea9a189f84..00000000000000 --- a/ports/libass/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: libass -Version: 0.14.0 -Build-Depends: freetype, fribidi, harfbuzz, dirent (windows) -Description: libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. diff --git a/ports/libass/portfile.cmake b/ports/libass/portfile.cmake index 040cadc661dca5..f5ab6606c07ef4 100644 --- a/ports/libass/portfile.cmake +++ b/ports/libass/portfile.cmake @@ -1,6 +1,3 @@ - -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libass/libass @@ -14,9 +11,6 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/libass.def DESTINATION ${SOURCE_PATH}) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libass RENAME copyright) - # Since libass uses automake, make and configure, we use a custom CMake file file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) @@ -27,4 +21,7 @@ vcpkg_configure_cmake( PREFER_NINJA) vcpkg_install_cmake() -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libass/vcpkg.json b/ports/libass/vcpkg.json new file mode 100644 index 00000000000000..151d87cdd6a69e --- /dev/null +++ b/ports/libass/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "libass", + "version-string": "0.14.0", + "port-version": 3, + "description": "libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format", + "homepage": "https://github.com/libass/libass", + "dependencies": [ + { + "name": "dirent", + "platform": "windows" + }, + "freetype", + "fribidi", + "harfbuzz" + ] +} diff --git a/ports/libb2/portfile.cmake b/ports/libb2/portfile.cmake index 2401cf0c1e2e62..992c59f4be3eb5 100644 --- a/ports/libb2/portfile.cmake +++ b/ports/libb2/portfile.cmake @@ -14,6 +14,7 @@ if(CMAKE_HOST_WIN32) endif() vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} OPTIONS ${OPTIONS} ) diff --git a/ports/libb2/vcpkg.json b/ports/libb2/vcpkg.json index 1d2f19db823e96..dbe8dc265e8ed7 100644 --- a/ports/libb2/vcpkg.json +++ b/ports/libb2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libb2", "version-string": "0.98.1", - "port-version": 3, + "port-version": 4, "description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp", "homepage": "https://github.com/BLAKE2/libb2", "supports": "!windows" diff --git a/ports/libcrafter/CONTROL b/ports/libcrafter/CONTROL index b8ebac0bf72624..47538dae935abe 100644 --- a/ports/libcrafter/CONTROL +++ b/ports/libcrafter/CONTROL @@ -1,5 +1,6 @@ Source: libcrafter -Version: 0.3-1 +Version: 0.3 +Port-Version: 2 Homepage: https://github.com/pellegre/libcrafter Description: Libcrafter is a high level library for C++ designed to create and decode network packets. -Build-Depends: libpcap \ No newline at end of file +Build-Depends: libpcap diff --git a/ports/libcrafter/portfile.cmake b/ports/libcrafter/portfile.cmake index 9965b7d3c9f0e9..565a0c3462a575 100644 --- a/ports/libcrafter/portfile.cmake +++ b/ports/libcrafter/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH libcrafter OPTIONS diff --git a/ports/libde265/CONTROL b/ports/libde265/CONTROL new file mode 100644 index 00000000000000..09ab2f2318147f --- /dev/null +++ b/ports/libde265/CONTROL @@ -0,0 +1,5 @@ +Source: libde265 +Version: 1.0.5 +Homepage: https://www.libde265.org/ +Description: Open h.265 video codec implementation. +Supports: !(arm|uwp) diff --git a/ports/libde265/portfile.cmake b/ports/libde265/portfile.cmake new file mode 100644 index 00000000000000..70cfe2e3015b32 --- /dev/null +++ b/ports/libde265/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO strukturag/libde265 + REF v1.0.5 + SHA512 3ff7310fc4621cac0ef1cb9bbc4df61724f8943d57f5263a3663a77f4d90d84716b2a708ee9fec306e909dc8b5e7fe645a641b6a6db795a89a01799be910831e + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libde265/) + +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") +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index daf330e83442ef..93d1aede793073 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,5 +1,6 @@ Source: libepoxy Version: 1.5.4 +Port-Version: 1 Homepage: https://github.com/anholt/libepoxy Description: Epoxy is a library for handling OpenGL function pointer management for you Build-Depends: tool-meson diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index 69482f9c227c9a..caaa02ab200522 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -11,8 +11,7 @@ vcpkg_from_github( libepoxy-1.5.4_Add_call_convention_to_mock_function.patch ) - -if (VCPKG_TARGET_IS_WINDOWS) +if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX) vcpkg_configure_meson(SOURCE_PATH ${SOURCE_PATH} OPTIONS -Denable-glx=no @@ -24,7 +23,7 @@ else() if (NOT autoreconf OR NOT EXISTS "/usr/share/doc/libgles2/copyright") message(FATAL_ERROR "autoreconf and libgles2-mesa-dev must be installed before libepoxy can build. Install them with \"apt-get install dh-autoreconf libgles2-mesa-dev\".") endif() - + find_program(MAKE make) if (NOT MAKE) message(FATAL_ERROR "MAKE not found") @@ -32,34 +31,34 @@ else() file(REMOVE_RECURSE ${SOURCE_PATH}/m4) file(MAKE_DIRECTORY ${SOURCE_PATH}/m4) - + set(LIBEPOXY_CONFIG_ARGS "--enable-x11=yes --enable-glx=yes --enable-egl=yes") - + vcpkg_execute_required_process( COMMAND "autoreconf" -v --install WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME autoreconf-${TARGET_TRIPLET} ) - + message(STATUS "Configuring ${TARGET_TRIPLET}") set(OUT_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/make-build-${TARGET_TRIPLET}-release) - + file(REMOVE_RECURSE ${OUT_PATH_RELEASE}) file(MAKE_DIRECTORY ${OUT_PATH_RELEASE}) - + vcpkg_execute_required_process( COMMAND "./configure" --prefix=${OUT_PATH_RELEASE} "${LIBEPOXY_CONFIG_ARGS}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME config-${TARGET_TRIPLET} ) - + message(STATUS "Building ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME build-${TARGET_TRIPLET}-release ) - + message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND make install diff --git a/ports/libevent/CONTROL b/ports/libevent/CONTROL index 4df532990ce45d..fd98e588a12ddd 100644 --- a/ports/libevent/CONTROL +++ b/ports/libevent/CONTROL @@ -1,5 +1,5 @@ Source: libevent -Version: 2.1.11-5 +Version: 2.1.12 Homepage: https://github.com/libevent/libevent Description: An event notification library Supports: !uwp diff --git a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch index b444ae3e724047..9566f152cc4b27 100644 --- a/ports/libevent/fix-LibeventConfig_cmake_in_path.patch +++ b/ports/libevent/fix-LibeventConfig_cmake_in_path.patch @@ -1,13 +1,13 @@ diff --git a/cmake/LibeventConfig.cmake.in b/cmake/LibeventConfig.cmake.in -index 5422336..d436100 100644 +index 7b808c3..fbf67be 100644 --- a/cmake/LibeventConfig.cmake.in +++ b/cmake/LibeventConfig.cmake.in -@@ -8,7 +8,7 @@ +@@ -58,7 +58,7 @@ endif() + + # Get the path of the current file. get_filename_component(LIBEVENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - - # Set the include directories. --set(LIBEVENT_INCLUDE_DIRS "@EVENT_INSTALL_INCLUDE_DIR@") -+set(LIBEVENT_INCLUDE_DIRS "${LIBEVENT_CMAKE_DIR}/../../include") - - # Include the project Targets file, this contains definitions for IMPORTED targets. - include(${LIBEVENT_CMAKE_DIR}/LibeventTargets.cmake) +-get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE) ++get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../.." ABSOLUTE) + + macro(message_if_needed _flag _msg) + if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) diff --git a/ports/libevent/fix-crt_linkage.patch b/ports/libevent/fix-crt_linkage.patch deleted file mode 100644 index b766b455652ced..00000000000000 --- a/ports/libevent/fix-crt_linkage.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bf333f3..5bc2a54 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -230,7 +230,7 @@ endif() - - if (${MSVC}) - set(msvc_static_runtime OFF) -- if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC") -+ if ("${VCPKG_CRT_LINKAGE}" STREQUAL "STATIC") - set(msvc_static_runtime ON) - endif() - diff --git a/ports/libevent/fix-file_path.patch b/ports/libevent/fix-file_path.patch index 179700b7ed2c17..fb34080f8790d8 100644 --- a/ports/libevent/fix-file_path.patch +++ b/ports/libevent/fix-file_path.patch @@ -1,26 +1,22 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6e91c08..44b6e18 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1430,7 +1430,7 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in - # Calculate the relative directory from the Cmake dir. - file(RELATIVE_PATH - REL_INCLUDE_DIR -- "${EVENT_INSTALL_CMAKE_DIR}" -+ "${CURRENT_PACKAGES_DIR}/${EVENT_INSTALL_CMAKE_DIR}" - "${CMAKE_INSTALL_PREFIX}/include") - - # Note the LIBEVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in, diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake -index 9de4484..411ca9d 100644 +index 04f5837..95d9808 100644 --- a/cmake/AddEventLibrary.cmake +++ b/cmake/AddEventLibrary.cmake -@@ -113,7 +113,7 @@ macro(add_event_library LIB_NAME) - EXPORT LibeventTargets - LIBRARY DESTINATION "lib" COMPONENT lib - ARCHIVE DESTINATION "lib" COMPONENT lib -- RUNTIME DESTINATION "lib" COMPONENT lib -+ RUNTIME DESTINATION "bin" COMPONENT bin - PUBLIC_HEADER DESTINATION "include/event2" - COMPONENT dev - ) +@@ -42,7 +42,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + install(TARGETS "${LIB_NAME}_${TYPE}" + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT bin + COMPONENT dev + ) + else() +@@ -69,7 +69,7 @@ macro(export_install_target TYPE LIB_NAME OUTER_INCLUDES) + EXPORT LibeventTargets-${TYPE} + LIBRARY DESTINATION "lib" COMPONENT lib + ARCHIVE DESTINATION "lib" COMPONENT lib +- RUNTIME DESTINATION "lib" COMPONENT lib ++ RUNTIME DESTINATION "bin" COMPONENT bin + COMPONENT dev + ) + endif() diff --git a/ports/libevent/portfile.cmake b/ports/libevent/portfile.cmake index bd44d8428a5a45..9865cecea3faae 100644 --- a/ports/libevent/portfile.cmake +++ b/ports/libevent/portfile.cmake @@ -3,11 +3,10 @@ vcpkg_fail_port_install(MESSAGE "${PORT} does not currently support UWP" ON_TARG vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libevent/libevent - REF release-2.1.11-stable - SHA512 a34ca4ad4d55a989a4f485f929d0ed2438d070d0e12a19d90c2b12783a562419c64db6a2603b093d958a75246d14ffefc8730c69c90b1b2f48339bde947f0e02 + REF release-2.1.12-stable + SHA512 5d6c6f0072f69a68b190772d4c973ce8f33961912032cdc104ad0854c0950f9d7e28bc274ca9df23897937f0cd8e45d1f214543d80ec271c5a6678814a7f195e PATCHES fix-file_path.patch - fix-crt_linkage.patch fix-LibeventConfig_cmake_in_path.patch ) @@ -23,13 +22,18 @@ else() set(LIBEVENT_LIB_TYPE STATIC) endif() +if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(LIBEVENT_STATIC_RUNTIME ON) +else() + set(LIBEVENT_STATIC_RUNTIME OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} - -DEVENT_INSTALL_CMAKE_DIR:PATH=share/libevent -DEVENT__LIBRARY_TYPE=${LIBEVENT_LIB_TYPE} - -DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE} + -DEVENT__MSVC_STATIC_RUNTIME=${LIBEVENT_STATIC_RUNTIME} -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_REGRESS=ON @@ -38,20 +42,28 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/libevent) -else () - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libevent/) file(RENAME ${CURRENT_PACKAGES_DIR}/bin/event_rpcgen.py ${CURRENT_PACKAGES_DIR}/tools/libevent/event_rpcgen.py) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() +set(_target_suffix) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(_target_suffix static) +else() + set(_target_suffix shared) +endif() +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/libevent/LibeventTargets-${_target_suffix}.cmake + "${CURRENT_PACKAGES_DIR}" + "${CURRENT_INSTALLED_DIR}" +) + vcpkg_copy_pdbs() #Handle copyright diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 95dfbeb56ea68c..a5d4c20941d852 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,4 +1,5 @@ Source: libffi -Version: 3.3-3 +Version: 3.3 +Port-Version: 4 Homepage: https://github.com/libffi/libffi Description: Portable, high level programming interface to various calling conventions diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index 3033319249ce1a..7748d1cb63ca2e 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -6,6 +6,9 @@ vcpkg_from_github( REF v3.3 SHA512 62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83 HEAD_REF master + PATCHES + win64-disable-stackframe-check.patch + win32-disable-stackframe-check.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/libffi/win32-disable-stackframe-check.patch b/ports/libffi/win32-disable-stackframe-check.patch new file mode 100644 index 00000000000000..8fdca8b011ff19 --- /dev/null +++ b/ports/libffi/win32-disable-stackframe-check.patch @@ -0,0 +1,50 @@ +Rolf Gebhardt +22 Jul 2020 +[PATCH] x86/win32: disable runtime stack frame checks with msvc + around built assembly + +based on the patch for x86/win64: + +From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Fri, 16 Mar 2018 15:10:04 +1100 +Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc + around built assembly + +MSVC can add truntime code that checks if a stack frame is mismanaged +however our custom assembly delibrately accesses and modifies the parent +stack frame. Fortunately we can disable that specific check for the +function call so do that. +--- + src/x86/ffi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/x86/ffi.c b/src/x86/ffi.c +index 9a59218..9f5d703 100644 +--- a/src/x86/ffi.c ++++ b/src/x86/ffi.c +@@ -255,6 +255,14 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = { + + extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; + ++/* we perform some black magic here to use some of the parent's ++ * stack frame in ff_call_win() that breaks with the msvc compiler ++ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time ++ * error checking' for this function so we don't hit weird exceptions ++ * in debug builds */ ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", off) ++#endif + static void + ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +@@ -390,6 +398,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + + ffi_call_i386 (frame, stack); + } ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", restore) ++#endif + + void + ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libffi/win64-disable-stackframe-check.patch b/ports/libffi/win64-disable-stackframe-check.patch new file mode 100644 index 00000000000000..ce3d3ca5574009 --- /dev/null +++ b/ports/libffi/win64-disable-stackframe-check.patch @@ -0,0 +1,43 @@ +From 53291b332b1bc061a3409d3b60c38f313609b98e Mon Sep 17 00:00:00 2001 +From: Matthew Waters +Date: Fri, 16 Mar 2018 15:10:04 +1100 +Subject: [PATCH] x86/win64: disable runtime stack frame checks with msvc + around built assembly + +MSVC can add truntime code that checks if a stack frame is mismanaged +however our custom assembly delibrately accesses and modifies the parent +stack frame. Fortunately we can disable that specific check for the +function call so do that. +--- + src/x86/ffiw64.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/x86/ffiw64.c b/src/x86/ffiw64.c +index f7875252..88bb3a34 100644 +--- a/src/x86/ffiw64.c ++++ b/src/x86/ffiw64.c +@@ -106,6 +106,14 @@ EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) + return FFI_OK; + } + ++/* we perform some black magic here to use some of the parent's ++ * stack frame in ff_call_win64() that breaks with the msvc compiler ++ * with the /RTCs or /GZ flags. Disable the 'Stack frame run time ++ * error checking' for this function so we don't hit weird exceptions ++ * in debug builds */ ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", off) ++#endif + static void + ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) +@@ -170,6 +178,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + + ffi_call_win64 (stack, frame, closure); + } ++#if defined(_MSC_VER) ++#pragma runtime_checks("s", restore) ++#endif + + void + EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) diff --git a/ports/libflac/CONTROL b/ports/libflac/CONTROL index 745494c7705fed..696e9fffb2ed5d 100644 --- a/ports/libflac/CONTROL +++ b/ports/libflac/CONTROL @@ -1,5 +1,6 @@ Source: libflac -Version: 1.3.3-1 +Version: 1.3.3 +Port-Version: 3 Homepage: https://xiph.org/flac/ Description: Library for manipulating FLAC files Build-Depends: libogg diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 72309d9bbaf900..36f7b997ee7612 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -9,6 +9,20 @@ vcpkg_from_github( "${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(BUILD_SHARED_LIBS ON) +else() + set(BUILD_SHARED_LIBS OFF) +endif() + +if(VCPKG_TARGET_IS_MINGW) + set(WITH_STACK_PROTECTOR OFF) + string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0") + string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0") +else() + set(WITH_STACK_PROTECTOR ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA @@ -16,7 +30,9 @@ vcpkg_configure_cmake( -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF - -DBUILD_TESTING=OFF) + -DBUILD_TESTING=OFF + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} + -DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR}) vcpkg_install_cmake() vcpkg_fixup_cmake_targets( @@ -28,7 +44,26 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + "#if defined(FLAC__NO_DLL)" + "#if 0" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + "#if defined(FLAC__NO_DLL)" + "#if 0" + ) +else() + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + "#if defined(FLAC__NO_DLL)" + "#if 1" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + "#if defined(FLAC__NO_DLL)" + "#if 1" + ) +endif() + # This license (BSD) is relevant only for library - if someone would want to install # FLAC cmd line tools as well additional license (GPL) should be included -file(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libftdi1/CONTROL b/ports/libftdi1/CONTROL index d282ad9eb8d28a..daab99f1793d30 100644 --- a/ports/libftdi1/CONTROL +++ b/ports/libftdi1/CONTROL @@ -1,4 +1,4 @@ Source: libftdi1 -Version: 1.4 +Version: 1.4-1 Build-Depends: libusb Description: FTDI USB driver with bitbang mode (v1.4) diff --git a/ports/libftdi1/portfile.cmake b/ports/libftdi1/portfile.cmake index 4007e91220b3f5..e05ccca2064556 100644 --- a/ports/libftdi1/portfile.cmake +++ b/ports/libftdi1/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE URLS "https://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.4.tar.bz2" FILENAME "libftdi1-1.4.tar.bz2" @@ -26,7 +24,6 @@ vcpkg_configure_cmake( -DEXAMPLES=OFF -DPYTHON_BINDINGS=OFF -DLINK_PYTHON_LIBRARY=OFF - -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON -DCMAKE_DISABLE_FIND_PACKAGE_Confuse=ON @@ -41,7 +38,10 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libftdi1 TARGET_PATH share/libft file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libftdi1) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libftdi1/LICENSE ${CURRENT_PACKAGES_DIR}/share/libftdi1/copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libgpod/CMakeLists.txt b/ports/libgpod/CMakeLists.txt index 233efc72231f26..ea1294906ee3ae 100644 --- a/ports/libgpod/CMakeLists.txt +++ b/ports/libgpod/CMakeLists.txt @@ -4,7 +4,7 @@ project (libgpod C) option(WITH_INTERNAL_GCHECKSUM OFF) -find_package(sqlite3 CONFIG REQUIRED) +find_package(unofficial-sqlite3 CONFIG REQUIRED) include(SelectLibraryConfigurations) find_path(glib_PATH glib.h PATHS include) @@ -66,7 +66,7 @@ if (WITH_INTERNAL_GCHECKSUM) endif() target_compile_definitions(libgpod PRIVATE -DLIBGPOD_BLOB_DIR=\"${LIBGPOD_BLOB_DIR}\" -DGETTEXT_PACKAGE="libgpod") -target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} sqlite3) +target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} unofficial::sqlite3::sqlite3) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/itdb.h DESTINATION include/libgpod/gpod) diff --git a/ports/libgpod/CONTROL b/ports/libgpod/CONTROL index 01134d30349476..2d6fe295cbb868 100644 --- a/ports/libgpod/CONTROL +++ b/ports/libgpod/CONTROL @@ -1,5 +1,6 @@ Source: libgpod Version: 2019-08-29 +Port-Version: 1 Homepage: https://github.com/fadingred/libgpod Description: libgpod is a library meant to abstract access to an iPod content. Build-Depends: glib, libplist, sqlite3 \ No newline at end of file diff --git a/ports/libheif/CONTROL b/ports/libheif/CONTROL new file mode 100644 index 00000000000000..c6dc34356082a4 --- /dev/null +++ b/ports/libheif/CONTROL @@ -0,0 +1,6 @@ +Source: libheif +Version: 1.7.0 +Port-Version: 1 +Homepage: http://www.libheif.org/ +Description: Open h.265 video codec implementation. +Build-Depends: x265, libde265 diff --git a/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch b/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch new file mode 100644 index 00000000000000..78bab905a380dc --- /dev/null +++ b/ports/libheif/dont_build_examples_and_gdk_pixbuf.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4463476..3a5cfbc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,6 +80,6 @@ configure_file(libheif.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +-add_subdirectory (examples) ++#add_subdirectory (examples) + add_subdirectory (libheif) +-add_subdirectory (gdk-pixbuf) ++#add_subdirectory (gdk-pixbuf) diff --git a/ports/libheif/install-extra-headers.patch b/ports/libheif/install-extra-headers.patch new file mode 100644 index 00000000000000..eb32ee8a408dab --- /dev/null +++ b/ports/libheif/install-extra-headers.patch @@ -0,0 +1,12 @@ +diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt +index 6d683ec..dc2c4eb 100644 +--- a/libheif/CMakeLists.txt ++++ b/libheif/CMakeLists.txt +@@ -17,6 +17,7 @@ set(libheif_headers + heif_plugin_registry.h + heif_limits.h + heif_plugin.h ++ heif_cxx.h + logging.h + ${CMAKE_CURRENT_BINARY_DIR}/heif_version.h + ) diff --git a/ports/libheif/portfile.cmake b/ports/libheif/portfile.cmake new file mode 100644 index 00000000000000..97068d449bae66 --- /dev/null +++ b/ports/libheif/portfile.cmake @@ -0,0 +1,21 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO strukturag/libheif + REF v1.7.0 + SHA512 7da6ab9daf253c2493e0c3960c6f817e0234dfbd0463467cd1e5f11f7d6804735e401b73fb1038b8f81cfc6527fafb6ac7f4668c3de9400a0131c1292bdbe660 + HEAD_REF master + PATCHES + dont_build_examples_and_gdk_pixbuf.patch + remove_finding_pkgconfig.patch + install-extra-headers.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libheif/) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libheif/remove_finding_pkgconfig.patch b/ports/libheif/remove_finding_pkgconfig.patch new file mode 100644 index 00000000000000..ed8913a22b352b --- /dev/null +++ b/ports/libheif/remove_finding_pkgconfig.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3a5cfbc..9a3046e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,10 +52,9 @@ if (has_potentially_evaluated_expression) + endif() + + if (UNIX) +- find_package(PkgConfig) +- pkg_check_modules(LIBDE265 libde265) +- pkg_check_modules(X265 x265) +- pkg_check_modules(AOM aom) ++ find_package(libde265) ++ find_package(x265) ++ find_package(aom) + endif() + + # Create libheif pkgconfig file diff --git a/ports/libigl/CONTROL b/ports/libigl/CONTROL index 90c5313fbd8572..496f735700ffeb 100644 --- a/ports/libigl/CONTROL +++ b/ports/libigl/CONTROL @@ -1,8 +1,9 @@ Source: libigl -Version: 2.1.0-2 +Version: 2.2.0 Homepage: https://github.com/libigl/libigl Description: libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB. Build-Depends: eigen3 +Supports: !(arm|uwp) Feature: embree Description: Build with embree @@ -20,18 +21,6 @@ Feature: imgui Description: Build with imgui Build-Depends: imgui[bindings] -Feature: png -Description: Build with libpng -Build-Depends: libpng, stb - Feature: xml Description: Build with libxml Build-Depends: tinyxml2 - -Feature: python -Description: Build with python bind -Build-Depends: pybind11 - -Feature: test -Description: Build test -Build-Depends: catch2 \ No newline at end of file diff --git a/ports/libigl/fix-dependency.patch b/ports/libigl/fix-dependency.patch index 06e3d0f7d00064..e891e341efac4a 100644 --- a/ports/libigl/fix-dependency.patch +++ b/ports/libigl/fix-dependency.patch @@ -1,47 +1,51 @@ +diff --git a/cmake/LibiglWindows.cmake b/cmake/LibiglWindows.cmake +index b98aa55..46c68a7 100644 +--- a/cmake/LibiglWindows.cmake ++++ b/cmake/LibiglWindows.cmake +@@ -1,4 +1,4 @@ +-if(MSVC) ++if(0) + option(IGL_STATIC_RUNTIME "Use libigl with the static MSVC runtime." OFF) + if(IGL_STATIC_RUNTIME) + message(STATUS "MSVC -> forcing use of statically-linked runtime.") diff --git a/cmake/libigl.cmake b/cmake/libigl.cmake -index 7016cbf..3a6b4dd 100644 +index d07bbb3..a33cefa 100644 --- a/cmake/libigl.cmake +++ b/cmake/libigl.cmake -@@ -96,8 +96,9 @@ if(UNIX) +@@ -107,7 +107,8 @@ if(HUNTER_ENABLED) endif() # Eigen --if(TARGET Eigen3::Eigen) -+if(1) - # If an imported target already exists, use it -+ find_package(Eigen3 CONFIG REQUIRED) - target_link_libraries(igl_common INTERFACE Eigen3::Eigen) - else() +-if(NOT TARGET Eigen3::Eigen) ++find_package(Eigen3 CONFIG REQUIRED) ++if(0) igl_download_eigen() -@@ -182,7 +183,7 @@ compile_igl_module("core" ${SOURCES_IGL}) + add_library(igl_eigen INTERFACE) + target_include_directories(igl_eigen SYSTEM INTERFACE +@@ -296,9 +297,9 @@ endif() ################################################################################ - ### Download the python part ### - if(LIBIGL_WITH_PYTHON) -- igl_download_pybind11() -+ #igl_download_pybind11() - endif() - - ################################################################################ -@@ -281,7 +282,8 @@ if(LIBIGL_WITH_EMBREE) - set(EMBREE_STATIC_RUNTIME ON CACHE BOOL " " FORCE) - endif() + ### Compile the embree part ### + if(LIBIGL_WITH_EMBREE) +- set(EMBREE_DIR "${LIBIGL_EXTERNAL}/embree") ++ find_package(embree 3 CONFIG REQUIRED) - if(NOT TARGET embree) -+ find_package(embree 3 CONFIG REQUIRED) + if(0) - # TODO: Should probably save/restore the CMAKE_CXX_FLAGS_*, since embree seems to be - # overriding them on Windows. But well... it works for now. igl_download_embree() -@@ -289,7 +291,7 @@ if(LIBIGL_WITH_EMBREE) + + set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "") +@@ -315,8 +316,8 @@ if(LIBIGL_WITH_EMBREE) endif() compile_igl_module("embree") - target_link_libraries(igl_embree ${IGL_SCOPE} embree) -+ target_link_libraries(igl_embree ${IGL_SCOPE} sys math simd embree) - target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) +- target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_DIR}/include) ++ target_link_libraries(igl_embree ${IGL_SCOPE} ${EMBREE_LIBRARIES}) ++ target_include_directories(igl_embree ${IGL_SCOPE} ${EMBREE_INCLUDE_DIRS}) target_compile_definitions(igl_embree ${IGL_SCOPE} -DEMBREE_STATIC_LIB) endif() -@@ -332,11 +334,12 @@ if(LIBIGL_WITH_OPENGL) + +@@ -358,11 +359,12 @@ if(LIBIGL_WITH_OPENGL) endif() # glad module @@ -56,17 +60,17 @@ index 7016cbf..3a6b4dd 100644 endif() ################################################################################ -@@ -345,7 +348,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) +@@ -371,7 +373,8 @@ if(LIBIGL_WITH_OPENGL_GLFW) if(TARGET igl::opengl) # GLFW module compile_igl_module("opengl/glfw") - if(NOT TARGET glfw) + find_package(glfw3 CONFIG REQUIRED) + if(0) - set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) - set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE) - set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE) -@@ -363,9 +367,10 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) + igl_download_glfw() + option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) + option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) +@@ -394,11 +397,12 @@ if(LIBIGL_WITH_OPENGL_GLFW_IMGUI) if(TARGET igl::opengl_glfw) # ImGui module compile_igl_module("opengl/glfw/imgui") @@ -74,12 +78,14 @@ index 7016cbf..3a6b4dd 100644 + find_package(imgui CONFIG REQUIRED) + if(0) igl_download_imgui() -- add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) -+ add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui::imgui) + add_subdirectory(${LIBIGL_EXTERNAL}/libigl-imgui imgui) endif() - target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) +- target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui) ++ target_link_libraries(igl_opengl_glfw_imgui ${IGL_SCOPE} igl_opengl_glfw imgui::imgui) endif() -@@ -377,12 +382,21 @@ if(LIBIGL_WITH_PNG) + endif() + +@@ -408,12 +412,22 @@ if(LIBIGL_WITH_PNG) # png/ module is anomalous because it also depends on opengl it really should # be moved into the opengl/ directory and namespace ... if(TARGET igl_opengl) @@ -87,6 +93,7 @@ index 7016cbf..3a6b4dd 100644 + find_path(stb_include_dir stb.h) + find_package(opengl REQUIRED) + find_package(libpng CONFIG REQUIRED) ++ find_package(glad CONFIG REQUIRED) + if (BUILD_SHARED_LIBS) + set(libpng_LIBRARIES png) + else() @@ -98,12 +105,12 @@ index 7016cbf..3a6b4dd 100644 endif() compile_igl_module("png" "") - target_link_libraries(igl_png ${IGL_SCOPE} igl_stb_image igl_opengl) -+ target_include_directories(igl_png PUBLIC ${stb_include_dir}) -+ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES}) ++ target_include_directories(igl_png INTERFACE ${stb_include_dir}) ++ target_link_libraries(igl_png ${IGL_SCOPE} OpenGL::GL ${libpng_LIBRARIES} glad::glad) endif() endif() -@@ -430,7 +444,8 @@ endif() +@@ -461,7 +475,8 @@ endif() ### Compile the xml part ### if(LIBIGL_WITH_XML) set(TINYXML2_DIR "${LIBIGL_EXTERNAL}/tinyxml2") @@ -113,7 +120,7 @@ index 7016cbf..3a6b4dd 100644 igl_download_tinyxml2() add_library(tinyxml2 STATIC ${TINYXML2_DIR}/tinyxml2.cpp ${TINYXML2_DIR}/tinyxml2.h) target_include_directories(tinyxml2 PUBLIC ${TINYXML2_DIR}) -@@ -440,7 +455,7 @@ if(LIBIGL_WITH_XML) +@@ -471,7 +486,7 @@ if(LIBIGL_WITH_XML) SOVERSION "3") endif() compile_igl_module("xml") @@ -136,20 +143,26 @@ index 1d3e3bc..682b6d7 100644 #include #include diff --git a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -index 3939b03..835b208 100644 +index 47de487..6c607de 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp +++ b/include/igl/opengl/glfw/imgui/ImGuiMenu.cpp -@@ -9,7 +9,7 @@ +@@ -9,10 +9,10 @@ #include "ImGuiMenu.h" #include "ImGuiHelpers.h" #include -#include +-#include +-#include +-#include +#include - #include - #include - #include ++#include ++#include ++#include + #include + #include + //////////////////////////////////////////////////////////////////////////////// diff --git a/include/igl/opengl/glfw/imgui/ImGuiTraits.h b/include/igl/opengl/glfw/imgui/ImGuiTraits.h -index fbc892f..e8828b1 100644 +index 7dae22a..e6911c5 100644 --- a/include/igl/opengl/glfw/imgui/ImGuiTraits.h +++ b/include/igl/opengl/glfw/imgui/ImGuiTraits.h @@ -8,7 +8,7 @@ @@ -161,30 +174,11 @@ index fbc892f..e8828b1 100644 // Extend ImGui by populating its namespace directly namespace ImGui -diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt -index 7a14775..f5c84a8 100644 ---- a/python/CMakeLists.txt -+++ b/python/CMakeLists.txt -@@ -23,8 +23,8 @@ endif() - # set(PYTHON_INCLUDE_DIR "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m") - - set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7) --find_package(PythonInterp 3.4 REQUIRED) --find_package(PythonLibs 3.4 REQUIRED) -+find_package(PythonInterp REQUIRED) -+find_package(PythonLibs REQUIRED) - - ## libigl - if(NOT TARGET igl::core) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 8a0af13..5c6a350 100644 +index 273324d..cefbd52 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt -@@ -11,16 +11,14 @@ else() - endif() - - ### Download data --igl_download_test_data() +@@ -15,12 +15,11 @@ igl_download_test_data() set(IGL_TEST_DATA ${LIBIGL_EXTERNAL}/../tests/data) ### Download Catch2 unit test framework @@ -199,7 +193,7 @@ index 8a0af13..5c6a350 100644 # Create test executable diff --git a/tutorial/106_ViewerMenu/main.cpp b/tutorial/106_ViewerMenu/main.cpp -index 09f3272..9e1a19d 100644 +index cc514e5..f1be538 100644 --- a/tutorial/106_ViewerMenu/main.cpp +++ b/tutorial/106_ViewerMenu/main.cpp @@ -2,7 +2,7 @@ diff --git a/ports/libigl/portfile.cmake b/ports/libigl/portfile.cmake index 6407ca812639eb..d3e342b5b6abf5 100644 --- a/ports/libigl/portfile.cmake +++ b/ports/libigl/portfile.cmake @@ -1,10 +1,12 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "uwp") +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libigl/libigl - REF f6b406427400ed7ddb56cfc2577b6af571827c8c #2.1.0 - SHA512 262f0b16e6c018d86d11a7cc90f8f4f8088fa7190634a7cd5cc392ebdefe47e2218b4f9276e411498ae0001d66d0207f4108c87c5090e3a39df4a2760930e945 + REF 3cb4894eaf8ea4610467189ca292be349425d44b #2.2.0 + SHA512 339f96e36b6a99ae8301ec2e234e18cecba7b7c42289ed68a26c20b279dce3135405f9b49e292c321fba962d56c083ae61831057bec9a19ad1495e2afa379b8b HEAD_REF master PATCHES fix-dependency.patch ) @@ -14,10 +16,9 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(LIBIGL_BUILD_STATIC ON) endif() -if ("python" IN_LIST FEATURES) - vcpkg_find_acquire_program(PYTHON2) - get_filename_component(PYTHON2_DIR ${PYTHON2} DIRECTORY) - set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}") +if ("imgui" IN_LIST FEATURES AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Remove this after add port libigl-imgui + message(FATAL_ERROR "Feature imgui does not support static build currentlly") endif() if ("test" IN_LIST FEATURES AND NOT EXISTS ${SOURCE_PATH}/tests/data) @@ -37,10 +38,9 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS opengl LIBIGL_WITH_OPENGL glfw LIBIGL_WITH_OPENGL_GLFW imgui LIBIGL_WITH_OPENGL_GLFW_IMGUI - png LIBIGL_WITH_PNG + #png LIBIGL_WITH_PNG # Disable this feature due to issue https://github.com/libigl/libigl/issues/1199 xml LIBIGL_WITH_XML - python LIBIGL_WITH_PYTHON - test LIBIGL_BUILD_TESTS + #python LIBIGL_WITH_PYTHON # Python binding are in the process of being redone. ) vcpkg_configure_cmake( @@ -55,7 +55,9 @@ vcpkg_configure_cmake( -DLIBIGL_WITH_TRIANGLE=OFF -DLIBIGL_WITH_PREDICATES=OFF -DLIBIGL_BUILD_TUTORIALS=OFF - -DPYTHON_EXECUTABLE=${PYTHON2} + -DLIBIGL_WITH_PNG=OFF + -DLIBIGL_BUILD_TESTS=OFF + -DPYTHON_EXECUTABLE=${PYTHON2} ) vcpkg_install_cmake() @@ -70,4 +72,3 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE.GPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - diff --git a/ports/liblzma/CONTROL b/ports/liblzma/CONTROL index e95b13c3c0d49e..dc9d0fda86c7e5 100644 --- a/ports/liblzma/CONTROL +++ b/ports/liblzma/CONTROL @@ -1,4 +1,5 @@ Source: liblzma Version: 5.2.5 +Port-Version: 1 Homepage: https://github.com/xz-mirror/xz Description: Compression library with an API similar to that of zlib. diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake index acc0dbaaa9b01d..c29dbafedc367e 100644 --- a/ports/liblzma/portfile.cmake +++ b/ports/liblzma/portfile.cmake @@ -68,9 +68,13 @@ set(LZMA_FOUND TRUE CACHE BOOL \"\") set(LIBLZMA_FOUND TRUE CACHE BOOL \"\") ") -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(APPEND ${CURRENT_PACKAGES_DIR}/share/liblzma/LibLZMAConfig.cmake "add_definitions(-DLZMA_API_STATIC)") +file(READ ${CURRENT_PACKAGES_DIR}/include/lzma.h _contents) +if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(LZMA_API_STATIC)" "1" _contents "${_contents}") +else() + string(REPLACE "defined(LZMA_API_STATIC)" "0" _contents "${_contents}") endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/lzma.h "${_contents}") if (VCPKG_BUILD_TYPE STREQUAL debug) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include) diff --git a/ports/libmagic/CONTROL b/ports/libmagic/CONTROL index 07fce2a682e2b0..750b6513901124 100644 --- a/ports/libmagic/CONTROL +++ b/ports/libmagic/CONTROL @@ -1,4 +1,5 @@ Source: libmagic -Version: 5.37-1 +Version: 5.37 +Port-Version: 2 Homepage: https://github.com/file/file -Description: This library can be used to classify files according to magic number tests. \ No newline at end of file +Description: This library can be used to classify files according to magic number tests. diff --git a/ports/libmagic/portfile.cmake b/ports/libmagic/portfile.cmake index 65fe8d8ab6cbfe..363fa148f3f4da 100644 --- a/ports/libmagic/portfile.cmake +++ b/ports/libmagic/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() diff --git a/ports/libmariadb/CONTROL b/ports/libmariadb/CONTROL index 6507c55c71c49e..d3b39d0afc406a 100644 --- a/ports/libmariadb/CONTROL +++ b/ports/libmariadb/CONTROL @@ -1,4 +1,14 @@ Source: libmariadb -Version: 3.1.7-1 +Version: 3.1.7 +Port-Version: 2 Homepage: https://github.com/MariaDB/mariadb-connector-c Description: MariaDB Connector/C is used to connect C/C++ applications to MariaDB and MySQL databases +Default-Features: zlib, openssl + +Feature: zlib +Build-Depends: zlib +Description: Use internal zlib + +Feature: openssl +Build-Depends: openssl +Description: Enable SSL support diff --git a/ports/libmariadb/portfile.cmake b/ports/libmariadb/portfile.cmake index 06f54bb41d55e3..6943c934c0bb88 100644 --- a/ports/libmariadb/portfile.cmake +++ b/ports/libmariadb/portfile.cmake @@ -8,7 +8,7 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO MariaDB/mariadb-connector-c - REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 + REF 8e9c3116105d9a998a60991b7f4ba910d454d4b1 # v3.1.7 SHA512 b663effe7794d997c0589a9a20dab6b7359414612e60e3cb43e3fd0ddeae0391bcbc2d816cba4a7438602566ad6781cbf8e18b0062f1d37a2b2bd521af16033c HEAD_REF master PATCHES @@ -17,12 +17,17 @@ vcpkg_from_github( fix-InstallPath.patch ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + zlib WITH_EXTERNAL_ZLIB + openssl WITH_SSL +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DWITH_UNITTEST=OFF - -DWITH_SSL=OFF -DWITH_CURL=OFF ) diff --git a/ports/libmodbus/CMakeLists.txt b/ports/libmodbus/CMakeLists.txt index c08abe838c3026..618ba5f6cb8992 100644 --- a/ports/libmodbus/CMakeLists.txt +++ b/ports/libmodbus/CMakeLists.txt @@ -59,9 +59,10 @@ configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) if(BUILD_SHARED_LIBS) add_compile_options(-DDLLBUILD=ON) +else() + add_compile_options(-DLIBBUILD=ON) endif() - set(MODBUS_PUBLIC_HEADERS src/modbus-rtu.h src/modbus-tcp.h diff --git a/ports/libmodbus/CONTROL b/ports/libmodbus/CONTROL deleted file mode 100644 index cb3f5a295b73e6..00000000000000 --- a/ports/libmodbus/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: libmodbus -Version: 3.1.6 -Description: libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol diff --git a/ports/libmodbus/fix-static-linkage.patch b/ports/libmodbus/fix-static-linkage.patch new file mode 100644 index 00000000000000..7d7ae79f509e66 --- /dev/null +++ b/ports/libmodbus/fix-static-linkage.patch @@ -0,0 +1,13 @@ +diff --git a/src/modbus.h b/src/modbus.h +index fbe20bc..895d05d 100644 +--- a/src/modbus.h ++++ b/src/modbus.h +@@ -24,6 +24,8 @@ + # if defined(DLLBUILD) + /* define DLLBUILD when building the DLL */ + # define MODBUS_API __declspec(dllexport) ++# elif defined(LIBBUILD) ++# define MODBUS_API + # else + # define MODBUS_API __declspec(dllimport) + # endif diff --git a/ports/libmodbus/portfile.cmake b/ports/libmodbus/portfile.cmake index fda250e4f33310..a607f5a9ed6b8d 100644 --- a/ports/libmodbus/portfile.cmake +++ b/ports/libmodbus/portfile.cmake @@ -1,27 +1,32 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "uwp") vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO stephane/libmodbus - REF v3.1.6 - SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 - HEAD_REF master + OUT_SOURCE_PATH SOURCE_PATH + REPO stephane/libmodbus + REF v3.1.6 + SHA512 9eaa395c75e1170e703e01f8c52c6e6e87efe4eaa22adfc3b51153fd5535d545aea35cf68e1aba29720a6c1dd13d9c60b6b08a5c8098dccd13ccfdc6944420a9 + HEAD_REF master + PATCHES fix-static-linkage.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${CMAKE_CURRENT_LIST_DIR}/config.h.cmake DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( - SOURCE_PATH "${SOURCE_PATH}" - PREFER_NINJA - OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=ON + SOURCE_PATH "${SOURCE_PATH}" + PREFER_NINJA + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/modbus.h "elif defined(LIBBUILD)" "elif 1") +endif() + # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/libmodbus RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) \ No newline at end of file diff --git a/ports/libmodbus/vcpkg.json b/ports/libmodbus/vcpkg.json new file mode 100644 index 00000000000000..cea78893150e31 --- /dev/null +++ b/ports/libmodbus/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "libmodbus", + "version-string": "3.1.6", + "port-version": 1, + "description": "libmodbus is a free software library to send/receive data with a device which respects the Modbus protocol", + "homepage": "https://github.com/stephane/libmodbus", + "supports": "!uwp" +} diff --git a/ports/libmodman/CONTROL b/ports/libmodman/CONTROL index c1fd4cd49c5bf2..21b45a2c6ea368 100644 --- a/ports/libmodman/CONTROL +++ b/ports/libmodman/CONTROL @@ -1,5 +1,5 @@ Source: libmodman -Version: 2.0.1-1 +Version: 2.0.1-2 Homepage: https://code.google.com/p/libmodman Description: a simple library for managing modules diff --git a/ports/libmodman/vcpkg-cmake-wrapper.cmake b/ports/libmodman/vcpkg-cmake-wrapper.cmake index 6d67806f51b153..f3722577475339 100644 --- a/ports/libmodman/vcpkg-cmake-wrapper.cmake +++ b/ports/libmodman/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(LIBMODMAN_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT LIBMODMAN_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${LIBMODMAN_PREV_MODULE_PATH}) diff --git a/ports/libodb-sqlite/CMakeLists.txt b/ports/libodb-sqlite/CMakeLists.txt index 8a62ab9a876df2..e0689fa91f3a36 100644 --- a/ports/libodb-sqlite/CMakeLists.txt +++ b/ports/libodb-sqlite/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.0) project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX) find_package(odb 2.4.0 REQUIRED COMPONENTS libodb) -find_package(sqlite3 CONFIG) +find_package(unofficial-sqlite3 CONFIG) configure_file(config.unix.h.in odb/sqlite/details/config.h COPYONLY) set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") @@ -17,7 +17,7 @@ target_include_directories(libodb-sqlite $ ) -target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3) +target_link_libraries(libodb-sqlite PRIVATE odb::libodb unofficial::sqlite3::sqlite3) if(BUILD_SHARED_LIBS) target_compile_definitions(libodb-sqlite PRIVATE -DLIBODB_SQLITE_DYNAMIC_LIB diff --git a/ports/libodb-sqlite/CONTROL b/ports/libodb-sqlite/CONTROL index e7afd76e0ef20e..ae35fc37219ab1 100644 --- a/ports/libodb-sqlite/CONTROL +++ b/ports/libodb-sqlite/CONTROL @@ -1,5 +1,6 @@ Source: libodb-sqlite -Version: 2.4.0-6 +Version: 2.4.0 +Port-Version: 7 Homepage: https://www.codesynthesis.com/products/odb/ Description: Sqlite support for the ODB ORM library Build-Depends: libodb, sqlite3 diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index 0258a720e625ff..988f95ebf9e65a 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,6 @@ Source: libpng -Version: 1.6.37-9 +Version: 1.6.37 +Port-Version: 11 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/libpng/pkgconfig.2.patch b/ports/libpng/pkgconfig.2.patch new file mode 100644 index 00000000000000..99c1b19300d950 --- /dev/null +++ b/ports/libpng/pkgconfig.2.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6451fcf..4090f42 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -821,20 +821,31 @@ endif() + # Only do this on Windows for Cygwin - the files don't make much sense outside + # of a UNIX look-alike. + if(NOT WIN32 OR CYGWIN OR MINGW) +- set(prefix ${CMAKE_INSTALL_PREFIX}) +- set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +- set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) +- set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +- set(LIBS "-lz -lm") +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in +- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) +- create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) +- +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in +- ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) +- create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) ++ set(LIBS "-lz") ++ if(NOT APPLE) ++ string(APPEND LIBS " -lm") ++ endif() ++else() ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(LIBS "-lzlibd") ++ else() ++ set(LIBS "-lzlib") ++ endif() + endif() + ++set(prefix ${CMAKE_INSTALL_PREFIX}) ++set(exec_prefix ${CMAKE_INSTALL_PREFIX}) ++set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) ++set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) ++ ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) ++create_symlink(libpng.pc FILE ${PNGLIB_NAME}.pc) ++ ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) ++create_symlink(libpng-config FILE ${PNGLIB_NAME}-config) ++ + # SET UP LINKS + if(PNG_SHARED) + set_target_properties(png PROPERTIES diff --git a/ports/libpng/pkgconfig.patch b/ports/libpng/pkgconfig.patch new file mode 100644 index 00000000000000..5640f3834ca44c --- /dev/null +++ b/ports/libpng/pkgconfig.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6599e1d7d..c0bb2fad2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -894,13 +894,13 @@ if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) + install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3) + install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5) + # Install pkg-config files ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config +- DESTINATION bin) ++ DESTINATION tools/libpng) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config +- DESTINATION bin) ++ DESTINATION tools/libpng) + endif() diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index 28fee46f3a4522..d366283b1ebc62 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -14,16 +14,13 @@ if ("apng" IN_LIST FEATURES) FILENAME "${LIBPNG_APG_PATCH_NAME}.gz" SHA512 226adcb3a8c60f2267fe2976ab531329ae43c2603dab4d0cf8f16217d64069936b879f3d6516b75d259c47d6f5c5b1f24f887602206c8e46abde0fb7f5c7946b ) - vcpkg_find_acquire_program(7Z) - vcpkg_execute_required_process( COMMAND ${7Z} x ${LIBPNG_APNG_PATCH_ARCHIVE} -aoa WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src LOGNAME extract-patch.log ) endif() - set(APNG_EXTRA_PATCH ${LIBPNG_APG_PATCH_PATH}) set(LIBPNG_APNG_OPTION "-DPNG_PREFIX=a") endif() @@ -37,6 +34,8 @@ vcpkg_from_github( PATCHES use_abort.patch cmake.patch + pkgconfig.patch + pkgconfig.2.patch ${APNG_EXTRA_PATCH} ) @@ -62,6 +61,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DPNG_MAN_DIR=share/${PORT}/man ${LIBPNG_APNG_OPTION} ${LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION} ${LD_VERSION_SCRIPT_OPTION} @@ -71,15 +71,65 @@ vcpkg_configure_cmake( -DPNG_TESTS=OFF -DSKIP_INSTALL_PROGRAMS=ON -DSKIP_INSTALL_EXECUTABLES=ON - -DSKIP_INSTALL_FILES=ON - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON + -DSKIP_INSTALL_FILES=OFF + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON ) - vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/libpng) +set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng16.pc") +if(EXISTS ${_file}) + file(READ "${_file}" _contents) + if(VCPKG_TARGET_IS_WINDOWS) + string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") + else() + string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") + endif() + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") + else() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") +endif() +set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpng.pc") +if(EXISTS ${_file}) + file(READ "${_file}" _contents) + if(VCPKG_TARGET_IS_WINDOWS) + string(REGEX REPLACE "-lpng16(d)?" "-llibpng16d" _contents "${_contents}") + else() + string(REGEX REPLACE "-lpng16(d)?" "-lpng16d" _contents "${_contents}") + endif() + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlibd" _contents "${_contents}") + else() + string(REPLACE "-lzlib" "-lzlibd" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") +endif() +if(VCPKG_TARGET_IS_WINDOWS) + set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng16.pc") + if(EXISTS ${_file}) + file(READ "${_file}" _contents) + string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlib" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + endif() + set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng.pc") + if(EXISTS ${_file}) + file(READ "${_file}" _contents) + string(REPLACE "-lpng16" "-llibpng16" _contents "${_contents}") + if(VCPKG_TARGET_IS_MINGW) + string(REPLACE "-lz" "-lzlib" _contents "${_contents}") + endif() + file(WRITE "${_file}" "${_contents}") + endif() +endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) vcpkg_copy_pdbs() - +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index cd63f76717490f..e42dd5f5e20c60 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,6 +1,6 @@ Source: libpq Version: 12.2 -Port-Version: 5 +Port-Version: 6 Build-Depends: libpq[bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 756e20d1b2e383..3d147104e2d3f1 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -67,7 +67,11 @@ vcpkg_extract_source_archive_ex( ) unset(buildenv_contents) # Get paths to required programs -foreach(program_name BISON FLEX PERL) +set(REQUIRED_PROGRAMS PERL) +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND REQUIRED_PROGRAMS BISON FLEX) +endif() +foreach(program_name ${REQUIRED_PROGRAMS}) # Need to rename win_bison and win_flex to just bison and flex vcpkg_find_acquire_program(${program_name}) get_filename_component(${program_name}_EXE_PATH ${${program_name}} DIRECTORY) diff --git a/ports/libproxy/CONTROL b/ports/libproxy/CONTROL index 051420c855651a..1855f9947a3e46 100644 --- a/ports/libproxy/CONTROL +++ b/ports/libproxy/CONTROL @@ -1,5 +1,5 @@ Source: libproxy -Version: 0.4.15-1 +Version: 0.4.15-2 Homepage: https://github.com/libproxy/libproxy Description: libproxy is a library that provides automatic proxy configuration management. Build-Depends: libmodman diff --git a/ports/libproxy/vcpkg-cmake-wrapper.cmake b/ports/libproxy/vcpkg-cmake-wrapper.cmake index 31c99f39f07d25..63158432bc5ae4 100644 --- a/ports/libproxy/vcpkg-cmake-wrapper.cmake +++ b/ports/libproxy/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(LIBPROXY_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT LIBPROXY_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${LIBPROXY_PREV_MODULE_PATH}) diff --git a/ports/libraqm/CMakeLists.txt b/ports/libraqm/CMakeLists.txt index 22f4e59d9d98d0..9ad1db64a6bc86 100644 --- a/ports/libraqm/CMakeLists.txt +++ b/ports/libraqm/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(harfbuzz CONFIG REQUIRED) find_path(HARFBUZZ_INCLUDE_DIRS NAMES hb.h PATH_SUFFIXES harfbuzz) -find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h) +find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2) configure_file(src/raqm-version.h.in src/raqm-version.h) diff --git a/ports/libraqm/CONTROL b/ports/libraqm/CONTROL index d768af76f72dda..460e66c1676a97 100644 --- a/ports/libraqm/CONTROL +++ b/ports/libraqm/CONTROL @@ -1,4 +1,5 @@ Source: libraqm -Version: 0.7.0-1 +Version: 0.7.0 +Port-Version: 2 Description: A library for complex text layout Build-Depends: freetype, harfbuzz, fribidi \ No newline at end of file diff --git a/ports/librdkafka/CONTROL b/ports/librdkafka/CONTROL index f88fa9bb325cac..12f1ae21bde613 100644 --- a/ports/librdkafka/CONTROL +++ b/ports/librdkafka/CONTROL @@ -1,5 +1,5 @@ Source: librdkafka -Version: 1.2.0-2 +Version: 1.5.0 Description: The Apache Kafka C/C++ library Homepage: https://github.com/edenhill/librdkafka diff --git a/ports/librdkafka/portfile.cmake b/ports/librdkafka/portfile.cmake index f64aa17f069f22..5ae2b695e846e9 100644 --- a/ports/librdkafka/portfile.cmake +++ b/ports/librdkafka/portfile.cmake @@ -1,10 +1,8 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO edenhill/librdkafka - REF v1.2.0 - SHA512 7caddeec09bd1556688f0011f5cae49f8b0cde55b8dbc1296b3d2a39879badc42b7f59369bb1938ce7c4c4ff8b0fe4f1973b923c3db603466c10a4c015306522 + REF 39796d359898c07ea422849e6d7cd34cd13ec466 #v1.5.0 + SHA512 96bc1e1063d4387483f955315a8523045a308aba5fc40197c805f14ceb12ff5241f98b6937c41ab84094fe39e034e8b11ba66dd4d69a758b6ecb20d56d78cbfe HEAD_REF master PATCHES fix-arm64.patch @@ -78,6 +76,3 @@ configure_file(${SOURCE_PATH}/LICENSES.txt ${CURRENT_PACKAGES_DIR}/share/${PORT} # Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME RdKafka) diff --git a/ports/libressl/CONTROL b/ports/libressl/CONTROL index a5dfd10c70e388..2b7d62ec20a9a6 100644 --- a/ports/libressl/CONTROL +++ b/ports/libressl/CONTROL @@ -1,5 +1,6 @@ Source: libressl -Version: 2.9.1-2 +Version: 2.9.1 +Port-Version: 3 Description: LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes. Supports: !(uwp|arm) diff --git a/ports/libressl/portfile.cmake b/ports/libressl/portfile.cmake index 5c8e5b964ce65d..7e37c207edd966 100644 --- a/ports/libressl/portfile.cmake +++ b/ports/libressl/portfile.cmake @@ -1,26 +1,17 @@ -cmake_minimum_required(VERSION 3.13) - if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") message(WARNING "Can't build libressl if openssl is installed. Please remove openssl, and try install libressl again if you need it. Build will continue since libressl is a subset of openssl") set(VCPKG_POLICY_EMPTY_PACKAGE enabled) return() endif() -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP") -endif() -if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - message(FATAL_ERROR "${PORT} does not support ARM") -endif() - -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") set(LIBRESSL_VERSION 2.9.1) set(LIBRESSL_HASH 7051911e566bb093c48a70da72c9981b870e3bf49a167ba6c934eece873084cc41221fbe3cd0c8baba268d0484070df7164e4b937854e716337540a87c214354) vcpkg_download_distfile( LIBRESSL_SOURCE_ARCHIVE - URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz + URLS https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz https://ftp.fau.de/openbsd/LibreSSL/${PORT}-${LIBRESSL_VERSION}.tar.gz FILENAME ${PORT}-${LIBRESSL_VERSION}.tar.gz SHA512 ${LIBRESSL_HASH} ) @@ -34,16 +25,15 @@ vcpkg_extract_source_archive_ex( 0002-suppress-msvc-warnings.patch ) -set(LIBRESSL_APPS OFF) -if("tools" IN_LIST FEATURES) - set(LIBRESSL_APPS ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "tools" LIBRESSL_APPS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DLIBRESSL_APPS=${LIBRESSL_APPS} + ${FEATURE_OPTIONS} -DLIBRESSL_TESTS=OFF OPTIONS_DEBUG -DLIBRESSL_APPS=OFF @@ -51,8 +41,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(LIBRESSL_APPS) - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) +if("tools" IN_LIST FEATURES) + if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) set(EXECUTABLE_SUFFIX .exe) endif() file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/openssl") @@ -73,15 +63,12 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" ) -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") -endif() vcpkg_copy_pdbs() file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -if((NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) +if((VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")) file(GLOB_RECURSE LIBS "${CURRENT_PACKAGES_DIR}/*.lib") foreach(LIB ${LIBS}) string(REGEX REPLACE "(.+)-[0-9]+\\.lib" "\\1.lib" LINK "${LIB}") diff --git a/ports/libsndfile/CONTROL b/ports/libsndfile/CONTROL index ed59ac139eaf4c..913af809d22801 100644 --- a/ports/libsndfile/CONTROL +++ b/ports/libsndfile/CONTROL @@ -1,5 +1,6 @@ Source: libsndfile -Version: 1.0.29-9 +Version: 1.0.29 +Port-Version: 10 Description: Library to read, write and manipulate many soundfile types. Authored by Eric de Castro Lopo Homepage: https://github.com/erikd/libsndfile Default-Features: external-libs diff --git a/ports/libsndfile/portfile.cmake b/ports/libsndfile/portfile.cmake index ce8f9427b7b93b..1e86fbffbdc53f 100644 --- a/ports/libsndfile/portfile.cmake +++ b/ports/libsndfile/portfile.cmake @@ -19,9 +19,6 @@ option(BUILD_EXECUTABLES "Build sndfile tools and install to folder tools" OFF) if("external-libs" IN_LIST FEATURES) set(SNDFILE_WITHOUT_EXTERNAL_LIBS OFF) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(FLAC_EXPORT_DEFINITION "-DFLAC__NO_DLL") - endif() else() set(SNDFILE_WITHOUT_EXTERNAL_LIBS ON) endif() @@ -37,7 +34,6 @@ vcpkg_configure_cmake( -DENABLE_STATIC_RUNTIME=${CRT_LIB_STATIC} -DBUILD_STATIC_LIBS=${BUILD_STATIC} -DDISABLE_EXTERNAL_LIBS=${SNDFILE_WITHOUT_EXTERNAL_LIBS} - -DCMAKE_C_FLAGS=${FLAC_EXPORT_DEFINITION} OPTIONS_RELEASE -DBUILD_PROGRAMS=${BUILD_EXECUTABLES} OPTIONS_DEBUG diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index c6cd574b7fdbd1..48505d85a58978 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,9 +1,9 @@ Source: libtorrent -Version: 1.2.7 +Version: 1.2.8 Homepage: https://github.com/arvidn/libtorrent Description: An efficient feature complete C++ BitTorrent implementation Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision, boost-variant -Supports: !uwp +Supports: !uwp&!(windows&arm) Feature: deprfun Description: build with deprecated functions enabled diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index bdab0a37400fb9..e88ddf7cc2ce85 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -39,8 +39,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO arvidn/libtorrent - REF libtorrent_1_2_7 - SHA512 8a6b0ab387e538351ad770ad189ceaa29f0c382b7152d65d3b40b4271716c8f1550c51189ac1e2550683b69f24abbd667d13a0197e7db2ac9ea06ffa37933495 + REF libtorrent-1.2.8 + SHA512 2a36412fb399f066de9768f4afd87ddbfc10fcd2a0b3a8be0a43bec6914497e71d9d4ffe4ff8ccc5544a048f799ccba6ce086ab6199f4dee66d1341f02d73f9a HEAD_REF RC_1_2 PATCHES add-datetime-to-boost-libs.patch diff --git a/ports/libu2f-server/CONTROL b/ports/libu2f-server/CONTROL index 26803fbb7ecd09..1af6aa8f1d5cb6 100644 --- a/ports/libu2f-server/CONTROL +++ b/ports/libu2f-server/CONTROL @@ -1,4 +1,7 @@ Source: libu2f-server Version: 1.1.0 +Port-Version: 2 Build-Depends: openssl, json-c +Homepage: https://developers.yubico.com/libu2f-server/ Description: Yubico Universal 2nd Factor (U2F) Server C Library +Supports: (x86 | x64) & windows diff --git a/ports/libu2f-server/portfile.cmake b/ports/libu2f-server/portfile.cmake index 86e5d9bbebf2b8..e4f7c6ddbfac39 100644 --- a/ports/libu2f-server/portfile.cmake +++ b/ports/libu2f-server/portfile.cmake @@ -23,6 +23,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +# The include file must be patched after the build has completed, because the source files use the wrong subdirectory name! +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libu2f-server/u2f-server.h + "#include " + "#include " +) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() diff --git a/ports/libusb/CONTROL b/ports/libusb/CONTROL index 8e351613262ec8..accbf3d0e0aa39 100644 --- a/ports/libusb/CONTROL +++ b/ports/libusb/CONTROL @@ -1,4 +1,6 @@ Source: libusb Version: 1.0.23 +Port-Version: 2 Homepage: https://github.com/libusb/libusb Description: a cross-platform library to access USB devices +Supports: !uwp diff --git a/ports/libusb/portfile.cmake b/ports/libusb/portfile.cmake index 1beb053aa12353..74a592f41f2706 100644 --- a/ports/libusb/portfile.cmake +++ b/ports/libusb/portfile.cmake @@ -1,8 +1,6 @@ -if (VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "Error: the port is unsupported on your platform. Please open an issue on github.com/Microsoft/vcpkg to request a fix") -endif() +vcpkg_fail_port_install(ON_TARGET "uwp") -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(VCPKG_TARGET_IS_LINUX) message("${PORT} currently requires the following tools and libraries from the system package manager:\n autoreconf\n libudev\n\nThese can be installed on Ubuntu systems via apt-get install autoreconf libudev-dev") endif() @@ -41,78 +39,22 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() + # The README file in the archive is a symlink to README.md + # which causes issues with the windows MSBUILD process + file(REMOVE ${SOURCE_PATH}/README) + vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH msvc/libusb_${LIBUSB_PROJECT_TYPE}_${MSVS_VERSION}.vcxproj LICENSE_SUBPATH COPYING ) + file(INSTALL ${SOURCE_PATH}/libusb/libusb.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0) else() - set(BASH /bin/bash) - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - # Copy sources - message(STATUS "Copying source files...") - file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - endforeach() - message(STATUS "Copying source files... done") - # Configure release - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - # Copy sources - message(STATUS "Copying source files...") - file(GLOB PORT_SOURCE_FILES ${SOURCE_PATH}/*) - foreach(SOURCE_FILE ${PORT_SOURCE_FILES}) - file(COPY ${SOURCE_FILE} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - endforeach() - message(STATUS "Copying source files... done") - # Configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./autogen.sh\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"./configure --prefix=${CURRENT_PACKAGES_DIR}/debug\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - # Build release - message(STATUS "Package ${TARGET_TRIPLET}-rel") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"make install\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # Build debug - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - execute_process( - COMMAND "${BASH} --noprofile --norc -c \"make install\"" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") - endif() + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + ) + vcpkg_install_make() endif() -file(INSTALL - ${SOURCE_PATH}/libusb/libusb.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include/libusb-1.0 -) - file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libvpx/CONTROL b/ports/libvpx/CONTROL index 969ae8a10961c7..82eec705c923c4 100644 --- a/ports/libvpx/CONTROL +++ b/ports/libvpx/CONTROL @@ -1,6 +1,6 @@ Source: libvpx Version: 1.8.1 -Port-Version: 8 +Port-Version: 9 Homepage: https://github.com/webmproject/libvpx Description: The reference software implementation for the video coding formats VP8 and VP9. Supports: !(uwp&arm) diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index 1d818ddf169db0..7a899c9cb70ea1 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -83,23 +83,24 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) OPTIONS /p:UseEnv=True ) + # note: pdb file names are hardcoded in the lib file, cannot rename if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpxmt.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "vpxmt.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Release/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") endif() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmdd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmdd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") else() file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpxmtd.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") - file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "vpxmtd.pdb") + file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/${LIBVPX_ARCH_DIR}/Debug/vpx/vpx.pdb" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") endif() endif() diff --git a/ports/libwandio/CONTROL b/ports/libwandio/CONTROL index 5fc36ba357f7f2..1150b06ec140fb 100644 --- a/ports/libwandio/CONTROL +++ b/ports/libwandio/CONTROL @@ -1,5 +1,7 @@ Source: libwandio -Version: 4.2.1-2 +Version: 4.2.1 +Port-Version: 3 Homepage: https://github.com/wanduow/wandio Description: C library for simple and efficient file IO. -Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2 \ No newline at end of file +Build-Depends: zlib, zstd, liblzma, lzo, lz4, curl, pthread, bzip2 +Supports: !windows diff --git a/ports/libwandio/configure.lib.patch b/ports/libwandio/configure.lib.patch index 57719581ea09ac..3898836b7bc082 100644 --- a/ports/libwandio/configure.lib.patch +++ b/ports/libwandio/configure.lib.patch @@ -120,21 +120,3 @@ index 4579fbb3d..f6be008c8 100644 fi AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support") with_lz4=streamapi -@@ -296,12 +304,14 @@ AC_ARG_WITH([http], - AS_IF([test "x$with_http" != "xno"], - [ - # we need curl_easy_pause which was added in 7.18.0 -- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) -+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) -+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) - ], [have_curl=no]) - - AS_IF([test "x$have_curl" = "xyes"], [ -- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then -- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" -+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then -+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" -+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" - fi - AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") - with_http=yes], diff --git a/ports/libwandio/configure.patch b/ports/libwandio/configure.patch new file mode 100644 index 00000000000000..929662d6703296 --- /dev/null +++ b/ports/libwandio/configure.patch @@ -0,0 +1,14 @@ +diff --git a/configure.ac b/configure.ac +index e250c0c31..0465120ba 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -83,7 +83,7 @@ ADD_INCLS="" + ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib" + LIBWANDIO_LIBS="" + +-CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1" ++CFLAGS="$CFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" +-CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1" ++CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX" + + # Check for -fvisibility diff --git a/ports/libwandio/curl.patch b/ports/libwandio/curl.patch new file mode 100644 index 00000000000000..326700ed0bb142 --- /dev/null +++ b/ports/libwandio/curl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 4579fbb3d..f6be008c8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -296,12 +304,14 @@ AC_ARG_WITH([http], + AS_IF([test "x$with_http" != "xno"], + [ + # we need curl_easy_pause which was added in 7.18.0 +- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) ++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d libcurl libcurl-d], have_curl=yes, have_curl=no, [-lCrypt32 -lWldap32 -lWs2_32 -ladvapi32]) ++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) + ], [have_curl=no]) + + AS_IF([test "x$have_curl" = "xyes"], [ +- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" ++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lCrypt32 -lWldap32 -lWs2_32 -ladvapi32 $ac_cv_search_curl_easy_pause" ++ LIBS="$LIBS" + fi + AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") + with_http=yes], diff --git a/ports/libwandio/openssl.patch b/ports/libwandio/openssl.patch new file mode 100644 index 00000000000000..586cdfab569bf9 --- /dev/null +++ b/ports/libwandio/openssl.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 4579fbb3d..f6be008c8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -296,12 +304,14 @@ AC_ARG_WITH([http], + AS_IF([test "x$with_http" != "xno"], + [ + # we need curl_easy_pause which was added in 7.18.0 +- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) ++ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl]) ++ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no) + ], [have_curl=no]) + + AS_IF([test "x$have_curl" = "xyes"], [ +- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then +- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl" ++ if test "$ac_cv_search_curl_easy_pause" != "none required"; then ++ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl" ++ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl" + fi + AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support") + with_http=yes], diff --git a/ports/libwandio/portfile.cmake b/ports/libwandio/portfile.cmake index c9be34be64f4ae..a03d5c79f2c768 100644 --- a/ports/libwandio/portfile.cmake +++ b/ports/libwandio/portfile.cmake @@ -1,3 +1,11 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + set(PATCHES curl.patch) + #TODO: Still does not work. Requires proper "signal" support and "unistd" +else() + set(PATCHES openssl.patch) # needed if curl is using openssl +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wanduow/wandio @@ -5,9 +13,12 @@ vcpkg_from_github( SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d HEAD_REF master PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed. + configure.patch + ${PATCHES} ) vcpkg_configure_make( + AUTOCONFIG SOURCE_PATH ${SOURCE_PATH} COPY_SOURCE ) diff --git a/ports/libzip/CONTROL b/ports/libzip/CONTROL index 9ed941bccf718b..8a3d1513724495 100644 --- a/ports/libzip/CONTROL +++ b/ports/libzip/CONTROL @@ -1,5 +1,6 @@ Source: libzip Version: 1.7.1 +Port-Version: 1 Homepage: https://github.com/nih-at/libzip Build-Depends: zlib Default-Features: bzip2,default-aes diff --git a/ports/libzip/fix-findpackage.patch b/ports/libzip/fix-findpackage.patch new file mode 100644 index 00000000000000..94ef7d93a0dcc5 --- /dev/null +++ b/ports/libzip/fix-findpackage.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6e35082..d90c0c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -482,7 +482,7 @@ CONFIGURE_PACKAGE_CONFIG_FILE("${PROJECT_NAME}.cmake.in" "${PROJECT_BINARY_DIR}/ + IF(LIBZIP_DO_INSTALL) + INSTALL(EXPORT ${PROJECT_NAME}-targets + FILE ${PROJECT_NAME}-targets.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake + ) + ENDIF() + +@@ -494,7 +494,7 @@ EXPORT(TARGETS zip + IF(LIBZIP_DO_INSTALL) + INSTALL(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-version.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake + ) + ENDIF() + +diff --git a/libzip.cmake.in b/libzip.cmake.in +index 462439b..6caf754 100644 +--- a/libzip.cmake.in ++++ b/libzip.cmake.in +@@ -1,7 +1,7 @@ + @PACKAGE_INIT@ + + # Provide all our library targets to users. +-include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/cmake/libzip/libzip-targets.cmake") ++include("@PACKAGE_CMAKE_INSTALL_LIBDIR@/../share/libzip/libzip-targets.cmake") + + get_filename_component(LIBZIP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + set(LIBZIP_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/ports/libzip/portfile.cmake b/ports/libzip/portfile.cmake index 5b325363b6dbb4..131c3ccfcaf006 100644 --- a/ports/libzip/portfile.cmake +++ b/ports/libzip/portfile.cmake @@ -4,6 +4,7 @@ vcpkg_from_github( REF dcd9a0bfe1ac2893d7f62bafb19f0a4d7b08c0f7 #v1.7.1 SHA512 33ad594398f79544636464d6ae0892553a212dc833b508820f81f10823c3a5c4016288d05953176fb8d52919414edd28f26da6037b93129a58826abdcb501d18 HEAD_REF master + PATCHES fix-findpackage.patch ) vcpkg_check_features( diff --git a/ports/log4cpp/CONTROL b/ports/log4cpp/CONTROL index ec84f40653626d..11d3c0207b19aa 100644 --- a/ports/log4cpp/CONTROL +++ b/ports/log4cpp/CONTROL @@ -1,5 +1,6 @@ Source: log4cpp -Version: 2.9.1-2 +Version: 2.9.1 +Port-Version: 3 Homepage: https://github.com/orocos-toolchain/log4cpp Description: Log4cpp is library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. It is modeled after the Log4j Java library, staying as close to their API as is reasonable. Supports: !uwp diff --git a/ports/log4cpp/fix-includepath.patch b/ports/log4cpp/fix-includepath.patch new file mode 100644 index 00000000000000..2fdac90fe82c12 --- /dev/null +++ b/ports/log4cpp/fix-includepath.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index beace9e..c8264ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,7 +136,7 @@ SET(prefix "${CMAKE_INSTALL_PREFIX}") + SET(exec_prefix "\${prefix}") + SET(log4cpp_cflags "") + SET(log4cpp_libs "${LOG4CPP_LIBS}") +-SET(includedir "\${prefix}/include/orocos") ++SET(includedir "\${prefix}/include") + SET(libdir "\${prefix}/lib") + CONFIGURE_FILE(log4cpp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos-log4cpp.pc @ONLY) + +@@ -147,7 +147,7 @@ INSTALL( + + INSTALL ( + DIRECTORY include/log4cpp +- DESTINATION include/orocos ++ DESTINATION include + PATTERN "config.h.in" EXCLUDE + PATTERN ".svn" EXCLUDE + PATTERN "*.am" EXCLUDE +@@ -157,7 +157,7 @@ INSTALL ( + + INSTALL ( + FILES ${CMAKE_CURRENT_BINARY_DIR}/include/log4cpp/config.h +- DESTINATION include/orocos/log4cpp ++ DESTINATION include/log4cpp + ) + + INSTALL(TARGETS ${LOG4CPP_LIBRARY_NAME} diff --git a/ports/log4cpp/portfile.cmake b/ports/log4cpp/portfile.cmake index 44c91587655720..e8de2c0e342b62 100644 --- a/ports/log4cpp/portfile.cmake +++ b/ports/log4cpp/portfile.cmake @@ -1,8 +1,4 @@ -include(vcpkg_common_functions) - -if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore") - message(FATAL_ERROR "${PORT} does not currently support UWP.") -endif() +vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -13,6 +9,7 @@ vcpkg_from_github( PATCHES fix-install-targets.patch Fix-StaticSupport.patch + fix-includepath.patch ) vcpkg_configure_cmake( @@ -29,5 +26,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_copy_pdbs() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/lzokay/portfile.cmake b/ports/lzokay/portfile.cmake new file mode 100644 index 00000000000000..719c63d979da4c --- /dev/null +++ b/ports/lzokay/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jackoalan/lzokay + REF 546a9695271e8a8b4711383f828172754fd825f2 + SHA512 b4e96183ea52dc5ba0d88b4b9b27baa2c3e2c540b1bfd50cf7a3c2569337fbe9d73dd9939cb456d5f7459df8e10d84677d40ee33f7d524f0f5f8a723d7a70583 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/lzokay/vcpkg.json b/ports/lzokay/vcpkg.json new file mode 100644 index 00000000000000..fb2b0787a587db --- /dev/null +++ b/ports/lzokay/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "lzokay", + "version-string": "2020-07-30", + "description": "lzokay – MIT licensed C++ implementation of LZO compression/decompression algorithm", + "homepage": "https://github.com/jackoalan/lzokay" +} diff --git a/ports/marble/CONTROL b/ports/marble/CONTROL new file mode 100644 index 00000000000000..20dd30c0c313fd --- /dev/null +++ b/ports/marble/CONTROL @@ -0,0 +1,6 @@ +Source: marble +Version: 19.08.2 +Homepage: https://marble.kde.org +Description: Marble KDE library +Supports: windows & x64 & !static +Build-Depends: qt5-base, qt5-svg, qt5-quickcontrols, qt5-webchannel diff --git a/ports/marble/portfile.cmake b/ports/marble/portfile.cmake new file mode 100644 index 00000000000000..665eb31d10e9b9 --- /dev/null +++ b/ports/marble/portfile.cmake @@ -0,0 +1,45 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/marble + REF 552cb9ae1f34482d1ec56532a703e0d820856286 #v20.04.3 + SHA512 ac6106a6db53534c96d7281b1a07624c2852ed8c78cce0b91c5f865b106487f1f49aaa4c72d00ffb1f79a761d8d2eca18129ef9517bef463a1840554ed3e51fb + HEAD_REF master + PATCHES "qtfix.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) + +# Install plugins and data files +file(GLOB_RECURSE PLUGINS "${CURRENT_PACKAGES_DIR}/plugins/*") +file(GLOB_RECURSE PLUGINS_DESIGNER "${CURRENT_PACKAGES_DIR}/lib/plugins/*") +file(GLOB_RECURSE PLUGINS_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/plugins/*") +file(GLOB_RECURSE MKSPECS "${CURRENT_PACKAGES_DIR}/mkspecs/*") + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) +file(COPY ${PLUGINS} ${PLUGINS_DESIGNER} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/plugins) +file(COPY ${PLUGINS_DEBUG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/plugins) +file(COPY "${CURRENT_PACKAGES_DIR}/data" DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) # have to keep folder structure here +file(COPY ${MKSPECS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}/mkspecs) + +# remove plugin folder +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/plugins ${CURRENT_PACKAGES_DIR}/debug/plugins + ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/debug/data + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/mkspecs ${CURRENT_PACKAGES_DIR}/debug/mkspecs + ${CURRENT_PACKAGES_DIR}/debug/share + ${CURRENT_PACKAGES_DIR}/debug/lib/plugins ${CURRENT_PACKAGES_DIR}/lib/plugins +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/marble/qtfix.patch b/ports/marble/qtfix.patch new file mode 100644 index 00000000000000..39a420be02ce3a --- /dev/null +++ b/ports/marble/qtfix.patch @@ -0,0 +1,97 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3b2139dc..1f9a10513 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,7 +171,7 @@ set (PEDANTIC FALSE CACHE BOOL "Determines if we should compile with -Wall -Werr + set (WITH_DESIGNER_PLUGIN TRUE CACHE BOOL "Build plugins for Qt Designer") + add_feature_info("Qt Designer plugins" WITH_DESIGNER_PLUGIN "Marble widget support in Qt Designer. Toggle with WITH_DESIGNER_PLUGIN=YES/NO") + +-set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Base directory for executables and libraries" FORCE) ++set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "Base directory for executables and libraries" FORCE) + if (NOT QT_PLUGINS_DIR) + set(QT_PLUGINS_DIR ${CMAKE_INSTALL_LIBDIR}/plugins) + endif() +@@ -248,7 +248,7 @@ add_definitions( + -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +- -DQT_STRICT_ITERATORS ++# -DQT_STRICT_ITERATORS + -DQT_DISABLE_DEPRECATED_BEFORE=0x050700 + ) + +diff --git a/src/apps/marble-qt/CMakeLists.txt b/src/apps/marble-qt/CMakeLists.txt +index d28e3aa5e..7bbf4a63c 100644 +--- a/src/apps/marble-qt/CMakeLists.txt ++++ b/src/apps/marble-qt/CMakeLists.txt +@@ -48,7 +48,7 @@ if(STATIC_BUILD) + endif(STATIC_BUILD) + + if(WIN32) +-install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) ++ install (TARGETS marble-qt RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/marble) + else(WIN32) + if (APPLE) + # No need for this when installing to a bundle +diff --git a/src/lib/astro/CMakeLists.txt b/src/lib/astro/CMakeLists.txt +index 5e1afd60f..fc53985f4 100644 +--- a/src/lib/astro/CMakeLists.txt ++++ b/src/lib/astro/CMakeLists.txt +@@ -50,7 +50,7 @@ target_include_directories(astro + + # choose the correct target install library path + if(WIN32) +- INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + elseif(APPLE) + INSTALL(TARGETS astro LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) + else() +diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt +index 7d27be94b..f1f377967 100644 +--- a/src/lib/marble/CMakeLists.txt ++++ b/src/lib/marble/CMakeLists.txt +@@ -448,7 +448,7 @@ target_include_directories(marblewidget + + # choose the correct target install library path + if(WIN32) +- install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + elseif(APPLE) + install(TARGETS marblewidget LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) + else() +diff --git a/src/lib/marble/declarative/CMakeLists.txt b/src/lib/marble/declarative/CMakeLists.txt +index dd5d519c4..482a02ad5 100644 +--- a/src/lib/marble/declarative/CMakeLists.txt ++++ b/src/lib/marble/declarative/CMakeLists.txt +@@ -53,7 +53,7 @@ if(Qt5Positioning_FOUND) + endif() + + if(WIN32) +- install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} ARCHIVE DESTINATION lib) ++ install(TARGETS marbledeclarative RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + else() + install(TARGETS marbledeclarative LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +diff --git a/src/plugins/positionprovider/CMakeLists.txt b/src/plugins/positionprovider/CMakeLists.txt +index 85591098e..87011876e 100644 +--- a/src/plugins/positionprovider/CMakeLists.txt ++++ b/src/plugins/positionprovider/CMakeLists.txt +@@ -12,12 +12,12 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} + COMPONENTS + Positioning + ) +-marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) +-marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) +-marble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) +-if(Qt5Positioning_FOUND) +- ADD_SUBDIRECTORY( qtpositioning ) +-endif() ++#marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" ) ++#marble_set_package_properties( Qt5Positioning PROPERTIES URL "https://www.qt.io/developers/" ) ++#arble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "position information via Qt5Positioning" ) ++#if(Qt5Positioning_FOUND) ++# ADD_SUBDIRECTORY( qtpositioning ) ++#endif() + + + macro_optional_find_package(libwlocate) diff --git a/ports/minc/CONTROL b/ports/minc/CONTROL new file mode 100644 index 00000000000000..6cd1d54997367d --- /dev/null +++ b/ports/minc/CONTROL @@ -0,0 +1,9 @@ +Source: minc +Version: 2.4.03 +Description: MINC - Medical Image NetCDF or MINC isn't netCDF +Homepage: https://github.com/BIC-MNI/libminc +Build-Depends: nifticlib, hdf5[core], zlib + +Feature: minc1 +Description: Support minc1 file format, requires NETCDF +Build-Depends: netcdf[core] \ No newline at end of file diff --git a/ports/minc/build.patch b/ports/minc/build.patch new file mode 100644 index 00000000000000..d0275c20d4c61e --- /dev/null +++ b/ports/minc/build.patch @@ -0,0 +1,67 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 52cc81ace..d7a1f63f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -403,9 +404,11 @@ ENDIF(LIBMINC_MINC1_SUPPORT) + # Keep this variable for compatibility + SET(VOLUME_IO_LIBRARY ${LIBMINC_EXTERNAL_LIB_PREFIX}minc2) + SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + + ADD_LIBRARY(${LIBMINC_LIBRARY} ${LIBRARY_TYPE} ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} ) +- ++if(WIN32) ++ target_link_libraries(${LIBMINC_LIBRARY} ws2_32) ++endif() + IF(NIFTI_FOUND AND NOT LIBMINC_USE_SYSTEM_NIFTI) + ADD_DEPENDENCIES(${LIBMINC_LIBRARY} NIFTI) + ENDIF() +@@ -453,7 +456,7 @@ IF( LIBMINC_INSTALL_LIB_DIR ) + ${LIBMINC_EXPORTED_TARGETS} + LIBRARY DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries + ARCHIVE DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries +- RUNTIME DESTINATION ${LIBMINC_INSTALL_LIB_DIR} COMPONENT libraries ++ RUNTIME DESTINATION ${LIBMINC_INSTALL_BIN_DIR} COMPONENT libraries + ) + ENDIF( LIBMINC_INSTALL_LIB_DIR ) + +@@ -538,7 +541,7 @@ IF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Use${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINC.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LIBMINC_EXTERNAL_LIB_PREFIX}LIBMINCConfig.cmake + DESTINATION +- ${LIBMINC_INSTALL_LIB_DIR} ++ ${LIBMINC_INSTALL_LIB_DIR}/cmake + COMPONENT Development) + + ENDIF(LIBMINC_INSTALL_LIB_DIR AND NOT LIBMINC_INSTALL_NO_DEVELOPMENT) +diff --git a/config.h.cmake b/config.h.cmake +index 9ceffa8fc..21c2f3baf 100644 +--- a/config.h.cmake ++++ b/config.h.cmake +@@ -1,4 +1,8 @@ + /* various defines */ ++#ifdef _MSC_VER ++#define strcasecmp _stricmp ++#define strncasecmp _strnicmp ++#endif + + #ifndef MINC2 + #define MINC2 @MINC2@ +diff --git a/libcommon/minc_config.c b/libcommon/minc_config.c +index 531ef108e..5472d9274 100644 +--- a/libcommon/minc_config.c ++++ b/libcommon/minc_config.c +@@ -20,14 +20,6 @@ + + #include "minc_config.h" + +-#ifdef _MSC_VER +-#define snprintf _snprintf +-#define vsnprintf _vsnprintf +-#define strcasecmp _stricmp +-#define strncasecmp _strnicmp +-#endif +- +- + static const char *_CONFIG_VAR[]= + { + "MINC_FORCE_V2", diff --git a/ports/minc/config.patch b/ports/minc/config.patch new file mode 100644 index 00000000000000..a726b9a57f0392 --- /dev/null +++ b/ports/minc/config.patch @@ -0,0 +1,15 @@ +diff --git a/LIBMINCConfig.cmake.in b/LIBMINCConfig.cmake.in +index 7790597b2..c041b685a 100644 +--- a/LIBMINCConfig.cmake.in ++++ b/LIBMINCConfig.cmake.in +@@ -1,3 +1,4 @@ ++set(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../") + # LIBMINC CMake configuration file + + get_filename_component(LIBMINC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) +@@ -37,3 +38,4 @@ set( LIBMINC_FOUND 1 ) + # set( LIBMINC_TARGETS_IMPORTED 1 ) + # include( "${LIBMINC_CMAKE_DIR}/@LIBMINC_EXPORTED_TARGETS@.cmake" ) + #endif() ++unset(_IMPORT_PREFIX) +\ No newline at end of file diff --git a/ports/minc/portfile.cmake b/ports/minc/portfile.cmake new file mode 100644 index 00000000000000..4b9ff63b149d80 --- /dev/null +++ b/ports/minc/portfile.cmake @@ -0,0 +1,47 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO BIC-MNI/libminc + REF e75a936c12a305b596d743c26a5437196ebce2a4 + SHA512 744f879ac8f0594c310d1c1b7fe67543c5feeb3e5a0979035918dbb2bf1d0973fbd389e5357a75631e618cc614b648c21179f7467576bd68e3522e63f21451b0 + HEAD_REF master + PATCHES build.patch + config.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "minc1" LIBMINC_MINC1_SUPPORT +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # Symbols are not properly exported +endif() + +set(OPTIONS) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=ON") +else() + list(APPEND OPTIONS "-DLIBMINC_BUILD_SHARED_LIBS=OFF") +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE + OPTIONS + "-DBUILD_TESTING=OFF" + "-DLIBMINC_USE_SYSTEM_NIFTI=ON" + ${OPTIONS} + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/libminc) + +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/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mlpack/CONTROL b/ports/mlpack/CONTROL index dfccb9025821df..252c669976b6b9 100644 --- a/ports/mlpack/CONTROL +++ b/ports/mlpack/CONTROL @@ -1,8 +1,9 @@ Source: mlpack -Version: 3.2.2-3 +Version: 3.2.2 +Port-Version: 5 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: openblas (!osx), clapack (!osx), boost, armadillo, ensmallen, stb +Build-Depends: openblas (!osx), lapack, boost, armadillo, ensmallen, stb Feature: tools Description: Build command-line executables. diff --git a/ports/mlpack/cmakelists.patch b/ports/mlpack/cmakelists.patch index 9db41f91267dc5..79f176419bed90 100644 --- a/ports/mlpack/cmakelists.patch +++ b/ports/mlpack/cmakelists.patch @@ -2,7 +2,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 26757a5..c200b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -288,6 +288,7 @@ endif() +@@ -288,6 +282,7 @@ endif() # and find LAPACK and BLAS ourselves, using a slightly modified variant of the # script Armadillo uses to find these. if (WIN32) @@ -10,16 +10,14 @@ index 26757a5..c200b40 100644 find_library(LAPACK_LIBRARY NAMES lapack liblapack lapack_win32_MT lapack_win32 PATHS "C:/Program Files/Armadillo" -@@ -305,24 +306,31 @@ if (WIN32) +@@ -305,24 +306,25 @@ if (WIN32) if (NOT BLAS_LIBRARY) message(FATAL_ERROR "Cannot find BLAS library (.lib)!") endif () + endif() -+ find_package(clapack CONFIG REQUIRED) -+ set(LAPACK_LIBRARIES lapack) -+ find_package(OpenBLAS CONFIG REQUIRED) -+ set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) ++ find_package(LAPACK REQUIRED) ++ find_package(BLAS REQUIRED) # Piggyback LAPACK and BLAS linking into Armadillo link. set(ARMADILLO_LIBRARIES - ${ARMADILLO_LIBRARIES} ${BLAS_LIBRARY} ${LAPACK_LIBRARY}) @@ -28,23 +26,19 @@ index 26757a5..c200b40 100644 # Ensure that the libraries are added to the MSVC IDE runtime path. - get_filename_component(BLAS_DIR ${BLAS_LIBRARY} DIRECTORY) - get_filename_component(LAPACK_DIR ${LAPACK_LIBRARY} DIRECTORY) -+ get_property(BLAS_DIR TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_LOCATION_RELEASE) -+ get_filename_component(BLAS_DIR ${BLAS_DIR} DIRECTORY) -+ get_property(LAPACK_DIR TARGET lapack PROPERTY IMPORTED_LOCATION_RELEASE) -+ get_filename_component(LAPACK_DIR ${LAPACK_DIR} DIRECTORY) # Sometimes, especially with an OpenBLAS install via nuget, the DLLs are # actually in ../../bin/x64/. Automatically add these. - if (EXISTS "${BLAS_DIR}/../../bin/x64/") - get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}/../../bin/x64" ABSOLUTE) -+ if (EXISTS "${BLAS_DIR}") ++ if (0) + get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () - if (EXISTS "${LAPACK_DIR}/../../bin/x64/") - get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}/../../bin/x64" ABSOLUTE) -+ if (EXISTS "${LAPACK_DIR}") ++ if (0) + get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}" ABSOLUTE) set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}") endif () diff --git a/ports/monkeys-audio/CONTROL b/ports/monkeys-audio/CONTROL index 8b66f9027d06a4..388299f8c7e25f 100644 --- a/ports/monkeys-audio/CONTROL +++ b/ports/monkeys-audio/CONTROL @@ -1,5 +1,5 @@ Source: monkeys-audio -Version: 5.46 +Version: 5.48 Homepage: https://monkeysaudio.com Description: Monkey's Audio is an excellent audio compression tool which has multiple advantages over traditional methods. Audio files compressed with it end with .ape extension. diff --git a/ports/monkeys-audio/portfile.cmake b/ports/monkeys-audio/portfile.cmake index 320aeada95b312..f0edaaf32e0c77 100644 --- a/ports/monkeys-audio/portfile.cmake +++ b/ports/monkeys-audio/portfile.cmake @@ -2,12 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "UWP" "OSX" "Linux") vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) -set(MA_VERSION 546) +set(MA_VERSION 548) vcpkg_download_distfile(ARCHIVE URLS "https://monkeysaudio.com/files/MAC_SDK_${MA_VERSION}.zip" FILENAME "MAC_SDK_${MA_VERSION}.zip" - SHA512 5fd426e3fa1d9283ef812a039fe4290e67881aaf1c374ce912b31df894128413c57e23fda0e79c0ae1e1d117ba15c8dd635b784d150451602f06f2fd3fe41566 + SHA512 036c75f4cc8dc54837b2f9f822d260ebdbed918dff9ac744746e2786d13a33364d0cd7f380f015e89eaf5ebedd7180df979dfd15cb8f0160e339fafebc93f4ba ) vcpkg_extract_source_archive_ex( diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL deleted file mode 100644 index 6955ef15da9404..00000000000000 --- a/ports/mosquitto/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: mosquitto -Version: 1.6.8-1 -Build-Depends: c-ares, libwebsockets, openssl, pthreads -Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1. - MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino. -Homepage: https://mosquitto.org/download/ diff --git a/ports/mosquitto/portfile.cmake b/ports/mosquitto/portfile.cmake index 2c04a7bb05debd..8c83401c94e366 100644 --- a/ports/mosquitto/portfile.cmake +++ b/ports/mosquitto/portfile.cmake @@ -46,4 +46,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +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/ports/mosquitto/usage b/ports/mosquitto/usage new file mode 100644 index 00000000000000..1f4e6735c12c5e --- /dev/null +++ b/ports/mosquitto/usage @@ -0,0 +1,5 @@ +The package mosquitto provides CMake targets: + + find_package(mosquitto REQUIRED) + target_include_directories(main PRIVATE ${MOSQUITTO_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${MOSQUITTO_LIBRARIES}) diff --git a/ports/mosquitto/vcpkg-cmake-wrapper.cmake b/ports/mosquitto/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..ad8124c677974e --- /dev/null +++ b/ports/mosquitto/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,15 @@ +include(FindPackageHandleStandardArgs) +include(SelectLibraryConfigurations) + +find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h) + +find_library(MOSQUITTO_LIBRARY_DEBUG NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTO_LIBRARY_RELEASE NAMES mosquitto libmosquitto NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTOPP_LIBRARY_DEBUG NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(MOSQUITTOPP_LIBRARY_RELEASE NAMES mosquittopp libmosquittopp NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) + +select_library_configurations(MOSQUITTO) +select_library_configurations(MOSQUITTOPP) + +set(MOSQUITTO_INCLUDE_DIRS ${MOSQUITTO_INCLUDE_DIR}) +set(MOSQUITTO_LIBRARIES ${MOSQUITTO_LIBRARY} ${MOSQUITTOPP_LIBRARY}) diff --git a/ports/mosquitto/vcpkg.json b/ports/mosquitto/vcpkg.json new file mode 100644 index 00000000000000..2e3654754bd238 --- /dev/null +++ b/ports/mosquitto/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "mosquitto", + "version-string": "1.6.8", + "port-version": 2, + "description": "Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1, MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model, This makes it suitable for machine to machine messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino", + "homepage": "https://mosquitto.org/download/", + "dependencies": [ + "c-ares", + "libwebsockets", + "openssl", + "pthreads" + ] +} diff --git a/ports/mozjpeg/CONTROL b/ports/mozjpeg/CONTROL index 867ba8bcaebd88..998e5eacfe4b3f 100644 --- a/ports/mozjpeg/CONTROL +++ b/ports/mozjpeg/CONTROL @@ -1,4 +1,5 @@ Source: mozjpeg -Version: 2020-06-02 +Version: 2020-06-02-1 +Build-Depends: libpng Homepage: https://github.com/mozilla/mozjpeg Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg. diff --git a/ports/mozjpeg/fix-install-error.patch b/ports/mozjpeg/fix-install-error.patch index b0ba9ac2d7b71b..0d0a283652a6c2 100644 --- a/ports/mozjpeg/fix-install-error.patch +++ b/ports/mozjpeg/fix-install-error.patch @@ -1,126 +1,33 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 51f4714..9ca3463 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1370,21 +1370,28 @@ endif() +@@ -1369,13 +1369,13 @@ + ############################################################################### set(EXE ${CMAKE_EXECUTABLE_SUFFIX}) -+if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ set(REAL_BUILDS_PATH "Debug/") -+else() -+ set(REAL_BUILDS_PATH "Release/") -+endif() -+ if(WITH_TURBOJPEG) if(ENABLE_SHARED) - install(TARGETS turbojpeg tjbench -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) +- install(TARGETS turbojpeg tjbench ++ install(TARGETS turbojpeg #tjbench + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND CMAKE_C_LINKER_SUPPORTS_PDB) install(FILES "$" -- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) -+ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) - endif() - endif() - if(ENABLE_STATIC) -- install(TARGETS turbojpeg-static ARCHIVE -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS turbojpeg-static -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) - if(NOT ENABLE_SHARED) - if(MSVC_IDE OR XCODE) - set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") -@@ -1392,15 +1399,15 @@ if(WITH_TURBOJPEG) - set(DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif() - install(PROGRAMS ${DIR}/tjbench-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME tjbench${EXE}) -+ DESTINATION tools/mozjpeg RENAME tjbench${EXE}) - endif() - endif() - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/turbojpeg.h -- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) - endif() - - if(ENABLE_STATIC) -- install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS jpeg-static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg) - if(NOT ENABLE_SHARED) - if(MSVC_IDE OR XCODE) - set(DIR "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}") -@@ -1408,15 +1415,15 @@ if(ENABLE_STATIC) - set(DIR ${CMAKE_CURRENT_BINARY_DIR}) - endif() - install(PROGRAMS ${DIR}/cjpeg-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME cjpeg${EXE}) -+ DESTINATION tools/mozjpeg RENAME cjpeg${EXE}) - install(PROGRAMS ${DIR}/djpeg-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) -+ DESTINATION tools/mozjpeg RENAME djpeg${EXE}) +@@ -1413,13 +1413,13 @@ + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME djpeg${EXE}) install(PROGRAMS ${DIR}/jpegtran-static${EXE} -- DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) -+ DESTINATION tools/mozjpeg RENAME jpegtran${EXE}) + DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME jpegtran${EXE}) endif() endif() -install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg) ++#install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/example.txt -@@ -1424,10 +1431,10 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.ijg + ${CMAKE_CURRENT_SOURCE_DIR}/tjexample.c ${CMAKE_CURRENT_SOURCE_DIR}/libjpeg.txt ${CMAKE_CURRENT_SOURCE_DIR}/structure.txt - ${CMAKE_CURRENT_SOURCE_DIR}/usage.txt ${CMAKE_CURRENT_SOURCE_DIR}/wizard.txt -- ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md DESTINATION share/mozjpeg) - if(WITH_JAVA) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/java/TJExample.java -- DESTINATION ${CMAKE_INSTALL_DOCDIR}) -+ DESTINATION share/mozjpeg) - endif() - - if(UNIX OR MINGW) -@@ -1439,12 +1446,12 @@ if(UNIX OR MINGW) - endif() - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc - ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/mozjpeg) - - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h - ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h -- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mozjpeg) - - include(cmakescripts/BuildPackages.cmake) - -diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt -index f0a7d87..1e82349 100644 ---- a/sharedlib/CMakeLists.txt -+++ b/sharedlib/CMakeLists.txt -@@ -92,11 +92,11 @@ add_executable(jcstest ../jcstest.c) - target_link_libraries(jcstest jpeg) - - install(TARGETS jpeg cjpeg djpeg jpegtran -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mozjpeg -+ RUNTIME DESTINATION tools/mozjpeg) - if(NOT CMAKE_VERSION VERSION_LESS "3.1" AND MSVC AND - CMAKE_C_LINKER_SUPPORTS_PDB) - install(FILES "$" -- DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) -+ DESTINATION ${CMAKE_INSTALL_BINDIR}/mozjpeg OPTIONAL) - endif() diff --git a/ports/mozjpeg/portfile.cmake b/ports/mozjpeg/portfile.cmake index 93f9c86e94c8f4..9c756e778d11e8 100644 --- a/ports/mozjpeg/portfile.cmake +++ b/ports/mozjpeg/portfile.cmake @@ -12,34 +12,41 @@ vcpkg_find_acquire_program(NASM) get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) vcpkg_add_to_path(${NASM_EXE_PATH}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(ENABLE_STATIC_BUILD ON) - set(ENABLE_SHARED_BUILD OFF) -else() - set(ENABLE_STATIC_BUILD OFF) - set(ENABLE_SHARED_BUILD ON) -endif() - +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DDENABLE_SHARED=${ENABLE_SHARED_BUILD} - -DENABLE_STATIC=${ENABLE_STATIC_BUILD} + -DENABLE_SHARED=${ENABLE_SHARED} + -DENABLE_STATIC=${ENABLE_STATIC} -DWITH_CRT_DLL=${WITH_CRT_DLL} ) vcpkg_install_cmake() -#remove extra debug files +# Rename libraries for static builds +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/jpeg.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/lib/turbojpeg.lib") + endif() + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/jpeg.lib") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg-static.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/turbojpeg.lib") + endif() +endif() + +# Remove extra debug files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -vcpkg_copy_tools(${CURRENT_PACKAGES_DIR}/tools/mozjpeg) +vcpkg_copy_tools(TOOL_NAMES cjpeg djpeg jpegtran AUTO_CLEAN) +vcpkg_fixup_pkgconfig() -#remove empty folders after static build +# Remove empty folders after static build if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/mpg123/CONTROL b/ports/mpg123/CONTROL index deefddbdaa079b..3e7705ab08f280 100644 --- a/ports/mpg123/CONTROL +++ b/ports/mpg123/CONTROL @@ -1,4 +1,5 @@ Source: mpg123 -Version: 1.25.8-12 +Version: 1.25.8 +Port-Version: 13 Homepage: https://sourceforge.net/projects/mpg123/ Description: mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers 1, 2 and 3 (MPEG 1.0 layer 3 also known as MP3). diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index 5190a17db091e5..9438c58115e5fa 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -116,97 +116,38 @@ elseif(VCPKG_TARGET_IS_WINDOWS) ${SOURCE_PATH}/src/libmpg123/mpg123.h.in DESTINATION ${CURRENT_PACKAGES_DIR}/include ) -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") - file(REMOVE_RECURSE ${SOURCE_PATH}/build/debug) - file(REMOVE_RECURSE ${SOURCE_PATH}/build/release) - - ################ - # Debug build - ################ - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/debug --enable-debug=yes --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done.") - - message(STATUS "Installing ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Installing ${TARGET_TRIPLET}-dbg done.") - - ################ - # Release build - ################ - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make distclean - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH}/configure" --prefix=${SOURCE_PATH}/build/release --enable-static=yes --disable-dependency-tracking --with-default-audio=coreaudio --with-module-suffix=.so - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done.") - - message(STATUS "Installing ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME build-${TARGET_TRIPLET}-rel - ) - message(STATUS "Installing ${TARGET_TRIPLET}-rel done.") - - file( - INSTALL - "${SOURCE_PATH}/build/debug/include/fmt123.h" - "${SOURCE_PATH}/build/debug/include/mpg123.h" - "${SOURCE_PATH}/build/debug/include/out123.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include +elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX) + set(MPG123_OPTIONS + --disable-dependency-tracking ) - if(EXISTS "${SOURCE_PATH}/build/debug/lib64/libmpg123.a") - file( - INSTALL - "${SOURCE_PATH}/build/debug/lib64/libmpg123.a" - "${SOURCE_PATH}/build/debug/lib64/libout123.a" - DESTINATION - ${CURRENT_INSTALLED_DIR}/debug/lib - ) - else() - file( - INSTALL - "${SOURCE_PATH}/build/debug/lib/libmpg123.a" - "${SOURCE_PATH}/build/debug/lib/libout123.a" - DESTINATION - ${CURRENT_INSTALLED_DIR}/debug/lib - ) + # Find cross-compiler prefix + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") endif() - - if(EXISTS "${SOURCE_PATH}/build/release/lib64/libmpg123.a") - file( - INSTALL - "${SOURCE_PATH}/build/release/lib64/libmpg123.a" - "${SOURCE_PATH}/build/release/lib64/libout123.a" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib + if(CMAKE_C_COMPILER) + vcpkg_execute_required_process( + COMMAND ${CMAKE_C_COMPILER} -dumpmachine + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + LOGNAME dumpmachine-${TARGET_TRIPLET} ) - else() - file( - INSTALL - "${SOURCE_PATH}/build/release/lib/libmpg123.a" - "${SOURCE_PATH}/build/release/lib/libout123.a" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib + file(READ ${CURRENT_BUILDTREES_DIR}/dumpmachine-${TARGET_TRIPLET}-out.log MPG123_HOST) + string(REPLACE "\n" "" MPG123_HOST "${MPG123_HOST}") + message(STATUS "Cross-compiling with ${CMAKE_C_COMPILER}") + message(STATUS "Detected autoconf triplet --host=${MPG123_HOST}") + set(MPG123_OPTIONS + --host=${MPG123_HOST} + ${MPG123_OPTIONS} ) endif() + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${MPG123_OPTIONS} + ) + vcpkg_install_make() + + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL deleted file mode 100644 index 0871ce157b27a6..00000000000000 --- a/ports/mpir/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: mpir -Version: 3.0.0-8 -Homepage: https://github.com/wbhart/mpir -Description: Multiple Precision Integers and Rationals. -Supports: !(uwp|arm) \ No newline at end of file diff --git a/ports/mpir/portfile.cmake b/ports/mpir/portfile.cmake index 118a19602e25c0..856e4e273d4b55 100644 --- a/ports/mpir/portfile.cmake +++ b/ports/mpir/portfile.cmake @@ -1,5 +1,9 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h") + message(FATAL_ERROR "Can't build ${PORT} if gmp is installed. Please remove gmp, and try to install ${PORT} again if you need it.") +endif() + if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs") endif() @@ -30,44 +34,29 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) set(OPTIONS --disable-silent-rules --enable-gmpcompat --enable-cxx ${SHARED_STATIC}) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG} -O0 -g") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME configure-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Building ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME install-${TARGET_TRIPLET}-dbg - ) + string(APPEND VCPKG_C_FLAGS " -Wno-implicit-function-declaration") + string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - set(ENV{CXXFLAGS} "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE} -O2") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O2") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME configure-${TARGET_TRIPLET}-rel - ) - message(STATUS "Building ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME install-${TARGET_TRIPLET}-rel + # on Linux, autoconf is required; on macOS, it isn't + if(VCPKG_TARGET_IS_LINUX) + set(AUTOCONFIG "AUTOCONFIG") + endif() + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + ${AUTOCONFIG} + OPTIONS ${OPTIONS} ) + + vcpkg_install_make() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + endif() + + configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) - file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -113,37 +102,52 @@ elseif(VCPKG_TARGET_IS_WINDOWS) OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}" OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}" ) - file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) - file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib) + endif() endif() - file(GLOB HEADERS - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h - ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h - ) - file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - - file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) - file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) - - file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) - file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) - - list(APPEND REL_LIBS ${REL_LIBS_CXX}) - list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) - - file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(GLOB HEADERS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h + ) + file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll) + file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib) + list(APPEND REL_LIBS ${REL_LIBS_CXX}) + + file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) endif() - + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB HEADERS + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmp.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmpxx.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.h + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.h + ) + file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + + file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll) + file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib) + list(APPEND DBG_LIBS ${DBG_LIBS_CXX}) + + file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + endif() + vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -endif() \ No newline at end of file +endif() diff --git a/ports/mpir/vcpkg.json b/ports/mpir/vcpkg.json new file mode 100644 index 00000000000000..29754ccd9ace40 --- /dev/null +++ b/ports/mpir/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "mpir", + "version-string": "3.0.0", + "port-version": 10, + "description": "Multiple Precision Integers and Rationals", + "homepage": "https://github.com/wbhart/mpir", + "supports": "!(uwp | arm)" +} diff --git a/ports/nana/CMakeLists.txt b/ports/nana/CMakeLists.txt index 7cd9865dcb60af..eca50614d0aa81 100644 --- a/ports/nana/CMakeLists.txt +++ b/ports/nana/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -project(nana VERSION 1.5.5 LANGUAGES CXX) +project(nana VERSION 1.7.2 LANGUAGES CXX) option(NANA_ENABLE_PNG "Enable PNG support" OFF) option(NANA_ENABLE_JPEG "Enable JPEG support" OFF) @@ -26,7 +26,7 @@ target_include_directories(nana PUBLIC $ $) -target_compile_features(nana PUBLIC cxx_std_14) +target_compile_features(nana PUBLIC cxx_std_17) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_link_libraries(nana PUBLIC c++experimental) diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL index c0abb1df034ad6..d6c94949850503 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,5 +1,6 @@ Source: nana -Version: 1.7.2-3 +Version: 1.7.2 +Port-Version: 4 Homepage: https://github.com/cnjinhao/nana Description: Cross-platform library for GUI programming in modern C++ style. Build-Depends: libpng, libjpeg-turbo, freetype (!uwp&&!windows), fontconfig (!uwp&&!windows) diff --git a/ports/neargye-semver/CONTROL b/ports/neargye-semver/CONTROL new file mode 100644 index 00000000000000..4b7745b394b8c0 --- /dev/null +++ b/ports/neargye-semver/CONTROL @@ -0,0 +1,4 @@ +Source: neargye-semver +Version: 0.2.2 +Description: C++17 header-only dependency-free versioning library complying with Semantic Versioning 2.0.0 +Homepage: https://github.com/Neargye/semver diff --git a/ports/neargye-semver/portfile.cmake b/ports/neargye-semver/portfile.cmake new file mode 100644 index 00000000000000..8a74ee93a98e2b --- /dev/null +++ b/ports/neargye-semver/portfile.cmake @@ -0,0 +1,13 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Neargye/semver + REF v0.2.2 + SHA512 f299e6d74f0232f40e20959ed3d7138d5faff924f60748827849e21951d76d34070bac2479a35f3ea6e801ec5e23ebf8391adedc70d778c4aa5e4c89b20c332c + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/include/semver.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/neargye) + +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index d277cd975fb649..92d0439d96285a 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,5 +1,6 @@ Source: netcdf-c -Version: 4.7.3-1 +Version: 4.7.3 +Port-Version: 4 Build-Depends: hdf5, curl Homepage: https://github.com/Unidata/netcdf-c Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/fix-dependency-libmath.patch b/ports/netcdf-c/fix-dependency-libmath.patch new file mode 100644 index 00000000000000..0db00ccaff9056 --- /dev/null +++ b/ports/netcdf-c/fix-dependency-libmath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 35c694f..e2c03e5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -839,7 +839,7 @@ ENDIF() + + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) +- FIND_LIBRARY(HAVE_LIBM NAMES math m libm) ++ FIND_LIBRARY(HAVE_LIBM NAMES m libm math) + MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) + MESSAGE(FATAL_ERROR "Unable to find the math library.") diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index d1af9d9f175d18..4813aa5b83824d 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( config-pkg-location.patch use_targets.patch mpi.patch + fix-dependency-libmath.patch ) #Remove outdated find modules diff --git a/ports/netcdf-c/usage b/ports/netcdf-c/usage index 98824b337bfa8d..681a20f8c1bde9 100644 --- a/ports/netcdf-c/usage +++ b/ports/netcdf-c/usage @@ -1,4 +1,4 @@ The package netcdf-c provides CMake targets: find_package(netCDF CONFIG REQUIRED) - target_link_libraries(main PRIVATE netcdf) \ No newline at end of file + target_link_libraries(main PRIVATE netcdf) diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL index baf0147c68b475..b628a3825bd4e3 100644 --- a/ports/netcdf-cxx4/CONTROL +++ b/ports/netcdf-cxx4/CONTROL @@ -1,5 +1,6 @@ Source: netcdf-cxx4 Version: 4.3.1 +Port-Version: 1 Build-Depends: hdf5, netcdf-c Homepage: https://github.com/Unidata/netcdf-cxx4 Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch index 5d289ec2efdac1..73b9a0d0134ddb 100644 --- a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch +++ b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch @@ -1,32 +1,41 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 60c699d..6bd7822 100644 +index 60c699d..f06fcc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -402,7 +402,7 @@ ELSE(MSVC) - FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) - ENDIF(MSVC) - --CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) -+set(HAVE_H5FREE_MEMORY ON) - IF(NOT HAVE_H5FREE_MEMORY) - MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") - SET(NC_HAS_DEF_VAR_FILTER "") -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6a48709..79de128 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -399,7 +399,13 @@ IF(MSVC) +@@ -395,14 +395,20 @@ ENDIF(NC_HAS_DEF_VAR_FILTER) + ### + # Find HDF5 + ### +-IF(MSVC) ++IF(0) SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL NO_MODULES REQUIRED ${NC_HDF5_LINK_TYPE}) ELSE(MSVC) - FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + FIND_PACKAGE(hdf5 CONFIG REQUIRED) + set(HDF5_FOUND ${hdf5_FOUND}) -+ if (BUILD_SHARED_LIBS) ++ if (NOT HDF5_USE_STATIC_LIBRARIES) + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared hdf5::hdf5_hl-shared) + else() + set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static hdf5::hdf5_hl-static) + endif() ENDIF(MSVC) - set(HAVE_H5FREE_MEMORY ON) +-CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY) ++set(HAVE_H5FREE_MEMORY ON) + IF(NOT HAVE_H5FREE_MEMORY) + MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") + SET(NC_HAS_DEF_VAR_FILTER "") +diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt +index 30a4a96..1809d29 100644 +--- a/plugins/CMakeLists.txt ++++ b/plugins/CMakeLists.txt +@@ -23,7 +23,7 @@ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES OUTPUT_NAME "bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "h5bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "h5bzip2") + SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES RUNTIME_OUTPUT_NAME "h5bzip2") +-TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS}) ++TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS} ${HDF5_C_LIBRARY_hdf5}) + + ADD_LIBRARY(misc MODULE ${libmisc_SOURCES}) + SET_TARGET_PROPERTIES(misc PROPERTIES LIBRARY_OUTPUT_NAME "misc") diff --git a/ports/netcdf-cxx4/portfile.cmake b/ports/netcdf-cxx4/portfile.cmake index d90ea7131ab3c0..3efd8e3aa0eefc 100644 --- a/ports/netcdf-cxx4/portfile.cmake +++ b/ports/netcdf-cxx4/portfile.cmake @@ -1,6 +1,6 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HDF5_USE_STATIC_LIBRARIES) -set(HDF5_USE_STATIC_LIBRARIES ON) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH diff --git a/ports/nettle/CONTROL b/ports/nettle/CONTROL index e73b0df663cb18..c6e3e37353b7cc 100644 --- a/ports/nettle/CONTROL +++ b/ports/nettle/CONTROL @@ -1,5 +1,5 @@ Source: nettle -Version: 3.5.1-1 +Version: 3.5.1-2 Homepage: https://git.lysator.liu.se/nettle/nettle Description: Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space. Build-Depends: gmp, vs-yasm (windows) \ No newline at end of file diff --git a/ports/ngspice/CONTROL b/ports/ngspice/CONTROL new file mode 100644 index 00000000000000..40a5d35b9cacc0 --- /dev/null +++ b/ports/ngspice/CONTROL @@ -0,0 +1,5 @@ +Source: ngspice +Version: 32 +Homepage: http://ngspice.sourceforge.net/ +Description: Ngspice is a mixed-level/mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley SPICE +Supports: !(linux|osx|arm|uwp) diff --git a/ports/ngspice/portfile.cmake b/ports/ngspice/portfile.cmake new file mode 100644 index 00000000000000..5265ac816ce4f8 --- /dev/null +++ b/ports/ngspice/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_fail_port_install(ON_TARGET "Linux" "OSX" "UWP" ON_ARCH "arm" "arm64") + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO ngspice/ng-spice-rework + REF 32 + FILENAME "ngspice-32.tar.gz" + SHA512 222eaa0cd6577a6eb8454bb49a7050a162d430c4b07a4fdc6baf350c5b3f5b018bac640fd44f465ec09c8cba6a9729b1cbe8d3d8c097f672acc2c22fabe8f4bc + PATCHES + use-winbison-global.patch +) + +vcpkg_find_acquire_program(BISON) + +get_filename_component(BISON_DIR "${BISON}" DIRECTORY) +vcpkg_add_to_path(PREPEND "${BISON_DIR}") + +# Ensure its windows +if (VCPKG_TARGET_IS_WINDOWS) + # Sadly, vcpkg globs .libs inside install_msbuild and whines that the 47 year old SPICE format isn't a MSVC lib ;) + # We need to kill them off first before the source tree is copied to a tmp location by install_msbuild + + file(REMOVE_RECURSE ${SOURCE_PATH}/contrib) + file(REMOVE_RECURSE ${SOURCE_PATH}/examples) + file(REMOVE_RECURSE ${SOURCE_PATH}/man) + file(REMOVE_RECURSE ${SOURCE_PATH}/tests) + + # We use build_msbuild because install_msbuild is incompatible due to SPICE using .lib for the last 47 years.... + vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION + SOURCE_PATH ${SOURCE_PATH} + INCLUDES_SUBPATH /src/include + LICENSE_SUBPATH COPYING + PLATFORM ${TRIPLET_SYSTEM_ARCH} # install_msbuild swaps x86 for win32(bad) if we dont force our own setting + PROJECT_SUBPATH visualc/sharedspice.sln + TARGET Build + ) +else() + message(FATAL_ERROR "Sorry but ngspice only can be built in Windows") +endif() + +# Unforunately install_msbuild isn't able to dual include directories that effectively layer +file(GLOB NGSPICE_INCLUDES + ${SOURCE_PATH}/visualc/src/include/ngspice/* +) +file(COPY ${NGSPICE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ngspice) + +vcpkg_copy_pdbs() diff --git a/ports/ngspice/use-winbison-global.patch b/ports/ngspice/use-winbison-global.patch new file mode 100644 index 00000000000000..f28a34acec3da9 --- /dev/null +++ b/ports/ngspice/use-winbison-global.patch @@ -0,0 +1,13 @@ +diff --git a/visualc/sharedspice.vcxproj b/visualc/sharedspice.vcxproj +index 96786b1..f5d9322 100644 +--- a/visualc/sharedspice.vcxproj ++++ b/visualc/sharedspice.vcxproj +@@ -879,7 +879,7 @@ + + + invoke win_bison.exe for %(Identity) +- ..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 ++ win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1 + .\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h + + diff --git a/ports/nifticlib/CONTROL b/ports/nifticlib/CONTROL new file mode 100644 index 00000000000000..acd8aedaa51db3 --- /dev/null +++ b/ports/nifticlib/CONTROL @@ -0,0 +1,25 @@ +Source: nifticlib +Version: 2020-04-30 +Description: Nifticlib is a C I/O library for reading and writing files in the nifti-1 data format. +Homepage: NIFTI-Imaging/nifti_clib +Build-Depends: zlib +Default-Features: nifti2, nifticdf +Supports: !uwp + +Feature: cifti +Description: Build cifti libraries and tools + +Feature: fsl +Description: Build fsl libraries and tools + +Feature: nifti2 +Description: Build nifti2 libraries and tools + +Feature: nifticdf +Description: Build nifticdf libraries and tools + +Feature: tools +Description: Build tools + +Feature: tests +Description: Build tests diff --git a/ports/nifticlib/portfile.cmake b/ports/nifticlib/portfile.cmake new file mode 100644 index 00000000000000..c9d74a49e5c39e --- /dev/null +++ b/ports/nifticlib/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO NIFTI-Imaging/nifti_clib + REF 65f801b9c2f1f15f4de4a19d45e6595c25765632 + SHA512 be03cdc6cf17fd9ff74c5ecc1f6b2132121bb4b7973a731da334af2a8428d1f0dbbf7b94b2511d1ff7e515b8cc4cf3316d62b189566fb6ffc88c6146eebd48ff + HEAD_REF master + PATCHES zlib_include.patch +) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "cifti" USE_CIFTI_CODE + "fsl" USE_FSL_CODE + "nifti2" USE_NIFTI2_CODE + "nifticdf" USE_NIFTICDF_CODE + "tools" NIFTI_BUILD_APPLICATIONS + "tests" BUILD_TESTING +) +set(TOOL_NAMES) +if("tools" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifti_stats nifti_tool nifti1_tool) +endif() +if("tests" IN_LIST FEATURES) + list(APPEND TOOL_NAMES nifit_test) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake TARGET_PATH share) + +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nifticlib/zlib_include.patch b/ports/nifticlib/zlib_include.patch new file mode 100644 index 00000000000000..1ef462b7f1f8de --- /dev/null +++ b/ports/nifticlib/zlib_include.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 54150d739..c3ca8fe50 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,6 +77,7 @@ set_if_not_defined(ZNZ_COMPILE_DEF "") + if(NOT NIFTI_ZLIB_LIBRARIES) # If using a custom zlib library, skip the find package + ### USE AS STAND ALONE PACKAGE + find_package(ZLIB REQUIRED) ++ include_directories(${ZLIB_INCLUDE_DIRS}) + set(NIFTI_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + endif() + #message(STATUS "---------------------ZLIB -${NIFTI_ZLIB_LIBRARIES}--") diff --git a/ports/nlohmann-json/CONTROL b/ports/nlohmann-json/CONTROL index 3e8f51fa6a8b43..f474ce9067e82e 100644 --- a/ports/nlohmann-json/CONTROL +++ b/ports/nlohmann-json/CONTROL @@ -1,5 +1,4 @@ Source: nlohmann-json -Version: 3.8.0 -Port-Version: 2 +Version: 3.9.1 Homepage: https://github.com/nlohmann/json Description: JSON for Modern C++ diff --git a/ports/nlohmann-json/portfile.cmake b/ports/nlohmann-json/portfile.cmake index 1f5f8575cf52df..448ca04b399c1d 100644 --- a/ports/nlohmann-json/portfile.cmake +++ b/ports/nlohmann-json/portfile.cmake @@ -1,4 +1,4 @@ -set(SOURCE_VERSION 3.8.0) +set(SOURCE_VERSION 3.9.1) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${PORT}-v${SOURCE_VERSION}) file(MAKE_DIRECTORY ${SOURCE_PATH}) @@ -13,16 +13,17 @@ function(download_src SUBPATH SHA512) file(COPY ${FILE} DESTINATION ${SUBPATH_DIR}) endfunction() -download_src(CMakeLists.txt 18151b19cb5258e58feffac8d4aed559c87e158dc217f47be23351b15c86e1d3f3c5ad2f7d11beabe3f0c0f948f3da1b9a807d425b1a9a0bb1ed74767cefafa9) +download_src(CMakeLists.txt d0ea797de0e3f98778cfcfa1249e9a363f0ae14f057f8f4338a2026d59eb929ddee9e45889c7f25d2c48633baa89ae9b4db4e5d99205f5ce7e1238fd82f3c113) download_src(LICENSE.MIT d5f7bb6a33469e19250a5e20db44e7ba09602ee85bc0afb03e4932402b08ca1c0dbbe6376b7e0a84eb11c782d70ae96f130755967204d35420c6ecbcafd301e5) download_src(nlohmann_json.natvis 9bce6758db0e54777394a4e718e60a281952b15f0c6dc6a6ad4a6d023c958b5515b2d39b7d4c66c03f0d3fdfdc1d6c23afb8b8419f1345c9d44d7b9a9ee2582b) download_src(cmake/config.cmake.in 7caab6166baa891f77f5b632ac4a920e548610ec41777b885ec51fe68d3665ffe91984dd2881caf22298b5392dfbd84b526fda252467bb66de9eb90e6e6ade5a) +download_src(cmake/pkg-config.pc.in 34afe9f9ef9c77c9053f81bdc5605523ba5c20ca1bc2e0cb26afe1754362b25e88d809df47cdd63024c60f346240010a6aa343ff46d6a959a38612b3f1955664) download_src(cmake/nlohmann_jsonConfigVersion.cmake.in 3b3ca2cfe740ba9646e5976b1112ba37c229bf527959bfb47a5e6c2fcd5ba6b5626d3c2455c181fe41a72ec78500738e2950e4fe76a2e91ba2073ba01f5595a8) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/nlohmann/json/releases/download/v${SOURCE_VERSION}/include.zip" FILENAME ${PORT}-v${SOURCE_VERSION}-include.zip - SHA512 f4453aced8d74cf7c65d038fdf8da1e2b2153a1c15e26c7f25394ab1ce81f78920dd30b418b1db4cbf3f934df0459024230700bdd943aad569b2525b6a26e5d0 + SHA512 24984da33c5bf80eb276712d4bdc698c2724e72dc0f4c70e87527fb6b16e21f535f5a022d52c7ed2f59dcfe4a4e5b61a56101b61def09b31c827689f6c7ec673 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH OUT_PATH diff --git a/ports/ocilib/CONTROL b/ports/ocilib/CONTROL index c5d4fbb3742c95..a4d44f4a36d902 100644 --- a/ports/ocilib/CONTROL +++ b/ports/ocilib/CONTROL @@ -1,5 +1,6 @@ Source: ocilib -Version: 4.6.4-1 +Version: 4.6.4 +Port-Version: 2 Homepage: https://vrogier.github.io/ocilib/ Description: OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases. Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/ocilib/portfile.cmake b/ports/ocilib/portfile.cmake index 84912c10f6c5d5..a8a451f484d899 100644 --- a/ports/ocilib/portfile.cmake +++ b/ports/ocilib/portfile.cmake @@ -1,62 +1,64 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO vrogier/ocilib - REF v4.6.4 - SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a - HEAD_REF master - PATCHES - out_of_source_build_version_file_configure.patch + OUT_SOURCE_PATH SOURCE_PATH + REPO vrogier/ocilib + REF v4.6.4 + SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a + HEAD_REF master + PATCHES + out_of_source_build_version_file_configure.patch ) if(VCPKG_TARGET_IS_WINDOWS) - if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v142") set(SOLUTION_TYPE vs2019) set(OCILIB_ARCH_X86 x86) set(OCILIB_ARCH_X64 x64) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(SOLUTION_TYPE vs2017) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - else() + else() set(SOLUTION_TYPE vs2015) set(OCILIB_ARCH_X86 Win32) set(OCILIB_ARCH_X64 Win64) - endif() + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM ${OCILIB_ARCH_X86}) else() set(PLATFORM ${OCILIB_ARCH_X64}) endif() - - # There is no debug configuration - # As it is a C library, build the release configuration and copy its output to the debug folder - set(VCPKG_BUILD_TYPE release) - vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln - INCLUDES_SUBPATH include - LICENSE_SUBPATH LICENSE - RELEASE_CONFIGURATION "Release - ANSI" - PLATFORM ${PLATFORM} - USE_VCPKG_INTEGRATION - ALLOW_ROOT_INCLUDES) + + # There is no debug configuration + # As it is a C library, build the release configuration and copy its output to the debug folder + set(VCPKG_BUILD_TYPE release) + vcpkg_install_msbuild( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln + INCLUDES_SUBPATH include + LICENSE_SUBPATH LICENSE + RELEASE_CONFIGURATION "Release - ANSI" + PLATFORM ${PLATFORM} + USE_VCPKG_INTEGRATION + ALLOW_ROOT_INCLUDES) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) - file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) + file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) else() - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - --with-oracle-import=runtime - ) + vcpkg_configure_make( + COPY_SOURCE + AUTOCONFIG + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + --with-oracle-import=runtime + ) - vcpkg_install_make() + vcpkg_install_make() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) - file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT}) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc) + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) endif() diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL deleted file mode 100644 index 521f13f1738f14..00000000000000 --- a/ports/ogre/CONTROL +++ /dev/null @@ -1,18 +0,0 @@ -Source: ogre -Version: 1.12.1-1 -Build-Depends: freeimage, freetype, zlib, zziplib -Homepage: https://github.com/OGRECave/ogre -Description: 3D Object-Oriented Graphics Rendering Engine - -Feature: d3d9 -Description: Build Direct3D9 RenderSystem - -Feature: csharp -Description: Build csharp bindings - -Feature: java -Description: Build Java (JNI) bindings - -Feature: python -Description: Build Python bindings -Build-Depends: python3 diff --git a/ports/ogre/fix-dependency.patch b/ports/ogre/fix-dependency.patch new file mode 100644 index 00000000000000..ba7e7516de72fa --- /dev/null +++ b/ports/ogre/fix-dependency.patch @@ -0,0 +1,45 @@ +diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake +index 959fdf5..dcd28bb 100644 +--- a/CMake/Dependencies.cmake ++++ b/CMake/Dependencies.cmake +@@ -217,7 +217,7 @@ find_package(FreeImage) + macro_log_feature(FreeImage_FOUND "freeimage" "Support for commonly used graphics image formats" "http://freeimage.sourceforge.net" FALSE "" "") + + # Find FreeType +-find_package(Freetype) ++find_package(freetype CONFIG REQUIRED) + macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "") + + # Find X11 +@@ -291,7 +291,7 @@ macro_log_feature(SWIG_FOUND "SWIG" "Language bindings (Python, Java, C#) for OG + # Find sdl2 + if(NOT ANDROID AND NOT EMSCRIPTEN) + # find script does not work in cross compilation environment +- find_package(SDL2 QUIET) ++ find_package(SDL2 CONFIG REQUIRED) + macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "") + if(SDL2_FOUND AND NOT TARGET SDL2::SDL2) + add_library(SDL2::SDL2 INTERFACE IMPORTED) +diff --git a/PlugIns/DotScene/CMakeLists.txt b/PlugIns/DotScene/CMakeLists.txt +index fd285df..ab8e9c1 100644 +--- a/PlugIns/DotScene/CMakeLists.txt ++++ b/PlugIns/DotScene/CMakeLists.txt +@@ -1,4 +1,4 @@ +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") + list(APPEND HEADER_FILES ${PROJECT_BINARY_DIR}/include/OgreDotScenePluginExports.h) +diff --git a/Tools/XMLConverter/CMakeLists.txt b/Tools/XMLConverter/CMakeLists.txt +index 8fe9683..2a516b2 100644 +--- a/Tools/XMLConverter/CMakeLists.txt ++++ b/Tools/XMLConverter/CMakeLists.txt +@@ -22,7 +22,7 @@ set(SOURCE_FILES + ) + + # allow override by cmake +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + add_executable(OgreXMLConverter ${HEADER_FILES} ${SOURCE_FILES}) + target_include_directories(OgreXMLConverter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/ports/ogre/fix-findimgui.patch b/ports/ogre/fix-findimgui.patch new file mode 100644 index 00000000000000..efd30d061ea704 --- /dev/null +++ b/ports/ogre/fix-findimgui.patch @@ -0,0 +1,35 @@ +diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt +index 1cea873..d3e756e 100644 +--- a/Components/Overlay/CMakeLists.txt ++++ b/Components/Overlay/CMakeLists.txt +@@ -19,12 +19,8 @@ list(APPEND HEADER_FILES + file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + + if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) +- list(APPEND SOURCE_FILES +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_draw.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_widgets.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_demo.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype/imgui_freetype.cpp) ++ find_package(imgui CONFIG REQUIRED) ++ find_path(IMGUI_INCLUDE_DIR imgui.h) + else() + list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreImGuiOverlay.cpp") + endif() +@@ -32,13 +28,13 @@ endif() + # setup target + add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) + set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) +-target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) ++target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB imgui::imgui) + target_include_directories(OgreOverlay PUBLIC + "$" + $ + PRIVATE ${FREETYPE_INCLUDE_DIRS}) + +-if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) ++if(0) + target_include_directories(OgreOverlay PUBLIC + PUBLIC "$" + PRIVATE "$") diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index f5faac14b88890..408ce416bf6544 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -9,11 +9,13 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OGRECave/ogre - REF 8083067c1835147de5d82015347d95c710e36bc0 - SHA512 0690aaff0bea74c38598894939396cab8077b84bda166deb4790fba87566114bc5267660e8efc4de9babeb1b8bddf73530e1a1dbbc63c7e24b14bc012b033bc8 + REF 8ff1a4046716244fc4b3a3e44e5b6abeda755b0a #v1.12.7 + SHA512 60c66118e35904cbabe881301f3e59026483507341450956f99b67220e1aaebd7035caac69c3e06cf45f08163254264da111b93d0c6b3402c3fba64858786b66 HEAD_REF master PATCHES toolchain_fixes.patch + fix-dependency.patch + fix-findimgui.patch ) file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake") diff --git a/ports/ogre/toolchain_fixes.patch b/ports/ogre/toolchain_fixes.patch index 9ff2d87dfe6b1d..cae36e1ebbbf9a 100644 --- a/ports/ogre/toolchain_fixes.patch +++ b/ports/ogre/toolchain_fixes.patch @@ -20,10 +20,10 @@ index a7a3796..2e21403 100644 set(INST_FILES Utils/FindPkgMacros.cmake) diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake -index 783755e..79f7514 100644 +index 06a055b..09d10bd 100644 --- a/CMake/InstallResources.cmake +++ b/CMake/InstallResources.cmake -@@ -208,10 +208,12 @@ endif () +@@ -201,10 +201,12 @@ endif () # Create the CMake package files include(CMakePackageConfigHelpers) @@ -38,8 +38,8 @@ index 783755e..79f7514 100644 + set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") + endif() endif() - configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${PROJECT_BINARY_DIR}/cmake/OGREConfig.cmake - INSTALL_DESTINATION ${OGRE_CMAKE_DIR} + if(WIN32) + set(OGRE_PLUGIN_DIR_CMAKE "bin") diff --git a/CMake/Packages/FindCg.cmake b/CMake/Packages/FindCg.cmake index 4501cf9..7eb57c3 100644 --- a/CMake/Packages/FindCg.cmake @@ -93,7 +93,7 @@ index 7125895..13a306f 100644 findpkg_finish(HLSL2GLSL) add_parent_dir(HLSL2GLSL_INCLUDE_DIRS HLSL2GLSL_INCLUDE_DIR) diff --git a/CMake/Packages/FindNVAPI.cmake b/CMake/Packages/FindNVAPI.cmake -index 2b9deba..f33a298 100644 +index 95c70cd..893ce01 100644 --- a/CMake/Packages/FindNVAPI.cmake +++ b/CMake/Packages/FindNVAPI.cmake @@ -44,7 +44,7 @@ findpkg_framework(NVAPI) @@ -238,10 +238,10 @@ index 374f84b..dc7066d 100644 # Generate debug names from given release names diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3e09d2d..58968f0 100644 +index 1602572..9fddbe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -274,7 +274,7 @@ elseif(EMSCRIPTEN) +@@ -269,7 +269,7 @@ elseif(EMSCRIPTEN) elseif (APPLE AND NOT APPLE_IOS) set(XCODE_ATTRIBUTE_SDKROOT macosx) @@ -250,32 +250,6 @@ index 3e09d2d..58968f0 100644 execute_process(COMMAND xcodebuild -version -sdk "${XCODE_ATTRIBUTE_SDKROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT) string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}") else() -diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt -index bdb303d..d9cc221 100644 ---- a/Components/Overlay/CMakeLists.txt -+++ b/Components/Overlay/CMakeLists.txt -@@ -21,7 +21,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") - # setup target - add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} ${PLATFORM_SOURCE_FILES}) - set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) --target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE "${FREETYPE_LIBRARIES}" ZLIB::ZLIB) -+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) - target_include_directories(OgreOverlay PUBLIC - "$" - $ -diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt -index 6ec4e34..cc9cb9d 100644 ---- a/OgreMain/CMakeLists.txt -+++ b/OgreMain/CMakeLists.txt -@@ -225,8 +225,6 @@ if (APPLE) - set_target_properties(OgreMain PROPERTIES - LINK_FLAGS "-framework IOKit -framework Cocoa -framework Carbon -framework OpenGL -framework CoreVideo" - ) -- -- set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)") - - if(OGRE_BUILD_LIBS_AS_FRAMEWORKS) - add_custom_command(TARGET OgreMain POST_BUILD diff --git a/PlugIns/EXRCodec/CMakeLists.txt b/PlugIns/EXRCodec/CMakeLists.txt index e9c936a..bb8747e 100644 --- a/PlugIns/EXRCodec/CMakeLists.txt diff --git a/ports/ogre/vcpkg.json b/ports/ogre/vcpkg.json new file mode 100644 index 00000000000000..133fb3cfb200e8 --- /dev/null +++ b/ports/ogre/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "ogre", + "version-string": "1.12.7", + "description": "3D Object-Oriented Graphics Rendering Engine", + "homepage": "https://github.com/OGRECave/ogre", + "dependencies": [ + "freeimage", + "freetype", + { + "name": "imgui", + "features": [ + "freetype" + ] + }, + "pugixml", + "sdl2", + "zlib", + "zziplib" + ], + "features": [ + { + "name": "csharp", + "description": "Build csharp bindings" + }, + { + "name": "d3d9", + "description": "Build Direct3D9 RenderSystem" + }, + { + "name": "java", + "description": "Build Java (JNI) bindings" + }, + { + "name": "python", + "description": "Build Python bindings", + "dependencies": [ + "python3" + ] + } + ] +} diff --git a/ports/ompl/CONTROL b/ports/ompl/CONTROL index 8a60f34cdd4bc2..292ad71b66ee57 100644 --- a/ports/ompl/CONTROL +++ b/ports/ompl/CONTROL @@ -1,5 +1,6 @@ Source: ompl -Version: 1.4.2-4 +Version: 1.4.2 +Port-Version: 5 Homepage: https://bitbucket.org/ompl Description: The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms Build-Depends: boost-dynamic-bitset, boost-filesystem, boost-graph, boost-odeint, boost-program-options, boost-serialization, boost-system, boost-test, boost-ublas, boost-timer, eigen3 diff --git a/ports/ompl/portfile.cmake b/ports/ompl/portfile.cmake index 074d2b852aa14a..a3c1244e931a22 100644 --- a/ports/ompl/portfile.cmake +++ b/ports/ompl/portfile.cmake @@ -29,6 +29,7 @@ file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${_contents}") vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + DISABLE_PARALLEL_CONFIGURE OPTIONS -DOMPL_VERSIONED_INSTALL=OFF -DOMPL_REGISTRATION=OFF diff --git a/ports/openal-soft/CONTROL b/ports/openal-soft/CONTROL index 6b84e63ff2b8b5..a139fb9e8085a8 100644 --- a/ports/openal-soft/CONTROL +++ b/ports/openal-soft/CONTROL @@ -1,6 +1,6 @@ Source: openal-soft Version: 1.20.1 -Port-Version: 4 +Port-Version: 5 Homepage: https://github.com/kcat/openal-soft Description: OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API. Supports: !uwp diff --git a/ports/openal-soft/fix-mingw-build.patch b/ports/openal-soft/fix-mingw-build.patch new file mode 100644 index 00000000000000..ffb2db303a4ad4 --- /dev/null +++ b/ports/openal-soft/fix-mingw-build.patch @@ -0,0 +1,14 @@ +diff --git a/common/alstring.h b/common/alstring.h +index 194e54a1..5a5f87ed 100644 +--- a/common/alstring.h ++++ b/common/alstring.h +@@ -4,6 +4,9 @@ + #include + #include + ++// This fixes MinGW link errors. It defines strcasecmp and strncasecmp in string.h. ++#include ++ + #include "almalloc.h" + + diff --git a/ports/openal-soft/portfile.cmake b/ports/openal-soft/portfile.cmake index 5b6c8067ce5948..31ebc6bae143ad 100644 --- a/ports/openal-soft/portfile.cmake +++ b/ports/openal-soft/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES dont-export-symbols-in-static-build.patch fix-arm-builds.patch + fix-mingw-build.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/openblas/CONTROL b/ports/openblas/CONTROL index 3c2b0b7ebe68d7..ea246834dd9953 100644 --- a/ports/openblas/CONTROL +++ b/ports/openblas/CONTROL @@ -1,5 +1,6 @@ Source: openblas -Version: 0.3.9-1 +Version: 0.3.9 +Port-Version: 2 Homepage: https://github.com/xianyi/OpenBLAS -Build-Depends: pthread (linux) +Build-Depends: pthread (linux&osx) Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. diff --git a/ports/openblas/portfile.cmake b/ports/openblas/portfile.cmake index 2decb588380674..57b9236ace6cd6 100644 --- a/ports/openblas/portfile.cmake +++ b/ports/openblas/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xianyi/OpenBLAS @@ -22,13 +20,15 @@ set(SED_EXE_PATH "${GIT_EXE_PATH}/../usr/bin") # openblas require perl to generate .def for exports vcpkg_find_acquire_program(PERL) get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) -set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH};${SED_EXE_PATH}") +set(PATH_BACKUP "$ENV{PATH}") +vcpkg_add_to_path("${PERL_EXE_PATH}") +vcpkg_add_to_path("${SED_EXE_PATH}") set(COMMON_OPTIONS -DBUILD_WITHOUT_LAPACK=ON) # for UWP version, must build non uwp first for helper # binaries. -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_UWP) message(STATUS "Building Windows helper files") set(TEMP_CMAKE_SYSTEM_NAME "${VCPKG_CMAKE_SYSTEM_NAME}") set(TEMP_CMAKE_SYSTEM_VERSION "${VCPKG_CMAKE_SYSTEM_VERSION}") @@ -46,7 +46,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") # add just built path to environment for gen_config_h.exe, # getarch.exe and getarch_2nd.exe - set(ENV{PATH} "$ENV{PATH};${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + vcpkg_add_to_path("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") # restore target build information set(VCPKG_CMAKE_SYSTEM_NAME "${TEMP_CMAKE_SYSTEM_NAME}") @@ -63,7 +63,7 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -DVS_WINRT_COMPONENT=TRUE "-DBLASHELPER_BINARY_DIR=${CURRENT_BUILDTREES_DIR}/x64-windows-rel") -elseif(NOT VCPKG_CMAKE_SYSTEM_NAME) +elseif(VCPKG_TARGET_IS_WINDOWS) vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} @@ -85,6 +85,23 @@ endif() vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/OpenBLAS TARGET_PATH share/openblas) +set(ENV{PATH} "${PATH_BACKUP}") + +set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/openblas.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/blas.pc" COPY_ON_ERROR) +endif() +set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/openblas.pc") +if(EXISTS "${pcfile}") + file(READ "${pcfile}" _contents) + set(_contents "prefix=${CURRENT_INSTALLED_DIR}/debug\n${_contents}") + file(WRITE "${pcfile}" "${_contents}") + #file(CREATE_LINK "${pcfile}" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/blas.pc" COPY_ON_ERROR) +endif() +vcpkg_fixup_pkgconfig() #maybe we need also to write a wrapper inside share/blas to search implicitly for openblas, whenever we feel it's ready for its own -config.cmake file # openblas do not make the config file , so I manually made this @@ -97,8 +114,7 @@ string(REPLACE "#include \"common.h\"" "#include \"openblas_common.h\"" CBLAS_H file(WRITE ${CURRENT_PACKAGES_DIR}/include/cblas.h "${CBLAS_H}") # openblas is BSD -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openblas) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openblas/LICENSE ${CURRENT_PACKAGES_DIR}/share/openblas/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindBLAS.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/blas) diff --git a/ports/opencl/CONTROL b/ports/opencl/CONTROL index 9ad614bbf67b9e..41069be8225e56 100644 --- a/ports/opencl/CONTROL +++ b/ports/opencl/CONTROL @@ -1,5 +1,6 @@ Source: opencl -Version: 2.2-2-1 +Version: 2.2 +Port-Version: 3 Homepage: https://github.com/KhronosGroup/OpenCL-Headers Description: C/C++ headers and ICD loader (Installable Client Driver) for OpenCL diff --git a/ports/opencl/vcpkg-cmake-wrapper.cmake b/ports/opencl/vcpkg-cmake-wrapper.cmake index 73c9da576937b5..0893710ff58a4a 100644 --- a/ports/opencl/vcpkg-cmake-wrapper.cmake +++ b/ports/opencl/vcpkg-cmake-wrapper.cmake @@ -4,6 +4,9 @@ if(NOT BUILD_SHARED_LIBS AND (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")) set(OpenCL_Extra_Libs ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) if(CMAKE_SYSTEM_NAME MATCHES "Windows") list(APPEND OpenCL_Extra_Libs cfgmgr32) + if($ENV{WindowsSDKVersion} MATCHES "^10") + list(APPEND OpenCL_Extra_Libs OneCoreUAP) + endif() endif(CMAKE_SYSTEM_NAME MATCHES "Windows") if(TARGET OpenCL::OpenCL) diff --git a/ports/opencolorio-tools/0001-lcms-dependency-search.patch b/ports/opencolorio-tools/0001-lcms-dependency-search.patch new file mode 100644 index 00000000000000..353a8061501cbb --- /dev/null +++ b/ports/opencolorio-tools/0001-lcms-dependency-search.patch @@ -0,0 +1,40 @@ +diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt +index d31b4e3..2b57d1c 100644 +--- a/src/apps/ociobakelut/CMakeLists.txt ++++ b/src/apps/ociobakelut/CMakeLists.txt +@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE + FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" + "${LCMS_INCLUDE_DIR}") + else() ++ find_path(LCMS_INCLUDE_DIRS ++ NAMES ++ lcms2.h ++ lcms2_plugin.h ++ HINTS ++ ${LCMS_INCLUDEDIR} ++ ${LCMS_INCLUDE_DIRS} ++ ) ++ ++ find_library(LCMS_LIBRARIES ++ LIBRARY_NAMES ++ lcms ++ lcms2 ++ HINTS ++ ${LCMS_LIBRARY_DIRS} ++ ) ++ ++ get_filename_component(LCMS_LIBRARY_DIRS ${LCMS_LIBRARIES} DIRECTORY) ++ ++ find_package_handle_standard_args(LCMS ++ REQUIRED_VARS ++ LCMS_LIBRARIES ++ LCMS_LIBRARY_DIRS ++ LCMS_INCLUDE_DIRS ++ ) ++ mark_as_advanced(LCMS_LIBRARIES LCMS_INCLUDE_DIRS LCMS_LIBRARY_DIRS LCMS_FOUND) ++endif() ++ ++if(NOT LCMS_FOUND) + find_package(Git) + if(NOT GIT_EXECUTABLE) + message("Git not found, could not build external LCMS as we cannot apply patch") diff --git a/ports/opencolorio-tools/0002-msvc-cpluscplus.patch b/ports/opencolorio-tools/0002-msvc-cpluscplus.patch new file mode 100644 index 00000000000000..c4349ea1276bb8 --- /dev/null +++ b/ports/opencolorio-tools/0002-msvc-cpluscplus.patch @@ -0,0 +1,84 @@ +diff --git a/src/apps/ocioconvert/CMakeLists.txt b/src/apps/ocioconvert/CMakeLists.txt +index 82b0792..7d16bdf 100644 +--- a/src/apps/ocioconvert/CMakeLists.txt ++++ b/src/apps/ocioconvert/CMakeLists.txt +@@ -6,16 +6,23 @@ if (OIIO_FOUND) + ${OIIO_INCLUDES} + ${ILMBASE_INCLUDES} + ) +- ++ + file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") +- ++ + add_executable(ocioconvert ${share_src_files} main.cpp) +- ++ ++ target_compile_options(ocioconvert ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + set_target_properties(ocioconvert PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + + target_link_libraries(ocioconvert ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) +- ++ + target_link_OCIO(ocioconvert) +- ++ + install(TARGETS ocioconvert EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) + endif() +diff --git a/src/apps/ociodisplay/CMakeLists.txt b/src/apps/ociodisplay/CMakeLists.txt +index d11b9e1..0f27d86 100644 +--- a/src/apps/ociodisplay/CMakeLists.txt ++++ b/src/apps/ociodisplay/CMakeLists.txt +@@ -11,6 +11,13 @@ if (OIIO_FOUND) + + add_executable(ociodisplay main.cpp) + ++ target_compile_options(ociodisplay ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + # set_target_properties(ociodisplay PROPERTIES INSTALL_RPATH ${OIIO_LIBRARIES} ) + set_target_properties(ociodisplay PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + target_link_libraries(ociodisplay ${GLEW_LIBRARIES} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${OIIO_LIBRARIES}) +diff --git a/src/apps/ociolutimage/CMakeLists.txt b/src/apps/ociolutimage/CMakeLists.txt +index 528333f..821155d 100644 +--- a/src/apps/ociolutimage/CMakeLists.txt ++++ b/src/apps/ociolutimage/CMakeLists.txt +@@ -6,16 +6,23 @@ if (OIIO_FOUND) + ${OIIO_INCLUDES} + ${ILMBASE_INCLUDES} + ) +- ++ + file(GLOB_RECURSE share_src_files "${CMAKE_SOURCE_DIR}/src/apps/share/*.cpp") +- ++ + add_executable(ociolutimage ${share_src_files} main.cpp) +- ++ ++ target_compile_options(ociolutimage ++ PRIVATE ++ $<$: ++ /Zc:__cplusplus # Enable updated __cplusplus macro ++ > ++ ) ++ + set_target_properties(ociolutimage PROPERTIES COMPILE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) + + target_link_libraries(ociolutimage ${OIIO_LIBRARIES} ${CMAKE_DL_LIBS}) +- ++ + target_link_OCIO(ociolutimage) +- ++ + install(TARGETS ociolutimage EXPORT OpenColorIO DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/bin) + endif() diff --git a/ports/opencolorio-tools/0003-osx-self-assign-field.patch b/ports/opencolorio-tools/0003-osx-self-assign-field.patch new file mode 100644 index 00000000000000..18947bbbdeed1e --- /dev/null +++ b/ports/opencolorio-tools/0003-osx-self-assign-field.patch @@ -0,0 +1,13 @@ +diff --git a/src/core/Config.cpp b/src/core/Config.cpp +index f5cb379..5ea178e 100644 +--- a/src/core/Config.cpp ++++ b/src/core/Config.cpp +@@ -330,7 +330,7 @@ OCIO_NAMESPACE_ENTER + sanitytext_ = rhs.sanitytext_; + + cacheids_ = rhs.cacheids_; +- cacheidnocontext_ = cacheidnocontext_; ++ cacheidnocontext_ = rhs.cacheidnocontext_; + } + return *this; + } diff --git a/ports/opencolorio-tools/0004-yaml-dependency-search.patch b/ports/opencolorio-tools/0004-yaml-dependency-search.patch new file mode 100644 index 00000000000000..30c01d41a83239 --- /dev/null +++ b/ports/opencolorio-tools/0004-yaml-dependency-search.patch @@ -0,0 +1,108 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4f3119..5cfa601 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,34 +244,49 @@ else(USE_EXTERNAL_TINYXML) + endif() + set_target_properties(TINYXML_LIB PROPERTIES FOLDER External) + endif(USE_EXTERNAL_TINYXML) +- ++ + ############################################################################### + ### YAML ### + + if(USE_EXTERNAL_YAML) +- # Set minimum yaml version for non-patched sources. +- set(YAML_VERSION_MIN "0.3.0") +- include(FindPkgConfig) +- pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) +- find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h +- HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) +- find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp +- HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) +- set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) +- set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) +- set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) +- +- if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) +- message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") +- endif() ++ find_package(yaml-cpp 0.3.0) ++ if(yaml-cpp_FOUND) ++ include(FindPackageMessage) ++ ++ set(YAML_CPP_FOUND ${yaml-cpp_FOUND}) ++ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) ++ set(YAML_CPP_VERSION ${yaml-cpp_VERSION}) ++ set(YAML_CPP_LIBRARIES yaml-cpp) ++ ++ find_package_message(yaml-cpp ++ "Found yaml ${YAML_CPP_VERSION}: ${YAML_CPP_INCLUDE_DIRS}" ++ "${YAML_CPP_INCLUDE_DIRS}:${YAML_CPP_LIBRARIES}" ++ ) ++ else() ++ # Set minimum yaml version for non-patched sources. ++ set(YAML_VERSION_MIN "0.3.0") ++ include(FindPkgConfig) ++ pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp) ++ find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h ++ HINTS ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} ) ++ find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp ++ HINTS ${PC_YAML_CPP_LIBRARY_DIRS} ) ++ set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY}) ++ set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) ++ set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION}) ++ ++ if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN}) ++ message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.") ++ endif() + +- find_package_handle_standard_args(yaml-cpp +- REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) +- set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) +- mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) ++ find_package_handle_standard_args(yaml-cpp ++ REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS ) ++ set(YAML_CPP_FOUND ${YAML-CPP_FOUND}) ++ mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND) ++ endif() + + if(YAML_CPP_FOUND) +- if(YAML_CPP_VERSION VERSION_GREATER "0.5.0") ++ if(YAML_CPP_VERSION VERSION_GREATER "0.5.0" AND YAML_CPP_VERSION VERSION_LESS "0.6.0") + # Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them. + # Don't bother doing this step if we are already including the boost headers for shared_ptr + if(NOT OCIO_USE_BOOST_PTR) +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 4b931ef..12a1dbf 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -77,7 +77,14 @@ endif() + if(OCIO_BUILD_STATIC) + list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) +- add_dependencies(OpenColorIO_STATIC TINYXML_LIB YAML_CPP_LIB) ++ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ ++ if(USE_EXTERNAL_YAML) ++ target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) ++ else(USE_EXTERNAL_YAML) ++ add_dependencies(OpenColorIO_STATIC YAML_CPP_LIB) ++ endif() ++ + if(EXTERNAL_LIBRARIES) + target_link_libraries(OpenColorIO_STATIC ${EXTERNAL_LIBRARIES}) + endif() +diff --git a/src/core/OCIOYaml.cpp b/src/core/OCIOYaml.cpp +index aeee4d1..f1c662d 100644 +--- a/src/core/OCIOYaml.cpp ++++ b/src/core/OCIOYaml.cpp +@@ -69,7 +69,7 @@ namespace YAML { + + #ifdef WIN32 + #pragma warning( push ) +-#pragma warning( disable: 4146 ) ++#pragma warning( disable: 4146 4251 ) + #endif + + #include diff --git a/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch b/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch new file mode 100644 index 00000000000000..319f88b733fdf0 --- /dev/null +++ b/ports/opencolorio-tools/0005-tinyxml-dependency-search.patch @@ -0,0 +1,18 @@ +diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt +index 45e55f9..f4b687d 100644 +--- a/src/core/CMakeLists.txt ++++ b/src/core/CMakeLists.txt +@@ -77,7 +77,12 @@ endif() + if(OCIO_BUILD_STATIC) + list(REMOVE_ITEM core_src_files ${CMAKE_SOURCE_DIR}/src/core/UnitTest.cpp) + add_library(OpenColorIO_STATIC STATIC ${EXTERNAL_OBJECTS} ${core_src_files}) +- add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ ++ if(USE_EXTERNAL_TINYXML) ++ target_link_libraries(OpenColorIO_STATIC ${TINYXML_LIBRARIES}) ++ else(USE_EXTERNAL_TINYXML) ++ add_dependencies(OpenColorIO_STATIC TINYXML_LIB) ++ endif(USE_EXTERNAL_TINYXML) + + if(USE_EXTERNAL_YAML) + target_link_libraries(OpenColorIO_STATIC ${YAML_CPP_LIBRARIES}) diff --git a/ports/opencolorio-tools/0006-oiio-dependency-search.patch b/ports/opencolorio-tools/0006-oiio-dependency-search.patch new file mode 100644 index 00000000000000..09624e55c70740 --- /dev/null +++ b/ports/opencolorio-tools/0006-oiio-dependency-search.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cfa601..f79807c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,7 +475,8 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ find_package(OpenImageIO CONFIG REQUIRED) ++ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio-tools/CONTROL b/ports/opencolorio-tools/CONTROL new file mode 100644 index 00000000000000..679933a250eb60 --- /dev/null +++ b/ports/opencolorio-tools/CONTROL @@ -0,0 +1,5 @@ +Source: opencolorio-tools +Version: 1.1.1 +Homepage: https://opencolorio.org/ +Description: OpenColorIO applications, same source with port OpenColorIO. +Build-Depends: openimageio[opencolorio] diff --git a/ports/opencolorio-tools/portfile.cmake b/ports/opencolorio-tools/portfile.cmake new file mode 100644 index 00000000000000..f08786a325c3d0 --- /dev/null +++ b/ports/opencolorio-tools/portfile.cmake @@ -0,0 +1,68 @@ +# Note: Should be maintained simultaneously with opencolorio! +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(_BUILD_SHARED OFF) + set(_BUILD_STATIC ON) +else() + set(_BUILD_SHARED ON) + set(_BUILD_STATIC OFF) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO imageworks/OpenColorIO + REF v1.1.1 + SHA512 bed722f9ddce1887d28aacef2882debccd7c3f3c0c708d2723fea58a097de9f02721af9e85453e089ffda5406aef593ab6536c6886307823c132aa787e492e33 + HEAD_REF master + PATCHES + 0001-lcms-dependency-search.patch + 0002-msvc-cpluscplus.patch + 0003-osx-self-assign-field.patch + 0004-yaml-dependency-search.patch + 0005-tinyxml-dependency-search.patch + 0006-oiio-dependency-search.patch +) + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) +vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) + +# TODO(theblackunknown) build additional targets based on feature + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DOCIO_BUILD_APPS=ON + -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} + -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} + -DOCIO_BUILD_TRUELIGHT:BOOL=OFF + -DOCIO_BUILD_NUKE:BOOL=OFF + -DOCIO_BUILD_DOCS:BOOL=OFF + -DOCIO_BUILD_TESTS:BOOL=OFF + -DOCIO_BUILD_PYGLUE:BOOL=OFF + -DOCIO_BUILD_JNIGLUE:BOOL=OFF + -DOCIO_STATIC_JNIGLUE:BOOL=OFF + -DUSE_EXTERNAL_TINYXML:BOOL=ON + -DUSE_EXTERNAL_YAML:BOOL=ON +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +vcpkg_copy_tools(TOOL_NAMES ociobakelut ociocheck) + +# Clean redundant files +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug + ${CURRENT_PACKAGES_DIR}/include + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/lib + ${CURRENT_PACKAGES_DIR}/cmake + ${CURRENT_PACKAGES_DIR}/share) + +file(REMOVE ${CURRENT_PACKAGES_DIR}/OpenColorIOConfig.cmake) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencolorio/0001-lcms-dependency-search.patch b/ports/opencolorio/0001-lcms-dependency-search.patch index 597609a6e6e95e..353a8061501cbb 100644 --- a/ports/opencolorio/0001-lcms-dependency-search.patch +++ b/ports/opencolorio/0001-lcms-dependency-search.patch @@ -1,8 +1,8 @@ diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt -index d31b4e3..778b631 100644 +index d31b4e3..2b57d1c 100644 --- a/src/apps/ociobakelut/CMakeLists.txt +++ b/src/apps/ociobakelut/CMakeLists.txt -@@ -5,6 +5,34 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE +@@ -5,6 +5,35 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}" "${LCMS_INCLUDE_DIR}") else() @@ -18,6 +18,7 @@ index d31b4e3..778b631 100644 + find_library(LCMS_LIBRARIES + LIBRARY_NAMES + lcms ++ lcms2 + HINTS + ${LCMS_LIBRARY_DIRS} + ) diff --git a/ports/opencolorio/0006-oiio-dependency-search.patch b/ports/opencolorio/0006-oiio-dependency-search.patch new file mode 100644 index 00000000000000..09624e55c70740 --- /dev/null +++ b/ports/opencolorio/0006-oiio-dependency-search.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cfa601..f79807c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -475,7 +475,8 @@ endif() + if(OCIO_BUILD_APPS AND (OCIO_BUILD_STATIC OR OCIO_BUILD_SHARED) ) + + # Try to find OpenImageIO (OIIO) and OpenGL stuff +- OCIOFindOpenImageIO() ++ find_package(OpenImageIO CONFIG REQUIRED) ++ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util) + + if(OIIO_FOUND) + add_subdirectory(src/apps/ocioconvert) diff --git a/ports/opencolorio/CONTROL b/ports/opencolorio/CONTROL index 9d57a22e3b0138..806609be0d4333 100644 --- a/ports/opencolorio/CONTROL +++ b/ports/opencolorio/CONTROL @@ -1,9 +1,6 @@ Source: opencolorio -Version: 1.1.1-2 +Version: 1.1.1 +Port-Version: 3 Homepage: https://opencolorio.org/ Description: OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation. OCIO provides a straightforward and consistent user experience across all supporting applications while allowing for sophisticated back-end configuration options suitable for high-end production usage. OCIO is compatible with the Academy Color Encoding Specification (ACES) and is LUT-format agnostic, supporting many popular formats. -Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] - -Feature: applications -Description: Enable OpenColorIO tools -Build-Depends: openimageio[core], openexr[core] +Build-Depends: glew[core], freeglut[core], lcms[core], yaml-cpp[core], tinyxml[core] \ No newline at end of file diff --git a/ports/opencolorio/portfile.cmake b/ports/opencolorio/portfile.cmake index 1d9ee2d7e1cbcf..1a55713e67425b 100644 --- a/ports/opencolorio/portfile.cmake +++ b/ports/opencolorio/portfile.cmake @@ -1,3 +1,4 @@ +# Note: Should be maintained simultaneously with opencolorio-tools! if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(_BUILD_SHARED OFF) set(_BUILD_STATIC ON) @@ -20,12 +21,6 @@ vcpkg_from_github( 0005-tinyxml-dependency-search.patch ) -vcpkg_check_features( - OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - applications OCIO_BUILD_APPS -) - vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_PATH}) @@ -36,7 +31,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - ${FEATURE_OPTIONS} + -DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_SHARED:BOOL=${_BUILD_SHARED} -DOCIO_BUILD_STATIC:BOOL=${_BUILD_STATIC} -DOCIO_BUILD_TRUELIGHT:BOOL=OFF @@ -56,33 +51,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH "cmake") vcpkg_copy_pdbs() -if("applications" IN_LIST FEATURES) - # port applications to tools - file(MAKE_DIRECTORY - "${CURRENT_PACKAGES_DIR}/tools/${PORT}" - "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}" - ) - - file(GLOB_RECURSE _TOOLS - "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" - ) - foreach(_TOOL IN LISTS _TOOLS) - get_filename_component(_NAME ${_TOOL} NAME) - file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${_NAME}") - endforeach() - - file(GLOB_RECURSE _TOOLS - "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}" - ) - foreach(_TOOL IN LISTS _TOOLS) - get_filename_component(_NAME ${_TOOL} NAME) - file(RENAME "${_TOOL}" "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/${_NAME}") - endforeach() - - vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") - vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}") -endif() - # Clean redundant files file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/opencv/CONTROL b/ports/opencv/CONTROL index 7b5ba5af93765b..768d8fda7d9ee4 100644 --- a/ports/opencv/CONTROL +++ b/ports/opencv/CONTROL @@ -1,102 +1,102 @@ -Source: opencv -Version: 4.1.1-1 -Homepage: https://github.com/opencv/opencv -Description: Computer vision library -Build-Depends: opencv4[core] -Default-Features: dnn, jpeg, opengl, png, tiff, webp - -Feature: nonfree -Build-Depends: opencv4[nonfree] -Description: opencv nonfree module - -Feature: ade -Build-Depends: opencv4[ade] -Description: graph api - -Feature: contrib -Build-Depends: opencv4[contrib] -Description: opencv_contrib module - -Feature: cuda -Build-Depends: opencv4[cuda] -Description: CUDA support for opencv - -Feature: dnn -Build-Depends: opencv4[dnn] -Description: Enable dnn module - -Feature: eigen -Build-Depends: opencv4[eigen] -Description: Eigen support for opencv - -Feature: ffmpeg -Build-Depends: opencv4[ffmpeg] -Description: ffmpeg support for opencv - -Feature: gdcm -Build-Depends: opencv4[gdcm] -Description: GDCM support for opencv - -Feature: ipp -Build-Depends: opencv4[ipp] -Description: Enable Intel Integrated Performance Primitives - -Feature: jasper -Build-Depends: opencv4[jasper] -Description: JPEG 2000 support for opencv - -Feature: jpeg -Build-Depends: opencv4[jpeg] -Description: JPEG support for opencv - -Feature: openexr -Build-Depends: opencv4[openexr] -Description: OpenEXR support for opencv - -Feature: opengl -Build-Depends: opencv4[opengl] -Description: opengl support for opencv - -Feature: openmp -Build-Depends: opencv4[openmp] -Description: Enable openmp support for opencv - -Feature: ovis -Build-Depends: opencv4[ovis] -Description: opencv_ovis module - -Feature: png -Build-Depends: opencv4[png] -Description: PNG support for opencv - -Feature: qt -Build-Depends: opencv4[qt] -Description: Qt GUI support for opencv - -Feature: sfm -Build-Depends: opencv4[sfm] -Description: opencv_sfm module - -Feature: tbb -Build-Depends: opencv4[tbb] -Description: Enable Intel Threading Building Blocks - -Feature: tiff -Build-Depends: opencv4[tiff] -Description: TIFF support for opencv - -Feature: vtk -Build-Depends: opencv4[vtk] -Description: vtk support for opencv - -Feature: webp -Build-Depends: opencv4[webp] -Description: WebP support for opencv - -Feature: halide -Build-Depends: opencv4[halide] -Description: Halide support for opencv - -Feature: world -Build-Depends: opencv4[world] -Description: Compile to a single package support for opencv +Source: opencv +Version: 4.3.0 +Homepage: https://github.com/opencv/opencv +Description: Computer vision library +Build-Depends: opencv4[core] +Default-Features: dnn, jpeg, opengl, png, tiff, webp + +Feature: nonfree +Build-Depends: opencv4[core,nonfree] +Description: opencv nonfree module + +Feature: ade +Build-Depends: opencv4[core,ade] +Description: graph api + +Feature: contrib +Build-Depends: opencv4[core,contrib] +Description: opencv_contrib module + +Feature: cuda +Build-Depends: opencv4[core,cuda] +Description: CUDA support for opencv + +Feature: dnn +Build-Depends: opencv4[core,dnn] +Description: Enable dnn module + +Feature: eigen +Build-Depends: opencv4[core,eigen] +Description: Eigen support for opencv + +Feature: ffmpeg +Build-Depends: opencv4[core,ffmpeg] +Description: ffmpeg support for opencv + +Feature: gdcm +Build-Depends: opencv4[core,gdcm] +Description: GDCM support for opencv + +Feature: halide +Build-Depends: opencv4[core,halide] +Description: Halide support for opencv + +Feature: ipp +Build-Depends: opencv4[core,ipp] +Description: Enable Intel Integrated Performance Primitives + +Feature: jasper +Build-Depends: opencv4[core,jasper] +Description: JPEG 2000 support for opencv + +Feature: jpeg +Build-Depends: opencv4[core,jpeg] +Description: JPEG support for opencv + +Feature: openexr +Build-Depends: opencv4[core,openexr] +Description: OpenEXR support for opencv + +Feature: opengl +Build-Depends: opencv4[core,opengl] +Description: opengl support for opencv + +Feature: openmp +Build-Depends: opencv4[core,openmp] +Description: Enable openmp support for opencv + +Feature: ovis +Build-Depends: opencv4[core,ovis] +Description: opencv_ovis module + +Feature: png +Build-Depends: opencv4[core,png] +Description: PNG support for opencv + +Feature: qt +Build-Depends: opencv4[core,qt] +Description: Qt GUI support for opencv + +Feature: sfm +Build-Depends: opencv4[core,sfm] +Description: opencv_sfm module + +Feature: tbb +Build-Depends: opencv4[core,tbb] +Description: Enable Intel Threading Building Blocks + +Feature: tiff +Build-Depends: opencv4[core,tiff] +Description: TIFF support for opencv + +Feature: vtk +Build-Depends: opencv4[core,vtk] +Description: vtk support for opencv + +Feature: webp +Build-Depends: opencv4[core,webp] +Description: WebP support for opencv + +Feature: world +Build-Depends: opencv4[core,world] +Description: Compile to a single package support for opencv diff --git a/ports/opencv2/CONTROL b/ports/opencv2/CONTROL index 391621beecdcb8..d2cff4b6a612b5 100644 --- a/ports/opencv2/CONTROL +++ b/ports/opencv2/CONTROL @@ -1,5 +1,6 @@ Source: opencv2 -Version: 2.4.13.7-2 +Version: 2.4.13.7 +Port-Version: 2 Build-Depends: zlib Description: computer vision library, version 2 Default-Features: eigen, jpeg, opengl, png, tiff diff --git a/ports/opencv2/FindCUDA.cmake b/ports/opencv2/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv2/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv2/portfile.cmake b/ports/opencv2/portfile.cmake index 8033ba4b4fdd8f..e901c77a9eb874 100644 --- a/ports/opencv2/portfile.cmake +++ b/ports/opencv2/portfile.cmake @@ -30,10 +30,10 @@ vcpkg_from_github( file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) #contains fixes for CUDA 11 compat, remove when CMake has support for it vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" WITH_CUDA - "cuda" WITH_CUBLAS "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "jasper" WITH_JASPER @@ -105,6 +105,7 @@ vcpkg_configure_cmake( -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENMP=OFF -DWITH_ZLIB=ON + -DWITH_CUBLAS=OFF # newer libcublas cannot be found by the old cuda cmake script in opencv2, requires a fix ) vcpkg_install_cmake() @@ -115,7 +116,14 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES) string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)" "set(CMAKE_IMPORT_FILE_VERSION 1) +find_package(CUDA QUIET) +find_package(Threads QUIET) find_package(PNG QUIET) +find_package(OpenEXR QUIET) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(TIFF QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") diff --git a/ports/opencv3/0001-disable-downloading.patch b/ports/opencv3/0001-disable-downloading.patch index 7e49fae2a1e2f2..41131c6a811b21 100644 --- a/ports/opencv3/0001-disable-downloading.patch +++ b/ports/opencv3/0001-disable-downloading.patch @@ -1,13 +1,14 @@ diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake -index cdc47ad..175aaf3 100644 +index 63cf6d3..01e84a5 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -154,6 +154,8 @@ function(ocv_download) +@@ -157,6 +157,9 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" - INACTIVITY_TIMEOUT 60 - TIMEOUT 600 ++ + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" diff --git a/ports/opencv3/0002-install-options.patch b/ports/opencv3/0002-install-options.patch index 3d334a0a150880..4f0197f9d23304 100644 --- a/ports/opencv3/0002-install-options.patch +++ b/ports/opencv3/0002-install-options.patch @@ -1,69 +1,65 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ce583b..e9ea757 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -665,7 +665,7 @@ endif() - - if(WIN32) - # Postfix of DLLs: -- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") -+ set(OPENCV_DLLVERSION "") - set(OPENCV_DEBUG_POSTFIX d) - else() - # Postfix of so's: -@@ -716,7 +716,7 @@ endif() - ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) - - # --- Python Support --- --if(NOT IOS) -+if(0) - include(cmake/OpenCVDetectPython.cmake) - endif() - -diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index 0b9d669..142b21b 100644 ---- a/cmake/OpenCVCompilerOptions.cmake -+++ b/cmake/OpenCVCompilerOptions.cmake -@@ -254,7 +254,6 @@ if(MSVC) - #endif() - - if(BUILD_WITH_DEBUG_INFO) -- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") - set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") - set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") - endif() -diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index 2c7c42b..e7bc157 100644 ---- a/cmake/OpenCVGenConfig.cmake -+++ b/cmake/OpenCVGenConfig.cmake -@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) - endif() - endfunction() - --if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(NOT ANDROID) - ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") - endif() - -@@ -121,7 +121,7 @@ endif() - # -------------------------------------------------------------------------------------------- - # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages - # -------------------------------------------------------------------------------------------- --if(WIN32) -+if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - if(BUILD_SHARED_LIBS) - set(_lib_suffix "lib") -diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt -index 1f0d720..0bb1ff7 100644 ---- a/data/CMakeLists.txt -+++ b/data/CMakeLists.txt -@@ -1,8 +1,6 @@ - file(GLOB HAAR_CASCADES haarcascades/*.xml) - file(GLOB LBP_CASCADES lbpcascades/*.xml) - --install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) --install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) - - if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) - install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 614baa2..1e930a3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -601,7 +601,7 @@ endif() + ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) + + # --- Python Support --- +-if(NOT IOS) ++if(0) + include(cmake/OpenCVDetectPython.cmake) + endif() + +diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake +index 476156f..4b27b6a 100644 +--- a/cmake/OpenCVCompilerOptions.cmake ++++ b/cmake/OpenCVCompilerOptions.cmake +@@ -261,7 +261,6 @@ if(MSVC) + #endif() + + if(BUILD_WITH_DEBUG_INFO) +- set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} /Zi") + set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug") + set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") + endif() +diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake +index c7f9fc2..84bd302 100644 +--- a/cmake/OpenCVGenConfig.cmake ++++ b/cmake/OpenCVGenConfig.cmake +@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) + endif() + endfunction() + +-if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) ++if(TRUE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") + endif() + +-if(ANDROID) ++if(FALSE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") + install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) + endif() +@@ -121,7 +121,7 @@ endif() + # -------------------------------------------------------------------------------------------- + # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages + # -------------------------------------------------------------------------------------------- +-if(WIN32) ++if(0) + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) + ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" + "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index 1f0d720..0bb1ff7 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -1,8 +1,6 @@ + file(GLOB HAAR_CASCADES haarcascades/*.xml) + file(GLOB LBP_CASCADES lbpcascades/*.xml) + +-install(FILES ${HAAR_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/haarcascades COMPONENT libs) +-install(FILES ${LBP_CASCADES} DESTINATION ${OPENCV_OTHER_INSTALL_PATH}/lbpcascades COMPONENT libs) + + if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH) + install(DIRECTORY "${OPENCV_TEST_DATA_PATH}/" DESTINATION "${OPENCV_TEST_DATA_INSTALL_PATH}" COMPONENT "tests") diff --git a/ports/opencv3/0003-force-package-requirements.patch b/ports/opencv3/0003-force-package-requirements.patch index d43ccf4f6e3263..7f1b0c906f23f3 100644 --- a/ports/opencv3/0003-force-package-requirements.patch +++ b/ports/opencv3/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index fcf716b..bda80e9 100644 +index fcf716b..f3951e3 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -70,7 +70,7 @@ index fcf716b..bda80e9 100644 # --- GDAL (optional) --- if(WITH_GDAL) - find_package(GDAL QUIET) -+ find_package(GDAL REQUIRED) ++ find_package(GDAL REQUIRED) if(NOT GDAL_FOUND) set(HAVE_GDAL NO) @@ -83,3 +83,39 @@ index fcf716b..bda80e9 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) +diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake +index b9b1a95..596c152 100644 +--- a/cmake/OpenCVFindLibsPerf.cmake ++++ b/cmake/OpenCVFindLibsPerf.cmake +@@ -51,14 +51,9 @@ endif(WITH_CUDA) + + # --- Eigen --- + if(WITH_EIGEN AND NOT HAVE_EIGEN) +- find_package(Eigen3 QUIET) ++ find_package(Eigen3 REQUIRED) + + if(Eigen3_FOUND) +- if(TARGET Eigen3::Eigen) +- # Use Eigen3 imported target if possible +- list(APPEND OPENCV_LINKER_LIBS Eigen3::Eigen) +- set(HAVE_EIGEN 1) +- else() + if(DEFINED EIGEN3_INCLUDE_DIRS) + set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) + set(HAVE_EIGEN 1) +@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) + set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) + set(HAVE_EIGEN 1) + endif() +- endif() + if(HAVE_EIGEN) + if(DEFINED EIGEN3_WORLD_VERSION) # CMake module + set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) +@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) + set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) + set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) + endif() ++ ocv_include_directories(${EIGEN_INCLUDE_PATH}) + endif() + endif() + diff --git a/ports/opencv3/0004-add-missing-stdexcept-include.patch b/ports/opencv3/0004-add-missing-stdexcept-include.patch new file mode 100644 index 00000000000000..4f0df7d06615e5 --- /dev/null +++ b/ports/opencv3/0004-add-missing-stdexcept-include.patch @@ -0,0 +1,12 @@ +diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp +index fef3fea..68d1a80 100644 +--- a/modules/cvv/src/util/observer_ptr.hpp ++++ b/modules/cvv/src/util/observer_ptr.hpp +@@ -11,6 +11,7 @@ + #include //size_t + #include // [u]intXX_t + #include // since some people like to forget that one ++#include + + namespace cvv + { diff --git a/ports/opencv3/0009-fix-uwp.patch b/ports/opencv3/0009-fix-uwp.patch index cba3963dc9693f..73cac14531af2a 100644 --- a/ports/opencv3/0009-fix-uwp.patch +++ b/ports/opencv3/0009-fix-uwp.patch @@ -1,67 +1,13 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index c2fda8f..3f7dfdc 100644 +index 634b5b2..07a96fb 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -850,7 +850,7 @@ macro(ocv_create_module) - set(the_module_target ${the_module}) - endif() - -- if(WINRT) -+ if(WINRT AND BUILD_TESTS) - # removing APPCONTAINER from modules to run from console - # in case of usual starting of WinRT test apps output is missing - # so starting of console version w/o APPCONTAINER is required to get test results -diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp -index f1107b0..c613ca2 100644 ---- a/modules/core/src/utils/datafile.cpp -+++ b/modules/core/src/utils/datafile.cpp -@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) - CV_UNUSED(addr); - #ifdef _WIN32 - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if (_WIN32_WINNT >= 0x0501) && (!WINRT_STORE) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -diff --git a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -index f4147f3..b92efdd 100644 ---- a/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -+++ b/modules/highgui/include/opencv2/highgui/highgui_winrt.hpp -@@ -24,6 +24,7 @@ - // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - // POSSIBILITY OF SUCH DAMAGE. - -+#include "opencv2/core/cvdef.h" - using namespace Windows::UI::Xaml::Controls; - - namespace cv -diff --git a/modules/highgui/src/window_winrt_bridge.hpp b/modules/highgui/src/window_winrt_bridge.hpp -index 25f4aef..5429f0b 100644 ---- a/modules/highgui/src/window_winrt_bridge.hpp -+++ b/modules/highgui/src/window_winrt_bridge.hpp -@@ -28,6 +28,7 @@ - - #include - #include -+#include "opencv2/highgui/highgui_c.h" - - using namespace Windows::UI::Xaml::Controls; - -diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -index 236e227..e2417dc 100644 ---- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -@@ -94,10 +94,10 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() - - void Media::CaptureFrameGrabber::ShowCameraSettings() - { --#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP -+#if (WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY!=WINAPI_FAMILY_APP) - if (_state == State::Started) - { -- CameraOptionsUI::Show(_capture.Get()); -+ CameraOptionsUI::Show(_capture.Get()); // TODO: Turn it on again in UWP mode by adding reference to UWP Desktop Extensions - } - #endif - } +@@ -1183,7 +1183,7 @@ function(ocv_add_perf_tests) + set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") + endif() + +- if(WINRT) ++ if(WINRT AND BUILD_TESTS) + # removing APPCONTAINER from tests to run from console + # look for detailed description inside of ocv_create_module macro above + add_custom_command(TARGET "opencv_perf_${name}" diff --git a/ports/opencv3/CONTROL b/ports/opencv3/CONTROL index a103e97a6d9dd2..623eb99218e3af 100644 --- a/ports/opencv3/CONTROL +++ b/ports/opencv3/CONTROL @@ -1,5 +1,5 @@ Source: opencv3 -Version: 3.4.7-4 +Version: 3.4.10 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -12,11 +12,11 @@ Feature: flann Description: opencv_flann module Feature: contrib -Build-Depends: opencv3[dnn], hdf5 (!uwp) +Build-Depends: opencv3[dnn], hdf5 (!uwp), tesseract (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv3[contrib], cuda +Build-Depends: opencv3[contrib], cuda, cudnn Description: CUDA support for opencv Feature: dnn @@ -35,6 +35,10 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv +Feature: halide +Build-Depends: halide, opencv3[core], opencv3[dnn] +Description: Halide support for opencv + Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -86,9 +90,5 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv -Feature: halide -Build-Depends: halide, opencv3[core], opencv3[dnn] -Description: Halide support for opencv - Feature: world Description: Compile to a single package support for opencv diff --git a/ports/opencv3/FindCUDA.cmake b/ports/opencv3/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv3/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv3/portfile.cmake b/ports/opencv3/portfile.cmake index 6c7320c42c8cca..f190376c28e96e 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -6,15 +6,13 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv4") message(FATAL_ERROR "OpenCV 4 is installed, please uninstall and try again:\n vcpkg remove opencv4") endif() -include(vcpkg_common_functions) - -set(OPENCV_VERSION "3.4.7") +set(OPENCV_VERSION "3.4.10") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 ba1336ad4e5208748aa09c99770392cc71ef72688560d0b03287ddafd36093ef30cbdf6422f87f8f878663ab8085cc0ff8a8c65fd1ff0ec6800855ea01309beb + SHA512 7ccdc7fef26436b2f643cce2a13c9f9f77e56d3fd0340117419df3c1665ca12416277b626cce3c056fdc14899805bbe9ece391f11d28c6adea716d47ce8894bc HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -23,6 +21,11 @@ vcpkg_from_github( 0009-fix-uwp.patch ) +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") +file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -48,8 +51,17 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "world" BUILD_opencv_world ) -# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "dnn", "ipp", ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. +set(BUILD_opencv_dnn OFF) +if("dnn" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_ANDROID) + set(BUILD_opencv_dnn ON) + else() + message(WARNING "The dnn module cannot be enabled on Android") + endif() +endif() + set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) @@ -94,11 +106,13 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 922620f3e8754fc15dedf8993bdc1f00c06b623cbeeb72afb984ddaad6e0e04f46561a0ee4d20f5e260616c1f32c6dc0dd7248355d417873ae72bd03cb5d57fd + SHA512 70b4ecfaf9881390ad826a2aba24cced8514a680965ec7151df9926082fff53364bbe6be36458bb9ff466fda6f6f6ca2174eeac94c10a6bada989f07ed1c4da1 HEAD_REF master + PATCHES + 0004-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") - # Used for opencv's face module + vcpkg_download_distfile(OCV_DOWNLOAD URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat" FILENAME "opencv-cache/data/7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat" @@ -144,9 +158,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" - SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" + SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -155,15 +169,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" - SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" + SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" - SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" + SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -172,15 +186,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" - FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" - SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" + FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" + SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" - FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" - SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" + FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" + SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -238,14 +252,20 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= + -DOPENCV_BIN_INSTALL_PATH=bin + -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv + -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d - -DOpenCV_DISABLE_ARCH_PATH=ON + -DOPENCV_DLLVERSION= + -DOPENCV_DEBUG_POSTFIX=d + -DOPENCV_GENERATE_SETUPVARS=OFF # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -257,6 +277,9 @@ vcpkg_configure_cmake( -DBUILD_TIFF=OFF -DBUILD_WEBP=OFF -DBUILD_ZLIB=OFF + -DBUILD_TBB=OFF + -DBUILD_IPP_IW=OFF + -DBUILD_ITT=OFF ###### Disable build 3rd party components -DBUILD_PROTOBUF=OFF ###### OpenCV Build components @@ -264,14 +287,21 @@ vcpkg_configure_cmake( -DBUILD_opencv_bgsegm=${BUILD_opencv_bgsegm} -DBUILD_opencv_line_descriptor=${BUILD_opencv_line_descriptor} -DBUILD_opencv_saliency=${BUILD_opencv_saliency} + -DBUILD_ANDROID_PROJECT=OFF + -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_PACKAGE=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DBUILD_WITH_DEBUG_INFO=ON -DBUILD_WITH_STATIC_CRT=${BUILD_WITH_STATIC_CRT} + -DBUILD_JAVA=OFF + -DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR} ###### PROTOBUF -DPROTOBUF_UPDATE_FILES=ON -DUPDATE_PROTO_FILES=ON + ###### PYLINT/FLAKE8 + -DENABLE_PYLINT=OFF + -DENABLE_FLAKE8=OFF # CMAKE -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -DCMAKE_DISABLE_FIND_PACKAGE_JNI=ON @@ -284,18 +314,23 @@ vcpkg_configure_cmake( ###### customized properties ## Options from vcpkg_check_features() ${FEATURE_OPTIONS} + -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} + -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MATLAB=OFF -DWITH_MSMF=${WITH_MSMF} + -DWITH_OPENMP=OFF -DWITH_PROTOBUF=ON -DWITH_OPENCLAMDBLAS=OFF -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} + -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} + -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} ###### Additional build flags @@ -326,6 +361,8 @@ if(Protobuf_FOUND) ) endif() endif() +find_package(CUDA QUIET) +find_package(Threads QUIET) find_package(TIFF QUIET) find_package(HDF5 QUIET) find_package(Freetype QUIET) @@ -336,8 +373,19 @@ find_package(ade QUIET) find_package(VTK QUIET) find_package(OpenMP QUIET) find_package(Tesseract QUIET) +find_package(OpenEXR QUIET) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") + if(BUILD_opencv_ovis) + string(REPLACE "OgreGLSupportStatic" + "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") + endif() + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -345,8 +393,12 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv3.cmd) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv3.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) + +if(VCPKG_TARGET_IS_ANDROID) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opencv4/0001-disable-downloading.patch b/ports/opencv4/0001-disable-downloading.patch index 28b00251fe4f23..41131c6a811b21 100644 --- a/ports/opencv4/0001-disable-downloading.patch +++ b/ports/opencv4/0001-disable-downloading.patch @@ -1,11 +1,14 @@ +diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake +index 63cf6d3..01e84a5 100644 --- a/cmake/OpenCVDownload.cmake +++ b/cmake/OpenCVDownload.cmake -@@ -151,6 +151,8 @@ function(ocv_download) +@@ -157,6 +157,9 @@ function(ocv_download) # Download if(NOT EXISTS "${CACHE_CANDIDATE}") ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + string(REPLACE "${OPENCV_DOWNLOAD_PATH}/" "opencv-cache/" CACHE_SUBPATH "${CACHE_CANDIDATE}") + message(FATAL_ERROR " Downloads are not permitted during configure. Please pre-download the file \"${CACHE_CANDIDATE}\":\n \n vcpkg_download_distfile(OCV_DOWNLOAD\n URLS \"${DL_URL}\"\n FILENAME \"${CACHE_SUBPATH}\"\n SHA512 0\n )") - file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" - INACTIVITY_TIMEOUT 60 - TIMEOUT 600 ++ + foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) + ocv_download_log("#try ${try}") + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" diff --git a/ports/opencv4/0002-install-options.patch b/ports/opencv4/0002-install-options.patch index 10aa08c24449da..9707a6a323695c 100644 --- a/ports/opencv4/0002-install-options.patch +++ b/ports/opencv4/0002-install-options.patch @@ -1,17 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8631bbc..e801558 100644 +index 4c0b388..16c0ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -647,7 +647,7 @@ endif() - - if(WIN32) - # Postfix of DLLs: -- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") -+ set(OPENCV_DLLVERSION "") - set(OPENCV_DEBUG_POSTFIX d) - else() - # Postfix of so's: -@@ -698,7 +698,7 @@ endif() +@@ -594,7 +594,7 @@ endif() ocv_cmake_hook(POST_CMAKE_BUILD_OPTIONS) # --- Python Support --- @@ -21,10 +12,10 @@ index 8631bbc..e801558 100644 endif() diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake -index e3ae62f..d866162 100644 +index 87b2161..5192875 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake -@@ -256,7 +256,6 @@ if(MSVC) +@@ -263,7 +263,6 @@ if(MSVC) #endif() if(BUILD_WITH_DEBUG_INFO) @@ -33,27 +24,32 @@ index e3ae62f..d866162 100644 set(OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_SHARED_LINKER_FLAGS_RELEASE} /debug") endif() diff --git a/cmake/OpenCVGenConfig.cmake b/cmake/OpenCVGenConfig.cmake -index cef9d0b..b6ddb81 100644 +index 6991289..3a691c5 100644 --- a/cmake/OpenCVGenConfig.cmake +++ b/cmake/OpenCVGenConfig.cmake -@@ -109,7 +109,7 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) +@@ -109,11 +109,11 @@ function(ocv_gen_config TMP_DIR NESTED_PATH ROOT_NAME) endif() endfunction() -if((CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" OR UNIX) AND NOT ANDROID) -+if(NOT ANDROID) ++if(TRUE) ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "" "") endif() +-if(ANDROID) ++if(FALSE) + ocv_gen_config("${CMAKE_BINARY_DIR}/unix-install" "abi-${ANDROID_NDK_ABI_NAME}" "OpenCVConfig.root-ANDROID.cmake.in") + install(FILES "${OpenCV_SOURCE_DIR}/platforms/android/android.toolchain.cmake" DESTINATION "${OPENCV_CONFIG_INSTALL_PATH}" COMPONENT dev) + endif() @@ -121,7 +121,7 @@ endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- -if(WIN32) +if(0) - if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - if(BUILD_SHARED_LIBS) - set(_lib_suffix "lib") + if(CMAKE_HOST_SYSTEM_NAME MATCHES Windows AND NOT OPENCV_SKIP_CMAKE_ROOT_CONFIG) + ocv_gen_config("${CMAKE_BINARY_DIR}/win-install" + "${OPENCV_INSTALL_BINARIES_PREFIX}${OPENCV_INSTALL_BINARIES_SUFFIX}" diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 1f0d720..0bb1ff7 100644 --- a/data/CMakeLists.txt diff --git a/ports/opencv4/0003-force-package-requirements.patch b/ports/opencv4/0003-force-package-requirements.patch index b6051f8498b66b..b25668b38325ee 100644 --- a/ports/opencv4/0003-force-package-requirements.patch +++ b/ports/opencv4/0003-force-package-requirements.patch @@ -1,5 +1,5 @@ diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake -index 227cfb2..7a97a19 100644 +index 0beaf19..3ba1ebd 100644 --- a/cmake/OpenCVFindLibsGrfmt.cmake +++ b/cmake/OpenCVFindLibsGrfmt.cmake @@ -6,7 +6,7 @@ @@ -38,7 +38,7 @@ index 227cfb2..7a97a19 100644 if(WEBP_FOUND) set(HAVE_WEBP 1) endif() -@@ -158,7 +158,7 @@ if(WITH_JASPER) +@@ -173,7 +173,7 @@ if(WITH_JASPER AND NOT HAVE_OPENJPEG) if(BUILD_JASPER) ocv_clear_vars(JASPER_FOUND) else() @@ -47,7 +47,7 @@ index 227cfb2..7a97a19 100644 endif() if(NOT JASPER_FOUND) -@@ -182,7 +182,7 @@ if(WITH_PNG) +@@ -197,7 +197,7 @@ if(WITH_PNG) if(BUILD_PNG) ocv_clear_vars(PNG_FOUND) else() @@ -56,7 +56,7 @@ index 227cfb2..7a97a19 100644 if(PNG_FOUND) include(CheckIncludeFile) check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H) -@@ -213,7 +213,7 @@ endif() +@@ -228,7 +228,7 @@ endif() if(WITH_OPENEXR) ocv_clear_vars(HAVE_OPENEXR) if(NOT BUILD_OPENEXR) @@ -65,7 +65,7 @@ index 227cfb2..7a97a19 100644 endif() if(OPENEXR_FOUND) -@@ -231,7 +231,7 @@ endif() +@@ -246,7 +246,7 @@ endif() # --- GDAL (optional) --- if(WITH_GDAL) @@ -74,7 +74,7 @@ index 227cfb2..7a97a19 100644 if(NOT GDAL_FOUND) set(HAVE_GDAL NO) -@@ -243,7 +243,7 @@ if(WITH_GDAL) +@@ -258,7 +258,7 @@ if(WITH_GDAL) endif() if (WITH_GDCM) @@ -83,18 +83,11 @@ index 227cfb2..7a97a19 100644 if(NOT GDCM_FOUND) set(HAVE_GDCM NO) ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES) -@@ -273,4 +273,4 @@ if(WITH_IMGCODEC_PFM) - set(HAVE_IMGCODEC_PFM ON) - elseif(DEFINED WITH_IMGCODEC_PFM) - set(HAVE_IMGCODEC_PFM OFF) --endif() -\ No newline at end of file -+endif() diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake -index a658bf6..5c9411a 100644 +index b9b1a95..596c152 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake -@@ -41,14 +41,9 @@ endif(WITH_CUDA) +@@ -51,14 +51,9 @@ endif(WITH_CUDA) # --- Eigen --- if(WITH_EIGEN AND NOT HAVE_EIGEN) @@ -110,7 +103,7 @@ index a658bf6..5c9411a 100644 if(DEFINED EIGEN3_INCLUDE_DIRS) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIRS}) set(HAVE_EIGEN 1) -@@ -56,7 +51,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -66,7 +61,6 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_INCLUDE_PATH ${EIGEN3_INCLUDE_DIR}) set(HAVE_EIGEN 1) endif() @@ -118,7 +111,7 @@ index a658bf6..5c9411a 100644 if(HAVE_EIGEN) if(DEFINED EIGEN3_WORLD_VERSION) # CMake module set(EIGEN_WORLD_VERSION ${EIGEN3_WORLD_VERSION}) -@@ -67,6 +61,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) +@@ -77,6 +71,7 @@ if(WITH_EIGEN AND NOT HAVE_EIGEN) set(EIGEN_MAJOR_VERSION ${EIGEN3_VERSION_MINOR}) set(EIGEN_MINOR_VERSION ${EIGEN3_VERSION_PATCH}) endif() diff --git a/ports/opencv4/0004-fix-policy-CMP0057.patch b/ports/opencv4/0004-fix-policy-CMP0057.patch index ed25d501dfe7c2..7f0f0c0271ba01 100644 --- a/ports/opencv4/0004-fix-policy-CMP0057.patch +++ b/ports/opencv4/0004-fix-policy-CMP0057.patch @@ -1,5 +1,5 @@ diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt -index 1608655..a394f04 100644 +index c1c6754..360aa6b 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -1,3 +1,4 @@ diff --git a/ports/opencv4/0005-add-missing-stdexcept-include.patch b/ports/opencv4/0005-add-missing-stdexcept-include.patch new file mode 100644 index 00000000000000..4f0df7d06615e5 --- /dev/null +++ b/ports/opencv4/0005-add-missing-stdexcept-include.patch @@ -0,0 +1,12 @@ +diff --git a/modules/cvv/src/util/observer_ptr.hpp b/modules/cvv/src/util/observer_ptr.hpp +index fef3fea..68d1a80 100644 +--- a/modules/cvv/src/util/observer_ptr.hpp ++++ b/modules/cvv/src/util/observer_ptr.hpp +@@ -11,6 +11,7 @@ + #include //size_t + #include // [u]intXX_t + #include // since some people like to forget that one ++#include + + namespace cvv + { diff --git a/ports/opencv4/0009-fix-uwp.patch b/ports/opencv4/0009-fix-uwp.patch index 5c54256a598c5f..1c40cf1e17d4aa 100644 --- a/ports/opencv4/0009-fix-uwp.patch +++ b/ports/opencv4/0009-fix-uwp.patch @@ -1,17 +1,8 @@ diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 799592b..3f44173 100644 +index 9053957..d2b6412 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake -@@ -852,7 +852,7 @@ macro(ocv_create_module) - set(the_module_target ${the_module}) - endif() - -- if(WINRT) -+ if(WINRT AND BUILD_TESTS) - # removing APPCONTAINER from modules to run from console - # in case of usual starting of WinRT test apps output is missing - # so starting of console version w/o APPCONTAINER is required to get test results -@@ -1175,7 +1175,7 @@ function(ocv_add_perf_tests) +@@ -1196,7 +1196,7 @@ function(ocv_add_perf_tests) set_target_properties(${the_target} PROPERTIES FOLDER "tests performance") endif() @@ -20,38 +11,3 @@ index 799592b..3f44173 100644 # removing APPCONTAINER from tests to run from console # look for detailed description inside of ocv_create_module macro above add_custom_command(TARGET "opencv_perf_${name}" -diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp -index aafbfdf..10543ae 100644 ---- a/modules/core/src/utils/datafile.cpp -+++ b/modules/core/src/utils/datafile.cpp -@@ -108,7 +108,7 @@ static cv::String getModuleLocation(const void* addr) - CV_UNUSED(addr); - #ifdef _WIN32 - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -@@ -155,7 +155,7 @@ bool getBinLocation(std::wstring& dst) - { - void* addr = (void*)getModuleLocation; // using code address, doesn't work with static linkage! - HMODULE m = 0; --#if _WIN32_WINNT >= 0x0501 -+#if _WIN32_WINNT >= 0x0501 && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - reinterpret_cast(addr), - &m); -diff --git a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -index 236e227..eccf97e 100644 ---- a/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -+++ b/modules/videoio/src/cap_winrt/CaptureFrameGrabber.cpp -@@ -94,7 +94,7 @@ Media::CaptureFrameGrabber::~CaptureFrameGrabber() - - void Media::CaptureFrameGrabber::ShowCameraSettings() - { --#if WINAPI_FAMILY!=WINAPI_FAMILY_PHONE_APP -+#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) && (WINAPI_FAMILY != WINAPI_FAMILY_PC_APP) - if (_state == State::Started) - { - CameraOptionsUI::Show(_capture.Get()); diff --git a/ports/opencv4/CONTROL b/ports/opencv4/CONTROL index 60c1e0aa7d2df8..fa6388e66f49d8 100644 --- a/ports/opencv4/CONTROL +++ b/ports/opencv4/CONTROL @@ -1,5 +1,5 @@ Source: opencv4 -Version: 4.1.1-6 +Version: 4.3.0 Build-Depends: protobuf, zlib Homepage: https://github.com/opencv/opencv Description: computer vision library @@ -13,11 +13,11 @@ Build-Depends: ade Description: graph api Feature: contrib -Build-Depends: hdf5 (!uwp) +Build-Depends: hdf5 (!uwp), tesseract (!uwp) Description: opencv_contrib module Feature: cuda -Build-Depends: opencv4[contrib], cuda +Build-Depends: opencv4[contrib], cuda, cudnn Description: CUDA support for opencv Feature: dnn @@ -35,6 +35,10 @@ Feature: gdcm Build-Depends: gdcm Description: GDCM support for opencv +Feature: halide +Build-Depends: halide, opencv4[core], opencv4[dnn] +Description: Halide support for opencv + Feature: ipp Description: Enable Intel Integrated Performance Primitives @@ -89,13 +93,5 @@ Feature: webp Build-Depends: libwebp Description: WebP support for opencv -Feature: halide -Build-Depends: halide, opencv4[core], opencv4[dnn] -Description: Halide support for opencv - Feature: world Description: Compile to a single package support for opencv - -Feature: gtk -Build-Depends: gtk -Description: gtk support for opencv diff --git a/ports/opencv4/FindCUDA.cmake b/ports/opencv4/FindCUDA.cmake new file mode 100644 index 00000000000000..56e15e89d2ed07 --- /dev/null +++ b/ports/opencv4/FindCUDA.cmake @@ -0,0 +1,2026 @@ +#[=======================================================================[.rst: +FindCUDA +-------- + +.. deprecated:: 3.10 + + Superseded by first-class support for the CUDA language in CMake. + Superseded by the :module:`FindCUDAToolkit` for CUDA toolkit libraries. + +Replacement +^^^^^^^^^^^ + +It is no longer necessary to use this module or call ``find_package(CUDA)`` +for compiling CUDA code. Instead, list ``CUDA`` among the languages named +in the top-level call to the :command:`project` command, or call the +:command:`enable_language` command with ``CUDA``. +Then one can add CUDA (``.cu``) sources to programs directly +in calls to :command:`add_library` and :command:`add_executable`. + +To find and use the CUDA toolkit libraries the :module:`FindCUDAToolkit` +module has superseded this module. It works whether or not the ``CUDA`` +language is enabled. + +Documentation of Deprecated Usage +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Tools for building CUDA C files: libraries and build dependencies. + +This script locates the NVIDIA CUDA C tools. It should work on Linux, +Windows, and macOS and should be reasonably up to date with CUDA C +releases. + +This script makes use of the standard :command:`find_package` arguments of +````, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an +acceptable version of CUDA was found. + +The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if +the prefix cannot be determined by the location of nvcc in the system +path and ``REQUIRED`` is specified to :command:`find_package`. To use +a different installed version of the toolkit set the environment variable +``CUDA_BIN_PATH`` before running cmake (e.g. +``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default +``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If +you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that +depend on the path will be relocated. + +It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain +platforms, or to use a CUDA runtime not installed in the default +location. In newer versions of the toolkit the CUDA library is +included with the graphics driver -- be sure that the driver version +matches what is needed by the CUDA runtime version. + +The following variables affect the behavior of the macros in the +script (in alphabetical order). Note that any of these flags can be +changed multiple times in the same directory before calling +``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``, +``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN`` +or ``CUDA_WRAP_SRCS``:: + + CUDA_64_BIT_DEVICE_CODE (Default matches host bit size) + -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code. + Note that making this different from the host code when generating object + or C files from CUDA code just won't work, because size_t gets defined by + nvcc in the generated source. If you compile to PTX and then load the + file yourself, you can mix bit sizes between device and host. + + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON) + -- Set to ON if you want the custom build rule to be attached to the source + file in Visual Studio. Turn OFF if you add the same cuda file to multiple + targets. + + This allows the user to build the target from the CUDA file; however, bad + things can happen if the CUDA source file is added to multiple targets. + When performing parallel builds it is possible for the custom build + command to be run more than once and in parallel causing cryptic build + errors. VS runs the rules for every source file in the target, and a + source can have only one rule no matter how many projects it is added to. + When the rule is run from multiple targets race conditions can occur on + the generated file. Eventually everything will get built, but if the user + is unaware of this behavior, there may be confusion. It would be nice if + this script could detect the reuse of source files across multiple targets + and turn the option off for the user, but no good solution could be found. + + CUDA_BUILD_CUBIN (Default OFF) + -- Set to ON to enable and extra compilation pass with the -cubin option in + Device mode. The output is parsed and register, shared memory usage is + printed during build. + + CUDA_BUILD_EMULATION (Default OFF for device mode) + -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files + when CUDA_BUILD_EMULATION is TRUE. + + CUDA_LINK_LIBRARIES_KEYWORD (Default "") + -- The keyword to use for internal + target_link_libraries calls. The default is to use no keyword which + uses the old "plain" form of target_link_libraries. Note that is matters + because whatever is used inside the FindCUDA module must also be used + outside - the two forms of target_link_libraries cannot be mixed. + + CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) + -- Set to the path you wish to have the generated files placed. If it is + blank output files will be placed in CMAKE_CURRENT_BINARY_DIR. + Intermediate files will always be placed in + CMAKE_CURRENT_BINARY_DIR/CMakeFiles. + + CUDA_HOST_COMPILATION_CPP (Default ON) + -- Set to OFF for C compilation of host code. + + CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER) + -- Set the host compiler to be used by nvcc. Ignored if -ccbin or + --compiler-bindir is already present in the CUDA_NVCC_FLAGS or + CUDA_NVCC_FLAGS_ variables. For Visual Studio targets, + the host compiler is constructed with one or more visual studio macros + such as $(VCInstallDir), that expands out to the path when + the command is run from within VS. + If the CUDAHOSTCXX environment variable is set it will + be used as the default. + + CUDA_NVCC_FLAGS + CUDA_NVCC_FLAGS_ + -- Additional NVCC command line arguments. NOTE: multiple arguments must be + semi-colon delimited (e.g. --compiler-options;-Wall) + + CUDA_PROPAGATE_HOST_FLAGS (Default ON) + -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration + dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the + host compiler through nvcc's -Xcompiler flag. This helps make the + generated host code match the rest of the system better. Sometimes + certain flags give nvcc problems, and this will help you turn the flag + propagation off. This does not affect the flags supplied directly to nvcc + via CUDA_NVCC_FLAGS or through the OPTION flags specified through + CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for + shared library compilation are not affected by this flag. + + CUDA_SEPARABLE_COMPILATION (Default OFF) + -- If set this will enable separable compilation for all CUDA runtime object + files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY + (e.g. calling CUDA_WRAP_SRCS directly), + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called. + + CUDA_SOURCE_PROPERTY_FORMAT + -- If this source file property is set, it can override the format specified + to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file + is not a .cu file, setting this file will cause it to be treated as a .cu + file. See documentation for set_source_files_properties on how to set + this property. + + CUDA_USE_STATIC_CUDA_RUNTIME (Default ON) + -- When enabled the static version of the CUDA runtime library will be used + in CUDA_LIBRARIES. If the version of CUDA configured doesn't support + this option, then it will be silently disabled. + + CUDA_VERBOSE_BUILD (Default OFF) + -- Set to ON to see all the commands used when building the CUDA file. When + using a Makefile generator the value defaults to VERBOSE (run make + VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will + always print the output. + +The script creates the following macros (in alphabetical order):: + + CUDA_ADD_CUFFT_TO_TARGET( cuda_target ) + -- Adds the cufft library to the target (can be any target). Handles whether + you are in emulation mode or not. + + CUDA_ADD_CUBLAS_TO_TARGET( cuda_target ) + -- Adds the cublas library to the target (can be any target). Handles + whether you are in emulation mode or not. + + CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ... + [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Creates an executable "cuda_target" which is made up of the files + specified. All of the non CUDA C files are compiled using the standard + build rules specified by CMAKE and the cuda files are compiled to object + files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is + added automatically to include_directories(). Some standard CMake target + calls can be used on the target after calling this macro + (e.g. set_target_properties and target_link_libraries), but setting + properties that adjust compilation flags will not affect code compiled by + nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS. + + CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] ) + -- Same as CUDA_ADD_EXECUTABLE except that a library is created. + + CUDA_BUILD_CLEAN_TARGET() + -- Creates a convenience target that deletes all the dependency files + generated. You should make clean after running this target to ensure the + dependency files get regenerated. + + CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE] + [OPTIONS ...] ) + -- Returns a list of generated files from the input source files to be used + with ADD_LIBRARY or ADD_EXECUTABLE. + + CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of PTX files generated from the input source files. + + CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of FATBIN files generated from the input source files. + + CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] ) + -- Returns a list of CUBIN files generated from the input source files. + + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var + cuda_target + object_files ) + -- Compute the name of the intermediate link file used for separable + compilation. This file name is typically passed into + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced + based on cuda_target the list of objects files that need separable + compilation as specified by object_files. If the object_files list is + empty, then output_file_var will be empty. This function is called + automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that + this is a function and not a macro. + + CUDA_INCLUDE_DIRECTORIES( path0 path1 ... ) + -- Sets the directories that should be passed to nvcc + (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu + files. + + + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target + nvcc_flags object_files) + -- Generates the link object required by separable compilation from the given + object files. This is called automatically for CUDA_ADD_EXECUTABLE and + CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS + directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the + nvcc_flags passed in are the same as the flags passed in via the OPTIONS + argument. The only nvcc flag added automatically is the bitness flag as + specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function + instead of a macro. + + CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures]) + -- Selects GPU arch flags for nvcc based on target_CUDA_architectures + target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...) + - "Auto" detects local machine GPU compute arch at runtime. + - "Common" and "All" cover common and entire subsets of architectures + ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX + NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal + NUM: Any number. Only those pairs are currently accepted by NVCC though: + 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 + Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable} + Additionally, sets ${out_variable}_readable to the resulting numeric list + Example: + CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell) + LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS}) + + More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA + Note that this is a function instead of a macro. + + CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ... + [STATIC | SHARED | MODULE] [OPTIONS ...] ) + -- This is where all the magic happens. CUDA_ADD_EXECUTABLE, + CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this + function under the hood. + + Given the list of files (file0 file1 ... fileN) this macro generates + custom commands that generate either PTX or linkable objects (use "PTX" or + "OBJ" for the format argument to switch). Files that don't end with .cu + or have the HEADER_FILE_ONLY property are ignored. + + The arguments passed in after OPTIONS are extra command line options to + give to nvcc. You can also specify per configuration options by + specifying the name of the configuration followed by the options. General + options must precede configuration specific options. Not all + configurations need to be specified, only the ones provided will be used. + + OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag" + DEBUG -g + RELEASE --use_fast_math + RELWITHDEBINFO --use_fast_math;-g + MINSIZEREL --use_fast_math + + For certain configurations (namely VS generating object files with + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will + be produced for the given cuda file. This is because when you add the + cuda file to Visual Studio it knows that this file produces an object file + and will link in the resulting object file automatically. + + This script will also generate a separate cmake script that is used at + build time to invoke nvcc. This is for several reasons. + + 1. nvcc can return negative numbers as return values which confuses + Visual Studio into thinking that the command succeeded. The script now + checks the error codes and produces errors when there was a problem. + + 2. nvcc has been known to not delete incomplete results when it + encounters problems. This confuses build systems into thinking the + target was generated when in fact an unusable file exists. The script + now deletes the output files if there was an error. + + 3. By putting all the options that affect the build into a file and then + make the build rule dependent on the file, the output files will be + regenerated when the options change. + + This script also looks at optional arguments STATIC, SHARED, or MODULE to + determine when to target the object compilation for a shared library. + BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in + CUDA_ADD_LIBRARY. On some systems special flags are added for building + objects intended for shared libraries. A preprocessor macro, + _EXPORTS is defined when a shared library compilation is + detected. + + Flags passed into add_definitions with -D or /D are passed along to nvcc. + + + +The script defines the following variables:: + + CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc. + CUDA_VERSION_MINOR -- The minor version. + CUDA_VERSION + CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR + CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported. + + CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set). + CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the + SDK. This script will not directly support finding + specific libraries or headers, as that isn't + supported by NVIDIA. If you want to change + libraries when the path changes see the + FindCUDA.cmake script for an example of how to clear + these variables. There are also examples of how to + use the CUDA_SDK_ROOT_DIR to locate headers or + libraries, if you so choose (at your own risk). + CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically + for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY. + CUDA_LIBRARIES -- Cuda RT library. + CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT + implementation (alternative to: + CUDA_ADD_CUFFT_TO_TARGET macro) + CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS + implementation (alternative to: + CUDA_ADD_CUBLAS_TO_TARGET macro). + CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library. + Only available for CUDA version 5.5+ + CUDA_cudadevrt_LIBRARY -- Device runtime library. + Required for separable compilation. + CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library. + Only available for CUDA version 4.0+. + CUDA_curand_LIBRARY -- CUDA Random Number Generation library. + Only available for CUDA version 3.2+. + CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. + Only available for CUDA version 7.0+. + CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. + Only available for CUDA version 3.2+. + CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. + Only available for CUDA version 4.0+. + CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core). + Only available for CUDA version 5.5+. + CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 5.5 - 8.0. + CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0 - 10.2. + Replaced by nvjpeg. + CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing). + Only available for CUDA version 9.0. + CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing). + Only available for CUDA version 5.5+. + CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library. + Only available for CUDA version 3.2+. + Windows only. + CUDA_nvToolsExt_LIBRARY + -- NVIDA CUDA Tools Extension library. + Available for CUDA version 5+. + CUDA_OpenCL_LIBRARY -- NVIDA CUDA OpenCL library. + Available for CUDA version 5+. + +#]=======================================================================] + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# FindCUDA.cmake + +# This macro helps us find the location of helper files we will need the full path to +macro(CUDA_FIND_HELPER_FILE _name _extension) + set(_full_name "${_name}.${_extension}") + # CMAKE_CURRENT_LIST_FILE contains the full path to the file currently being + # processed. Using this variable, we can pull out the current path, and + # provide a way to get access to the other files we need local to here. + set(CUDA_${_name} "${CMAKE_ROOT}/Modules/FindCUDA/${_full_name}") + if(NOT EXISTS "${CUDA_${_name}}") + set(error_message "${_full_name} not found in ${CMAKE_ROOT}/Modules/FindCUDA") + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT CUDA_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +##################################################################### +## CUDA_INCLUDE_NVCC_DEPENDENCIES +## + +# So we want to try and include the dependency file if it exists. If +# it doesn't exist then we need to create an empty one, so we can +# include it. + +# If it does exist, then we need to check to see if all the files it +# depends on exist. If they don't then we should clear the dependency +# file and regenerate it later. This covers the case where a header +# file has disappeared or moved. + +macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file) + set(CUDA_NVCC_DEPEND) + set(CUDA_NVCC_DEPEND_REGENERATE FALSE) + + + # Include the dependency file. Create it first if it doesn't exist . The + # INCLUDE puts a dependency that will force CMake to rerun and bring in the + # new info when it changes. DO NOT REMOVE THIS (as I did and spent a few + # hours figuring out why it didn't work. + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + # Always include this file to force CMake to run again next + # invocation and rebuild the dependencies. + #message("including dependency_file = ${dependency_file}") + include(${dependency_file}) + + # Now we need to verify the existence of all the included files + # here. If they aren't there we need to just blank this variable and + # make the file regenerate again. +# if(DEFINED CUDA_NVCC_DEPEND) +# message("CUDA_NVCC_DEPEND set") +# else() +# message("CUDA_NVCC_DEPEND NOT set") +# endif() + if(CUDA_NVCC_DEPEND) + #message("CUDA_NVCC_DEPEND found") + foreach(f ${CUDA_NVCC_DEPEND}) + # message("searching for ${f}") + if(NOT EXISTS ${f}) + #message("file ${f} not found") + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + #message("CUDA_NVCC_DEPEND false") + # No dependencies, so regenerate the file. + set(CUDA_NVCC_DEPEND_REGENERATE TRUE) + endif() + + #message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}") + # No incoming dependencies, so we need to generate them. Make the + # output depend on the dependency file itself, which should cause the + # rule to re-run. + if(CUDA_NVCC_DEPEND_REGENERATE) + set(CUDA_NVCC_DEPEND ${dependency_file}) + #message("Generating an empty dependency_file: ${dependency_file}") + file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n") + endif() + +endmacro() + +############################################################################### +############################################################################### +# Setup variables' defaults +############################################################################### +############################################################################### + +# Allow the user to specify if the device code is supposed to be 32 or 64 bit. +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT ON) +else() + set(CUDA_64_BIT_DEVICE_CODE_DEFAULT OFF) +endif() +option(CUDA_64_BIT_DEVICE_CODE "Compile device code in 64 bit mode" ${CUDA_64_BIT_DEVICE_CODE_DEFAULT}) + +# Attach the build rule to the source file in VS. This option +option(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE "Attach the build rule to the CUDA source file. Enable only when the CUDA source file is added to at most one target." ON) + +# Prints out extra information about the cuda file during compilation +option(CUDA_BUILD_CUBIN "Generate and parse .cubin files in Device mode." OFF) + +# Set whether we are using emulation or device mode. +option(CUDA_BUILD_EMULATION "Build in Emulation mode" OFF) + +# Where to put the generated output. +set(CUDA_GENERATED_OUTPUT_DIR "" CACHE PATH "Directory to put all the output files. If blank it will default to the CMAKE_CURRENT_BINARY_DIR") + +# Parse HOST_COMPILATION mode. +option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON) + +# Extra user settable flags +cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.") + +if(DEFINED ENV{CUDAHOSTCXX}) + set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC") +elseif(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)") + if(MSVC_VERSION LESS 1910) + set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)bin") + endif() + + set(CUDA_HOST_COMPILER "${_CUDA_MSVC_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") + +else() + if(APPLE + AND "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" + AND "${CMAKE_C_COMPILER}" MATCHES "/cc$") + # Using cc which is symlink to clang may let NVCC think it is GCC and issue + # unhandled -dumpspecs option to clang. Also in case neither + # CMAKE_C_COMPILER is defined (project does not use C language) nor + # CUDA_HOST_COMPILER is specified manually we should skip -ccbin and let + # nvcc use its own default C compiler. + # Only care about this on APPLE with clang to avoid + # following symlinks to things like ccache + if(DEFINED CMAKE_C_COMPILER AND NOT DEFINED CUDA_HOST_COMPILER) + get_filename_component(c_compiler_realpath "${CMAKE_C_COMPILER}" REALPATH) + # if the real path does not end up being clang then + # go back to using CMAKE_C_COMPILER + if(NOT "${c_compiler_realpath}" MATCHES "/clang$") + set(c_compiler_realpath "${CMAKE_C_COMPILER}") + endif() + else() + set(c_compiler_realpath "") + endif() + set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache") + # NVCC does not think it will work if it is passed clcache.exe or sccache.exe + # as the host compiler, which means that builds with CC=cl.exe won't work. + # Best to just feed it whatever the actual cl.exe is as the host compiler. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") + else() + set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" + CACHE FILEPATH "Host side compiler used by NVCC") + endif() +endif() + +# Propagate the host flags to the host compiler via -Xcompiler +option(CUDA_PROPAGATE_HOST_FLAGS "Propagate C/CXX_FLAGS and friends to the host compiler via -Xcompile" ON) + +# Enable CUDA_SEPARABLE_COMPILATION +option(CUDA_SEPARABLE_COMPILATION "Compile CUDA objects with separable compilation enabled. Requires CUDA 5.0+" OFF) + +# Specifies whether the commands used when compiling the .cu file will be printed out. +option(CUDA_VERBOSE_BUILD "Print out the commands run while compiling the CUDA source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) + +mark_as_advanced( + CUDA_64_BIT_DEVICE_CODE + CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE + CUDA_GENERATED_OUTPUT_DIR + CUDA_HOST_COMPILATION_CPP + CUDA_NVCC_FLAGS + CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION + ) + +# Single config generators like Makefiles or Ninja don't usually have +# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by +# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for +# single config generators (and should not be defined for multi-config +# generators). To ensure we get a complete superset of all possible +# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and +# all of the standard configurations, then weed out duplicates with +# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have +# each configuration-specific set of nvcc flags defined and marked as advanced. +set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES CUDA_configuration_types) + +############################################################################### +############################################################################### +# Locate CUDA, Set Build Type, etc. +############################################################################### +############################################################################### + +macro(cuda_unset_include_and_libraries) + unset(CUDA_TOOLKIT_INCLUDE CACHE) + unset(CUDA_CUDART_LIBRARY CACHE) + unset(CUDA_CUDA_LIBRARY CACHE) + # Make sure you run this before you unset CUDA_VERSION. + if(CUDA_VERSION VERSION_EQUAL "3.0") + # This only existed in the 3.0 version of the CUDA toolkit + unset(CUDA_CUDARTEMU_LIBRARY CACHE) + endif() + unset(CUDA_cudart_static_LIBRARY CACHE) + unset(CUDA_cudadevrt_LIBRARY CACHE) + unset(CUDA_cublas_LIBRARY CACHE) + unset(CUDA_cublas_device_LIBRARY CACHE) + unset(CUDA_cublasemu_LIBRARY CACHE) + unset(CUDA_cufft_LIBRARY CACHE) + unset(CUDA_cufftemu_LIBRARY CACHE) + unset(CUDA_cupti_LIBRARY CACHE) + unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) + unset(CUDA_cusparse_LIBRARY CACHE) + unset(CUDA_npp_LIBRARY CACHE) + unset(CUDA_nppc_LIBRARY CACHE) + unset(CUDA_nppi_LIBRARY CACHE) + unset(CUDA_npps_LIBRARY CACHE) + unset(CUDA_nvcuvenc_LIBRARY CACHE) + unset(CUDA_nvcuvid_LIBRARY CACHE) + unset(CUDA_nvToolsExt_LIBRARY CACHE) + unset(CUDA_OpenCL_LIBRARY CACHE) + unset(CUDA_GPU_DETECT_OUTPUT CACHE) +endmacro() + +# Check to see if the CUDA_TOOLKIT_ROOT_DIR and CUDA_SDK_ROOT_DIR have changed, +# if they have then clear the cache variables, so that will be detected again. +if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") + unset(CUDA_TOOLKIT_TARGET_DIR CACHE) + unset(CUDA_NVCC_EXECUTABLE CACHE) + cuda_unset_include_and_libraries() + unset(CUDA_VERSION CACHE) +endif() + +if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}") + cuda_unset_include_and_libraries() +endif() + +# +# End of unset() +# + +# +# Start looking for things +# + +# Search for the cuda distribution. +if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) + # Search in the CUDA_BIN_PATH first. + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS + ENV CUDA_TOOLKIT_ROOT + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + DOC "Toolkit location." + NO_DEFAULT_PATH + ) + + # Now search default paths + find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC + NAMES nvcc nvcc.exe + PATHS /opt/cuda/bin + PATH_SUFFIXES cuda/bin + DOC "Toolkit location." + ) + + if (CUDA_TOOLKIT_ROOT_DIR_NVCC) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) + get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE) + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + # We need to force this back into the cache. + set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE) + set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) + endif() + unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE) + + if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR}) + if(CUDA_FIND_REQUIRED) + message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR") + elseif(NOT CUDA_FIND_QUIETLY) + message("CUDA_TOOLKIT_ROOT_DIR not found or specified") + endif() + endif () +endif () + +if(CMAKE_CROSSCOMPILING) + SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT}) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDA_TOOLKIT_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDA_TOOLKIT_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + endif() + + if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}") + set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.") + SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT}) + mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) + endif() + + # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers + set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}") + macro( cuda_find_host_program ) + if (COMMAND find_host_program) + find_host_program( ${ARGN} ) + else() + find_program( ${ARGN} ) + endif() + endmacro() +else() + # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR + macro( cuda_find_host_program ) + find_program( ${ARGN} ) + endmacro() + SET (CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR}) +endif() + + +# CUDA_NVCC_EXECUTABLE +if(DEFINED ENV{CUDA_NVCC_EXECUTABLE}) + set(CUDA_NVCC_EXECUTABLE "$ENV{CUDA_NVCC_EXECUTABLE}" CACHE FILEPATH "The CUDA compiler") +else() + cuda_find_host_program(CUDA_NVCC_EXECUTABLE + NAMES nvcc + PATHS "${CUDA_TOOLKIT_ROOT_DIR}" + ENV CUDA_PATH + ENV CUDA_BIN_PATH + PATH_SUFFIXES bin bin64 + NO_DEFAULT_PATH + ) + # Search default search paths, after we search our own set of paths. + cuda_find_host_program(CUDA_NVCC_EXECUTABLE nvcc) +endif() +mark_as_advanced(CUDA_NVCC_EXECUTABLE) + +if(CUDA_NVCC_EXECUTABLE AND NOT CUDA_VERSION) + # Compute the version. + execute_process (COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT}) + string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) + set(CUDA_VERSION "${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}" CACHE STRING "Version of CUDA as computed from nvcc.") + mark_as_advanced(CUDA_VERSION) +else() + # Need to set these based off of the cached value + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${CUDA_VERSION}") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${CUDA_VERSION}") +endif() + + +# Always set this convenience variable +set(CUDA_VERSION_STRING "${CUDA_VERSION}") + +# CUDA_TOOLKIT_INCLUDE +find_path(CUDA_TOOLKIT_INCLUDE + device_functions.h # Header included in toolkit + PATHS ${CUDA_TOOLKIT_TARGET_DIR} + ENV CUDA_PATH + ENV CUDA_INC_PATH + PATH_SUFFIXES include + NO_DEFAULT_PATH + ) +# Search default search paths, after we search our own set of paths. +find_path(CUDA_TOOLKIT_INCLUDE device_functions.h) +mark_as_advanced(CUDA_TOOLKIT_INCLUDE) + +if (CUDA_VERSION VERSION_GREATER "7.0" OR EXISTS "${CUDA_TOOLKIT_INCLUDE}/cuda_fp16.h") + set(CUDA_HAS_FP16 TRUE) +else() + set(CUDA_HAS_FP16 FALSE) +endif() + +# Set the user list of include dir to nothing to initialize it. +set (CUDA_NVCC_INCLUDE_DIRS_USER "") +set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) + +macro(cuda_find_library_local_first_with_path_ext _var _names _doc _path_ext ) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # CUDA 3.2+ on Windows moved the library directories, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir "${_path_ext}lib/x64" "${_path_ext}lib64" "${_path_ext}libx64" ) + endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). + find_library(${_var} + NAMES ${_names} + PATHS "${CUDA_TOOLKIT_TARGET_DIR}" + ENV CUDA_PATH + ENV CUDA_LIB_PATH + PATH_SUFFIXES ${_cuda_64bit_lib_dir} "${_path_ext}lib/Win32" "${_path_ext}lib" "${_path_ext}libWin32" + DOC ${_doc} + NO_DEFAULT_PATH + ) + if (NOT CMAKE_CROSSCOMPILING) + # Search default search paths, after we search our own set of paths. + find_library(${_var} + NAMES ${_names} + PATHS "/usr/lib/nvidia-current" + DOC ${_doc} + ) + endif() +endmacro() + +macro(cuda_find_library_local_first _var _names _doc) + cuda_find_library_local_first_with_path_ext( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + +macro(find_library_local_first _var _names _doc ) + cuda_find_library_local_first( "${_var}" "${_names}" "${_doc}" "" ) +endmacro() + + +# CUDA_LIBRARIES +cuda_find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library") +if(CUDA_VERSION VERSION_EQUAL "3.0") + # The cudartemu library only existed for the 3.0 version of CUDA. + cuda_find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library") + mark_as_advanced( + CUDA_CUDARTEMU_LIBRARY + ) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.5") + cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") + mark_as_advanced(CUDA_cudart_static_LIBRARY) +endif() + + +if(CUDA_cudart_static_LIBRARY) + # If static cudart available, use it by default, but provide a user-visible option to disable it. + option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) +else() + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() + set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") + mark_as_advanced(CUDA_cudadevrt_LIBRARY) +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + if(UNIX) + # Check for the dependent libraries. + + # Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;} + # as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and + # -Werror causes the try_compile to fail. We will just temporarily disable other flags + # when doing the find_package command here. + set(_cuda_cmake_c_flags ${CMAKE_C_FLAGS}) + set(CMAKE_C_FLAGS "-fPIC") + find_package(Threads REQUIRED) + set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) + + if(NOT APPLE) + #On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDA_rt_LIBRARY rt) + if (NOT CUDA_rt_LIBRARY) + message(WARNING "Expecting to find librt for libcudart_static, but didn't find it.") + endif() + endif() + endif() +endif() + +# CUPTI library showed up in cuda toolkit 4.0 +if(NOT CUDA_VERSION VERSION_LESS "4.0") + cuda_find_library_local_first_with_path_ext(CUDA_cupti_LIBRARY cupti "\"cupti\" library" "extras/CUPTI/") + mark_as_advanced(CUDA_cupti_LIBRARY) +endif() + +# Set the CUDA_LIBRARIES variable. This is the set of stuff to link against if you are +# using the CUDA runtime. For the dynamic version of the runtime, most of the +# dependencies are brough in, but for the static version there are additional libraries +# and linker commands needed. +# Initialize to empty +set(CUDA_LIBRARIES) + +# If we are using emulation mode and we found the cudartemu library then use +# that one instead of cudart. +if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY}) +elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY}) + if (TARGET Threads::Threads) + list(APPEND CUDA_LIBRARIES Threads::Threads) + endif() + list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS}) + if (CUDA_rt_LIBRARY) + list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY}) + endif() + if(APPLE) + # We need to add the default path to the driver (libcuda.dylib) as an rpath, so that + # the static cuda runtime can find it at runtime. + list(APPEND CUDA_LIBRARIES -Wl,-rpath,/usr/local/cuda/lib) + endif() +else() + list(APPEND CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY}) +endif() + +# 1.1 toolkit on linux doesn't appear to have a separate library on +# some platforms. +cuda_find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older versions only).") + +mark_as_advanced( + CUDA_CUDA_LIBRARY + CUDA_CUDART_LIBRARY + ) + +####################### +# Look for some of the toolkit helper libraries +macro(FIND_CUDA_HELPER_LIBS _name) + cuda_find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library") + mark_as_advanced(CUDA_${_name}_LIBRARY) +endmacro() + +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + +# Search for additional CUDA toolkit libraries. +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() +find_cuda_helper_libs(cufft) +find_cuda_helper_libs(cublas) +if(NOT CUDA_VERSION VERSION_LESS "3.2") + # cusparse showed up in version 3.2 + find_cuda_helper_libs(cusparse) + find_cuda_helper_libs(curand) + if (WIN32) + find_cuda_helper_libs(nvcuvenc) + find_cuda_helper_libs(nvcuvid) + endif() +endif() +if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2") + # In CUDA 9.2 cublas_device was deprecated + find_cuda_helper_libs(cublas_device) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "5.0") + find_cuda_helper_libs(nvToolsExt) + find_cuda_helper_libs(OpenCL) +endif() + +if(NOT CUDA_VERSION VERSION_LESS "9.0") + # In CUDA 9.0 NPP was nppi was removed + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppial) + find_cuda_helper_libs(nppicc) + if(CUDA_VERSION VERSION_LESS "11.0") + find_cuda_helper_libs(nppicom) + endif() + find_cuda_helper_libs(nppidei) + find_cuda_helper_libs(nppif) + find_cuda_helper_libs(nppig) + find_cuda_helper_libs(nppim) + find_cuda_helper_libs(nppist) + find_cuda_helper_libs(nppisu) + find_cuda_helper_libs(nppitc) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(CUDA_VERSION VERSION_GREATER "5.0") + # In CUDA 5.5 NPP was split into 3 separate libraries. + find_cuda_helper_libs(nppc) + find_cuda_helper_libs(nppi) + find_cuda_helper_libs(npps) + set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") +elseif(NOT CUDA_VERSION VERSION_LESS "4.0") + find_cuda_helper_libs(npp) +endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() + +if (CUDA_BUILD_EMULATION) + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) +else() + set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) + set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) +endif() + +######################## +# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with +# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory +find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h + HINTS + "$ENV{NVSDKCOMPUTE_ROOT}/C" + ENV NVSDKCUDA_ROOT + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]" + PATHS + "/Developer/GPU\ Computing/C" + ) + +# Keep the CUDA_SDK_ROOT_DIR first in order to be able to override the +# environment variables. +set(CUDA_SDK_SEARCH_PATH + "${CUDA_SDK_ROOT_DIR}" + "${CUDA_TOOLKIT_ROOT_DIR}/local/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NVSDK0.2" + "${CUDA_TOOLKIT_ROOT_DIR}/NV_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK" + "$ENV{HOME}/NVIDIA_CUDA_SDK_MACOSX" + "/Developer/CUDA" + ) + +# Example of how to find an include file from the CUDA_SDK_ROOT_DIR + +# find_path(CUDA_CUT_INCLUDE_DIR +# cutil.h +# PATHS ${CUDA_SDK_SEARCH_PATH} +# PATH_SUFFIXES "common/inc" +# DOC "Location of cutil.h" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_path(CUDA_CUT_INCLUDE_DIR cutil.h DOC "Location of cutil.h") + +# mark_as_advanced(CUDA_CUT_INCLUDE_DIR) + + +# Example of how to find a library in the CUDA_SDK_ROOT_DIR + +# # cutil library is called cutil64 for 64 bit builds on windows. We don't want +# # to get these confused, so we are setting the name based on the word size of +# # the build. + +# if(CMAKE_SIZEOF_VOID_P EQUAL 8) +# set(cuda_cutil_name cutil64) +# else() +# set(cuda_cutil_name cutil32) +# endif() + +# find_library(CUDA_CUT_LIBRARY +# NAMES cutil ${cuda_cutil_name} +# PATHS ${CUDA_SDK_SEARCH_PATH} +# # The new version of the sdk shows up in common/lib, but the old one is in lib +# PATH_SUFFIXES "common/lib" "lib" +# DOC "Location of cutil library" +# NO_DEFAULT_PATH +# ) +# # Now search system paths +# find_library(CUDA_CUT_LIBRARY NAMES cutil ${cuda_cutil_name} DOC "Location of cutil library") +# mark_as_advanced(CUDA_CUT_LIBRARY) +# set(CUDA_CUT_LIBRARIES ${CUDA_CUT_LIBRARY}) + + + +############################# +# Check for required components +set(CUDA_FOUND TRUE) + +set(CUDA_TOOLKIT_ROOT_DIR_INTERNAL "${CUDA_TOOLKIT_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_ROOT_DIR was set successfully." FORCE) +set(CUDA_TOOLKIT_TARGET_DIR_INTERNAL "${CUDA_TOOLKIT_TARGET_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_TOOLKIT_TARGET_DIR was set successfully." FORCE) +set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL + "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) + +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + ${CUDA_CUDART_LIBRARY_VAR} + VERSION_VAR + CUDA_VERSION + ) + + + +############################################################################### +############################################################################### +# Macros +############################################################################### +############################################################################### + +############################################################################### +# Add include directories to pass to the nvcc command. +macro(CUDA_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND CUDA_NVCC_INCLUDE_DIRS_USER ${dir}) + endforeach() +endmacro() + + +############################################################################## +cuda_find_helper_file(parse_cubin cmake) +cuda_find_helper_file(make2cmake cmake) +cuda_find_helper_file(run_nvcc cmake) +include("${CMAKE_ROOT}/Modules/FindCUDA/select_compute_arch.cmake") + +############################################################################## +# Separate the OPTIONS out from the sources +# +macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options) + set( ${_sources} ) + set( ${_cmake_options} ) + set( ${_options} ) + set( _found_options FALSE ) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xOPTIONS") + set( _found_options TRUE ) + elseif( + "x${arg}" STREQUAL "xWIN32" OR + "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if ( _found_options ) + list(APPEND ${_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################## +# Parse the OPTIONS from ARGN and set the variables prefixed by _option_prefix +# +macro(CUDA_PARSE_NVCC_OPTIONS _option_prefix) + set( _found_config ) + foreach(arg ${ARGN}) + # Determine if we are dealing with a perconfiguration flag + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + if (arg STREQUAL "${config_upper}") + set( _found_config _${arg}) + # Set arg to nothing to keep it from being processed further + set( arg ) + endif() + endforeach() + + if ( arg ) + list(APPEND ${_option_prefix}${_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################## +# Helper to add the include directory for CUDA only once +function(CUDA_ADD_CUDA_INCLUDE_ONCE) + get_directory_property(_include_directories INCLUDE_DIRECTORIES) + set(_add TRUE) + if(_include_directories) + foreach(dir ${_include_directories}) + if("${dir}" STREQUAL "${CUDA_INCLUDE_DIRS}") + set(_add FALSE) + endif() + endforeach() + endif() + if(_add) + include_directories(${CUDA_INCLUDE_DIRS}) + endif() +endfunction() + +function(CUDA_BUILD_SHARED_LIBRARY shared_flag) + set(cmake_args ${ARGN}) + # If SHARED, MODULE, or STATIC aren't already in the list of arguments, then + # add SHARED or STATIC based on the value of BUILD_SHARED_LIBS. + list(FIND cmake_args SHARED _cuda_found_SHARED) + list(FIND cmake_args MODULE _cuda_found_MODULE) + list(FIND cmake_args STATIC _cuda_found_STATIC) + if( _cuda_found_SHARED GREATER -1 OR + _cuda_found_MODULE GREATER -1 OR + _cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs) + else() + if (BUILD_SHARED_LIBS) + set(_cuda_build_shared_libs SHARED) + else() + set(_cuda_build_shared_libs STATIC) + endif() + endif() + set(${shared_flag} ${_cuda_build_shared_libs} PARENT_SCOPE) +endfunction() + +############################################################################## +# Helper to avoid clashes of files with the same basename but different paths. +# This doesn't attempt to do exactly what CMake internals do, which is to only +# add this path when there is a conflict, since by the time a second collision +# in names is detected it's already too late to fix the first one. For +# consistency sake the relative path will be added to all files. +function(CUDA_COMPUTE_BUILD_PATH path build_path) + #message("CUDA_COMPUTE_BUILD_PATH([${path}] ${build_path})") + # Only deal with CMake style paths from here on out + file(TO_CMAKE_PATH "${path}" bpath) + if (IS_ABSOLUTE "${bpath}") + # Absolute paths are generally unnessary, especially if something like + # file(GLOB_RECURSE) is used to pick up the files. + + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if (_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the + # CMake source. + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + + # Strip off the filename. I wait until here to do it, since removin the + # basename can make a path that looked like path/../basename turn into + # path/.. (notice the trailing slash). + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) + #message("${build_path} = ${bpath}") +endfunction() + +############################################################################## +# This helper macro populates the following variables and setups up custom +# commands and targets to invoke the nvcc compiler to generate C or PTX source +# dependent upon the format parameter. The compiler is invoked once with -M +# to generate a dependency file and a second time with -cuda or -ptx to generate +# a .cpp or .ptx file. +# INPUT: +# cuda_target - Target name +# format - PTX, CUBIN, FATBIN or OBJ +# FILE1 .. FILEN - The remaining arguments are the sources to be wrapped. +# OPTIONS - Extra options to NVCC +# OUTPUT: +# generated_files - List of generated files +############################################################################## +############################################################################## + +macro(CUDA_WRAP_SRCS cuda_target format generated_files) + + # Put optional arguments in list. + set(_argn_list "${ARGN}") + # If one of the given optional arguments is "PHONY", make a note of it, then + # remove it from the list. + list(FIND _argn_list "PHONY" _phony_idx) + if("${_phony_idx}" GREATER "-1") + set(_target_is_phony true) + list(REMOVE_AT _argn_list ${_phony_idx}) + else() + set(_target_is_phony false) + endif() + + # If CMake doesn't support separable compilation, complain + if(CUDA_SEPARABLE_COMPILATION AND CMAKE_VERSION VERSION_LESS "2.8.10.1") + message(SEND_ERROR "CUDA_SEPARABLE_COMPILATION isn't supported for CMake versions less than 2.8.10.1") + endif() + + # Set up all the command line flags here, so that they can be overridden on a per target basis. + + set(nvcc_flags "") + + # Emulation if the card isn't present. + if (CUDA_BUILD_EMULATION) + # Emulation. + set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g) + else() + # Device mode. No flags necessary. + endif() + + if(CUDA_HOST_COMPILATION_CPP) + set(CUDA_C_OR_CXX CXX) + else() + if(CUDA_VERSION VERSION_LESS "3.0") + set(nvcc_flags ${nvcc_flags} --host-compilation C) + else() + message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" ) + endif() + set(CUDA_C_OR_CXX C) + endif() + + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + + if(CUDA_64_BIT_DEVICE_CODE) + set(nvcc_flags ${nvcc_flags} -m64) + else() + set(nvcc_flags ${nvcc_flags} -m32) + endif() + + if(CUDA_TARGET_CPU_ARCH) + set(nvcc_flags ${nvcc_flags} "--target-cpu-architecture=${CUDA_TARGET_CPU_ARCH}") + endif() + + # This needs to be passed in at this stage, because VS needs to fill out the + # various macros from within VS. Note that CCBIN is only used if + # -ccbin or --compiler-bindir isn't used and CUDA_HOST_COMPILER matches + # _CUDA_MSVC_HOST_COMPILER + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(ccbin_flags -D "\"CCBIN:PATH=${_CUDA_MSVC_HOST_COMPILER}\"" ) + else() + set(ccbin_flags) + endif() + + # Figure out which configure we will use and pass that in as an argument to + # the script. We need to defer the decision until compilation time, because + # for VS projects we won't know if we are making a debug or release build + # until build time. + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set( CUDA_build_configuration "$(ConfigurationName)" ) + else() + set( CUDA_build_configuration "${CMAKE_BUILD_TYPE}") + endif() + + # Initialize our list of includes with the user ones followed by the CUDA system ones. + set(CUDA_NVCC_INCLUDE_DIRS ${CUDA_NVCC_INCLUDE_DIRS_USER} "${CUDA_INCLUDE_DIRS}") + if(_target_is_phony) + # If the passed in target name isn't a real target (i.e., this is from a call to one of the + # cuda_compile_* functions), need to query directory properties to get include directories + # and compile definitions. + get_directory_property(_dir_include_dirs INCLUDE_DIRECTORIES) + get_directory_property(_dir_compile_defs COMPILE_DEFINITIONS) + + list(APPEND CUDA_NVCC_INCLUDE_DIRS "${_dir_include_dirs}") + set(CUDA_NVCC_COMPILE_DEFINITIONS "${_dir_compile_defs}") + else() + # Append the include directories for this target via generator expression, which is + # expanded by the FILE(GENERATE) call below. This generator expression captures all + # include dirs set by the user, whether via directory properties or target properties + list(APPEND CUDA_NVCC_INCLUDE_DIRS "$") + + # Do the same thing with compile definitions + set(CUDA_NVCC_COMPILE_DEFINITIONS "$") + endif() + + + # Reset these variables + set(CUDA_WRAP_OPTION_NVCC_FLAGS) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + set(CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}) + endforeach() + + CUDA_GET_SOURCES_AND_OPTIONS(_cuda_wrap_sources _cuda_wrap_cmake_options _cuda_wrap_options ${_argn_list}) + CUDA_PARSE_NVCC_OPTIONS(CUDA_WRAP_OPTION_NVCC_FLAGS ${_cuda_wrap_options}) + + # Figure out if we are building a shared library. BUILD_SHARED_LIBS is + # respected in CUDA_ADD_LIBRARY. + set(_cuda_build_shared_libs FALSE) + # SHARED, MODULE + list(FIND _cuda_wrap_cmake_options SHARED _cuda_found_SHARED) + list(FIND _cuda_wrap_cmake_options MODULE _cuda_found_MODULE) + if(_cuda_found_SHARED GREATER -1 OR _cuda_found_MODULE GREATER -1) + set(_cuda_build_shared_libs TRUE) + endif() + # STATIC + list(FIND _cuda_wrap_cmake_options STATIC _cuda_found_STATIC) + if(_cuda_found_STATIC GREATER -1) + set(_cuda_build_shared_libs FALSE) + endif() + + # CUDA_HOST_FLAGS + if(_cuda_build_shared_libs) + # If we are setting up code for a shared library, then we need to add extra flags for + # compiling objects for shared libraries. + set(CUDA_HOST_SHARED_FLAGS ${CMAKE_SHARED_LIBRARY_${CUDA_C_OR_CXX}_FLAGS}) + else() + set(CUDA_HOST_SHARED_FLAGS) + endif() + # Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We + # always need to set the SHARED_FLAGS, though. + if(CUDA_PROPAGATE_HOST_FLAGS) + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})") + else() + set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})") + endif() + + set(_cuda_nvcc_flags_config "# Build specific configuration flags") + # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS + # we convert the strings to lists (like we want). + + if(CUDA_PROPAGATE_HOST_FLAGS) + # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g + set(_cuda_fix_g3 FALSE) + + if(CMAKE_COMPILER_IS_GNUCC) + if (CUDA_VERSION VERSION_LESS "3.0" OR + CUDA_VERSION VERSION_EQUAL "4.1" OR + CUDA_VERSION VERSION_EQUAL "4.2" + ) + set(_cuda_fix_g3 TRUE) + endif() + endif() + if(_cuda_fix_g3) + string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + else() + set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + endif() + + string(APPEND _cuda_host_flags "\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})") + endif() + + # Note that if we ever want CUDA_NVCC_FLAGS_ to be string (instead of a list + # like it is currently), we can remove the quotes around the + # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_ variable. + string(APPEND _cuda_nvcc_flags_config "\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Process the C++11 flag. If the host sets the flag, we need to add it to nvcc and + # remove it from the host. This is because -Xcompile -std=c++ will choke nvcc (it uses + # the C preprocessor). In order to get this to work correctly, we need to use nvcc's + # specific c++11 flag. + if( "${_cuda_host_flags}" MATCHES "-std=c\\+\\+11") + # Add the c++11 flag to nvcc if it isn't already present. Note that we only look at + # the main flag instead of the configuration specific flags. + if( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=c\\+\\+11" ) + list(APPEND nvcc_flags --std c++11) + endif() + string(REGEX REPLACE "[-]+std=c\\+\\+11" "" _cuda_host_flags "${_cuda_host_flags}") + endif() + + if(_cuda_build_shared_libs) + list(APPEND nvcc_flags "-D${cuda_target}_EXPORTS") + endif() + + # Reset the output variable + set(_cuda_wrap_generated_files "") + + # Iterate over the macro arguments and create custom + # commands for all the .cu files. + foreach(file ${_argn_list}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non-.cu files. + get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _cuda_source_format) AND NOT _is_header) + + if(NOT _cuda_source_format) + set(_cuda_source_format ${format}) + endif() + # If file isn't a .cu file, we need to tell nvcc to treat it as such. + if(NOT ${file} MATCHES "\\.cu$") + set(cuda_language_flag -x=cu) + else() + set(cuda_language_flag) + endif() + + if( ${_cuda_source_format} MATCHES "OBJ") + set( cuda_compile_to_external_module OFF ) + else() + set( cuda_compile_to_external_module ON ) + if( ${_cuda_source_format} MATCHES "PTX" ) + set( cuda_compile_to_external_module_type "ptx" ) + elseif( ${_cuda_source_format} MATCHES "CUBIN") + set( cuda_compile_to_external_module_type "cubin" ) + elseif( ${_cuda_source_format} MATCHES "FATBIN") + set( cuda_compile_to_external_module_type "fatbin" ) + else() + message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS or set with CUDA_SOURCE_PROPERTY_FORMAT file property for file '${file}': '${_cuda_source_format}'. Use OBJ, PTX, CUBIN or FATBIN.") + endif() + endif() + + if(cuda_compile_to_external_module) + # Don't use any of the host compilation flags for PTX targets. + set(CUDA_HOST_FLAGS) + set(CUDA_NVCC_FLAGS_CONFIG) + else() + set(CUDA_HOST_FLAGS ${_cuda_host_flags}) + set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config}) + endif() + + # Determine output directory + cuda_compute_build_path("${file}" cuda_build_path) + set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}") + if(CUDA_GENERATED_OUTPUT_DIR) + set(cuda_compile_output_dir "${CUDA_GENERATED_OUTPUT_DIR}") + else() + if ( cuda_compile_to_external_module ) + set(cuda_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(cuda_compile_output_dir "${cuda_compile_intermediate_directory}") + endif() + endif() + + # Add a custom target to generate a c or ptx file. ###################### + + get_filename_component( basename ${file} NAME ) + if( cuda_compile_to_external_module ) + set(generated_file_path "${cuda_compile_output_dir}") + set(generated_file_basename "${cuda_target}_generated_${basename}.${cuda_compile_to_external_module_type}") + set(format_flag "-${cuda_compile_to_external_module_type}") + file(MAKE_DIRECTORY "${cuda_compile_output_dir}") + else() + set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}") + if(CUDA_SEPARABLE_COMPILATION) + set(format_flag "-dc") + else() + set(format_flag "-c") + endif() + endif() + + # Set all of our file names. Make sure that whatever filenames that have + # generated_file_path in them get passed in through as a command line + # argument, so that the ${CMAKE_CFG_INTDIR} gets expanded at run time + # instead of configure time. + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") + set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") + set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$>:.$>.cmake") + + # Setup properties for obj files: + if( NOT cuda_compile_to_external_module ) + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. + ) + endif() + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path. + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + if( NOT cuda_compile_to_external_module AND CUDA_SEPARABLE_COMPILATION) + list(APPEND ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS "${generated_file}") + endif() + + # Bring in the dependencies. Creates a variable CUDA_NVCC_DEPEND ####### + cuda_include_nvcc_dependencies(${cmake_dependency_file}) + + # Convenience string for output ######################################### + if(CUDA_BUILD_EMULATION) + set(cuda_build_type "Emulation") + else() + set(cuda_build_type "Device") + endif() + + # Build the NVCC made dependency file ################################### + set(build_cubin OFF) + if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN ) + if ( NOT cuda_compile_to_external_module ) + set ( build_cubin ON ) + endif() + endif() + + # Configure the build script + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + + # So if a user specifies the same cuda file as input more than once, you + # can have bad things happen with dependencies. Here we check an option + # to see if this is the behavior they want. + if(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE) + set(main_dep MAIN_DEPENDENCY ${source_file}) + else() + set(main_dep DEPENDS ${source_file}) + endif() + + if(CUDA_VERBOSE_BUILD) + set(verbose_output ON) + elseif(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + if(cuda_compile_to_external_module) + set(cuda_build_comment_string "Building NVCC ${cuda_compile_to_external_module_type} file ${generated_file_relative_path}") + else() + set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}") + endif() + + set(_verbatim VERBATIM) + if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + # Build the generated file and dependency file ########################## + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${CUDA_NVCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + ${ccbin_flags} + -D build_configuration:STRING=${CUDA_build_configuration} + -D "generated_file:STRING=${generated_file}" + -D "generated_cubin_file:STRING=${generated_cubin_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${cuda_compile_intermediate_directory}" + COMMENT "${cuda_build_comment_string}" + ${_verbatim} + ) + + # Make sure the build system knows the file is generated. + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + + list(APPEND _cuda_wrap_generated_files ${generated_file}) + + # Add the other files that we want cmake to clean on a cleanup ########## + list(APPEND CUDA_ADDITIONAL_CLEAN_FILES "${cmake_dependency_file}") + list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES) + set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") + + endif() + endforeach() + + # Set the return parameter + set(${generated_files} ${_cuda_wrap_generated_files}) +endmacro() + +function(_cuda_get_important_host_flags important_flags flag_string) + if(CMAKE_GENERATOR MATCHES "Visual Studio") + string(REGEX MATCHALL "/M[DT][d]?" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + else() + string(REGEX MATCHALL "-fPIC" flags "${flag_string}") + list(APPEND ${important_flags} ${flags}) + endif() + set(${important_flags} ${${important_flags}} PARENT_SCOPE) +endfunction() + +############################################################################### +############################################################################### +# Separable Compilation Link +############################################################################### +############################################################################### + +# Compute the filename to be used by CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS +function(CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME output_file_var cuda_target object_files) + if (object_files) + set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION}) + set(output_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${CMAKE_CFG_INTDIR}/${cuda_target}_intermediate_link${generated_extension}") + else() + set(output_file) + endif() + + set(${output_file_var} "${output_file}" PARENT_SCOPE) +endfunction() + +# Setup the build rule for the separable compilation intermediate link file. +function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options object_files) + if (object_files) + + set_source_files_properties("${output_file}" + PROPERTIES + EXTERNAL_OBJECT TRUE # This is an object file not to be compiled, but only + # be linked. + GENERATED TRUE # This file is generated during the build + ) + + # For now we are ignoring all the configuration specific flags. + set(nvcc_flags) + CUDA_PARSE_NVCC_OPTIONS(nvcc_flags ${options}) + if(CUDA_64_BIT_DEVICE_CODE) + list(APPEND nvcc_flags -m64) + else() + list(APPEND nvcc_flags -m32) + endif() + # If -ccbin, --compiler-bindir has been specified, don't do anything. Otherwise add it here. + list( FIND nvcc_flags "-ccbin" ccbin_found0 ) + list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 ) + if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) + # Match VERBATIM check below. + if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)") + list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") + else() + list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}") + endif() + endif() + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* + set(config_specific_flags) + set(flags) + foreach(config ${CUDA_configuration_types}) + string(TOUPPER ${config} config_upper) + # Add config specific flags + foreach(f ${CUDA_NVCC_FLAGS_${config_upper}}) + list(APPEND config_specific_flags $<$:${f}>) + endforeach() + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") + foreach(f ${important_host_flags}) + list(APPEND flags $<$:-Xcompiler> $<$:${f}>) + endforeach() + endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags "${CMAKE_${CUDA_C_OR_CXX}_FLAGS}") + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags + set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) + + file(RELATIVE_PATH output_file_relative_path "${CMAKE_BINARY_DIR}" "${output_file}") + + # Some generators don't handle the multiple levels of custom command + # dependencies correctly (obj1 depends on file1, obj2 depends on obj1), so + # we work around that issue by compiling the intermediate link object as a + # pre-link custom command in that situation. + set(do_obj_build_rule TRUE) + if (MSVC_VERSION GREATER 1599 AND MSVC_VERSION LESS 1800) + # VS 2010 and 2012 have this problem. + set(do_obj_build_rule FALSE) + endif() + + set(_verbatim VERBATIM) + if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)") + set(_verbatim "") + endif() + + if (do_obj_build_rule) + add_custom_command( + OUTPUT ${output_file} + DEPENDS ${object_files} + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file} + ${flags} + COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) + add_custom_command( + TARGET ${cuda_target} + PRE_LINK + COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" + COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" + COMMAND_EXPAND_LISTS + ${_verbatim} + ) + endif() + endif() +endfunction() + +############################################################################### +############################################################################### +# ADD LIBRARY +############################################################################### +############################################################################### +macro(CUDA_ADD_LIBRARY cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + CUDA_BUILD_SHARED_LIBRARY(_cuda_shared_flag ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} + ${_cmake_options} ${_cuda_shared_flag} + OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_library(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + if(CUDA_SEPARABLE_COMPILATION) + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_cudadevrt_LIBRARY} + ) + endif() + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# ADD EXECUTABLE +############################################################################### +############################################################################### +macro(CUDA_ADD_EXECUTABLE cuda_target) + + CUDA_ADD_CUDA_INCLUDE_ONCE() + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${cuda_target} OBJ _generated_files ${_sources} OPTIONS ${_options} ) + + # Compute the file name of the intermedate link file used for separable + # compilation. + CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME(link_file ${cuda_target} "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + # Add the library. + add_executable(${cuda_target} ${_cmake_options} + ${_generated_files} + ${_sources} + ${link_file} + ) + + # Add a link phase for the separable compilation if it has been enabled. If + # it has been enabled then the ${cuda_target}_SEPARABLE_COMPILATION_OBJECTS + # variable will have been defined. + CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS("${link_file}" ${cuda_target} "${_options}" "${${cuda_target}_SEPARABLE_COMPILATION_OBJECTS}") + + target_link_libraries(${cuda_target} ${CUDA_LINK_LIBRARIES_KEYWORD} + ${CUDA_LIBRARIES} + ) + + # We need to set the linker language based on what the expected generated file + # would be. CUDA_C_OR_CXX is computed based on CUDA_HOST_COMPILATION_CPP. + set_target_properties(${cuda_target} + PROPERTIES + LINKER_LANGUAGE ${CUDA_C_OR_CXX} + ) + +endmacro() + + +############################################################################### +############################################################################### +# (Internal) helper for manually added cuda source files with specific targets +############################################################################### +############################################################################### +macro(cuda_compile_base cuda_target format generated_files) + # Update a counter in this directory, to keep phony target names unique. + set(_cuda_target "${cuda_target}") + get_property(_counter DIRECTORY PROPERTY _cuda_internal_phony_counter) + if(_counter) + math(EXPR _counter "${_counter} + 1") + else() + set(_counter 1) + endif() + string(APPEND _cuda_target "_${_counter}") + set_property(DIRECTORY PROPERTY _cuda_internal_phony_counter ${_counter}) + + # Separate the sources from the options + CUDA_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _options ${ARGN}) + + # Create custom commands and targets for each file. + CUDA_WRAP_SRCS( ${_cuda_target} ${format} _generated_files ${_sources} + ${_cmake_options} OPTIONS ${_options} PHONY) + + set( ${generated_files} ${_generated_files}) + +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE +############################################################################### +############################################################################### +macro(CUDA_COMPILE generated_files) + cuda_compile_base(cuda_compile OBJ ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE PTX +############################################################################### +############################################################################### +macro(CUDA_COMPILE_PTX generated_files) + cuda_compile_base(cuda_compile_ptx PTX ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE FATBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_FATBIN generated_files) + cuda_compile_base(cuda_compile_fatbin FATBIN ${generated_files} ${ARGN}) +endmacro() + +############################################################################### +############################################################################### +# CUDA COMPILE CUBIN +############################################################################### +############################################################################### +macro(CUDA_COMPILE_CUBIN generated_files) + cuda_compile_base(cuda_compile_cubin CUBIN ${generated_files} ${ARGN}) +endmacro() + + +############################################################################### +############################################################################### +# CUDA ADD CUFFT TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUFFT_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufftemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cufft_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA ADD CUBLAS TO TARGET +############################################################################### +############################################################################### +macro(CUDA_ADD_CUBLAS_TO_TARGET target) + if (CUDA_BUILD_EMULATION) + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublasemu_LIBRARY}) + else() + target_link_libraries(${target} ${CUDA_LINK_LIBRARIES_KEYWORD} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY}) + endif() +endmacro() + +############################################################################### +############################################################################### +# CUDA BUILD CLEAN TARGET +############################################################################### +############################################################################### +macro(CUDA_BUILD_CLEAN_TARGET) + # Call this after you add all your CUDA targets, and you will get a + # convenience target. You should also make clean after running this target + # to get the build system to generate all the code again. + + set(cuda_clean_target_name clean_cuda_depends) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name) + endif() + add_custom_target(${cuda_clean_target_name} + COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES}) + + # Clear out the variable, so the next time we configure it will be empty. + # This is useful so that the files won't persist in the list after targets + # have been removed. + set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.") +endmacro() diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 660a4e263bc73d..522623c45f0945 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -6,15 +6,13 @@ if (EXISTS "${CURRENT_INSTALLED_DIR}/share/opencv3") message(FATAL_ERROR "OpenCV 3 is installed, please uninstall and try again:\n vcpkg remove opencv3") endif() -include(vcpkg_common_functions) - -set(OPENCV_VERSION "4.1.1") +set(OPENCV_VERSION "4.3.0") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO opencv/opencv REF ${OPENCV_VERSION} - SHA512 80fa48d992ca06a2a4ab6740df6d8c21f4926165486b393969da2c5bbe2f3a0b799fb76dee5e3654e90c743e49bbd2b5b02ad59a4766896bbf4cd5b4e3251e0f + SHA512 ac22b41fffa3e3138701fa0df0d19900b3ce72e168f4478ecdc593c5c9fd004b4b1b26612d62c25b681db99a8720db7a11b5b224e576e595624965fa79b0f383 HEAD_REF master PATCHES 0001-disable-downloading.patch @@ -24,6 +22,11 @@ vcpkg_from_github( 0009-fix-uwp.patch ) +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDNN.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/FindCUDA.cmake") +file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindCUDA") +file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindCUDA.cmake DESTINATION ${SOURCE_PATH}/cmake/) # backported from CMake 3.18, remove when released + string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" BUILD_WITH_STATIC_CRT) set(ADE_DIR ${CURRENT_INSTALLED_DIR}/share/ade CACHE PATH "Path to existing ADE CMake Config file") @@ -33,7 +36,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "contrib" WITH_CONTRIB "cuda" WITH_CUDA "cuda" WITH_CUBLAS - "dnn" BUILD_opencv_dnn "eigen" WITH_EIGEN "ffmpeg" WITH_FFMPEG "gdcm" WITH_GDCM @@ -43,23 +45,39 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "nonfree" OPENCV_ENABLE_NONFREE "openexr" WITH_OPENEXR "opengl" WITH_OPENGL - "openmp" WITH_OPENMP "png" WITH_PNG "qt" WITH_QT "sfm" BUILD_opencv_sfm "tiff" WITH_TIFF "webp" WITH_WEBP "world" BUILD_opencv_world - "gtk" WITH_GTK ) -# Cannot use vcpkg_check_features() for "ipp", "ovis", "tbb", and "vtk". +# Cannot use vcpkg_check_features() for "dnn", ipp", "openmp", "ovis", "tbb", and "vtk". # As the respective value of their variables can be unset conditionally. +set(BUILD_opencv_dnn OFF) +if("dnn" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_ANDROID) + set(BUILD_opencv_dnn ON) + else() + message(WARNING "The dnn module cannot be enabled on Android") + endif() +endif() + set(WITH_IPP OFF) if("ipp" IN_LIST FEATURES) set(WITH_IPP ON) endif() +set(WITH_OPENMP OFF) +if("openmp" IN_LIST FEATURES) + if(NOT VCPKG_TARGET_IS_OSX) + set(WITH_OPENMP ON) + else() + message(WARNING "The OpenMP feature is not supported on macOS") + endif() +endif() + set(BUILD_opencv_ovis OFF) if("ovis" IN_LIST FEATURES) set(BUILD_opencv_ovis ON) @@ -107,8 +125,10 @@ if("contrib" IN_LIST FEATURES) OUT_SOURCE_PATH CONTRIB_SOURCE_PATH REPO opencv/opencv_contrib REF ${OPENCV_VERSION} - SHA512 8af13f0a5f350360316662c1ce5e58c21d906a58591acfbd575a8dacde19b6f3bbd694c3c199feb35c33549cf8c37e3fb4c494b586a00ad29fe3b4aeeb2d22ab + SHA512 cfeda06a9f86ccaedbca9521c35bf685c3d8d3a182fb943f9378a7ecd1949d6e2e9df1673f0e3e9686840ca4c9e5a8e8cf2ac962a33b6e1f88f8278abd8c37e5 HEAD_REF master + PATCHES + 0005-add-missing-stdexcept-include.patch ) set(BUILD_WITH_CONTRIB_FLAG "-DOPENCV_EXTRA_MODULES_PATH=${CONTRIB_SOURCE_PATH}/modules") @@ -178,9 +198,9 @@ if(WITH_IPP) if(VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_mac_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/fe6b2bb75ae0e3f19ad3ae1a31dfa4a2-ippicv_2019_mac_intel64_general_20180723.tgz" - SHA512 266fe3fecf8e95e1f51c09b65330a577743ef72b423b935d4d1fe8d87f1b4f258c282fe6a18fc805d489592f137ebed37c9f1d1b34026590d9f1ba107015132e + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_mac_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/1c3d675c2a2395d094d523024896e01b-ippicv_2020_mac_intel64_20191018_general.tgz" + SHA512 454dfaaa245e3a3b2f1ffb1aa8e27e280b03685009d66e147482b14e5796fdf2d332cac0f9b0822caedd5760fda4ee0ce2961889597456bbc18202f10bf727cd ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -189,15 +209,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_LINUX) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" - SHA512 e4ec6b3b9fc03d7b3ae777c2a26f57913e83329fd2f7be26c259b07477ca2a641050b86979e0c96e25aa4c1f9f251b28727690358a77418e76dd910d0f4845c9 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_intel64_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/7421de0095c7a39162ae13a6098782f9-ippicv_2020_lnx_intel64_20191018_general.tgz" + SHA512 de6d80695cd6deef359376476edc4ff85fdddcf94972b936e0017f8a48aaa5d18f55c4253ae37deb83bff2f71410f68408063c88b5f3bf4df3c416aa93ceca87 ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_ia32_general_20180723.tgz" - FILENAME "opencv-cache/ippicv/4f38432c30bfd6423164b7a24bbc98a0-ippicv_2019_lnx_ia32_general_20180723.tgz" - SHA512 d96d3989928ff11a18e631bf5ecfdedf88fd350162a23fa2c8f7dbc3bf878bf442aff7fb2a07dc56671d7268cc20682055891be75b9834e9694d20173e92b6a3 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_lnx_ia32_20191018_general.tgz" + FILENAME "opencv-cache/ippicv/ad189a940fb60eb71f291321322fe3e8-ippicv_2020_lnx_ia32_20191018_general.tgz" + SHA512 5ca9dafc3a634e2a5f83f6a498611c990ef16d54358e9b44574b01694e9d64b118d46d6e2011506e40d37e5a9865f576f790e37ff96b7c8b503507633631a296 ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -206,15 +226,15 @@ if(WITH_IPP) elseif(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_intel64_20180723_general.zip" - FILENAME "opencv-cache/ippicv/1d222685246896fe089f88b8858e4b2f-ippicv_2019_win_intel64_20180723_general.zip" - SHA512 b6c4f2696e2004b8f5471efd9bdc6c684b77830e0533d8880310c0b665b450d6f78e10744c937f5592ab900e187c475e46cb49e98701bb4bcbbc7da77723011d + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" + FILENAME "opencv-cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" + SHA512 50c4af4b7fe2161d652264230389dad2330e8c95b734d04fb7565bffdab855c06d43085e480da554c56b04f8538087d49503538d5943221ee2a772ee7be4c93c ) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") vcpkg_download_distfile(OCV_DOWNLOAD - URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_win_ia32_20180723_general.zip" - FILENAME "opencv-cache/ippicv/0157251a2eb9cd63a3ebc7eed0f3e59e-ippicv_2019_win_ia32_20180723_general.zip" - SHA512 c33fd4019c71b064b153e1b25e0307f9c7ada693af8ec910410edeab471c6f14df9b11bf9f5302ceb0fcd4282f5c0b6c92fb5df0e83eb50ed630c45820d1e184 + URLS "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_ia32_20191018_general.zip" + FILENAME "opencv-cache/ippicv/cd39bdf0c2e1cac9a61101dad7a2413e-ippicv_2020_win_ia32_20191018_general.zip" + SHA512 058d00775d9f16955c7a557d554b8c2976ab9dbad4ba3fdb9823c0f768809edbd835e4397f01dc090a9bc80d81de834375e7006614d2a898f42e8004de0e04bf ) else() message(WARNING "This target architecture is not supported IPPICV") @@ -263,13 +283,20 @@ vcpkg_configure_cmake( PREFER_NINJA SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DOPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE=ON #to use custom module with fixes for CUDA 11 compat, waiting for CMake support ###### ocv_options -DOpenCV_INSTALL_BINARIES_PREFIX= + -DOPENCV_BIN_INSTALL_PATH=bin + -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_LIB_INSTALL_PATH=lib -DOPENCV_3P_LIB_INSTALL_PATH=lib -DOPENCV_CONFIG_INSTALL_PATH=share/opencv + -DINSTALL_TO_MANGLED_PATHS=OFF -DOPENCV_FFMPEG_USE_FIND_PACKAGE=FFMPEG -DCMAKE_DEBUG_POSTFIX=d + -DOPENCV_DLLVERSION= + -DOPENCV_DEBUG_POSTFIX=d + -DOPENCV_GENERATE_SETUPVARS=OFF # Do not build docs/examples -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF @@ -320,17 +347,23 @@ vcpkg_configure_cmake( ${FEATURE_OPTIONS} -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON + -DWITH_GTK=OFF -DWITH_IPP=${WITH_IPP} -DWITH_MSMF=${WITH_MSMF} + -DWITH_OPENMP=${WITH_OPENMP} -DWITH_PROTOBUF=ON -DWITH_TBB=${WITH_TBB} -DWITH_VTK=${WITH_VTK} + -DWITH_OPENJPEG=OFF ###### WITH PROPERTIES explicitly disabled, they have problems with libraries if already installed by user and that are "involuntarily" found during install -DWITH_LAPACK=OFF ###### BUILD_options (mainly modules which require additional libraries) -DBUILD_opencv_ovis=${BUILD_opencv_ovis} + -DBUILD_opencv_dnn=${BUILD_opencv_dnn} ###### The following modules are disabled for UWP -DBUILD_opencv_quality=${BUILD_opencv_quality} + ###### The following module is disabled because it's broken #https://github.com/opencv/opencv_contrib/issues/2307 + -DBUILD_opencv_rgbd=OFF ###### Additional build flags ${ADDITIONAL_BUILD_FLAGS} ) @@ -359,6 +392,8 @@ if(Protobuf_FOUND) ) endif() endif() +find_package(CUDA QUIET) +find_package(Threads QUIET) find_package(TIFF QUIET) find_package(HDF5 QUIET) find_package(Freetype QUIET) @@ -369,15 +404,25 @@ find_package(ade QUIET) find_package(VTK QUIET) find_package(OpenMP QUIET) find_package(Tesseract QUIET) +find_package(OpenEXR QUIET) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +find_package(Qt5 COMPONENTS OpenGL Concurrent Test QUIET) find_package(GDCM QUIET)" OPENCV_MODULES "${OPENCV_MODULES}") - if("openmp" IN_LIST FEATURES) + if(WITH_OPENMP) string(REPLACE "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"" "set_target_properties(opencv_core PROPERTIES INTERFACE_LINK_LIBRARIES \"\$;" OPENCV_MODULES "${OPENCV_MODULES}") endif() + if(BUILD_opencv_ovis) + string(REPLACE "OgreGLSupportStatic" + "OgreGLSupport" OPENCV_MODULES "${OPENCV_MODULES}") + endif() + file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -385,9 +430,12 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE ${CURRENT_PACKAGES_DIR}/setup_vars_opencv4.cmd) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/setup_vars_opencv4.cmd) file(REMOVE ${CURRENT_PACKAGES_DIR}/LICENSE) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/LICENSE) +if(VCPKG_TARGET_IS_ANDROID) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/README.android) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/README.android) +endif() + file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openexr/CONTROL b/ports/openexr/CONTROL index ddf7b0fbd2be03..0a725a0424a3a9 100644 --- a/ports/openexr/CONTROL +++ b/ports/openexr/CONTROL @@ -1,6 +1,7 @@ Source: openexr -Version: 2.3.0-5 +Version: 2.5.0 +Port-Version: 1 Homepage: https://www.openexr.com/ Description: OpenEXR is a high dynamic-range (HDR) image file format developed by Industrial Light & Magic for use in computer imaging applications -Build-Depends: zlib -Supports: !uwp \ No newline at end of file +Build-Depends: zlib, python3 +Supports: !uwp diff --git a/ports/openexr/FindOpenEXR.cmake b/ports/openexr/FindOpenEXR.cmake deleted file mode 100644 index f036c742e1ffd8..00000000000000 --- a/ports/openexr/FindOpenEXR.cmake +++ /dev/null @@ -1,94 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path(OpenEXR_INCLUDE_DIRS OpenEXR/OpenEXRConfig.h) -find_path(OPENEXR_INCLUDE_PATHS NAMES ImfRgbaFile.h PATH_SUFFIXES OpenEXR) - -file(STRINGS "${OpenEXR_INCLUDE_DIRS}/OpenEXR/OpenEXRConfig.h" OPENEXR_CONFIG_H) - -string(REGEX REPLACE "^.*define OPENEXR_VERSION_MAJOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MAJOR "${OPENEXR_CONFIG_H}") -string(REGEX REPLACE "^.*define OPENEXR_VERSION_MINOR ([0-9]+).*$" "\\1" OpenEXR_VERSION_MINOR "${OPENEXR_CONFIG_H}") -set(OpenEXR_LIB_SUFFIX "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}") - -include(SelectLibraryConfigurations) - -if(NOT OpenEXR_BASE_LIBRARY) - find_library(OpenEXR_BASE_LIBRARY_RELEASE NAMES IlmImf-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_BASE_LIBRARY_DEBUG NAMES IlmImf-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_BASE) -endif() - -if(NOT OpenEXR_UTIL_LIBRARY) - find_library(OpenEXR_UTIL_LIBRARY_RELEASE NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_UTIL_LIBRARY_DEBUG NAMES IlmImfUtil-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_UTIL) -endif() - -if(NOT OpenEXR_HALF_LIBRARY) - find_library(OpenEXR_HALF_LIBRARY_RELEASE NAMES Half-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_HALF_LIBRARY_DEBUG NAMES Half-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_HALF) -endif() - -if(NOT OpenEXR_IEX_LIBRARY) - find_library(OpenEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_IEX) -endif() - -if(NOT OpenEXR_MATH_LIBRARY) - find_library(OpenEXR_MATH_LIBRARY_RELEASE NAMES Imath-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_MATH_LIBRARY_DEBUG NAMES Imath-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_MATH) -endif() - -if(NOT OpenEXR_THREAD_LIBRARY) - find_library(OpenEXR_THREAD_LIBRARY_RELEASE NAMES IlmThread-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_THREAD_LIBRARY_DEBUG NAMES IlmThread-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_THREAD) -endif() - -if(NOT OpenEXR_IEXMATH_LIBRARY) - find_library(OpenEXR_IEXMATH_LIBRARY_RELEASE NAMES IexMath-${OpenEXR_LIB_SUFFIX}) - find_library(OpenEXR_IEXMATH_LIBRARY_DEBUG NAMES IexMath-${OpenEXR_LIB_SUFFIX}_d) - select_library_configurations(OpenEXR_IEXMATH) -endif() - -set(OPENEXR_HALF_LIBRARY "${OpenEXR_HALF_LIBRARY}") -set(OPENEXR_Half_LIBRARY "${OpenEXR_HALF_LIBRARY}") -set(OPENEXR_IEX_LIBRARY "${OpenEXR_IEX_LIBRARY}") -set(OPENEXR_Iex_LIBRARY "${OpenEXR_IEX_LIBRARY}") -set(OPENEXR_IMATH_LIBRARY "${OpenEXR_MATH_LIBRARY}") -set(OPENEXR_ILMIMF_LIBRARY "${OpenEXR_BASE_LIBRARY}") -set(OPENEXR_IlmImf_LIBRARY "${OpenEXR_BASE_LIBRARY}") -set(OPENEXR_ILMIMFUTIL_LIBRARY "${OpenEXR_UTIL_LIBRARY}") -set(OPENEXR_ILMTHREAD_LIBRARY "${OpenEXR_THREAD_LIBRARY}") - -set(OpenEXR_LIBRARY "${OpenEXR_BASE_LIBRARY}") - -set(OpenEXR_LIBRARIES - ${OpenEXR_LIBRARY} - ${OpenEXR_MATH_LIBRARY} - ${OpenEXR_IEXMATH_LIBRARY} - ${OpenEXR_UTIL_LIBRARY} - ${OpenEXR_HALF_LIBRARY} - ${OpenEXR_IEX_LIBRARY} - ${OpenEXR_THREAD_LIBRARY} -) - -set(OPENEXR_LIBRARIES - ${OPENEXR_HALF_LIBRARY} - ${OPENEXR_IEX_LIBRARY} - ${OPENEXR_IMATH_LIBRARY} - ${OPENEXR_ILMIMF_LIBRARY} - ${OPENEXR_ILMTHREAD_LIBRARY} -) - -set(OpenEXR_INCLUDE_DIR ${OpenEXR_INCLUDE_DIRS}) -set(OPENEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS}) -set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATHS}) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR REQUIRED_VARS OpenEXR_LIBRARIES OpenEXR_INCLUDE_DIRS) - -if(OpenEXR_FOUND) - set(OPENEXR_FOUND 1) -endif() diff --git a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch b/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch deleted file mode 100644 index 05e86b50c6e4ef..00000000000000 --- a/ports/openexr/fix_clang_not_setting_modern_cplusplus.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/IlmBase/CMakeLists.txt b/IlmBase/CMakeLists.txt -index e13c768..95942c8 100644 ---- a/IlmBase/CMakeLists.txt -+++ b/IlmBase/CMakeLists.txt -@@ -110,7 +110,7 @@ ENDIF () - - IF (OPENEXR_FORCE_CXX03) - FILE ( APPEND ${ILMBASE_TMP_CONFIG} "#define ILMBASE_FORCE_CXX03 1\n" ) --ELSEIF (NOT WIN32) -+ELSEIF (NOT WIN32 AND NOT APPLE) - # really only care about c++11 right now for the threading bits, but this can be changed to 14 - # when needed... - # Note that the __cplusplus check is not valid under MSVC diff --git a/ports/openexr/fix_install_ilmimf.patch b/ports/openexr/fix_install_ilmimf.patch deleted file mode 100644 index db65be73684da1..00000000000000 --- a/ports/openexr/fix_install_ilmimf.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt -index e1a8740..d31cf68 100644 ---- a/OpenEXR/IlmImf/CMakeLists.txt -+++ b/OpenEXR/IlmImf/CMakeLists.txt -@@ -2,14 +2,6 @@ - - SET(CMAKE_INCLUDE_CURRENT_DIR 1) - --IF (WIN32) -- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/bin) -- SET(WORKING_DIR ${RUNTIME_DIR}) --ELSE () -- SET(RUNTIME_DIR ${OPENEXR_PACKAGE_PREFIX}/lib) -- SET(WORKING_DIR .) --ENDIF () -- - SET(BUILD_B44EXPLOGTABLE OFF) - IF (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/b44ExpLogTable.h") - SET(BUILD_B44EXPLOGTABLE ON) diff --git a/ports/openexr/fix_linux_static_library_names.patch b/ports/openexr/fix_linux_static_library_names.patch deleted file mode 100644 index e7a41daa7ee0f2..00000000000000 --- a/ports/openexr/fix_linux_static_library_names.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b06d97e..ad360f8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -53,10 +53,13 @@ endif() - if (WIN32 AND OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_OPENEXR AND OPENEXR_BUILD_SHARED) - # necessary for building dwa lookup tables, and b44log tables on windows - set(BUILD_ILMBASE_STATIC ON) -+ set(OPENEXR_STATIC_SUFFIX "_s") - elseif (OPENEXR_BUILD_ILMBASE AND OPENEXR_BUILD_STATIC) - set(BUILD_ILMBASE_STATIC ON) -+ set(OPENEXR_STATIC_SUFFIX "") - else() - set(BUILD_ILMBASE_STATIC OFF) -+ set(OPENEXR_STATIC_SUFFIX "") - endif() - - if (NOT OPENEXR_BUILD_SHARED) -diff --git a/IlmBase/Half/CMakeLists.txt b/IlmBase/Half/CMakeLists.txt -index 3d24cd7..d92aa67 100644 ---- a/IlmBase/Half/CMakeLists.txt -+++ b/IlmBase/Half/CMakeLists.txt -@@ -60,7 +60,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Half_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Half${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - - ADD_DEPENDENCIES ( Half_static toFloat eLut ) -diff --git a/IlmBase/Iex/CMakeLists.txt b/IlmBase/Iex/CMakeLists.txt -index 847518c..9425430 100644 ---- a/IlmBase/Iex/CMakeLists.txt -+++ b/IlmBase/Iex/CMakeLists.txt -@@ -34,7 +34,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Iex_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF() - -diff --git a/IlmBase/IexMath/CMakeLists.txt b/IlmBase/IexMath/CMakeLists.txt -index 472fd33..1427fa8 100644 ---- a/IlmBase/IexMath/CMakeLists.txt -+++ b/IlmBase/IexMath/CMakeLists.txt -@@ -36,7 +36,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( IexMath_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF( ) - -diff --git a/IlmBase/IlmThread/CMakeLists.txt b/IlmBase/IlmThread/CMakeLists.txt -index 3a24823..b281916 100644 ---- a/IlmBase/IlmThread/CMakeLists.txt -+++ b/IlmBase/IlmThread/CMakeLists.txt -@@ -49,7 +49,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( IlmThread_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF () - -diff --git a/IlmBase/Imath/CMakeLists.txt b/IlmBase/Imath/CMakeLists.txt -index 8faa97a..bf29000 100644 ---- a/IlmBase/Imath/CMakeLists.txt -+++ b/IlmBase/Imath/CMakeLists.txt -@@ -37,7 +37,7 @@ IF (BUILD_ILMBASE_STATIC) - SET_TARGET_PROPERTIES ( Imath_static - PROPERTIES - VERSION ${ILMBASE_VERSION_MAJOR}.${ILMBASE_VERSION_MINOR}.${ILMBASE_VERSION_PATCH} -- OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}_s" -+ OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF () - -diff --git a/OpenEXR/IlmImf/CMakeLists.txt b/OpenEXR/IlmImf/CMakeLists.txt -index d31cf68..52c2b6e 100644 ---- a/OpenEXR/IlmImf/CMakeLists.txt -+++ b/OpenEXR/IlmImf/CMakeLists.txt -@@ -226,7 +226,7 @@ IF (OPENEXR_BUILD_STATIC) - SET_TARGET_PROPERTIES ( IlmImf_static - PROPERTIES - VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} -- OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmImf${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - SET_ILMBASE_INCLUDE_DIRS(IlmImf_static) - -diff --git a/OpenEXR/IlmImfUtil/CMakeLists.txt b/OpenEXR/IlmImfUtil/CMakeLists.txt -index 4cc53de..26df90e 100644 ---- a/OpenEXR/IlmImfUtil/CMakeLists.txt -+++ b/OpenEXR/IlmImfUtil/CMakeLists.txt -@@ -60,7 +60,7 @@ IF ( OPENEXR_BUILD_STATIC ) - PROPERTIES - VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} - SOVERSION ${OPENEXR_SOVERSION} -- OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}_s" -+ OUTPUT_NAME "IlmImfUtil${OPENEXR_LIBSUFFIX}${OPENEXR_STATIC_SUFFIX}" - ) - ENDIF() - diff --git a/ports/openexr/fixup_cmake_exports_path.patch b/ports/openexr/fixup_cmake_exports_path.patch new file mode 100644 index 00000000000000..e39bd3792ff8a7 --- /dev/null +++ b/ports/openexr/fixup_cmake_exports_path.patch @@ -0,0 +1,78 @@ +diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt +index d9c5ae4..45ee6cc 100644 +--- a/IlmBase/config/CMakeLists.txt ++++ b/IlmBase/config/CMakeLists.txt +@@ -105,7 +105,7 @@ endif() + include(CMakePackageConfigHelpers) + configure_package_config_file(IlmBaseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ INSTALL_DESTINATION share/ilmbase + ) + write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${ILMBASE_VERSION} +@@ -113,10 +113,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/ilmbase + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/ilmbase + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES +diff --git a/OpenEXR/config/CMakeLists.txt b/OpenEXR/config/CMakeLists.txt +index b52ad0d..3dc6d22 100644 +--- a/OpenEXR/config/CMakeLists.txt ++++ b/OpenEXR/config/CMakeLists.txt +@@ -19,7 +19,7 @@ int main() + sysconf(_SC_NPROCESSORS_ONLN); + } + " OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN +-) ++) + + check_cxx_source_compiles( + " +@@ -100,7 +100,7 @@ endif() + include(CMakePackageConfigHelpers) + configure_package_config_file(OpenEXRConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ INSTALL_DESTINATION share/openexr + ) + write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${OPENEXR_VERSION} +@@ -108,10 +108,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/openexr + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/openexr + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES +diff --git a/PyIlmBase/config/CMakeLists.txt b/PyIlmBase/config/CMakeLists.txt +index 1872c89..bc61f43 100644 +--- a/PyIlmBase/config/CMakeLists.txt ++++ b/PyIlmBase/config/CMakeLists.txt +@@ -39,10 +39,10 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + COMPATIBILITY SameMajorVersion + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/pyilmbase + ) + install(EXPORT ${PROJECT_NAME} +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ DESTINATION share/pyilmbase + FILE ${PROJECT_NAME}Config.cmake + NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES diff --git a/ports/openexr/portfile.cmake b/ports/openexr/portfile.cmake index 31b0582ed4d780..d73520cea1f9b2 100644 --- a/ports/openexr/portfile.cmake +++ b/ports/openexr/portfile.cmake @@ -1,65 +1,49 @@ -include(vcpkg_common_functions) - if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") message(FATAL_ERROR "UWP build not supported") endif() -set(OPENEXR_VERSION 2.3.0) -set(OPENEXR_HASH 268ae64b40d21d662f405fba97c307dad1456b7d996a447aadafd41b640ca736d4851d9544b4741a94e7b7c335fe6e9d3b16180e710671abfc0c8b2740b147b2) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openexr/openexr - REF v${OPENEXR_VERSION} - SHA512 ${OPENEXR_HASH} + REF ed64d5467dee9763f28baf300f7699e6288b9f5f + SHA512 549d37ed1ef4d1ff7e732d583f7213ee15c7f92625aea9fd65345e4c5b854902c02e5940d0692b1af5ae0a02abf46aaefea2662db2389d1b2fb4264a373baac2 HEAD_REF master PATCHES - fix_clang_not_setting_modern_cplusplus.patch - fix_install_ilmimf.patch - fix_linux_static_library_names.patch + remove_find_package_macro.patch + fixup_cmake_exports_path.patch + remove_symlinks.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENEXR_BUILD_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENEXR_BUILD_SHARED) - vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DOPENEXR_BUILD_PYTHON_LIBS:BOOL=FALSE - -DOPENEXR_BUILD_STATIC=${OPENEXR_BUILD_STATIC} - -DOPENEXR_BUILD_SHARED=${OPENEXR_BUILD_SHARED} - OPTIONS_DEBUG - -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}/debug - OPTIONS_RELEASE - -DILMBASE_PACKAGE_PREFIX=${CURRENT_INSTALLED_DIR}) + -DCMAKE_DEBUG_POSTFIX=_d + -DPYILMBASE_ENABLE=FALSE +) vcpkg_install_cmake() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/ilmbase TARGET_PATH share/ilmbase) +vcpkg_fixup_cmake_targets() + +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) -# NOTE: Only use ".exe" extension on Windows executables. -# Is there a cleaner way to do this? -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(EXECUTABLE_SUFFIX ".exe") -else() - set(EXECUTABLE_SUFFIX "") -endif() -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrenvmap${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrheader${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmakepreview${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmaketiled${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultipart${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrmultiview${EXECUTABLE_SUFFIX}) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/exrstdattr${EXECUTABLE_SUFFIX}) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/openexr/) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${EXECUTABLE_SUFFIX}) -file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrenvmap${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrheader${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmakepreview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmaketiled${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultipart${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrmultiview${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exrstdattr${VCPKG_HOST_EXECUTABLE_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/openexr/exr2aces${VCPKG_HOST_EXECUTABLE_SUFFIX}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openexr) vcpkg_copy_pdbs() @@ -68,6 +52,8 @@ if (VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindOpenEXR.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openexr/remove_find_package_macro.patch b/ports/openexr/remove_find_package_macro.patch new file mode 100644 index 00000000000000..967e89a83c7e3f --- /dev/null +++ b/ports/openexr/remove_find_package_macro.patch @@ -0,0 +1,87 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 111a603..109394f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,22 +25,12 @@ endif() + project(OpenEXRMetaProject) + + +-# An "official" way to make this a super-project +-# basically overrides the find_package to not find anything +-# for stuff we're including locally +-set(as_subproject IlmBase OpenEXR) +-macro(find_package) +- if(NOT "${ARGV0}" IN_LIST as_subproject) +- _find_package(${ARGV}) +- endif() +-endmacro() +- + + # If you want to use ctest to configure, build and + # upload the results, cmake has builtin support for + # submitting to CDash, or any server who speaks the + # same protocol +-# ++# + # These settings will need to be set for your environment, + # and then a script such as the example in + # +@@ -51,7 +41,7 @@ endmacro() + # cmake -S cmake/SampleCTestScript.cmake + # + # [or whatever you name the file you edit] +-# ++# + #set(CTEST_PROJECT_NAME "OpenEXR") + #set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC") + #set(CTEST_DROP_METHOD "http") # there are others... +diff --git a/OpenEXR/CMakeLists.txt b/OpenEXR/CMakeLists.txt +index 390b27f..87b2d01 100644 +--- a/OpenEXR/CMakeLists.txt ++++ b/OpenEXR/CMakeLists.txt +@@ -35,7 +35,6 @@ include(config/OpenEXRSetup.cmake) + + # Everyone depends on IlmBase, and we currently rely on + # the version matched with our release +-find_package(IlmBase ${OPENEXR_VERSION} EXACT REQUIRED CONFIG) + + # generates config headers, package config files + add_subdirectory(config) +diff --git a/OpenEXR/config/OpenEXRSetup.cmake b/OpenEXR/config/OpenEXRSetup.cmake +index 5116726..34c7c87 100644 +--- a/OpenEXR/config/OpenEXRSetup.cmake ++++ b/OpenEXR/config/OpenEXRSetup.cmake +@@ -33,7 +33,7 @@ endif() + # Whether to build & install the various command line utility programs + option(OPENEXR_BUILD_UTILS "Enables building of utility programs" ON) + +-# This is a variable here for use in controlling where include files are ++# This is a variable here for use in controlling where include files are + # installed. Care must be taken when changing this, as many things + # probably assume this is OpenEXR + set(OPENEXR_OUTPUT_SUBDIR OpenEXR CACHE STRING "Destination sub-folder of the include path for install") +diff --git a/OpenEXR_Viewers/CMakeLists.txt b/OpenEXR_Viewers/CMakeLists.txt +index 5efa353..5246fa7 100644 +--- a/OpenEXR_Viewers/CMakeLists.txt ++++ b/OpenEXR_Viewers/CMakeLists.txt +@@ -24,8 +24,6 @@ project(OpenEXR_Viewers VERSION ${OPENEXR_VIEWERS_VERSION}) + ####################################### + include(config/OpenEXRViewersSetup.cmake) + +-find_package(IlmBase ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) +-find_package(OpenEXR ${OPENEXR_VIEWERS_VERSION} EXACT REQUIRED CONFIG) + + # This is for newer cmake versions who know about vendor versions + set(OpenGL_GL_PREFERENCE GLVND) +diff --git a/PyIlmBase/CMakeLists.txt b/PyIlmBase/CMakeLists.txt +index 291b96e..7d5074f 100644 +--- a/PyIlmBase/CMakeLists.txt ++++ b/PyIlmBase/CMakeLists.txt +@@ -27,7 +27,6 @@ project(PyIlmBase VERSION ${PYILMBASE_VERSION} LANGUAGES C CXX) + include(config/PyIlmBaseSetup.cmake) + + # we have a strong dependence on IlmBase being an exact match +-find_package(IlmBase ${PYILMBASE_VERSION} EXACT REQUIRED CONFIG) + + # we are building a python extension, so of course we depend on + # python as well. Except we don't know which version... diff --git a/ports/openexr/remove_symlinks.patch b/ports/openexr/remove_symlinks.patch new file mode 100644 index 00000000000000..89b9c53f3c96fc --- /dev/null +++ b/ports/openexr/remove_symlinks.patch @@ -0,0 +1,40 @@ +diff --git a/IlmBase/config/LibraryDefine.cmake b/IlmBase/config/LibraryDefine.cmake +index 44254a7..1f5d2a6 100644 +--- a/IlmBase/config/LibraryDefine.cmake ++++ b/IlmBase/config/LibraryDefine.cmake +@@ -101,15 +101,6 @@ function(ILMBASE_DEFINE_LIBRARY libname) + if(BUILD_SHARED_LIBS AND (NOT "${ILMBASE_LIB_SUFFIX}" STREQUAL "")) + set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${ILMBASE_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) +- if(WIN32) +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") +- else() +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_LIBDIR} ${baselibname} -> ${verlibname}\")") +- endif() +- set(verlibname) +- set(baselibname) + endif() + + if(ILMBASE_BUILD_BOTH_STATIC_SHARED) +diff --git a/OpenEXR/config/LibraryDefine.cmake b/OpenEXR/config/LibraryDefine.cmake +index a9561dc..42853af 100644 +--- a/OpenEXR/config/LibraryDefine.cmake ++++ b/OpenEXR/config/LibraryDefine.cmake +@@ -95,15 +95,6 @@ function(OPENEXR_DEFINE_LIBRARY libname) + if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "")) + set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX}) +- if(WIN32) +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_BINDIR} ${baselibname} -> ${verlibname}\")") +- else() +- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})") +- install(CODE "message(\"-- Creating symlink in ${CMAKE_INSTALL_FULL_DIR} ${baselibname} -> ${verlibname}\")") +- endif() +- set(verlibname) +- set(baselibname) + endif() + + if(OPENEXR_BUILD_BOTH_STATIC_SHARED) diff --git a/ports/openexr/vcpkg-cmake-wrapper.cmake b/ports/openexr/vcpkg-cmake-wrapper.cmake index a977a420e867d7..479cd302782d11 100644 --- a/ports/openexr/vcpkg-cmake-wrapper.cmake +++ b/ports/openexr/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,38 @@ -set(OPENEXR_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +_find_package(${ARGS}) -if(NOT OpenEXR_LIBRARIES OR OPENEXR_LIBRARIES) - _find_package(${ARGS}) +if(TARGET OpenEXR::IlmImf AND NOT OPENEXR_LIBRARIES AND NOT OPENEXR_FOUND) + set(OPENEXR_FOUND TRUE CACHE BOOL "") + set(OpenEXR_FOUND TRUE CACHE BOOL "") + set(OPENEXR_VERSION "2.5.0" CACHE STRING "") + set(OpenEXR_VERSION "2.5.0" CACHE STRING "") + get_target_property(OpenEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_PATHS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_DIRS OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(OPENEXR_INCLUDE_DIR OpenEXR::IlmImf INTERFACE_INCLUDE_DIRECTORIES) + set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIRS} CACHE STRING "") + set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} CACHE STRING "") + set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIRS} CACHE STRING "") + set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR} CACHE STRING "") + set(OPENEXR_ILMIMF_LIBRARY "OpenEXR::IlmImf" CACHE STRING "") + set(OPENEXR_ILMIMFUTIL_LIBRARY "OpenEXR::IlmImfUtil" CACHE STRING "") + set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMFUTIL_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} CACHE STRING "") endif() -set(CMAKE_MODULE_PATH ${OPENEXR_PREV_MODULE_PATH}) +if(TARGET IlmBase::Half AND NOT ILMBASE_LIBRARIES AND NOT ILMBASE_FOUND) + set(ILMBASE_FOUND TRUE CACHE BOOL "") + set(IlmBASE_FOUND TRUE CACHE BOOL "") + set(ILMBASE_VERSION "2.5.0" CACHE STRING "") + set(IlmBASE_VERSION "2.5.0" CACHE STRING "") + get_target_property(ILMBASE_INCLUDE_DIR IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(ILMBASE_INCLUDE_DIRS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(ILMBASE_INCLUDE_PATHS IlmBase::Half INTERFACE_INCLUDE_DIRECTORIES) + set(ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_DIR} CACHE STRING "") + set(ILMBASE_INCLUDE_DIRS ${ILMBASE_INCLUDE_DIRS} CACHE STRING "") + set(ILMBASE_INCLUDE_PATHS ${ILMBASE_INCLUDE_PATHS} CACHE STRING "") + set(OPENEXR_HALF_LIBRARY "IlmBase::Half" CACHE STRING "") + set(OPENEXR_IEX_LIBRARY "IlmBase::Iex" CACHE STRING "") + set(OPENEXR_IEXMATH_LIBRARY "IlmBase::IexMath" CACHE STRING "") + set(OPENEXR_ILMTHREAD_LIBRARY "IlmBase::IlmThread" CACHE STRING "") + set(OPENEXR_IMATH_LIBRARY "IlmBase::Imath" CACHE STRING "") + set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${OPENEXR_IEXMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "") +endif() diff --git a/ports/openimageio/CONTROL b/ports/openimageio/CONTROL index c68f5cf8aeea2b..3612d396d1a61e 100644 --- a/ports/openimageio/CONTROL +++ b/ports/openimageio/CONTROL @@ -1,8 +1,9 @@ Source: openimageio Version: 2.1.16.0 +Port-Version: 3 Homepage: https://github.com/OpenImageIO/oiio Description: A library for reading and writing images, and a bunch of related classes, utilities, and application -Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt +Build-Depends: libjpeg-turbo, tiff, libpng, libheif, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace, fmt Feature: libraw Build-Depends: libraw diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake index 8e3e90ef84a6fd..f549457afbb5c6 100644 --- a/ports/openimageio/portfile.cmake +++ b/ports/openimageio/portfile.cmake @@ -66,7 +66,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO TARGET_PATH share/OpenImageIO) if ("tools" IN_LIST FEATURES) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/openimageio) @@ -78,8 +78,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO) # Handle copyright file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/openimageio/vcpkg-cmake-wrapper.cmake b/ports/openimageio/vcpkg-cmake-wrapper.cmake index 82dc991f066967..688c83f3cc99d8 100644 --- a/ports/openimageio/vcpkg-cmake-wrapper.cmake +++ b/ports/openimageio/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(OPENIMAGEIO_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT OPENIMAGEIO_LIBRARIES) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${OPENIMAGEIO_PREV_MODULE_PATH}) diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index 0fd7d64a6a0ca2..07afd75f16236e 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,4 +1,17 @@ Source: openjpeg -Version: 2.3.1-1 +Version: 2.3.1 +Port-Version: 2 Homepage: https://github.com/uclouvain/openjpeg Description: JPEG 2000 image library + +Feature: jpwl +Description: Build optional component jpwl + +Feature: mj2 +Description: Build optional component mj2 + +Feature: jpip +Description: Build optional component jpip + +Feature: jp3d +Description: Build optional component jp3d diff --git a/ports/openjpeg/dll.location.patch b/ports/openjpeg/dll.location.patch new file mode 100644 index 00000000000000..bdc77a5427c31d --- /dev/null +++ b/ports/openjpeg/dll.location.patch @@ -0,0 +1,32 @@ +diff --git a/src/lib/openjp3d/CMakeLists.txt b/src/lib/openjp3d/CMakeLists.txt +index b0469af1f..75048ef13 100644 +--- a/src/lib/openjp3d/CMakeLists.txt ++++ b/src/lib/openjp3d/CMakeLists.txt +@@ -34,8 +34,9 @@ endif() + # Install library + install(TARGETS ${OPENJP3D_LIBRARY_NAME} + EXPORT OpenJP3DTargets +- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} +- COMPONENT Libraries ++ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ++ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries + ) + + # Install includes files +diff --git a/src/lib/openmj2/CMakeLists.txt b/src/lib/openmj2/CMakeLists.txt +index 25294b20e..e3acfe8e7 100644 +--- a/src/lib/openmj2/CMakeLists.txt ++++ b/src/lib/openmj2/CMakeLists.txt +@@ -53,8 +53,9 @@ endif() + # Install library + install(TARGETS ${OPENMJ2_LIBRARY_NAME} + EXPORT OpenMJ2Targets +- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} +- COMPONENT Libraries ++ RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries ++ ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries + ) + + # Install includes files diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index 2296734ad1c872..c6d854490fa0c5 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -1,27 +1,65 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO uclouvain/openjpeg REF v2.3.1 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 HEAD_REF master + PATCHES dll.location.patch ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=OFF" + "-DBUILD_STATIC_LIBS=ON") +else() + list(APPEND OPTIONS "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_STATIC_LIBS=OFF") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "jpwl" BUILD_JPWL + "mj2" BUILD_MJ2 + "jpip" BUILD_JPIP + "jp3d" BUILD_JP3D + ) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DBUILD_CODEC:BOOL=OFF + -DBUILD_DOC:BOOL=OFF -DOPENJPEG_INSTALL_PACKAGE_DIR=share/openjpeg -DOPENJPEG_INSTALL_INCLUDE_DIR=include + -DEXECUTABLE_OUTPUT_PATH=tools/${PORT} + -DBUILD_PKGCONFIG_FILES=ON + ${FEATURE_OPTIONS} + ${OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() +if(VCPKG_TARGET_IS_WINDOWS) + # TODO: remove -lm from *.pc files +endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -vcpkg_fixup_cmake_targets() - +set(TOOL_NAMES) +if("jpwl" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_dec_server opj_jpwl_compress opj_jpwl_decompress) +endif() +if("mj2" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_compress opj_decompress opj_dump opj_mj2_compress opj_mj2_decompress opj_mj2_extract opj_mj2_wrap) +endif() +if("jpip" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_jpip_addxml opj_jpip_test opj_jpip_transcode) +endif() +if("jp3d" IN_LIST FEATURES) + list(APPEND TOOL_NAMES opj_jp3d_compress opj_jp3d_decompress) +endif() +if(TOOL_NAMES) + vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) +endif() file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg.h OPENJPEG_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}") @@ -32,7 +70,6 @@ string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}") file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg.h "${OPENJPEG_H}") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openjpeg/LICENSE ${CURRENT_PACKAGES_DIR}/share/openjpeg/copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL index 4da1df53ed4e66..37fe14b0ca97c2 100644 --- a/ports/openmpi/CONTROL +++ b/ports/openmpi/CONTROL @@ -1,5 +1,6 @@ Source: openmpi Version: 4.0.3 +Port-Version: 2 Homepage: https://www.open-mpi.org/ Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers. Supports: !(windows|uwp) diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake index 6dbb01127c78ae..0ef3c3c6a57cd7 100644 --- a/ports/openmpi/portfile.cmake +++ b/ports/openmpi/portfile.cmake @@ -21,6 +21,7 @@ get_filename_component(PERL_PATH ${PERL} DIRECTORY) vcpkg_add_to_path(${PERL_PATH}) vcpkg_configure_make( + COPY_SOURCE SOURCE_PATH ${SOURCE_PATH} OPTIONS --with-hwloc=internal diff --git a/ports/openssl-unix/CMakeLists.txt b/ports/openssl-unix/CMakeLists.txt index 7857058f0a0dd2..c7d7cc32ab8c17 100644 --- a/ports/openssl-unix/CMakeLists.txt +++ b/ports/openssl-unix/CMakeLists.txt @@ -15,6 +15,12 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(PLATFORM darwin64-x86_64-cc) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(PLATFORM BSD-generic64) +elseif(MINGW) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(PLATFORM mingw64) + else() + set(PLATFORM mingw) + endif() else() message(FATAL_ERROR "Unknown platform") endif() @@ -76,10 +82,15 @@ if(BUILD_SHARED_LIBS) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(LIB_EXT dylib) set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT}) + elseif(MINGW) + string(REPLACE "." "_" SHLIB_VERSION "${SHLIB_VERSION}") + set(BIN_EXT dll) + set(LIB_EXT dll.a) else() set(LIB_EXT so) set(LIB_EXTS ${LIB_EXT}.${SHLIB_VERSION}) endif() + list(APPEND BIN_EXTS ${BIN_EXT}) list(APPEND LIB_EXTS ${LIB_EXT}) else() set(SHARED no-shared) @@ -89,6 +100,14 @@ foreach(lib ssl crypto) foreach(ext ${LIB_EXTS}) list(APPEND INSTALL_LIBS "${BUILDDIR}/lib${lib}.${ext}") endforeach() + foreach(ext ${BIN_EXTS}) + # This might be wrong for targets which don't follow this naming scheme, but I'm not aware of any + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}-x64.${ext}") + else() + list(APPEND INSTALL_BINS "${BUILDDIR}/lib${lib}-${SHLIB_VERSION}.${ext}") + endif() + endforeach() endforeach() if(CMAKE_HOST_WIN32) @@ -142,3 +161,7 @@ install( FILES ${INSTALL_LIBS} DESTINATION lib ) +install( + FILES ${INSTALL_BINS} + DESTINATION bin +) \ No newline at end of file diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL index a28775cc22e7a5..01fa5f3f6e8711 100644 --- a/ports/openssl-unix/CONTROL +++ b/ports/openssl-unix/CONTROL @@ -1,4 +1,5 @@ Source: openssl-unix Version: 1.1.1g +Port-Version: 1 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. Supports: !(windows|uwp) diff --git a/ports/openssl-unix/portfile.cmake b/ports/openssl-unix/portfile.cmake index 633cef70d2a2d0..5dd28a6f2c77fd 100644 --- a/ports/openssl-unix/portfile.cmake +++ b/ports/openssl-unix/portfile.cmake @@ -1,4 +1,6 @@ -vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") +if (NOT VCPKG_TARGET_IS_MINGW) + vcpkg_fail_port_install(MESSAGE "${PORT} is only for openssl on Unix-like systems" ON_TARGET "UWP" "Windows") +endif() if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL index e9ea27a427846b..e70ab221cb2bc9 100644 --- a/ports/openssl-windows/CONTROL +++ b/ports/openssl-windows/CONTROL @@ -1,4 +1,5 @@ Source: openssl-windows Version: 1.1.1g +Port-Version: 1 Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. Supports: windows diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index a802c84c509a8c..a4735d1fce9ee4 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -1,9 +1,9 @@ vcpkg_fail_port_install(MESSAGE "${PORT} is only for Windows Desktop" ON_TARGET "UWP" "Linux" "OSX") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + return() endif() vcpkg_find_acquire_program(PERL) @@ -20,8 +20,8 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} ) vcpkg_find_acquire_program(NASM) @@ -32,10 +32,10 @@ vcpkg_find_acquire_program(JOM) set(OPENSSL_SHARED no-shared) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPENSSL_SHARED shared) + set(OPENSSL_SHARED shared) endif() -set(CONFIGURE_COMMAND ${PERL} Configure +set(CONFIGURE_OPTIONS enable-static-engine enable-capieng no-ssl2 @@ -44,6 +44,12 @@ set(CONFIGURE_COMMAND ${PERL} Configure ${OPENSSL_SHARED} ) +if(DEFINED OPENSSL_USE_NOPINSHARED) + set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) +endif() + +set(CONFIGURE_COMMAND ${PERL} Configure ${CONFIGURE_OPTIONS}) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(OPENSSL_ARCH VC-WIN32) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") @@ -170,13 +176,15 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) endif() -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) -string(REPLACE "" "" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" + "" + "" +) -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) -string(REPLACE "# include " "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" + "# include " + "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include " +) vcpkg_copy_pdbs() diff --git a/ports/orocos-kdl/CONTROL b/ports/orocos-kdl/CONTROL index edef89076a3e9c..1270962d769369 100644 --- a/ports/orocos-kdl/CONTROL +++ b/ports/orocos-kdl/CONTROL @@ -1,5 +1,6 @@ Source: orocos-kdl -Version: 1.4-2 +Version: 1.4 +Port-Version: 3 Homepage: https://github.com/orocos/orocos_kinematics_dynamics Description: Kinematics and Dynamics Library Build-Depends: eigen3 diff --git a/ports/orocos-kdl/portfile.cmake b/ports/orocos-kdl/portfile.cmake index f0549d14522524..8044d3ee9d4af7 100644 --- a/ports/orocos-kdl/portfile.cmake +++ b/ports/orocos-kdl/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO orocos/orocos_kinematics_dynamics @@ -20,6 +18,11 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/orocos_kdl/cmake TARGET_PATH share/orocos_kdl) +file(READ ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake _contents) +string(REPLACE "\${CMAKE_CURRENT_LIST_DIR}/../../.." "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") +string(REPLACE "\${_IMPORT_PREFIX}" "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/orocos_kdl/orocos_kdl-config.cmake "${_contents}") + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index 598ec59b1cd107..6a7d856da9c853 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -1,5 +1,5 @@ Source: osg -Version: 3.6.4-3 +Version: 3.6.5 Homepage: https://github.com/openscenegraph/OpenSceneGraph Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. Build-Depends: zlib, fontconfig, boost-asio (!windows), boost-core (!windows), boost-logic (!windows), boost-lexical-cast (!windows), boost-smart-ptr (!windows), boost-tuple (!windows), boost-bind (!windows), freeglut (windows), expat (windows), openimageio (osx) @@ -24,4 +24,4 @@ Feature: packages Description: Set to ON to generate CPack configuration files and packaging targets Feature: docs -Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads \ No newline at end of file +Description: Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index d8c8a846532ac3..332359122441ba 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -1,10 +1,10 @@ -set(OSG_VER 3.6.4) +set(OSG_VER 3.6.5) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openscenegraph/OpenSceneGraph REF OpenSceneGraph-${OSG_VER} - SHA512 7cb34fc279ba62a7d7177d3f065f845c28255688bd29026ffb305346e1bb2e515a22144df233e8a7246ed392044ee3e8b74e51bf655282d33ab27dcaf12f4b19 + SHA512 7002fa30a3bcf6551d2e1050b4ca75a3736013fd190e4f50953717406864da1952deb09f530bc8c5ddf6e4b90204baec7dbc283f497829846d46d561f66feb4b HEAD_REF master PATCHES collada.patch diff --git a/ports/osg/remove-prefix.patch b/ports/osg/remove-prefix.patch index 62b1466c961328..ced94522cdb579 100644 --- a/ports/osg/remove-prefix.patch +++ b/ports/osg/remove-prefix.patch @@ -11,15 +11,6 @@ index bb3be63..356edcd 100644 HANDLE_MSVC_DLL() ENDIF() -@@ -33,7 +33,7 @@ INSTALL( - ) - - IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) -- GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) -+ set(PREFIX "") - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) - ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) diff --git a/src/OpenThreads/win32/CMakeLists.txt b/src/OpenThreads/win32/CMakeLists.txt index 84550bd..0e816f7 100644 --- a/src/OpenThreads/win32/CMakeLists.txt diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 74f1c5875af302..3585c467e3f041 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,4 +1,5 @@ Source: osgearth -Version: 2.10.2-1 +Version: 3.0 +Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping. Build-Depends: osg[plugins] diff --git a/ports/osgearth/RocksDB.patch b/ports/osgearth/RocksDB.patch index 07fd7e6031a11e..c73cdad19b869d 100644 --- a/ports/osgearth/RocksDB.patch +++ b/ports/osgearth/RocksDB.patch @@ -1,84 +1,79 @@ -diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake -index 109b383..8382ed9 100644 ---- a/CMakeModules/FindRocksDB.cmake -+++ b/CMakeModules/FindRocksDB.cmake -@@ -40,5 +40,49 @@ find_package_handle_standard_args(ROCKSDB - "Could NOT find ROCKSDB" - ) - -+if(ROCKSDB_FOUND) -+ FIND_PACKAGE(ZLIB REQUIRED) -+ -+ include(SelectLibraryConfigurations) -+ # Find Snappy library -+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) -+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) -+ select_library_configurations(SNAPPY) -+ find_package_handle_standard_args(SNAPPY -+ FOUND_VAR -+ SNAPPY_FOUND -+ REQUIRED_VARS -+ SNAPPY_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find SNAPPY" -+ ) -+ -+ # Find LZ4 library -+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) -+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) -+ select_library_configurations(LZ4) -+ find_package_handle_standard_args(LZ4 -+ FOUND_VAR -+ LZ4_FOUND -+ REQUIRED_VARS -+ LZ4_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find LZ4" -+ ) -+ -+ # Find ZSTD library -+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) -+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) -+ select_library_configurations(ZSTD) -+ find_package_handle_standard_args(ZSTD -+ FOUND_VAR -+ ZSTD_FOUND -+ REQUIRED_VARS -+ ZSTD_LIBRARY -+ FAIL_MESSAGE -+ "Could NOT find ZSTD_" -+ ) -+endif(ROCKSDB_FOUND) -+ - set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) - set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) -- -- - -diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -index 68ad85d..86bb18a 100644 ---- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt -@@ -16,7 +16,19 @@ SET(TARGET_SRC - RocksDBCacheDriver.cpp - ) - --SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) -+if(SNAPPY_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) -+endif(SNAPPY_FOUND) -+ -+if(LZ4_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) -+endif(LZ4_FOUND) -+ -+if(ZSTD_FOUND) -+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) -+endif(ZSTD_FOUND) -+ -+SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) - - IF(MSVC) - SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) -- -- \ No newline at end of file +diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake +index b0692b0..984d3f2 100644 +--- a/CMakeModules/FindRocksDB.cmake ++++ b/CMakeModules/FindRocksDB.cmake +@@ -39,5 +39,49 @@ find_package_handle_standard_args(ROCKSDB + "Could NOT find ROCKSDB" + ) + ++if(ROCKSDB_FOUND) ++ FIND_PACKAGE(ZLIB REQUIRED) ++ ++ include(SelectLibraryConfigurations) ++ # Find Snappy library ++ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd) ++ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy) ++ select_library_configurations(SNAPPY) ++ find_package_handle_standard_args(SNAPPY ++ FOUND_VAR ++ SNAPPY_FOUND ++ REQUIRED_VARS ++ SNAPPY_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find SNAPPY" ++ ) ++ ++ # Find LZ4 library ++ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d) ++ find_library(LZ4_LIBRARY_RELEASE NAMES lz4) ++ select_library_configurations(LZ4) ++ find_package_handle_standard_args(LZ4 ++ FOUND_VAR ++ LZ4_FOUND ++ REQUIRED_VARS ++ LZ4_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find LZ4" ++ ) ++ ++ # Find ZSTD library ++ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd) ++ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd) ++ select_library_configurations(ZSTD) ++ find_package_handle_standard_args(ZSTD ++ FOUND_VAR ++ ZSTD_FOUND ++ REQUIRED_VARS ++ ZSTD_LIBRARY ++ FAIL_MESSAGE ++ "Could NOT find ZSTD_" ++ ) ++endif(ROCKSDB_FOUND) ++ + set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} ) + set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY}) +diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +index ecaac34..b4ec764 100644 +--- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt ++++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt +@@ -34,7 +34,19 @@ IF(ROCKSDB_FOUND OR RocksDB_FOUND) + RocksDBCacheDriver.cpp + ) + +- SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY) ++ if(SNAPPY_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY}) ++ endif(SNAPPY_FOUND) ++ ++ if(LZ4_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY}) ++ endif(LZ4_FOUND) ++ ++ if(ZSTD_FOUND) ++ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY}) ++ endif(ZSTD_FOUND) ++ ++ SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY) + + IF(MSVC) + SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi) diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 8f74dea63c421c..3be639cb46b314 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) file(GLOB OSG_PLUGINS_SUBDIR ${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*) @@ -12,11 +10,11 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OS vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gwaldron/osgearth - REF osgearth-2.10.2 - SHA512 fa306a82374716dafae9d834ed0fb07a7369ae0961696de36b6e2af45bc150040295985d9b9781ab713fd0707691451a6a8f173b34253749ab22764f51e60045 + REF 90ad04f281cbc87ffc45bed847ebaaecb188e593 #version 3.0 + SHA512 d1d59ae65cb4ef8a71e01b42411029e61bef20e2fd6d95b81c091d7d32b8c30f96d3156d7fd28e177ca83fd74ed113b9e31bf5ef360757524beb7cec7ced4996 HEAD_REF master PATCHES - RocksDB.patch + RocksDB.patch ) vcpkg_configure_cmake( @@ -27,7 +25,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() #Release -set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/osgearth) +set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT}) set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH}) @@ -45,7 +43,7 @@ file(REMOVE_RECURSE ${OSGDB_PLUGINS}) #Debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/osgearth) +set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}) set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}) file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH}) @@ -62,5 +60,4 @@ file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS}) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osgearth) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/osgearth/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osgearth/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/outcome/CONTROL b/ports/outcome/CONTROL index a90346b67e6d8e..449485ed9611fc 100644 --- a/ports/outcome/CONTROL +++ b/ports/outcome/CONTROL @@ -1,4 +1,4 @@ Source: outcome -Version: 2.1 +Version: 2.1.3 Homepage: https://github.com/ned14/outcome -Description: Provides very lightweight outcome and result (non-Boost edition) \ No newline at end of file +Description: Provides very lightweight outcome and result (non-Boost edition) diff --git a/ports/outcome/portfile.cmake b/ports/outcome/portfile.cmake index a9686b31c1e8f1..0d1223fc74a3d4 100644 --- a/ports/outcome/portfile.cmake +++ b/ports/outcome/portfile.cmake @@ -1,16 +1,13 @@ -# single header file - -include(vcpkg_common_functions) - +# header-only library vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ned14/outcome - REF 525478ed519d7c3400d60110649c315d705a07ad #v2.1 - SHA512 cf05f7c09ced02fa5fe3d9ad6533358a2fb63e31b5d5be81c16c285250cd275467217b8f9364b4ff1947d8c4aa6a86e10cef310d8475dcd9f7a0a713f1a01c8e + REF 34f3bd55e2bcaf246cb79efe64a5600e89b91b66 #v2.1.3 + SHA512 83eba50e2095e7c768dacb3af5f82db117c3451f1d5bc2f73d716608d56f7b73006ec33d0f3842fdefd076f0e82b72ece5777868712f75e83eac93aa8adf351c HEAD_REF develop ) file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") -file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt index 5fdd730ba79ee4..127b92319c7dce 100644 --- a/ports/pango/CMakeLists.txt +++ b/ports/pango/CMakeLists.txt @@ -49,11 +49,7 @@ find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARY fontconfig) # find freetype -find_path(FREETYPE_INCLUDE_DIR ft2build.h) -if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(FT_SUFFIX d) -endif() -find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) +find_package(Freetype REQUIRED) # find harfbuzz find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) @@ -65,7 +61,7 @@ if (APPLE) endif() set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) -set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) +set(FONT_LIBRARIES Freetype::Freetype ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) macro(pango_add_module MODULE_NAME) add_library(${MODULE_NAME} ${ARGN}) diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL index 2e1d6679e44832..cea8f146423d8e 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -1,5 +1,6 @@ Source: pango -Version: 1.40.11-7 +Version: 1.40.11 +Port-Version: 8 Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ Description: Text and font handling library. Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/pangolin/CONTROL b/ports/pangolin/CONTROL index 8963cc26bbe352..8fb88660e8de8b 100644 --- a/ports/pangolin/CONTROL +++ b/ports/pangolin/CONTROL @@ -1,5 +1,7 @@ Source: pangolin -Version: 0.5-7 +Version: 0.5 +Port-Version: 9 Build-Depends: eigen3, glew, libpng, libjpeg-turbo, ffmpeg Homepage: https://github.com/stevenlovegrove/Pangolin Description: Lightweight GUI Library +Supports: !uwp & !osx & !(windows&static) diff --git a/ports/pangolin/fix-dependency-python.patch b/ports/pangolin/fix-dependency-python.patch new file mode 100644 index 00000000000000..67eae1288cf54a --- /dev/null +++ b/ports/pangolin/fix-dependency-python.patch @@ -0,0 +1,14 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7f364a7..9e0baac 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -213,6 +213,9 @@ endif() + find_package(PythonLibs QUIET) + if(BUILD_PANGOLIN_GUI AND BUILD_PANGOLIN_VARS AND PYTHONLIBS_FOUND AND NOT _WIN_) + set(HAVE_PYTHON 1) ++ if (UNIX) ++ set(PYTHON_LIBRARY ${PYTHON_LIBRARY} dl util) ++ endif() + list(APPEND HEADERS + ${INCDIR}/console/ConsoleInterpreter.h + ${INCDIR}/console/ConsoleView.h diff --git a/ports/pangolin/fix-dependeny-ffmpeg.patch b/ports/pangolin/fix-dependeny-ffmpeg.patch new file mode 100644 index 00000000000000..2c52bb710c3755 --- /dev/null +++ b/ports/pangolin/fix-dependeny-ffmpeg.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeModules/FindFFMPEG.cmake b/CMakeModules/FindFFMPEG.cmake +index 4f77e5a..151762f 100644 +--- a/CMakeModules/FindFFMPEG.cmake ++++ b/CMakeModules/FindFFMPEG.cmake +@@ -21,6 +21,14 @@ FIND_PATH( + SWSCALE_INCLUDE_DIR libswscale/swscale.h + /usr/include /usr/local/include /opt/local/include + ) ++FIND_PATH( ++ AVDEVICE_INCLUDE_DIR libavdevice/avdevice.h ++ /usr/include /usr/local/include /opt/local/include ++) ++FIND_PATH( ++ SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h ++ /usr/include /usr/local/include /opt/local/include ++) + + # Find Library files + FIND_LIBRARY( +@@ -43,15 +51,28 @@ FIND_LIBRARY( + NAMES swscale + PATH /usr/lib /usr/local/lib /opt/local/lib + ) ++FIND_LIBRARY( ++ AVDEVICE_LIBRARY ++ NAMES avdevice ++ PATH /usr/lib /usr/local/lib /opt/local/lib ++) ++FIND_LIBRARY( ++ SWRESAMPLE_LIBRARY ++ NAMES swresample ++ PATH /usr/lib /usr/local/lib /opt/local/lib ++) + + IF( EXISTS "${AVUTIL_INCLUDE_DIR}/libavutil/pixdesc.h" ) + SET( AVUTIL_HAVE_PIXDESC TRUE) + endif() + + IF(AVCODEC_INCLUDE_DIR AND AVFORMAT_INCLUDE_DIR AND AVUTIL_INCLUDE_DIR AND SWSCALE_INCLUDE_DIR AND AVCODEC_LIBRARY AND AVFORMAT_LIBRARY AND AVUTIL_LIBRARY AND SWSCALE_LIBRARY AND AVUTIL_HAVE_PIXDESC) ++ IF (WIN32) ++ SET(AVFORMAT_LIBRARY ${AVFORMAT_LIBRARY} Ws2_32 Secur32 Bcrypt) ++ ENDIF() + SET(FFMPEG_FOUND TRUE) +- SET(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY}) +- SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR}) ++ SET(FFMPEG_LIBRARIES ${AVFORMAT_LIBRARY} ${AVDEVICE_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} ${SWRESAMPLE_LIBRARY}) ++ SET(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWSCALE_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR}) + + include(CheckCXXSourceCompiles) + diff --git a/ports/pangolin/portfile.cmake b/ports/pangolin/portfile.cmake index e22672ec00dd55..4f48fc1c66beca 100644 --- a/ports/pangolin/portfile.cmake +++ b/ports/pangolin/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -11,6 +9,8 @@ vcpkg_from_github( PATCHES deprecated_constants.patch # Change from upstream pangolin to address build failures from latest ffmpeg library fix-includepath-error.patch # include path has one more ../ + fix-dependeny-ffmpeg.patch + fix-dependency-python.patch ) file(REMOVE ${SOURCE_PATH}/CMakeModules/FindGLEW.cmake) @@ -33,7 +33,9 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Pangolin) vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(GLOB EXE ${CURRENT_PACKAGES_DIR}/lib/*.dll) file(COPY ${EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE ${EXE}) @@ -42,21 +44,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(COPY ${DEBUG_EXE} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) file(REMOVE ${DEBUG_EXE}) - file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake PANGOLIN_TARGETS) - string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake "${PANGOLIN_TARGETS}") - - file(READ ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake PANGOLIN_TARGETS) - string(REPLACE "lib/pangolin.dll" "bin/pangolin.dll" PANGOLIN_TARGETS "${PANGOLIN_TARGETS}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake "${PANGOLIN_TARGETS}") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-debug.cmake + "lib/pangolin.dll" "bin/pangolin.dll" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/pangolin/PangolinTargets-release.cmake + "lib/pangolin.dll" "bin/pangolin.dll" + ) + + # Copy missing header file + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# Copy missing header file -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/include/pangolin/pangolin_export.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/pangolin) - # Put the license file where vcpkg expects it -file(COPY ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) -file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/Pangolin/) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/Pangolin/LICENCE ${CURRENT_PACKAGES_DIR}/share/Pangolin/copyright) +file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/) +file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/paraview/CONTROL b/ports/paraview/CONTROL index 56aa3cbaadfa49..d40b55adc6282a 100644 --- a/ports/paraview/CONTROL +++ b/ports/paraview/CONTROL @@ -1,8 +1,9 @@ Source: paraview -Version: 5.8.0-2 +Version: 5.8.0 +Port-Version: 3 Homepage: https://www.paraview.org/ Description: VTK-based Data Analysis and Visualization Application -Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm, embree3(linux) +Build-Depends: vtk[core,paraview], protobuf, cgns, boost-core, boost-format, boost-algorithm Feature: vtkm Description: enables vtkm for the build of paraview diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index 84f1d1aab2cc53..ab64ef34af2c8f 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -1,9 +1,5 @@ set(VERSION 5.8) -if ("tools" IN_LIST FEATURES AND VCPKG_TARGET_IS_OSX) - mesage(FATAL_ERROR "Feature tools are currently not supported.") -endif() - vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "cuda" PARAVIEW_USE_CUDA #untested; probably only affects internal VTK build so it does nothing here "all_modules" PARAVIEW_BUILD_ALL_MODULES #untested @@ -65,13 +61,9 @@ if("python" IN_LIST FEATURES) -DPython3_FIND_REGISTRY=NEVER "-DPython3_EXECUTABLE:PATH=${PYTHON3}" # Required by more than one feature ) - #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages endif() -string(APPEND VCPKG_C_FLAGS " -DH5_USE_110_API") -string(APPEND VCPKG_CXX_FLAGS " -DH5_USE_110_API") - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja @@ -82,15 +74,15 @@ vcpkg_configure_cmake( -DVTK_MODULE_ENABLE_ParaView_qttesting=YES -DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF -DPARAVIEW_USE_QTHELP:BOOL=OFF - + #A little bit of help in finding the boost headers "-DBoost_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include" - + # Workarounds for CMake issues -DHAVE_SYS_TYPES_H=0 ## For some strange reason the test first succeeds and then fails the second time around -DWORDS_BIGENDIAN=0 ## Tests fails in VisItCommon.cmake for some unknown reason this is just a workaround since most systems are little endian. ${ADDITIONAL_OPTIONS} - + #-DPARAVIEW_ENABLE_FFMPEG:BOOL=OFF ) if(CMAKE_HOST_UNIX) @@ -120,7 +112,7 @@ set(TOOLS paraview smTestDriver vtkProcessXML vtkWrapClientServer) - + foreach(tool ${TOOLS}) # Remove debug tools set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}) diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL index 1577832fd66730..e7f0cc3c06c3e1 100644 --- a/ports/pbc/CONTROL +++ b/ports/pbc/CONTROL @@ -1,6 +1,7 @@ Source: pbc -Version: 0.5.14-2 -Build-Depends: mpir (windows) +Version: 0.5.14 +Port-Version: 4 +Build-Depends: mpir (windows), gmp (!windows) Homepage: https://crypto.stanford.edu/pbc Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems. -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/ports/pbc/portfile.cmake b/ports/pbc/portfile.cmake index 3f47fa56ea3fde..93b06c5dbe090f 100644 --- a/ports/pbc/portfile.cmake +++ b/ports/pbc/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP") set(PBC_VERSION 0.5.14) -if(VCPKG_CMAKE_SYSTEM_NAME) +if(NOT VCPKG_TARGET_IS_WINDOWS) vcpkg_download_distfile( ARCHIVE URLS "https://crypto.stanford.edu/pbc/files/pbc-${PBC_VERSION}.tar.gz" @@ -27,45 +27,16 @@ if(VCPKG_CMAKE_SYSTEM_NAME) endif() set(OPTIONS ${SHARED_STATIC} LEX=${FLEX} YACC=${BISON}\ -y) - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/setup - WORKING_DIRECTORY ${SOURCE_PATH} - LOGNAME setup-${TARGET_TRIPLET} - ) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g -I${SOURCE_PATH}/include") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME configure-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Building ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME install-${TARGET_TRIPLET}-dbg + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + COPY_SOURCE + OPTIONS + ${OPTIONS} ) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O3 -I${SOURCE_PATH}/include") - set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") - vcpkg_execute_required_process( - COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME configure-${TARGET_TRIPLET}-rel - ) - message(STATUS "Building ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND make -j install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME install-${TARGET_TRIPLET}-rel - ) + vcpkg_install_make() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index a36dec4e8298a5..cbd70b86927bb0 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,5 +1,5 @@ Source: pcre Version: 8.44 -Port-Version: 5 +Port-Version: 7 Homepage: https://www.pcre.org/ Description: Perl Compatible Regular Expressions diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index fe989d66013df8..6175b0bbb1f43c 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -73,44 +73,46 @@ if(VCPKG_TARGET_IS_LINUX) # Used here in .pc.in files: Libs.private: @PTHREAD_CFLAGS@ set(PTHREAD_CFLAGS "-pthread") endif() - -configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) - +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + + configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre16.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcre32.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcrecpp.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpcreposix.pc" @ONLY) +endif() # debug set(prefix "${CURRENT_INSTALLED_DIR}/debug") set(exec_prefix "\${prefix}") set(libdir "\${prefix}/lib") set(includedir "\${prefix}/../include") +if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) + configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre16.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcre32.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcrecpp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc" @ONLY) -configure_file("${SOURCE_PATH}/libpcreposix.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc" @ONLY) - -if(VCPKG_TARGET_IS_WINDOWS) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc LIBPCRE.PC) - string(REPLACE "-lpcre" "-lpcred" LIBPCRE.PC ${LIBPCRE.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc ${LIBPCRE.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc LIBPCRE16.PC) - string(REPLACE "-lpcre16" "-lpcre16d" LIBPCRE16.PC ${LIBPCRE16.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc ${LIBPCRE16.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc LIBPCRE32.PC) - string(REPLACE "-lpcre32" "-lpcre32d" LIBPCRE32.PC ${LIBPCRE32.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc ${LIBPCRE32.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc LIBPCRECPP.PC) - string(REPLACE "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" LIBPCRECPP.PC ${LIBPCRECPP.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc ${LIBPCRECPP.PC}) - file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc LIBPCREPOSIX.PC) - string(REPLACE "-lpcreposix" "-lpcreposixd" LIBPCREPOSIX.PC ${LIBPCREPOSIX.PC}) - file(WRITE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc ${LIBPCREPOSIX.PC}) + if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre.pc + "-lpcre" "-lpcred" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre16.pc + "-lpcre16" "-lpcre16d" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcre32.pc + "-lpcre32" "-lpcre32d" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcrecpp.pc + "-lpcre -lpcrecpp" "-lpcred -lpcrecppd" + ) + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libpcreposix.pc + "-lpcreposix" "-lpcreposixd" + ) + endif() endif() -vcpkg_fixup_pkgconfig() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/physx/CONTROL b/ports/physx/CONTROL index c744a2ae36c38d..7b8c12c2a8db7f 100644 --- a/ports/physx/CONTROL +++ b/ports/physx/CONTROL @@ -1,4 +1,5 @@ Source: physx -Version: 4.1.1-3 +Version: 4.1.1 +Port-Version: 5 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 Supports: !uwp diff --git a/ports/physx/internalMBP_symbols.patch b/ports/physx/internalMBP_symbols.patch new file mode 100644 index 00000000000000..a74e2eaab79199 --- /dev/null +++ b/ports/physx/internalMBP_symbols.patch @@ -0,0 +1,49 @@ +diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp +index f19ba271..51580049 100644 +--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp ++++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp +@@ -90,6 +90,8 @@ using namespace Cm; + return ir; + }*/ + ++namespace internalMBP { ++ + struct RegionHandle : public Ps::UserAllocated + { + PxU16 mHandle; // Handle from region +@@ -582,6 +584,10 @@ struct RegionData : public Ps::UserAllocated + #endif + #endif + ++} ++ ++using namespace internalMBP; ++ + /////////////////////////////////////////////////////////////////////////////// + + MBP_PairManager::MBP_PairManager() : +diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h +index cf15f6d3..90f43e47 100644 +--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h ++++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h +@@ -35,8 +35,10 @@ + #include "BpBroadPhaseMBPCommon.h" + #include "BpMBPTasks.h" + ++namespace internalMBP { + class MBP; +- ++} ++ + namespace physx + { + namespace Bp +@@ -84,7 +86,7 @@ namespace Bp + MBPUpdateWorkTask mMBPUpdateWorkTask; + MBPPostUpdateWorkTask mMBPPostUpdateWorkTask; + +- MBP* mMBP; // PT: TODO: aggregate ++ internalMBP::MBP* mMBP; // PT: TODO: aggregate + + MBP_Handle* mMapping; + PxU32 mCapacity; diff --git a/ports/physx/portfile.cmake b/ports/physx/portfile.cmake index c77b18773dc178..2dcb5bdc1e0d36 100644 --- a/ports/physx/portfile.cmake +++ b/ports/physx/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(SYSTEM_PLATFORM "32") set(SYSTEM_PLATFORM_PATH "x86_32") @@ -13,30 +11,30 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(SYSTEM_PLATFORM "arm64") set(SYSTEM_PLATFORM_PATH "arm_64") else() - message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(GENERATE_STATIC_LIBRARIES "True") elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(GENERATE_STATIC_LIBRARIES "False") + set(GENERATE_STATIC_LIBRARIES "False") endif() -if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(MSBUILD_PLATFORM "Win32") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(MSBUILD_PLATFORM "x64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + elseif(VCPKG_TARGET_IS_UWP) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") set(MSBUILD_PLATFORM "ARM") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(MSBUILD_PLATFORM "ARM64") else() - message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() else() - message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") + message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}") endif() if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140") @@ -56,7 +54,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL set(BUILD_SNIPPETS "False") set(BUILD_PUBLIC_SAMPLES "False") - if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "") + if(VCPKG_TARGET_IS_WINDOWS) set(SYSTEM "win") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") set(USE_STATIC_WINCRT "False") @@ -69,7 +67,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL set(COMPILER "vc${MSVC_VERSION}${SYSTEM}${SYSTEM_PLATFORM}") set(PRESET_FILE ${COMPILER}-${RUNTIME_LIBRARY_LINKAGE}-${VCPKG_LIBRARY_LINKAGE}) set(BUILD_PATH "${SYSTEM}.${SYSTEM_PLATFORM_PATH}.vc${TOOLSET_VERSION}.${RUNTIME_LIBRARY_LINKAGE}") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + elseif(VCPKG_TARGET_IS_UWP) set(SYSTEM "uwp") set(USE_STATIC_WINCRT "False") set(USE_DEBUG_CRT "False") @@ -87,9 +85,10 @@ vcpkg_from_github( REF ae80dede0546d652040ae6260a810e53e20a06fa SHA512 f3a690039cf39fe2db9a728b82af0d39eaa02340a853bdad4b5152d63532367eb24fc7033a614882168049b80d803b6225fc60ed2900a9d0deab847f220540be HEAD_REF master - PATCHES - msvc_142_bug_workaround.patch - vs16_3_typeinfo_header_fix.patch + PATCHES + internalMBP_symbols.patch + msvc_142_bug_workaround.patch + vs16_3_typeinfo_header_fix.patch ) file(REMOVE ${SOURCE_PATH}/physx/buildtools/presets/public/${PRESET_FILE}.xml) @@ -110,14 +109,16 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET} ) -set(RELEASE_CONFIGURATION "release") +if(NOT DEFINED RELEASE_CONFIGURATION) + set(RELEASE_CONFIGURATION "release") +endif() set(DEBUG_CONFIGURATION "debug") vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln + PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION} DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION} - PLATFORM ${MSBUILD_PLATFORM} + PLATFORM ${MSBUILD_PLATFORM} ) file(INSTALL ${SOURCE_PATH}/physx/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}/) @@ -136,9 +137,9 @@ endif() file( GLOB RELEASE_LIBS - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib - ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb - ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib + ${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb + ${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb ) file(INSTALL ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) diff --git a/ports/pngpp/portfile.cmake b/ports/pngpp/portfile.cmake new file mode 100644 index 00000000000000..1fa23e4445ab07 --- /dev/null +++ b/ports/pngpp/portfile.cmake @@ -0,0 +1,15 @@ +# Header only library +vcpkg_download_distfile(ARCHIVE + URLS "http://download.savannah.nongnu.org/releases/pngpp/png++-0.2.10.tar.gz" + FILENAME "png++-0.2.10.tar.gz" + SHA512 c54a74c0c20212bd0dcf86386c0c11dd824ad14952917ba0ff4c184b6547744458728a4f06018371acb7d5b842b641708914ccaa81bad8e72e173903f494ca85 +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} +) + +file(GLOB HEADER_FILES ${SOURCE_PATH}/*.hpp) +file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/png++) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/pngpp/vcpkg.json b/ports/pngpp/vcpkg.json new file mode 100644 index 00000000000000..67312ef2f9f1dd --- /dev/null +++ b/ports/pngpp/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "pngpp", + "version-string": "0.2.10", + "description": "A C++ wrapper for libpng library.", + "dependencies": [ + "libpng" + ] +} diff --git a/ports/podofo/CONTROL b/ports/podofo/CONTROL index a6965d832de761..933f7363fc410d 100644 --- a/ports/podofo/CONTROL +++ b/ports/podofo/CONTROL @@ -1,5 +1,6 @@ Source: podofo -Version: 0.9.6-11 +Version: 0.9.6 +Port-Version: 12 Homepage: https://sourceforge.net/projects/podofo/ Description: PoDoFo is a library to work with the PDF file format Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openssl, freetype diff --git a/ports/podofo/freetype.patch b/ports/podofo/freetype.patch new file mode 100644 index 00000000000000..f241690f719136 --- /dev/null +++ b/ports/podofo/freetype.patch @@ -0,0 +1,18 @@ +diff --git a/cmake/modules/FindFREETYPE.cmake b/cmake/modules/FindFREETYPE.cmake +index 41114798f..0911dc092 100644 +--- a/cmake/modules/FindFREETYPE.cmake ++++ b/cmake/modules/FindFREETYPE.cmake +@@ -15,9 +15,13 @@ SET(FREETYPE_FIND_QUIETLY 1) + # first we try to find ft2build.h in the new location as + # of freetype 2.5.1 + FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h ++ PATHS + /usr/include/freetype2 + /usr/local/include/freetype2 + /usr/X11/include/freetype2 ++ PATH_SUFFIXES ++ freetype2 ++ include/freetype2 + NO_CMAKE_SYSTEM_PATH + ) + diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake index d9b34614a8c2e6..36bd2c48e4cd50 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_sourceforge( PATCHES 0001-unique_ptr.patch 0002-HAVE_UNISTD_H.patch + freetype.patch ${ADDITIONAL_PATCH} ) diff --git a/ports/polyhook2/CONTROL b/ports/polyhook2/CONTROL index d867d5ebaa666e..924ea7e2a5f38b 100644 --- a/ports/polyhook2/CONTROL +++ b/ports/polyhook2/CONTROL @@ -1,5 +1,5 @@ Source: polyhook2 -Version: 2020-07-01 +Version: 2020-08-04 Homepage: https://github.com/stevemk14ebr/PolyHook_2_0 Description: C++17, x86/x64 Hooking Libary v2.0 Supports: !(arm|uwp|linux|osx) diff --git a/ports/polyhook2/portfile.cmake b/ports/polyhook2/portfile.cmake index 93e1ead79a6c22..267945d2046cb1 100644 --- a/ports/polyhook2/portfile.cmake +++ b/ports/polyhook2/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "Linux" "OSX" "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stevemk14ebr/PolyHook_2_0 - REF d8d0eb9b0932783f7d6be2d96e4d2c8adbf08c4b - SHA512 4e08614818dac648596118c62c38b36f88b39bd7c299cdbb44604249b3d7201541dcb64e926e3f5a92327603342f8393e4c7c84feda37e9f4250a5bf06ab2473 + REF 69fa86df9ae125617ac660b2d6ae2920c69194d9 + SHA512 822c6f07106b5264ab0fe6608875e18ff85572e4316f9bf90be9c68a2c0ed2c4a8f1d1b9fd497d8adf8420c1c9cc34ff46f2e8848f128e37491a86212ed14dc9 HEAD_REF master ) diff --git a/ports/proj4/CONTROL b/ports/proj4/CONTROL index 523e449a1e018e..ef83912c6408fc 100644 --- a/ports/proj4/CONTROL +++ b/ports/proj4/CONTROL @@ -1,5 +1,6 @@ Source: proj4 -Version: 6.3.1-1 +Version: 6.3.1 +Port-Version: 2 Homepage: https://github.com/OSGeo/PROJ Description: PROJ.4 library for cartographic projections Build-Depends: sqlite3[core] @@ -7,4 +8,4 @@ Default-Features: database Feature: database Build-Depends: sqlite3[tool] (!uwp&!arm) -Description: generate database \ No newline at end of file +Description: generate database diff --git a/ports/proj4/fix-sqlite-dependency-export.patch b/ports/proj4/fix-sqlite-dependency-export.patch index 774d1acfdd28e0..06ea71c79ba9a3 100644 --- a/ports/proj4/fix-sqlite-dependency-export.patch +++ b/ports/proj4/fix-sqlite-dependency-export.patch @@ -7,7 +7,7 @@ index 2e90f98f..dc171e91 100644 include_directories(${SQLITE3_INCLUDE_DIR}) -target_link_libraries(${PROJ_CORE_TARGET} ${SQLITE3_LIBRARY}) -+target_link_libraries(${PROJ_CORE_TARGET} PUBLIC ${SQLITE3_LIBRARY}) ++target_link_libraries(${PROJ_CORE_TARGET} PRIVATE ${SQLITE3_LIBRARY}) if(MSVC AND BUILD_LIBPROJ_SHARED) target_compile_definitions(${PROJ_CORE_TARGET} diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index be633ef0ce6a00..b669bfd729df40 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( fix-win-output-name.patch fix-sqlite-dependency-export.patch fix-linux-build.patch + use-sqlite3-config.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") diff --git a/ports/proj4/use-sqlite3-config.patch b/ports/proj4/use-sqlite3-config.patch new file mode 100644 index 00000000000000..050a88415eab8a --- /dev/null +++ b/ports/proj4/use-sqlite3-config.patch @@ -0,0 +1,57 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c617912..bed0428 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,23 @@ if(NOT EXE_SQLITE3) + message(SEND_ERROR "sqlite3 binary not found!") + endif() + +-find_package(Sqlite3 REQUIRED) ++#find_package(Sqlite3 REQUIRED) ++find_package(unofficial-sqlite3 CONFIG REQUIRED) ++if(unofficial-sqlite3_FOUND) ++ set(SQLITE3_FOUND true) ++ get_target_property(SQLITE3_INCLUDE_DIR unofficial::sqlite3::sqlite3 INTERFACE_INCLUDE_DIRECTORIES) ++ set(SQLITE3_LIBRARY unofficial::sqlite3::sqlite3) ++ # Extract version information from the header file ++ if(SQLITE3_INCLUDE_DIR) ++ file(STRINGS ${SQLITE3_INCLUDE_DIR}/sqlite3.h _ver_line ++ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" ++ LIMIT_COUNT 1) ++ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" ++ SQLITE3_VERSION "${_ver_line}") ++ unset(_ver_line) ++ endif() ++endif() ++ + if(NOT SQLITE3_FOUND) + message(SEND_ERROR "sqlite3 dependency not found!") + endif() +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 92197c8..ab65de7 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -25,6 +25,10 @@ else () + endif () + + string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER) ++set(FIND_DEPENDENCY_SQLITE3 "") ++if(NOT BUILD_LIBPROJ_SHARED) ++ set(FIND_DEPENDENCY_SQLITE3 "find_package(unofficial-sqlite3 CONFIG REQUIRED)") ++endif() + configure_file(project-config.cmake.in project-config.cmake @ONLY) + configure_file(project-config-version.cmake.in + project-config-version.cmake @ONLY) +diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in +index 9a52b3b..295d95d 100644 +--- a/cmake/project-config.cmake.in ++++ b/cmake/project-config.cmake.in +@@ -13,6 +13,8 @@ message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}") + message (STATUS + "@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}") + ++@FIND_DEPENDENCY_SQLITE3@ ++ + # Tell the user project where to find our headers and libraries + get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE) diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 2daa1ecaa17339..3b2a541bc031d6 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,5 +1,6 @@ Source: protobuf Version: 3.12.3 +Port-Version: 2 Homepage: https://github.com/google/protobuf Description: Protocol Buffers - Google's data interchange format diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index f8610470ac6b86..3b8f806cf2b493 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_from_github( if(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "x86") set(protobuf_BUILD_PROTOC_BINARIES OFF) -elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME) +elseif(CMAKE_HOST_WIN32 AND NOT VCPKG_TARGET_IS_MINGW AND NOT (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)) set(protobuf_BUILD_PROTOC_BINARIES OFF) else() set(protobuf_BUILD_PROTOC_BINARIES ON) @@ -90,8 +90,7 @@ protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) if(CMAKE_HOST_WIN32) if(protobuf_BUILD_PROTOC_BINARIES) - file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tools(TOOL_NAMES protoc) else() file(COPY ${CURRENT_INSTALLED_DIR}/../x86-windows/tools/${PORT} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() @@ -122,3 +121,15 @@ endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() +set(packages protobuf protobuf-lite) +foreach(_package IN LISTS packages) + set(_file ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${_package}.pc) + if(EXISTS "${_file}") + vcpkg_replace_string(${_file} "-l${_package}" "-l${_package}d") + endif() +endforeach() + +if(NOT VCPKG_TARGET_IS_WINDOWS) + set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) +endif() +vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 4788f4b3852d6c..28247c42d506bc 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,8 +1,9 @@ Source: qt5-base Version: 5.15.0 +Port-Version: 2 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. -Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) +Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) Feature: latest Description: Build latest qt version (5.15.0) instead of LTS (latest and LTS are currently the same) diff --git a/ports/qt5-base/cmake/install_qt.cmake b/ports/qt5-base/cmake/install_qt.cmake index a188138f499c7b..97f2e71a20e920 100644 --- a/ports/qt5-base/cmake/install_qt.cmake +++ b/ports/qt5-base/cmake/install_qt.cmake @@ -4,6 +4,7 @@ function(install_qt) if(CMAKE_HOST_WIN32) vcpkg_find_acquire_program(JOM) set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY}) + set(INVOKE_SINGLE "${JOM}" /J 1) else() find_program(MAKE make) set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY}) @@ -62,8 +63,9 @@ function(install_qt) endif() message(STATUS "Building ${_build_triplet}") - vcpkg_execute_required_process( + vcpkg_execute_build_process( COMMAND ${INVOKE} + NO_PARALLEL_COMMAND ${INVOKE_SINGLE} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet} LOGNAME build-${_build_triplet} ) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index f989926730ef66..1044df3174644f 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -130,6 +130,13 @@ find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux) find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_RELEASE NAMES brotlienc brotlienc-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_DEBUG NAMES brotlienc brotlienc-static brotliencd brotlienc-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(ICUTU_RELEASE NAMES icutu libicutu PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) @@ -166,8 +173,8 @@ find_library(SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DI find_library(EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}") -set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}") +set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_ENC_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}") +set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_ENC_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_RELEASE}") # If HarfBuzz is built with GLib enabled, it must be statically link set(GLIB_LIB_VERSION 2.0) @@ -186,7 +193,7 @@ set(RELEASE_OPTIONS "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}" "ICU_LIBS=${ICU_RELEASE}" "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}" - "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" + "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}" ) set(DEBUG_OPTIONS "LIBJPEG_LIBS=${JPEG_DEBUG}" @@ -261,7 +268,7 @@ elseif(VCPKG_TARGET_IS_OSX) set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) message(STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}") FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) - string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) + string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) endif() #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) diff --git a/ports/qt5-connectivity/CONTROL b/ports/qt5-connectivity/CONTROL index 7ffc9959c974c0..aefaea84647020 100644 --- a/ports/qt5-connectivity/CONTROL +++ b/ports/qt5-connectivity/CONTROL @@ -1,4 +1,5 @@ Source: qt5-connectivity Version: 5.15.0 +Port-Version: 1 Description: Qt5 Connectivity module - Provides access to Bluetooth and NFC hardware Build-Depends: qt5-base[core] diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL index 277ba3c0ca29db..6cc1b86eadd211 100644 --- a/ports/qt5-imageformats/CONTROL +++ b/ports/qt5-imageformats/CONTROL @@ -1,4 +1,5 @@ Source: qt5-imageformats Version: 5.15.0 +Port-Version: 1 Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP Build-Depends: qt5-base[core], tiff, libwebp, jasper diff --git a/ports/qt5-location/CONTROL b/ports/qt5-location/CONTROL index ecc878edf71715..c0e66e5ac1ec53 100644 --- a/ports/qt5-location/CONTROL +++ b/ports/qt5-location/CONTROL @@ -1,4 +1,5 @@ Source: qt5-location Version: 5.15.0 +Port-Version: 1 Description: Qt5 Location Module - Displays map, navigation, and place content in a QML application. Build-Depends: qt5-base[core], qt5-declarative, qt5-quickcontrols, qt5-quickcontrols2, qt5-serialport diff --git a/ports/qt5-webengine/CONTROL b/ports/qt5-webengine/CONTROL index 8dc1dc5a953bd1..a157652411afcc 100644 --- a/ports/qt5-webengine/CONTROL +++ b/ports/qt5-webengine/CONTROL @@ -1,5 +1,6 @@ Source: qt5-webengine Version: 5.15.0 +Port-Version: 1 Description: Qt5 webengine Module; Build-Depends: qt5-base[core], qt5-declarative, qt5-location, qt5-quickcontrols, qt5-quickcontrols2, qt5-tools, qt5-webchannel, atlmfc (windows), ffmpeg[core] (!windows) Supports: !static diff --git a/ports/qt5-webengine/portfile.cmake b/ports/qt5-webengine/portfile.cmake index 9da6797ca90ba1..611a3c7c035ddb 100644 --- a/ports/qt5-webengine/portfile.cmake +++ b/ports/qt5-webengine/portfile.cmake @@ -10,8 +10,6 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) endif() include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake) - - vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) vcpkg_find_acquire_program(GPERF) @@ -38,7 +36,10 @@ vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") vcpkg_add_to_path(PREPEND "${GPERF_DIR}") vcpkg_add_to_path(PREPEND "${NINJA_DIR}") -set(PATCHES common.pri.patch gl.patch build.patch) +set(PATCHES common.pri.patch + gl.patch + build.patch + vs2017.patch) if(NOT VCPKG_TARGET_IS_WINDOWS) list(APPEND CORE_OPTIONS "BUILD_OPTIONS" "-webengine-system-libwebp" "-webengine-system-ffmpeg" "-webengine-system-icu") diff --git a/ports/qt5-webengine/vs2017.patch b/ports/qt5-webengine/vs2017.patch new file mode 100644 index 00000000000000..07eb79e16fb6bd --- /dev/null +++ b/ports/qt5-webengine/vs2017.patch @@ -0,0 +1,12 @@ +diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc +index 33d5cb1f6f6..1ba53aee4b3 100644 +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/importers/systrace/systrace_trace_parser.cc +@@ -26,6 +26,7 @@ + #include "src/trace_processor/slice_tracker.h" + #include "src/trace_processor/track_tracker.h" + ++#include + #include + #include + #include diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 0f5121a287f50d..2b06636e7b82dd 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,9 +1,10 @@ Source: qt5 Version: 5.15.0 +Port-Version: 1 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Build-Depends: qt5-base[core] -Default-Features: essentials, default +Default-Features: essentials Feature: essentials Build-Depends: qt5[core, tools, networkauth, quickcontrols2, multimedia, imageformats, declarative, svg, activeqt] @@ -13,29 +14,25 @@ Feature: latest Build-Depends: qt5-base[core, latest] Description: Build latest qt version (5.14.2) instead of LTS -Feature: default -Build-Depends: qt5[core, 3d, webchannel, websockets, extras, sensors, serialport, speech, virtualkeyboard, purchasing, scxml, charts, datavis3d, gamepad, graphicaleffects, location, webglplugin, webview, translations, remoteobjects, connectivity] -Description: Build the essential qt modules - Feature: all Build-Depends: qt5[3d, webchannel, websockets, extras, xmlpatterns, sensors, serialport, speech, svg, tools, virtualkeyboard, networkauth, purchasing, quickcontrols, quickcontrols2, script, scxml, activeqt, charts, datavis3d, declarative, gamepad, graphicaleffects, imageformats, location, multimedia, mqtt, webglplugin, webview, serialbus, translations, doc, remoteobjects, connectivity], qt5[core,webengine] (!static), qt5[core,wayland] (!windows) Description: Install all Qt5 submodules (Warning: Could take a long time and fail...) Feature: extras Build-Depends: qt5-winextras (windows), qt5-macextras (osx), qt5-x11extras (linux), qt5-androidextras (android) -Description: +Description: Feature: 3d Build-Depends: qt5-3d -Description: +Description: Feature: webchannel Build-Depends: qt5-webchannel -Description: +Description: Feature: websockets Build-Depends: qt5-websockets -Description: +Description: Feature: xmlpatterns Build-Depends: qt5-xmlpatterns @@ -43,35 +40,35 @@ Description: (deprecated) Feature: sensors Build-Depends: qt5-sensors -Description: +Description: Feature: serialport Build-Depends: qt5-serialport -Description: +Description: Feature: speech Build-Depends: qt5-speech -Description: +Description: Feature: svg Build-Depends: qt5-svg -Description: +Description: Feature: tools Build-Depends: qt5-tools -Description: +Description: Feature: virtualkeyboard Build-Depends: qt5-virtualkeyboard -Description: +Description: Feature: networkauth Build-Depends: qt5-networkauth -Description: +Description: Feature: purchasing Build-Depends: qt5-purchasing -Description: +Description: Feature: quickcontrols Build-Depends: qt5-quickcontrols @@ -79,7 +76,7 @@ Description: (deprecated) Feature: quickcontrols2 Build-Depends: qt5-quickcontrols2 -Description: +Description: Feature: script Build-Depends: qt5-script @@ -87,7 +84,7 @@ Description: (deprecated) Feature: scxml Build-Depends: qt5-scxml -Description: +Description: Feature: activeqt Build-Depends: qt5-activeqt (windows) @@ -95,76 +92,72 @@ Description: Windows Only Feature: charts Build-Depends: qt5-charts -Description: +Description: Feature: datavis3d Build-Depends: qt5-datavis3d -Description: +Description: Feature: declarative Build-Depends: qt5-declarative -Description: +Description: Feature: gamepad Build-Depends: qt5-gamepad -Description: +Description: Feature: graphicaleffects Build-Depends: qt5-graphicaleffects -Description: - -Feature: declarative -Build-Depends: qt5-declarative -Description: +Description: Feature: imageformats Build-Depends: qt5-imageformats -Description: +Description: Feature: location Build-Depends: qt5-location -Description: +Description: Feature: multimedia Build-Depends: qt5-multimedia -Description: +Description: Feature: mqtt Build-Depends: qt5-mqtt -Description: +Description: Feature: webglplugin Build-Depends: qt5-webglplugin -Description: +Description: Feature: webview Build-Depends: qt5-webview -Description: +Description: Feature: wayland Build-Depends: qt5-wayland -Description: +Description: Feature: webengine Build-Depends: qt5-webengine -Description: +Description: Feature: serialbus Build-Depends: qt5-serialbus -Description: +Description: Feature: translations Build-Depends: qt5-translations -Description: +Description: Feature: doc Build-Depends: qt5-doc -Description: +Description: Feature: remoteobjects Build-Depends: qt5-remoteobjects -Description: +Description: Feature: connectivity Build-Depends: qt5-connectivity -Description: +Description: diff --git a/ports/quazip/CONTROL b/ports/quazip/CONTROL new file mode 100644 index 00000000000000..853be24c058248 --- /dev/null +++ b/ports/quazip/CONTROL @@ -0,0 +1,5 @@ +Source: quazip +Version: 0.9.1 +Homepage: https://stachenov.github.io/quazip/ +Description: Qt/C++ wrapper over minizip +Build-Depends: qt5-base, zlib diff --git a/ports/quazip/portfile.cmake b/ports/quazip/portfile.cmake new file mode 100644 index 00000000000000..4c8602b69234a2 --- /dev/null +++ b/ports/quazip/portfile.cmake @@ -0,0 +1,20 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO stachenov/quazip + REF v0.9.1 + SHA512 db31f3c7e3d7e95c25090ceb8379643e0b49ed69ece009dd015bee120b2b60f42e73408f580caed3138fa19ca64dcd23a05f16435abb54e2b8df21105c7b42c0 + PATCHES + vcpkg_remove_extra_static.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/QuaZip5/) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright) \ No newline at end of file diff --git a/ports/quazip/vcpkg_remove_extra_static.patch b/ports/quazip/vcpkg_remove_extra_static.patch new file mode 100644 index 00000000000000..e600424751c1d1 --- /dev/null +++ b/ports/quazip/vcpkg_remove_extra_static.patch @@ -0,0 +1,30 @@ +diff --git a/quazip/CMakeLists.txt b/quazip/CMakeLists.txt +index 1efb5e2..2412b8a 100644 +--- a/quazip/CMakeLists.txt ++++ b/quazip/CMakeLists.txt +@@ -10,22 +10,13 @@ ADD_DEFINITIONS(-DQUAZIP_BUILD) + qt_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS}) + set(SRCS ${SRCS} ${MOC_SRCS}) + +-add_library(${QUAZIP_LIB_TARGET_NAME} SHARED ${SRCS}) +-add_library(quazip_static STATIC ${SRCS}) +- +-# Windows uses .lib extension for both static and shared library +-# *nix systems use different extensions for SHARED and STATIC library and by convention both libraries have the same name +-if (NOT WIN32) +- set_target_properties(quazip_static PROPERTIES OUTPUT_NAME quazip${QUAZIP_LIB_VERSION_SUFFIX}) +-endif () ++add_library(${QUAZIP_LIB_TARGET_NAME} ${SRCS}) + + target_include_directories(${QUAZIP_LIB_TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) +-target_include_directories(quazip_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) +-set_target_properties(${QUAZIP_LIB_TARGET_NAME} quazip_static PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) ++set_target_properties(${QUAZIP_LIB_TARGET_NAME} PROPERTIES VERSION ${QUAZIP_LIB_VERSION} SOVERSION ${QUAZIP_LIB_SOVERSION} DEBUG_POSTFIX d) + + # Link against ZLIB_LIBRARIES if needed (on Windows this variable is empty) + target_link_libraries(${QUAZIP_LIB_TARGET_NAME} ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) +-target_link_libraries(quazip_static ${QT_QTMAIN_LIBRARY} ${QTCORE_LIBRARIES} ${ZLIB_LIBRARIES}) + + install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip${QUAZIP_LIB_VERSION_SUFFIX}) +-install(TARGETS ${QUAZIP_LIB_TARGET_NAME} quazip_static LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION}) ++install(TARGETS ${QUAZIP_LIB_TARGET_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/ports/quill/CONTROL b/ports/quill/CONTROL index c69e4ffab6da44..9fee17006d55c2 100644 --- a/ports/quill/CONTROL +++ b/ports/quill/CONTROL @@ -1,5 +1,5 @@ Source: quill -Version: 1.3.1 +Version: 1.3.3 Homepage: https://github.com/odygrd/quill/ Description: C++14 Asynchronous Low Latency Logging Library Supports: !(arm|arm64|uwp|android) diff --git a/ports/quill/portfile.cmake b/ports/quill/portfile.cmake index 9f35ddc2b28681..61ad68227be8a9 100644 --- a/ports/quill/portfile.cmake +++ b/ports/quill/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO odygrd/quill - REF 3d72126ab749277267c45da80b65ee76aaafff6d #v1.3.1 - SHA512 06ca205d291cb5161bc956b472c00e791d8ff9bd512ac4b9d3592e0f5af19aac425836d77131d0294ceea83aaec386dbdb86179cf93fbb0c3972e5547c216287 + REF f1d244f521a117beabebbe536f8507f8b2aa2244 #v1.3.3 + SHA512 1164f6089f92822f35570832873aef9d619d3da311d1f57f36fd83fd2f659255a1ea44db79948a1591d48c4ec45a7b7158a5745f37a3c940e7bc7b97d52dd85e HEAD_REF master ) diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 4a2407b343b8a7..8353f4670f4306 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,5 +1,6 @@ Source: qwt Version: 6.1.4 +Port-Version: 1 Homepage: https://sourceforge.net/projects/qwt Description: Qt widgets library for technical applications Build-Depends: qt5-base[core], qt5-svg, qt5-tools diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index bbf03abc1482aa..795fe53b0bb408 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -31,4 +31,4 @@ file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qwtw/CONTROL b/ports/qwtw/CONTROL new file mode 100644 index 00000000000000..2ce5b0a13bac69 --- /dev/null +++ b/ports/qwtw/CONTROL @@ -0,0 +1,7 @@ +Source: qwtw +Version: 3.0 +Homepage: https://github.com/ig-or/qwtw +Description: qwt-based 2D plotting library +Supports: windows & x64 & !static +Build-Depends: qt5-base, qt5-svg, qwt, marble, boost-system, boost-filesystem, boost-date-time, boost-chrono, boost-regex, boost-thread, boost-circular-buffer, boost-asio + diff --git a/ports/qwtw/portfile.cmake b/ports/qwtw/portfile.cmake new file mode 100644 index 00000000000000..c88ac2179ed5f5 --- /dev/null +++ b/ports/qwtw/portfile.cmake @@ -0,0 +1,19 @@ +vcpkg_fail_port_install(ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" "x86" ON_LIBRARY_LINKAGE "static") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ig-or/qwtw + REF 54bedcce743991f2f274bebda0ee399683a9e9bb + SHA512 defd7f199c8bf490f5ac69deade4a4a45581c0fa5b79cf2aa1fbec8c46bbbe1d9c9cf0f7ba383e8e92f5e6145b42a837b7dc555017893797f72dab1ce490e57a + HEAD_REF master +) + + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/raylib/CONTROL b/ports/raylib/CONTROL index 382de52f3fcee3..7308a4e43f8a95 100644 --- a/ports/raylib/CONTROL +++ b/ports/raylib/CONTROL @@ -1,9 +1,13 @@ Source: raylib Version: 3.0.0 -Port-Version: 1 +Port-Version: 3 Description: A simple and easy-to-use library to enjoy videogames programming Homepage: https://github.com/raysan5/raylib Supports: !(arm|uwp) +Default-Features: use-audio -Feature: non-audio -Description: Build raylib without audio module +Feature: hidpi +Description: Support high-DPI displays + +Feature: use-audio +Description: Build raylib with audio module diff --git a/ports/raylib/portfile.cmake b/ports/raylib/portfile.cmake index f39d61d1cf6cab..ba63fff8484560 100644 --- a/ports/raylib/portfile.cmake +++ b/ports/raylib/portfile.cmake @@ -25,8 +25,9 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SHARED) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - non-audio USE_AUDIO + FEATURES + hidpi SUPPORT_HIGH_DPI + use-audio USE_AUDIO ) vcpkg_configure_cmake( @@ -37,8 +38,8 @@ vcpkg_configure_cmake( -DBUILD_GAMES=OFF -DSHARED=${SHARED} -DSTATIC=${STATIC} - -DUSE_AUDIO=${USE_AUDIO} -DUSE_EXTERNAL_GLFW=OFF # externl glfw3 causes build errors on Windows + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DENABLE_ASAN=ON -DENABLE_UBSAN=ON @@ -55,12 +56,6 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) -configure_file( - ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake - ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake - @ONLY -) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share @@ -74,8 +69,5 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ) endif() -# Install usage configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) - -# Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/raylib/usage b/ports/raylib/usage index 936b74f502a845..94ce10978f78d5 100644 --- a/ports/raylib/usage +++ b/ports/raylib/usage @@ -1,5 +1,5 @@ The package @PORT@:@TARGET_TRIPLET@ provides CMake targets: find_package(@PORT@ CONFIG REQUIRED) - target_include_directories(main PRIVATE ${raylib_INCLUDE_DIRS}) - target_link_libraries(main PRIVATE ${raylib_LIBRARIES}) + target_include_directories(main PRIVATE ${RAYLIB_INCLUDE_DIRS}) + target_link_libraries(main PRIVATE ${RAYLIB_LIBRARIES}) diff --git a/ports/raylib/vcpkg-cmake-wrapper.cmake b/ports/raylib/vcpkg-cmake-wrapper.cmake index 81e9989ec0d357..34484ea6fe3e41 100644 --- a/ports/raylib/vcpkg-cmake-wrapper.cmake +++ b/ports/raylib/vcpkg-cmake-wrapper.cmake @@ -1,14 +1,11 @@ -set(raylib_USE_STATIC_LIBS @STATIC@) +include(SelectLibraryConfigurations) -_find_package(${ARGS}) +find_path(RAYLIB_INCLUDE_DIR raylib.h) -if(raylib_FOUND) - get_filename_component(_raylib_lib_name ${raylib_LIBRARY} NAME) +find_library(RAYLIB_LIBRARY_DEBUG NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED) +find_library(RAYLIB_LIBRARY_RELEASE NAMES raylib libraylib NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED) - set(raylib_LIBRARY - debug ${CURRENT_INSTALLED_DIR}/debug/lib/${_raylib_lib_name} - optimized ${CURRENT_INSTALLED_DIR}/lib/${_raylib_lib_name} - ) +select_library_configurations(RAYLIB) - set(raylib_LIBRARIES ${raylib_LIBRARY}) -endif() +set(RAYLIB_INCLUDE_DIRS ${RAYLIB_INCLUDE_DIR}) +set(RAYLIB_LIBRARIES ${RAYLIB_LIBRARY}) diff --git a/ports/restinio/CONTROL b/ports/restinio/CONTROL index d953dcfee202ca..f86387b32c6af1 100644 --- a/ports/restinio/CONTROL +++ b/ports/restinio/CONTROL @@ -1,5 +1,5 @@ Source: restinio -Version: 0.6.8 +Version: 0.6.9 Description: A header-only C++14 library that gives you an embedded HTTP/Websocket server targeted primarily for asynchronous processing of HTTP-requests. Build-Depends: asio, fmt, http-parser Homepage: https://github.com/stiffstream/restinio diff --git a/ports/restinio/portfile.cmake b/ports/restinio/portfile.cmake index c2cbbb05712c57..5dcd5e6906e9c7 100644 --- a/ports/restinio/portfile.cmake +++ b/ports/restinio/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO stiffstream/restinio - REF c34f83a68e60537eba52e2d076ed22495ad4c5df # v.0.6.8 - SHA512 1c03a2cc96f44ce004870136ffdaa7a9abc5bc5173edadfe58e4f92f2e3c67c1555b4604094ad3a1dab1f0bf01cf9d79cf7d5a381f357aa4bdff90656a27e0c1 + REF 0ef04a26155d8aa4a56a36cc013c7e722675da21 # v.0.6.9 + SHA512 6ae218275f8b654e64708bfde7873170d613e830ffce4e9dade18ff06c47c0a8eec42570fe59f36e31ab052ad0e7724928d94fd70c6f72454a3cd7eb6cdbf175 ) vcpkg_configure_cmake( diff --git a/ports/robin-hood-hashing/CONTROL b/ports/robin-hood-hashing/CONTROL index 8d7eda75586bba..6aa499d881356b 100644 --- a/ports/robin-hood-hashing/CONTROL +++ b/ports/robin-hood-hashing/CONTROL @@ -1,4 +1,4 @@ Source: robin-hood-hashing -Version: 3.7.0 +Version: 3.8.0 Homepage: https://github.com/martinus/robin-hood-hashing Description: Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20 diff --git a/ports/robin-hood-hashing/portfile.cmake b/ports/robin-hood-hashing/portfile.cmake index 209fb611e6d314..4169c32483f009 100644 --- a/ports/robin-hood-hashing/portfile.cmake +++ b/ports/robin-hood-hashing/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO martinus/robin-hood-hashing - REF 3.7.0 - SHA512 3dd7c7ace50bd16579ef9db8f9a89e1b2fd8406d7f3af6a4cedb674ea14303bd70332da403b87b2f0fb3c7f415dd93e9a7b330cb86ca2f58d5916ca42666a8e5 + REF 3.8.0 + SHA512 f64635a2fc3ebd975d40dc4fd3e3df81a6bed11e8bb9df1d6d100e408c2c81da2679e9836313444e573c6bfb160eeecd7fde68988e9d0246601c8993ecc42085 HEAD_REF master ) diff --git a/ports/rsocket/CONTROL b/ports/rsocket/CONTROL new file mode 100644 index 00000000000000..333fe0df395f43 --- /dev/null +++ b/ports/rsocket/CONTROL @@ -0,0 +1,6 @@ +Source: rsocket +Version: 2020.05.04.00-1 +Homepage: https://github.com/rsocket/rsocket-cpp +Description: C++ implementation of RSocket http://rsocket.io +Build-Depends: folly, double-conversion, openssl, gflags, glog, fmt, boost-system, boost-thread, boost-filesystem, boost-regex, boost-context, boost-program-options, zlib +Supports: !(windows&x64) diff --git a/ports/rsocket/fix-cmake-config.patch b/ports/rsocket/fix-cmake-config.patch new file mode 100644 index 00000000000000..d3bf7b886ee444 --- /dev/null +++ b/ports/rsocket/fix-cmake-config.patch @@ -0,0 +1,26 @@ +diff --git a/cmake/rsocket-config.cmake.in b/cmake/rsocket-config.cmake.in +index d5579a85..ea12752a 100644 +--- a/cmake/rsocket-config.cmake.in ++++ b/cmake/rsocket-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET rsocket::ReactiveSocket) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/rsocket/rsocket-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/rsocket-exports.cmake") + endif() + + if (NOT rsocket_FIND_QUIETLY) +diff --git a/yarpl/cmake/yarpl-config.cmake.in b/yarpl/cmake/yarpl-config.cmake.in +index d557b213..1b83fffc 100644 +--- a/yarpl/cmake/yarpl-config.cmake.in ++++ b/yarpl/cmake/yarpl-config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + if(NOT TARGET yarpl::yarpl) +- include("${PACKAGE_PREFIX_DIR}/lib/cmake/yarpl/yarpl-exports.cmake") ++ include("${CMAKE_CURRENT_LIST_DIR}/yarpl-exports.cmake") + endif() + + set(YARPL_LIBRARIES yarpl::yarpl) diff --git a/ports/rsocket/fix-find-dependencies.patch b/ports/rsocket/fix-find-dependencies.patch new file mode 100644 index 00000000000000..287a6fa99df0fe --- /dev/null +++ b/ports/rsocket/fix-find-dependencies.patch @@ -0,0 +1,94 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f69e907..22570b5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,7 +124,7 @@ option(BUILD_BENCHMARKS "Build benchmarks" ON) + option(BUILD_EXAMPLES "Build examples" ON) + option(BUILD_TESTS "Build tests" ON) + +-enable_testing() ++#enable_testing() + + include(ExternalProject) + include(CTest) +@@ -172,7 +172,9 @@ endif() + + if("${BUILD_TYPE_LOWER}" MATCHES "debug") + message("debug mode was set") ++ if (NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unreachable-code") ++ endif() + else() + message("release mode was set") + endif() +@@ -181,18 +183,25 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(TEST_CXX_FLAGS ${TEST_CXX_FLAGS} -Wno-inconsistent-missing-override) + endif() + +-find_library(DOUBLE-CONVERSION double-conversion) ++find_package(double-conversion CONFIG REQUIRED) + + find_package(OpenSSL REQUIRED) + +-find_package(Gflags REQUIRED) ++find_package(gflags CONFIG REQUIRED) + +-# find glog::glog to satisfy the folly dep. +-find_package(Glog REQUIRED) ++find_package(ZLIB REQUIRED) + +-find_package(fmt CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() + +-include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) ++# find glog::glog to satisfy the folly dep. ++find_package(folly CONFIG REQUIRED) ++#find_package(glog CONFIG REQUIRED) ++# ++#find_package(fmt CONFIG REQUIRED) + + include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR}) + +@@ -327,7 +336,7 @@ target_compile_options( + ReactiveSocket + PRIVATE ${EXTRA_CXX_FLAGS}) + +-enable_testing() ++#enable_testing() + + install(TARGETS ReactiveSocket EXPORT rsocket-exports DESTINATION lib) + install(DIRECTORY rsocket DESTINATION include FILES_MATCHING PATTERN "*.h") +@@ -470,7 +479,7 @@ if(BUILD_TESTS) + ${GMOCK_LIBS} # This also needs the preceding `add_dependencies` + glog::glog + gflags +- ${DOUBLE-CONVERSION}) ++ double-conversion::double-conversion) + + # Download the latest TCK drivers JAR. + set(TCK_DRIVERS_JAR rsocket-tck-drivers-0.9.10.jar) +diff --git a/yarpl/CMakeLists.txt b/yarpl/CMakeLists.txt +index f4159b8..8c01ffb 100644 +--- a/yarpl/CMakeLists.txt ++++ b/yarpl/CMakeLists.txt +@@ -53,8 +53,14 @@ endif() + # Using NDEBUG in Release builds. + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") + +-find_package(Gflags REQUIRED) +-find_package(Glog REQUIRED) ++find_package(gflags CONFIG REQUIRED) ++if (BUILD_SHARED_LIBS) ++ set(gflags gflags_shared) ++else() ++ set(gflags gflags_static) ++endif() ++ ++find_package(glog CONFIG REQUIRED) + find_package(fmt CONFIG REQUIRED) + + IF(NOT FOLLY_VERSION) diff --git a/ports/rsocket/portfile.cmake b/ports/rsocket/portfile.cmake new file mode 100644 index 00000000000000..4ae31c106ef0fe --- /dev/null +++ b/ports/rsocket/portfile.cmake @@ -0,0 +1,44 @@ +# yarpl only support static build in Windows +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_fail_port_install(ON_ARCH "x64") + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO rsocket/rsocket-cpp #v2020.05.04.00 + REF 8038d05e741c3d3ecd6adb069b4a1b3daa230e14 + SHA512 d7bc93af7b6130d73fa0823f534ad57a531dfa7d7aa990a2a1a1b72b6761db7eeb60573d0d38f55daa991554e3ab4ac507047f8051a4390b3343cd708a48efbb + HEAD_REF master + PATCHES + fix-cmake-config.patch + fix-find-dependencies.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF + -DBUILD_BENCHMARKS=OFF +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/include/yarpl/perf + ${CURRENT_PACKAGES_DIR}/include/yarpl/cmake + ${CURRENT_PACKAGES_DIR}/include/yarpl/test + ${CURRENT_PACKAGES_DIR}/include/rsocket/examples + ${CURRENT_PACKAGES_DIR}/include/rsocket/test +) + +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/rtmidi/CMakeLists.txt b/ports/rtmidi/CMakeLists.txt deleted file mode 100644 index 91782fd1817485..00000000000000 --- a/ports/rtmidi/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(rtmidi CXX) - -add_library(rtmidi RtMidi.cpp rtmidi_c.cpp) -if(BUILD_SHARED_LIBS) - target_compile_definitions(rtmidi PRIVATE -DRTMIDI_EXPORT) -endif() - -file(READ "${PROJECT_SOURCE_DIR}/rtmidi_c.h" RTMIDI_EXPORT) -if (BUILD_SHARED_LIBS) - string(REPLACE "if defined(RTMIDI_EXPORT)" "if 1" RTMIDI_EXPORT "${RTMIDI_EXPORT}") -else() - string(REPLACE "if defined(RTMIDI_EXPORT)" "if 0" RTMIDI_EXPORT "${RTMIDI_EXPORT}") -endif() -file(WRITE "${PROJECT_BINARY_DIR}/rtmidi_c.h" "${RTMIDI_EXPORT}") - -install( - TARGETS rtmidi - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -if(NOT DISABLE_INSTALL_HEADERS) - install(FILES "RtMidi.h" DESTINATION include) - install(FILES "${PROJECT_BINARY_DIR}/rtmidi_c.h" DESTINATION include) -endif() diff --git a/ports/rtmidi/CONTROL b/ports/rtmidi/CONTROL index 3742ec9b16a450..7c2c39f2ad8f29 100644 --- a/ports/rtmidi/CONTROL +++ b/ports/rtmidi/CONTROL @@ -1,4 +1,6 @@ Source: rtmidi Version: 4.0.0 +Port-Version: 2 Homepage: https://github.com/thestk/rtmidi Description: A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMidi & JACK) and Windows (Multimedia) +Supports: !uwp diff --git a/ports/rtmidi/portfile.cmake b/ports/rtmidi/portfile.cmake index 8aa949b5a4cea5..4a9fccbcc078fb 100644 --- a/ports/rtmidi/portfile.cmake +++ b/ports/rtmidi/portfile.cmake @@ -1,22 +1,29 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_TARGET "UWP") + +# Upstream uses CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, which causes issues +# https://github.com/thestk/rtmidi/blob/4.0.0/CMakeLists.txt#L20 +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO thestk/rtmidi - REF 4.0.0 - SHA512 39383f121320c9471b31f8b9d283167bfadf4c7328b6664d1d54a4c52e3dd9b76362875258d90363c6044e87fcee31ccce80e19435dc620c88e6d60fc82d0f9d + REF dda792c5394375769466ab1c1d7773e741bbd950 # 4.0.0 + SHA512 cb1ded29c0b22cf7f38719131a9572a4daba7071fd8cf8b5b8d7306560a218bb0ef42150bf341b76f4ddee0ae087da975116c3b153e7bb908f2a674ecacb9d7a HEAD_REF master - PATCHES - fix-POSIXname.patch + PATCHES + fix-POSIXname.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON + OPTIONS -DRTMIDI_API_ALSA=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtmidi RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sdl1/CONTROL b/ports/sdl1/CONTROL index d34e89ad008880..87bb7b2afb825f 100644 --- a/ports/sdl1/CONTROL +++ b/ports/sdl1/CONTROL @@ -1,4 +1,5 @@ Source: sdl1 -Version: 1.2.15-11 +Version: 1.2.15 +Port-Version: 12 Homepage: https://www.libsdl.org Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl1/portfile.cmake b/ports/sdl1/portfile.cmake index e84582bf0a9a8d..6dd7da6876d573 100644 --- a/ports/sdl1/portfile.cmake +++ b/ports/sdl1/portfile.cmake @@ -54,11 +54,13 @@ else() message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".") vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH} ) vcpkg_install_make() - vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread) + vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib + -Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib + SYSTEM_LIBRARIES pthread) file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") foreach (SDL1_TOOL ${SDL1_TOOLS}) diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt index b5b5eac619b265..cc9816d0b781a2 100644 --- a/ports/sdl2-mixer/CMakeLists.txt +++ b/ports/sdl2-mixer/CMakeLists.txt @@ -91,7 +91,7 @@ add_library(SDL2_mixer music_wav.c version.rc) -if(WIN32 OR APPLE) +if((WIN32 OR APPLE) AND SDL_MIXER_ENABLE_NATIVEMIDI) list(APPEND SDL_MIXER_DEFINES MUSIC_MID_NATIVE) target_sources(SDL2_mixer PRIVATE music_nativemidi.c native_midi/native_midi_common.c) target_link_libraries(SDL2_mixer ${SDL_MIXER_LIBRARIES}) diff --git a/ports/sdl2-mixer/CONTROL b/ports/sdl2-mixer/CONTROL index 4ea51192ef4168..ef18e139debe36 100644 --- a/ports/sdl2-mixer/CONTROL +++ b/ports/sdl2-mixer/CONTROL @@ -1,12 +1,17 @@ Source: sdl2-mixer -Version: 2.0.4-9 +Version: 2.0.4 +Port-Version: 10 Homepage: https://www.libsdl.org/projects/SDL_mixer Description: Multi-channel audio mixer library for SDL. Build-Depends: sdl2 +Default-Features: nativemidi Feature: dynamic-load Description: Load plugins with dynamic call +Feature: nativemidi +Description: Support for MIDI audio format on Windows and macOS. + Feature: libflac Description: Support for FLAC audio format. Build-Depends: libflac diff --git a/ports/sdl2-mixer/portfile.cmake b/ports/sdl2-mixer/portfile.cmake index 74037d2f6b1d0d..16e45c5d88ab76 100644 --- a/ports/sdl2-mixer/portfile.cmake +++ b/ports/sdl2-mixer/portfile.cmake @@ -34,6 +34,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS libmodplug SDL_MIXER_ENABLE_MOD libvorbis SDL_MIXER_ENABLE_OGGVORBIS opusfile SDL_MIXER_ENABLE_OPUS + nativemidi SDL_MIXER_ENABLE_NATIVEMIDI ) vcpkg_configure_cmake( diff --git a/ports/secp256k1/CMakeLists.txt b/ports/secp256k1/CMakeLists.txt index 2e6b46198aabd8..a3af313b6e7109 100644 --- a/ports/secp256k1/CMakeLists.txt +++ b/ports/secp256k1/CMakeLists.txt @@ -12,15 +12,24 @@ add_definitions( file(GLOB SOURCES src/secp256k1.c) add_library(secp256k1 ${SOURCES}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) -install(TARGETS secp256k1 +target_include_directories(secp256k1 PUBLIC $ $) + +if(INSTALL_HEADERS) + file(GLOB HEADERS include/*.h) + install(FILES ${HEADERS} DESTINATION include) +endif() + +install(TARGETS secp256k1 EXPORT unofficial-secp256k1-targets RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -if(INSTALL_HEADERS) - file(GLOB HEADERS include/*.h) - install(FILES ${HEADERS} DESTINATION include) -endif() \ No newline at end of file +install( + EXPORT unofficial-secp256k1-targets + FILE unofficial-secp256k1-targets.cmake + NAMESPACE unofficial:: + DESTINATION share/unofficial-secp256k1 +) \ No newline at end of file diff --git a/ports/secp256k1/CONTROL b/ports/secp256k1/CONTROL index a0414b60c0af59..10d73e4c08d73c 100644 --- a/ports/secp256k1/CONTROL +++ b/ports/secp256k1/CONTROL @@ -1,4 +1,5 @@ Source: secp256k1 -Version: 2017-19-10-0b7024185045a49a1a6a4c5615bf31c94f63d9c4-2 +Version: 2017-19-10 +Port-Version: 3 Homepage: https://github.com/bitcoin-core/secp256k1 Description: Optimized C library for EC operations on curve diff --git a/ports/secp256k1/portfile.cmake b/ports/secp256k1/portfile.cmake index 28291c7eca389f..3bf158816ae426 100644 --- a/ports/secp256k1/portfile.cmake +++ b/ports/secp256k1/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( @@ -20,6 +18,8 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) -# Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +configure_file(${CMAKE_CURRENT_LIST_DIR}/secp256k1-config.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-secp256k1-config.cmake @ONLY) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/secp256k1/secp256k1-config.cmake b/ports/secp256k1/secp256k1-config.cmake new file mode 100644 index 00000000000000..5cc40fe829a9ae --- /dev/null +++ b/ports/secp256k1/secp256k1-config.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/unofficial-secp256k1-targets.cmake") diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL index 6f46156a93519e..836280f8bb795c 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,5 +1,6 @@ Source: sfml -Version: 2.5.1-7 +Version: 2.5.1 +Port-Version: 8 Homepage: https://github.com/sfml/sfml Description: Simple and fast multimedia library Build-Depends: freetype, libflac, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index efbcdd135912d0..82f6e11d15b524 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH SHA512 7aed2fc29d1da98e6c4d598d5c86cf536cb4eb5c2079cdc23bb8e502288833c052579dadbe0ce13ad6461792d959bf6d9660229f54c54cf90a541c88c6b03d59 PATCHES use-system-freetype.patch + stb_include.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) diff --git a/ports/sfml/stb_include.patch b/ports/sfml/stb_include.patch new file mode 100644 index 00000000000000..3519b1c1e61233 --- /dev/null +++ b/ports/sfml/stb_include.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e821a49bc..c68264ef2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,6 +188,9 @@ if(SFML_USE_SYSTEM_DEPS) + endforeach() + + list(REMOVE_DUPLICATES CMAKE_IGNORE_PATH) ++ ++ find_path(STB_INCLUDE_DIR stb.h) ++ include_directories(${STB_INCLUDE_DIR}) + endif() + + # Visual C++: remove warnings regarding SL security and algorithms on pointers diff --git a/ports/shapelib/CONTROL b/ports/shapelib/CONTROL index 283b66b442d812..e656682756f7b9 100644 --- a/ports/shapelib/CONTROL +++ b/ports/shapelib/CONTROL @@ -1,4 +1,4 @@ Source: shapelib -Version: 1.4.1-2 +Version: 1.5.0 Homepage: https://download.osgeo.org/shapelib Description: Shapefile C Library is simple C API for reading and writing ESRI Shapefiles diff --git a/ports/shapelib/portfile.cmake b/ports/shapelib/portfile.cmake index 788e21e2e3f5fe..3aceff84d7a016 100644 --- a/ports/shapelib/portfile.cmake +++ b/ports/shapelib/portfile.cmake @@ -1,7 +1,5 @@ -include(vcpkg_common_functions) - -set(SHAPELIB_VERSION 1.4.1) -set(SHAPELIB_HASH e3e02dde8006773fed25d630896e79fd79d2008a029cc86b157fe0d92c143a9fab930fdb93d9700d4e1397c3b23ae4b86e91db1dbaca1c5388d4e3aea0309341) +set(SHAPELIB_VERSION 1.5.0) +set(SHAPELIB_HASH 230939afb33aee042808a32b38ee9dfc7ec1f39432e5a4ebe3fda99c2f87bfbebc91830d4e21691c51aae3f4bb65d7e71e7061472bb08124dcd3402c46800d6c) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/shapelib/shapelib-${SHAPELIB_VERSION}.zip" @@ -44,8 +42,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/shapelib) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/shapelib/COPYING ${CURRENT_PACKAGES_DIR}/share/shapelib/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/shapelib) diff --git a/ports/simple-fft/CONTROL b/ports/simple-fft/CONTROL new file mode 100644 index 00000000000000..6595558bbd83df --- /dev/null +++ b/ports/simple-fft/CONTROL @@ -0,0 +1,4 @@ +Source: simple-fft +Version: 2020-06-14 +Homepage: https://github.com/d1vanov/Simple-FFT +Description: Header-only C++ library implementing fast Fourier transform of 1D, 2D and 3D data diff --git a/ports/simple-fft/portfile.cmake b/ports/simple-fft/portfile.cmake new file mode 100644 index 00000000000000..81f33e054c4b66 --- /dev/null +++ b/ports/simple-fft/portfile.cmake @@ -0,0 +1,20 @@ +# Header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO d1vanov/Simple-FFT + REF a0cc843ff36d33ad09c08674b9503614742ad0b9 + SHA512 6fbbda1f172505f6627f97ae671d12ff282844ca50e6e6c8016f78ee333c32ce6d17763837c281e47f10cfc277cb1f67394169f6bbf137b09885c1a053d6d342 + HEAD_REF master +) + +file(COPY ${SOURCE_PATH}/include/simple_fft/check_fft.hpp + ${SOURCE_PATH}/include/simple_fft/copy_array.hpp + ${SOURCE_PATH}/include/simple_fft/error_handling.hpp + ${SOURCE_PATH}/include/simple_fft/fft.h + ${SOURCE_PATH}/include/simple_fft/fft.hpp + ${SOURCE_PATH}/include/simple_fft/fft_impl.hpp + ${SOURCE_PATH}/include/simple_fft/fft_settings.h + DESTINATION ${CURRENT_PACKAGES_DIR}/include/simple_fft +) + +file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index 9005193609cad1..8636d8ba951701 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -1,5 +1,5 @@ Source: spdlog -Version: 1.6.1 +Version: 1.7.0 Homepage: https://github.com/gabime/spdlog Description: Very fast, header only, C++ logging library Build-Depends: fmt diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 0c8b0df72c3458..844575c134759a 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gabime/spdlog - REF 22a169bc319ac06948e7ee0be6b9b0ac81386604 #v1.6.1 - SHA512 29eac6f1be8d9fc08a257eab7f59cf70d63b2978fa4b8b63c825b39cf77f2505083bfd9db3fa2925739cea71d07986c022fc3d236cce351b3570d543f100a8a5 + REF 616caa5d30172b65cc3a06800894c575d70cb8e6 #v1.7.0 + SHA512 47411e8a607a339bffe2d5e13b4568b825ee8a07d88e69cf32096b08b76cdb60cbd64003620506e9c5748d3f66d8df76fa8880bb1a092923b7b405fedd18ad0c HEAD_REF v1.x ) diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 3c1fc071c26c29..6250eb7111b979 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -24,6 +24,15 @@ target_compile_definitions( -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_COLUMN_METADATA ) + +if(WITH_GEOPOLY) + add_compile_definitions(SQLITE_ENABLE_GEOPOLY) +endif() + +if(WITH_JSON1) + add_compile_definitions(SQLITE_ENABLE_JSON1) +endif() + target_include_directories(sqlite3 INTERFACE $) if(NOT WIN32) find_package(Threads REQUIRED) @@ -46,11 +55,11 @@ endif() install( TARGETS sqlite3 - EXPORT sqlite3 + EXPORT unofficial-sqlite3-targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release) -install(EXPORT sqlite3 FILE sqlite3-targets.cmake DESTINATION share/sqlite3) +install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL index c48578eef46afe..01df1c91abe0d6 100644 --- a/ports/sqlite3/CONTROL +++ b/ports/sqlite3/CONTROL @@ -1,7 +1,14 @@ Source: sqlite3 Version: 3.32.3 +Port-Version: 1 Homepage: https://sqlite.org/ Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. Feature: tool Description: sqlite3 executable + +Feature: geopoly +Description: enable geopoly functionality for sqlite3 + +Feature: json1 +Description: enable JSON functionality for sqlite3 diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 21d60ab9f6a554..7a1a5775e73e43 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -17,6 +17,9 @@ vcpkg_extract_source_archive_ex( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + geopoly WITH_GEOPOLY + json1 WITH_JSON1 INVERTED_FEATURES tool SQLITE3_SKIP_TOOLS ) @@ -30,7 +33,7 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) @@ -40,7 +43,7 @@ endif() configure_file( ${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake - ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake + ${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake @ONLY ) diff --git a/ports/sqlite3/sqlite3-config.in.cmake b/ports/sqlite3/sqlite3-config.in.cmake index 538342cf42961f..e7e26bf2cde563 100644 --- a/ports/sqlite3/sqlite3-config.in.cmake +++ b/ports/sqlite3/sqlite3-config.in.cmake @@ -4,4 +4,4 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32) find_dependency(Threads) endif() -include(${CMAKE_CURRENT_LIST_DIR}/sqlite3-targets.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake) diff --git a/ports/sqlitecpp/0001-Find-external-sqlite3.patch b/ports/sqlitecpp/0001-Find-external-sqlite3.patch index b2371490c07833..5914dc17d04700 100644 --- a/ports/sqlitecpp/0001-Find-external-sqlite3.patch +++ b/ports/sqlitecpp/0001-Find-external-sqlite3.patch @@ -7,10 +7,10 @@ index 9363c0d..0f47f0f 100644 target_link_libraries(SQLiteCpp PUBLIC sqlite3) else (SQLITECPP_INTERNAL_SQLITE) - find_package (SQLite3 REQUIRED) -+ find_package(sqlite3 CONFIG) ++ find_package(unofficial-sqlite3 CONFIG) message(STATUS "Link to sqlite3 system library") - target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3) -+ target_link_libraries(SQLiteCpp PRIVATE sqlite3) ++ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3) if(SQLite3_VERSION VERSION_LESS "3.19") set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT") endif() diff --git a/ports/sqlitecpp/CONTROL b/ports/sqlitecpp/CONTROL index d05dcec852980f..372acc14b06458 100644 --- a/ports/sqlitecpp/CONTROL +++ b/ports/sqlitecpp/CONTROL @@ -1,5 +1,6 @@ Source: sqlitecpp Version: 3.0.0 +Port-Version: 1 Build-Depends: sqlite3 Homepage: https://github.com/SRombauts/SQLiteCpp Description: SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper. diff --git a/ports/stb/CONTROL b/ports/stb/CONTROL index d54f21412a5221..b048cb8a057b53 100644 --- a/ports/stb/CONTROL +++ b/ports/stb/CONTROL @@ -1,4 +1,4 @@ Source: stb -Version: 2020-02-08 +Version: 2020-02-08-1 Homepage: https://github.com/nothings/stb Description: public domain header-only libraries diff --git a/ports/stb/vcpkg-cmake-wrapper.cmake b/ports/stb/vcpkg-cmake-wrapper.cmake index e13d523becdc6d..e787d29f05cbe3 100644 --- a/ports/stb/vcpkg-cmake-wrapper.cmake +++ b/ports/stb/vcpkg-cmake-wrapper.cmake @@ -1,8 +1,6 @@ set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -if(NOT Stb_INCLUDE_DIR) - _find_package(${ARGS}) -endif() +_find_package(${ARGS}) set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH}) diff --git a/ports/stx/CMakeLists.patch b/ports/stx/CMakeLists.patch new file mode 100644 index 00000000000000..70aaccbfda8e73 --- /dev/null +++ b/ports/stx/CMakeLists.patch @@ -0,0 +1,71 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4ed99e..b0d2b15 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -204,12 +204,7 @@ endif() + # =============================================== + + if(STX_ENABLE_BACKTRACE) +- if(NOT EXISTS third_party/abseil) +- execute_process( +- COMMAND git submodule update --init --recursive third_party/abseil +- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) +- endif() +- add_subdirectory(third_party/abseil) ++ find_package(absl CONFIG REQUIRED) + endif() + + # the atomics library doesn't automatically link on my Android phone +@@ -246,13 +241,17 @@ else() + add_library(stx STATIC ${STX_SRCS}) + endif() + +-target_include_directories(stx PUBLIC include) ++target_include_directories(stx PUBLIC ++ $ ++ $ ++) ++ + target_compile_options(stx PRIVATE ${STX_FLAGS} ${STX_WARNING_FLAGS}) + target_compile_definitions(stx PUBLIC ${STX_COMPILER_DEFS}) + target_link_libraries(stx ${STX_LIB_DEPENDENCIES}) + + if(STX_ENABLE_BACKTRACE) +- target_link_libraries(stx absl::stacktrace absl::symbolize) ++ target_link_libraries(stx PUBLIC absl::stacktrace absl::symbolize) + endif() + + if(ANDROID) +@@ -288,6 +287,7 @@ endif() + # + # =============================================== + ++ + if(STX_BUILD_BENCHMARKS) + + if(NOT EXISTS third_party/benchmark) +@@ -433,3 +433,24 @@ if(STX_BUILD_DOCS) + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/docs/html/assets) + + endif() ++ ++install( ++ TARGETS stx ++ EXPORT stx ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin ++) ++ ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ ++ DESTINATION include ++ FILES_MATCHING PATTERN "*.h*") ++ ++install( ++ EXPORT stx ++ DESTINATION share/stx ++ FILE stxConfig.cmake ++ NAMESPACE stx:: ++) ++ diff --git a/ports/stx/CONTROL b/ports/stx/CONTROL new file mode 100644 index 00000000000000..cd6886925d1d35 --- /dev/null +++ b/ports/stx/CONTROL @@ -0,0 +1,8 @@ +Source: stx +Version: 1.0.1 +Homepage: https://github.com/lamarrr/STX +Description: C++17 & C++ 20 error-handling and utility extensions + +Feature: backtrace +Description: stacktrace support for STX +Build-Depends: abseil diff --git a/ports/stx/portfile.cmake b/ports/stx/portfile.cmake new file mode 100644 index 00000000000000..ebfca54ab39778 --- /dev/null +++ b/ports/stx/portfile.cmake @@ -0,0 +1,35 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lamarrr/STX + REF v1.0.1 + SHA512 544ca32f07cd863082fa9688f5d56e2715b0129ff90d2a8533cc24a92c943e5848c4b2b06a71f54c12668f6e89e9e3c649f595f9eb886f671a5fa18d343f794b + HEAD_REF master + PATCHES + "CMakeLists.patch" +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + backtrace STX_ENABLE_BACKTRACE +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + -DSTX_BUILD_DOCS=OFF + -DSTX_BUILD_BENCHMARKS=OFF + -DSTX_BUILD_SHARED=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/stx) +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" +) diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL index 5481ea4014540a..722dac00485e74 100644 --- a/ports/suitesparse/CONTROL +++ b/ports/suitesparse/CONTROL @@ -1,6 +1,7 @@ Source: suitesparse -Version: 5.4.0-6 -Build-Depends: clapack (!osx) +Version: 5.4.0 +Port-Version: 7 +Build-Depends: lapack Homepage: http://faculty.cse.tamu.edu/davis/SuiteSparse Description: algebra library diff --git a/ports/teemo/CONTROL b/ports/teemo/CONTROL index 159990ec4fa89e..843f68e834b1a2 100644 --- a/ports/teemo/CONTROL +++ b/ports/teemo/CONTROL @@ -1,5 +1,5 @@ Source: teemo -Version: 1.3 -Build-Depends: curl[non-http], cpprestsdk +Version: 2.1 +Build-Depends: curl[non-http] Description: C++ File Download Library, support Multithreading, Breakpoint Transmission, Speed Limit, Real-time Speed. Homepage: https://github.com/winsoft666/teemo \ No newline at end of file diff --git a/ports/teemo/portfile.cmake b/ports/teemo/portfile.cmake index b6baba5637bf49..55afaf490f1fef 100644 --- a/ports/teemo/portfile.cmake +++ b/ports/teemo/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO winsoft666/teemo - REF 1ee566747fba3febade554718a2db6a6c71c6fc4 - SHA512 10b391a0c629bdcd3737c1e04ac09300412322c8a4b87a8008d368663a223442fe7d7dac4fbd423b5051afcab60bb4c619cfc451a9c5902d396b7a7081a4d3c4 + REF 99b012f827ba126fe43986e6c9266f656120edd6 + SHA512 b6fcbba897b370154965a5e884a6dbd13aa1dab1ec25f404125b62f3857752b5c8e791a90014ef058e839c21f1deae8b88df2d9a8084a9e48f7f676561aa9dc9 HEAD_REF master ) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index a9830adb24f719..6fa024164b5297 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,6 @@ Source: tensorflow-cc -Version: 1.14-3 +Version: 1.14 +Port-Version: 4 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8d2c187b057b86..fdd95307c4bc38 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -47,6 +47,7 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VS} $ENV{VSInstallDir}) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) + set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) endif() # tensorflow has long file names, which will not work on windows @@ -79,7 +80,7 @@ set(ENV{TF_CONFIGURE_IOS} 0) message(STATUS "Configuring TensorFlow") vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py + COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) diff --git a/ports/tiff/CONTROL b/ports/tiff/CONTROL index d8f79b2f90c2f3..f37049768efb92 100644 --- a/ports/tiff/CONTROL +++ b/ports/tiff/CONTROL @@ -1,5 +1,5 @@ Source: tiff -Version: 4.0.10-9 +Version: 4.1.0 Build-Depends: zlib, libjpeg-turbo, liblzma Homepage: https://download.osgeo.org/libtiff Description: A library that supports the manipulation of TIFF image files diff --git a/ports/tiff/cmakelists.patch b/ports/tiff/cmakelists.patch index 597c980c5571f4..a82de0452b33be 100644 --- a/ports/tiff/cmakelists.patch +++ b/ports/tiff/cmakelists.patch @@ -73,21 +73,6 @@ diff --git a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt index 1cf1b75..4ee29f6 100644 --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt -@@ -104,11 +104,11 @@ set(tiffxx_HEADERS - set(tiffxx_SOURCES - tif_stream.cxx) - --if(WIN32_IO) -- extra_dist(tif_unix.c) -+if(USE_WIN32_FILEIO) -+ extra_dist(tif_win32.c) - list(APPEND tiff_SOURCES tif_win32.c) - else() -- extra_dist(tif_win32.c) -+ extra_dist(tif_unix.c) - list(APPEND tiff_SOURCES tif_unix.c) - endif() - @@ -143,7 +143,7 @@ install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") diff --git a/ports/tiff/portfile.cmake b/ports/tiff/portfile.cmake index 828e8ec0baedf0..ab610d3287484b 100644 --- a/ports/tiff/portfile.cmake +++ b/ports/tiff/portfile.cmake @@ -1,9 +1,9 @@ -set(LIBTIFF_VERSION 4.0.10) +set(LIBTIFF_VERSION 4.1.0) vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz" FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz" - SHA512 d213e5db09fd56b8977b187c5a756f60d6e3e998be172550c2892dbdb4b2a8e8c750202bc863fe27d0d1c577ab9de1710d15e9f6ed665aadbfd857525a81eea8 + SHA512 fd541dcb11e3d5afaa1ec2f073c9497099727a52f626b338ef87dc93ca2e23ca5f47634015a4beac616d4e8f05acf7b7cd5797fb218758cc2ad31b390491c5a6 ) vcpkg_extract_source_archive_ex( @@ -49,8 +49,8 @@ file(REMOVE_RECURSE ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff) -file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/tiff RENAME copyright) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if ("tool" IN_LIST FEATURES) file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) diff --git a/ports/tlx/CONTROL b/ports/tlx/CONTROL new file mode 100644 index 00000000000000..b65af72604a4ca --- /dev/null +++ b/ports/tlx/CONTROL @@ -0,0 +1,4 @@ +Source: tlx +Version: 0.5.20191212 +Homepage: https://github.com/tlx/tlx +Description: tlx is a collection of C++ helpers and extensions universally needed, but not found in the STL diff --git a/ports/tlx/portfile.cmake b/ports/tlx/portfile.cmake new file mode 100644 index 00000000000000..525894d28041b9 --- /dev/null +++ b/ports/tlx/portfile.cmake @@ -0,0 +1,38 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +# TODO: Fix .dlls not producing .lib files + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tlx/tlx + REF 903b9b35df8731496a90d8d74f8bedbad2517d9b + SHA512 17087973f2f4751538c589e9f80d2b5ea872d2e7d90659769ae3350d441bda0b64aec9a4150d01a7cf5323ce327ebd104cdca7b4a3bc4eebdf574e71e013ba6e + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DVERBOSE=1 + -DTLX_BUILD_TESTS=off + -DTLX_USE_GCOV=off + -DTLX_TRY_COMPILE_HEADERS=off + -DTLX_MORE_TESTS=off + -DTLX_BUILD_STATIC_LIBS=${BUILD_STATIC} + -DTLX_BUILD_SHARED_LIBS=${BUILD_SHARED} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake/") +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/tlx") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/tomlplusplus/CONTROL b/ports/tomlplusplus/CONTROL new file mode 100644 index 00000000000000..5cba84a104489a --- /dev/null +++ b/ports/tomlplusplus/CONTROL @@ -0,0 +1,5 @@ +Source: tomlplusplus +Version: 2.1.0 +Homepage: https://marzer.github.io/tomlplusplus/ +Description: Header-only TOML config file parser and serializer for modern C++. +Supports: !(arm|uwp|linux|osx) diff --git a/ports/tomlplusplus/portfile.cmake b/ports/tomlplusplus/portfile.cmake new file mode 100644 index 00000000000000..26b8f81713fafd --- /dev/null +++ b/ports/tomlplusplus/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "linux" "osx" "uwp") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO marzer/tomlplusplus + REF v2.1.0 + SHA512 7bd0ea4ecfc90946487acd545bc8635a85353506c90553f4a6f8e3d83c30f85ac12e1ce82c10e03a4ea335c1b622e64ea0753efca9b2829907996e3a6d28867a + HEAD_REF master +) + +vcpkg_configure_meson( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DGENERATE_CMAKE_CONFIG=enabled + -DBUILD_TESTS=disabled + -DBUILD_EXAMPLES=disabled +) + +vcpkg_install_meson() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/treehopper/CONTROL b/ports/treehopper/CONTROL index f50e84f1b74462..b54e10dde0f5ad 100644 --- a/ports/treehopper/CONTROL +++ b/ports/treehopper/CONTROL @@ -1,5 +1,5 @@ Source: treehopper -Version: 1.11.3-3 +Version: 1.11.3-4 Description: Treehopper connects the physical world to your computer, tablet, or smartphone. Homepage: https://treehopper.io Build-Depends: libusb diff --git a/ports/treehopper/portfile.cmake b/ports/treehopper/portfile.cmake index 46ed0d85e386d1..c9e9855ceffbe4 100644 --- a/ports/treehopper/portfile.cmake +++ b/ports/treehopper/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) vcpkg_from_github( @@ -18,8 +16,9 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(INSTALL ${SOURCE_PATH}/C++/API/inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/Treehopper/) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/treehopper RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/vc/CONTROL b/ports/vc/CONTROL new file mode 100644 index 00000000000000..e56fda2d669037 --- /dev/null +++ b/ports/vc/CONTROL @@ -0,0 +1,5 @@ +Source: vc +Version: 1.4.1 +Homepage: https://github.com/VcDevel/Vc +Description: SIMD Vector Classes for C++ . +Supports: !arm64 diff --git a/ports/vc/correct_cmake_config_path.patch b/ports/vc/correct_cmake_config_path.patch new file mode 100644 index 00000000000000..bb1d5437b3d5a3 --- /dev/null +++ b/ports/vc/correct_cmake_config_path.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/VcConfig.cmake.in b/cmake/VcConfig.cmake.in +index 36de476..5cb0e5b 100644 +--- a/cmake/VcConfig.cmake.in ++++ b/cmake/VcConfig.cmake.in +@@ -4,7 +4,7 @@ + set_and_check(@PROJECT_NAME@_INSTALL_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@) + set_and_check(@PROJECT_NAME@_INCLUDE_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/include) + set_and_check(@PROJECT_NAME@_LIB_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@) +-set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR ${@PROJECT_NAME@_LIB_DIR}/cmake/Vc) ++set_and_check(@PROJECT_NAME@_CMAKE_MODULES_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@/share/vc) + set(@PROJECT_NAME@_VERSION_STRING "@PROJECT_VERSION@") + + ### Setup @PROJECT_NAME@ defaults +@@ -20,7 +20,7 @@ list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_COMPILE_FLAGS}) + list(APPEND @PROJECT_NAME@_ALL_FLAGS ${@PROJECT_NAME@_ARCHITECTURE_FLAGS}) + + ### Import targets +-include("@PACKAGE_CMAKE_INSTALL_PREFIX@/@PACKAGE_INSTALL_DESTINATION@/@PROJECT_NAME@Targets.cmake") ++include(${@PROJECT_NAME@_CMAKE_MODULES_DIR}/@PROJECT_NAME@Targets.cmake) + + ### Define @PROJECT_NAME@_LIBRARIES for backwards compatibility + get_target_property(vc_lib_location @PROJECT_NAME@::Vc INTERFACE_LOCATION) diff --git a/ports/vc/portfile.cmake b/ports/vc/portfile.cmake new file mode 100644 index 00000000000000..b5b0da5fb526ec --- /dev/null +++ b/ports/vc/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_fail_port_install(ON_ARCH "arm64") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO VcDevel/Vc + REF 1.4.1 + SHA512 dd17e214099796c41d70416d365ea038c00c5fda285b05e48d7ee4fe03f4db2671d2be006ca7b98b0d4133bfcb57faf04cecfe35c29c3b006cd91c9a185cc04a + HEAD_REF master + PATCHES + "correct_cmake_config_path.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Vc/) +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/vcpkg-gfortran/CONTROL b/ports/vcpkg-gfortran/CONTROL new file mode 100644 index 00000000000000..80484175a4440a --- /dev/null +++ b/ports/vcpkg-gfortran/CONTROL @@ -0,0 +1,4 @@ +Source: vcpkg-gfortran +Version: 1 +Description: Metaport to install gfortran dependencies from msys if VCPKG_USE_EXTERNAL_Fortran is false +Supports: windows & !arm \ No newline at end of file diff --git a/ports/vcpkg-gfortran/portfile.cmake b/ports/vcpkg-gfortran/portfile.cmake new file mode 100644 index 00000000000000..5dd1965cd8b1c2 --- /dev/null +++ b/ports/vcpkg-gfortran/portfile.cmake @@ -0,0 +1,53 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "linux" "osx") +include(vcpkg_find_fortran) +vcpkg_find_fortran(FORTRAN_CMAKE) +if(VCPKG_USE_INTERNAL_Fortran) + set(VCPKG_CRT_LINKAGE dynamic) # Will always be dynamic no way to overwrite internal CRT linkage here + vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(HOST_ARCH MATCHES "(amd|AMD)64") + set(MINGW_W w64) + set(MSYS_HOST x86_64) + elseif(HOST_ARCH MATCHES "(x|X)86") + set(MINGW_W w32) + set(MSYS_HOST i686) + else() + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH}!" ) + endif() + + if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") + set(MSYS_TARGET x86_64) + set(MINGW_W_TARGET 64) + set(GCC_LIB_SUFFIX s_seh-1) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") + set(MSYS_TARGET i686) + set(MINGW_W_TARGET 32) + set(GCC_LIB_SUFFIX s_dw2-1) + else() + message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" ) + endif() + + + vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran") # TODO: make x86 work + + set(MINGW_BIN "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/bin/") + set(MINGW_Fortran_DLLS "${MINGW_BIN}/libgfortran-5.dll" + "${MINGW_BIN}/libquadmath-0.dll" + "${MINGW_BIN}/libwinpthread-1.dll" + "${MINGW_BIN}/libgcc_${GCC_LIB_SUFFIX}.dll") + file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(INSTALL ${MINGW_Fortran_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled) # due to outdated msvcrt + set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) + set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/winpthreads" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license") + file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/gcc-libs" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/license") + file(INSTALL "${MSYS_ROOT}/mingw${MINGW_W_TARGET}/share/licenses/crt/COPYING.MinGW-w64-runtime.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +else() + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +endif() \ No newline at end of file diff --git a/ports/vtk/6811.patch b/ports/vtk/6811.patch new file mode 100644 index 00000000000000..86dca7ea0ca298 --- /dev/null +++ b/ports/vtk/6811.patch @@ -0,0 +1,26 @@ +From 34b9d59acb1688f4a9f38908760d5756a0e05ee4 Mon Sep 17 00:00:00 2001 +From: Julien Schueller +Date: Fri, 24 Apr 2020 08:28:23 -0400 +Subject: [PATCH] vtk_hdf5: Stick to 1.10.x API + +Closes #17866 +--- + ThirdParty/hdf5/vtk_hdf5.h.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ThirdParty/hdf5/vtk_hdf5.h.in b/ThirdParty/hdf5/vtk_hdf5.h.in +index 1d802937ba..c4738b2cbf 100644 +--- a/ThirdParty/hdf5/vtk_hdf5.h.in ++++ b/ThirdParty/hdf5/vtk_hdf5.h.in +@@ -18,6 +18,8 @@ + /* Use the hdf5 library configured for VTK. */ + #cmakedefine01 VTK_MODULE_USE_EXTERNAL_vtkhdf5 + ++#define H5_USE_110_API ++ + #if VTK_MODULE_USE_EXTERNAL_vtkhdf5 + #cmakedefine01 vtkhdf5_is_parallel + #if vtkhdf5_is_parallel +-- +GitLab + diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 42af4d39a17682..089dc11b67b310 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -109,6 +109,7 @@ vcpkg_from_github( SHA512 0efb1845053b6143e5ee7fa081b8be98f6825262c59051e88b2be02497e23362055067b2f811eff82e93eb194e5a9afd2a12e3878a252eb4011a5dab95127a6f HEAD_REF master PATCHES + 6811.patch FindLZMA.patch # Will be fixed in 9.1? FindLZ4.patch Findproj.patch diff --git a/ports/vxl/CONTROL b/ports/vxl/CONTROL index d95016ac05c008..4e6ba9d27b76be 100644 --- a/ports/vxl/CONTROL +++ b/ports/vxl/CONTROL @@ -1,8 +1,7 @@ Source: vxl Version: 2.0.2 -Port-Version: 1 +Port-Version: 2 Build-Depends: bzip2, expat, libgeotiff, libjpeg-turbo, libpng, shapelib, tiff, zlib -# Build-Depends: bzip2, dcmtk, expat, libgeotiff, libjpeg-turbo, openjpeg, libpng, shapelib, tiff, zlib Description: A multi-platform collection of C++ software libraries for Computer Vision and Image Understanding. Feature: core-imaging diff --git a/ports/vxl/fix_dependency.patch b/ports/vxl/fix_dependency.patch index 1c8e2ad54921b2..88cecfd660c70d 100644 --- a/ports/vxl/fix_dependency.patch +++ b/ports/vxl/fix_dependency.patch @@ -1,13 +1,13 @@ -diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt -index b6af7c2..7ca75d3 100644 ---- a/core/CMakeLists.txt -+++ b/core/CMakeLists.txt -@@ -100,7 +100,7 @@ endif() - - - # coordinate systems --if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS) -+if(BUILD_CORE_GEOMETRY AND BUILD_CORE_NUMERICS AND BUILD_CORE_IMAGING) - add_subdirectory(vcsl) - add_subdirectory(vpgl) - endif() +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 3483f9c..57e149b 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -100,7 +100,7 @@ endif() + + + # coordinate systems +-if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS) ++if(VXL_BUILD_CORE_GEOMETRY AND VXL_BUILD_CORE_NUMERICS AND VXL_BUILD_CORE_IMAGING) + add_subdirectory(vcsl) + add_subdirectory(vpgl) + endif() diff --git a/ports/vxl/portfile.cmake b/ports/vxl/portfile.cmake index 232cfa3a534a9c..c3124ce202c978 100644 --- a/ports/vxl/portfile.cmake +++ b/ports/vxl/portfile.cmake @@ -1,8 +1,8 @@ -set(BUILD_CORE_IMAGING OFF) +set(VXL_BUILD_CORE_IMAGING OFF) if("core-imaging" IN_LIST FEATURES) - set(BUILD_CORE_IMAGING ON) + set(VXL_BUILD_CORE_IMAGING ON) if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openjpeg.h") - set(BUILD_CORE_IMAGING OFF) + set(VXL_BUILD_CORE_IMAGING OFF) message(WARNING "Can't build VXL CORE_IMAGING features with non built-in OpenJpeg. Please remove OpenJpeg, and try install VXL again if you need them.") endif() endif() @@ -18,7 +18,7 @@ vcpkg_from_github( ) set(USE_WIN_WCHAR_T OFF) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) set(USE_WIN_WCHAR_T ON) endif() @@ -26,9 +26,9 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DBUILD_EXAMPLES=OFF + -DVXL_BUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DBUILD_CORE_IMAGING=${BUILD_CORE_IMAGING} + -DVXL_BUILD_CORE_IMAGING=${VXL_BUILD_CORE_IMAGING} -DVXL_FORCE_V3P_BZLIB2=OFF -DVXL_USING_NATIVE_BZLIB2=TRUE # for disable build built-in bzip2 (v3p/bzlib/CMakeLists.txt#L10-L26) -DVXL_FORCE_V3P_CLIPPER=ON # TODO : need add clipper port to turn off @@ -41,7 +41,7 @@ vcpkg_configure_cmake( -DVXL_FORCE_V3P_TIFF=OFF -DVXL_FORCE_V3P_ZLIB=OFF -DVXL_USE_DCMTK=OFF # TODO : need fix dcmtk support to turn on - -DXVL_USE_GEOTIFF=ON + -DVXL_USE_GEOTIFF=ON -DVXL_USE_WIN_WCHAR_T=${USE_WIN_WCHAR_T} ) @@ -53,5 +53,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -# +file(INSTALL ${SOURCE_PATH}/core/vxl_copyright.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/wavpack/CONTROL b/ports/wavpack/CONTROL index e8edf703e09939..a0052e027638ef 100644 --- a/ports/wavpack/CONTROL +++ b/ports/wavpack/CONTROL @@ -1,4 +1,6 @@ Source: wavpack -Version: 5.2.0 +Version: 5.2.0 +Port-Version: 1 Homepage: https://github.com/dbry/WavPack Description: WavPack encode/decode library, command-line programs, and several plugins +Supports: !(arm|arm64) \ No newline at end of file diff --git a/ports/wavpack/portfile.cmake b/ports/wavpack/portfile.cmake index c59374aa36524d..f2b7d87cf1acca 100644 --- a/ports/wavpack/portfile.cmake +++ b/ports/wavpack/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" "arm64") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -24,13 +24,14 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) +else() + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/WavPack) +endif() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -# Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME wavpack) diff --git a/ports/winpcap/CONTROL b/ports/winpcap/CONTROL index 14960d89d86c2b..c745c2d96ae12f 100644 --- a/ports/winpcap/CONTROL +++ b/ports/winpcap/CONTROL @@ -1,4 +1,5 @@ Source: winpcap -Version: 4.1.3-3 +Version: 4.1.3 +Port-Version: 4 Homepage: https://www.winpcap.org Description: WinPcap is the industry-standard tool for link-layer network access in Windows environments. diff --git a/ports/winpcap/portfile.cmake b/ports/winpcap/portfile.cmake index 62183624fdd5df..8549c543d26c8a 100644 --- a/ports/winpcap/portfile.cmake +++ b/ports/winpcap/portfile.cmake @@ -45,12 +45,7 @@ vcpkg_extract_source_archive_ex( "${CMAKE_CURRENT_LIST_DIR}/fix-create-lib-batch.patch" ) -file( - COPY - "${CURRENT_PORT_DIR}/create_bin.bat" - DESTINATION - ${SOURCE_PATH} -) +file(COPY "${CURRENT_PORT_DIR}/create_bin.bat" DESTINATION ${SOURCE_PATH}) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(PLATFORM Win32) @@ -111,8 +106,7 @@ vcpkg_execute_required_process( LOGNAME create_include-${TARGET_TRIPLET} ) -file( - INSTALL +file(INSTALL "${SOURCE_PATH}/WpdPack/Include/bittypes.h" "${SOURCE_PATH}/WpdPack/Include/ip6_misc.h" "${SOURCE_PATH}/WpdPack/Include/Packet32.h" @@ -122,12 +116,9 @@ file( "${SOURCE_PATH}/WpdPack/Include/pcap-stdinc.h" "${SOURCE_PATH}/WpdPack/Include/remote-ext.h" "${SOURCE_PATH}/WpdPack/Include/Win32-Extensions.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include -) + DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file( - INSTALL +file(INSTALL "${SOURCE_PATH}/WpdPack/Include/pcap/bluetooth.h" "${SOURCE_PATH}/WpdPack/Include/pcap/bpf.h" "${SOURCE_PATH}/WpdPack/Include/pcap/namedb.h" @@ -135,9 +126,7 @@ file( "${SOURCE_PATH}/WpdPack/Include/pcap/sll.h" "${SOURCE_PATH}/WpdPack/Include/pcap/usb.h" "${SOURCE_PATH}/WpdPack/Include/pcap/vlan.h" - DESTINATION - ${CURRENT_PACKAGES_DIR}/include/pcap -) + DESTINATION ${CURRENT_PACKAGES_DIR}/include/pcap) vcpkg_execute_required_process( COMMAND ${SOURCE_PATH}/create_lib.bat @@ -150,21 +139,15 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(PCAP_LIBRARY_PATH "${PCAP_LIBRARY_PATH}/x64") endif() -file( - INSTALL +file(INSTALL "${PCAP_LIBRARY_PATH}/Packet.lib" "${PCAP_LIBRARY_PATH}/wpcap.lib" - DESTINATION - ${CURRENT_PACKAGES_DIR}/lib -) + DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file( - INSTALL +file(INSTALL "${PCAP_LIBRARY_PATH}/debug/Packet.lib" "${PCAP_LIBRARY_PATH}/debug/wpcap.lib" - DESTINATION - ${CURRENT_PACKAGES_DIR}/debug/lib -) + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_execute_required_process( @@ -178,21 +161,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(PCAP_BINARY_PATH "${PCAP_BINARY_PATH}/x64") endif() - file( - INSTALL + file(INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION - ${CURRENT_PACKAGES_DIR}/bin - ) + DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file( - INSTALL + file(INSTALL "${PCAP_BINARY_PATH}/Packet.dll" "${PCAP_BINARY_PATH}/wpcap.dll" - DESTINATION - ${CURRENT_PACKAGES_DIR}/debug/bin - ) + DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) endif() -configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/winpcap/copyright COPYONLY) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/pcap-stdinc.h "#define inline __inline" "#ifndef __cplusplus\n#define inline __inline\n#endif") + +configure_file(${COPYRIGHT} ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/wpilib/CONTROL b/ports/wpilib/CONTROL index deef611ea76479..913521505e8b5f 100644 --- a/ports/wpilib/CONTROL +++ b/ports/wpilib/CONTROL @@ -1,8 +1,9 @@ Source: wpilib -Version: 2020.1.1 +Version: 2020.3.2 Homepage: https://github.com/wpilibsuite/allwpilib Build-Depends: eigen3, libuv Description: WPILib is the software library package for the FIRST Robotics Competition. The core install includes wpiutil, a common utilies library, and ntcore, the base NetworkTables library. +Supports: !osx Feature: cameraserver Build-Depends: opencv diff --git a/ports/wpilib/portfile.cmake b/ports/wpilib/portfile.cmake index 15041d84ba55cf..cbe4051f75fec1 100644 --- a/ports/wpilib/portfile.cmake +++ b/ports/wpilib/portfile.cmake @@ -3,30 +3,23 @@ vcpkg_fail_port_install(ON_TARGET "OSX") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wpilibsuite/allwpilib - REF e874ba9313a8243aa18eefb13e1d88a3999dd80e - SHA512 9a2e7abb3739008ed59e716d241a4ec8f0848c655ae8bb7e5bd98090109d6d86115c97ef16ea8881cc28715b691d873ab7be77b515efed8c361cb1f47745697f + REF 35eb90c135eba994a2ca2cbd50a68c367910f4b6 + SHA512 55bc608632ab67c097f3cce7c5ad9790b2b123a633c93bf5b4008f90bf79538cc142c911850d5f49b75e3a12f43ffad9f6f5f9bcdf1351cce7513ecc4b04e439 ) -set(WITHOUT_JAVA ON) -set(WITHOUT_CSCORE ON) -set(WITHOUT_ALLWPILIB ON) - -if ("cameraserver" IN_LIST FEATURES) - set(WITHOUT_CSCORE OFF) -endif() - -if ("allwpilib" IN_LIST FEATURES) - set(WITHOUT_ALLWPILIB OFF) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + cameraserver WITHOUT_CSCORE + allwpilib WITHOUT_ALLWPILIB +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DWITHOUT_JAVA=${WITHOUT_JAVA} - -DWITHOUT_CSCORE=${WITHOUT_CSCORE} - -DWITHOUT_ALLWPILIB=${WITHOUT_ALLWPILIB} + -DWITHOUT_JAVA=ON + ${FEATURE_OPTIONS} -DUSE_VCPKG_LIBUV=ON -DUSE_VCPKG_EIGEN=ON -DFLAT_INSTALL_WPILIB=ON @@ -35,26 +28,27 @@ vcpkg_install_cmake() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/ntcore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpiutil/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -if (NOT WITHOUT_ALLWPILIB) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/gen/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) + +if ("allwpilib" IN_LIST FEATURES) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/wpilibc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/hal/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/gen) endif() -if (NOT WITHOUT_CSCORE) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + +if ("cameraserver" IN_LIST FEATURES) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cameraserver/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/include/cscore/ DESTINATION ${CURRENT_PACKAGES_DIR}/include) endif() if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dll") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dll") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.so") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.so") - file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") - file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin FILES_MATCHING PATTERN "*.dylib") + file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin FILES_MATCHING PATTERN "*.dylib") endif() file(COPY ${CURRENT_PACKAGES_DIR}/wpilib/lib/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib FILES_MATCHING PATTERN "*.lib") @@ -65,4 +59,4 @@ file(COPY ${CURRENT_PACKAGES_DIR}/debug/wpilib/lib/ DESTINATION ${CURRENT_PACKAG vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wpilib RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/wtl/CONTROL b/ports/wtl/CONTROL index 63f618d9b656cd..db55ce52f709d0 100644 --- a/ports/wtl/CONTROL +++ b/ports/wtl/CONTROL @@ -1,4 +1,4 @@ Source: wtl -Version: 10.0-10 +Version: 10.0.10077 Homepage: https://sourceforge.net/projects/wtl/ Description: Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. diff --git a/ports/wtl/portfile.cmake b/ports/wtl/portfile.cmake index e72367e73dd3d6..0f8d189a867d4a 100644 --- a/ports/wtl/portfile.cmake +++ b/ports/wtl/portfile.cmake @@ -1,10 +1,10 @@ vcpkg_from_sourceforge( OUT_SOURCE_PATH SOURCE_PATH REPO wtl/WTL%2010 - REF WTL%2010.0.9163 - FILENAME "WTL10_9163.zip" + REF WTL%2010.0.10077 + FILENAME "WTL10_1077..zip" NO_REMOVE_ONE_LEVEL - SHA512 feb7fb1c456e44ad05610f31f8c0f964eb6ce3eadf65a389219051f0ea2547069727666616622631cd90e25ea4a682a7c88c7089a374181870717246ad44e035 + SHA512 5a49283196caf5b2ad8a3fb3cfa5d09cd555d59d4d5871408bf6a5b850cf4546cc6ece4e0bf79d152a4d2589fae3749f0f3e73ab6a3a7bc0cb373efa1474b98b ) file(INSTALL ${SOURCE_PATH}/Include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT} FILES_MATCHING PATTERN "*.h") diff --git a/ports/wxwidgets/CONTROL b/ports/wxwidgets/CONTROL index e69ead3add70a4..357ab8f8b0b59a 100644 --- a/ports/wxwidgets/CONTROL +++ b/ports/wxwidgets/CONTROL @@ -1,5 +1,6 @@ Source: wxwidgets -Version: 3.1.3-1 +Version: 3.1.4 +Port-Version: 1 Homepage: https://github.com/wxWidgets/wxWidgets Description: wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. -Build-Depends: zlib, libpng, tiff, expat +Build-Depends: zlib, libpng, tiff, expat \ No newline at end of file diff --git a/ports/wxwidgets/disable-platform-lib-dir.patch b/ports/wxwidgets/disable-platform-lib-dir.patch index 2a1de613eed16f..930477c010327d 100644 --- a/ports/wxwidgets/disable-platform-lib-dir.patch +++ b/ports/wxwidgets/disable-platform-lib-dir.patch @@ -1,13 +1,13 @@ diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake -index 06256b1..2960a31 100644 +index d013e92..c03135d 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake -@@ -66,7 +66,7 @@ else() +@@ -149,7 +149,7 @@ else() set(wxCOMPILER_PREFIX) endif() --if(MSVC OR MINGW) -+if((MSVC OR MINGW) AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) +-if(MSVC) ++if(MSVC AND NOT wxBUILD_DISABLE_PLATFORM_LIB_DIR) if(wxBUILD_SHARED) set(lib_suffix "dll") else() diff --git a/ports/wxwidgets/fix-macos-clipboard.patch b/ports/wxwidgets/fix-macos-clipboard.patch deleted file mode 100644 index 9f37cc1d9e1d36..00000000000000 --- a/ports/wxwidgets/fix-macos-clipboard.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp -index 274e200..6012d37 100644 ---- a/src/osx/carbon/clipbrd.cpp -+++ b/src/osx/carbon/clipbrd.cpp -@@ -60,7 +60,11 @@ void wxClipboard::Clear() - - bool wxClipboard::Flush() - { -- return false; -+ wxCHECK_MSG( m_open, false, wxT("clipboard not open") ); -+ -+ wxOSXPasteboard::GetGeneralClipboard()->Flush(); -+ -+ return true; - } - - bool wxClipboard::Open() -@@ -105,6 +109,8 @@ bool wxClipboard::AddData( wxDataObject *data ) - - data->WriteToSink(wxOSXPasteboard::GetGeneralClipboard()); - -+ Flush(); -+ - m_data = data; - - return true; diff --git a/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch b/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch new file mode 100644 index 00000000000000..e028112e7ece62 --- /dev/null +++ b/ports/wxwidgets/fix-stl-build-vs2019-16.6.patch @@ -0,0 +1,202 @@ +From 590e32c60b1dfb32b34632f3d1b0b5cf7c8e4b84 Mon Sep 17 00:00:00 2001 +From: Maarten Bent +Date: Sat, 1 Aug 2020 11:54:26 +0200 +Subject: [PATCH] Fix building with wxUSE_STL enabled in VS2019 16.6 + +Exporting standard C++ library types is not allowed any more, see + +https://developercommunity.visualstudio.com/content/problem/1042081/142628801includexhash201332-error-c2338-this-funct.html + +so don't use DLL export declarations for wxHash{Map,Set} classes, which +derive from std::{map,set}. + +Since the classes are header-only, this should have no direct +consequences. Only classes that extend wxHashMap or wxHashSet, like +wxImageHistogram, have to be made header only as well. + +Remove the wxLogError message in wxImageHistogram::FindFirstUnusedColour, so +log.h and translation.h do not have to be included in the header. + +Closes https://github.com/wxWidgets/wxWidgets/pull/2009 +--- + include/wx/hashmap.h | 9 ++++++--- + include/wx/hashset.h | 6 ++++-- + include/wx/image.h | 42 ++++++++++++++++++++++++++++++++++++++---- + src/common/image.cpp | 43 ------------------------------------------- + 4 files changed, 48 insertions(+), 52 deletions(-) + +diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h +index df9092a3823..86700f40ca9 100644 +--- a/include/wx/hashmap.h ++++ b/include/wx/hashmap.h +@@ -678,24 +678,27 @@ public: \ + + // and these do exactly the same thing but should be used inside the + // library ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, \ + CLASSNAME, class WXDLLIMPEXP_CORE ) + ++// note: DECL is not used since the class is inline + #define WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ + _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ +- CLASSNAME, DECL ) ++ CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ + WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ + class WXDLLIMPEXP_CORE ) + ++// note: DECL is not used since the class is inline + #define WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ + _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ +- CLASSNAME, DECL ) ++ CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ + WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ +diff --git a/include/wx/hashset.h b/include/wx/hashset.h +index bb713b87f4f..311aeca9a6e 100644 +--- a/include/wx/hashset.h ++++ b/include/wx/hashset.h +@@ -159,8 +159,9 @@ public: \ + + // and these do exactly the same thing but should be used inside the + // library ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, class ) + + #define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \ +@@ -173,8 +174,9 @@ public: \ + // common compilers (notably Sun CC). + #define WX_DECLARE_HASH_SET_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ + _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) ++// note: DECL is not used since the class is inline + #define WX_DECLARE_HASH_SET_WITH_DECL_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ +- _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, DECL ) ++ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) + + // delete all hash elements + // +diff --git a/include/wx/image.h b/include/wx/image.h +index f2b5866d2d7..d53ff0b1165 100644 +--- a/include/wx/image.h ++++ b/include/wx/image.h +@@ -190,7 +190,7 @@ WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry, + wxIntegerHash, wxIntegerEqual, + wxImageHistogramBase); + +-class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase ++class wxImageHistogram : public wxImageHistogramBase + { + public: + wxImageHistogram() : wxImageHistogramBase(256) { } +@@ -211,9 +211,43 @@ class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase + bool FindFirstUnusedColour(unsigned char *r, + unsigned char *g, + unsigned char *b, +- unsigned char startR = 1, +- unsigned char startG = 0, +- unsigned char startB = 0 ) const; ++ unsigned char r2 = 1, ++ unsigned char g2 = 0, ++ unsigned char b2 = 0 ) const ++ { ++ unsigned long key = MakeKey(r2, g2, b2); ++ ++ while ( find(key) != end() ) ++ { ++ // color already used ++ r2++; ++ if ( r2 >= 255 ) ++ { ++ r2 = 0; ++ g2++; ++ if ( g2 >= 255 ) ++ { ++ g2 = 0; ++ b2++; ++ if ( b2 >= 255 ) ++ { ++ return false; ++ } ++ } ++ } ++ ++ key = MakeKey(r2, g2, b2); ++ } ++ ++ if ( r ) ++ *r = r2; ++ if ( g ) ++ *g = g2; ++ if ( b ) ++ *b = b2; ++ ++ return true; ++ } + }; + + //----------------------------------------------------------------------------- +diff --git a/src/common/image.cpp b/src/common/image.cpp +index 096f823f0c1..880c1c4ea74 100644 +--- a/src/common/image.cpp ++++ b/src/common/image.cpp +@@ -3381,49 +3381,6 @@ wxImageHandler::GetResolutionFromOptions(const wxImage& image, int *x, int *y) + // image histogram stuff + // ---------------------------------------------------------------------------- + +-bool +-wxImageHistogram::FindFirstUnusedColour(unsigned char *r, +- unsigned char *g, +- unsigned char *b, +- unsigned char r2, +- unsigned char g2, +- unsigned char b2) const +-{ +- unsigned long key = MakeKey(r2, g2, b2); +- +- while ( find(key) != end() ) +- { +- // color already used +- r2++; +- if ( r2 >= 255 ) +- { +- r2 = 0; +- g2++; +- if ( g2 >= 255 ) +- { +- g2 = 0; +- b2++; +- if ( b2 >= 255 ) +- { +- wxLogError(_("No unused colour in image.") ); +- return false; +- } +- } +- } +- +- key = MakeKey(r2, g2, b2); +- } +- +- if ( r ) +- *r = r2; +- if ( g ) +- *g = g2; +- if ( b ) +- *b = b2; +- +- return true; +-} +- + bool + wxImage::FindFirstUnusedColour(unsigned char *r, + unsigned char *g, diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 530605782383e2..c862fec3899d68 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -1,11 +1,12 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wxWidgets/wxWidgets - REF v3.1.3 - SHA512 4ecb5c2d13f9bda7aa3c12e887c351a0004509ec24bdd440542bec67e1b6dca20e7838a01236a71dd3cf2e1ba0653c40878047f406464cb2c9ee07c26d6f2599 + REF v3.1.4 + SHA512 108e35220de10afbfc58762498ada9ece0b3166f56a6d11e11836d51bfbaed1de3033c32ed4109992da901fecddcf84ce8a1ba47303f728c159c638dac77d148 HEAD_REF master - PATCHES disable-platform-lib-dir.patch fix-macos-clipboard.patch + PATCHES + disable-platform-lib-dir.patch + fix-stl-build-vs2019-16.6.patch ) set(OPTIONS) @@ -37,6 +38,8 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") @@ -56,14 +59,16 @@ if(DLLS) endforeach() endif() -# Handle copyright -file(COPY ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/wxwidgets/licence.txt ${CURRENT_PACKAGES_DIR}/share/wxwidgets/copyright) +# do the copy pdbs now after the dlls got moved to the expected /bin folder above +vcpkg_copy_pdbs() if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) endif() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/mswu) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/mswud) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index b49bf0a7729147..0a4af3912f140f 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -1,5 +1,6 @@ Source: x264 -Version: 157-303c484ec828ed0-8 +Version: 157-303c484ec828ed0 +Port-Version: 9 Homepage: https://github.com/mirror/x264 Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format -Build-Depends: pthread (linux&osx) \ No newline at end of file +Build-Depends: pthread (linux&osx) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index d7aff89d7b49b5..1c9e32e9251816 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -12,9 +12,24 @@ vcpkg_from_github( "uwp-cflags.patch" ) +if(VCPKG_TARGET_IS_WINDOWS) + _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) + _vcpkg_determine_autotools_target_cpu(HOST_ARCH) + list(APPEND OPTIONS --build=${BUILD_ARCH}-pc-mingw32) + list(APPEND OPTIONS --host=${HOST_ARCH}-pc-mingw32) +endif() + +if(VCPKG_TARGET_IS_UWP) + list(APPEND OPTIONS --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) + list(APPEND OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) +endif() + + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} + NO_ADDITIONAL_PATHS OPTIONS + ${OPTIONS} --enable-strip --disable-lavf --disable-swscale @@ -24,21 +39,17 @@ vcpkg_configure_make( --disable-lsmash --disable-asm --enable-debug + ) vcpkg_install_make() -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) +vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN) -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig - ${CURRENT_PACKAGES_DIR}/debug/bin/x264.exe - ${CURRENT_PACKAGES_DIR}/debug/include -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/x264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/x264.lib) else() # force U_STATIC_IMPLEMENTATION macro file(READ ${CURRENT_PACKAGES_DIR}/include/x264.h HEADER_CONTENTS) @@ -51,6 +62,8 @@ else() ) endif() +vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES -lpthread -lm -ldl) + vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/xbyak/CONTROL b/ports/xbyak/CONTROL index 05a1956cfbd798..5239d99c4b20d7 100644 --- a/ports/xbyak/CONTROL +++ b/ports/xbyak/CONTROL @@ -1,5 +1,5 @@ Source: xbyak -Version: 5.911 +Version: 5.93 Description: Xbyak is a JIT assembler for x86(IA-32)/x64(AMD64, x86-64). Homepage: https://github.com/herumi/xbyak Supports: !(arm|uwp) diff --git a/ports/xbyak/portfile.cmake b/ports/xbyak/portfile.cmake index b07b372f307168..b365c38fc29302 100644 --- a/ports/xbyak/portfile.cmake +++ b/ports/xbyak/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO herumi/xbyak - REF v5.911 - SHA512 3cb6b1e73d7dc2a23dcb31310720f0d4b83b62cfc69ff09eeefafe032e58e04574419f668d5ca957e8fc21e679e25da059f6e93724949e0ff1fcaa6779b88bdd + REF v5.93 + SHA512 0c7052b2aeffc1aec541991a644753327232428ba7d8719e250a3afcc66b26beca2b92476f17af8121ceaacd822515e65d082e94b9f72fa29b4a005e32065843 HEAD_REF master ) diff --git a/ports/xeus/Fix-Compile-nlohmann-json.patch b/ports/xeus/Fix-Compile-nlohmann-json.patch new file mode 100644 index 00000000000000..7381d14caaedfb --- /dev/null +++ b/ports/xeus/Fix-Compile-nlohmann-json.patch @@ -0,0 +1,12 @@ +diff --git a/src/xmessage.cpp b/src/xmessage.cpp +index 0d6ad99..621d838 100644 +--- a/src/xmessage.cpp ++++ b/src/xmessage.cpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #include "xeus/xguid.hpp" + #include "xeus/xmessage.hpp" diff --git a/ports/xeus/portfile.cmake b/ports/xeus/portfile.cmake index 5dd646d7fa0fa8..577dbff1cb02c5 100644 --- a/ports/xeus/portfile.cmake +++ b/ports/xeus/portfile.cmake @@ -4,7 +4,9 @@ vcpkg_from_github( REF 8408f237f33514610a59d19a5ff045ee70dfa02b SHA512 41282addbe5519b6d357e802c48483834cd951604bfeb8c99d96f02d03dec2fc66ea4c091f40ec09348bb60587e8a6efef5e6eb2bb950ba720fc8ceb7a107960 HEAD_REF master - PATCHES Fix-TypeConversion.patch + PATCHES + Fix-TypeConversion.patch + Fix-Compile-nlohmann-json.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) diff --git a/ports/xframe/CONTROL b/ports/xframe/CONTROL new file mode 100644 index 00000000000000..a9b7721c116cd3 --- /dev/null +++ b/ports/xframe/CONTROL @@ -0,0 +1,5 @@ +Source: xframe +Version: 0.3.0 +Description: xframe is a dataframe for C++, based on xtensor and xtl. +Homepage: https://github.com/xtensor-stack/xframe +Build-Depends: xtensor, xtl diff --git a/ports/xframe/portfile.cmake b/ports/xframe/portfile.cmake new file mode 100644 index 00000000000000..cb3111bd984d20 --- /dev/null +++ b/ports/xframe/portfile.cmake @@ -0,0 +1,22 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO xtensor-stack/xframe + REF 0.3.0 + SHA512 880fe8ca00bd189a197cc71e5f32539562db69433fdfa03db5f0db8211230db36eb96757a5ca3c667ae1d4edc96eae38393718e7a1e3f7c1827130cf21579b07 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/xframe) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index b02b948ad50f87..3196577b552b85 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,5 +1,5 @@ Source: zlib Version: 1.2.11 -Port-Version: 7 +Port-Version: 8 Homepage: https://www.zlib.net/ Description: A compression library diff --git a/ports/zlib/add_debug_postfix_on_mingw.patch b/ports/zlib/add_debug_postfix_on_mingw.patch new file mode 100644 index 00000000000000..22172ccfcaaef0 --- /dev/null +++ b/ports/zlib/add_debug_postfix_on_mingw.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939d..e4fc213 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,7 @@ endif() + # + check_include_file(unistd.h Z_HAVE_UNISTD_H) + +-if(MSVC) ++if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index c05e7e252aceab..14faef4c8f3512 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_extract_source_archive_ex( REF ${VERSION} PATCHES "cmake_dont_build_more_than_needed.patch" + "add_debug_postfix_on_mingw.patch" ) # This is generated during the cmake build diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index 80c547633e3a11..cda29f7e6aa051 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -23,6 +23,9 @@ stages: displayName: Check the formatting of port manifests pool: $(windows-pool) dependsOn: [] + variables: + - name: VCPKG_DOWNLOADS + value: D:\downloads jobs: - job: workspace: @@ -32,7 +35,7 @@ stages: displayName: 'Check port manifest Formatting' inputs: filePath: 'scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1' - arguments: '-Root . -Downloads D:\Downloads' + arguments: '-Root .' - stage: run_port_ci displayName: 'Run the Port CI' dependsOn: diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 index b0e44765750b7e..43ec7aa73ede28 100644 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests.ps1 @@ -158,8 +158,13 @@ Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" Require-FileNotExists "$buildtreesRoot/rapidjson/src" Require-FileExists "$TestingRoot/packages.config" -& $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" -Throw-IfFailed +if ($IsLinux -or $IsMacOS) { + mono $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" + Throw-IfFailed +} else { + & $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" + Throw-IfFailed +} Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue mkdir $NuGetRoot @@ -177,3 +182,15 @@ Require-FileExists "$buildtreesRoot/tinyxml/src" if ((Get-ChildItem $NuGetRoot -Filter '*.nupkg' | Measure-Object).Count -ne 1) { throw "In '$CurrentTest': did not create exactly 1 NuGet package" } + +# Test export +$args = $commonArgs + @("export","rapidjson","tinyxml","--nuget","--nuget-id=vcpkg-export","--nuget-version=1.0.0","--output=vcpkg-export-output","--raw","--zip","--output-dir=$TestingRoot") +$CurrentTest = "./vcpkg $($args -join ' ')" +Write-Host $CurrentTest +Require-FileNotExists "$TestingRoot/vcpkg-export-output" +Require-FileNotExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" +Require-FileNotExists "$TestingRoot/vcpkg-export-output.zip" +./vcpkg @args +Require-FileExists "$TestingRoot/vcpkg-export-output" +Require-FileExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" +Require-FileExists "$TestingRoot/vcpkg-export-output.zip" diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index 4d4eada627cbca..969348980b779c 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -9,6 +9,12 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: /mnt/vcpkg-ci + - name: VCPKG_DOWNLOADS + value: /mnt/vcpkg-ci/downloads + steps: - bash: df -h displayName: 'Report on Disk Space' @@ -19,17 +25,15 @@ jobs: displayName: 'Create /home/agent' # Note: /mnt is the Azure machines' temporary disk. - bash: | - sudo mkdir /mnt/vcpkg-ci -m=777 - sudo mkdir /mnt/vcpkg-ci/downloads -m=777 + sudo mkdir ${{ variables.WORKING_ROOT }} -m=777 + sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} -m=777 exit 0 - displayName: 'Create /mnt/vcpkg-ci/downloads' + displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh arguments: "-buildTests" - env: - VCPKG_DOWNLOADS: '/mnt/vcpkg-ci/downloads' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' - task: PowerShell@2 @@ -37,7 +41,7 @@ jobs: inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot /mnt/vcpkg-ci -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -ArchivesRoot /archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md index b0fdde43464c6b..0395908f0174f0 100644 --- a/scripts/azure-pipelines/osx/README.md +++ b/scripts/azure-pipelines/osx/README.md @@ -25,7 +25,7 @@ and `Setup-VagrantMachines.ps1`, and make sure to push any changes! Before anything else, one must download `brew` and `powershell`. ```sh -$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" $ brew cask install powershell ``` diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 index fb153a28ab26b5..5600cb1ed6fc84 100755 --- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 +++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -19,7 +19,7 @@ The username for the archives share. .PARAMETER ArchivesAccessKey The access key for the archives share. -.PARAMETER ArchivesUri +.PARAMETER ArchivesUrn The URN of the archives share; looks like `foo.windows.core.net`. .PARAMETER ArchivesShare @@ -105,7 +105,7 @@ $configuration = @{ archives = @{ username = $ArchivesUsername; access_key = $ArchivesAccessKey; - url = $ArchivesUri; + urn = $ArchivesUrn; share = $ArchivesShare; }; } diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1 index 6fffa15225944d..b7ad489bb7995a 100644 --- a/scripts/azure-pipelines/osx/Utilities.psm1 +++ b/scripts/azure-pipelines/osx/Utilities.psm1 @@ -31,7 +31,7 @@ function Get-CommandExists [String]$Name ) - $null -ne (Get-Command -Name $Command -ErrorAction SilentlyContinue) + $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) } <# @@ -124,6 +124,7 @@ function Get-InstalledVirtualBoxExtensionPacks $currentString = "" $lines | ForEach-Object { + $Line = $_ if ($Line[0] -eq ' ') { $currentString += "`n$($Line.Trim())" } else { diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index cbf401fd353644..6e48238a7e2a7b 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -10,6 +10,12 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: /Users/vagrant/Data + - name: VCPKG_DOWNLOADS + value: /Users/vagrant/Data/downloads + steps: - bash: | df -h @@ -22,27 +28,32 @@ jobs: brew list libtool || brew install libtool brew list bison || brew install bison brew list gfortran || brew cask install gfortran + brew list mono || brew install mono + brew list yasm || brew install yasm displayName: 'Install brew dependencies' - bash: | - sudo mkdir /Users/vagrant/Data/downloads || 0 - sudo chmod 777 /Users/vagrant/Data/downloads || 0 + sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} || 0 + sudo chmod 777 ${{ variables.VCPKG_DOWNLOADS }} || 0 exit 0 - displayName: 'Create /Users/vagrant/Data/downloads' + displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' - task: Bash@3 displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh arguments: '-buildTests' - env: - VCPKG_DOWNLOADS: '/Users/vagrant/Data/downloads' - bash: toolsrc/build.rel/vcpkg-test displayName: 'Run vcpkg tests' + - task: PowerShell@2 + displayName: 'Run vcpkg end-to-end tests' + inputs: + filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' + arguments: '-Triplet x64-osx -WorkingRoot ${{ variables.WORKING_ROOT }}' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot /Users/vagrant/Data/archives -WorkingRoot /Users/vagrant/Data -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -ArchivesRoot ${{ variables.WORKING_ROOT }}/archives -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' - bash: | df -h displayName: 'Report on Disk Space After Build' diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile index b142b8189a95c2..1e1cce50f06c99 100644 --- a/scripts/azure-pipelines/osx/configuration/VagrantFile +++ b/scripts/azure-pipelines/osx/configuration/VagrantFile @@ -29,7 +29,7 @@ devops_url = 'https://dev.azure.com/vcpkg' agent_pool = 'vcpkgAgentPool' pat = configuration['pat'] archives = configuration['archives'] -archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['url']}/#{archives['share']}" +archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}" Vagrant.configure('2') do |config| # give them extra time to boot up @@ -42,7 +42,25 @@ Vagrant.configure('2') do |config| node.vm.hostname = machine[:hostname] node.vm.synced_folder '.', '/vagrant', disabled: true - node.vm.disk :disk, name: "#{machine[:hostname]}-data", size: "#{config['disk_size']}GB" + diskname = "#{machine[:hostname]}-data.vmdk" + + # I don't like this, but as far as I can tell, it's the only way + # to do this. When vagrant finishes the `disk` feature, switch + # over to that -- Nicole Mazzuca + if (not File.exists? diskname) then + system "VBoxManage createmedium --filename #{diskname} --size #{1024 * 220}" + end + + node.vm.provider 'virtualbox' do |vb| + vb.memory = machine[:ram] + vb.cpus = machine[:cpu] + vb.customize ['modifyvm', :id, '--ioapic', 'on'] + vb.customize ['storageattach', :id, + '--storagectl', 'SATA Controller', + '--port', '1', '--device', '0', '--type', 'hdd', + '--medium', "#{diskname}" + ] + end node.vm.provision 'shell', run: 'once', @@ -71,7 +89,7 @@ Vagrant.configure('2') do |config| node.vm.provision 'shell', run: 'once', name: 'Install brew and xcode command line tools', - inline: '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"', + inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', privileged: false node.vm.provision 'shell', diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json index 0518df3b6f1f43..f0abc1673419ce 100644 --- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json +++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -34,13 +34,13 @@ "required": [ "username", "access_key", - "url", + "urn", "share" ], "properties": { "username": { "type": "string" }, "access_key": { "type": "string" }, - "url": { "type": "string" }, + "urn": { "type": "string" }, "share": { "type": "string" } } } diff --git a/scripts/azure-pipelines/test-modified-ports.ps1 b/scripts/azure-pipelines/test-modified-ports.ps1 index 9a30321b4637be..27ff3290ca0d27 100755 --- a/scripts/azure-pipelines/test-modified-ports.ps1 +++ b/scripts/azure-pipelines/test-modified-ports.ps1 @@ -52,7 +52,8 @@ $commonArgs = @( '--binarycaching', "--x-buildtrees-root=$buildtreesRoot", "--x-install-root=$installRoot", - "--x-packages-root=$packagesRoot" + "--x-packages-root=$packagesRoot", + "--overlay-ports=scripts/test_ports" ) $binaryCachingMode = 'readwrite' diff --git a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 index 7f300164f6b060..2adeeae45cdb19 100644 --- a/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-CxxFormatting.ps1 @@ -32,9 +32,9 @@ try $msg = @( "", "The formatting of the C++ files didn't match our expectation.", - "If your build fails here, you need to format the following files with:" + "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#vcpkg-internal-code for solution." ) - $msg += " $(& $clangFormat -version)" + $msg += "File list:" $msg += " $changedFiles" $msg += "" diff --git a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 index e4f52ae7b44627..6e97ba35c7f74f 100644 --- a/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 +++ b/scripts/azure-pipelines/windows/Check-ManifestFormatting.ps1 @@ -3,8 +3,6 @@ Param( [Parameter(Mandatory=$True)] [string]$Root, [Parameter()] - [string]$DownloadsDirectory, - [Parameter()] [switch]$IgnoreErrors # allows one to just format ) @@ -16,11 +14,6 @@ if (-not (Test-Path "$Root/.vcpkg-root")) throw } -if (-not [string]::IsNullOrEmpty($DownloadsDirectory)) -{ - $env:VCPKG_DOWNLOADS = $DownloadsDirectory -} - if (-not (Test-Path "$Root/vcpkg.exe")) { & "$Root/bootstrap-vcpkg.bat" @@ -32,15 +25,20 @@ if (-not (Test-Path "$Root/vcpkg.exe")) } & "$Root/vcpkg.exe" 'x-format-manifest' '--all' +if (-not $?) +{ + Write-Error "Failed formatting manifests; are they well-formed?" + throw +} + $changedFiles = & "$PSScriptRoot/Get-ChangedFiles.ps1" -Directory $portsTree if (-not $IgnoreErrors -and $null -ne $changedFiles) { $msg = @( "", "The formatting of the manifest files didn't match our expectation.", - "If your build fails here, you need to run:" + "See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifest for solution." ) - $msg += " vcpkg x-format-manifest --all" $msg += "" $msg += "vcpkg should produce the following diff:" diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 5ec0b300c290b0..340138e124ac7f 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -9,6 +9,11 @@ jobs: workspace: clean: resources timeoutInMinutes: 1440 # 1 day + variables: + - name: WORKING_ROOT + value: D:\ + - name: VCPKG_DOWNLOADS + value: D:\downloads steps: - task: PowerShell@2 @@ -21,35 +26,35 @@ jobs: inputs: filePath: 'scripts/azure-pipelines/windows/disk-space.ps1' # Note: D: is the Azure machines' temporary disk. - - task: CmdLine@2 + - script: .\bootstrap-vcpkg.bat displayName: 'Build vcpkg' - inputs: - script: | - set VCPKG_DOWNLOADS=D:\downloads - .\bootstrap-vcpkg.bat - task: CmdLine@2 displayName: "Build vcpkg with CMake and Run Tests" condition: eq('${{ parameters.triplet }}', 'x86-windows') inputs: script: | :: TRANSITION, get these tools on the VMs next time we roll them - set VCPKG_DOWNLOADS=D:\downloads .\vcpkg.exe fetch cmake .\vcpkg.exe fetch ninja - set PATH=D:\downloads\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;D:\downloads\tools\ninja-1.10.0-windows;%PATH% + set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.17.2-windows\cmake-3.17.2-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.0-windows;%PATH% call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 rmdir /s /q build.x86.debug > nul 2> nul cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc ninja.exe -C build.x86.debug build.x86.debug\vcpkg-test.exe - powershell.exe -NoProfile -ExecutionPolicy Bypass "scripts\azure-pipelines\end-to-end-tests.ps1 -WorkingRoot \"%cd%\testing\" -triplet x86-windows" failOnStderr: true + - task: PowerShell@2 + displayName: 'Run vcpkg end-to-end tests' + condition: eq('${{ parameters.triplet }}', 'x86-windows') + inputs: + filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' + arguments: '-Triplet ${{ parameters.triplet }} -WorkingRoot ${{ variables.WORKING_ROOT }}' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: failOnStderr: true filePath: 'scripts/azure-pipelines/test-modified-ports.ps1' - arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot D:\ -ArtifactsDirectory $(System.ArtifactsDirectory)' + arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -ArchivesRoot W:\ -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactsDirectory $(System.ArtifactsDirectory)' - task: PowerShell@2 displayName: 'Report on Disk Space After Build' condition: always() @@ -68,7 +73,6 @@ jobs: inputs: targetType: inline script: | - $env:VCPKG_DOWNLOADS = "D:\downloads" ./vcpkg.exe fetch python3 & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\ - task: PublishBuildArtifacts@1 diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index 992cf37a29981a..8136a9799eb8aa 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -11,25 +11,68 @@ if ($null -eq $portsDir) $portsDir = "$scriptsDir/../../ports" } +# Optionally clear this array when moving to a new boost version +$port_versions = @{ + "asio" = 1; + "context" = 1; + "coroutine" = 1; + "fiber" = 1; + "filesystem" = 1; + "graph-parallel" = 1; + "iostreams" = 1; + "locale" = 1; + "log" = 1; + "mpi" = 1; + "parameter-python" = 1; + "poly-collection" = 1; + "python" = 1; + "safe-numerics" = 1; + "stacktrace" = 1; + "test" = 1; + "wave" = 1; + "boost" = 1 +} + +$per_port_data = @{ + "fiber" = @{ "supports" = "windows&!uwp&!arm" }; + "filesystem" = @{ "supports" = "!uwp" }; + "iostreams" = @{ "supports" = "!uwp" }; + "context" = @{ "supports" = "!uwp" }; + "stacktrace" = @{ "supports" = "!uwp" }; + "coroutine" = @{ "supports" = "!arm&!uwp" }; + "test" = @{ "supports" = "!uwp" }; + "wave" = @{ "supports" = "!uwp" }; + "log" = @{ "supports" = "!uwp" }; + "locale" = @{ + "supports" = "!uwp"; + "features" = @( + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Locale" + )}; + "python" = @{ + "supports" = "!uwp&!(arm&windows)"; + "features" = @( + "Feature: python2" + "Build-Depends: python2 (windows)" + "Description: Build with Python2 support" + )}; + "regex" = @{ "features" = @( + "Feature: icu" + "Build-Depends: icu" + "Description: ICU backend for Boost.Regex" + )} +} + function TransformReference() { param ( [string]$library ) - if ($library -match "fiber") - { - # these only work on windows desktop - "$library (windows)" - } - elseif ($library -match "type[_-]erasure|contract") + if ($per_port_data[$library].supports) { - # These only work on x86-derived processors - "$library (!arm)" - } - elseif ($library -match "iostreams|filesystem|context|stacktrace|coroutine`$|locale|test|wave|log`$") - { - "$library (!uwp)" + "$library ($($per_port_data[$library].supports))" } else { @@ -49,48 +92,28 @@ function Generate() $controlDeps = ($Depends | sort) -join ", " - $versionSuffix = "" - - # if ($PortName -eq "") - # { - # $versionSuffix = "-1" - # } - mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null $controlLines = @( "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost-$PortName" - "Version: $version$versionSuffix" + "Version: $version" + ) + if ($port_versions[$PortName]) + { + $controlLines += @("Port-Version: $($port_versions[$PortName])") + } + $controlLines += @( "Build-Depends: $controlDeps" "Homepage: https://github.com/boostorg/$Name" "Description: Boost $Name module" ) - if ($PortName -eq "locale") + if ($per_port_data[$PortName].supports) { - $controlLines += @( - "" - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Locale" - ) - } - if ($PortName -eq "python") - { - $controlLines += @( - "" - "Feature: python2" - "Build-Depends: python2 (windows)" - "Description: Build with Python2 support" - ) + $controlLines += @("Supports: $($per_port_data[$PortName].supports)") } - if ($PortName -eq "regex") + if ($per_port_data[$PortName].features) { - $controlLines += @( - "" - "Feature: icu" - "Build-Depends: icu" - "Description: ICU backend for Boost.Regex" - ) + $controlLines += @("") + $per_port_data[$PortName].features } $controlLines | out-file -enc ascii "$portsDir/boost-$PortName/CONTROL" @@ -115,23 +138,21 @@ function Generate() " SHA512 $Hash" " HEAD_REF master" ) - if ($PortName -eq "asio") + $patches = ls $portsDir/boost-$PortName/*.patch + if ($patches.Count -eq 0) { - $portfileLines += @(" PATCHES windows_alloca_header.patch") } - if ($PortName -eq "iostreams") + elseif ($patches.Count -eq 1) { - $portfileLines += @(" PATCHES Removeseekpos.patch") + $portfileLines += @(" PATCHES $($patches.name)") } - if ($PortName -eq "outcome") - { - # 1.73 Known Issue - $portfileLines += @(" PATCHES 0001-outcome-assert.patch") - } - if ($PortName -eq "beast") + else { - # 1.73 Known Issue - $portfileLines += @(" PATCHES 0002-beast-coroutines.patch") + $portfileLines += @(" PATCHES") + foreach ($patch in $patches) + { + $portfileLines += @(" $($patches.name)") + } } $portfileLines += @( ")" @@ -277,6 +298,7 @@ foreach ($library in $libraries) if ($_ -match "aligned_storage") { "type_traits" } elseif ($_ -match "noncopyable|ref|swap|get_pointer|checked_delete|visit_each") { "core" } elseif ($_ -eq "type") { "core" } + elseif ($_ -eq "concept") { "concept_check" } elseif ($_ -match "unordered_") { "unordered" } elseif ($_ -match "cstdint|integer_fwd|integer_traits") { "integer" } elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" } @@ -340,8 +362,8 @@ foreach ($library in $libraries) (($library -notmatch "iostreams") -or ($_ -notmatch "random"))` -and ` (($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator")) - } | % { "boost-$_" -replace "_","-" } | % { - TransformReference $_ + } | % { $_ -replace "_","-" } | % { + "boost-" + (TransformReference $_) }) $deps += @("boost-vcpkg-helpers") @@ -401,6 +423,7 @@ if ($libraries_in_boost_port.length -gt 1) { "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1" "Source: boost" "Version: $version" + "Port-Version: $($port_versions.boost)" "Homepage: https://boost.org" "Description: Peer-reviewed portable C++ source libraries" "Build-Depends: $boostDependsList" diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index c062e58daa47fc..0d87d6ee8939fb 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -57,11 +57,11 @@ while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) } Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" -$vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" +$vcpkgBootstrapPath = "$vcpkgRootDir\toolsrc\windows-bootstrap" -if (!(Test-Path $vcpkgSourcesPath)) +if (-not (Test-Path $vcpkgBootstrapPath)) { - Write-Error "Unable to determine vcpkg sources directory. '$vcpkgSourcesPath' does not exist." + Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist." throw } @@ -339,7 +339,7 @@ if ($disableMetrics) } $platform = "x86" -$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release" +$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x86.release" if($PSVersionTable.PSVersion.Major -le 2) { $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture @@ -356,7 +356,7 @@ if ($win64) } $platform = "x64" - $vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release" + $vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x64.release" } if ($architecture -like "*64*") @@ -379,7 +379,7 @@ $arguments = ( "/verbosity:minimal", "/m", "/nologo", -"`"$vcpkgSourcesPath\dirs.proj`"") -join " " +"`"$vcpkgBootstrapPath\dirs.proj`"") -join " " function vcpkgInvokeCommandClean() { diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index e27fd39f91a03e..c43837e53c8a67 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -91,8 +91,8 @@ - - + + diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4ee79d179be9c4..7eb6d474ae5ed1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -151,6 +151,8 @@ else() endif() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + set(_VCPKG_TARGET_TRIPLET_ARCH s390x) else() if( _CMAKE_IN_TRY_COMPILE ) message(STATUS "Unable to determine target architecture, continuing without vcpkg.") @@ -306,13 +308,23 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE) message(STATUS "Running vcpkg install") + set(_VCPKG_MANIFEST_FEATURES) + foreach(feature ${VCPKG_MANIFEST_FEATURES}) + list(APPEND _VCPKG_MANIFEST_FEATURES "--x-feature=${feature}") + endforeach() + + if(VCPKG_MANIFEST_NO_DEFAULT_FEATURES) + set(_VCPKG_MANIFEST_NO_DEFAULT_FEATURES "--x-no-default-features") + endif() + execute_process( COMMAND "${_VCPKG_EXECUTABLE}" install - --triplet ${VCPKG_TARGET_TRIPLET} - --vcpkg-root ${_VCPKG_ROOT_DIR} - --x-manifest-root=${_VCPKG_MANIFEST_DIR} - --x-install-root=${_VCPKG_INSTALLED_DIR} - --binarycaching + --triplet "${VCPKG_TARGET_TRIPLET}" + --vcpkg-root "${_VCPKG_ROOT_DIR}" + "--x-manifest-root=${_VCPKG_MANIFEST_DIR}" + "--x-install-root=${_VCPKG_INSTALLED_DIR}" + ${_VCPKG_MANIFEST_FEATURES} + ${_VCPKG_MANIFEST_NO_DEFAULT_FEATURES} RESULT_VARIABLE _VCPKG_INSTALL_RESULT) if (NOT _VCPKG_INSTALL_RESULT EQUAL 0) @@ -399,7 +411,11 @@ macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_NO_BOOST_CMAKE ON) unset(Boost_USE_STATIC_RUNTIME CACHE) - set(Boost_COMPILER "-vc140") + if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v120") + set(Boost_COMPILER "-vc120") + else() + set(Boost_COMPILER "-vc140") + endif() _find_package(${ARGV}) elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 5546c1f1ae9aec..0ca4b30d9e6370 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -74,8 +74,6 @@ asiosdk:x64-osx=fail asiosdk:x64-uwp=fail asiosdk:arm64-windows=fail asiosdk:arm-uwp=fail -asmjit:arm64-windows=fail -asmjit:arm-uwp=fail asyncplusplus:arm-uwp=fail asyncplusplus:x64-uwp=fail atk:x64-osx=fail @@ -90,6 +88,7 @@ avisynthplus:x64-windows-static=fail avro-c:arm-uwp=fail avro-c:x64-osx=fail avro-c:x64-uwp=fail +avro-cpp:x64-windows-static=fail aws-c-common:arm64-windows=fail aws-c-common:arm-uwp=fail aws-c-common:x64-uwp=fail @@ -103,6 +102,10 @@ aws-lambda-cpp:x86-windows=fail aws-lambda-cpp:x64-osx=fail azure-c-shared-utility:arm-uwp=fail azure-c-shared-utility:x64-uwp=fail +azure-kinect-sensor-sdk:x64-linux=fail +azure-kinect-sensor-sdk:x64-osx=fail +# Requires ATL for ARM64 to be installed in CI +azure-storage-cpp:arm64-windows=fail bde:arm64-windows=fail bde:arm-uwp=fail bde:x64-uwp=fail @@ -137,26 +140,6 @@ blosc:x64-uwp=fail bond:arm-uwp=fail bond:x64-osx=fail bond:x64-uwp=fail -boost-coroutine:arm-uwp=fail -boost-coroutine:arm64-windows=fail -boost-fiber:arm-uwp=fail -boost-fiber:arm64-windows=fail -boost-fiber:x64-osx=fail -boost-fiber:x64-uwp=fail -boost-filesystem:arm-uwp=fail -boost-filesystem:x64-uwp=fail -boost-iostreams:arm-uwp=fail -boost-iostreams:x64-uwp=fail -boost-locale:arm-uwp=fail -boost-locale:x64-uwp=fail -boost-log:arm-uwp=fail -boost-log:x64-uwp=fail -boost-stacktrace:arm-uwp=fail -boost-stacktrace:x64-uwp=fail -boost-test:arm-uwp=fail -boost-test:x64-uwp=fail -boost-wave:arm-uwp=fail -boost-wave:x64-uwp=fail botan:arm64-windows=fail botan:arm-uwp=fail botan:x64-uwp=fail @@ -225,6 +208,11 @@ chmlib:x64-uwp=fail civetweb:arm64-windows = skip civetweb:arm-uwp = skip civetweb:x64-uwp = skip +# clapack is replaced by lapack-reference. +clapack:x64-linux = skip +clapack:x64-windows = skip +clapack:x64-windows-static = skip +clapack:x86-windows = skip clapack:x64-uwp=fail clblas:arm64-windows=fail clblast:x64-linux=fail @@ -244,6 +232,7 @@ coin:arm64-windows=fail coin:arm-uwp=fail coin:x64-uwp=fail collada-dom:x64-windows-static=fail +constexpr-contracts:x64-linux=fail coolprop:arm-uwp=fail coolprop:x64-linux=fail coolprop:x64-osx=fail @@ -293,6 +282,15 @@ cudnn:arm-uwp=fail cudnn:x64-uwp=fail cudnn:x64-windows-static=fail cudnn:x86-windows=fail +# Since pipeline cannot automatically install dbghelp dependency, skip this detection +dbghelp:arm-uwp=skip +dbghelp:arm64-windows=skip +dbghelp:x64-linux=fail +dbghelp:x64-osx=fail +dbghelp:x64-uwp=skip +dbghelp:x64-windows-static=skip +dbghelp:x64-windows=skip +dbghelp:x86-windows=skip dbow2:x64-osx=fail dcmtk:arm-uwp=fail dcmtk:arm64-windows=fail @@ -447,6 +445,8 @@ freeglut:arm64-windows=fail freeglut:arm-uwp=fail freeglut:x64-uwp=fail freeglut:x64-osx=fail +# Needs /bigobj +freeopcua:arm64-windows=fail freetds:arm-uwp=fail freetds:x64-linux=fail freetds:x64-osx=fail @@ -534,9 +534,6 @@ graphqlparser:x64-uwp=fail gsl:arm-uwp=fail gsl:x64-uwp=fail # https://github.com/microsoft/vcpkg/pull/11048 -gsoap:x64-linux=fail -gsoap:x64-osx=fail -gsoap:x64-uwp=fail gtk:x64-linux=fail guetzli:x64-osx=fail h3:arm64-windows=fail @@ -611,9 +608,6 @@ isal:x64-uwp=fail isal:x64-windows=fail isal:x64-windows-static=fail isal:x86-windows=fail -itk:x64-windows=fail -itk:x64-windows-static=fail -itk:x86-windows=fail jack2:arm-uwp=fail jack2:x64-uwp=fail jaeger-client-cpp:arm64-windows=fail @@ -629,9 +623,9 @@ jinja2cpplight:arm-uwp=fail jinja2cpplight:x64-uwp=fail keystone:arm-uwp=fail keystone:x64-uwp=fail -kfr:arm64-windows=fail +kfr:arm64-windows=fail kfr:arm-uwp=fail -kfr:x64-linux=fail +kfr:x64-linux=fail kinectsdk1:arm64-windows=fail kinectsdk1:arm-uwp=fail kinectsdk1:x64-linux=fail @@ -652,7 +646,6 @@ leveldb:arm-uwp=fail leveldb:x64-uwp=fail libaiff:x64-linux=fail libarchive:arm-uwp=fail -libass:x64-windows-static=fail libbf:arm64-windows=fail libbf:arm-uwp=fail libbf:x64-uwp=fail @@ -703,6 +696,8 @@ libfabric:x64-uwp=fail libfabric:x64-windows=fail libfabric:x64-windows-static=fail libfreenect2:arm64-windows=fail +libfreenect2:x64-linux=fail +libfreenect2:x64-osx=fail libgit2:arm-uwp=fail libgit2:x64-uwp=fail libgo:arm-uwp=fail @@ -769,8 +764,6 @@ libmesh:x64-windows-static=skip libmesh:x86-windows=skip libmesh:x64-osx=skip libmesh:x64-linux=skip -libmodbus:arm-uwp=fail -libmodbus:x64-uwp=fail libmodman:arm-uwp=fail libmodman:x64-uwp=fail libmodman:x64-windows-static=fail @@ -873,8 +866,6 @@ libtins:arm-uwp=fail libtins:x64-uwp=fail libtomcrypt:arm64-windows=fail libtomcrypt:arm-uwp=fail -libtorrent:arm-uwp=fail -libtorrent:x64-uwp=fail libudis86:arm-uwp=fail libudis86:x64-linux=fail libudis86:x64-osx=fail @@ -890,8 +881,6 @@ libui:arm-uwp=fail libui:x64-linux=fail libui:x64-uwp=fail libusb:arm-uwp=fail -libusb:x64-linux=fail -libusb:x64-osx=fail libusb:x64-uwp=fail libusbmuxd:arm-uwp=fail libusbmuxd:x64-uwp=fail @@ -951,8 +940,6 @@ lmdb:arm-uwp=fail lmdb:x64-uwp=fail log4cplus:arm-uwp=fail log4cplus:x64-uwp=fail -log4cpp:arm-uwp=fail -log4cpp:x64-uwp=fail log4cxx:arm64-windows=fail log4cxx:arm-uwp=fail log4cxx:x64-linux=fail @@ -973,6 +960,12 @@ luasocket:x64-linux=fail luasocket:x64-osx=fail lzfse:arm-uwp=fail magnum:arm64-windows=skip +marble:x64-windows-static=fail +marble:arm64-windows=fail +marble:arm-uwp=fail +marble:x64-linux=fail +marble:x64-osx=fail +marble:x86-windows=fail marl:arm-uwp=fail marl:x64-uwp=fail mathgl:x64-osx=fail @@ -1075,6 +1068,7 @@ moos-core:x86-windows=fail moos-essential:arm64-windows=fail moos-essential:x64-windows=fail moos-essential:x86-windows=fail +# Conflicts with libjpeg-turbo mozjpeg:arm64-windows = skip mozjpeg:arm-uwp = skip mozjpeg:x64-linux = skip @@ -1089,8 +1083,6 @@ mpir:x86-windows=skip mpir:x64-windows=skip mpir:x64-windows-static=skip mpir:arm64-windows=skip -mpir:arm-uwp=skip -mpir:x64-uwp=skip mpir:x64-osx=skip mpir:x64-linux=skip msix:x64-linux=fail @@ -1146,6 +1138,7 @@ networkdirect-sdk:x64-linux=fail networkdirect-sdk:x64-osx=fail networkdirect-sdk:x64-uwp=fail networkdirect-sdk:x86-windows=fail +ngspice:x64-windows-static=fail nmslib:arm64-windows=fail nmslib:arm-uwp=fail nmslib:x64-uwp=fail @@ -1304,10 +1297,6 @@ osgearth:x64-windows-static=fail osg-qt:x64-windows-static=fail paho-mqtt:arm-uwp=fail paho-mqtt:x64-uwp=fail -pangolin:x64-linux=fail -pangolin:x64-osx=fail -pangolin:x64-uwp=fail -pangolin:x64-windows-static=fail pangomm:x64-osx=fail pangomm:arm64-windows=fail parmetis:x64-linux=fail @@ -1365,11 +1354,6 @@ pmdk:x64-windows-static=fail pmdk:x86-windows=fail pngwriter:arm-uwp=fail pngwriter:x64-uwp=fail -polyhook2:arm64-windows=fail -polyhook2:arm-uwp=fail -polyhook2:x64-linux=fail -polyhook2:x64-uwp=fail -polyhook2:x64-osx=fail portable-snippets:arm-uwp=fail # Portaudio was broken by Ninja 1.9.0 https://github.com/ninja-build/ninja/pull/1406 portaudio:arm-uwp=fail @@ -1421,7 +1405,7 @@ qpid-proton:x64-uwp=fail qpid-proton:x64-windows-static=fail qt5-activeqt:x64-linux=fail qt5-activeqt:x64-osx=fail -# Skip deprecated Qt module +# Skip deprecated Qt module # (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) qt5-canvas3d:x64-linux=skip qt5-canvas3d:x64-osx=skip @@ -1446,6 +1430,7 @@ qt5-webengine:x64-osx=fail # Fail due to outdated protoc headers. # D:\buildtrees\qt5-webengine\x64-windows-dbg\src\core\debug\gen\net/third_party/quiche/src/quic/core/proto/cached_network_parameters.pb.h(17): # fatal error C1189: #error: This file was generated by an older version of protoc which is +# Succesful built requires protobuf to be installed after qt5-webengine not before. Otherwise the build picks up the wrong headers from inside vcpkg. qt5-webengine:x64-windows=skip qt5-webengine:x86-windows=skip # Static builds of qt5-webengine are not supported by the port itself @@ -1456,18 +1441,12 @@ qt5-x11extras:x64-osx=fail qt5-x11extras:x86-windows=fail qt5-x11extras:x64-windows=fail qt5-x11extras:x64-windows-static=fail -# Broken by VS2019 16.6 and throws a ton of dialogs attempting to build -# fixed by https://github.com/microsoft/vcpkg/pull/11596 -qt5-translations:x64-windows-static=skip quickfix:arm-uwp=fail quickfix:arm64-windows=fail quickfix:x64-uwp=fail quickfix:x64-windows-static=fail quickfix:x64-windows=fail quickfix:x86-windows=fail -quill:arm64-windows=fail -quill:arm-uwp=fail -quill:x64-uwp=fail quirc:arm64-windows = skip quirc:arm-uwp = skip quirc:x64-linux = skip @@ -1528,6 +1507,8 @@ rocksdb:x64-uwp=fail rpclib:arm64-windows=fail rpclib:arm-uwp=fail rpclib:x64-uwp=fail +rsocket:x64-windows=fail +rsocket:x64-windows-static=fail rtlsdr:x64-uwp=fail rtlsdr:arm64-windows=fail rtlsdr:arm-uwp=fail @@ -1579,8 +1560,6 @@ sdl2-net:x64-uwp=fail # https://github.com/microsoft/vcpkg/issues/10918 seal:arm-uwp=fail seal:x64-uwp=fail -secp256k1:x64-linux=fail -secp256k1:x64-osx=fail sentencepiece:arm64-windows=fail sentencepiece:arm-uwp=fail sentencepiece:x64-uwp=fail @@ -1768,6 +1747,7 @@ torch-th:x64-uwp=fail torch-th:x64-windows-static=fail tre:x64-osx=fail treehopper:x64-windows-static=fail +treehopper:x64-linux=fail turbobase64:arm64-windows=fail turbobase64:arm-uwp=fail turbobase64:x64-uwp=fail @@ -1829,9 +1809,6 @@ vxl:x64-windows = skip vxl:x64-windows-static = skip vxl:x86-windows = skip wampcc:arm64-windows=fail -wavpack:arm64-windows=fail -wavpack:x64-linux=fail -wavpack:x64-osx=fail wepoll:arm-uwp=fail wepoll:x64-uwp=fail wepoll:x64-linux=fail @@ -1934,4 +1911,4 @@ ctp:x64-windows=skip ctp:x64-windows-static=skip ctp:x86-windows=skip protozero:arm-uwp=fail -protozero:x64-uwp=fail \ No newline at end of file +protozero:x64-uwp=fail diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 1b045985906da7..c7d0e8d9506ac9 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -36,7 +36,8 @@ ## * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) - set(TOOLPATH ${DOWNLOADS}/tools/msys2) + set(TIMESTAMP 20200812) + set(TOOLPATH ${DOWNLOADS}/tools/msys2-${TIMESTAMP}) cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) if(NOT CMAKE_HOST_WIN32) @@ -81,6 +82,19 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 ${HASH} ) + # download the new keyring, without it new packages and package updates + # might not install + vcpkg_download_distfile(KEYRING_PATH + URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz + FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz + SHA512 a5023fd17ccf6364bc6e27c5e63aea25f1fc264a5247cbae4008864c828c38c3e0b4de09ded650e28d2e24e319b5fcf7a9c0da0fa3a8ac81679470fc6bd120c9 + ) + vcpkg_download_distfile(KEYRING_SIG_PATH + URLS http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig + FILENAME msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig + SHA512 c326fefd13f58339afe0d0dc78306aa6ab27cafa8c4d792c2d34aa81fdd1f759d490990ab79daa9664a03a6dfa14ffd2b2ad828bf19a883410112d01f5ed6c4c + ) + file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) _execute_process( @@ -91,6 +105,19 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) + # install the new keyring + _execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --verify ${KEYRING_SIG_PATH}" + WORKING_DIRECTORY ${TOOLPATH} + RESULT_VARIABLE _vam_error_code + ) + if(_vam_error_code) + message(FATAL_ERROR "Cannot verify MSYS2 keyring.") + endif() + _execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -U ${KEYRING_PATH} --noconfirm" + WORKING_DIRECTORY ${TOOLPATH} + ) # we have to kill all GnuPG daemons otherwise bash would potentially not be # able to start after the core system upgrade, additionally vcpkg would # likely hang waiting for spawned processes to exit @@ -119,7 +146,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) endif() if(_am_PACKAGES) - message(STATUS "Acquiring MSYS Packages...") + message(STATUS "Acquiring MSYS Packages from ${TOOLPATH}...") string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}") set(_ENV_ORIGINAL $ENV{PATH}) diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 17a755890f6360..545e6d7653ebb6 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -59,17 +59,9 @@ function(vcpkg_build_make) set(INSTALL_OPTS ) if (CMAKE_HOST_WIN32) set(PATH_GLOBAL "$ENV{PATH}") - # These should be moved into the portfile! - # vcpkg_find_acquire_program(YASM) - # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - # vcpkg_add_to_path("${YASM_EXE_PATH}") - # vcpkg_find_acquire_program(PERL) - # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - # vcpkg_add_to_path("${PERL_EXE_PATH}") - vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") vcpkg_acquire_msys(MSYS_ROOT) - find_program(MAKE make REQUIRED) #mingw32-make + find_program(MAKE make REQUIRED) set(MAKE_COMMAND "${MAKE}") set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f Makefile ${_bc_BUILD_TARGET}) @@ -79,7 +71,6 @@ function(vcpkg_build_make) #TODO: optimize for install-data (release) and install-exec (release/debug) else() # Compiler requriements - # set(MAKE_BASH) find_program(MAKE make REQUIRED) set(MAKE_COMMAND "${MAKE}") # Set make command and install command @@ -87,41 +78,8 @@ function(vcpkg_build_make) set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} install DESTDIR=${CURRENT_PACKAGES_DIR}) endif() - # Backup enviromnent variables - set(C_FLAGS_BACKUP "$ENV{CFLAGS}") - set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") - set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") - set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") - set(INCLUDE_BACKUP "$ENV{INCLUDE}") - set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") - set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") - _vcpkg_backup_env_variable(LD_LIBRARY_PATH) - _vcpkg_backup_env_variable(LIBRARY_PATH) - set(LIBPATH_BACKUP "$ENV{LIBPATH}") - - # Setup include enviromnent - set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") - - # Setup global flags - set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") - set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") - set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") - if(NOT VCPKG_TARGET_IS_WINDOWS) - string(APPEND C_FLAGS_GLOBAL " -fPIC") - string(APPEND CXX_FLAGS_GLOBAL " -fPIC") - else() - string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - string(APPEND LD_FLAGS_GLOBAL " /machine:x64") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - string(APPEND LD_FLAGS_GLOBAL " /machine:x86") - endif() - endif() + # Since includes are buildtype independent those are setup by vcpkg_configure_make + _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) @@ -132,6 +90,7 @@ function(vcpkg_build_make) endif() set(SHORT_BUILDTYPE "-dbg") set(CMAKE_BUILDTYPE "DEBUG") + set(PATH_SUFFIX "/debug") else() # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory. if (_VCPKG_NO_DEBUG) @@ -140,56 +99,21 @@ function(vcpkg_build_make) set(SHORT_BUILDTYPE "-rel") endif() set(CMAKE_BUILDTYPE "RELEASE") + set(PATH_SUFFIX "") endif() set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}") message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}") + set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") + set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") + #set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") - if(BUILDTYPE STREQUAL "debug") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") - else() - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") - endif() - endif() - - if (CMAKE_HOST_WIN32) - set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_CFLAGS "${TMP_CFLAGS}") - set(ENV{CFLAGS} ${TMP_CFLAGS}) - - set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_CXXFLAGS "${TMP_CXXFLAGS}") - set(ENV{CXXFLAGS} ${TMP_CXXFLAGS}) - - set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - string(REGEX REPLACE "[ \t]+/" " -" TMP_LDFLAGS "${TMP_LDFLAGS}") - set(ENV{LDFLAGS} ${TMP_LDFLAGS}) - - string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") - if(BUILDTYPE STREQUAL "debug") - set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}/debug) - else() - set(ENV{VCPKG_PKG_PREFIX} ${_VCPKG_INSTALLED_PKGCONF}) - endif() - - else() - set(ENV{CFLAGS} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_${CMAKE_BUILDTYPE}}") - - if(BUILDTYPE STREQUAL "debug") - set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/debug/lib/ -L${_VCPKG_INSTALLED}/debug/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") - set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/debug/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/debug/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - else() - set(ENV{LDFLAGS} "-L${_VCPKG_INSTALLED}/lib/ -L${_VCPKG_INSTALLED}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${CMAKE_BUILDTYPE}}") - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") - set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - endif() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX}/bin") endif() if(MAKE_BASH) @@ -251,21 +175,9 @@ function(vcpkg_build_make) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") endif() - # Restore enviromnent - set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") - set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") - - set(ENV{INCLUDE} "${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") - _vcpkg_restore_env_variable(LIBRARY_PATH) - _vcpkg_restore_env_variable(LD_LIBRARY_PATH) - if (CMAKE_HOST_WIN32) set(ENV{PATH} "${PATH_GLOBAL}") endif() - + _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 6f3c871de561dc..deecf4f061a2ee 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -28,8 +28,9 @@ function(vcpkg_build_qmake) function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") - vcpkg_execute_required_process( + vcpkg_execute_build_process( COMMAND ${INVOKE} -j ${VCPKG_CONCURRENCY} ${TARGETS} + NO_PARALLEL_COMMAND ${INVOKE} -j 1 ${TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} ) diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index ee6f3484991fb1..2414b5df6c0487 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -32,6 +32,8 @@ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStor endif() elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(VCPKG_TARGET_IS_OSX 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(VCPKG_TARGET_IS_IOS 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") set(VCPKG_TARGET_IS_LINUX 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -129,5 +131,5 @@ endif() # Windows system libs if(VCPKG_TARGET_IS_WINDOWS) list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) - list(APPEND VCPKG_SYSTEM_LIBRARIES ws2_32) + list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) endif() diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 0e47b948b8a296..52000e36d85e0c 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -7,6 +7,11 @@ ## vcpkg_configure_make( ## SOURCE_PATH <${SOURCE_PATH}> ## [AUTOCONFIG] +## [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] +## [NO_ADDITIONAL_PATHS] +## [CONFIG_DEPENDENT_ENVIRONMENT ...] +## [CONFIGURE_ENVIRONMENT_VARIABLES ...] +## [ADD_BIN_TO_PATH] ## [NO_DEBUG] ## [SKIP_CONFIGURE] ## [PROJECT_SUBPATH <${PROJ_SUBPATH}>] @@ -29,12 +34,24 @@ ## ### SKIP_CONFIGURE ## Skip configure process ## +## ### BUILD_TRIPLET +## Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET +## +## ### NO_ADDITIONAL_PATHS +## Don't pass any additional paths except for --prefix to the configure call +## ## ### AUTOCONFIG ## Need to use autoconfig to generate configure file. ## ## ### PRERUN_SHELL ## Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure) ## +## ### ADD_BIN_TO_PATH +## Adds the appropriate Release and Debug `bin\` directories to the path during configure such that executables can run against the in-tree DLLs. +## +## ## DISABLE_VERBOSE_FLAGS +## do not pass '--disable-silent-rules --verbose' to configure +## ## ### OPTIONS ## Additional options passed to configure during the configuration. ## @@ -44,6 +61,14 @@ ## ### OPTIONS_DEBUG ## Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`. ## +## ### CONFIG_DEPENDENT_ENVIRONMENT +## List of additional configuration dependent environment variables to set. +## Pass SOMEVAR to set the environment and have SOMEVAR_(DEBUG|RELEASE) set in the portfile to the appropriate values +## General environment variables can be set from within the portfile itself. +## +## ### CONFIGURE_ENVIRONMENT_VARIABLES +## List of additional environment variables to pass via the configure call. +## ## ## Notes ## This command supplies many common arguments to configure. To see the full list, examine the source. ## @@ -53,96 +78,145 @@ ## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake) ## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) -macro(_vcpkg_determine_host) - # --build: the machine you are building on - # --host: the machine you are building for - # --target: the machine that GCC will produce binary for - set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) - set(MINGW_W w64) - set(MINGW_PACKAGES) - #message(STATUS "${HOST_ARCH}") +macro(_vcpkg_determine_host_mingw out_var) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() if(HOST_ARCH MATCHES "(amd|AMD)64") - set(MSYS_HOST x86_64) - set(HOST_ARCH x64) - set(BITS 64) - #list(APPEND MINGW_PACKAGES mingw-w64-x86_64-cccl) + set(${out_var} mingw64) elseif(HOST_ARCH MATCHES "(x|X)86") - set(MSYS_HOST i686) - set(HOST_ARCH x86) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) + set(${out_var} mingw32) + else() + message(FATAL_ERROR "Unsupported mingw architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(HOST_ARCH) +endmacro() + +macro(_vcpkg_determine_autotools_host_cpu out_var) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() + if(HOST_ARCH MATCHES "(amd|AMD)64") + set(${out_var} x86_64) + elseif(HOST_ARCH MATCHES "(x|X)86") + set(${out_var} i686) elseif(HOST_ARCH MATCHES "^(ARM|arm)64$") - set(MSYS_HOST arm) - set(HOST_ARCH arm) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) + set(${out_var} aarch64) elseif(HOST_ARCH MATCHES "^(ARM|arm)$") - set(MSYS_HOST arm) - set(HOST_ARCH arm) - set(BITS 32) - #list(APPEND MINGW_PACKAGES mingw-w64-i686-cccl) - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) + set(${out_var} arm) else() - message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_get_msys_toolchain!" ) + message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(HOST_ARCH) +endmacro() + +macro(_vcpkg_determine_autotools_target_cpu out_var) + if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64") + set(${out_var} x86_64) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") + set(${out_var} i686) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$") + set(${out_var} aarch64) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$") + set(${out_var} arm) + else() + message(FATAL_ERROR "Unsupported VCPKG_TARGET_ARCHITECTURE architecture ${VCPKG_TARGET_ARCHITECTURE} in _vcpkg_determine_autotools_target_cpu!" ) endif() - set(TARGET_ARCH ${VCPKG_TARGET_ARCHITECTURE}) endmacro() macro(_vcpkg_backup_env_variable envvar) - if(ENV{${envvar}}) + if(DEFINED ENV{${envvar}}) set(${envvar}_BACKUP "$ENV{${envvar}}") set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}") else() + set(${envvar}_BACKUP) set(${envvar}_PATHLIKE_CONCAT) endif() endmacro() +macro(_vcpkg_backup_env_variables) + foreach(_var ${ARGV}) + _vcpkg_backup_env_variable(${_var}) + endforeach() +endmacro() + macro(_vcpkg_restore_env_variable envvar) if(${envvar}_BACKUP) - set(ENV{${envvar}} ${${envvar}_BACKUP}) + set(ENV{${envvar}} "${${envvar}_BACKUP}") else() unset(ENV{${envvar}}) endif() endmacro() +macro(_vcpkg_restore_env_variables) + foreach(_var ${ARGV}) + _vcpkg_restore_env_variable(${_var}) + endforeach() +endmacro() function(vcpkg_configure_make) cmake_parse_arguments(_csc - "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE" - "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH" + "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT" ${ARGN} ) - # Backup enviromnent variables - set(C_FLAGS_BACKUP "$ENV{CFLAGS}") - set(CXX_FLAGS_BACKUP "$ENV{CXXFLAGS}") - set(LD_FLAGS_BACKUP "$ENV{LDFLAGS}") - set(INCLUDE_PATH_BACKUP "$ENV{INCLUDE_PATH}") - set(INCLUDE_BACKUP "$ENV{INCLUDE}") - set(C_INCLUDE_PATH_BACKUP "$ENV{C_INCLUDE_PATH}") - set(CPLUS_INCLUDE_PATH_BACKUP "$ENV{CPLUS_INCLUDE_PATH}") - #set(LD_LIBRARY_PATH_BACKUP "$ENV{LD_LIBRARY_PATH}") - _vcpkg_backup_env_variable(LD_LIBRARY_PATH) - #set(LIBRARY_PATH_BACKUP "$ENV{LIBRARY_PATH}") - _vcpkg_backup_env_variable(LIBRARY_PATH) - set(LIBPATH_BACKUP "$ENV{LIBPATH}") - - if(${CURRENT_PACKAGES_DIR} MATCHES " " OR ${CURRENT_INSTALLED_DIR} MATCHES " ") + if(DEFINED VCPKG_MAKE_BUILD_TRIPLET) + set(_csc_BUILD_TRIPLET ${VCPKG_MAKE_BUILD_TRIPLET}) # Triplet overwrite for crosscompiling + endif() + + set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") + + set(REQUIRES_AUTOGEN FALSE) # use autogen.sh + set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac + if(EXISTS "${SRC_DIR}/configure" AND "${SRC_DIR}/configure.ac") # remove configure; rerun autoconf + if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time + set(REQUIRES_AUTOCONFIG TRUE) + file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts + set(_csc_AUTOCONFIG ON) + endif() + elseif(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) # run normally; no autoconf or autgen required + elseif(EXISTS "${SRC_DIR}/configure.ac") # Run autoconfig + set(REQUIRES_AUTOCONFIG TRUE) + set(_csc_AUTOCONFIG ON) + elseif(EXISTS "${SRC_DIR}/autogen.sh") # Run autogen + set(REQUIRES_AUTOGEN TRUE) + else() + message(FATAL_ERROR "Could not determine method to configure make") + endif() + + debug_message("REQUIRES_AUTOGEN:${REQUIRES_AUTOGEN}") + debug_message("REQUIRES_AUTOCONFIG:${REQUIRES_AUTOCONFIG}") + # Backup environment variables + # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y + set(FLAGPREFIXES CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y) + foreach(_prefix IN LISTS FLAGPREFIXES) + _vcpkg_backup_env_variable(${prefix}FLAGS) + endforeach() + + # FC fotran compiler | FF Fortran 77 compiler + # LDFLAGS -> pass -L flags + # LIBS -> pass -l flags + + #Used by gcc/linux + _vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) + + #Used by cl + _vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) + + if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ") + # Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)! message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail") endif() # Pre-processing windows configure requirements if (CMAKE_HOST_WIN32) - # YASM and PERL are not strictly required by all ports. - # So this should probably be moved into the portfile - # vcpkg_find_acquire_program(YASM) - # get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) - # vcpkg_add_to_path("${YASM_EXE_PATH}") - - # vcpkg_find_acquire_program(PERL) - # get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - # vcpkg_add_to_path("${PERL_EXE_PATH}") + _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= list(APPEND MSYS_REQUIRE_PACKAGES diffutils pkg-config @@ -150,16 +224,36 @@ function(vcpkg_configure_make) libtool gettext gettext-devel - make) + ) + list(APPEND MSYS_REQUIRE_PACKAGES make) if (_csc_AUTOCONFIG) list(APPEND MSYS_REQUIRE_PACKAGES autoconf autoconf-archive automake m4 ) + # --build: the machine you are building on + # --host: the machine you are building for + # --target: the machine that CC will produce binaries for + # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler + # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host + if(NOT _csc_BUILD_TRIPLET) + set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-pc-mingw32") # This is required since we are running in a msys + # shell which will be otherwise identified as ${BUILD_ARCH}-pc-msys + _vcpkg_determine_autotools_target_cpu(TARGET_ARCH) + if(NOT TARGET_ARCH MATCHES "${BUILD_ARCH}") # we do not need to specify the additional flags if we build nativly. + string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-pc-mingw32") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target) + endif() + if(VCPKG_TARGET_IS_UWP AND NOT _csc_BUILD_TRIPLET MATCHES "--host") + # Needs to be different from --build to enable cross builds. + string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-unknown-mingw32") + endif() + endif() + debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}") endif() vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") + set(BASH "${MSYS_ROOT}/usr/bin/bash.exe") # This is required because PATH contains sort and find from Windows but the MSYS versions are needed @@ -167,40 +261,42 @@ function(vcpkg_configure_make) file(CREATE_LINK "${MSYS_ROOT}/usr/bin/sort.exe" "${SCRIPTS}/buildsystems/make_wrapper/sort.exe" COPY_ON_ERROR) file(CREATE_LINK "${MSYS_ROOT}/usr/bin/find.exe" "${SCRIPTS}/buildsystems/make_wrapper/find.exe" COPY_ON_ERROR) vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there + vcpkg_add_to_path(PREPEND "${MSYS_ROOT}/usr/share/automake-1.16") # Required wrappers are located here (compile ar-lib) - # --build: the machine you are building on - # --host: the machine you are building for - # --target: the machine that CC will produce binaries for - _vcpkg_determine_host() # VCPKG_HOST => machine you are building on => --build= - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=i686-pc-mingw32 --host=i686-pc-mingw32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32") - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) - set(BUILD_TARGET "--build=${MSYS_HOST}-pc-mingw32 --target=arm-pc-mingw32 --host=i686-pc-mingw32") - endif() - macro(_vcpkg_append_to_configure_environment inoutstring var defaultval) - # Allows to overwrite settings in custom triplets via the enviromnent - if(ENV{${var}}) + # Allows to overwrite settings in custom triplets via the environment + if(DEFINED ENV{${var}}) string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") else() string(APPEND ${inoutstring} " ${var}='${defaultval}'") endif() endmacro() - set(CONFIGURE_ENV "") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "${MSYS_ROOT}/usr/share/automake-1.16/compile cl.exe -nologo") + set(CONFIGURE_ENV "V=1") + if (_csc_AUTOCONFIG) # without autotools we assume a custom configure script which correctly handles cl and lib. Otherwise the port needs to set CC|CXX|AR and probably CPP + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "compile cl.exe -nologo -E") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "compile cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "compile cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "ar-lib lib.exe -verbose") + else() + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "cl.exe -nologo -E") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "cl.exe -nologo") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "lib.exe -verbose") + endif() _vcpkg_append_to_configure_environment(CONFIGURE_ENV LD "link.exe -verbose") - _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "${MSYS_ROOT}/usr/share/automake-1.16/ar-lib lib.exe -verbose") _vcpkg_append_to_configure_environment(CONFIGURE_ENV RANLIB ":") # Trick to ignore the RANLIB call + #_vcpkg_append_to_configure_environment(CONFIGURE_ENV OBJDUMP ":") ' Objdump is required to make shared libraries. Otherwise define lt_cv_deplibs_check_method=pass_all _vcpkg_append_to_configure_environment(CONFIGURE_ENV CCAS ":") # If required set the ENV variable CCAS in the portfile correctly - _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers -all") + _vcpkg_append_to_configure_environment(CONFIGURE_ENV STRIP ":") # If required set the ENV variable STRIP in the portfile correctly + _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers") # Would be better to have a true nm here! Some symbols (mainly exported variables) get not properly imported with dumpbin as nm # and require __declspec(dllimport) for some reason (same problem CMake has with WINDOWS_EXPORT_ALL_SYMBOLS) _vcpkg_append_to_configure_environment(CONFIGURE_ENV DLLTOOL "link.exe -verbose -dll") - + + foreach(_env IN LISTS _csc_CONFIGURE_ENVIRONMENT_VARIABLES) + _vcpkg_append_to_configure_environment(CONFIGURE_ENV ${_env} "${${_env}}") + endforeach() # Other maybe interesting variables to control # COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line. # LINK This is the command used to actually link a C program. @@ -228,11 +324,11 @@ function(vcpkg_configure_make) "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") - set(ENV{V} "1") #Enable Verbose MODE - # Set configure paths - set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} - "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}" + set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}") + set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}") + if(NOT _csc_NO_ADDITIONAL_PATHS) + set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} # Important: These should all be relative to prefix! "--bindir=${prefix_var}/tools/${PORT}/bin" "--sbindir=${prefix_var}/tools/${PORT}/sbin" @@ -241,25 +337,25 @@ function(vcpkg_configure_make) "--mandir=${prefix_var}/share/${PORT}" "--docdir=${prefix_var}/share/${PORT}" "--datarootdir=${prefix_var}/share/${PORT}") - set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} - "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}" + set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} # Important: These should all be relative to prefix! "--bindir=${prefix_var}/../tools/${PORT}/debug/bin" "--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin" #"--libdir='\${prefix}'/lib" # already the default! "--includedir=${prefix_var}/../include" "--datarootdir=${prefix_var}/share/${PORT}") - + endif() # Setup common options + if(NOT DISABLE_VERBOSE_FLAGS) + list(APPEND _csc_OPTIONS --disable-silent-rules --verbose) + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-shared --disable-static) - if (VCPKG_TARGET_IS_UWP) - list(APPEND _csc_OPTIONS --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib) - endif() + list(APPEND _csc_OPTIONS --enable-shared --disable-static) else() - list(APPEND _csc_OPTIONS --disable-silent-rules --verbose --enable-static --disable-shared) + list(APPEND _csc_OPTIONS --disable-shared --enable-static) endif() - + file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") set(base_cmd) @@ -270,39 +366,50 @@ function(vcpkg_configure_make) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") endif() include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - if(VCPKG_TARGET_IS_UWP) - # Flags should be set in the toolchain instead - set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\") - set(_csc_OPTIONS ${_csc_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00) - endif() #Join the options list as a string with spaces between options list(JOIN _csc_OPTIONS " " _csc_OPTIONS) list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE) list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG) endif() - # Setup include enviromnent + # Setup include environment (since these are buildtype independent restoring them is unnecessary) + # Used by CL set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_PATH_BACKUP}") + # Used by GCC set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}") set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}") # Setup global flags -> TODO: Further improve with toolchain file in mind! + set(CPP_FLAGS_GLOBAL "$ENV{CPPFLAGS} -I${_VCPKG_INSTALLED}/include") set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}") set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}") set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS} ${VCPKG_LINKER_FLAGS}") - # Flags should be set in the toolchain instead + # Flags should be set in the toolchain instead (Setting this up correctly requires a function named vcpkg_determined_cmake_compiler_flags which can also be used to setup CC and CXX etc.) if(NOT VCPKG_TARGET_IS_WINDOWS) string(APPEND C_FLAGS_GLOBAL " -fPIC") string(APPEND CXX_FLAGS_GLOBAL " -fPIC") else() - string(APPEND C_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND CXX_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") - string(APPEND LD_FLAGS_GLOBAL " /VERBOSE -no-undefined") + # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined + string(APPEND CPP_FLAGS_GLOBAL " /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DWIN32 /D_WINDOWS") + if(VCPKG_TARGET_IS_UWP) + # Be aware that configure thinks it is crosscompiling due to: + # error while loading shared libraries: VCRUNTIME140D_APP.dll: + # cannot open shared object file: No such file or directory + # IMPORTANT: The only way to pass linker flags through libtool AND the compile wrapper + # is to use the CL and LINK environment variables !!! + # (This is due to libtool and compiler wrapper using the same set of options to pass those variables around) + string(REPLACE "\\" "/" VCToolsInstallDir "$ENV{VCToolsInstallDir}") + set(ENV{_CL_} "$ENV{_CL_} /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"") + set(ENV{_LINK_} "$ENV{_LINK_} /MANIFEST /DYNAMICBASE WindowsApp.lib /WINMD:NO /APPCONTAINER") + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) - string(APPEND LD_FLAGS_GLOBAL " /machine:x64") + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x64") elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - string(APPEND LD_FLAGS_GLOBAL " /machine:x86") + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:x86") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm) + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) + set(ENV{_LINK_} "$ENV{_LINK_} -MACHINE:ARM64") endif() endif() @@ -316,20 +423,10 @@ function(vcpkg_configure_make) debug_message("ENV{PKG_CONFIG} found! Using: $ENV{PKG_CONFIG}") set(PKGCONFIG $ENV{PKG_CONFIG}) endif() - - set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}") - - # Run autoconf if necessary - if(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) - set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac - set(REQUIRES_AUTOGEN FALSE) # use autogen.sh - elseif(EXISTS "${SRC_DIR}/configure.ac") - set(REQUIRES_AUTOCONFIG TRUE) - set(REQUIRES_AUTOGEN FALSE) - elseif(EXISTS "${SRC_DIR}/autogen.sh") - set(REQUIRES_AUTOGEN TRUE) - set(REQUIRES_AUTOCONFIG FALSE) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT PKGCONFIG STREQUAL "--static") + set(PKGCONFIG "${PKGCONFIG} --static") endif() + # Run autoconf if necessary set(_GENERATED_CONFIGURE FALSE) if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG) find_program(AUTORECONF autoreconf REQUIRED) @@ -393,10 +490,12 @@ function(vcpkg_configure_make) set(SHORT_NAME_${_VAR_SUFFIX} "dbg") list(APPEND _buildtypes ${_VAR_SUFFIX}) if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead + string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX}d /D_DEBUG /Ob0 /Od ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() + set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -408,11 +507,13 @@ function(vcpkg_configure_make) set(PATH_SUFFIX_${_VAR_SUFFIX} "") set(SHORT_NAME_${_VAR_SUFFIX} "rel") list(APPEND _buildtypes ${_VAR_SUFFIX}) - if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain instead + if (CMAKE_HOST_WIN32) # Flags should be set in the toolchain + string(REGEX REPLACE "[ \t]+/" " -" CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") string(REGEX REPLACE "[ \t]+/" " -" CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_C_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG ${VCPKG_CXX_FLAGS_${_VAR_SUFFIX}}") string(REGEX REPLACE "[ \t]+/" " -" LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") else() + set(CPPFLAGS_${_VAR_SUFFIX} "${CPP_FLAGS_GLOBAL}") set(CFLAGS_${_VAR_SUFFIX} "${C_FLAGS_GLOBAL} ${VCPKG_C_FLAGS_DEBUG}") set(CXXFLAGS_${_VAR_SUFFIX} "${CXX_FLAGS_GLOBAL} ${VCPKG_CXX_FLAGS_DEBUG}") set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/ -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link/ ${LD_FLAGS_GLOBAL} ${VCPKG_LINKER_FLAGS_${_VAR_SUFFIX}}") @@ -421,6 +522,13 @@ function(vcpkg_configure_make) endif() foreach(_buildtype IN LISTS _buildtypes) + foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) + if(DEFINED ENV{${ENV_VAR}}) + set(BACKUP_CONFIG_${ENV_VAR} "$ENV{${ENV_VAR}}") + endif() + set(ENV{${ENV_VAR}} "${${ENV_VAR}_${_buildtype}}") + endforeach() + set(TAR_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") file(MAKE_DIRECTORY "${TAR_DIR}") file(RELATIVE_PATH RELATIVE_BUILD_PATH "${TAR_DIR}" "${SRC_DIR}") @@ -440,22 +548,28 @@ function(vcpkg_configure_make) set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}") endif() - # Setup enviromnent + # Setup environment + set(ENV{CPPFLAGS} ${CPPFLAGS_${_buildtype}}) set(ENV{CFLAGS} ${CFLAGS_${_buildtype}}) set(ENV{CXXFLAGS} ${CXXFLAGS_${_buildtype}}) set(ENV{LDFLAGS} ${LDFLAGS_${_buildtype}}) set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}") - set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib${VCPKG_HOST_PATH_SEPARATOR}${LIBPATH_BACKUP}") - - set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") + + set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIB_PATHLIKE_CONCAT}") + set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}") + set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}") set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}") - if (CMAKE_HOST_WIN32) - set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${BUILD_TARGET} ${HOST_TYPE}${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") + if (CMAKE_HOST_WIN32) + set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}") else() - set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) + set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) endif() - + if(_csc_ADD_BIN_TO_PATH) + set(PATH_BACKUP $ENV{PATH}) + vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/bin") + endif() + debug_message("Configure command:'${command}'") if (NOT _csc_SKIP_CONFIGURE) message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}") vcpkg_execute_required_process( @@ -477,20 +591,27 @@ function(vcpkg_configure_make) unset(ENV{PKG_CONFIG_PATH}) endif() unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}) + + if(_csc_ADD_BIN_TO_PATH) + set(ENV{PATH} "${PATH_BACKUP}") + endif() + # Restore environment (config dependent) + foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT}) + if(BACKUP_CONFIG_${ENV_VAR}) + set(ENV{${ENV_VAR}} "${BACKUP_CONFIG_${ENV_VAR}}") + else() + unset(ENV{${ENV_VAR}}) + endif() + endforeach() + endforeach() + + # Restore environment + foreach(_prefix IN LISTS FLAGPREFIXES) + _vcpkg_restore_env_variable(${prefix}FLAGS) endforeach() - - # Restore enviromnent - set(ENV{CFLAGS} "${C_FLAGS_BACKUP}") - set(ENV{CXXFLAGS} "${CXX_FLAGS_BACKUP}") - set(ENV{LDFLAGS} "${LD_FLAGS_BACKUP}") - - set(ENV{INCLUDE} "${INCLUDE_BACKUP}") - set(ENV{INCLUDE_PATH} "${INCLUDE_PATH_BACKUP}") - set(ENV{C_INCLUDE_PATH} "${C_INCLUDE_PATH_BACKUP}") - set(ENV{CPLUS_INCLUDE_PATH} "${CPLUS_INCLUDE_PATH_BACKUP}") - _vcpkg_restore_env_variable(LIBRARY_PATH) - _vcpkg_restore_env_variable(LD_LIBRARY_PATH) - set(ENV{LIBPATH} "${LIBPATH_BACKUP}") + + _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE) set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index 396d20b41d8e1c..1784a4d145c6d4 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -17,14 +17,21 @@ ## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake) ## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) function(vcpkg_copy_tool_dependencies TOOL_DIR) + find_program(PS_EXE powershell PATHS ${DOWNLOADS}/tool) + if (PS_EXE-NOTFOUND) + message(FATAL_ERROR "Could not find powershell in vcpkg tools, please open an issue to report this.") + endif() macro(search_for_dependencies PATH_TO_SEARCH) file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) foreach(TOOL ${TOOLS}) - execute_process(COMMAND powershell -noprofile -executionpolicy Bypass -nologo - -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 - -targetBinary ${TOOL} - -installedDir ${PATH_TO_SEARCH} - OUTPUT_VARIABLE OUT) + vcpkg_execute_required_process( + COMMAND ${PS_EXE} -noprofile -executionpolicy Bypass -nologo + -file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1 + -targetBinary ${TOOL} + -installedDir ${PATH_TO_SEARCH} + WORKING_DIRECTORY ${VCPKG_ROOT_DIR} + LOGNAME copy-tool-dependencies + ) endforeach() endmacro() search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin) diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index 9da6cec9f57baa..67607d768685a7 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -61,8 +61,11 @@ function(vcpkg_execute_build_process) OR err_contents MATCHES "LINK : fatal error LNK1102:" OR err_contents MATCHES " fatal error C1060: " OR out_contents MATCHES "LINK : fatal error LNK1318: Unexpected PDB error; ACCESS_DENIED" OR out_contents MATCHES "LINK : fatal error LNK1104:" - OR out_contents MATCHES "LINK : fatal error LNK1201:") + OR out_contents MATCHES "LINK : fatal error LNK1201:" # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + OR out_contents MATCHES "Cannot create parent directory" + # Multiple threads using the same directory at the same time cause conflicts, will try again. + ) message(STATUS "Restarting Build without parallelism because memory exceeded") set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err-1.log") diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index a5aefdc29297cd..7f1f419cdca842 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -33,6 +33,7 @@ ## - NINJA ## - NUGET ## - SCONS +## - SWIG ## - YASM ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). @@ -101,7 +102,7 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe") set(ARCHIVE "PortableGit-2.26.2-32-bit.7z.exe") set(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36) - set(PATHS + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin" "${DOWNLOADS}/tools/git/${SUBDIR}/mingw32/bin") else() @@ -190,8 +191,8 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME jom) set(SUBDIR "jom-1.1.3") set(PATHS ${DOWNLOADS}/tools/jom/${SUBDIR}) - set(URL - "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" + set(URL + "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" "http://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip" ) set(ARCHIVE "jom_1_1_3.zip") @@ -204,22 +205,30 @@ function(vcpkg_find_acquire_program VAR) set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) - set(SUBDIR "ninja-1.10.0") + set(NINJA_VERSION 1.10.0) + set(SUBDIR "ninja-${NINJA_VERSION}") + set(_vfa_SUPPORTED ON) if(CMAKE_HOST_WIN32) + set(ARCHIVE "ninja-win-${NINJA_VERSION}.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-windows") list(APPEND PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-win.zip") + set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(ARCHIVE "ninja-mac-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-mac.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") + set(HASH 619a1924067a0b30fc5f8887f868d3ee5481838d2f0f158d031f7614a2a10b95a73d4a56b658d5d560283ebf809e2e536b968c6c01ff0108075c3f393f5780ba) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd") + set(_vfa_SUPPORTED OFF) else() + set(ARCHIVE "ninja-linux-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip") set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") + set(HASH ffb179ab8ea315167fcc99a8f13286e1363590185b18cf819cc73e09f2a7553790e9dc45fd1ccd0bd1d2dbf543aee3f6c0951cf9ce453a7168ffd2ac873cdd29) endif() - set(BREW_PACKAGE_NAME "ninja") - set(APT_PACKAGE_NAME "ninja-build") - set(URL "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip") - set(ARCHIVE "ninja-win-1.10.0.zip") - set(HASH a196e243c53daa1df9d287af658d6d38d6b830b614f2d5704e8c88ffc61f179a533ae71cdb6d0d383d1559d65dacccbaaab270fb2a33aa211e5dba42ff046f97) + set(VERSION_CMD --version) elseif(VAR MATCHES "NUGET") set(PROGNAME nuget) set(SUBDIR "5.5.1") @@ -231,19 +240,23 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) elseif(VAR MATCHES "MESON") - set(PROGNAME meson) - set(REQUIRED_INTERPRETER PYTHON3) - set(BREW_PACKAGE_NAME "meson") - set(APT_PACKAGE_NAME "meson") - if(CMAKE_HOST_WIN32) - set(SCRIPTNAME meson.py) + if(NOT CMAKE_HOST_APPLE) + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(APT_PACKAGE_NAME "meson") + if(CMAKE_HOST_WIN32) + set(SCRIPTNAME meson.py) + else() + set(SCRIPTNAME meson) + endif() + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) + set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") + set(ARCHIVE "meson-0.54.2.zip") + set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) else() - set(SCRIPTNAME meson) + set(PROGNAME meson) + set(BREW_PACKAGE_NAME "meson") endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) - set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") - set(ARCHIVE "meson-0.54.2.zip") - set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") if(CMAKE_HOST_WIN32) set(SOURCEFORGE_ARGS @@ -305,7 +318,32 @@ function(vcpkg_find_acquire_program VAR) set(PATHS ${DOWNLOADS}/tools/scons) set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") set(ARCHIVE "scons-local-3.0.1.zip") - set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + elseif(VAR MATCHES "SWIG") + set(VERSION 4.0.2) + set(PROGNAME swig) + if(CMAKE_HOST_WIN32) + set(URL "https://sourceforge.net/projects/swig/files/swigwin/swigwin-${VERSION}/swigwin-${VERSION}.zip/download") + set(ARCHIVE "swigwin-${VERSION}.zip") + set(HASH b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d) + set(SUBDIR "swigwin-${VERSION}") + set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}/${SUBDIR}") + else() + #Not used + set(_vfa_SUPPORTED TRUE) + set(URL https://sourceforge.net/projects/swig/files/swig/swig-${VERSION}/swig-${VERSION}.tar.gz/download) + set(ARCHIVE "swig-${VERSION}.tar.gz") + set(HASH 05e7da70ce6d9a733b96c0bcfa3c1b82765bd859f48c74759bbf4bb1467acb1809caa310cba5e2b3280cd704fca249eaa0624821dffae1d2a75097c7f55d14ed) + set(SUBDIR "swig-${VERSION}") + set(PATHS "${DOWNLOADS}/tools/swig/${SUBDIR}") + endif() + set(SOURCEFORGE_ARGS + REPO swig + FILENAME "${ARCHIVE}" + SHA512 "${HASH}" + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/swig" + ) elseif(VAR MATCHES "DOXYGEN") set(PROGNAME doxygen) set(DOXYGEN_VERSION 1.8.17) @@ -329,12 +367,12 @@ function(vcpkg_find_acquire_program VAR) set(HASH db4a583cf2996aeb29fd008261b12fe39a4a5faf0fbf96f7124e6d3ffeccf6d9655d391378e68dd0915bc91c9e146a51fd9661963743857ca25179547feceab1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(_vfa_SUPPORTED ON) - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-darwin-x86_64") set(ARCHIVE "bazel-${BAZEL_VERSION}-darwin-x86_64") set(NOEXTRACT ON) set(HASH 420a37081e6ee76441b0d92ff26d1715ce647737ce888877980d0665197b5a619d6afe6102f2e7edfb5062c9b40630a10b2539585e35479b780074ada978d23c) else() - set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(ARCHIVE "bazel-${BAZEL_VERSION}-windows-x86_64.zip") set(HASH 6482f99a0896f55ef65739e7b53452fd9c0adf597b599d0022a5e0c5fa4374f4a958d46f98e8ba25af4b065adacc578bfedced483d8c169ea5cb1777a99eea53) endif() @@ -349,10 +387,36 @@ function(vcpkg_find_acquire_program VAR) message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() + macro(do_version_check) + if(VERSION_CMD) + _execute_process( + COMMAND ${${VAR}} ${VERSION_CMD} + WORKING_DIRECTORY ${DOWNLOADS} + OUTPUT_VARIABLE ${VAR}_VERSION_OUTPUT + ) + string(STRIP "${${VAR}_VERSION_OUTPUT}" ${VAR}_VERSION_OUTPUT) + #TODO: REGEX MATCH case for more complex cases! + if(NOT ${VAR}_VERSION_OUTPUT VERSION_GREATER_EQUAL ${VAR}_VERSION) + message(STATUS "Found ${PROGNAME}('${${VAR}_VERSION_OUTPUT}') but at least version ${${VAR}_VERSION} is required! Trying to use internal version if possible!") + set(${VAR} "${VAR}-NOTFOUND" CACHE INTERNAL "") + else() + message(STATUS "Found external ${PROGNAME}('${${VAR}_VERSION_OUTPUT}').") + endif() + endif() + endmacro() + macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) find_program(${VAR} ${PROGNAME} PATHS ${PATHS} NO_DEFAULT_PATH) - find_program(${VAR} ${PROGNAME}) + if(NOT ${VAR}) + find_program(${VAR} ${PROGNAME}) + if(${VAR} AND NOT ${VAR}_VERSION_CHECKED) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) @@ -426,8 +490,11 @@ function(vcpkg_find_acquire_program VAR) LOGNAME ${VAR}-tool-post-install ) endif() - + unset(${VAR} CACHE) do_find() + if(NOT ${VAR}) + message(FATAL_ERROR "Unable to find ${VAR}") + endif() endif() set(${VAR} "${${VAR}}" PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_find_fortran.cmake b/scripts/cmake/vcpkg_find_fortran.cmake new file mode 100644 index 00000000000000..daf63ce7279eec --- /dev/null +++ b/scripts/cmake/vcpkg_find_fortran.cmake @@ -0,0 +1,61 @@ +## # vcpkg_find_fortran +## +## Checks if a Fortran compiler can be found. +## Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran +## and return required cmake args for building. +## +## ## Usage +## ```cmake +## vcpkg_find_fortran( +## ) +## ``` + +function(vcpkg_find_fortran additional_cmake_args_out) + set(ARGS_OUT) + set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}") + set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform") + include(CMakeDetermineFortranCompiler) + if(NOT CMAKE_Fortran_COMPILER AND NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + # This intentionally breaks users with a custom toolchain which do not have a Fortran compiler setup + # because they either need to use a port-overlay (for e.g. lapack), remove the toolchain for the port using fortran + # or setup fortran in their VCPKG_CHAINLOAD_TOOLCHAIN_FILE themselfs! + if(WIN32) + message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!") + # If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") # Switching to mingw toolchain + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(MINGW_PATH mingw32) + set(MSYS_TARGET i686) + set(MACHINE_FLAG -m32) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(MINGW_PATH mingw64) + set(MSYS_TARGET x86_64) + set(MACHINE_FLAG -m64) + else() + message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!") + endif() + vcpkg_acquire_msys(MSYS_ROOT PACKAGES "mingw-w64-${MSYS_TARGET}-gcc-fortran") + set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin") + vcpkg_add_to_path(PREPEND "${MINGW_BIN}") + list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON + "-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe" + "-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe" + "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}") + set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE) + set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(VCPKG_CRT_LINKAGE dynamic PARENT_SCOPE) + message(STATUS "VCPKG_CRT_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic CRT linkage") + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(VCPKG_LIBRARY_LINKAGE dynamic PARENT_SCOPE) + message(STATUS "VCPKG_LIBRARY_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic library linkage") + endif() + else() + message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!") + endif() + endif() + set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE) +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index ec5ea05f57ce57..0be2dfc5405e29 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -53,11 +53,7 @@ function(vcpkg_fixup_cmake_targets) set(_vfct_TARGET_PATH share/${PORT}) endif() - if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(EXECUTABLE_SUFFIX "\\.exe") - else() - set(EXECUTABLE_SUFFIX) - endif() + string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) @@ -173,6 +169,10 @@ function(vcpkg_fixup_cmake_targets) "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" _contents "${_contents}") + string(REGEX REPLACE + "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\.((\\\\|/)\\.\\.)*\" ABSOLUTE\\)" + "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" + _contents "${_contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}") file(WRITE ${MAIN_CMAKE} "${_contents}") diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 6acb51360bd56c..24302a6af91962 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -8,6 +8,8 @@ ## [RELEASE_FILES ...] ## [DEBUG_FILES ...] ## [SYSTEM_LIBRARIES ...] +## [IGNORE_FLAGS ] +## [SKIP_CHECK] ## ) ## ``` ## @@ -20,10 +22,6 @@ ## Specifies a list of files to apply the fixes for debug paths. ## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ ## -## ### SYSTEM_PACKAGES -## If the *.pc file contains system packages outside vcpkg these need to be listed here. -## Since vcpkg checks the existence of all required packages within vcpkg. -## ## ### SYSTEM_LIBRARIES ## If the *.pc file contains system libraries outside vcpkg these need to be listed here. ## VCPKG checks every -l flag for the existence of the required library within vcpkg. @@ -31,172 +29,237 @@ ## ### IGNORE_FLAGS ## If the *.pc file contains flags in the lib field which are not libraries. These can be listed here ## +## ### SKIP_CHECK +## Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases. +## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them ## ## ## Examples -## ## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. -function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages _ignore_flags) - set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) - list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a;.a") - #message(STATUS "Checking configuration: ${_config}") +function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config _system_libs _ignore_flags) + # Setup pkg-config paths + if(CMAKE_HOST_WIN32) + # Those replacements are probably only necessary since we use pkg-config from msys + string(REPLACE " " "\ " _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") + string(REPLACE "\\" "/" _VCPKG_INSTALLED_PKGCONF "${_VCPKG_INSTALLED_PKGCONF}") + string(REPLACE " " "\ " _VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") + string(REPLACE "\\" "/" _VCPKG_PACKAGES_PKGCONF "${_VCPKG_PACKAGES_PKGCONF}") + else() + set(_VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}") + set(_VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}") + endif() + + set(PATH_SUFFIX_DEBUG /debug) + set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") + set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig") + + if(ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${PKGCONFIG_PACKAGES_SHARE_DIR}:$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}:${PKGCONFIG_INSTALLED_SHARE_DIR}:${PKGCONFIG_PACKAGES_DIR}:${PKGCONFIG_PACKAGES_SHARE_DIR}") + endif() + + # First make sure everything is ok with the package and its deps + get_filename_component(_package_name "${_file}" NAME_WLE) + debug_message("Checking package (${_config}): ${_package_name}") + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed") + message(STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + # Get all required libs. --static means we get all libraries required for static linkage + # which is the worst case and includes the case without --static + # This retests already tested *.pc files since pkg-config will recursivly search for + # required packages and add there link flags to the one being tested + # as such NOT_STATIC_PKGCONFIG might be used to deactivate the --static arg to pkg-config + + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors ${PKGCONFIG_STATIC} --libs ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_libs_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs ${_package_name} failed") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_libs_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_libs_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --static --libs-only-L ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_lib_paths_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs-only-L ${_package_name} failed") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_lib_paths_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_lib_paths_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + + string(REPLACE "\\ " "##" _pkg_lib_paths_output "${_pkg_lib_paths_output}") # Whitespace path protection + string(REGEX REPLACE "(^[\t ]*|[\t ]+)-L" ";" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + debug_message("-L LIST TRANSFORMATION:'${_pkg_lib_paths_output}'") + string(REGEX REPLACE "^[\t ]*;" "" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + string(REPLACE "##" "\\ " _pkg_lib_paths_output "${_pkg_lib_paths_output}") + + list(REMOVE_DUPLICATES _pkg_lib_paths_output) # We don't care about linker order and repeats + ## Remove search paths from LIBS + foreach(_search_path IN LISTS _pkg_lib_paths_output) + debug_message("REMOVING:'${_search_path}'") + debug_message("FROM:'${_pkg_libs_output}'") + string(REGEX REPLACE "(^[\t ]*|[\t ]+|;[\t ]*)-L${_search_path}([\t ]+|[\t ]*$)" ";" _pkg_libs_output "${_pkg_libs_output}") # Remove search paths from libs + endforeach() + debug_message("LIBS AFTER -L REMOVAL:'${_pkg_libs_output}'") + + #Make the remaining libs a proper CMake List + string(REPLACE "\\ " "##" _pkg_libs_output "${_pkg_libs_output}") # Whitespace path protection + string(REGEX REPLACE "(^[\t ]*|[\t ]+)-l" ";-l" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "[\t ]*(-pthreads?)" ";\\1" _pkg_libs_output "${_pkg_libs_output}") # handle pthread without -l here (makes a lot of problems otherwise) + string(REGEX REPLACE "^[\t ]*;[\t ]*" "" _pkg_libs_output "${_pkg_libs_output}") + string(REPLACE "##" "\\ " _pkg_libs_output "${_pkg_libs_output}") + + #Windows path transformations + if(CMAKE_HOST_WIN32) + string(REGEX REPLACE "(^|;)/([a-zA-Z])/" "\\1\\2:/" _pkg_lib_paths_output "${_pkg_lib_paths_output}") + string(REGEX REPLACE " /([a-zA-Z])/" ";\\1:/" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "-l/([a-zA-Z])/" "-l\\1:/" _pkg_libs_output "${_pkg_libs_output}") + debug_message("pkg-config output lib paths after replacement (cmake style):${_pkg_lib_paths_output}") + debug_message("pkg-config output lib after replacement (cmake style):${_pkg_libs_output}") + endif() + if("${_config}" STREQUAL "DEBUG") - set(prefix "${CURRENT_INSTALLED_DIR}/debug/") - set(libprefix "${CURRENT_INSTALLED_DIR}/debug/lib/") - set(installprefix "${CURRENT_PACKAGES_DIR}/debug/") - set(installlibprefix "${CURRENT_PACKAGES_DIR}/debug/lib/") - set(lib_suffixes d _d _debug) + set(lib_suffixes d _d _debug -s -sd _s _sd -static -staticd _static _staticd) elseif("${_config}" STREQUAL "RELEASE") - set(prefix "${CURRENT_INSTALLED_DIR}") - set(libprefix "${CURRENT_INSTALLED_DIR}/lib/") - set(installprefix "${CURRENT_PACKAGES_DIR}/") - set(installlibprefix "${CURRENT_PACKAGES_DIR}/lib/") - set(lib_suffixes "") + set(lib_suffixes -s _s -static _static) else() message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") endif() - debug_message("Default library search paths: ${libprefix} --- ${installlibprefix} --- ${PKG_LIB_SEARCH_PATH}") - set(_contents "${${_contents_var}}") - #message(STATUS "Contents: ${_contents}") - set(_system_lib_normalized) - foreach(_system_lib ${_system_libs}) - string(REPLACE "-l" "" _system_lib "${_system_lib}") - list(APPEND _system_lib_normalized "${_system_lib}") + + debug_message("IGNORED FLAGS:'${_ignore_flags}'") + debug_message("BEFORE IGNORE FLAGS REMOVAL: ${_pkg_libs_output}") + foreach(_ignore IN LISTS _ignore_flags) # Remove ignore with whitespace + debug_message("REMOVING FLAG:'${_ignore}'") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_ignore}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + debug_message("AFTER REMOVAL: ${_pkg_libs_output}") endforeach() - ## Extra libraries: - string(REGEX MATCH "Libs:[^\n#]+" _libs "${_contents}") - #message(STATUS "LIB LINE: ${_libs}") - # The path to the library is either quoted and can not contain a quote or it is unqouted and cannot contain a single unescaped space - string(REGEX REPLACE "Libs:" "" _libs_list_tmp "${_libs}") - string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") + string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal - string(REGEX MATCH "Libs.private:[^\n#]+" _libs_private "${_contents}") - string(REGEX REPLACE "Libs.private:" "" _libs_private_list_tmp "${_libs_private}") - string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") + debug_message("SYSTEM LIBRARIES:'${_system_libs}'") + debug_message("LIBRARIES in PC:'${_pkg_libs_output}'") + foreach(_system_lib IN LISTS _system_libs) # Remove system libs with whitespace + debug_message("REMOVING:'${_system_lib}'") + debug_message("FROM:'${_pkg_libs_output}'") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + string(TOLOWER "${_system_lib}" _system_lib_lower) + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}") + string(REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}") + debug_message("AFTER REMOVAL:'${_pkg_libs_output}'") + endforeach() + list(REMOVE_DUPLICATES _pkg_libs_output) # We don't care about linker order and repeats - #message(STATUS "Found libraries: ${_libs_list_tmp}") - #message(STATUS "Found private libraries: ${_libs_private_list_tmp}") - list(APPEND _all_libs "${_libs_list_tmp}" "${_libs_private_list_tmp}") - list(REMOVE_DUPLICATES _all_libs) - foreach(_lib ${_all_libs}) - string(REGEX REPLACE "(^[\t ]+|[\t ]+$)" "" _lib "${_lib}") # Remove whitespaces at begin & end - if( "x${_lib}x" STREQUAL "xx") #Empty String - continue() - endif() - unset(CHECK_LIB CACHE) - unset(NO_CHECK_LIB) - #message(STATUS "CHECKING: x${_lib}z") - if("${_lib}" MATCHES "^-L((\\ |[^ ]+)+)$") - debug_message("Search path for libraries (unused): ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix + string(REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}") # Double ;; and Whitespace before/after ; removal + + debug_message("Library search paths:${_pkg_lib_paths_output}") + debug_message("Libraries to search:${_pkg_libs_output}") + set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) + list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a) + foreach(_lib IN LISTS _pkg_libs_output) + if(EXISTS "${_lib}" OR "x${_lib}x" STREQUAL "xx" ) # eat; all ok _lib is a fullpath to a library or empty continue() - elseif("${_lib}" MATCHES [[^-l("[^"]+"|(\\ |[^ ]+)+)$]] ) - set(_libname ${CMAKE_MATCH_1}) - debug_message("Searching for library: ${_libname}") - #debug_message("System libraries: ${_system_libs}") - foreach(_system_lib ${_system_libs}) - string(REPLACE "^[\t ]*-l" "" _libname_norm "${_libname}") - string(REGEX REPLACE "[\t ]+$" "" _libname_norm "${_libname_norm}") - #debug_message("${_libname_norm} vs ${_system_lib}") - if("${_libname_norm}" MATCHES "${_system_lib}" OR "-l${_libname_norm}" MATCHES "${_system_lib}") - set(NO_CHECK_LIB ON) - debug_message("${_libname} is SYSTEM_LIBRARY") - break() - endif() - endforeach() - if(NO_CHECK_LIB) - break() + elseif (_lib MATCHES "^-l(.+)$") + debug_message("Library match: CMAKE_MATCH_1:${CMAKE_MATCH_1}") + set(_libname "${CMAKE_MATCH_1}") + if(EXISTS "${_libname}") + debug_message("${_libname} detected as an existing full path!") + continue() # fullpath in -l argument and exists; all ok endif() - #debug_message("Searching for library ${_libname} in ${libprefix}") - if(EXISTS "${_libname}") #full path - set(CHECK_LIB_${_libname} "${_libname}" CACHE INTERNAL FORCE) + debug_message("CHECK_LIB_${_libname}_${_config} before: ${CHECK_LIB_${_libname}_${_config}}") + find_library(CHECK_LIB_${_libname}_${_config} NAMES ${_libname} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) + debug_message("CHECK_LIB_${_libname}_${_config} after: ${CHECK_LIB_${_libname}_${_config}}") + if(CHECK_LIB_${_libname}_${_config}) + unset(CHECK_LIB_${_libname}_${_config} CACHE) # need to unset or else other configurations will not check correctly + debug_message("CHECK_LIB_${_libname}_${_config} after unset: ${CHECK_LIB_${_libname}_${_config}}") + continue() # found library; all ok endif() - find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}" NO_DEFAULT_PATH) - if(NOT CHECK_LIB_${_libname} AND "${_config}" STREQUAL "DEBUG") - #message(STATUS "Unable to locate ${_libname}. Trying with debug suffix") - foreach(_lib_suffix ${lib_suffixes}) - string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") - find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}") - if(CHECK_LIB_${_libname}) - message(FATAL_ERROR "Found ${CHECK_LIB_${_libname}} with additional debug suffix! Please correct the *.pc file!") - string(REGEX REPLACE "(-l${_name_without_extension})(\.dll\.a|\.a|\.lib|\.so)" "\\1${_lib_suffix}\\2" _contents ${_contents}) - endif() - endforeach() - if(NOT CHECK_LIB_${_libname}) - message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + debug_message("Searching with additional suffixes: '${lib_suffixes}'") + foreach(_lib_suffix IN LISTS lib_suffixes) + string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") + set(search_name ${_name_without_extension}${_lib_suffix}) + debug_message("Search name: '${search_name}'") + debug_message("CHECK_LIB_${search_name}_${_config} before: ${CHECK_LIB_${search_name}_${_config}}") + debug_message("Search paths:'${_pkg_lib_paths_output}' '${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib'") + find_library(CHECK_LIB_${search_name}_${_config} NAMES ${search_name} PATHS ${_pkg_lib_paths_output} "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH) + debug_message("CHECK_LIB_${search_name}_${_config} after: ${CHECK_LIB_${search_name}_${_config}}") + if(CHECK_LIB_${search_name}_${_config}) + message(FATAL_ERROR "Found ${CHECK_LIB_${search_name}_${_config}} with additional '${_lib_suffix}' suffix! Please correct the *.pc file!") + unset(CHECK_LIB_${search_name}_${_config} CACHE) # need to unset or else other configurations will not check correctly endif() - elseif(NOT CHECK_LIB_${_libname}) - message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") - else() - debug_message("Found ${_libname} at ${CHECK_LIB_${_libname}}") - endif() - else() - #handle special cases - if(_lib STREQUAL "-pthread" OR _lib STREQUAL "-pthreads") - # Replace with VCPKG version? - #VCPKG should probably rename one of the pthread versions to avoid linking against system pthread? - # set(PTHREAD_SUFFIX ) - # if("${_config}" STREQUAL "DEBUG") - # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/debug/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3d.*") - # elseif("${_config}" STREQUAL "RELEASE") - # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3.*") - # endif() - # get_filename_component(PTHREAD_LIB "${PTHREAD_LIB}" NAME_WE) - # string(REPLACE "Libs: -pthread" "Libs: -L\${libdir} -l${PTHREAD_LIB}" _contents ${_contents}) - elseif(_lib STREQUAL _ignore_flags) - message(STATUS "${_lib} found in *.pc file and ignored!") - else() - message(FATAL_ERROR "Found ${_lib} and no rule to analyse the flag! Please check the *.pc file") - endif() + endforeach() + # Reaching here means error! + message(STATUS "CHECK_LIB_${_libname}_${_config}:${CHECK_LIB_${_libname}_${_config}}") + message(FATAL_ERROR "Library \"${_libname}\" was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file") + else () + message(FATAL_ERROR "Unhandled string \"${_lib}\" was found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file or add the case to vcpkg_fixup_pkgconfig") endif() - unset(CHECK_LIB_${_libname} CACHE) - unset(NO_CHECK_LIB) endforeach() - ## Packages: - string(REGEX MATCH "Requires:[^\n#]+" _pkg_list_tmp "${_contents}") - string(REGEX REPLACE "Requires:[\t ]" "" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" "" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX REPLACE " " ";" _pkg_list_tmp "${_pkg_list_tmp}") - string(REGEX MATCH "Requires.private:[^\n#]+" _pkg_private_list_tmp "${_contents}") - string(REGEX REPLACE "Requires.private:[\t ]" "" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]+" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - - debug_message("Required packages: ${_pkg_list_tmp}") - debug_message("Required private packages: ${_pkg_private_list_tmp}") - - #message(STATUS "System packages: ${_system_packages}") - foreach(_package ${_pkg_list_tmp} ${_pkg_private_list_tmp}) - debug_message("Searching for package: ${_package}") - set(PKG_CHECK ON) - if(NOT "${_system_packages}" STREQUAL "") - #message(STATUS "Checking ${_package} for SYSTEM PACKAGE: ${_system_packages}") - if("${_system_packages}" MATCHES "${_package}" ) - debug_message("Package ${_package} is SYSTEM PACKAGE!") - set(PKG_CHECK OFF) - endif() - endif() - if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc" OR EXISTS "${PKG_LIB_SEARCH_PATH}/pkgconfig/${_package}.pc")) - message(FATAL_ERROR "Package ${_package} not found! If it is a system package add it to the SYSTEM_PACKAGES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") - else() - debug_message("Found package ${_package}!") - endif() - endforeach() - ## Push modifications up in scope - set(${_contents_var} "${_contents}" PARENT_SCOPE) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) endfunction() function(vcpkg_fixup_pkgconfig) - cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) + cmake_parse_arguments(_vfpkg "SKIP_CHECK;NOT_STATIC_PKGCONFIG" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) + # Note about SYSTEM_PACKAGES: pkg-config requires all packages mentioned in pc files to exists. Otherwise pkg-config will fail to find the pkg. + # As such naming any SYSTEM_PACKAGES is damned to fail which is why it is not mentioned in the docs at the beginning. if(VCPKG_SYSTEM_LIBRARIES) list(APPEND _vfpkg_SYSTEM_LIBRARIES ${VCPKG_SYSTEM_LIBRARIES}) endif() + + if(_vfpkg_NOT_STATIC_PKGCONFIG) + set(PKGCONFIG_STATIC) + else() + set(PKGCONFIG_STATIC --static) + endif() + message(STATUS "Fixing pkgconfig") if(_vfpkg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") @@ -212,7 +275,20 @@ function(vcpkg_fixup_pkgconfig) list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") endif() - #Absolute Unix like paths + if(NOT PKGCONFIG) + find_program(PKGCONFIG pkg-config PATHS "bin" "/usr/bin" "/usr/local/bin") + if(NOT PKGCONFIG AND CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) + find_program(PKGCONFIG pkg-config PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) + endif() + debug_message("Using pkg-config from: ${PKGCONFIG}") + if(NOT PKGCONFIG AND NOT _vfpkg_SKIP_CHECK) + message(WARNING "Unable to find pkg-config to validate *.pc files. Skipping checkes!") + set(_vfpkg_SKIP_CHECK TRUE) + endif() + endif() + + #Absolute Unix like paths string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}") @@ -223,19 +299,24 @@ function(vcpkg_fixup_pkgconfig) get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") - string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") + #Correct *.pc file file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - - string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") + string(REGEX REPLACE "^prefix=(\")?(\\\\)?\\\${prefix}(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable file(WRITE "${_file}" "${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() + if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! + foreach(_file ${_vfpkg_RELEASE_FILES}) + vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "RELEASE" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") + endforeach() + endif() + message(STATUS "Fixing pkgconfig - debug") debug_message("Files: ${_vfpkg_DEBUG_FILES}") foreach(_file ${_vfpkg_DEBUG_FILES}) @@ -244,24 +325,29 @@ function(vcpkg_fixup_pkgconfig) file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/") string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") + #Correct *.pc file file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - string(REPLACE "debug/include" "../include" _contents "${_contents}") string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") string(REPLACE "debug/share" "../share" _contents "${_contents}") string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword - - string(REGEX REPLACE "^prefix=(\\\\)?\\\${prefix}(/debug)?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable - string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. - vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") + string(REGEX REPLACE "^prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + string(REGEX REPLACE "[\n]prefix=(\")?(\\\\)?\\\${prefix}(/debug)?(\")?" "\nprefix=\${pcfiledir}/${RELATIVE_PC_PATH}" _contents "${_contents}") # make pc file relocatable + string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. file(WRITE "${_file}" "${_contents}") unset(PKG_LIB_SEARCH_PATH) endforeach() + + if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! + foreach(_file ${_vfpkg_DEBUG_FILES}) + vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "DEBUG" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}") + endforeach() + endif() message(STATUS "Fixing pkgconfig --- finished") set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index 05253289ea24b9..44581ac6f061f6 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -91,9 +91,22 @@ function(vcpkg_from_gitlab) set(VCPKG_USE_HEAD_VERSION OFF) endif() - string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) - string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) - + string(REPLACE "/" ";" GITLAB_REPO_LINK ${_vdud_REPO}) + + list(LENGTH GITLAB_REPO_LINK len) + if(${len} EQUAL "2") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}) + endif() + + if(${len} EQUAL "3") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 GROUP_NAME) + list(GET GITLAB_REPO_LINK 2 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${GROUP_NAME}/${REPO_NAME}) + endif() + # Handle --no-head scenarios if(NOT VCPKG_USE_HEAD_VERSION) if(NOT _vdud_REF) @@ -103,7 +116,7 @@ function(vcpkg_from_gitlab) string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") vcpkg_download_distfile(ARCHIVE - URLS "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" + URLS "${GITLAB_LINK}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" SHA512 "${_vdud_SHA512}" FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) @@ -120,7 +133,7 @@ function(vcpkg_from_gitlab) endif() # The following is for --head scenarios - set(URL "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") + set(URL "${GITLAB_LINK}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz") set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") @@ -151,7 +164,7 @@ function(vcpkg_from_gitlab) # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision _execute_process(COMMAND ${GIT} ls-remote - "${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}.git" "${_vdud_HEAD_REF}" + "${GITLAB_LINK}.git" "${_vdud_HEAD_REF}" RESULT_VARIABLE _git_result OUTPUT_VARIABLE _git_output ) diff --git a/scripts/cmake/vcpkg_prettify_command.cmake b/scripts/cmake/vcpkg_prettify_command.cmake index ca04f9120e18b9..c12332b7a5965b 100644 --- a/scripts/cmake/vcpkg_prettify_command.cmake +++ b/scripts/cmake/vcpkg_prettify_command.cmake @@ -16,10 +16,10 @@ macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR) set(${OUTPUT_VAR} "") foreach(v ${${INPUT_VAR}}) - if(${v} MATCHES "( )") - list(APPEND ${OUTPUT_VAR} \"${v}\") + if(v MATCHES "( )") + list(APPEND ${OUTPUT_VAR} "\"${v}\"") else() - list(APPEND ${OUTPUT_VAR} ${v}) + list(APPEND ${OUTPUT_VAR} "${v}") endif() endforeach() list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR}) diff --git a/scripts/test_ports/cmake/CONTROL b/scripts/test_ports/cmake/CONTROL new file mode 100644 index 00000000000000..ba5848dbcb7386 --- /dev/null +++ b/scripts/test_ports/cmake/CONTROL @@ -0,0 +1,5 @@ +Source: cmake +Version: 3.17.2 +Build-Depends: qt5-base, qt5-winextras (windows), bzip2, expat, jsoncpp, liblzma, zlib, zstd, libarchive, curl, libuv, nghttp2 +Homepage: https://cmake.org/ +Description: CMake is an open-source, cross-platform family of tools designed to build, test and package software. diff --git a/scripts/test_ports/cmake/portfile.cmake b/scripts/test_ports/cmake/portfile.cmake new file mode 100644 index 00000000000000..9f41be53c16a39 --- /dev/null +++ b/scripts/test_ports/cmake/portfile.cmake @@ -0,0 +1,53 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.kitware.com/ + OUT_SOURCE_PATH SOURCE_PATH + REPO cmake/cmake + REF 615129f3ebd308abeaaee7f5f0689e7fc4616c28 + SHA512 5f02e05b7e6119c9c165c868d0679e0fbe5cc6b4f081a4e63a87d663c029bc378327ec042ae6bfd16bf48737bfaa5bae3be33a6dd33648e1f47cdc1a2370c366 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + #-DCMAKE_USE_SYSTEM_LIBRARIES=ON + -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON + -DCMAKE_USE_SYSTEM_CURL=ON + -DCMAKE_USE_SYSTEM_EXPAT=ON + -DCMAKE_USE_SYSTEM_ZLIB=ON + -DCMAKE_USE_SYSTEM_BZIP2=ON + -DCMAKE_USE_SYSTEM_ZSTD=ON + -DCMAKE_USE_SYSTEM_FORM=ON + -DCMAKE_USE_SYSTEM_JSONCPP=ON + -DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG + -DCMAKE_USE_SYSTEM_LIBUV=ON + -DBUILD_QtDialog=ON # Just to test Qt with CMake +) + +vcpkg_install_cmake(ADD_BIN_TO_PATH) +vcpkg_copy_pdbs() + +if(NOT VCPKG_TARGET_IS_OSX) + set(_tools cmake cmake-gui ctest cpack) + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _tools cmcldeps) + endif() + vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN) +else() + # On OSX everything is within a CMake.app folder + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) + file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app") + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/debug) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app") + endif() +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + +# Handle copyright +configure_file(${SOURCE_PATH}/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) \ No newline at end of file diff --git a/scripts/test_ports/vcpkg-ci-paraview/CONTROL b/scripts/test_ports/vcpkg-ci-paraview/CONTROL new file mode 100644 index 00000000000000..d4816dbf383660 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-paraview/CONTROL @@ -0,0 +1,6 @@ +Source: vcpkg-ci-paraview +Version: 1 +Port-Version: 1 +Homepage: https://github.com/microsoft/vcpkg +Description: Port to force features of certain ports within CI +Build-Depends: paraview[vtkm, tools] diff --git a/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake b/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake new file mode 100644 index 00000000000000..0015715fb66c72 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/scripts/toolchains/android.cmake b/scripts/toolchains/android.cmake index 8ffe9fbbc478f9..a7a7ea2d0cae41 100644 --- a/scripts/toolchains/android.cmake +++ b/scripts/toolchains/android.cmake @@ -5,13 +5,13 @@ set(ANDROID_TOOLCHAIN clang CACHE STRING "") set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "") set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "") -if (VCPKG_TARGET_TRIPLET STREQUAL "arm64-android") +if (VCPKG_TARGET_TRIPLET MATCHES "^arm64-android") set(ANDROID_ABI arm64-v8a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "arm-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-android") set(ANDROID_ABI armeabi-v7a CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "x64-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^x64-android") set(ANDROID_ABI x86_64 CACHE STRING "") -elseif(VCPKG_TARGET_TRIPLET STREQUAL "x86-android") +elseif(VCPKG_TARGET_TRIPLET MATCHES "^x86-android") set(ANDROID_ABI x86 CACHE STRING "") else() message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}") @@ -26,7 +26,11 @@ endif() if(DEFINED ENV{ANDROID_NDK_HOME}) set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME}) else() - set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") + set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/") + if(NOT EXISTS "${ANDROID_NDK_HOME}") + # Use Xamarin default installation folder + set(ANDROID_NDK_HOME "$ENV{ProgramFiles\(x86\)}/Android/android-sdk/ndk-bundle") + endif() endif() if(NOT EXISTS "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") @@ -39,14 +43,14 @@ if(NOT _VCPKG_ANDROID_TOOLCHAIN) set(_VCPKG_ANDROID_TOOLCHAIN 1) get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if(NOT _CMAKE_IN_TRY_COMPILE) - string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") - string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") - string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") - string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") - string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ") - string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ") - - string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") - string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_C_FLAGS " -fPIC ${VCPKG_C_FLAGS} ") + string(APPEND CMAKE_CXX_FLAGS " -fPIC ${VCPKG_CXX_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_DEBUG " ${VCPKG_C_FLAGS_DEBUG} ") + string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${VCPKG_CXX_FLAGS_DEBUG} ") + string(APPEND CMAKE_C_FLAGS_RELEASE " ${VCPKG_C_FLAGS_RELEASE} ") + string(APPEND CMAKE_CXX_FLAGS_RELEASE " ${VCPKG_CXX_FLAGS_RELEASE} ") + + string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ") endif() endif() diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 10a280faacbd30..62cb3740db265f 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -1,161 +1,172 @@ -cmake_minimum_required(VERSION 3.14) - -project(vcpkg CXX) -include(cmake/utilities.cmake) - -# =============== -# === Options === -# =============== - -include(CMakeDependentOption) - -option(BUILD_TESTING "Option for enabling testing" ON) -option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) -option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) -option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) -option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) -option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) - -CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF - "BUILD_TESTING" OFF) - -if(WERROR) - message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") -endif() -if(DEFINE_DISABLE_METRICS) - message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") - set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) -endif() - -vcpkg_detect_compiler() -vcpkg_detect_standard_library() -vcpkg_detect_std_filesystem() - -# ====================== -# === Compiler Flags === -# ====================== - -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 17) - -if(MSVC) - # either MSVC, or clang-cl - add_compile_options(-FC) - - if (MSVC_VERSION GREATER 1900) - # Visual Studio 2017 or later - add_compile_options(-permissive- -utf-8) - endif() - - if(VCPKG_DEVELOPMENT_WARNINGS) - string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - add_compile_options(-W4) - if(VCPKG_COMPILER STREQUAL "clang") - add_compile_options(-Wmissing-prototypes -Wno-missing-field-initializers) - else() - add_compile_options(-analyze) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - add_compile_options(-WX) - endif() -else() - if(VCPKG_DEVELOPMENT_WARNINGS) - add_compile_options(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) - - # GCC and clang have different names for the same warning - if(VCPKG_COMPILER STREQUAL "gcc") - add_compile_options(-Wmissing-declarations) - elseif(VCPKG_COMPILER STREQUAL "clang") - add_compile_options(-Wmissing-prototypes) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - add_compile_options(-Werror) - endif() -endif() - -# ======================== -# === System Libraries === -# ======================== - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) -link_libraries(Threads::Threads) - -add_compile_definitions(VCPKG_USE_STD_FILESYSTEM=$) -if(VCPKG_REQUIRE_LINK_CXXFS) - if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") - link_libraries(stdc++fs) - elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") - link_libraries(c++fs) - endif() -endif() - -if (MINGW) - add_compile_definitions( - UNICODE - _WIN32_WINNT=0x0601 - WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 - __fastfail=exit) - link_libraries(winhttp bcrypt version ole32 uuid) -endif() - - -# =============== -# === Targets === -# =============== - -add_compile_definitions(VCPKG_DISABLE_METRICS=$) -include_directories(include) -file(GLOB_RECURSE VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) -add_library(vcpkglib OBJECT ${VCPKGLIB_SOURCES}) - -add_executable(vcpkg src/vcpkg.cpp $) -if(WIN32 AND NOT VCPKG_DISABLE_METRICS) - add_executable(vcpkgmetricsuploader WIN32 src/vcpkgmetricsuploader.cpp $) -endif() - -if (BUILD_TESTING) - file(GLOB_RECURSE VCPKGTEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) - - enable_testing() - add_executable(vcpkg-test ${VCPKGTEST_SOURCES} $) - add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) - - if (VCPKG_BUILD_BENCHMARKING) - target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) - endif() -endif() - -if(VCPKG_BUILD_FUZZING) - file(GLOB_RECURSE VCPKGFUZZ_SOURCES src/vcpkg-fuzz/*.cpp) - add_executable(vcpkg-fuzz ${VCPKGFUZZ_SOURCES} $) -endif() - -find_program(CLANG_FORMAT clang-format) -if(CLANG_FORMAT) - file(GLOB_RECURSE VCPKG_FORMAT_SOURCES CONFIGURE_DEPENDS src/*.cpp include/pch.h include/vcpkg/*.h include/vcpkg-test/*.h) - add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FORMAT_SOURCES}) -endif() - -# =========== -# === PCH === -# =========== - -if(MSVC) - get_target_property(_srcs vcpkglib SOURCES) - - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() - - set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") - target_sources(vcpkglib PRIVATE src/pch.cpp) - target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) -endif() +cmake_minimum_required(VERSION 3.14) + +project(vcpkg CXX) +include(cmake/utilities.cmake) + +# =============== +# === Options === +# =============== + +include(CMakeDependentOption) + +option(BUILD_TESTING "Option for enabling testing" ON) +option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) +option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) +option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) +option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) +option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) + +CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF + "BUILD_TESTING" OFF) + +if(WERROR) + message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") +endif() +if(DEFINE_DISABLE_METRICS) + message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") + set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) +endif() + +# ============= +# === Files === +# ============= + +file(GLOB VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) +file(GLOB VCPKGLIB_BASE_SOURCES CONFIGURE_DEPENDS src/vcpkg/base/*.cpp) +file(GLOB VCPKGLIB_INCLUDES CONFIGURE_DEPENDS include/vcpkg/*.h) +file(GLOB VCPKGLIB_BASE_INCLUDES CONFIGURE_DEPENDS include/vcpkg/base/*.h) + +set(VCPKG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkg.cpp) + +set(VCPKGMETRICSUPLOADER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkgmetricsuploader.cpp) + +file(GLOB VCPKG_TEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) +file(GLOB VCPKG_TEST_INCLUDES CONFIGURE_DEPENDS include/vcpkg-test/*.h) + +file(GLOB VCPKG_FUZZ_SOURCES CONFIGURE_DEPENDS src/vcpkg-fuzz/*.cpp) + +# ======================== +# === System detection === +# ======================== + +vcpkg_detect_compiler() +vcpkg_detect_standard_library() +vcpkg_detect_std_filesystem() + +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) +if(MSVC) + string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +endif() + +# =============== +# === Targets === +# =============== + +# === Target: vcpkglib === + +add_library(vcpkglib + ${VCPKGLIB_BASE_SOURCES} + ${VCPKGLIB_SOURCES} + ${VCPKGLIB_BASE_INCLUDES} + ${VCPKGLIB_INCLUDES}) +target_include_directories(vcpkglib PUBLIC include) + +vcpkg_target_add_warning_options(vcpkglib) +target_compile_definitions(vcpkglib PUBLIC + VCPKG_USE_STD_FILESYSTEM=$) + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +target_link_libraries(vcpkglib PRIVATE Threads::Threads) + +if(VCPKG_CXXFS_LIBRARY) + target_link_libraries(vcpkglib PRIVATE ${VCPKG_CXXFS_LIBRARY}) +endif() + +if(MSVC) + get_target_property(_srcs vcpkglib SOURCES) + + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") + set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + endif() + + set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") + target_sources(vcpkglib PRIVATE src/pch.cpp) + target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) +else() + target_compile_options(vcpkglib PRIVATE -include "${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h") +endif() + +if (MINGW) + target_compile_definitions(vcpkglib + PUBLIC + UNICODE + _WIN32_WINNT=0x0601 + WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 + __fastfail=exit) + target_link_libraries(vcpkglib PUBLIC winhttp bcrypt version ole32 uuid) +endif() + +# === Target: vcpkg === + +add_executable(vcpkg ${VCPKG_SOURCES}) +target_link_libraries(vcpkg PRIVATE vcpkglib) +vcpkg_target_add_warning_options(vcpkg) + +# === Target: vcpkgmetricsuploader === + +if(WIN32 AND NOT VCPKG_DISABLE_METRICS) + add_executable(vcpkgmetricsuploader WIN32 ${VCPKGMETRICSUPLOADER_SOURCES}) + target_link_libraries(vcpkgmetricsuploader PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkgmetricsuploader) +endif() + +# === Target: vcpkg-test === + +if (BUILD_TESTING) + enable_testing() + + add_executable(vcpkg-test + ${VCPKG_TEST_SOURCES} + ${VCPKG_TEST_INCLUDES}) + target_link_libraries(vcpkg-test PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkg-test) + + add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) + + if (VCPKG_BUILD_BENCHMARKING) + target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) + endif() +endif() + +# === Target: vcpkg-fuzz === + +if(VCPKG_BUILD_FUZZING) + add_executable(vcpkg-fuzz ${VCPKG_FUZZ_SOURCES}) + target_link_libraries(vcpkg-fuzz PRIVATE vcpkglib) + vcpkg_target_add_warning_options(vcpkg-fuzz) +endif() + +# === Target: format === + +find_program(CLANG_FORMAT clang-format) +if(CLANG_FORMAT) + add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose + ${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp + ${VCPKGLIB_BASE_SOURCES} + ${VCPKGLIB_NON_PCH_SOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h + ${VCPKGLIB_BASE_INCLUDES} + ${VCPKGLIB_NON_PCH_INCLUDES} + + ${VCPKG_SOURCES} + ${VCPKGMETRICSUPLOADER_SOURCES} + + ${VCPKG_TEST_SOURCES} + ${VCPKG_TEST_INCLUDES} + + ${VCPKG_FUZZ_SOURCES}) +endif() diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake index b99063a658ad9c..f04c1ddbb771b5 100644 --- a/toolsrc/cmake/utilities.cmake +++ b/toolsrc/cmake/utilities.cmake @@ -77,7 +77,7 @@ int main() {} _VCPKG_STANDARD_LIBRARY_LIBCXX) check_cxx_source_compiles([[ #include -#if !defined(_MSVC_STL_VERSION) +#if !defined(_MSVC_STL_VERSION) && !(defined(_MSC_VER) && _MSC_VER <= 1900) #error "not MSVC stl" #endif int main() {} @@ -101,7 +101,7 @@ int main() {} endif() endfunction() -# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_REQUIRE_LINK_CXXFS +# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_CXXFS_LIBRARY function(vcpkg_detect_std_filesystem) vcpkg_detect_standard_library() @@ -129,10 +129,14 @@ int main() {} int main() {} ]] _VCPKG_USE_STD_FILESYSTEM) + + if(_VCPKG_REQUIRE_LINK_CXXFS) + set(_VCPKG_CXXFS_LIBRARY "stdc++fs") + endif() elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") # AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0 - set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + set(_VCPKG_CXXFS_LIBRARY OFF) else() check_cxx_source_compiles([[ #include @@ -142,6 +146,10 @@ int main() {} int main() {} ]] _VCPKG_REQUIRE_LINK_CXXFS) + + if(_VCPKG_REQUIRE_LINK_CXXFS) + set(_VCPKG_CXXFS_LIBRARY "c++fs") + endif() endif() # We don't support versions of libc++ < 7.0.0, and libc++ 7.0.0 has @@ -155,16 +163,16 @@ int main() {} int main() {}" _VCPKG_USE_STD_FILESYSTEM) - set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + set(_VCPKG_CXXFS_LIBRARY OFF) endif() set(VCPKG_USE_STD_FILESYSTEM ${_VCPKG_USE_STD_FILESYSTEM} CACHE BOOL "Whether to use , as opposed to " FORCE) - set(VCPKG_REQUIRE_LINK_CXXFS ${_VCPKG_REQUIRE_LINK_CXXFS} - CACHE BOOL - "Whether it's required to pass -l[std]c++fs in order to use " + set(VCPKG_CXXFS_LIBRARY ${_VCPKG_CXXFS_LIBRARY} + CACHE STRING + "Library to link (if any) in order to use " FORCE) if(VCPKG_USE_STD_FILESYSTEM) @@ -172,10 +180,54 @@ int main() {} else() set(msg "") endif() - if(VCPKG_REQUIRE_LINK_CXXFS) - set(msg "${msg} with -l[std]c++fs") + if(VCPKG_CXXFS_LIBRARY) + set(msg "${msg} with -l${VCPKG_CXXFS_LIBRARY}") endif() message(STATUS "Detecting how to use the C++ filesystem library - ${msg}") endif() endfunction() + +function(vcpkg_target_add_warning_options TARGET) + if(MSVC) + # either MSVC, or clang-cl + target_compile_options(${TARGET} PRIVATE -FC) + + if (MSVC_VERSION GREATER 1900) + # Visual Studio 2017 or later + target_compile_options(${TARGET} PRIVATE -permissive- -utf-8) + endif() + + if(VCPKG_DEVELOPMENT_WARNINGS) + target_compile_options(${TARGET} PRIVATE -W4) + if(VCPKG_COMPILER STREQUAL "clang") + target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes -Wno-missing-field-initializers) + else() + target_compile_options(${TARGET} PRIVATE -analyze) + endif() + else() + target_compile_options(${TARGET} PRIVATE -W3) + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + target_compile_options(${TARGET} PRIVATE -WX) + endif() + else() + if(VCPKG_DEVELOPMENT_WARNINGS) + target_compile_options(${TARGET} PRIVATE + -Wall -Wextra -Wpedantic + -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) + + # GCC and clang have different names for the same warning + if(VCPKG_COMPILER STREQUAL "gcc") + target_compile_options(${TARGET} PRIVATE -Wmissing-declarations) + elseif(VCPKG_COMPILER STREQUAL "clang") + target_compile_options(${TARGET} PRIVATE -Wmissing-prototypes) + endif() + endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + target_compile_options(${TARGET} PRIVATE -Werror) + endif() + endif() +endfunction() diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h index ce403c308095d8..d2c512f9bf0eae 100644 --- a/toolsrc/include/vcpkg-test/util.h +++ b/toolsrc/include/vcpkg-test/util.h @@ -18,6 +18,22 @@ } \ } while (0) +namespace Catch +{ + template<> + struct StringMaker + { + static std::string convert(vcpkg::FullPackageSpec const& value) + { + return vcpkg::Strings::concat(value.package_spec.name(), + '[', + vcpkg::Strings::join(",", value.features), + "]:", + value.package_spec.triplet()); + } + }; +} + namespace vcpkg::Test { std::unique_ptr make_control_file( @@ -48,6 +64,12 @@ namespace vcpkg::Test const char* depends = "", const char* triplet = "x86-windows"); + extern const Triplet X86_WINDOWS; + extern const Triplet X64_WINDOWS; + extern const Triplet X86_UWP; + extern const Triplet ARM_UWP; + extern const Triplet X64_ANDROID; + /// /// Map of source control files by their package name. /// @@ -55,7 +77,7 @@ namespace vcpkg::Test { std::unordered_map map; Triplet triplet; - PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) { } + PackageSpecMap(Triplet t = X86_WINDOWS) noexcept : triplet(t) { } PackageSpec emplace(const char* name, const char* depends = "", diff --git a/toolsrc/include/vcpkg/base/json.h b/toolsrc/include/vcpkg/base/json.h index 3195c223a72601..a4ad44ebd07259 100644 --- a/toolsrc/include/vcpkg/base/json.h +++ b/toolsrc/include/vcpkg/base/json.h @@ -88,11 +88,11 @@ namespace vcpkg::Json { Value() noexcept; // equivalent to Value::null() Value(Value&&) noexcept; + Value(const Value&); Value& operator=(Value&&) noexcept; + Value& operator=(const Value&); ~Value(); - Value clone() const noexcept; - ValueKind kind() const noexcept; bool is_null() const noexcept; @@ -124,7 +124,12 @@ namespace vcpkg::Json static Value number(double d) noexcept; static Value string(StringView) noexcept; static Value array(Array&&) noexcept; + static Value array(const Array&) noexcept; static Value object(Object&&) noexcept; + static Value object(const Object&) noexcept; + + friend bool operator==(const Value& lhs, const Value& rhs); + friend bool operator!=(const Value& lhs, const Value& rhs) { return !(lhs == rhs); } private: friend struct impl::ValueImpl; @@ -138,14 +143,12 @@ namespace vcpkg::Json public: Array() = default; - Array(Array const&) = delete; + Array(Array const&) = default; Array(Array&&) = default; - Array& operator=(Array const&) = delete; + Array& operator=(Array const&) = default; Array& operator=(Array&&) = default; ~Array() = default; - Array clone() const noexcept; - using iterator = underlying_t::iterator; using const_iterator = underlying_t::const_iterator; @@ -177,37 +180,45 @@ namespace vcpkg::Json const_iterator cbegin() const { return underlying_.cbegin(); } const_iterator cend() const { return underlying_.cend(); } + friend bool operator==(const Array& lhs, const Array& rhs); + friend bool operator!=(const Array& lhs, const Array& rhs) { return !(lhs == rhs); } + private: underlying_t underlying_; }; struct Object { private: - using underlying_t = std::vector>; + using value_type = std::pair; + using underlying_t = std::vector; underlying_t::const_iterator internal_find_key(StringView key) const noexcept; public: // these are here for better diagnostics Object() = default; - Object(Object const&) = delete; + Object(Object const&) = default; Object(Object&&) = default; - Object& operator=(Object const&) = delete; + Object& operator=(Object const&) = default; Object& operator=(Object&&) = default; ~Object() = default; - Object clone() const noexcept; - // asserts if the key is found Value& insert(std::string key, Value&& value); + Value& insert(std::string key, const Value& value); Object& insert(std::string key, Object&& value); + Object& insert(std::string key, const Object& value); Array& insert(std::string key, Array&& value); + Array& insert(std::string key, const Array& value); // replaces the value if the key is found, otherwise inserts a new // value. Value& insert_or_replace(std::string key, Value&& value); + Value& insert_or_replace(std::string key, const Value& value); Object& insert_or_replace(std::string key, Object&& value); + Object& insert_or_replace(std::string key, const Object& value); Array& insert_or_replace(std::string key, Array&& value); + Array& insert_or_replace(std::string key, const Array& value); // returns whether the key existed bool remove(StringView key) noexcept; @@ -216,13 +227,13 @@ namespace vcpkg::Json Value& operator[](StringView key) noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); return *res; } const Value& operator[](StringView key) const noexcept { auto res = this->get(key); - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, res, "missing key: \"%s\"", key); return *res; } @@ -231,8 +242,12 @@ namespace vcpkg::Json bool contains(StringView key) const noexcept { return this->get(key); } + bool is_empty() const noexcept { return size() == 0; } std::size_t size() const noexcept { return this->underlying_.size(); } + // sorts keys alphabetically + void sort_keys(); + struct const_iterator { using value_type = std::pair; @@ -267,6 +282,9 @@ namespace vcpkg::Json const_iterator cbegin() const noexcept { return const_iterator{this->underlying_.begin()}; } const_iterator cend() const noexcept { return const_iterator{this->underlying_.end()}; } + friend bool operator==(const Object& lhs, const Object& rhs); + friend bool operator!=(const Object& lhs, const Object& rhs) { return !(lhs == rhs); } + private: underlying_t underlying_; }; diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index cd48380290d675..5042dd15883149 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -185,6 +185,8 @@ namespace vcpkg::Strings std::string trim(std::string&& s); + StringView trim(StringView sv); + void trim_all_and_remove_whitespace_strings(std::vector* strings); std::vector split(StringView s, const char delimiter); diff --git a/toolsrc/include/vcpkg/base/stringview.h b/toolsrc/include/vcpkg/base/stringview.h index 6a5503e1c3e29d..405142c3683f53 100644 --- a/toolsrc/include/vcpkg/base/stringview.h +++ b/toolsrc/include/vcpkg/base/stringview.h @@ -37,6 +37,9 @@ namespace vcpkg constexpr const char* begin() const { return m_ptr; } constexpr const char* end() const { return m_ptr + m_size; } + std::reverse_iterator rbegin() const { return std::make_reverse_iterator(end()); } + std::reverse_iterator rend() const { return std::make_reverse_iterator(begin()); } + constexpr const char* data() const { return m_ptr; } constexpr size_t size() const { return m_size; } diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 0a2e745c468c11..2340728fd032ce 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -25,6 +25,7 @@ namespace vcpkg::System X64, ARM, ARM64, + S390X, }; Optional to_cpu_architecture(StringView arch); diff --git a/toolsrc/include/vcpkg/base/system.process.h b/toolsrc/include/vcpkg/base/system.process.h index 91faa59854b4e2..b9184c05cd7440 100644 --- a/toolsrc/include/vcpkg/base/system.process.h +++ b/toolsrc/include/vcpkg/base/system.process.h @@ -27,6 +27,12 @@ namespace vcpkg::System { CmdLineBuilder& path_arg(const fs::path& p) { return string_arg(p.u8string()); } CmdLineBuilder& string_arg(StringView s); + CmdLineBuilder& ampersand() + { + buf.push_back('&'); + buf.push_back('&'); + return *this; + } std::string extract() noexcept { return std::move(buf); } operator ZStringView() const { return buf; } diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index 2d2e4cf200de52..f10c41af07bc01 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -39,7 +39,7 @@ namespace vcpkg std::vector default_features; std::vector dependencies; std::string abi; - Type type; + Type type = {Type::UNKNOWN}; }; bool operator==(const BinaryParagraph&, const BinaryParagraph&); diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 0fac8222c07e27..83d797fd1df216 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -346,4 +347,11 @@ namespace vcpkg::Build bool m_compiler_tracking; }; + + struct BuildCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/commands.autocomplete.h b/toolsrc/include/vcpkg/commands.autocomplete.h new file mode 100644 index 00000000000000..4f518d0f0c6029 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.autocomplete.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Autocomplete +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct AutocompleteCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.buildexternal.h b/toolsrc/include/vcpkg/commands.buildexternal.h new file mode 100644 index 00000000000000..b4e1aa669bf5d0 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.buildexternal.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::BuildExternal +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct BuildExternalCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.cache.h b/toolsrc/include/vcpkg/commands.cache.h new file mode 100644 index 00000000000000..5d18a3f99f49e1 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.cache.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Cache +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CacheCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.ci.h b/toolsrc/include/vcpkg/commands.ci.h new file mode 100644 index 00000000000000..4657741c926d2f --- /dev/null +++ b/toolsrc/include/vcpkg/commands.ci.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::CI +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct CICommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.ciclean.h b/toolsrc/include/vcpkg/commands.ciclean.h new file mode 100644 index 00000000000000..ed9e2f005b209f --- /dev/null +++ b/toolsrc/include/vcpkg/commands.ciclean.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::CIClean +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CICleanCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.contact.h b/toolsrc/include/vcpkg/commands.contact.h new file mode 100644 index 00000000000000..f0af41c14aef4e --- /dev/null +++ b/toolsrc/include/vcpkg/commands.contact.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Contact +{ + extern const CommandStructure COMMAND_STRUCTURE; + const std::string& email(); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + + struct ContactCommand : BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.create.h b/toolsrc/include/vcpkg/commands.create.h new file mode 100644 index 00000000000000..a8eb99b273d0dd --- /dev/null +++ b/toolsrc/include/vcpkg/commands.create.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Create +{ + extern const CommandStructure COMMAND_STRUCTURE; + int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct CreateCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.dependinfo.h b/toolsrc/include/vcpkg/commands.dependinfo.h new file mode 100644 index 00000000000000..81301b6d9c6c9c --- /dev/null +++ b/toolsrc/include/vcpkg/commands.dependinfo.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::DependInfo +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct DependInfoCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.edit.h b/toolsrc/include/vcpkg/commands.edit.h new file mode 100644 index 00000000000000..9a37d2ee3d2cfe --- /dev/null +++ b/toolsrc/include/vcpkg/commands.edit.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Edit +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct EditCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.env.h b/toolsrc/include/vcpkg/commands.env.h new file mode 100644 index 00000000000000..5ba58d081daedf --- /dev/null +++ b/toolsrc/include/vcpkg/commands.env.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Env +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct EnvCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.fetch.h b/toolsrc/include/vcpkg/commands.fetch.h new file mode 100644 index 00000000000000..c41965903e9571 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.fetch.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Fetch +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct FetchCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.format-manifest.h b/toolsrc/include/vcpkg/commands.format-manifest.h new file mode 100644 index 00000000000000..1317bbc705febc --- /dev/null +++ b/toolsrc/include/vcpkg/commands.format-manifest.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::FormatManifest +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct FormatManifestCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index cec9237f5737f4..948d4b5e84f78b 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -1,10 +1,9 @@ #pragma once #include +#include #include #include -#include -#include #include #include @@ -12,162 +11,6 @@ namespace vcpkg::Commands { - using CommandTypeA = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - using CommandTypeC = void (*)(const VcpkgCmdArguments& args, Files::Filesystem& fs); - - enum class DryRun : bool - { - No, - Yes, - }; - - namespace BuildExternal - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace CI - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace CIClean - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Env - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Create - { - extern const CommandStructure COMMAND_STRUCTURE; - int perform(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Upgrade - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Edit - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace DependInfo - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - - namespace Search - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace List - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Owns - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Cache - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Integrate - { - extern const CommandStructure COMMAND_STRUCTURE; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void append_helpstring(HelpTableFormatter& table); - std::string get_helpstring(); - } - - namespace PortsDiff - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace PortHistory - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Autocomplete - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Version - { - const char* base_version(); - const std::string& version(); - void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - } - - namespace Contact - { - extern const CommandStructure COMMAND_STRUCTURE; - const std::string& email(); - void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); - } - - namespace X_VSInstances - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Hash - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Fetch - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace FormatManifest - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace SetInstalled - { - extern const CommandStructure COMMAND_STRUCTURE; - void perform_and_exit_ex(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - const PortFileProvider::PathsPortFileProvider& provider, - IBinaryProvider& binary_provider, - const CMakeVars::CMakeVarProvider& cmake_vars, - const std::vector& specs, - const Build::BuildPackageOptions& install_plan_options, - DryRun dry_run, - const Optional& pkgsconfig_path); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); - } - template struct PackageNameAndFunction { @@ -175,12 +18,12 @@ namespace vcpkg::Commands T function; }; - Span> get_available_commands_type_a(); - Span> get_available_commands_type_b(); - Span> get_available_commands_type_c(); + Span> get_available_basic_commands(); + Span> get_available_paths_commands(); + Span> get_available_triplet_commands(); template - T find(const std::string& command_name, const std::vector> available_commands) + T find(StringView command_name, Span> available_commands) { for (const PackageNameAndFunction& cmd : available_commands) { diff --git a/toolsrc/include/vcpkg/commands.hash.h b/toolsrc/include/vcpkg/commands.hash.h new file mode 100644 index 00000000000000..aa9b11c056c984 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.hash.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Hash +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct HashCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.info.h b/toolsrc/include/vcpkg/commands.info.h new file mode 100644 index 00000000000000..556d1eb012da82 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.info.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Info +{ + extern const CommandStructure COMMAND_STRUCTURE; + + struct InfoCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.integrate.h b/toolsrc/include/vcpkg/commands.integrate.h new file mode 100644 index 00000000000000..162f49a3c34baf --- /dev/null +++ b/toolsrc/include/vcpkg/commands.integrate.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Integrate +{ + extern const CommandStructure COMMAND_STRUCTURE; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + void append_helpstring(HelpTableFormatter& table); + std::string get_helpstring(); + + struct IntegrateCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h new file mode 100644 index 00000000000000..10d213522007bc --- /dev/null +++ b/toolsrc/include/vcpkg/commands.interface.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +namespace vcpkg::Commands +{ + enum class DryRun : bool + { + No, + Yes, + }; + + struct BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const = 0; + virtual ~BasicCommand() = default; + }; + + struct PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const = 0; + virtual ~PathsCommand() = default; + }; + + struct TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const = 0; + virtual ~TripletCommand() = default; + }; +} diff --git a/toolsrc/include/vcpkg/commands.list.h b/toolsrc/include/vcpkg/commands.list.h new file mode 100644 index 00000000000000..77a5f41bdb3217 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.list.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::List +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct ListCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h new file mode 100644 index 00000000000000..13676b2bd96a36 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.owns.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Owns +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct OwnsCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.porthistory.h b/toolsrc/include/vcpkg/commands.porthistory.h new file mode 100644 index 00000000000000..3ca5325320f4e7 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.porthistory.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::PortHistory +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct PortHistoryCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.portsdiff.h b/toolsrc/include/vcpkg/commands.portsdiff.h new file mode 100644 index 00000000000000..8cd1b094c68742 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.portsdiff.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg::Commands::PortsDiff +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct PortsDiffCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h new file mode 100644 index 00000000000000..6220a886630e5c --- /dev/null +++ b/toolsrc/include/vcpkg/commands.search.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Search +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct SearchCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.setinstalled.h b/toolsrc/include/vcpkg/commands.setinstalled.h new file mode 100644 index 00000000000000..c5723669bd7307 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.setinstalled.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +namespace vcpkg::Commands::SetInstalled +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit_ex(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binary_provider, + const CMakeVars::CMakeVarProvider& cmake_vars, + Dependencies::ActionPlan action_plan, + DryRun dry_run, + const Optional& pkgsconfig_path); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct SetInstalledCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.upgrade.h b/toolsrc/include/vcpkg/commands.upgrade.h new file mode 100644 index 00000000000000..340a70c97cd42b --- /dev/null +++ b/toolsrc/include/vcpkg/commands.upgrade.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Upgrade +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct UpgradeCommand : TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.version.h b/toolsrc/include/vcpkg/commands.version.h new file mode 100644 index 00000000000000..0f1717c7462dd0 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.version.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace vcpkg::Commands::Version +{ + const char* base_version(); + const std::string& version(); + void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs); + + struct VersionCommand : BasicCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const override; + }; +} diff --git a/toolsrc/include/vcpkg/commands.xvsinstances.h b/toolsrc/include/vcpkg/commands.xvsinstances.h new file mode 100644 index 00000000000000..fc7a39b98bc5ba --- /dev/null +++ b/toolsrc/include/vcpkg/commands.xvsinstances.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace vcpkg::Commands::X_VSInstances +{ + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct VSInstancesCommand : PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; +} diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index a9021355f570d6..76ff89e7a4f077 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -161,6 +161,12 @@ namespace vcpkg::Dependencies const StatusParagraphs& status_db, const CreateInstallPlanOptions& options = {}); + // `features` should have "default" instead of missing "core". This is only exposed for testing purposes. + std::vector resolve_deps_as_top_level(const SourceControlFile& scf, + Triplet triplet, + std::vector features, + CMakeVars::CMakeVarProvider& var_provider); + void print_plan(const ActionPlan& action_plan, const bool is_recursive = true, const fs::path& default_ports_dir = {}); diff --git a/toolsrc/include/vcpkg/export.h b/toolsrc/include/vcpkg/export.h index 3605081e3a8367..0dd5b1aacdf930 100644 --- a/toolsrc/include/vcpkg/export.h +++ b/toolsrc/include/vcpkg/export.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace vcpkg::Export { @@ -9,4 +9,11 @@ namespace vcpkg::Export void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths); + + struct ExportCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h index 97bc1186409833..3e1ef381e41317 100644 --- a/toolsrc/include/vcpkg/help.h +++ b/toolsrc/include/vcpkg/help.h @@ -1,7 +1,6 @@ #pragma once -#include -#include +#include #include @@ -12,4 +11,9 @@ namespace vcpkg::Help void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); void help_topic_valid_triplet(const VcpkgPaths& paths); + + struct HelpCommand : Commands::PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; } diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index 2c674e7de6727a..f85d48d8d14513 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -90,7 +91,24 @@ namespace vcpkg::Install const Build::IBuildLogsRecorder& build_logs_recorder, const CMakeVars::CMakeVarProvider& var_provider); + struct CMakeUsageInfo + { + std::string message; + bool usage_file = false; + Optional header_only; + std::map> cmake_targets_map; + }; + + CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths); + extern const CommandStructure COMMAND_STRUCTURE; void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); + + struct InstallCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/packagespec.h b/toolsrc/include/vcpkg/packagespec.h index 495056884b0b08..a362d80680eb38 100644 --- a/toolsrc/include/vcpkg/packagespec.h +++ b/toolsrc/include/vcpkg/packagespec.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -47,6 +48,9 @@ namespace vcpkg Triplet m_triplet; }; + bool operator==(const PackageSpec& left, const PackageSpec& right); + inline bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } + /// /// /// Full specification of a feature. Contains all information to reference @@ -108,6 +112,12 @@ namespace vcpkg const std::vector& all_features) const; static ExpectedS from_string(const std::string& spec_as_string, Triplet default_triplet); + + bool operator==(const FullPackageSpec& o) const + { + return package_spec == o.package_spec && features == o.features; + } + bool operator!=(const FullPackageSpec& o) const { return !(*this == o); } }; /// @@ -128,6 +138,11 @@ namespace vcpkg std::string name; std::vector features; PlatformExpression::Expr platform; + + Json::Object extra_info; + + friend bool operator==(const Dependency& lhs, const Dependency& rhs); + friend bool operator!=(const Dependency& lhs, const Dependency& rhs) { return !(lhs == rhs); } }; struct ParsedQualifiedSpecifier @@ -142,9 +157,6 @@ namespace vcpkg Optional parse_package_name(Parse::ParserBase& parser); ExpectedS parse_qualified_specifier(StringView input); Optional parse_qualified_specifier(Parse::ParserBase& parser); - - bool operator==(const PackageSpec& left, const PackageSpec& right); - bool operator!=(const PackageSpec& left, const PackageSpec& right); } namespace std diff --git a/toolsrc/include/vcpkg/paragraphparseresult.h b/toolsrc/include/vcpkg/paragraphparseresult.h deleted file mode 100644 index 558715bbcc8233..00000000000000 --- a/toolsrc/include/vcpkg/paragraphparseresult.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include - -namespace vcpkg -{ - enum class ParagraphParseResult - { - SUCCESS = 0, - EXPECTED_ONE_PARAGRAPH - }; - - struct ParagraphParseResultCategoryImpl final : std::error_category - { - virtual const char* name() const noexcept override; - - virtual std::string message(int ev) const noexcept override; - }; - - const std::error_category& paragraph_parse_result_category(); - - std::error_code make_error_code(ParagraphParseResult e); - - ParagraphParseResult to_paragraph_parse_result(int i); - - ParagraphParseResult to_paragraph_parse_result(std::error_code ec); -} - -namespace std -{ - // Enable implicit conversion to std::error_code - template<> - struct is_error_code_enum : ::std::true_type - { - }; -} \ No newline at end of file diff --git a/toolsrc/include/vcpkg/platform-expression.h b/toolsrc/include/vcpkg/platform-expression.h index fd2bb85898d5ee..43ae6e89de5c85 100644 --- a/toolsrc/include/vcpkg/platform-expression.h +++ b/toolsrc/include/vcpkg/platform-expression.h @@ -38,6 +38,31 @@ namespace vcpkg::PlatformExpression bool evaluate(const Context& context) const; bool is_empty() const { return !static_cast(underlying_); } + // returns: + // - 0 for empty + // - 1 for identifiers + // - 1 + complexity(inner) for ! + // - 1 + sum(complexity(inner)) for & and | + int complexity() const; + + // these two are friends so that they're only findable via ADL + + // this does a structural equality, so, for example: + // !structurally_equal((x & y) & z, x & y & z) + // !structurally_equal((x & y) | z, (x | z) & (y | z)) + // even though these expressions are equivalent + friend bool structurally_equal(const Expr& lhs, const Expr& rhs); + + // returns 0 if and only if structurally_equal(lhs, rhs) + // Orders via the following: + // - If complexity(a) < complexity(b) => a < b + // - Otherwise, if to_string(a).size() < to_string(b).size() => a < b + // - Otherwise, if to_string(a) < to_string(b) => a < b + // - else, they must be structurally equal + friend int compare(const Expr& lhs, const Expr& rhs); + + friend std::string to_string(const Expr& expr); + private: std::unique_ptr underlying_; }; diff --git a/toolsrc/include/vcpkg/remove.h b/toolsrc/include/vcpkg/remove.h index c43bc73c20cdaa..f68e8bd9f980b3 100644 --- a/toolsrc/include/vcpkg/remove.h +++ b/toolsrc/include/vcpkg/remove.h @@ -1,8 +1,7 @@ #pragma once +#include #include -#include -#include namespace vcpkg::Remove { @@ -23,4 +22,11 @@ namespace vcpkg::Remove void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); + + struct RemoveCommand : Commands::TripletCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const override; + }; } diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index b2743645c856a4..ac3699ca983d63 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -40,6 +40,11 @@ namespace vcpkg std::string name; std::vector description; std::vector dependencies; + + Json::Object extra_info; + + friend bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs); + friend bool operator!=(const FeatureParagraph& lhs, const FeatureParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -60,6 +65,11 @@ namespace vcpkg Type type; PlatformExpression::Expr supports_expression; + + Json::Object extra_info; + + friend bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs); + friend bool operator!=(const SourceParagraph& lhs, const SourceParagraph& rhs) { return !(lhs == rhs); } }; /// @@ -73,7 +83,7 @@ namespace vcpkg { for (const auto& feat_ptr : scf.feature_paragraphs) { - feature_paragraphs.emplace_back(std::make_unique(*feat_ptr)); + feature_paragraphs.push_back(std::make_unique(*feat_ptr)); } } @@ -89,8 +99,14 @@ namespace vcpkg Optional find_feature(const std::string& featurename) const; Optional&> find_dependencies_for_feature(const std::string& featurename) const; + + friend bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs); + friend bool operator!=(const SourceControlFile& lhs, const SourceControlFile& rhs) { return !(lhs == rhs); } }; + Json::Object serialize_manifest(const SourceControlFile& scf); + Json::Object serialize_debug_manifest(const SourceControlFile& scf); + /// /// Full metadata of a package: core and other features. As well as the location the SourceControlFile was /// loaded from. diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index dde4ecb19866cc..cf4c3c0466758a 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -61,4 +61,6 @@ namespace vcpkg const StatusParagraph* core; std::vector features; }; + + Json::Value serialize_ipv(const InstalledPackageView& ipv, const struct VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h index b57ca2918919b9..d5c0a5c23db572 100644 --- a/toolsrc/include/vcpkg/tools.h +++ b/toolsrc/include/vcpkg/tools.h @@ -9,6 +9,21 @@ namespace vcpkg { struct VcpkgPaths; + namespace Tools + { + static const std::string SEVEN_ZIP = "7zip"; + static const std::string SEVEN_ZIP_ALT = "7z"; + static const std::string MAVEN = "mvn"; + static const std::string CMAKE = "cmake"; + static const std::string GIT = "git"; + static const std::string MONO = "mono"; + static const std::string NINJA = "ninja"; + static const std::string NUGET = "nuget"; + static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; + static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; + static const std::string IFW_REPOGEN = "ifw_repogen"; + } + struct ToolCache { virtual ~ToolCache() { } diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index 736b22a2d11b14..42d99dc3e12f1c 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -3,13 +3,12 @@ #include #include -#include - #include namespace vcpkg { struct TripletInstance; + struct VcpkgCmdArguments; struct Triplet { @@ -18,20 +17,6 @@ namespace vcpkg static Triplet from_canonical_name(std::string&& triplet_as_string); - static const Triplet X86_WINDOWS; - static const Triplet X64_WINDOWS; - static const Triplet ARM_WINDOWS; - static const Triplet ARM64_WINDOWS; - static const Triplet X86_UWP; - static const Triplet X64_UWP; - static const Triplet ARM_UWP; - static const Triplet ARM64_UWP; - - static const Triplet ARM_ANDROID; - static const Triplet ARM64_ANDROID; - static const Triplet X86_ANDROID; - static const Triplet X64_ANDROID; - const std::string& canonical_name() const; const std::string& to_string() const; void to_string(std::string& out) const; diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h index 6091da7783792f..2c05e489ea3e69 100644 --- a/toolsrc/include/vcpkg/update.h +++ b/toolsrc/include/vcpkg/update.h @@ -1,10 +1,9 @@ #pragma once +#include #include #include #include -#include -#include #include namespace vcpkg::Update @@ -21,4 +20,9 @@ namespace vcpkg::Update const StatusParagraphs& status_db); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + struct UpdateCommand : Commands::PathsCommand + { + virtual void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override; + }; } diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index ddc407a35a4aff..84cd7c59925f07 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -130,6 +130,7 @@ namespace vcpkg constexpr static StringLiteral TRIPLET_ENV = "VCPKG_DEFAULT_TRIPLET"; constexpr static StringLiteral TRIPLET_ARG = "triplet"; std::unique_ptr triplet; + constexpr static StringLiteral OVERLAY_PORTS_ENV = "VCPKG_OVERLAY_PORTS"; constexpr static StringLiteral OVERLAY_PORTS_ARG = "overlay-ports"; std::vector overlay_ports; constexpr static StringLiteral OVERLAY_TRIPLETS_ARG = "overlay-triplets"; @@ -152,6 +153,9 @@ namespace vcpkg constexpr static StringLiteral WAIT_FOR_LOCK_SWITCH = "x-wait-for-lock"; Optional wait_for_lock = nullopt; + constexpr static StringLiteral JSON_SWITCH = "x-json"; + Optional json = nullopt; + // feature flags constexpr static StringLiteral FEATURE_FLAGS_ENV = "VCPKG_FEATURE_FLAGS"; constexpr static StringLiteral FEATURE_FLAGS_ARG = "feature-flags"; @@ -168,6 +172,7 @@ namespace vcpkg bool binary_caching_enabled() const { return binary_caching.value_or(true); } bool compiler_tracking_enabled() const { return compiler_tracking.value_or(true); } + bool output_json() const { return json.value_or(false); } std::string command; std::vector command_arguments; diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 594407c4b32194..721b59606943f2 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -4,30 +4,11 @@ #include #include #include +#include #include -#include -#include -#include -#include - namespace vcpkg { - namespace Tools - { - static const std::string SEVEN_ZIP = "7zip"; - static const std::string SEVEN_ZIP_ALT = "7z"; - static const std::string MAVEN = "mvn"; - static const std::string CMAKE = "cmake"; - static const std::string GIT = "git"; - static const std::string MONO = "mono"; - static const std::string NINJA = "ninja"; - static const std::string NUGET = "nuget"; - static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; - static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; - static const std::string IFW_REPOGEN = "ifw_repogen"; - } - struct ToolsetArchOption { CStringView name; @@ -61,6 +42,11 @@ namespace vcpkg struct VcpkgPathsImpl; } + struct BinaryParagraph; + struct VcpkgCmdArguments; + struct PackageSpec; + struct Triplet; + struct VcpkgPaths : Util::MoveOnlyBase { struct TripletFile diff --git a/toolsrc/src/pch.cpp b/toolsrc/src/pch.cpp index 17305716aacd2a..ebc3d89049e924 100644 --- a/toolsrc/src/pch.cpp +++ b/toolsrc/src/pch.cpp @@ -1 +1,2 @@ -#include "pch.h" \ No newline at end of file +// This file intentionally left blank. It exists to be a target for pch compilation, +// but `#include "pch.h"` is already injected by the compiler. \ No newline at end of file diff --git a/toolsrc/src/vcpkg-test/binarycaching.cpp b/toolsrc/src/vcpkg-test/binarycaching.cpp index a8204f9c2add0e..55532d14df3409 100644 --- a/toolsrc/src/vcpkg-test/binarycaching.cpp +++ b/toolsrc/src/vcpkg-test/binarycaching.cpp @@ -11,6 +11,8 @@ #include +#include + using namespace vcpkg; TEST_CASE ("reformat_version semver-ish", "[reformat_version]") @@ -65,7 +67,7 @@ Build-Depends: bzip REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; - Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Triplet::X64_WINDOWS}, + Dependencies::InstallPlanAction ipa(PackageSpec{"zlib2", Test::X64_WINDOWS}, scfl, Dependencies::RequestType::USER_REQUESTED, {{"a", {}}, {"b", {}}}); @@ -177,7 +179,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf.has_value()); SourceControlFileLocation scfl{std::move(*maybe_scf.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[0].spec = PackageSpec("zlib", Triplet::X64_ANDROID); + plan.install_actions[0].spec = PackageSpec("zlib", Test::X64_ANDROID); plan.install_actions[0].source_control_file_location = scfl; plan.install_actions[0].abi_info = Build::AbiInfo{}; plan.install_actions[0].abi_info.get()->package_abi = "packageabi"; @@ -200,7 +202,7 @@ Description: a spiffy compression library wrapper REQUIRE(maybe_scf2.has_value()); SourceControlFileLocation scfl2{std::move(*maybe_scf2.get()), fs::path()}; plan.install_actions.push_back(Dependencies::InstallPlanAction()); - plan.install_actions[1].spec = PackageSpec("zlib2", Triplet::X64_ANDROID); + plan.install_actions[1].spec = PackageSpec("zlib2", Test::X64_ANDROID); plan.install_actions[1].source_control_file_location = scfl2; plan.install_actions[1].abi_info = Build::AbiInfo{}; plan.install_actions[1].abi_info.get()->package_abi = "packageabi2"; diff --git a/toolsrc/src/vcpkg-test/commands.cpp b/toolsrc/src/vcpkg-test/commands.cpp new file mode 100644 index 00000000000000..2c37798770c3c2 --- /dev/null +++ b/toolsrc/src/vcpkg-test/commands.cpp @@ -0,0 +1,69 @@ +#include + +#include +#include +#include + +using namespace vcpkg; + +TEST_CASE ("test commands are constructible", "[commands]") +{ + Commands::Contact::ContactCommand contact{}; + Commands::Version::VersionCommand version{}; +} + +TEST_CASE ("get_available_basic_commands works", "[commands]") +{ + auto commands_list = Commands::get_available_basic_commands(); + CHECK(commands_list.size() == 2); + CHECK(Commands::find("version", commands_list) != nullptr); + CHECK(Commands::find("contact", commands_list) != nullptr); + CHECK(Commands::find("aang", commands_list) == nullptr); +} + +TEST_CASE ("get_available_paths_commands works", "[commands]") +{ + auto commands_list = Commands::get_available_paths_commands(); + CHECK(commands_list.size() == 19); + + CHECK(Commands::find("/?", commands_list) != nullptr); + CHECK(Commands::find("help", commands_list) != nullptr); + CHECK(Commands::find("search", commands_list) != nullptr); + CHECK(Commands::find("list", commands_list) != nullptr); + CHECK(Commands::find("integrate", commands_list) != nullptr); + CHECK(Commands::find("owns", commands_list) != nullptr); + CHECK(Commands::find("update", commands_list) != nullptr); + CHECK(Commands::find("edit", commands_list) != nullptr); + CHECK(Commands::find("create", commands_list) != nullptr); + CHECK(Commands::find("cache", commands_list) != nullptr); + CHECK(Commands::find("portsdiff", commands_list) != nullptr); + CHECK(Commands::find("autocomplete", commands_list) != nullptr); + CHECK(Commands::find("hash", commands_list) != nullptr); + CHECK(Commands::find("fetch", commands_list) != nullptr); + CHECK(Commands::find("x-ci-clean", commands_list) != nullptr); + CHECK(Commands::find("x-history", commands_list) != nullptr); + CHECK(Commands::find("x-package-info", commands_list) != nullptr); + CHECK(Commands::find("x-vsinstances", commands_list) != nullptr); + CHECK(Commands::find("x-format-manifest", commands_list) != nullptr); + + CHECK(Commands::find("korra", commands_list) == nullptr); +} + +TEST_CASE ("get_available_commands_type_a works", "[commands]") +{ + auto commands_list = Commands::get_available_triplet_commands(); + CHECK(commands_list.size() == 10); + + CHECK(Commands::find("install", commands_list) != nullptr); + CHECK(Commands::find("x-set-installed", commands_list) != nullptr); + CHECK(Commands::find("ci", commands_list) != nullptr); + CHECK(Commands::find("remove", commands_list) != nullptr); + CHECK(Commands::find("upgrade", commands_list) != nullptr); + CHECK(Commands::find("build", commands_list) != nullptr); + CHECK(Commands::find("env", commands_list) != nullptr); + CHECK(Commands::find("build-external", commands_list) != nullptr); + CHECK(Commands::find("export", commands_list) != nullptr); + CHECK(Commands::find("depend-info", commands_list) != nullptr); + + CHECK(Commands::find("mai", commands_list) == nullptr); +} diff --git a/toolsrc/src/vcpkg-test/commands.create.cpp b/toolsrc/src/vcpkg-test/commands.create.cpp index 4d8b2fd5098f0a..0cc93bd57652fb 100644 --- a/toolsrc/src/vcpkg-test/commands.create.cpp +++ b/toolsrc/src/vcpkg-test/commands.create.cpp @@ -2,7 +2,7 @@ #include -#include +#include #include #include diff --git a/toolsrc/src/vcpkg-test/dependencies.cpp b/toolsrc/src/vcpkg-test/dependencies.cpp index 6bd9dfc42b4c4f..ef39bd1efb63fb 100644 --- a/toolsrc/src/vcpkg-test/dependencies.cpp +++ b/toolsrc/src/vcpkg-test/dependencies.cpp @@ -33,12 +33,12 @@ TEST_CASE ("filter depends", "[dependencies]") auto deps_ = parse_dependencies_list("liba (!uwp), libb, libc (uwp)"); REQUIRE(deps_); auto& deps = *deps_.get(); - auto v = filter_dependencies(deps, Triplet::X64_WINDOWS, x64_win_cmake_vars); + auto v = filter_dependencies(deps, Test::X64_WINDOWS, x64_win_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v.at(0).package_spec.name() == "liba"); REQUIRE(v.at(1).package_spec.name() == "libb"); - auto v2 = filter_dependencies(deps, Triplet::ARM_UWP, arm_uwp_cmake_vars); + auto v2 = filter_dependencies(deps, Test::ARM_UWP, arm_uwp_cmake_vars); REQUIRE(v.size() == 2); REQUIRE(v2.at(0).package_spec.name() == "libb"); REQUIRE(v2.at(1).package_spec.name() == "libc"); @@ -85,3 +85,67 @@ TEST_CASE ("qualified dependency", "[dependencies]") REQUIRE(plan2.install_actions.size() == 2); REQUIRE(plan2.install_actions.at(0).feature_list == std::vector{"b1", "core"}); } + +TEST_CASE ("resolve_deps_as_top_level", "[dependencies]") +{ + using namespace Test; + PackageSpecMap spec_map; + FullPackageSpec spec_a{spec_map.emplace("a", "b, b[b1] (linux)"), {}}; + FullPackageSpec spec_b{spec_map.emplace("b", "", {{"b1", ""}}), {}}; + FullPackageSpec spec_c{spec_map.emplace("c", "b", {{"c1", "b[b1]"}, {"c2", "c[c1], a"}}, {"c1"}), {"core"}}; + FullPackageSpec spec_d{spec_map.emplace("d", "c[core]"), {}}; + + PortFileProvider::MapPortFileProvider map_port{spec_map.map}; + MockCMakeVarProvider var_provider; + Triplet t_linux = Triplet::from_canonical_name("x64-linux"); + var_provider.dep_info_vars[{"a", t_linux}].emplace("VCPKG_CMAKE_SYSTEM_NAME", "Linux"); + { + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("a").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b); + } + { + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("a").source_control_file, t_linux, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == FullPackageSpec({"b", t_linux}, {"b1"})); + } + { + // without defaults + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b); + } + FullPackageSpec spec_b_with_b1{spec_b.package_spec, {"b1"}}; + { + // with defaults of c (c1) + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"default"}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b_with_b1); + } + { + // with c1 + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c1"}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_b_with_b1); + } + { + // with c2 implying c1 + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("c").source_control_file, Test::X86_WINDOWS, {"c2"}, var_provider); + REQUIRE(deps.size() == 2); + REQUIRE(deps.at(0) == spec_a); + REQUIRE(deps.at(1) == spec_b_with_b1); + } + { + // d -> c[core] + auto deps = vcpkg::Dependencies::resolve_deps_as_top_level( + *spec_map.map.at("d").source_control_file, Test::X86_WINDOWS, {}, var_provider); + REQUIRE(deps.size() == 1); + REQUIRE(deps.at(0) == spec_c); + } +} diff --git a/toolsrc/src/vcpkg-test/json.cpp b/toolsrc/src/vcpkg-test/json.cpp index 90a3537aba4636..0b9941861e4221 100644 --- a/toolsrc/src/vcpkg-test/json.cpp +++ b/toolsrc/src/vcpkg-test/json.cpp @@ -80,6 +80,49 @@ TEST_CASE ("JSON parse strings", "[json]") REQUIRE(res.get()->first.string() == grin); } +TEST_CASE ("JSON parse strings with escapes", "[json]") +{ + auto res = Json::parse(R"("\t")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\t"); + + res = Json::parse(R"("\\")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\\"); + + res = Json::parse(R"("\/")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "/"); + + res = Json::parse(R"("\b")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\b"); + + res = Json::parse(R"("\f")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\f"); + + res = Json::parse(R"("\n")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\n"); + + res = Json::parse(R"("\r")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == "\r"); + + res = Json::parse(R"("This is a \"test\", hopefully it worked")"); + REQUIRE(res); + REQUIRE(res.get()->first.is_string()); + REQUIRE(res.get()->first.string() == R"(This is a "test", hopefully it worked)"); +} + TEST_CASE ("JSON parse integers", "[json]") { auto res = Json::parse("0"); diff --git a/toolsrc/src/vcpkg-test/manifests.cpp b/toolsrc/src/vcpkg-test/manifests.cpp index 108b2d0c5aad65..95a0b149b16663 100644 --- a/toolsrc/src/vcpkg-test/manifests.cpp +++ b/toolsrc/src/vcpkg-test/manifests.cpp @@ -5,9 +5,14 @@ #include #include +#include #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + using namespace vcpkg; using namespace vcpkg::Paragraphs; using namespace vcpkg::Test; @@ -68,10 +73,10 @@ TEST_CASE ("manifest construct maximum", "[manifests]") "name": "iroh", "description": "zuko's uncle", "dependencies": [ + "firebending", { "name": "tea" }, - "firebending", { "name": "order.white-lotus", "features": [ "the-ancient-ways" ], @@ -105,18 +110,20 @@ TEST_CASE ("manifest construct maximum", "[manifests]") REQUIRE(pgh.feature_paragraphs[0]->description.size() == 1); REQUIRE(pgh.feature_paragraphs[0]->description[0] == "zuko's uncle"); REQUIRE(pgh.feature_paragraphs[0]->dependencies.size() == 3); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "tea"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "firebending"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "order.white-lotus"); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features.size() == 1); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].features[0] == "the-ancient-ways"); - REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[0].name == "firebending"); + + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].name == "order.white-lotus"); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features.size() == 1); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].features[0] == "the-ancient-ways"); + REQUIRE_FALSE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "arm"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", ""}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); - REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].platform.evaluate( + REQUIRE(pgh.feature_paragraphs[0]->dependencies[1].platform.evaluate( {{"VCPKG_CMAKE_SYSTEM_NAME", "Linux"}, {"VCPKG_TARGET_ARCHITECTURE", "x86"}})); + REQUIRE(pgh.feature_paragraphs[0]->dependencies[2].name == "tea"); + REQUIRE(pgh.feature_paragraphs[1]->name == "zuko"); REQUIRE(pgh.feature_paragraphs[1]->description.size() == 2); REQUIRE(pgh.feature_paragraphs[1]->description[0] == "son of the fire lord"); @@ -134,8 +141,8 @@ TEST_CASE ("SourceParagraph manifest two dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); } TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") @@ -149,9 +156,10 @@ TEST_CASE ("SourceParagraph manifest three dependencies", "[manifests]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); } TEST_CASE ("SourceParagraph manifest construct qualified dependencies", "[manifests]") @@ -239,3 +247,50 @@ TEST_CASE ("SourceParagraph manifest empty supports", "[manifests]") true); REQUIRE_FALSE(m_pgh.has_value()); } + +TEST_CASE ("Serialize all the ports", "[manifests]") +{ + std::vector args_list = {"x-format-manifest"}; + auto& fs = Files::get_real_filesystem(); + auto args = VcpkgCmdArguments::create_from_arg_sequence(args_list.data(), args_list.data() + args_list.size()); + VcpkgPaths paths{fs, args}; + + std::vector scfs; + + for (auto dir : fs::directory_iterator(paths.ports)) + { + const auto control = dir / fs::u8path("CONTROL"); + const auto manifest = dir / fs::u8path("vcpkg.json"); + if (fs.exists(control)) + { + auto contents = fs.read_contents(control, VCPKG_LINE_INFO); + auto pghs = Paragraphs::parse_paragraphs(contents, control.u8string()); + REQUIRE(pghs); + + scfs.push_back(std::move( + *SourceControlFile::parse_control_file(control, std::move(pghs).value_or_exit(VCPKG_LINE_INFO)) + .value_or_exit(VCPKG_LINE_INFO))); + } + else if (fs.exists(manifest)) + { + std::error_code ec; + auto contents = Json::parse_file(fs, manifest, ec); + REQUIRE_FALSE(ec); + REQUIRE(contents); + + auto scf = SourceControlFile::parse_manifest_file(manifest, + contents.value_or_exit(VCPKG_LINE_INFO).first.object()); + REQUIRE(scf); + + scfs.push_back(std::move(*scf.value_or_exit(VCPKG_LINE_INFO))); + } + } + + for (auto& scf : scfs) + { + auto serialized = serialize_manifest(scf); + auto serialized_scf = SourceControlFile::parse_manifest_file({}, serialized).value_or_exit(VCPKG_LINE_INFO); + + REQUIRE(*serialized_scf == scf); + } +} diff --git a/toolsrc/src/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index 2638a3900df61f..05ba8cfba3d803 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -87,8 +87,9 @@ TEST_CASE ("SourceParagraph two dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 2); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "z"); } TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") @@ -102,9 +103,10 @@ TEST_CASE ("SourceParagraph three dependencies", "[paragraph]") auto& pgh = **m_pgh.get(); REQUIRE(pgh.core_paragraph->dependencies.size() == 3); - REQUIRE(pgh.core_paragraph->dependencies[0].name == "z"); - REQUIRE(pgh.core_paragraph->dependencies[1].name == "openssl"); - REQUIRE(pgh.core_paragraph->dependencies[2].name == "xyz"); + // should be ordered + REQUIRE(pgh.core_paragraph->dependencies[0].name == "openssl"); + REQUIRE(pgh.core_paragraph->dependencies[1].name == "xyz"); + REQUIRE(pgh.core_paragraph->dependencies[2].name == "z"); } TEST_CASE ("SourceParagraph construct qualified dependencies", "[paragraph]") diff --git a/toolsrc/src/vcpkg-test/plan.cpp b/toolsrc/src/vcpkg-test/plan.cpp index 09c377ecc1da57..55c6740da40acf 100644 --- a/toolsrc/src/vcpkg-test/plan.cpp +++ b/toolsrc/src/vcpkg-test/plan.cpp @@ -28,7 +28,7 @@ using Test::PackageSpecMap; static void features_check(Dependencies::InstallPlanAction& plan, std::string pkg_name, std::vector expected_features, - Triplet triplet = Triplet::X86_WINDOWS) + Triplet triplet = Test::X86_WINDOWS) { const auto& feature_list = plan.feature_list; @@ -54,7 +54,7 @@ static void features_check(Dependencies::InstallPlanAction& plan, /// static void remove_plan_check(Dependencies::RemovePlanAction& plan, std::string pkg_name, - Triplet triplet = Triplet::X86_WINDOWS) + Triplet triplet = Test::X86_WINDOWS) { REQUIRE(plan.spec.triplet().to_string() == triplet.to_string()); REQUIRE(pkg_name == plan.spec.name()); @@ -381,14 +381,14 @@ TEST_CASE ("basic feature test 8", "[plan]") std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; - spec_map.triplet = Triplet::X86_WINDOWS; + spec_map.triplet = Test::X86_WINDOWS; auto spec_a_86 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; auto spec_b_86 = FullPackageSpec{spec_map.emplace("b")}; auto spec_c_86 = FullPackageSpec{spec_map.emplace("c", "a[a1]"), {"core"}}; @@ -401,14 +401,14 @@ TEST_CASE ("basic feature test 8", "[plan]") {spec_c_64, spec_a_86, spec_a_64, spec_c_86}, StatusParagraphs(std::move(status_paragraphs))); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); remove_plan_check(plan.remove_actions.at(1), "a"); auto& install_plan = plan.install_actions; - features_check(install_plan.at(0), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.at(1), "a", {"a1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.at(0), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.at(1), "a", {"a1", "core"}, Test::X64_WINDOWS); features_check(install_plan.at(2), "b", {"core"}); features_check(install_plan.at(3), "a", {"a1", "core"}); - features_check(install_plan.at(4), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.at(4), "c", {"core"}, Test::X64_WINDOWS); features_check(install_plan.at(5), "c", {"core"}); } @@ -416,10 +416,10 @@ TEST_CASE ("install all features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -432,7 +432,7 @@ TEST_CASE ("install all features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"0", "1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 1", "[plan]") @@ -440,11 +440,11 @@ TEST_CASE ("install default features test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" with default features "1" and features "0" and "1". - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", ""}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -456,23 +456,23 @@ TEST_CASE ("install default features test 1", "[plan]") // Expect the default feature "1" to be installed, but not "0" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 2", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("a", Test::X64_WINDOWS); // Add a port "a" of which "core" is already installed, but we will // install the default features "explicitly" // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -485,8 +485,8 @@ TEST_CASE ("install default features test 2", "[plan]") // Expect "a" to get removed for rebuild and then installed with default // features. REQUIRE(install_plan.size() == 2); - remove_plan_check(install_plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Triplet::X64_WINDOWS); + remove_plan_check(install_plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"a1", "core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features test 3", "[plan]") @@ -494,11 +494,11 @@ TEST_CASE ("install default features test 3", "[plan]") std::vector> status_paragraphs; // "a" has two features, of which "a1" is default. - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"a0", ""}, {"a1", ""}}, {"a1"}); // Explicitly install "a" without default features - auto install_specs = FullPackageSpec::from_string("a[core]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -510,7 +510,7 @@ TEST_CASE ("install default features test 3", "[plan]") // Expect the default feature not to get installed. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 1", "[plan]") @@ -518,13 +518,13 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -536,8 +536,8 @@ TEST_CASE ("install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("do not install default features of dependency test 1", "[plan]") @@ -545,14 +545,14 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -565,8 +565,8 @@ TEST_CASE ("do not install default features of dependency test 1", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency, // as no explicit features of "b" are installed by the user. REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 2", "[plan]") @@ -574,14 +574,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") std::vector> status_paragraphs; // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto spec_a = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); - auto spec_b = FullPackageSpec::from_string("b[core]", Triplet::X64_WINDOWS); + auto spec_a = FullPackageSpec::from_string("a", Test::X64_WINDOWS); + auto spec_b = FullPackageSpec::from_string("b[core]", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -593,14 +593,14 @@ TEST_CASE ("install default features of dependency test 2", "[plan]") // Expect "a" to get installed and defaults of "b" through the dependency REQUIRE(install_plan.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"b1", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("do not install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the core of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); @@ -608,10 +608,10 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -622,13 +622,13 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") // Expect "a" to get installed, but not require rebuilding "b" REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of existing dependency", "[plan]") { // Add a port "a" which depends on the default features of "b" - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b"); // "b" has a default feature spec_map.emplace("b", "", {{"b1", ""}}, {"b1"}); @@ -636,10 +636,10 @@ TEST_CASE ("install default features of existing dependency", "[plan]") std::vector> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b", "", "b1")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -650,24 +650,24 @@ TEST_CASE ("install default features of existing dependency", "[plan]") // Expect "b" to be rebuilt REQUIRE(install_plan.install_actions.size() == 2); - features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); } TEST_CASE ("install default features of dependency test 3", "[plan]") { std::vector> status_paragraphs; status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); + status_paragraphs.back()->package.spec = PackageSpec("b", Test::X64_WINDOWS); // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "b[core]"); // "b" has two features, of which "b1" is default. spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -679,7 +679,7 @@ TEST_CASE ("install default features of dependency test 3", "[plan]") // Expect "a" to get installed, not the defaults of "b", as the required // dependencies are already there, installed explicitly by the user. REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("install plan action dependencies", "[plan]") @@ -688,13 +688,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -704,13 +704,13 @@ TEST_CASE ("install plan action dependencies", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); // TODO: Figure out what to do with these tests - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b}); } @@ -720,13 +720,13 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_c = spec_map.emplace("c"); auto spec_b = spec_map.emplace("b", "c"); spec_map.emplace("a", "c, b"); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -736,12 +736,12 @@ TEST_CASE ("install plan action dependencies 2", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(1).install_action.get()->computed_dependencies == std::vector{spec_c}); - features_check(install_plan.install_actions.at(2), "a", {"core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(2).install_action.get()->computed_dependencies == std::vector{spec_b, // spec_c}); } @@ -752,11 +752,11 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") // Add a port "a" which depends on the core of "b", which was already // installed explicitly - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); spec_map.emplace("a", "", {{"0", ""}, {"1", "a[0]"}}, {"1"}); // Install "a" (without explicit feature specification) - auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a", Test::X64_WINDOWS); PortFileProvider::MapPortFileProvider map_port{spec_map.map}; MockCMakeVarProvider var_provider; @@ -766,7 +766,7 @@ TEST_CASE ("install plan action dependencies 3", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 1); - features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "a", {"1", "0", "core"}, Test::X64_WINDOWS); // REQUIRE(install_plan.at(0).install_action.get()->computed_dependencies == std::vector{}); } @@ -827,7 +827,7 @@ TEST_CASE ("upgrade with default features 2", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); auto spec_b = spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0", "b1"}); @@ -837,10 +837,10 @@ TEST_CASE ("upgrade with default features 2", "[plan]") // The upgrade should install the new default feature b1 but not b0 REQUIRE(plan.size() == 4); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - remove_plan_check(plan.remove_actions.at(1), "b", Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(1), "b", Test::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"core", "b1"}, Test::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("upgrade with default features 3", "[plan]") @@ -852,7 +852,7 @@ TEST_CASE ("upgrade with default features 3", "[plan]") StatusParagraphs status_db(std::move(pghs)); - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a = spec_map.emplace("a", "b[core]"); spec_map.emplace("b", "", {{"b0", ""}, {"b1", ""}}, {"b0"}); @@ -862,9 +862,9 @@ TEST_CASE ("upgrade with default features 3", "[plan]") // The upgrade should install the default feature REQUIRE(plan.size() == 3); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Triplet::X64_WINDOWS); - features_check(plan.install_actions.at(1), "a", {"core"}, Triplet::X64_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X64_WINDOWS); + features_check(plan.install_actions.at(0), "b", {"b0", "core"}, Test::X64_WINDOWS); + features_check(plan.install_actions.at(1), "a", {"core"}, Test::X64_WINDOWS); } TEST_CASE ("upgrade with new default feature", "[plan]") @@ -883,20 +883,20 @@ TEST_CASE ("upgrade with new default feature", "[plan]") // The upgrade should install the new default feature but not the old default feature 0 REQUIRE(plan.size() == 2); - remove_plan_check(plan.remove_actions.at(0), "a", Triplet::X86_WINDOWS); - features_check(plan.install_actions.at(0), "a", {"core", "1"}, Triplet::X86_WINDOWS); + remove_plan_check(plan.remove_actions.at(0), "a", Test::X86_WINDOWS); + features_check(plan.install_actions.at(0), "a", {"core", "1"}, Test::X86_WINDOWS); } TEST_CASE ("transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; @@ -908,21 +908,21 @@ TEST_CASE ("transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("no transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"0", ""}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "c", {{"0", ""}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -933,21 +933,21 @@ TEST_CASE ("no transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("only transitive features test", "[plan]") { std::vector> status_paragraphs; - PackageSpecMap spec_map(Triplet::X64_WINDOWS); + PackageSpecMap spec_map(Test::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "", {{"0", "b[0]"}}), {"core"}}; auto spec_b_64 = FullPackageSpec{spec_map.emplace("b", "", {{"0", "c[0]"}}), {"core"}}; auto spec_c_64 = FullPackageSpec{spec_map.emplace("c", "", {{"0", ""}}), {"core"}}; - auto install_specs = FullPackageSpec::from_string("a[*]", Triplet::X64_WINDOWS); + auto install_specs = FullPackageSpec::from_string("a[*]", Test::X64_WINDOWS); REQUIRE(install_specs.has_value()); if (!install_specs.has_value()) return; PortFileProvider::MapPortFileProvider provider(spec_map.map); @@ -958,9 +958,9 @@ TEST_CASE ("only transitive features test", "[plan]") StatusParagraphs(std::move(status_paragraphs))); REQUIRE(install_plan.size() == 3); - features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Triplet::X64_WINDOWS); - features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Triplet::X64_WINDOWS); + features_check(install_plan.install_actions.at(0), "c", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(1), "b", {"0", "core"}, Test::X64_WINDOWS); + features_check(install_plan.install_actions.at(2), "a", {"0", "core"}, Test::X64_WINDOWS); } TEST_CASE ("basic remove scheme", "[plan]") @@ -969,7 +969,7 @@ TEST_CASE ("basic remove scheme", "[plan]") pghs.push_back(make_status_pgh("a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 1); REQUIRE(remove_plan.at(0).spec.name() == "a"); @@ -982,7 +982,7 @@ TEST_CASE ("recurse remove scheme", "[plan]") pghs.push_back(make_status_pgh("b", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -997,7 +997,7 @@ TEST_CASE ("features depend remove scheme", "[plan]") pghs.push_back(make_status_feature_pgh("b", "0", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -1013,7 +1013,7 @@ TEST_CASE ("features depend remove scheme once removed", "[plan]") pghs.push_back(make_status_feature_pgh("opencv", "vtk", "vtk")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({{"expat", Triplet::X86_WINDOWS}}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"expat", Test::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 3); REQUIRE(remove_plan.at(0).spec.name() == "opencv"); diff --git a/toolsrc/src/vcpkg-test/specifier.cpp b/toolsrc/src/vcpkg-test/specifier.cpp index f350ff60132b41..f750f4144f28f3 100644 --- a/toolsrc/src/vcpkg-test/specifier.cpp +++ b/toolsrc/src/vcpkg-test/specifier.cpp @@ -5,6 +5,8 @@ #include +#include + using namespace vcpkg; TEST_CASE ("specifier conversion", "[specifier]") @@ -13,8 +15,8 @@ TEST_CASE ("specifier conversion", "[specifier]") { constexpr std::size_t SPEC_SIZE = 6; - PackageSpec a_spec("a", Triplet::X64_WINDOWS); - PackageSpec b_spec("b", Triplet::X64_WINDOWS); + PackageSpec a_spec("a", Test::X64_WINDOWS); + PackageSpec b_spec("b", Test::X64_WINDOWS); auto fspecs = FullPackageSpec{a_spec, {"0", "1"}}.to_feature_specs({}, {}); auto fspecs2 = FullPackageSpec{b_spec, {"2", "3"}}.to_feature_specs({}, {}); @@ -94,19 +96,18 @@ TEST_CASE ("specifier parsing", "[specifier]") SECTION ("expand wildcards") { - auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); - auto openssl = - vcpkg::FullPackageSpec::from_string("openssl[*]", Triplet::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto zlib = vcpkg::FullPackageSpec::from_string("zlib[0,1]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); + auto openssl = vcpkg::FullPackageSpec::from_string("openssl[*]", Test::X86_UWP).value_or_exit(VCPKG_LINE_INFO); auto specs = zlib.to_feature_specs({}, {}); auto specs2 = openssl.to_feature_specs({}, {}); Util::Vectors::append(&specs, specs2); Util::sort(specs); std::vector spectargets{ - {{"openssl", Triplet::X86_UWP}, "core"}, - {{"zlib", Triplet::X86_UWP}, "core"}, - {{"zlib", Triplet::X86_UWP}, "0"}, - {{"zlib", Triplet::X86_UWP}, "1"}, + {{"openssl", Test::X86_UWP}, "core"}, + {{"zlib", Test::X86_UWP}, "core"}, + {{"zlib", Test::X86_UWP}, "0"}, + {{"zlib", Test::X86_UWP}, "1"}, }; Util::sort(spectargets); REQUIRE(specs.size() == spectargets.size()); diff --git a/toolsrc/src/vcpkg-test/statusparagraphs.cpp b/toolsrc/src/vcpkg-test/statusparagraphs.cpp index 382eab1a72fcdd..f647484e603062 100644 --- a/toolsrc/src/vcpkg-test/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg-test/statusparagraphs.cpp @@ -28,7 +28,7 @@ Status: install ok installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it != status_db.end()); } @@ -49,7 +49,7 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it == status_db.end()); } @@ -78,11 +78,11 @@ Status: purge ok not-installed StatusParagraphs status_db( Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); - auto it = status_db.find_installed({"ffmpeg", Triplet::X64_WINDOWS}); + auto it = status_db.find_installed({"ffmpeg", Test::X64_WINDOWS}); REQUIRE(it != status_db.end()); // Feature "openssl" is not installed and should not be found - auto it1 = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); + auto it1 = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); REQUIRE(it1 == status_db.end()); } @@ -111,6 +111,6 @@ Status: install ok installed Util::fmap(*pghs.get(), [](Paragraph& rpgh) { return std::make_unique(std::move(rpgh)); })); // Feature "openssl" is installed and should therefore be found - auto it = status_db.find_installed({{"ffmpeg", Triplet::X64_WINDOWS}, "openssl"}); + auto it = status_db.find_installed({{"ffmpeg", Test::X64_WINDOWS}, "openssl"}); REQUIRE(it != status_db.end()); } diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp index 95a6de2af9d086..cc45365e691a73 100644 --- a/toolsrc/src/vcpkg-test/strings.cpp +++ b/toolsrc/src/vcpkg-test/strings.cpp @@ -8,6 +8,10 @@ #include #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + TEST_CASE ("b32 encoding", "[strings]") { using u64 = uint64_t; diff --git a/toolsrc/src/vcpkg-test/system.cpp b/toolsrc/src/vcpkg-test/system.cpp index 01540635816275..dec7b576917d9c 100644 --- a/toolsrc/src/vcpkg-test/system.cpp +++ b/toolsrc/src/vcpkg-test/system.cpp @@ -11,6 +11,10 @@ #include +#if defined(_MSC_VER) +#pragma warning(disable : 6237) +#endif + using vcpkg::nullopt; using vcpkg::Optional; using vcpkg::StringView; diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index 74ade3aeb89220..2841aefa035571 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -39,6 +39,12 @@ namespace vcpkg::Test { + const Triplet X86_WINDOWS = Triplet::from_canonical_name("x86-windows"); + const Triplet X64_WINDOWS = Triplet::from_canonical_name("x64-windows"); + const Triplet X86_UWP = Triplet::from_canonical_name("x86-uwp"); + const Triplet ARM_UWP = Triplet::from_canonical_name("arm-uwp"); + const Triplet X64_ANDROID = Triplet::from_canonical_name("x64-android"); + std::unique_ptr make_control_file( const char* name, const char* depends, diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 40ccb1668470ee..d0df8749fde733 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -8,7 +8,9 @@ #include #include +#include #include +#include #include #include #include @@ -66,16 +68,18 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } }; - if (const auto command_function = find_command(Commands::get_available_commands_type_c())) + if (const auto command_function = find_command(Commands::get_available_basic_commands())) { - return command_function->function(args, fs); + return command_function->function->perform_and_exit(args, fs); } const VcpkgPaths paths(fs, args); paths.track_feature_flag_metrics(); fs.current_path(paths.root, VCPKG_LINE_INFO); - if (args.command == "install" || args.command == "remove" || args.command == "export" || args.command == "update") + if ((args.command == "install" || args.command == "remove" || args.command == "export" || + args.command == "update") && + !args.output_json()) { Commands::Version::warn_if_vcpkg_version_mismatch(paths); std::string surveydate = *GlobalState::g_surveydate.lock(); @@ -102,17 +106,17 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args) } } - if (const auto command_function = find_command(Commands::get_available_commands_type_b())) + if (const auto command_function = find_command(Commands::get_available_paths_commands())) { - return command_function->function(args, paths); + return command_function->function->perform_and_exit(args, paths); } Triplet default_triplet = vcpkg::default_triplet(args); Input::check_triplet(default_triplet, paths); - if (const auto command_function = find_command(Commands::get_available_commands_type_a())) + if (const auto command_function = find_command(Commands::get_available_triplet_commands())) { - return command_function->function(args, paths, default_triplet); + return command_function->function->perform_and_exit(args, paths, default_triplet); } return invalid_command(args.command); diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index ca82b3100f29ac..c90706928eeea6 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include #include #include +#include namespace vcpkg::Archives { diff --git a/toolsrc/src/vcpkg/base/checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp index 42e0835c6bcdeb..c0075e33f546a9 100644 --- a/toolsrc/src/vcpkg/base/checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/chrono.cpp b/toolsrc/src/vcpkg/base/chrono.cpp index 86dc590f8ffad2..971d5f37e04a2d 100644 --- a/toolsrc/src/vcpkg/base/chrono.cpp +++ b/toolsrc/src/vcpkg/base/chrono.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/cofffilereader.cpp b/toolsrc/src/vcpkg/base/cofffilereader.cpp index cb75e084750911..30e0f8588a87fa 100644 --- a/toolsrc/src/vcpkg/base/cofffilereader.cpp +++ b/toolsrc/src/vcpkg/base/cofffilereader.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 051e8306fa0a8a..59669749990115 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/enums.cpp b/toolsrc/src/vcpkg/base/enums.cpp index aa124f3aa9b427..8b99ddf7bacb3f 100644 --- a/toolsrc/src/vcpkg/base/enums.cpp +++ b/toolsrc/src/vcpkg/base/enums.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp index 902b482d2acb32..e4c821eaeaa294 100644 --- a/toolsrc/src/vcpkg/base/files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -141,7 +139,12 @@ namespace vcpkg::Files const auto target = read_symlink_implementation(oldpath, ec); if (ec) return; - const DWORD flags = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; + const DWORD flags = +#if defined(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE) + SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; +#else + 0; +#endif if (!CreateSymbolicLinkW(newpath.c_str(), target.c_str(), flags)) { const auto err = GetLastError(); @@ -1036,7 +1039,7 @@ namespace vcpkg::Files return res; } - System::printf("Waiting to take filesystem lock on %s...\n", path.u8string()); + Debug::print("Waiting to take filesystem lock on ", path.u8string(), "...\n"); auto wait = std::chrono::milliseconds(100); // waits, at most, a second and a half. while (wait < std::chrono::milliseconds(1000)) diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 58e17e1ad47803..0070a5f72647c3 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/json.cpp b/toolsrc/src/vcpkg/base/json.cpp index 75b917523e57f3..0a9422d6664aeb 100644 --- a/toolsrc/src/vcpkg/base/json.cpp +++ b/toolsrc/src/vcpkg/base/json.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -37,8 +35,11 @@ namespace vcpkg::Json ValueImpl(ValueKindConstant vk, int64_t i) : tag(vk), integer(i) { } ValueImpl(ValueKindConstant vk, double d) : tag(vk), number(d) { } ValueImpl(ValueKindConstant vk, std::string&& s) : tag(vk), string(std::move(s)) { } + ValueImpl(ValueKindConstant vk, const std::string& s) : tag(vk), string(s) { } ValueImpl(ValueKindConstant vk, Array&& arr) : tag(vk), array(std::move(arr)) { } + ValueImpl(ValueKindConstant vk, const Array& arr) : tag(vk), array(arr) { } ValueImpl(ValueKindConstant vk, Object&& obj) : tag(vk), object(std::move(obj)) { } + ValueImpl(ValueKindConstant vk, const Object& obj) : tag(vk), object(obj) { } ValueImpl& operator=(ValueImpl&& other) noexcept { @@ -140,30 +141,30 @@ namespace vcpkg::Json } StringView Value::string() const noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_string(), "json value is not string"); return underlying_->string; } const Array& Value::array() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); return underlying_->array; } Array& Value::array() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_array(), "json value is not array"); return underlying_->array; } Array&& Value::array() && noexcept { return std::move(this->array()); } const Object& Value::object() const& noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); return underlying_->object; } Object& Value::object() & noexcept { - vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object()); + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, is_object(), "json value is not object"); return underlying_->object; } Object&& Value::object() && noexcept { return std::move(this->object()); } @@ -171,23 +172,65 @@ namespace vcpkg::Json Value::Value() noexcept = default; Value::Value(Value&&) noexcept = default; Value& Value::operator=(Value&&) noexcept = default; - Value::~Value() = default; - Value Value::clone() const noexcept + Value::Value(const Value& other) + { + switch (other.kind()) + { + case ValueKind::Null: return; // default construct underlying_ + case ValueKind::Boolean: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); + break; + case ValueKind::Integer: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); + break; + case ValueKind::Number: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); + break; + case ValueKind::String: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); + break; + case ValueKind::Array: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); + break; + case ValueKind::Object: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); + break; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + Value& Value::operator=(const Value& other) { - switch (kind()) + switch (other.kind()) { - case ValueKind::Null: return Value::null(nullptr); - case ValueKind::Boolean: return Value::boolean(boolean()); - case ValueKind::Integer: return Value::integer(integer()); - case ValueKind::Number: return Value::number(number()); - case ValueKind::String: return Value::string(string()); - case ValueKind::Array: return Value::array(array().clone()); - case ValueKind::Object: return Value::object(object().clone()); - default: Checks::exit_fail(VCPKG_LINE_INFO); + case ValueKind::Null: underlying_.reset(); break; + case ValueKind::Boolean: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->boolean)); + break; + case ValueKind::Integer: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->integer)); + break; + case ValueKind::Number: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->number)); + break; + case ValueKind::String: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->string)); + break; + case ValueKind::Array: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->array)); + break; + case ValueKind::Object: + underlying_.reset(new ValueImpl(ValueKindConstant(), other.underlying_->object)); + break; + default: Checks::unreachable(VCPKG_LINE_INFO); } + + return *this; } + Value::~Value() = default; + Value Value::null(std::nullptr_t) noexcept { return Value(); } Value Value::boolean(bool b) noexcept { @@ -225,25 +268,43 @@ namespace vcpkg::Json val.underlying_ = std::make_unique(ValueKindConstant(), std::move(arr)); return val; } + Value Value::array(const Array& arr) noexcept + { + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), arr); + return val; + } Value Value::object(Object&& obj) noexcept { Value val; val.underlying_ = std::make_unique(ValueKindConstant(), std::move(obj)); return val; } - // } struct Value - // struct Array { - Array Array::clone() const noexcept + Value Value::object(const Object& obj) noexcept + { + Value val; + val.underlying_ = std::make_unique(ValueKindConstant(), obj); + return val; + } + + bool operator==(const Value& lhs, const Value& rhs) { - Array arr; - arr.underlying_.reserve(size()); - for (const auto& el : *this) + if (lhs.kind() != rhs.kind()) return false; + + switch (lhs.kind()) { - arr.underlying_.push_back(el.clone()); + case ValueKind::Null: return true; + case ValueKind::Boolean: return lhs.underlying_->boolean == rhs.underlying_->boolean; + case ValueKind::Integer: return lhs.underlying_->integer == rhs.underlying_->integer; + case ValueKind::Number: return lhs.underlying_->number == rhs.underlying_->number; + case ValueKind::String: return lhs.underlying_->string == rhs.underlying_->string; + case ValueKind::Array: return lhs.underlying_->string == rhs.underlying_->string; + case ValueKind::Object: return lhs.underlying_->string == rhs.underlying_->string; + default: Checks::unreachable(VCPKG_LINE_INFO); } - return arr; } - + // } struct Value + // struct Array { Value& Array::push_back(Value&& value) { underlying_.push_back(std::move(value)); @@ -265,6 +326,7 @@ namespace vcpkg::Json { return insert_before(it, Value::array(std::move(arr))).array(); } + bool operator==(const Array& lhs, const Array& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Array // struct Object { Value& Object::insert(std::string key, Value&& value) @@ -273,14 +335,29 @@ namespace vcpkg::Json underlying_.push_back({std::move(key), std::move(value)}); return underlying_.back().second; } + Value& Object::insert(std::string key, const Value& value) + { + vcpkg::Checks::check_exit(VCPKG_LINE_INFO, !contains(key)); + underlying_.push_back({std::move(key), value}); + return underlying_.back().second; + } Array& Object::insert(std::string key, Array&& value) { return insert(std::move(key), Value::array(std::move(value))).array(); } + Array& Object::insert(std::string key, const Array& value) + { + return insert(std::move(key), Value::array(value)).array(); + } Object& Object::insert(std::string key, Object&& value) { return insert(std::move(key), Value::object(std::move(value))).object(); } + Object& Object::insert(std::string key, const Object& value) + { + return insert(std::move(key), Value::object(value)).object(); + } + Value& Object::insert_or_replace(std::string key, Value&& value) { auto v = get(key); @@ -295,14 +372,36 @@ namespace vcpkg::Json return underlying_.back().second; } } + Value& Object::insert_or_replace(std::string key, const Value& value) + { + auto v = get(key); + if (v) + { + *v = value; + return *v; + } + else + { + underlying_.push_back({std::move(key), std::move(value)}); + return underlying_.back().second; + } + } Array& Object::insert_or_replace(std::string key, Array&& value) { return insert_or_replace(std::move(key), Value::array(std::move(value))).array(); } + Array& Object::insert_or_replace(std::string key, const Array& value) + { + return insert_or_replace(std::move(key), Value::array(value)).array(); + } Object& Object::insert_or_replace(std::string key, Object&& value) { return insert_or_replace(std::move(key), Value::object(std::move(value))).object(); } + Object& Object::insert_or_replace(std::string key, const Object& value) + { + return insert_or_replace(std::move(key), Value::object(value)).object(); + } auto Object::internal_find_key(StringView key) const noexcept -> underlying_t::const_iterator { @@ -350,16 +449,14 @@ namespace vcpkg::Json } } - Object Object::clone() const noexcept + void Object::sort_keys() { - Object obj; - obj.underlying_.reserve(size()); - for (const auto& el : *this) - { - obj.insert(el.first.to_string(), el.second.clone()); - } - return obj; + std::sort(underlying_.begin(), underlying_.end(), [](const value_type& lhs, const value_type& rhs) { + return lhs.first < rhs.first; + }); } + + bool operator==(const Object& lhs, const Object& rhs) { return lhs.underlying_ == rhs.underlying_; } // } struct Object // auto parse() { @@ -411,7 +508,7 @@ namespace vcpkg::Json } else { - vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + vcpkg::Checks::unreachable(VCPKG_LINE_INFO); } } @@ -448,14 +545,14 @@ namespace vcpkg::Json switch (current) { - case '"': return '"'; - case '\\': return '\\'; - case '/': return '/'; - case 'b': return '\b'; - case 'f': return '\f'; - case 'n': return '\n'; - case 'r': return '\r'; - case 't': return '\t'; + case '"': next(); return '"'; + case '\\': next(); return '\\'; + case '/': next(); return '/'; + case 'b': next(); return '\b'; + case 'f': next(); return '\f'; + case 'n': next(); return '\n'; + case 'r': next(); return '\r'; + case 't': next(); return '\t'; case 'u': { char16_t code_unit = 0; @@ -657,7 +754,7 @@ namespace vcpkg::Json rest = U"ull"; val = Value::null(nullptr); break; - default: vcpkg::Checks::exit_fail(VCPKG_LINE_INFO); + default: vcpkg::Checks::unreachable(VCPKG_LINE_INFO); } for (const char32_t* rest_it = rest; *rest_it != '\0'; ++rest_it) diff --git a/toolsrc/src/vcpkg/base/machinetype.cpp b/toolsrc/src/vcpkg/base/machinetype.cpp index 237e1eb8bfcba9..243fa70864537a 100644 --- a/toolsrc/src/vcpkg/base/machinetype.cpp +++ b/toolsrc/src/vcpkg/base/machinetype.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/parse.cpp b/toolsrc/src/vcpkg/base/parse.cpp index 7d6576f4168caa..669321c05621e2 100644 --- a/toolsrc/src/vcpkg/base/parse.cpp +++ b/toolsrc/src/vcpkg/base/parse.cpp @@ -1,12 +1,7 @@ -#include "pch.h" - #include #include #include -#include -#include - #include using namespace vcpkg; @@ -106,128 +101,4 @@ namespace vcpkg::Parse // Avoid error loops by skipping to the end skip_to_eof(); } - - static Optional> remove_field(Paragraph* fields, const std::string& fieldname) - { - auto it = fields->find(fieldname); - if (it == fields->end()) - { - return nullopt; - } - - auto value = std::move(it->second); - fields->erase(it); - return value; - } - - void ParagraphParser::required_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (const auto field = maybe_field.get()) - out = std::move(*field); - else - missing_fields.push_back(fieldname); - } - void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) - { - auto maybe_field = remove_field(&fields, fieldname); - if (auto field = maybe_field.get()) out = std::move(*field); - } - void ParagraphParser::required_field(const std::string& fieldname, std::string& out) - { - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - } - std::string ParagraphParser::optional_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - optional_field(fieldname, {out, ignore}); - return out; - } - std::string ParagraphParser::required_field(const std::string& fieldname) - { - std::string out; - TextRowCol ignore; - required_field(fieldname, {out, ignore}); - return out; - } - - std::unique_ptr ParagraphParser::error_info(const std::string& name) const - { - if (!fields.empty() || !missing_fields.empty()) - { - auto err = std::make_unique(); - err->name = name; - err->extra_fields["CONTROL"] = Util::extract_keys(fields); - err->missing_fields["CONTROL"] = std::move(missing_fields); - err->expected_types = std::move(expected_types); - return err; - } - return nullptr; - } - - template - static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) - { - std::vector ret; - parser.skip_whitespace(); - if (parser.at_eof()) return std::vector{}; - do - { - auto item = f(parser); - if (!item) return nullopt; - ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); - parser.skip_whitespace(); - if (parser.at_eof()) return {std::move(ret)}; - if (parser.cur() != ',') - { - parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); - return nullopt; - } - parser.next(); - parser.skip_whitespace(); - } while (true); - } - - ExpectedS> parse_default_features_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_qualified_specifier_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof( - "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } - ExpectedS> parse_dependencies_list(const std::string& str, - StringView origin, - TextRowCol textrowcol) - { - auto parser = Parse::ParserBase(str, origin, textrowcol); - auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { - auto loc = parser.cur_loc(); - return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { - if (pqs.triplet) - { - parser.add_error("triplet specifier not allowed in this context", loc); - return nullopt; - } - return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; - }); - }); - if (!opt) return {parser.get_error()->format(), expected_right_tag}; - - return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; - } } diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp index 44fc3ebd114857..8e1bbdc22431ba 100644 --- a/toolsrc/src/vcpkg/base/strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -146,6 +144,13 @@ std::string Strings::trim(std::string&& s) return std::move(s); } +StringView Strings::trim(StringView sv) +{ + auto last = std::find_if_not(sv.rbegin(), sv.rend(), details::is_space).base(); + auto first = std::find_if_not(sv.begin(), sv.end(), details::is_space); + return StringView(first, last); +} + void Strings::trim_all_and_remove_whitespace_strings(std::vector* strings) { for (std::string& s : *strings) diff --git a/toolsrc/src/vcpkg/base/stringview.cpp b/toolsrc/src/vcpkg/base/stringview.cpp index 8ab114a5e4efce..6e03ba543eabf8 100644 --- a/toolsrc/src/vcpkg/base/stringview.cpp +++ b/toolsrc/src/vcpkg/base/stringview.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index 63674963e384e3..800a0a23b3c747 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -19,6 +17,7 @@ namespace vcpkg if (Strings::case_insensitive_ascii_equals(arch, "amd64")) return CPUArchitecture::X64; if (Strings::case_insensitive_ascii_equals(arch, "arm")) return CPUArchitecture::ARM; if (Strings::case_insensitive_ascii_equals(arch, "arm64")) return CPUArchitecture::ARM64; + if (Strings::case_insensitive_ascii_equals(arch, "s390x")) return CPUArchitecture::S390X; return nullopt; } @@ -30,6 +29,7 @@ namespace vcpkg case CPUArchitecture::X64: return "x64"; case CPUArchitecture::ARM: return "arm"; case CPUArchitecture::ARM64: return "arm64"; + case CPUArchitecture::S390X: return "s390x"; default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::System::CPUArchitecture"); } } @@ -45,12 +45,14 @@ namespace vcpkg #else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv #if defined(__x86_64__) || defined(_M_X64) return CPUArchitecture::X64; -#elif defined(__x86__) || defined(_M_X86) +#elif defined(__x86__) || defined(_M_X86) || defined(__i386__) return CPUArchitecture::X86; #elif defined(__arm__) || defined(_M_ARM) return CPUArchitecture::ARM; #elif defined(__aarch64__) || defined(_M_ARM64) return CPUArchitecture::ARM64; +#elif defined(__s390x__) + return CPUArchitecture::S390X; #else // choose architecture #error "Unknown host architecture" #endif // choose architecture diff --git a/toolsrc/src/vcpkg/base/system.print.cpp b/toolsrc/src/vcpkg/base/system.print.cpp index fc8e4184c8dad7..885269eef7038b 100644 --- a/toolsrc/src/vcpkg/base/system.print.cpp +++ b/toolsrc/src/vcpkg/base/system.print.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index 300e318df0d167..ee2dd1b3f2ea4b 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/base/unicode.cpp b/toolsrc/src/vcpkg/base/unicode.cpp index 149bad20f9180a..92b964ed83fa18 100644 --- a/toolsrc/src/vcpkg/base/unicode.cpp +++ b/toolsrc/src/vcpkg/base/unicode.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/binarycaching.cpp b/toolsrc/src/vcpkg/binarycaching.cpp index d63d6b3d498ce5..2c6f0fe989ade7 100644 --- a/toolsrc/src/vcpkg/binarycaching.cpp +++ b/toolsrc/src/vcpkg/binarycaching.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include using namespace vcpkg; @@ -663,6 +662,24 @@ namespace const ExpectedS& default_cache_path() { static auto cachepath = System::get_platform_cache_home().then([](fs::path p) -> ExpectedS { + auto maybe_cachepath = System::get_environment_variable("VCPKG_DEFAULT_BINARY_CACHE"); + if (auto p_str = maybe_cachepath.get()) + { + const auto path = fs::u8path(*p_str); + const auto status = fs::stdfs::status(path); + if (!fs::stdfs::exists(status)) + return {"Path to VCPKG_DEFAULT_BINARY_CACHE does not exist: " + path.u8string(), + expected_right_tag}; + if (!fs::stdfs::is_directory(status)) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not a directory: " + + path.u8string(), + expected_right_tag}; + if (!path.is_absolute()) + return {"Value of environment variable VCPKG_DEFAULT_BINARY_CACHE is not absolute: " + + path.u8string(), + expected_right_tag}; + return ExpectedS(path); + } p /= fs::u8path("vcpkg/archives"); if (p.is_absolute()) { @@ -673,6 +690,10 @@ namespace return {"default path was not absolute: " + p.u8string(), expected_right_tag}; } }); + if (cachepath.has_value()) + Debug::print("Default binary cache path is: ", cachepath.get()->u8string(), '\n'); + else + Debug::print("No binary cache path. Reason: ", cachepath.error(), '\n'); return cachepath; } diff --git a/toolsrc/src/vcpkg/binaryparagraph.cpp b/toolsrc/src/vcpkg/binaryparagraph.cpp index 0b0819fd718f3e..4d3bcbc973ac8b 100644 --- a/toolsrc/src/vcpkg/binaryparagraph.cpp +++ b/toolsrc/src/vcpkg/binaryparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index bcd0a7f89c012f..92dedd8dba16e0 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -16,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include using namespace vcpkg; @@ -187,6 +187,13 @@ namespace vcpkg::Build Build::null_build_logs_recorder(), paths); } + + void BuildCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Build::Command::perform_and_exit(args, paths, default_triplet); + } } namespace vcpkg::Build diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp index 9ef330e660df58..09d84d0e88075b 100644 --- a/toolsrc/src/vcpkg/buildenvironment.cpp +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -1,6 +1,5 @@ -#include "pch.h" - #include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg/cmakevars.cpp b/toolsrc/src/vcpkg/cmakevars.cpp index ee718d40822993..7c5078d3b80fa3 100644 --- a/toolsrc/src/vcpkg/cmakevars.cpp +++ b/toolsrc/src/vcpkg/cmakevars.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index 17d38f395f87ac..ae01302cb93e1d 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -1,8 +1,9 @@ -#include "pch.h" - #include -#include +#include +#include +#include +#include #include #include #include @@ -175,4 +176,9 @@ namespace vcpkg::Commands::Autocomplete Checks::exit_success(VCPKG_LINE_INFO); } + + void AutocompleteCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Autocomplete::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.buildexternal.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp index 79a8dd3c4b6895..02861918253fd1 100644 --- a/toolsrc/src/vcpkg/commands.buildexternal.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -1,9 +1,7 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include @@ -43,4 +41,11 @@ namespace vcpkg::Commands::BuildExternal Build::null_build_logs_recorder(), paths); } + + void BuildExternalCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + BuildExternal::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp index e7802498c703f5..555b70859e19a3 100644 --- a/toolsrc/src/vcpkg/commands.cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include @@ -71,4 +69,9 @@ namespace vcpkg::Commands::Cache Checks::exit_success(VCPKG_LINE_INFO); } + + void CacheCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Cache::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 50336a4c183d24..4dffcfd3c8f9dd 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -9,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -579,4 +577,11 @@ namespace vcpkg::Commands::CI Checks::exit_success(VCPKG_LINE_INFO); } + + void CICommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + CI::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 980e17da8f4a7b..21ae756ed43294 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include using namespace vcpkg; @@ -39,4 +37,9 @@ namespace vcpkg::Commands::CIClean print2("Completed vcpkg CI clean\n"); Checks::exit_success(VCPKG_LINE_INFO); } + + void CICleanCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + CIClean::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp index ce83fab80eff00..2c8c7b1b2857b1 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include @@ -58,4 +56,9 @@ namespace vcpkg::Commands::Contact } Checks::exit_success(VCPKG_LINE_INFO); } + + void ContactCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const + { + Contact::perform_and_exit(args, fs); + } } diff --git a/toolsrc/src/vcpkg/commands.cpp b/toolsrc/src/vcpkg/commands.cpp index be6d553047c20b..466cc11c073f49 100644 --- a/toolsrc/src/vcpkg/commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -1,10 +1,31 @@ -#include "pch.h" - -#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -13,104 +34,87 @@ namespace vcpkg::Commands { - Span> get_available_commands_type_a() + Span> get_available_basic_commands() { - static std::vector> t = { - {"install", &Install::perform_and_exit}, - {"x-set-installed", &SetInstalled::perform_and_exit}, - {"ci", &CI::perform_and_exit}, - {"remove", &Remove::perform_and_exit}, - {"upgrade", &Upgrade::perform_and_exit}, - {"build", &Build::Command::perform_and_exit}, - {"env", &Env::perform_and_exit}, - {"build-external", &BuildExternal::perform_and_exit}, - {"export", &Export::perform_and_exit}, - {"depend-info", &DependInfo::perform_and_exit}, + static const Version::VersionCommand version{}; + static const Contact::ContactCommand contact{}; + static std::vector> t = { + {"version", &version}, + {"contact", &contact}, }; return t; } - Span> get_available_commands_type_b() + Span> get_available_paths_commands() { - static std::vector> t = { - {"/?", &Help::perform_and_exit}, - {"help", &Help::perform_and_exit}, - {"search", &Search::perform_and_exit}, - {"list", &List::perform_and_exit}, - {"integrate", &Integrate::perform_and_exit}, - {"owns", &Owns::perform_and_exit}, - {"update", &Update::perform_and_exit}, - {"edit", &Edit::perform_and_exit}, - {"create", &Create::perform_and_exit}, - {"cache", &Cache::perform_and_exit}, - {"portsdiff", &PortsDiff::perform_and_exit}, - {"autocomplete", &Autocomplete::perform_and_exit}, - {"hash", &Hash::perform_and_exit}, - {"fetch", &Fetch::perform_and_exit}, - {"x-ci-clean", &CIClean::perform_and_exit}, - {"x-history", &PortHistory::perform_and_exit}, - {"x-vsinstances", &X_VSInstances::perform_and_exit}, - {"x-format-manifest", &FormatManifest::perform_and_exit}, - }; - return t; - } + static const Help::HelpCommand help{}; + static const Search::SearchCommand search{}; + static const List::ListCommand list{}; + static const Info::InfoCommand info{}; + static const Integrate::IntegrateCommand integrate{}; + static const Owns::OwnsCommand owns{}; + static const Update::UpdateCommand update{}; + static const Edit::EditCommand edit{}; + static const Create::CreateCommand create{}; + static const Cache::CacheCommand cache{}; + static const PortsDiff::PortsDiffCommand portsdiff{}; + static const Autocomplete::AutocompleteCommand autocomplete{}; + static const Hash::HashCommand hash{}; + static const Fetch::FetchCommand fetch{}; + static const CIClean::CICleanCommand ciclean{}; + static const PortHistory::PortHistoryCommand porthistory{}; + static const X_VSInstances::VSInstancesCommand vsinstances{}; + static const FormatManifest::FormatManifestCommand format_manifest{}; - Span> get_available_commands_type_c() - { - static std::vector> t = { - {"version", &Version::perform_and_exit}, - {"contact", &Contact::perform_and_exit}, + static std::vector> t = { + {"/?", &help}, + {"help", &help}, + {"search", &search}, + {"list", &list}, + {"integrate", &integrate}, + {"owns", &owns}, + {"update", &update}, + {"edit", &edit}, + {"create", &create}, + {"cache", &cache}, + {"portsdiff", &portsdiff}, + {"autocomplete", &autocomplete}, + {"hash", &hash}, + {"fetch", &fetch}, + {"x-ci-clean", &ciclean}, + {"x-package-info", &info}, + {"x-history", &porthistory}, + {"x-vsinstances", &vsinstances}, + {"x-format-manifest", &format_manifest}, }; return t; } -} - -namespace vcpkg::Commands::Fetch -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), - 1, - 1, - {}, - nullptr, - }; - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + Span> get_available_triplet_commands() { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + static const Install::InstallCommand install{}; + static const SetInstalled::SetInstalledCommand set_installed{}; + static const CI::CICommand ci{}; + static const Remove::RemoveCommand remove{}; + static const Upgrade::UpgradeCommand upgrade{}; + static const Build::BuildCommand build{}; + static const Env::EnvCommand env{}; + static const BuildExternal::BuildExternalCommand build_external{}; + static const Export::ExportCommand export_command{}; + static const DependInfo::DependInfoCommand depend_info{}; - const std::string tool = args.command_arguments[0]; - const fs::path tool_path = paths.get_tool_exe(tool); - System::print2(tool_path.u8string(), '\n'); - Checks::exit_success(VCPKG_LINE_INFO); - } -} - -namespace vcpkg::Commands::Hash -{ - const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), - 1, - 2, - {}, - nullptr, - }; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) - { - Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); - - const fs::path file_to_hash = args.command_arguments[0]; - - auto algorithm = vcpkg::Hash::Algorithm::Sha512; - if (args.command_arguments.size() == 2) - { - algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); - } - - const std::string hash = - vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); - System::print2(hash, '\n'); - Checks::exit_success(VCPKG_LINE_INFO); + static std::vector> t = { + {"install", &install}, + {"x-set-installed", &set_installed}, + {"ci", &ci}, + {"remove", &remove}, + {"upgrade", &upgrade}, + {"build", &build}, + {"env", &env}, + {"build-external", &build_external}, + {"export", &export_command}, + {"depend-info", &depend_info}, + }; + return t; } } diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index 83d2e109d5dffa..a7cfbc9318e626 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include namespace vcpkg::Commands::Create @@ -44,4 +42,9 @@ namespace vcpkg::Commands::Create { Checks::exit_with_code(VCPKG_LINE_INFO, perform(args, paths)); } + + void CreateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Create::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.dependinfo.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp index ba6da1aa3fbde7..0f1e431e58fa85 100644 --- a/toolsrc/src/vcpkg/commands.dependinfo.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include #include @@ -328,4 +326,11 @@ namespace vcpkg::Commands::DependInfo } Checks::exit_success(VCPKG_LINE_INFO); } + + void DependInfoCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + DependInfo::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index a433af8ecf8feb..b66e8c6808c759 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include @@ -267,4 +265,9 @@ namespace vcpkg::Commands::Edit #endif Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line)); } + + void EditCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Edit::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.env.cpp b/toolsrc/src/vcpkg/commands.env.cpp index bcde9916671c1d..a825230601d6cc 100644 --- a/toolsrc/src/vcpkg/commands.env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -1,11 +1,9 @@ -#include "pch.h" - #include #include #include #include -#include +#include #include namespace vcpkg::Commands::Env @@ -99,4 +97,11 @@ namespace vcpkg::Commands::Env #endif Checks::exit_with_code(VCPKG_LINE_INFO, rc); } + + void EnvCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Env::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp new file mode 100644 index 00000000000000..e6e59a30c15c10 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -0,0 +1,29 @@ +#include + +#include + +namespace vcpkg::Commands::Fetch +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), + 1, + 1, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + + const std::string tool = args.command_arguments[0]; + const fs::path tool_path = paths.get_tool_exe(tool); + System::print2(tool_path.u8string(), '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } + + void FetchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Fetch::perform_and_exit(args, paths); + } +} diff --git a/toolsrc/src/vcpkg/commands.format-manifest.cpp b/toolsrc/src/vcpkg/commands.format-manifest.cpp index f234722457b286..656e1799647a0f 100644 --- a/toolsrc/src/vcpkg/commands.format-manifest.cpp +++ b/toolsrc/src/vcpkg/commands.format-manifest.cpp @@ -1,18 +1,184 @@ -#include "pch.h" - #include #include #include #include -#include +#include +#include #include +#include + +namespace +{ + using namespace vcpkg; + + struct ToWrite + { + SourceControlFile scf; + fs::path file_to_write; + fs::path original_path; + std::string original_source; + }; + + Optional read_manifest(Files::Filesystem& fs, fs::path&& manifest_path) + { + auto path_string = manifest_path.u8string(); + Debug::print("Reading ", path_string, "\n"); + auto contents = fs.read_contents(manifest_path, VCPKG_LINE_INFO); + auto parsed_json_opt = Json::parse(contents, manifest_path); + if (!parsed_json_opt.has_value()) + { + System::printf( + System::Color::error, "Failed to parse %s: %s\n", path_string, parsed_json_opt.error()->format()); + return nullopt; + } + + const auto& parsed_json = parsed_json_opt.value_or_exit(VCPKG_LINE_INFO).first; + if (!parsed_json.is_object()) + { + System::printf(System::Color::error, "The file %s is not an object\n", path_string); + return nullopt; + } + + auto scf = SourceControlFile::parse_manifest_file(manifest_path, parsed_json.object()); + if (!scf.has_value()) + { + System::printf(System::Color::error, "Failed to parse manifest file: %s\n", path_string); + print_error_message(scf.error()); + return nullopt; + } + + return ToWrite{ + std::move(*scf.value_or_exit(VCPKG_LINE_INFO)), + manifest_path, + manifest_path, + std::move(contents), + }; + } + + Optional read_control_file(Files::Filesystem& fs, fs::path&& control_path) + { + std::error_code ec; + auto control_path_string = control_path.u8string(); + Debug::print("Reading ", control_path_string, "\n"); + + auto manifest_path = control_path.parent_path(); + manifest_path /= fs::u8path("vcpkg.json"); + + auto contents = fs.read_contents(control_path, VCPKG_LINE_INFO); + auto paragraphs = Paragraphs::parse_paragraphs(contents, control_path_string); + + if (!paragraphs) + { + System::printf(System::Color::error, + "Failed to read paragraphs from %s: %s\n", + control_path_string, + paragraphs.error()); + return {}; + } + auto scf_res = + SourceControlFile::parse_control_file(control_path, std::move(paragraphs).value_or_exit(VCPKG_LINE_INFO)); + if (!scf_res) + { + System::printf(System::Color::error, "Failed to parse control file: %s\n", control_path_string); + print_error_message(scf_res.error()); + return {}; + } + + return ToWrite{ + std::move(*scf_res.value_or_exit(VCPKG_LINE_INFO)), + manifest_path, + control_path, + std::move(contents), + }; + } + + void write_file(Files::Filesystem& fs, const ToWrite& data) + { + auto original_path_string = data.original_path.u8string(); + auto file_to_write_string = data.file_to_write.u8string(); + if (data.file_to_write == data.original_path) + { + Debug::print("Formatting ", file_to_write_string, "\n"); + } + else + { + Debug::print("Converting ", file_to_write_string, " -> ", original_path_string, "\n"); + } + auto res = serialize_manifest(data.scf); + + auto check = SourceControlFile::parse_manifest_file(fs::path{}, res); + if (!check) + { + System::printf(System::Color::error, + R"([correctness check] Failed to parse serialized manifest file of %s +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: +Error:)", + data.scf.core_paragraph->name); + print_error_message(check.error()); + Checks::exit_with_message(VCPKG_LINE_INFO, + R"( +=== Serialized manifest file === +%s +)", + Json::stringify(res, {})); + } + + auto check_scf = std::move(check).value_or_exit(VCPKG_LINE_INFO); + if (*check_scf != data.scf) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + R"([correctness check] The serialized manifest SCF was different from the original SCF. +Please open an issue at https://github.com/microsoft/vcpkg, with the following output: + +=== Original File === +%s + +=== Serialized File === +%s + +=== Original SCF === +%s + +=== Serialized SCF === +%s +)", + data.original_source, + Json::stringify(res, {}), + Json::stringify(serialize_debug_manifest(data.scf), {}), + Json::stringify(serialize_debug_manifest(*check_scf), {})); + } + + // the manifest scf is correct + std::error_code ec; + fs.write_contents(data.file_to_write, Json::stringify(res, {}), ec); + if (ec) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to write manifest file %s: %s\n", file_to_write_string, ec.message()); + } + if (data.original_path != data.file_to_write) + { + fs.remove(data.original_path, ec); + if (ec) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to remove control file %s: %s\n", original_path_string, ec.message()); + } + } + } +} namespace vcpkg::Commands::FormatManifest { static constexpr StringLiteral OPTION_ALL = "all"; + static constexpr StringLiteral OPTION_CONVERT_CONTROL = "convert-control"; - const CommandSwitch FORMAT_SWITCHES[] = {{OPTION_ALL, "Format all ports' manifest files."}}; + const CommandSwitch FORMAT_SWITCHES[] = { + {OPTION_ALL, "Format all ports' manifest files."}, + {OPTION_CONVERT_CONTROL, "Convert CONTROL files to manifest files."}, + }; const CommandStructure COMMAND_STRUCTURE = { create_example_string(R"###(x-format-manifest --all)###"), @@ -26,23 +192,35 @@ namespace vcpkg::Commands::FormatManifest { auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE); - std::vector files_to_format; - auto& fs = paths.get_filesystem(); bool has_error = false; - if (Util::Sets::contains(parsed_args.switches, OPTION_ALL)) + const bool format_all = Util::Sets::contains(parsed_args.switches, OPTION_ALL); + const bool convert_control = Util::Sets::contains(parsed_args.switches, OPTION_CONVERT_CONTROL); + + if (!format_all && convert_control) { - for (const auto& dir : fs::directory_iterator(paths.ports)) - { - auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); - if (fs.exists(manifest_path)) - { - files_to_format.push_back(std::move(manifest_path)); - } - } + System::print2(System::Color::warning, R"(x-format-manifest was passed '--convert-control' without '--all'. + This doesn't do anything: + we will automatically convert all control files passed explicitly.)"); + } + + if (!format_all && args.command_arguments.empty()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + "No files to format; please pass either --all, or the explicit files to format or convert."); } + std::vector to_write; + + const auto add_file = [&to_write, &has_error](Optional&& opt) { + if (auto t = opt.get()) + to_write.push_back(std::move(*t)); + else + has_error = true; + }; + for (const auto& arg : args.command_arguments) { auto path = fs::u8path(arg); @@ -50,40 +228,47 @@ namespace vcpkg::Commands::FormatManifest { path = paths.original_cwd / path; } - files_to_format.push_back(std::move(path)); - } - for (const auto& path : files_to_format) - { - std::error_code ec; - Debug::print("Formatting ", path.u8string(), "\n"); - auto parsed_json_opt = Json::parse_file(fs, path, ec); - if (ec) - { - System::printf(System::Color::error, "Failed to read %s: %s\n", path.u8string(), ec.message()); - has_error = true; - } - - if (auto pr = parsed_json_opt.get()) + if (path.filename() == fs::u8path("CONTROL")) { - fs.write_contents(path, Json::stringify(pr->first, Json::JsonStyle{}), ec); + add_file(read_control_file(fs, std::move(path))); } else { - System::printf(System::Color::error, - "Failed to parse %s: %s\n", - path.u8string(), - parsed_json_opt.error()->format()); - has_error = true; + add_file(read_manifest(fs, std::move(path))); } + } - if (ec) + if (format_all) + { + for (const auto& dir : fs::directory_iterator(paths.ports)) { - System::printf(System::Color::error, "Failed to write %s: %s\n", path.u8string(), ec.message()); - has_error = true; + auto control_path = dir.path() / fs::u8path("CONTROL"); + auto manifest_path = dir.path() / fs::u8path("vcpkg.json"); + auto manifest_exists = fs.exists(manifest_path); + auto control_exists = fs.exists(control_path); + + Checks::check_exit(VCPKG_LINE_INFO, + !manifest_exists || !control_exists, + "Both a manifest file and a CONTROL file exist in port directory: %s", + dir.path().u8string()); + + if (manifest_exists) + { + add_file(read_manifest(fs, std::move(manifest_path))); + } + if (convert_control && control_exists) + { + add_file(read_control_file(fs, std::move(control_path))); + } } } + for (auto const& el : to_write) + { + write_file(fs, el); + } + if (has_error) { Checks::exit_fail(VCPKG_LINE_INFO); @@ -94,4 +279,9 @@ namespace vcpkg::Commands::FormatManifest Checks::exit_success(VCPKG_LINE_INFO); } } + + void FormatManifestCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + FormatManifest::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp new file mode 100644 index 00000000000000..5ac5e8aa6d4f1a --- /dev/null +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -0,0 +1,38 @@ +#include +#include + +#include + +namespace vcpkg::Commands::Hash +{ + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("The argument should be a file path\n%s", create_example_string("hash boost_1_62_0.tar.bz2")), + 1, + 2, + {}, + nullptr, + }; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) + { + Util::unused(args.parse_arguments(COMMAND_STRUCTURE)); + + const fs::path file_to_hash = args.command_arguments[0]; + + auto algorithm = vcpkg::Hash::Algorithm::Sha512; + if (args.command_arguments.size() == 2) + { + algorithm = vcpkg::Hash::algorithm_from_string(args.command_arguments[1]).value_or_exit(VCPKG_LINE_INFO); + } + + const std::string hash = + vcpkg::Hash::get_file_hash(VCPKG_LINE_INFO, paths.get_filesystem(), file_to_hash, algorithm); + System::print2(hash, '\n'); + Checks::exit_success(VCPKG_LINE_INFO); + } + + void HashCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Hash::perform_and_exit(args, paths); + } +} diff --git a/toolsrc/src/vcpkg/commands.info.cpp b/toolsrc/src/vcpkg/commands.info.cpp new file mode 100644 index 00000000000000..afb2642c6e9396 --- /dev/null +++ b/toolsrc/src/vcpkg/commands.info.cpp @@ -0,0 +1,146 @@ +#include "pch.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace vcpkg::Commands::Info +{ + static constexpr StringLiteral OPTION_TRANSITIVE = "x-transitive"; + static constexpr StringLiteral OPTION_INSTALLED = "x-installed"; + + static constexpr CommandSwitch INFO_SWITCHES[] = { + {OPTION_INSTALLED, "(experimental) Report on installed packages instead of available"}, + {OPTION_TRANSITIVE, "(experimental) Also report on dependencies of installed packages"}, + }; + + const CommandStructure COMMAND_STRUCTURE = { + Strings::format("Display detailed information on packages.\n%s", + create_example_string("x-package-info zlib openssl:x64-windows")), + 1, + SIZE_MAX, + {INFO_SWITCHES, {}}, + nullptr, + }; + + void InfoCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); + if (!args.output_json()) + { + Checks::exit_with_message( + VCPKG_LINE_INFO, "This command currently requires --%s", VcpkgCmdArguments::JSON_SWITCH); + } + + const bool installed = Util::Sets::contains(options.switches, OPTION_INSTALLED); + const bool transitive = Util::Sets::contains(options.switches, OPTION_TRANSITIVE); + + if (transitive && !installed) + { + Checks::exit_with_message(VCPKG_LINE_INFO, "--%s requires --%s", OPTION_TRANSITIVE, OPTION_INSTALLED); + } + + if (installed) + { + const StatusParagraphs status_paragraphs = database_load_check(paths); + std::set specs_written; + std::vector specs_to_write; + for (auto&& arg : args.command_arguments) + { + Parse::ParserBase parser(arg, ""); + auto maybe_qpkg = parse_qualified_specifier(parser); + if (!parser.at_eof() || !maybe_qpkg) + { + parser.add_error("expected a package specifier"); + } + else if (!maybe_qpkg.get()->triplet) + { + parser.add_error("expected an explicit triplet"); + } + else if (maybe_qpkg.get()->features) + { + parser.add_error("unexpected list of features"); + } + else if (maybe_qpkg.get()->platform) + { + parser.add_error("unexpected qualifier"); + } + if (auto err = parser.get_error()) + { + System::print2(err->format(), "\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + auto& qpkg = *maybe_qpkg.get(); + auto t = Triplet::from_canonical_name(std::string(*qpkg.triplet.get())); + Input::check_triplet(t, paths); + specs_to_write.emplace_back(qpkg.name, t); + } + Json::Object response; + Json::Object results; + while (!specs_to_write.empty()) + { + auto spec = std::move(specs_to_write.back()); + specs_to_write.pop_back(); + if (!specs_written.insert(spec).second) continue; + auto maybe_ipv = status_paragraphs.get_installed_package_view(spec); + if (auto ipv = maybe_ipv.get()) + { + results.insert(spec.to_string(), serialize_ipv(*ipv, paths)); + if (transitive) + { + auto deps = ipv->dependencies(); + specs_to_write.insert(specs_to_write.end(), + std::make_move_iterator(deps.begin()), + std::make_move_iterator(deps.end())); + } + } + } + response.insert("results", std::move(results)); + System::print2(Json::stringify(response, {})); + } + else + { + Json::Object response; + Json::Object results; + PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports); + + for (auto&& arg : args.command_arguments) + { + Parse::ParserBase parser(arg, ""); + auto maybe_pkg = parse_package_name(parser); + if (!parser.at_eof() || !maybe_pkg) + { + parser.add_error("expected only a package identifier"); + } + if (auto err = parser.get_error()) + { + System::print2(err->format(), "\n"); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + auto& pkg = *maybe_pkg.get(); + + if (results.contains(pkg)) continue; + + auto maybe_scfl = provider.get_control_file(pkg); + + Json::Object obj; + if (auto pscfl = maybe_scfl.get()) + { + results.insert(pkg, serialize_manifest(*pscfl->source_control_file)); + } + } + response.insert("results", std::move(results)); + System::print2(Json::stringify(response, {})); + } + } +} diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index a7ef5a012226c3..1aa7d58649bf57 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,8 +5,9 @@ #include #include -#include +#include #include +#include #include namespace vcpkg::Commands::Integrate @@ -559,4 +558,9 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_with_message(VCPKG_LINE_INFO, "Unknown parameter %s for integrate", args.command_arguments[0]); } + + void IntegrateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Integrate::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.list.cpp b/toolsrc/src/vcpkg/commands.list.cpp index f65ba9497974ae..fcd2919ff172c5 100644 --- a/toolsrc/src/vcpkg/commands.list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -1,8 +1,6 @@ -#include "pch.h" - #include -#include +#include #include #include #include @@ -11,8 +9,6 @@ namespace vcpkg::Commands::List { static constexpr StringLiteral OPTION_FULLDESC = "x-full-desc"; // TODO: This should find a better home, eventually - static constexpr StringLiteral OPTION_JSON = "--x-json"; - static void do_print_json(std::vector installed_packages) { Json::Object obj; @@ -75,9 +71,8 @@ namespace vcpkg::Commands::List } } - static constexpr std::array LIST_SWITCHES = {{ + static constexpr std::array LIST_SWITCHES = {{ {OPTION_FULLDESC, "Do not truncate long text"}, - {OPTION_JSON, "List libraries in JSON format"}, }}; const CommandStructure COMMAND_STRUCTURE = { @@ -115,7 +110,6 @@ namespace vcpkg::Commands::List }); const auto enable_fulldesc = Util::Sets::contains(options.switches, OPTION_FULLDESC.to_string()); - const auto enable_json = Util::Sets::contains(options.switches, OPTION_JSON.to_string()); if (!args.command_arguments.empty()) { @@ -126,7 +120,7 @@ namespace vcpkg::Commands::List installed_packages = pghs; } - if (enable_json) + if (args.output_json()) { do_print_json(installed_packages); } @@ -140,4 +134,9 @@ namespace vcpkg::Commands::List Checks::exit_success(VCPKG_LINE_INFO); } + + void ListCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + List::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp index a71a56ed30153e..29cfe3a2300e87 100644 --- a/toolsrc/src/vcpkg/commands.owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -1,8 +1,6 @@ -#include "pch.h" - #include -#include +#include #include #include @@ -40,4 +38,9 @@ namespace vcpkg::Commands::Owns search_file(paths, args.command_arguments[0], status_db); Checks::exit_success(VCPKG_LINE_INFO); } + + void OwnsCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Owns::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp index b1bf29f5f3e0b7..6f45e26ed0f115 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -1,11 +1,10 @@ -#include "pch.h" - #include #include #include -#include +#include #include +#include namespace vcpkg::Commands::PortHistory { @@ -94,4 +93,9 @@ namespace vcpkg::Commands::PortHistory } Checks::exit_success(VCPKG_LINE_INFO); } + + void PortHistoryCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + PortHistory::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp index 94c6e490b410cd..ad27599fbbeaeb 100644 --- a/toolsrc/src/vcpkg/commands.portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -1,13 +1,12 @@ -#include "pch.h" - #include #include #include #include -#include +#include #include #include +#include #include namespace vcpkg::Commands::PortsDiff @@ -190,4 +189,9 @@ namespace vcpkg::Commands::PortsDiff Checks::exit_success(VCPKG_LINE_INFO); } + + void PortsDiffCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + PortsDiff::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.search.cpp b/toolsrc/src/vcpkg/commands.search.cpp index b78420b4db2ccf..836acfffeea1f5 100644 --- a/toolsrc/src/vcpkg/commands.search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -1,8 +1,6 @@ -#include "pch.h" - #include -#include +#include #include #include #include @@ -144,4 +142,9 @@ namespace vcpkg::Commands::Search Checks::exit_success(VCPKG_LINE_INFO); } + + void SearchCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Search::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/commands.setinstalled.cpp b/toolsrc/src/vcpkg/commands.setinstalled.cpp index 82e1c763f14f9a..6ef5099dc6f5ef 100644 --- a/toolsrc/src/vcpkg/commands.setinstalled.cpp +++ b/toolsrc/src/vcpkg/commands.setinstalled.cpp @@ -1,9 +1,7 @@ -#include "pch.h" - #include #include -#include +#include #include #include #include @@ -39,21 +37,10 @@ namespace vcpkg::Commands::SetInstalled const PortFileProvider::PathsPortFileProvider& provider, IBinaryProvider& binary_provider, const CMakeVars::CMakeVarProvider& cmake_vars, - const std::vector& specs, - const Build::BuildPackageOptions& install_plan_options, + Dependencies::ActionPlan action_plan, DryRun dry_run, const Optional& maybe_pkgsconfig) { - // We have a set of user-requested specs. - // We need to know all the specs which are required to fulfill dependencies for those specs. - // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. - auto action_plan = Dependencies::create_feature_install_plan(provider, cmake_vars, specs, {}); - - for (auto&& action : action_plan.install_actions) - { - action.build_options = install_plan_options; - } - cmake_vars.load_tag_vars(action_plan, provider); Build::compute_all_abis(paths, action_plan, cmake_vars, {}); @@ -155,14 +142,31 @@ namespace vcpkg::Commands::SetInstalled { pkgsconfig = it_pkgsconfig->second; } + + // We have a set of user-requested specs. + // We need to know all the specs which are required to fulfill dependencies for those specs. + // Therefore, we see what we would install into an empty installed tree, so we can use the existing code. + auto action_plan = Dependencies::create_feature_install_plan(provider, *cmake_vars, specs, {}); + + for (auto&& action : action_plan.install_actions) + { + action.build_options = Build::default_build_package_options; + } + perform_and_exit_ex(args, paths, provider, *binary_provider, *cmake_vars, - specs, - vcpkg::Build::default_build_package_options, + std::move(action_plan), dry_run ? DryRun::Yes : DryRun::No, pkgsconfig); } + + void SetInstalledCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + SetInstalled::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp index 25fb0de9895aac..391192038a9f27 100644 --- a/toolsrc/src/vcpkg/commands.upgrade.cpp +++ b/toolsrc/src/vcpkg/commands.upgrade.cpp @@ -1,10 +1,8 @@ -#include "pch.h" - #include #include #include -#include +#include #include #include #include @@ -192,4 +190,11 @@ namespace vcpkg::Commands::Upgrade Checks::exit_success(VCPKG_LINE_INFO); } + + void UpgradeCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Upgrade::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp index 273b4f10a64e20..d366a42b83a85e 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -1,8 +1,6 @@ -#include "pch.h" - #include -#include +#include #include #include @@ -93,4 +91,9 @@ namespace vcpkg::Commands::Version "See LICENSE.txt for license information.\n"); Checks::exit_success(VCPKG_LINE_INFO); } + + void VersionCommand::perform_and_exit(const VcpkgCmdArguments& args, Files::Filesystem& fs) const + { + Version::perform_and_exit(args, fs); + } } diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp index 718c73ec015604..4ad9744c90e557 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -1,8 +1,6 @@ -#include "pch.h" - #include -#include +#include #include #include @@ -33,4 +31,9 @@ namespace vcpkg::Commands::X_VSInstances Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); #endif } + + void VSInstancesCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + X_VSInstances::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index e9af12929f9601..f7671ceef20789 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -594,6 +592,70 @@ namespace vcpkg::Dependencies m_graph->get(spec).request_type = RequestType::USER_REQUESTED; } + // `features` should have "default" instead of missing "core" + std::vector resolve_deps_as_top_level(const SourceControlFile& scf, + Triplet triplet, + std::vector features, + CMakeVars::CMakeVarProvider& var_provider) + { + PackageSpec spec{scf.core_paragraph->name, triplet}; + std::map> specs_to_features; + + Optional ctx_storage = var_provider.get_dep_info_vars(spec); + auto ctx = [&]() -> const PlatformExpression::Context& { + if (!ctx_storage) + { + var_provider.load_dep_info_vars({{spec}}); + ctx_storage = var_provider.get_dep_info_vars(spec); + } + return ctx_storage.value_or_exit(VCPKG_LINE_INFO); + }; + + auto handle_deps = [&](View deps) { + for (auto&& dep : deps) + { + if (dep.platform.is_empty() || dep.platform.evaluate(ctx())) + { + if (dep.name == spec.name()) + Util::Vectors::append(&features, dep.features); + else + Util::Vectors::append(&specs_to_features[dep.name], dep.features); + } + } + }; + + handle_deps(scf.core_paragraph->dependencies); + enum class State + { + NotVisited = 0, + Visited, + }; + std::map feature_state; + while (!features.empty()) + { + auto feature = std::move(features.back()); + features.pop_back(); + + if (feature_state[feature] == State::Visited) continue; + feature_state[feature] = State::Visited; + if (feature == "default") + { + Util::Vectors::append(&features, scf.core_paragraph->default_features); + } + else + { + auto it = + Util::find_if(scf.feature_paragraphs, [&feature](const std::unique_ptr& ptr) { + return ptr->name == feature; + }); + if (it != scf.feature_paragraphs.end()) handle_deps(it->get()->dependencies); + } + } + return Util::fmap(specs_to_features, [triplet](std::pair>& p) { + return FullPackageSpec({p.first, triplet}, Util::sort_unique_erase(std::move(p.second))); + }); + } + ActionPlan create_feature_install_plan(const PortFileProvider::PortFileProvider& port_provider, const CMakeVars::CMakeVarProvider& var_provider, const std::vector& specs, @@ -627,7 +689,9 @@ namespace vcpkg::Dependencies } pgraph.install(feature_specs); - return pgraph.serialize(options); + auto res = pgraph.serialize(options); + + return res; } void PackageGraph::mark_for_reinstall(const PackageSpec& first_remove_spec, diff --git a/toolsrc/src/vcpkg/export.chocolatey.cpp b/toolsrc/src/vcpkg/export.chocolatey.cpp index 40564ae135d163..abaea6921f874d 100644 --- a/toolsrc/src/vcpkg/export.chocolatey.cpp +++ b/toolsrc/src/vcpkg/export.chocolatey.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -7,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Export::Chocolatey { @@ -39,24 +38,24 @@ namespace vcpkg::Export::Chocolatey const std::map& packages_version, const Options& chocolatey_options) { - static constexpr auto CONTENT_TEMPLATE = R"( - - - @PACKAGE_ID@ - @PACKAGE_VERSION@ - @PACKAGE_MAINTAINER@ - - - @PACKAGE_DEPENDENCIES@ - - - - - - - + static constexpr auto CONTENT_TEMPLATE = R"( + + + @PACKAGE_ID@ + @PACKAGE_VERSION@ + @PACKAGE_MAINTAINER@ + + + @PACKAGE_DEPENDENCIES@ + + + + + + + )"; auto package_version = packages_version.find(binary_paragraph.spec.name()); if (package_version == packages_version.end()) @@ -81,68 +80,68 @@ namespace vcpkg::Export::Chocolatey static std::string create_chocolatey_install_contents() { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$installedDir = Join-Path $rootDir 'installed' - -$whereToInstall = (pwd).path -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Set-Content -Path $whereToInstallCache -Value $whereToInstall -Copy-Item $installedDir -destination $whereToInstall -recurse -force + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$installedDir = Join-Path $rootDir 'installed' + +$whereToInstall = (pwd).path +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Set-Content -Path $whereToInstallCache -Value $whereToInstall +Copy-Item $installedDir -destination $whereToInstall -recurse -force )###"; return CONTENT_TEMPLATE; } static std::string create_chocolatey_uninstall_contents(const BinaryParagraph& binary_paragraph) { - static constexpr auto CONTENT_TEMPLATE = R"###( -$ErrorActionPreference = 'Stop'; - -$packageName= $env:ChocolateyPackageName -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$rootDir = "$(Split-Path -parent $toolsDir)" -$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' - -$whereToInstall = $null -$whereToInstallCache = Join-Path $rootDir 'install.txt' -Get-Content $whereToInstallCache | Foreach-Object { - $whereToInstall = $_ -} - -$installedDir = Join-Path $whereToInstall 'installed' -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Leaf) { - Remove-Item $fileToRemove - } -} - -Get-Content $listFile | Foreach-Object { - $fileToRemove = Join-Path $installedDir $_ - if (Test-Path $fileToRemove -PathType Container) { - $folderToDelete = Join-Path $fileToRemove * - if (-Not (Test-Path $folderToDelete)) - { - Remove-Item $fileToRemove - } - } -} - -$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' -Remove-Item $listFileToRemove - -if (Test-Path $installedDir) -{ - while ( - $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { - $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 - } - ) { $empties | Remove-Item } -} + static constexpr auto CONTENT_TEMPLATE = R"###( +$ErrorActionPreference = 'Stop'; + +$packageName= $env:ChocolateyPackageName +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$rootDir = "$(Split-Path -parent $toolsDir)" +$listFile = Join-Path $rootDir 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' + +$whereToInstall = $null +$whereToInstallCache = Join-Path $rootDir 'install.txt' +Get-Content $whereToInstallCache | Foreach-Object { + $whereToInstall = $_ +} + +$installedDir = Join-Path $whereToInstall 'installed' +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Leaf) { + Remove-Item $fileToRemove + } +} + +Get-Content $listFile | Foreach-Object { + $fileToRemove = Join-Path $installedDir $_ + if (Test-Path $fileToRemove -PathType Container) { + $folderToDelete = Join-Path $fileToRemove * + if (-Not (Test-Path $folderToDelete)) + { + Remove-Item $fileToRemove + } + } +} + +$listFileToRemove = Join-Path $whereToInstall 'installed\vcpkg\info\@PACKAGE_FULLSTEM@.list' +Remove-Item $listFileToRemove + +if (Test-Path $installedDir) +{ + while ( + $empties = Get-ChildItem $installedDir -recurse -Directory | Where-Object { + $_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0 + } + ) { $empties | Remove-Item } +} )###"; std::string chocolatey_uninstall_content = Strings::replace_all(CONTENT_TEMPLATE, "@PACKAGE_FULLSTEM@", binary_paragraph.fullstem()); diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index 54a1180c1fb8be..f8691aa0405780 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -15,6 +13,7 @@ #include #include #include +#include #include namespace vcpkg::Export @@ -150,13 +149,19 @@ namespace vcpkg::Export fs.write_contents(nuspec_file_path, nuspec_file_content, VCPKG_LINE_INFO); // -NoDefaultExcludes is needed for ".vcpkg-root" - const auto cmd_line = Strings::format(R"("%s" pack -OutputDirectory "%s" "%s" -NoDefaultExcludes)", - nuget_exe.u8string(), - output_dir.u8string(), - nuspec_file_path.u8string()); + System::CmdLineBuilder cmd; +#ifndef _WIN32 + cmd.path_arg(paths.get_tool_exe(Tools::MONO)); +#endif + cmd.path_arg(nuget_exe) + .string_arg("pack") + .path_arg(nuspec_file_path) + .string_arg("-OutputDirectory") + .path_arg(output_dir) + .string_arg("-NoDefaultExcludes"); const int exit_code = - System::cmd_execute_and_capture_output(cmd_line, System::get_clean_environment()).exit_code; + System::cmd_execute_and_capture_output(cmd.extract(), System::get_clean_environment()).exit_code; Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: NuGet package creation failed"); const fs::path output_path = output_dir / (nuget_id + "." + nuget_version + ".nupkg"); @@ -206,14 +211,26 @@ namespace vcpkg::Export Strings::format("%s.%s", exported_dir_filename, format.extension()); const fs::path exported_archive_path = (output_dir / exported_archive_filename); - // -NoDefaultExcludes is needed for ".vcpkg-root" - const auto cmd_line = Strings::format(R"("%s" -E tar "cf" "%s" --format=%s -- "%s")", - cmake_exe.u8string(), - exported_archive_path.u8string(), - format.cmake_option(), - raw_exported_dir.u8string()); + System::CmdLineBuilder cmd; + cmd.string_arg("cd").path_arg(raw_exported_dir.parent_path()); + cmd.ampersand(); + cmd.path_arg(cmake_exe) + .string_arg("-E") + .string_arg("tar") + .string_arg("cf") + .path_arg(exported_archive_path) + .string_arg(Strings::concat("--format=", format.cmake_option())) + .string_arg("--") + .path_arg(raw_exported_dir); + + auto cmdline = cmd.extract(); +#ifdef WIN32 + // Invoke through `cmd` to support `&&` + cmdline.insert(0, "cmd /c \""); + cmdline.push_back('"'); +#endif - const int exit_code = System::cmd_execute_clean(cmd_line); + const int exit_code = System::cmd_execute_clean(cmdline); Checks::check_exit( VCPKG_LINE_INFO, exit_code == 0, "Error: %s creation failed", exported_archive_path.generic_string()); return exported_archive_path; @@ -262,6 +279,7 @@ namespace vcpkg::Export bool all_installed = false; Optional maybe_output; + fs::path output_dir; Optional maybe_nuget_id; Optional maybe_nuget_version; @@ -273,6 +291,7 @@ namespace vcpkg::Export }; static constexpr StringLiteral OPTION_OUTPUT = "output"; + static constexpr StringLiteral OPTION_OUTPUT_DIR = "output-dir"; static constexpr StringLiteral OPTION_DRY_RUN = "dry-run"; static constexpr StringLiteral OPTION_RAW = "raw"; static constexpr StringLiteral OPTION_NUGET = "nuget"; @@ -314,8 +333,9 @@ namespace vcpkg::Export {OPTION_ALL_INSTALLED, "Export all installed packages"}, }}; - static constexpr std::array EXPORT_SETTINGS = {{ + static constexpr std::array EXPORT_SETTINGS = {{ {OPTION_OUTPUT, "Specify the output name (used to construct filename)"}, + {OPTION_OUTPUT_DIR, "Specify the output directory for produced artifacts"}, {OPTION_NUGET_ID, "Specify the id for the exported NuGet package (overrides --output)"}, {OPTION_NUGET_VERSION, "Specify the version for the exported NuGet package"}, {OPTION_IFW_REPOSITORY_URL, "Specify the remote repository URL for the online installer"}, @@ -342,7 +362,8 @@ namespace vcpkg::Export nullptr, }; - static ExportArguments handle_export_command_arguments(const VcpkgCmdArguments& args, + static ExportArguments handle_export_command_arguments(const VcpkgPaths& paths, + const VcpkgCmdArguments& args, Triplet default_triplet, const StatusParagraphs& status_db) { @@ -361,6 +382,15 @@ namespace vcpkg::Export ret.prefab_options.enable_maven = options.switches.find(OPTION_PREFAB_ENABLE_MAVEN) != options.switches.cend(); ret.prefab_options.enable_debug = options.switches.find(OPTION_PREFAB_ENABLE_DEBUG) != options.switches.cend(); ret.maybe_output = maybe_lookup(options.settings, OPTION_OUTPUT); + auto maybe_output_dir = maybe_lookup(options.settings, OPTION_OUTPUT_DIR); + if (auto output_dir = maybe_output_dir.get()) + { + ret.output_dir = Files::combine(paths.original_cwd, fs::u8path(*output_dir)); + } + else + { + ret.output_dir = paths.root; + } ret.all_installed = options.switches.find(OPTION_ALL_INSTALLED) != options.switches.end(); if (ret.all_installed) @@ -479,8 +509,7 @@ namespace vcpkg::Export const VcpkgPaths& paths) { Files::Filesystem& fs = paths.get_filesystem(); - const fs::path export_to_path = paths.root; - const fs::path raw_exported_dir_path = export_to_path / export_id; + const fs::path raw_exported_dir_path = opts.output_dir / export_id; fs.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); // TODO: error handling @@ -538,7 +567,7 @@ namespace vcpkg::Export const std::string nuget_id = opts.maybe_nuget_id.value_or(raw_exported_dir_path.filename().string()); const std::string nuget_version = opts.maybe_nuget_version.value_or("1.0.0"); const fs::path output_path = - do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, export_to_path); + do_nuget_export(paths, nuget_id, nuget_version, raw_exported_dir_path, opts.output_dir); System::print2(System::Color::success, "NuGet package exported at: ", output_path.u8string(), "\n"); System::printf(R"( @@ -554,7 +583,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { System::print2("Creating zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::ZIP); + do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::ZIP); System::print2(System::Color::success, "Zip archive exported at: ", output_path.u8string(), "\n"); print_next_step_info("[...]"); } @@ -563,7 +592,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console { System::print2("Creating 7zip archive...\n"); const fs::path output_path = - do_archive_export(paths, raw_exported_dir_path, export_to_path, ArchiveFormatC::SEVEN_ZIP); + do_archive_export(paths, raw_exported_dir_path, opts.output_dir, ArchiveFormatC::SEVEN_ZIP); System::print2(System::Color::success, "7zip archive exported at: ", output_path.u8string(), "\n"); print_next_step_info("[...]"); } @@ -584,7 +613,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console "may use export in classic mode by running vcpkg outside of a manifest-based project."); } const StatusParagraphs status_db = database_load_check(paths); - const auto opts = handle_export_command_arguments(args, default_triplet, status_db); + const auto opts = handle_export_command_arguments(paths, args, default_triplet, status_db); for (auto&& spec : opts.specs) Input::check_triplet(spec.triplet(), paths); @@ -659,4 +688,11 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Checks::exit_success(VCPKG_LINE_INFO); } + + void ExportCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Export::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/commands.exportifw.cpp b/toolsrc/src/vcpkg/export.ifw.cpp similarity index 99% rename from toolsrc/src/vcpkg/commands.exportifw.cpp rename to toolsrc/src/vcpkg/export.ifw.cpp index 8356313cf3f94f..45b600801cc45a 100644 --- a/toolsrc/src/vcpkg/commands.exportifw.cpp +++ b/toolsrc/src/vcpkg/export.ifw.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -7,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Export::IFW { diff --git a/toolsrc/src/vcpkg/export.prefab.cpp b/toolsrc/src/vcpkg/export.prefab.cpp index 7dd516ac55702b..51ac868c721068 100644 --- a/toolsrc/src/vcpkg/export.prefab.cpp +++ b/toolsrc/src/vcpkg/export.prefab.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -11,6 +9,7 @@ #include #include #include +#include namespace vcpkg::Export::Prefab { diff --git a/toolsrc/src/vcpkg/globalstate.cpp b/toolsrc/src/vcpkg/globalstate.cpp index 037232f11e8e25..b07690bbd31741 100644 --- a/toolsrc/src/vcpkg/globalstate.cpp +++ b/toolsrc/src/vcpkg/globalstate.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include namespace vcpkg diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index d341b32ab790e5..1719e5f6cce2ae 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -1,9 +1,14 @@ -#include "pch.h" - #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -129,4 +134,9 @@ namespace vcpkg::Help help_topics(paths); Checks::exit_fail(VCPKG_LINE_INFO); } + + void HelpCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Help::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/input.cpp b/toolsrc/src/vcpkg/input.cpp index f9184983c67947..b82dc44fb7f153 100644 --- a/toolsrc/src/vcpkg/input.cpp +++ b/toolsrc/src/vcpkg/input.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index da4248c39e1953..03ae77d9823ff3 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -8,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -512,6 +510,8 @@ namespace vcpkg::Install static constexpr StringLiteral OPTION_USE_ARIA2 = "x-use-aria2"; static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "clean-after-build"; static constexpr StringLiteral OPTION_WRITE_PACKAGES_CONFIG = "x-write-nuget-packages-config"; + static constexpr StringLiteral OPTION_MANIFEST_NO_DEFAULT_FEATURES = "x-no-default-features"; + static constexpr StringLiteral OPTION_MANIFEST_FEATURE = "x-feature"; static constexpr std::array INSTALL_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually build or install"}, @@ -524,6 +524,19 @@ namespace vcpkg::Install {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, }}; + static constexpr std::array MANIFEST_INSTALL_SWITCHES = {{ + {OPTION_DRY_RUN, "Do not actually build or install"}, + {OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"}, + {OPTION_NO_DOWNLOADS, "Do not download new sources"}, + {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"}, + {OPTION_RECURSE, "Allow removal of packages as part of installation"}, + {OPTION_KEEP_GOING, "Continue installing packages on failure"}, + {OPTION_EDITABLE, "Disable source re-extraction and binary caching for libraries on the command line"}, + {OPTION_USE_ARIA2, "Use aria2 to perform download tasks"}, + {OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"}, + {OPTION_MANIFEST_NO_DEFAULT_FEATURES, "Don't install the default features from the manifest."}, + }}; + static constexpr std::array INSTALL_SETTINGS = {{ {OPTION_XUNIT, "File to output results in XUnit format (Internal use)"}, {OPTION_WRITE_PACKAGES_CONFIG, @@ -531,6 +544,10 @@ namespace vcpkg::Install "binarycaching` for more information."}, }}; + static constexpr std::array MANIFEST_INSTALL_MULTISETTINGS = {{ + {OPTION_MANIFEST_FEATURE, "A feature from the manifest to install."}, + }}; + std::vector get_all_port_names(const VcpkgPaths& paths) { auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports); @@ -551,26 +568,40 @@ namespace vcpkg::Install create_example_string("install --triplet x64-windows"), 0, 0, - {INSTALL_SWITCHES, INSTALL_SETTINGS}, + {MANIFEST_INSTALL_SWITCHES, INSTALL_SETTINGS, MANIFEST_INSTALL_MULTISETTINGS}, nullptr, }; static void print_cmake_information(const BinaryParagraph& bpgh, const VcpkgPaths& paths) + { + auto usage = get_cmake_usage(bpgh, paths); + + if (!usage.message.empty()) + { + System::print2(usage.message); + } + } + + CMakeUsageInfo get_cmake_usage(const BinaryParagraph& bpgh, const VcpkgPaths& paths) { static const std::regex cmake_library_regex(R"(\badd_library\(([^\$\s\)]+)\s)", std::regex_constants::ECMAScript); + CMakeUsageInfo ret; + auto& fs = paths.get_filesystem(); auto usage_file = paths.installed / bpgh.spec.triplet().canonical_name() / "share" / bpgh.spec.name() / "usage"; if (fs.exists(usage_file)) { + ret.usage_file = true; auto maybe_contents = fs.read_contents(usage_file); if (auto p_contents = maybe_contents.get()) { - System::print2(*p_contents, '\n'); + ret.message = std::move(*p_contents); + ret.message.push_back('\n'); } - return; + return ret; } auto files = fs.read_lines(paths.listfile_path(bpgh)); @@ -635,6 +666,8 @@ namespace vcpkg::Install } } + ret.header_only = is_header_only; + if (library_targets.empty()) { if (is_header_only && !header_path.empty()) @@ -653,20 +686,21 @@ namespace vcpkg::Install "The package ", bpgh.spec, " is header only and can be used from CMake via:\n\n"); Strings::append(msg, " find_path(", name, "_INCLUDE_DIRS \"", header_path, "\")\n"); Strings::append(msg, " target_include_directories(main PRIVATE ${", name, "_INCLUDE_DIRS})\n\n"); - System::print2(msg); + + ret.message = std::move(msg); } } else { - System::print2("The package ", bpgh.spec, " provides CMake targets:\n\n"); + auto msg = Strings::concat("The package ", bpgh.spec, " provides CMake targets:\n\n"); for (auto&& library_target_pair : library_targets) { auto config_it = config_files.find(library_target_pair.first); if (config_it != config_files.end()) - System::printf(" find_package(%s CONFIG REQUIRED)\n", config_it->second); + Strings::append(msg, " find_package(", config_it->second, " CONFIG REQUIRED)\n "); else - System::printf(" find_package(%s CONFIG REQUIRED)\n", library_target_pair.first); + Strings::append(msg, " find_package(", library_target_pair.first, " CONFIG REQUIRED)\n "); std::sort(library_target_pair.second.begin(), library_target_pair.second.end(), @@ -678,22 +712,27 @@ namespace vcpkg::Install if (library_target_pair.second.size() <= 4) { - System::printf(" target_link_libraries(main PRIVATE %s)\n\n", - Strings::join(" ", library_target_pair.second)); + Strings::append(msg, + " target_link_libraries(main PRIVATE ", + Strings::join(" ", library_target_pair.second), + ")\n\n"); } else { auto omitted = library_target_pair.second.size() - 4; library_target_pair.second.erase(library_target_pair.second.begin() + 4, library_target_pair.second.end()); - System::printf(" # Note: %zd target(s) were omitted.\n" - " target_link_libraries(main PRIVATE %s)\n\n", - omitted, - Strings::join(" ", library_target_pair.second)); + msg += Strings::format(" # Note: %zd target(s) were omitted.\n" + " target_link_libraries(main PRIVATE %s)\n\n", + omitted, + Strings::join(" ", library_target_pair.second)); } } + ret.message = std::move(msg); } + ret.cmake_targets_map = std::move(library_targets); } + return ret; } /// @@ -743,48 +782,62 @@ namespace vcpkg::Install if (paths.manifest_mode_enabled()) { - std::error_code ec; - const auto path_to_manifest = paths.manifest_root_dir / "vcpkg.json"; - auto res = Paragraphs::try_load_manifest(paths.get_filesystem(), "user manifest", path_to_manifest, ec); + Optional pkgsconfig; + auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); + if (it_pkgsconfig != options.settings.end()) + { + pkgsconfig = fs::u8path(it_pkgsconfig->second); + } + std::error_code ec; + auto manifest_path = paths.manifest_root_dir / fs::u8path("vcpkg.json"); + auto maybe_manifest_scf = Paragraphs::try_load_manifest(fs, "manifest", manifest_path, ec); if (ec) { - Checks::exit_with_message(VCPKG_LINE_INFO, - "Failed to load manifest file (%s): %s\n", - path_to_manifest.u8string(), - ec.message()); + Checks::exit_with_message( + VCPKG_LINE_INFO, "Failed to read manifest %s: %s", manifest_path.u8string(), ec.message()); } + else if (!maybe_manifest_scf) + { + print_error_message(maybe_manifest_scf.error()); + Checks::exit_with_message(VCPKG_LINE_INFO, "Failed to read manifest %s.", manifest_path.u8string()); + } + auto& manifest_scf = *maybe_manifest_scf.value_or_exit(VCPKG_LINE_INFO); - std::vector specs; - if (auto val = res.get()) + std::vector features; + auto manifest_feature_it = options.multisettings.find(OPTION_MANIFEST_FEATURE); + if (manifest_feature_it != options.multisettings.end()) { - for (auto& dep : (*val)->core_paragraph->dependencies) - { - specs.push_back(FullPackageSpec{ - {std::move(dep.name), default_triplet}, - std::move(dep.features), - }); - } + features.insert(features.end(), manifest_feature_it->second.begin(), manifest_feature_it->second.end()); + } + auto core_it = Util::find(features, "core"); + if (core_it == features.end()) + { + if (!Util::Sets::contains(options.switches, OPTION_MANIFEST_NO_DEFAULT_FEATURES)) + features.push_back("default"); } else { - print_error_message(res.error()); - Checks::exit_fail(VCPKG_LINE_INFO); + // remove "core" because resolve_deps_as_top_level uses default-inversion + features.erase(core_it); } + auto specs = resolve_deps_as_top_level(manifest_scf, default_triplet, features, var_provider); - Optional pkgsconfig; - auto it_pkgsconfig = options.settings.find(OPTION_WRITE_PACKAGES_CONFIG); - if (it_pkgsconfig != options.settings.end()) + auto install_plan = Dependencies::create_feature_install_plan(provider, var_provider, specs, {}); + + for (InstallPlanAction& action : install_plan.install_actions) { - pkgsconfig = fs::u8path(it_pkgsconfig->second); + action.build_options = install_plan_options; + action.build_options.use_head_version = Build::UseHeadVersion::NO; + action.build_options.editable = Build::Editable::NO; } + Commands::SetInstalled::perform_and_exit_ex(args, paths, provider, *binaryprovider, var_provider, - specs, - install_plan_options, + std::move(install_plan), dry_run ? Commands::DryRun::Yes : Commands::DryRun::No, pkgsconfig); } @@ -927,6 +980,13 @@ namespace vcpkg::Install Checks::exit_success(VCPKG_LINE_INFO); } + void InstallCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Install::perform_and_exit(args, paths, default_triplet); + } + SpecSummary::SpecSummary(const PackageSpec& spec, const Dependencies::InstallPlanAction* action) : spec(spec), build_result{BuildResult::NULLVALUE, nullptr}, action(action) { diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index f348e32c0fb8ce..79a33a0d7421c9 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -8,6 +6,7 @@ #include #include +#include #include #if defined(_WIN32) @@ -179,11 +178,11 @@ namespace vcpkg::Metrics std::string format_event_data_template() const { - auto props_plus_buildtimes = properties.clone(); + auto props_plus_buildtimes = properties; if (buildtime_names.size() > 0) { - props_plus_buildtimes.insert("buildnames_1", Json::Value::array(buildtime_names.clone())); - props_plus_buildtimes.insert("buildtimes", Json::Value::array(buildtime_times.clone())); + props_plus_buildtimes.insert("buildnames_1", buildtime_names); + props_plus_buildtimes.insert("buildtimes", buildtime_times); } Json::Array arr = Json::Array(); @@ -232,9 +231,9 @@ namespace vcpkg::Metrics base_data.insert("ver", Json::Value::integer(2)); base_data.insert("name", Json::Value::string("commandline_test7")); - base_data.insert("properties", Json::Value::object(std::move(props_plus_buildtimes))); - base_data.insert("measurements", Json::Value::object(measurements.clone())); - base_data.insert("feature-flags", Json::Value::object(feature_flags.clone())); + base_data.insert("properties", std::move(props_plus_buildtimes)); + base_data.insert("measurements", measurements); + base_data.insert("feature-flags", feature_flags); } return Json::stringify(arr, vcpkg::Json::JsonStyle()); diff --git a/toolsrc/src/vcpkg/packagespec.cpp b/toolsrc/src/vcpkg/packagespec.cpp index d4c293b46f5221..0feb8412a418a1 100644 --- a/toolsrc/src/vcpkg/packagespec.cpp +++ b/toolsrc/src/vcpkg/packagespec.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -93,8 +91,6 @@ namespace vcpkg return left.name() == right.name() && left.triplet() == right.triplet(); } - bool operator!=(const PackageSpec& left, const PackageSpec& right) { return !(left == right); } - ExpectedS Features::from_string(const std::string& name) { return parse_qualified_specifier(name).then([&](ParsedQualifiedSpecifier&& pqs) -> ExpectedS { @@ -262,4 +258,15 @@ namespace vcpkg parser.skip_tabs_spaces(); return ret; } + + bool operator==(const Dependency& lhs, const Dependency& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.features != rhs.features) return false; + if (!structurally_equal(lhs.platform, rhs.platform)) return false; + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + bool operator!=(const Dependency& lhs, const Dependency& rhs); } diff --git a/toolsrc/src/vcpkg/paragraphparseresult.cpp b/toolsrc/src/vcpkg/paragraphparseresult.cpp deleted file mode 100644 index 8bd5c0d7ac1068..00000000000000 --- a/toolsrc/src/vcpkg/paragraphparseresult.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pch.h" - -#include - -#include - -namespace vcpkg -{ - const char* ParagraphParseResultCategoryImpl::name() const noexcept { return "ParagraphParseResult"; } - - std::string ParagraphParseResultCategoryImpl::message(int ev) const noexcept - { - switch (static_cast(ev)) - { - case ParagraphParseResult::SUCCESS: return "OK"; - case ParagraphParseResult::EXPECTED_ONE_PARAGRAPH: return "There should be exactly one paragraph"; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - const std::error_category& paragraph_parse_result_category() - { - static ParagraphParseResultCategoryImpl instance; - return instance; - } - - std::error_code make_error_code(ParagraphParseResult e) - { - return std::error_code(static_cast(e), paragraph_parse_result_category()); - } - - ParagraphParseResult to_paragraph_parse_result(int i) { return static_cast(i); } - - ParagraphParseResult to_paragraph_parse_result(std::error_code ec) { return to_paragraph_parse_result(ec.value()); } -} diff --git a/toolsrc/src/vcpkg/paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp index 20a82ee0c09f32..a1d6970630465b 100644 --- a/toolsrc/src/vcpkg/paragraphs.cpp +++ b/toolsrc/src/vcpkg/paragraphs.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,12 +5,139 @@ #include #include -#include +#include #include using namespace vcpkg::Parse; using namespace vcpkg; +namespace vcpkg::Parse +{ + static Optional> remove_field(Paragraph* fields, const std::string& fieldname) + { + auto it = fields->find(fieldname); + if (it == fields->end()) + { + return nullopt; + } + + auto value = std::move(it->second); + fields->erase(it); + return value; + } + + void ParagraphParser::required_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (const auto field = maybe_field.get()) + out = std::move(*field); + else + missing_fields.push_back(fieldname); + } + void ParagraphParser::optional_field(const std::string& fieldname, std::pair out) + { + auto maybe_field = remove_field(&fields, fieldname); + if (auto field = maybe_field.get()) out = std::move(*field); + } + void ParagraphParser::required_field(const std::string& fieldname, std::string& out) + { + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + } + std::string ParagraphParser::optional_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + optional_field(fieldname, {out, ignore}); + return out; + } + std::string ParagraphParser::required_field(const std::string& fieldname) + { + std::string out; + TextRowCol ignore; + required_field(fieldname, {out, ignore}); + return out; + } + + std::unique_ptr ParagraphParser::error_info(const std::string& name) const + { + if (!fields.empty() || !missing_fields.empty()) + { + auto err = std::make_unique(); + err->name = name; + err->extra_fields["CONTROL"] = Util::extract_keys(fields); + err->missing_fields["CONTROL"] = std::move(missing_fields); + err->expected_types = std::move(expected_types); + return err; + } + return nullptr; + } + + template + static Optional> parse_list_until_eof(StringLiteral plural_item_name, Parse::ParserBase& parser, F f) + { + std::vector ret; + parser.skip_whitespace(); + if (parser.at_eof()) return std::vector{}; + do + { + auto item = f(parser); + if (!item) return nullopt; + ret.push_back(std::move(item).value_or_exit(VCPKG_LINE_INFO)); + parser.skip_whitespace(); + if (parser.at_eof()) return {std::move(ret)}; + if (parser.cur() != ',') + { + parser.add_error(Strings::concat("expected ',' or end of text in ", plural_item_name, " list")); + return nullopt; + } + parser.next(); + parser.skip_whitespace(); + } while (true); + } + + ExpectedS> parse_default_features_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("default features", parser, &parse_feature_name); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_qualified_specifier_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof( + "dependencies", parser, [](ParserBase& parser) { return parse_qualified_specifier(parser); }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } + ExpectedS> parse_dependencies_list(const std::string& str, + StringView origin, + TextRowCol textrowcol) + { + auto parser = Parse::ParserBase(str, origin, textrowcol); + auto opt = parse_list_until_eof("dependencies", parser, [](ParserBase& parser) { + auto loc = parser.cur_loc(); + return parse_qualified_specifier(parser).then([&](ParsedQualifiedSpecifier&& pqs) -> Optional { + if (pqs.triplet) + { + parser.add_error("triplet specifier not allowed in this context", loc); + return nullopt; + } + return Dependency{pqs.name, pqs.features.value_or({}), pqs.platform.value_or({})}; + }); + }); + if (!opt) return {parser.get_error()->format(), expected_right_tag}; + + return {std::move(opt).value_or_exit(VCPKG_LINE_INFO), expected_left_tag}; + } +} + namespace vcpkg::Paragraphs { struct PghParser : private Parse::ParserBase @@ -93,7 +218,7 @@ namespace vcpkg::Paragraphs if (auto p = pghs.get()) { - if (p->size() != 1) return std::error_code(ParagraphParseResult::EXPECTED_ONE_PARAGRAPH).message(); + if (p->size() != 1) return {"There should be exactly one paragraph", expected_right_tag}; return std::move(p->front()); } else diff --git a/toolsrc/src/vcpkg/platform-expression.cpp b/toolsrc/src/vcpkg/platform-expression.cpp index fadb548c1802cd..3490dbbe266e4c 100644 --- a/toolsrc/src/vcpkg/platform-expression.cpp +++ b/toolsrc/src/vcpkg/platform-expression.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,6 +5,7 @@ #include +#include #include #include @@ -415,6 +414,28 @@ namespace vcpkg::PlatformExpression return Visitor{context, override_ctxt}.visit(*this->underlying_); } + int Expr::complexity() const + { + if (is_empty()) return 0; + + struct Impl + { + int operator()(const std::unique_ptr& expr) const { return (*this)(*expr); } + int operator()(const detail::ExprImpl& expr) const + { + if (expr.kind == ExprKind::identifier) return 1; + + if (expr.kind == ExprKind::op_not) return 1 + (*this)(expr.exprs.at(0)); + + return 1 + std::accumulate(expr.exprs.begin(), expr.exprs.end(), 0, [](int acc, const auto& el) { + return acc + Impl{}(el); + }); + } + }; + + return Impl{}(underlying_); + } + ExpectedS parse_platform_expression(StringView expression, MultipleBinaryOperators multiple_binary_operators) { auto parser = ExpressionParser(expression, multiple_binary_operators); @@ -429,4 +450,100 @@ namespace vcpkg::PlatformExpression return res; } } + + bool structurally_equal(const Expr& lhs, const Expr& rhs) + { + struct Impl + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const detail::ExprImpl& lhs, const detail::ExprImpl& rhs) const + { + if (lhs.kind != rhs.kind) return false; + + if (lhs.kind == ExprKind::identifier) + { + return lhs.identifier == rhs.identifier; + } + else + { + const auto& exprs_l = lhs.exprs; + const auto& exprs_r = rhs.exprs; + return std::equal(exprs_l.begin(), exprs_l.end(), exprs_r.begin(), exprs_r.end(), *this); + } + } + }; + + if (lhs.is_empty()) + { + return rhs.is_empty(); + } + if (rhs.is_empty()) + { + return false; + } + return Impl{}(lhs.underlying_, rhs.underlying_); + } + + int compare(const Expr& lhs, const Expr& rhs) + { + auto lhs_platform_complexity = lhs.complexity(); + auto rhs_platform_complexity = lhs.complexity(); + + if (lhs_platform_complexity < rhs_platform_complexity) return -1; + if (rhs_platform_complexity < lhs_platform_complexity) return 1; + + auto lhs_platform = to_string(lhs); + auto rhs_platform = to_string(rhs); + + if (lhs_platform.size() < rhs_platform.size()) return -1; + if (rhs_platform.size() < lhs_platform.size()) return 1; + + auto platform_cmp = lhs_platform.compare(rhs_platform); + if (platform_cmp < 0) return -1; + if (platform_cmp > 0) return 1; + + return 0; + } + + std::string to_string(const Expr& expr) + { + struct Impl + { + std::string operator()(const std::unique_ptr& expr) const + { + return (*this)(*expr, false); + } + std::string operator()(const detail::ExprImpl& expr, bool outer) const + { + const char* join = nullptr; + switch (expr.kind) + { + case ExprKind::identifier: return expr.identifier; + case ExprKind::op_and: join = " & "; break; + case ExprKind::op_or: join = " | "; break; + case ExprKind::op_not: return Strings::format("!%s", (*this)(expr.exprs.at(0))); + default: Checks::unreachable(VCPKG_LINE_INFO); + } + + if (outer) + { + return Strings::join(join, expr.exprs, *this); + } + else + { + return Strings::format("(%s)", Strings::join(join, expr.exprs, *this)); + } + } + }; + + if (expr.is_empty()) + { + return std::string{}; + } + return Impl{}(*expr.underlying_, true); + } } diff --git a/toolsrc/src/vcpkg/portfileprovider.cpp b/toolsrc/src/vcpkg/portfileprovider.cpp index 707b763a414ef7..1376ad3bc89b06 100644 --- a/toolsrc/src/vcpkg/portfileprovider.cpp +++ b/toolsrc/src/vcpkg/portfileprovider.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -88,7 +86,7 @@ namespace vcpkg::PortFileProvider { vcpkg::print_error_message(maybe_scf.error()); Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Failed to load port from %s", spec, ports_dir.u8string()); + VCPKG_LINE_INFO, "Error: Failed to load port %s from %s", spec, ports_dir.u8string()); } continue; @@ -130,6 +128,7 @@ namespace vcpkg::PortFileProvider // Reload cache with ports contained in all ports_dirs cache.clear(); std::vector ret; + for (auto&& ports_dir : ports_dirs) { // Try loading individual port diff --git a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp index e9215ed8ccb69e..182625b7834ec1 100644 --- a/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index f70876c2ed7dc3..a384cea0a9450c 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/remove.cpp b/toolsrc/src/vcpkg/remove.cpp index 62e203b432c923..0d5b84280e932b 100644 --- a/toolsrc/src/vcpkg/remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -332,4 +330,11 @@ namespace vcpkg::Remove Checks::exit_success(VCPKG_LINE_INFO); } + + void RemoveCommand::perform_and_exit(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + Triplet default_triplet) const + { + Remove::perform_and_exit(args, paths, default_triplet); + } } diff --git a/toolsrc/src/vcpkg/sourceparagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp index 8c86f167716ba1..a336db7d184b51 100644 --- a/toolsrc/src/vcpkg/sourceparagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -16,6 +14,57 @@ namespace vcpkg { using namespace vcpkg::Parse; + template + static bool paragraph_equal(const Lhs& lhs, const Rhs& rhs) + { + return std::equal( + lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](const std::string& lhs, const std::string& rhs) { + return Strings::trim(StringView(lhs)) == Strings::trim(StringView(rhs)); + }); + } + + bool operator==(const SourceParagraph& lhs, const SourceParagraph& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.version != rhs.version) return false; + if (lhs.port_version != rhs.port_version) return false; + if (!paragraph_equal(lhs.description, rhs.description)) return false; + if (!paragraph_equal(lhs.maintainers, rhs.maintainers)) return false; + if (lhs.homepage != rhs.homepage) return false; + if (lhs.documentation != rhs.documentation) return false; + if (lhs.dependencies != rhs.dependencies) return false; + if (lhs.default_features != rhs.default_features) return false; + if (lhs.license != rhs.license) return false; + + if (lhs.type != rhs.type) return false; + if (!structurally_equal(lhs.supports_expression, rhs.supports_expression)) return false; + + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + + bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs) + { + if (lhs.name != rhs.name) return false; + if (lhs.dependencies != rhs.dependencies) return false; + if (!paragraph_equal(lhs.description, rhs.description)) return false; + if (lhs.extra_info != rhs.extra_info) return false; + + return true; + } + + bool operator==(const SourceControlFile& lhs, const SourceControlFile& rhs) + { + if (*lhs.core_paragraph != *rhs.core_paragraph) return false; + return std::equal(lhs.feature_paragraphs.begin(), + lhs.feature_paragraphs.end(), + rhs.feature_paragraphs.begin(), + rhs.feature_paragraphs.end(), + [](const std::unique_ptr& lhs, + const std::unique_ptr& rhs) { return *lhs == *rhs; }); + } + namespace SourceParagraphFields { static const std::string BUILD_DEPENDS = "Build-Depends"; @@ -197,6 +246,117 @@ namespace vcpkg } } + namespace + { + constexpr static struct Canonicalize + { + struct FeatureLess + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const + { + return lhs.name < rhs.name; + } + }; + struct FeatureEqual + { + bool operator()(const std::unique_ptr& lhs, + const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const FeatureParagraph& lhs, const FeatureParagraph& rhs) const + { + return lhs.name == rhs.name; + } + }; + + // assume canonicalized feature list + struct DependencyLess + { + bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) const + { + return (*this)(*lhs, *rhs); + } + bool operator()(const Dependency& lhs, const Dependency& rhs) const + { + auto cmp = lhs.name.compare(rhs.name); + if (cmp < 0) return true; + if (cmp > 0) return false; + + // same dependency name + + // order by platform string: + auto platform_cmp = compare(lhs.platform, rhs.platform); + if (platform_cmp < 0) return true; + if (platform_cmp > 0) return false; + + // then order by features + // smaller list first, then lexicographical + if (lhs.features.size() < rhs.features.size()) return true; + if (rhs.features.size() < lhs.features.size()) return false; + + // then finally order by feature list + if (std::lexicographical_compare( + lhs.features.begin(), lhs.features.end(), rhs.features.begin(), rhs.features.end())) + { + return true; + } + return false; + } + }; + + template + void operator()(std::unique_ptr& ptr) const + { + (*this)(*ptr); + } + + void operator()(Dependency& dep) const + { + std::sort(dep.features.begin(), dep.features.end()); + dep.extra_info.sort_keys(); + } + void operator()(SourceParagraph& spgh) const + { + std::for_each(spgh.dependencies.begin(), spgh.dependencies.end(), *this); + std::sort(spgh.dependencies.begin(), spgh.dependencies.end(), DependencyLess{}); + + std::sort(spgh.default_features.begin(), spgh.default_features.end()); + + spgh.extra_info.sort_keys(); + } + void operator()(FeatureParagraph& fpgh) const + { + std::for_each(fpgh.dependencies.begin(), fpgh.dependencies.end(), *this); + std::sort(fpgh.dependencies.begin(), fpgh.dependencies.end(), DependencyLess{}); + + fpgh.extra_info.sort_keys(); + } + void operator()(SourceControlFile& scf) const + { + (*this)(*scf.core_paragraph); + std::for_each(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), *this); + std::sort(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureLess{}); + + auto adjacent_equal = + std::adjacent_find(scf.feature_paragraphs.begin(), scf.feature_paragraphs.end(), FeatureEqual{}); + if (adjacent_equal != scf.feature_paragraphs.end()) + { + Checks::exit_with_message(VCPKG_LINE_INFO, + R"(Multiple features with the same name for port %s: %s + This is invalid; please make certain that features have distinct names.)", + scf.core_paragraph->name, + (*adjacent_equal)->name); + } + } + } canonicalize{}; + } + static ParseExpected parse_source_paragraph(const fs::path& path_to_control, Paragraph&& fields) { auto origin = path_to_control.u8string(); @@ -311,6 +471,7 @@ namespace vcpkg return std::move(maybe_feature).error(); } + canonicalize(*control_file); return control_file; } @@ -351,6 +512,21 @@ namespace vcpkg StringView type_name_; }; + struct NaturalNumberField : Json::VisitorCrtpBase + { + using type = int; + StringView type_name() { return "a natural number"; } + + Optional visit_integer(Json::Reader&, StringView, int64_t value) + { + if (value > std::numeric_limits::max() || value < 0) + { + return nullopt; + } + return static_cast(value); + } + }; + struct BooleanField : Json::VisitorCrtpBase { using type = bool; @@ -424,6 +600,12 @@ namespace vcpkg // strings with uppercase letters from the basic check static const std::regex RESERVED = std::regex(R"(prn|aux|nul|con|(lpt|com)[1-9]|core|default)"); + // back-compat + if (sv == "all_modules") + { + return true; + } + if (!std::regex_match(sv.begin(), sv.end(), BASIC_IDENTIFIER)) { return false; // we're not even in the shape of an identifier @@ -651,11 +833,11 @@ namespace vcpkg using type = Dependency; StringView type_name() { return "a dependency"; } - constexpr static StringView NAME = "name"; - constexpr static StringView FEATURES = "features"; - constexpr static StringView DEFAULT_FEATURES = "default-features"; - constexpr static StringView PLATFORM = "platform"; - constexpr static StringView KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral FEATURES = "features"; + constexpr static StringLiteral DEFAULT_FEATURES = "default-features"; + constexpr static StringLiteral PLATFORM = "platform"; + const static StringView KNOWN_FIELDS[4]; // not constexpr in MSVC 2015 Optional visit_string(Json::Reader&, StringView, StringView sv) { @@ -680,6 +862,15 @@ namespace vcpkg } Dependency dep; + + for (const auto& el : obj) + { + if (Strings::starts_with(el.first, "$")) + { + dep.extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } + r.required_object_field(type_name(), obj, NAME, dep.name, PackageNameField{}); r.optional_object_field( obj, FEATURES, dep.features, ArrayField{"an array of identifiers", AllowEmpty::Yes}); @@ -696,20 +887,38 @@ namespace vcpkg return dep; } }; + const StringView DependencyField::KNOWN_FIELDS[] = {NAME, FEATURES, DEFAULT_FEATURES, PLATFORM}; struct FeatureField : Json::VisitorCrtpBase { using type = std::unique_ptr; StringView type_name() { return "a feature"; } - constexpr static StringView NAME = "name"; - constexpr static StringView DESCRIPTION = "description"; - constexpr static StringView DEPENDENCIES = "dependencies"; + constexpr static StringLiteral NAME = "name"; + constexpr static StringLiteral DESCRIPTION = "description"; + constexpr static StringLiteral DEPENDENCIES = "dependencies"; + const static StringView KNOWN_FIELDS[3]; // Not constexpr in MSVC 2015 Optional> visit_object(Json::Reader& r, StringView, const Json::Object& obj) { + { + auto extra_fields = invalid_json_fields(obj, KNOWN_FIELDS); + if (!extra_fields.empty()) + { + r.error().add_extra_fields(type_name().to_string(), std::move(extra_fields)); + } + } + auto feature = std::make_unique(); + for (const auto& el : obj) + { + if (Strings::starts_with(el.first, "$")) + { + feature->extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } + r.required_object_field(type_name(), obj, NAME, feature->name, IdentifierField{}); r.required_object_field(type_name(), obj, DESCRIPTION, feature->description, ParagraphField{}); r.optional_object_field(obj, @@ -720,6 +929,7 @@ namespace vcpkg return std::move(feature); } }; + const StringView FeatureField::KNOWN_FIELDS[] = {NAME, DESCRIPTION, DEPENDENCIES}; Parse::ParseExpected SourceControlFile::parse_manifest_file(const fs::path& path_to_manifest, const Json::Object& manifest) @@ -768,11 +978,21 @@ namespace vcpkg control_file->core_paragraph = std::make_unique(); auto& spgh = control_file->core_paragraph; + spgh->type = Type{Type::PORT}; + + for (const auto& el : manifest) + { + if (Strings::starts_with(el.first, "$")) + { + spgh->extra_info.insert_or_replace(el.first.to_string(), el.second); + } + } constexpr static StringView type_name = "vcpkg.json"; visit.required_object_field(type_name, manifest, ManifestFields::NAME, spgh->name, IdentifierField{}); visit.required_object_field( type_name, manifest, ManifestFields::VERSION, spgh->version, StringField{"a version"}); + visit.optional_object_field(manifest, ManifestFields::PORT_VERSION, spgh->port_version, NaturalNumberField{}); visit.optional_object_field(manifest, ManifestFields::MAINTAINERS, spgh->maintainers, ParagraphField{}); visit.optional_object_field(manifest, ManifestFields::DESCRIPTION, spgh->description, ParagraphField{}); visit.optional_object_field(manifest, ManifestFields::HOMEPAGE, spgh->homepage, StringField{"a url"}); @@ -806,6 +1026,7 @@ namespace vcpkg return std::make_unique(std::move(err.pcei)); } + canonicalize(*control_file); return std::move(control_file); } @@ -845,4 +1066,147 @@ namespace vcpkg } return ret; } + + static Json::Object serialize_manifest_impl(const SourceControlFile& scf, bool debug) + { + auto serialize_paragraph = + [&](Json::Object& obj, StringLiteral name, const std::vector& pgh, bool always = false) { + if (!debug) + { + if (pgh.empty()) + { + if (always) + { + obj.insert(name, Json::Array()); + } + return; + } + if (pgh.size() == 1) + { + obj.insert(name, Json::Value::string(pgh.front())); + return; + } + } + + auto& arr = obj.insert(name, Json::Array()); + for (const auto& s : pgh) + { + arr.push_back(Json::Value::string(s)); + } + }; + auto serialize_optional_array = + [&](Json::Object& obj, StringLiteral name, const std::vector& pgh) { + if (pgh.empty() && !debug) return; + + auto& arr = obj.insert(name, Json::Array()); + for (const auto& s : pgh) + { + arr.push_back(Json::Value::string(s)); + } + }; + auto serialize_optional_string = [&](Json::Object& obj, StringLiteral name, const std::string& s) { + if (!s.empty() || debug) + { + obj.insert(name, Json::Value::string(s)); + } + }; + auto serialize_dependency = [&](Json::Array& arr, const Dependency& dep) { + if (dep.features.empty() && dep.platform.is_empty() && dep.extra_info.is_empty()) + { + arr.push_back(Json::Value::string(dep.name)); + } + else + { + auto& dep_obj = arr.push_back(Json::Object()); + for (const auto& el : dep.extra_info) + { + dep_obj.insert(el.first.to_string(), el.second); + } + + dep_obj.insert(DependencyField::NAME, Json::Value::string(dep.name)); + + auto features_copy = dep.features; + auto core_it = std::find(features_copy.begin(), features_copy.end(), "core"); + if (core_it != features_copy.end()) + { + dep_obj.insert(DependencyField::DEFAULT_FEATURES, Json::Value::boolean(false)); + features_copy.erase(core_it); + } + + serialize_optional_array(dep_obj, DependencyField::FEATURES, features_copy); + serialize_optional_string(dep_obj, DependencyField::PLATFORM, to_string(dep.platform)); + } + }; + + Json::Object obj; + + for (const auto& el : scf.core_paragraph->extra_info) + { + obj.insert(el.first.to_string(), el.second); + } + + obj.insert(ManifestFields::NAME, Json::Value::string(scf.core_paragraph->name)); + obj.insert(ManifestFields::VERSION, Json::Value::string(scf.core_paragraph->version)); + + if (scf.core_paragraph->port_version != 0 || debug) + { + obj.insert(ManifestFields::PORT_VERSION, Json::Value::integer(scf.core_paragraph->port_version)); + } + + serialize_paragraph(obj, ManifestFields::MAINTAINERS, scf.core_paragraph->maintainers); + serialize_paragraph(obj, ManifestFields::DESCRIPTION, scf.core_paragraph->description); + + serialize_optional_string(obj, ManifestFields::HOMEPAGE, scf.core_paragraph->homepage); + serialize_optional_string(obj, ManifestFields::DOCUMENTATION, scf.core_paragraph->documentation); + serialize_optional_string(obj, ManifestFields::LICENSE, scf.core_paragraph->license); + serialize_optional_string(obj, ManifestFields::SUPPORTS, to_string(scf.core_paragraph->supports_expression)); + + if (!scf.core_paragraph->dependencies.empty() || debug) + { + auto& deps = obj.insert(ManifestFields::DEPENDENCIES, Json::Array()); + + for (const auto& dep : scf.core_paragraph->dependencies) + { + serialize_dependency(deps, dep); + } + } + + serialize_optional_array(obj, ManifestFields::DEFAULT_FEATURES, scf.core_paragraph->default_features); + + if (!scf.feature_paragraphs.empty() || debug) + { + auto& arr = obj.insert(ManifestFields::FEATURES, Json::Array()); + for (const auto& feature : scf.feature_paragraphs) + { + auto& feature_obj = arr.push_back(Json::Object()); + for (const auto& el : feature->extra_info) + { + feature_obj.insert(el.first.to_string(), el.second); + } + + feature_obj.insert(FeatureField::NAME, Json::Value::string(feature->name)); + serialize_paragraph(feature_obj, FeatureField::DESCRIPTION, feature->description, true); + + if (!feature->dependencies.empty() || debug) + { + auto& deps = feature_obj.insert(FeatureField::DEPENDENCIES, Json::Array()); + for (const auto& dep : feature->dependencies) + { + serialize_dependency(deps, dep); + } + } + } + } + + if (debug) + { + obj.insert("TYPE", Json::Value::string(Type::to_string(scf.core_paragraph->type))); + } + + return obj; + } + + Json::Object serialize_debug_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, true); } + + Json::Object serialize_manifest(const SourceControlFile& scf) { return serialize_manifest_impl(scf, false); } } diff --git a/toolsrc/src/vcpkg/statusparagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp index 398129a0484a51..ba4b6f9bdb586e 100644 --- a/toolsrc/src/vcpkg/statusparagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/statusparagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp index d282a5ccbea959..ba181522483bbb 100644 --- a/toolsrc/src/vcpkg/statusparagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -1,8 +1,8 @@ -#include "pch.h" - #include +#include #include +#include namespace vcpkg { @@ -145,4 +145,42 @@ namespace vcpkg out_str.push_back('\n'); } } + + Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths) + { + const auto& fs = paths.get_filesystem(); + Json::Object iobj; + iobj.insert("version-string", Json::Value::string(ipv.core->package.version)); + iobj.insert("port-version", Json::Value::integer(ipv.core->package.port_version)); + iobj.insert("triplet", Json::Value::string(ipv.spec().triplet().to_string())); + iobj.insert("abi", Json::Value::string(ipv.core->package.abi)); + Json::Array deps; + for (auto&& dep : ipv.dependencies()) + deps.push_back(Json::Value::string(dep.to_string())); + if (deps.size() != 0) + { + iobj.insert("dependencies", std::move(deps)); + } + Json::Array features; + for (auto&& feature : ipv.features) + { + features.push_back(Json::Value::string(feature->package.feature)); + } + if (features.size() != 0) + { + iobj.insert("features", std::move(features)); + } + auto usage = Install::get_cmake_usage(ipv.core->package, paths); + if (!usage.message.empty()) + { + iobj.insert("usage", Json::Value::string(std::move(usage.message))); + } + auto owns_files = fs.read_lines(paths.listfile_path(ipv.core->package)).value_or_exit(VCPKG_LINE_INFO); + Json::Array owns; + for (auto&& owns_file : owns_files) + owns.push_back(Json::Value::string(std::move(owns_file))); + + iobj.insert("owns", std::move(owns)); + return Json::Value::object(std::move(iobj)); + } } diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 9098cb135fd0cc..1d5a682c6c8f6a 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -83,8 +81,12 @@ namespace vcpkg const bool has_tool_entry = std::regex_search(XML.cbegin(), XML.cend(), match_tool_entry, tool_regex); if (!has_tool_entry) { - return Strings::format( - "Could not find entry for tool %s in %s for os=%s", tool, XML_PATH.u8string(), OS_STRING); + return Strings::format("Could not automatically acquire %s because there is no entry in %s for os=%s. You " + "may be able to install %s via your system package manager.", + tool, + XML_PATH.u8string(), + OS_STRING, + tool); } const std::string tool_data = diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp index f9438c00afe871..c9ae7497042625 100644 --- a/toolsrc/src/vcpkg/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -1,8 +1,7 @@ -#include "pch.h" - #include #include +#include namespace vcpkg { @@ -29,25 +28,9 @@ namespace std namespace vcpkg { - static std::unordered_set g_triplet_instances; - - const Triplet Triplet::X86_WINDOWS = from_canonical_name("x86-windows"); - const Triplet Triplet::X64_WINDOWS = from_canonical_name("x64-windows"); - const Triplet Triplet::ARM_WINDOWS = from_canonical_name("arm-windows"); - const Triplet Triplet::ARM64_WINDOWS = from_canonical_name("arm64-windows"); - const Triplet Triplet::X86_UWP = from_canonical_name("x86-uwp"); - const Triplet Triplet::X64_UWP = from_canonical_name("x64-uwp"); - const Triplet Triplet::ARM_UWP = from_canonical_name("arm-uwp"); - const Triplet Triplet::ARM64_UWP = from_canonical_name("arm64-uwp"); - - // - const Triplet Triplet::ARM_ANDROID = from_canonical_name("arm-android"); - const Triplet Triplet::ARM64_ANDROID = from_canonical_name("arm64-android"); - const Triplet Triplet::X86_ANDROID = from_canonical_name("x86-android"); - const Triplet Triplet::X64_ANDROID = from_canonical_name("x64-android"); - Triplet Triplet::from_canonical_name(std::string&& triplet_as_string) { + static std::unordered_set g_triplet_instances; std::string s(Strings::ascii_to_lowercase(std::move(triplet_as_string))); const auto p = g_triplet_instances.emplace(std::move(s)); return &*p.first; @@ -62,19 +45,19 @@ namespace vcpkg Optional Triplet::guess_architecture() const noexcept { using System::CPUArchitecture; - if (*this == X86_WINDOWS || *this == X86_UWP || *this == X86_ANDROID) + if (Strings::starts_with(this->canonical_name(), "x86-")) { return CPUArchitecture::X86; } - else if (*this == X64_WINDOWS || *this == X64_UWP || *this == X64_ANDROID) + if (Strings::starts_with(this->canonical_name(), "x64-")) { return CPUArchitecture::X64; } - else if (*this == ARM_WINDOWS || *this == ARM_UWP || *this == ARM_ANDROID) + if (Strings::starts_with(this->canonical_name(), "arm-")) { return CPUArchitecture::ARM; } - else if (*this == ARM64_WINDOWS || *this == ARM64_UWP || *this == ARM64_ANDROID) + if (Strings::starts_with(this->canonical_name(), "arm64-")) { return CPUArchitecture::ARM64; } @@ -98,7 +81,7 @@ namespace vcpkg else { #if defined(_WIN32) - return Triplet::X86_WINDOWS; + return Triplet::from_canonical_name("x86-windows"); #elif defined(__APPLE__) return Triplet::from_canonical_name("x64-osx"); #elif defined(__FreeBSD__) diff --git a/toolsrc/src/vcpkg/update.cpp b/toolsrc/src/vcpkg/update.cpp index 3a269ea7aeac29..48471e26c399c4 100644 --- a/toolsrc/src/vcpkg/update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include @@ -87,4 +85,9 @@ namespace vcpkg::Update Checks::exit_success(VCPKG_LINE_INFO); } + + void UpdateCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const + { + Update::perform_and_exit(args, paths); + } } diff --git a/toolsrc/src/vcpkg/userconfig.cpp b/toolsrc/src/vcpkg/userconfig.cpp index 32588b2bbfbc7d..5236a3c3b62c28 100644 --- a/toolsrc/src/vcpkg/userconfig.cpp +++ b/toolsrc/src/vcpkg/userconfig.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 280faae0d80f19..7377baafb33b71 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -1,9 +1,8 @@ -#include "pch.h" - #include #include #include +#include #include #include #include @@ -309,6 +308,7 @@ namespace vcpkg {FEATURE_PACKAGES_SWITCH, &VcpkgCmdArguments::feature_packages}, {BINARY_CACHING_SWITCH, &VcpkgCmdArguments::binary_caching}, {WAIT_FOR_LOCK_SWITCH, &VcpkgCmdArguments::wait_for_lock}, + {JSON_SWITCH, &VcpkgCmdArguments::json}, }; bool found = false; @@ -605,12 +605,13 @@ namespace vcpkg void VcpkgCmdArguments::append_common_options(HelpTableFormatter& table) { static auto opt = [](StringView arg, StringView joiner, StringView value) { - return Strings::format("--%s%s%s", arg, joiner, value); + return Strings::concat("--", arg, joiner, value); }; table.format(opt(TRIPLET_ARG, " ", ""), "Specify the target architecture triplet. See 'vcpkg help triplet'"); table.format("", "(default: " + format_environment_variable("VCPKG_DEFAULT_TRIPLET") + ')'); table.format(opt(OVERLAY_PORTS_ARG, "=", ""), "Specify directories to be used when searching for ports"); + table.format("", "(also: " + format_environment_variable("VCPKG_OVERLAY_PORTS") + ')'); table.format(opt(OVERLAY_TRIPLETS_ARG, "=", ""), "Specify directories containing triplets files"); table.format(opt(BINARY_SOURCES_ARG, "=", ""), "Add sources for binary caching. See 'vcpkg help binarycaching'"); @@ -623,6 +624,7 @@ namespace vcpkg table.format(opt(INSTALL_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the install root directory"); table.format(opt(PACKAGES_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the packages root directory"); table.format(opt(SCRIPTS_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the scripts root directory"); + table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output"); } void VcpkgCmdArguments::imbue_from_environment() @@ -645,6 +647,19 @@ namespace vcpkg } } + { + const auto vcpkg_overlay_ports_env = System::get_environment_variable(OVERLAY_PORTS_ENV); + if (const auto unpacked = vcpkg_overlay_ports_env.get()) + { +#ifdef WIN32 + auto overlays = Strings::split(*unpacked, ';'); +#else + auto overlays = Strings::split(*unpacked, ':'); +#endif + overlay_ports.insert(std::end(overlay_ports), std::begin(overlays), std::end(overlays)); + } + } + if (!vcpkg_root_dir) { const auto vcpkg_root_env = System::get_environment_variable(VCPKG_ROOT_DIR_ENV); diff --git a/toolsrc/src/vcpkg/vcpkglib.cpp b/toolsrc/src/vcpkg/vcpkglib.cpp index ce9c6273418867..a158cf74ba5349 100644 --- a/toolsrc/src/vcpkg/vcpkglib.cpp +++ b/toolsrc/src/vcpkg/vcpkglib.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -174,7 +172,6 @@ namespace vcpkg { std::map ipv_map; - std::vector installed_packages; for (auto&& pgh : status_db) { if (!pgh->is_installed()) continue; diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index 4837c4b713083e..4f7ef7141e4551 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include #include @@ -7,11 +5,14 @@ #include #include +#include #include #include #include #include #include +#include +#include #include #include @@ -165,7 +166,7 @@ namespace vcpkg else { // we ignore the manifest root dir if the user requests -manifest - if (!manifest_root_dir.empty() && !args.manifest_mode.has_value()) + if (!manifest_root_dir.empty() && !args.manifest_mode.has_value() && !args.output_json()) { System::print2(System::Color::warning, "Warning: manifest-root detected at ", diff --git a/toolsrc/src/vcpkg/versiont.cpp b/toolsrc/src/vcpkg/versiont.cpp index b3e5b2590fea6b..c419745c2837f1 100644 --- a/toolsrc/src/vcpkg/versiont.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #include #include diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index a9a5d5565fed2e..023844d0b91dd0 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -1,5 +1,3 @@ -#include "pch.h" - #if defined(_WIN32) #include diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln deleted file mode 100644 index 7f51e701fad235..00000000000000 --- a/toolsrc/vcpkg.sln +++ /dev/null @@ -1,105 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgtest", "vcpkgtest\vcpkgtest.vcxproj", "{F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F5893B21-EA71-4432-84D6-5FB0E0461A2A}" - ProjectSection(SolutionItems) = preProject - ..\scripts\bootstrap.ps1 = ..\scripts\bootstrap.ps1 - ..\scripts\get_triplet_environment.cmake = ..\scripts\get_triplet_environment.cmake - ..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1 - ..\scripts\ports.cmake = ..\scripts\ports.cmake - ..\scripts\vcpkgTools.xml = ..\scripts\vcpkgTools.xml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}" - ProjectSection(SolutionItems) = preProject - ..\scripts\cmake\vcpkg_acquire_msys.cmake = ..\scripts\cmake\vcpkg_acquire_msys.cmake - ..\scripts\cmake\vcpkg_apply_patches.cmake = ..\scripts\cmake\vcpkg_apply_patches.cmake - ..\scripts\cmake\vcpkg_build_cmake.cmake = ..\scripts\cmake\vcpkg_build_cmake.cmake - ..\scripts\cmake\vcpkg_build_msbuild.cmake = ..\scripts\cmake\vcpkg_build_msbuild.cmake - ..\scripts\cmake\vcpkg_build_qmake.cmake = ..\scripts\cmake\vcpkg_build_qmake.cmake - ..\scripts\cmake\vcpkg_common_functions.cmake = ..\scripts\cmake\vcpkg_common_functions.cmake - ..\scripts\cmake\vcpkg_configure_cmake.cmake = ..\scripts\cmake\vcpkg_configure_cmake.cmake - ..\scripts\cmake\vcpkg_configure_meson.cmake = ..\scripts\cmake\vcpkg_configure_meson.cmake - ..\scripts\cmake\vcpkg_configure_qmake.cmake = ..\scripts\cmake\vcpkg_configure_qmake.cmake - ..\scripts\cmake\vcpkg_copy_pdbs.cmake = ..\scripts\cmake\vcpkg_copy_pdbs.cmake - ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake = ..\scripts\cmake\vcpkg_copy_tool_dependencies.cmake - ..\scripts\cmake\vcpkg_download_distfile.cmake = ..\scripts\cmake\vcpkg_download_distfile.cmake - ..\scripts\cmake\vcpkg_execute_required_process.cmake = ..\scripts\cmake\vcpkg_execute_required_process.cmake - ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake = ..\scripts\cmake\vcpkg_execute_required_process_repeat.cmake - ..\scripts\cmake\vcpkg_extract_source_archive.cmake = ..\scripts\cmake\vcpkg_extract_source_archive.cmake - ..\scripts\cmake\vcpkg_find_acquire_program.cmake = ..\scripts\cmake\vcpkg_find_acquire_program.cmake - ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake = ..\scripts\cmake\vcpkg_fixup_cmake_targets.cmake - ..\scripts\cmake\vcpkg_from_bitbucket.cmake = ..\scripts\cmake\vcpkg_from_bitbucket.cmake - ..\scripts\cmake\vcpkg_from_github.cmake = ..\scripts\cmake\vcpkg_from_github.cmake - ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake = ..\scripts\cmake\vcpkg_get_program_files_platform_bitness.cmake - ..\scripts\cmake\vcpkg_get_windows_sdk.cmake = ..\scripts\cmake\vcpkg_get_windows_sdk.cmake - ..\scripts\cmake\vcpkg_install_cmake.cmake = ..\scripts\cmake\vcpkg_install_cmake.cmake - ..\scripts\cmake\vcpkg_install_meson.cmake = ..\scripts\cmake\vcpkg_install_meson.cmake - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BCE555DF-F471-4ACC-98E5-76CBE8E8F79E}" - ProjectSection(SolutionItems) = preProject - vcpkg.natvis = vcpkg.natvis - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.ActiveCfg = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.Build.0 = Debug|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.ActiveCfg = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.Build.0 = Debug|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.ActiveCfg = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 - {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.Build.0 = Debug|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.ActiveCfg = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 - {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.Build.0 = Debug|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.ActiveCfg = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.Build.0 = Release|x64 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.ActiveCfg = Release|Win32 - {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.Build.0 = Release|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.ActiveCfg = Debug|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x64.Build.0 = Debug|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.ActiveCfg = Debug|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Debug|x86.Build.0 = Debug|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.ActiveCfg = Release|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x64.Build.0 = Release|x64 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.ActiveCfg = Release|Win32 - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {A0122231-04D5-420B-81CA-7960946E5E65} = {F5893B21-EA71-4432-84D6-5FB0E0461A2A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {DEDCC7AF-0FE6-4387-9FFE-495D6C1AEE1B} - EndGlobalSection -EndGlobal diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj deleted file mode 100644 index b955e435783794..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ /dev/null @@ -1,301 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {B98C92B7-2874-4537-9D46-D14E5C237F04} - vcpkglib - 8.1 - v140 - - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - StaticLibrary - true - MultiByte - - - StaticLibrary - false - true - MultiByte - - - 0 - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - - Level4 - Disabled - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - false - - - - - Level4 - Disabled - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - false - - - - - Level3 - MaxSpeed - true - true - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - ..\include - VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) - /std:c++latest %(AdditionalOptions) - true - Use - pch.h - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters deleted file mode 100644 index 5c5beb540527a4..00000000000000 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ /dev/null @@ -1,462 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {69f6b6e6-5ac4-4419-a256-b8a6b0392720} - - - {4a229410-0d09-4dab-953b-f434d6483f96} - - - {75592043-ab63-4905-beee-568a6ab8bf93} - - - {fa1f10e7-58d2-4f7c-ac26-a979baa70061} - - - - - Source Files - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg - - - Source Files\vcpkg\base - - - Source Files\vcpkg\base - - - - - Header Files - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg - - - Header Files\vcpkg\base - - - Header Files\vcpkg\base - - - diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj deleted file mode 100644 index 07e10e1a431b56..00000000000000 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - {b98c92b7-2874-4537-9d46-d14e5c237f04} - - - - - - - - - {F27B8DB0-1279-4AF8-A2E3-1D49C4F0220D} - Win32Proj - vcpkgtest - 8.1 - v140 - - - - Application - true - Unicode - false - - - Application - false - true - Unicode - false - - - Application - true - Unicode - false - - - Application - false - true - Unicode - false - - - - - - - - - $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x86.debug\ - - - $(SolutionDir)msbuild.x86.release\ - $(SolutionDir)msbuild.x86.release\$(ProjectName)\ - - - $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ - $(SolutionDir)msbuild.x64.debug\ - - - $(SolutionDir)msbuild.x64.release\$(ProjectName)\ - $(SolutionDir)msbuild.x64.release\ - - - true - - - true - - - - - - Level4 - Disabled - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level4 - Disabled - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - _DEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - true - true - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) - NDEBUG;%(PreprocessorDefinitions) - true - /std:c++latest %(AdditionalOptions) - true - false - - - Console - true - true - $(VCInstallDir)UnitTest\lib;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Bcrypt.lib;%(AdditionalDependencies) - - - - - - diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters deleted file mode 100644 index 481fe3b6e79ba5..00000000000000 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters +++ /dev/null @@ -1,69 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/toolsrc/dirs.proj b/toolsrc/windows-bootstrap/dirs.proj similarity index 100% rename from toolsrc/dirs.proj rename to toolsrc/windows-bootstrap/dirs.proj diff --git a/toolsrc/windows-bootstrap/vcpkg.sln b/toolsrc/windows-bootstrap/vcpkg.sln new file mode 100644 index 00000000000000..51dc3649eb5cbd --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkg.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30330.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkg", "vcpkg\vcpkg.vcxproj", "{34671B80-54F9-46F5-8310-AC429C11D4FB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkglib", "vcpkglib\vcpkglib.vcxproj", "{B98C92B7-2874-4537-9D46-D14E5C237F04}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcpkgmetricsuploader", "vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj", "{7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E4FAF582-0DB7-4CF5-BAE0-E2D38C48593B}" + ProjectSection(SolutionItems) = preProject + ..\vcpkg.natvis = ..\vcpkg.natvis + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.ActiveCfg = Debug|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x64.Build.0 = Debug|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.ActiveCfg = Debug|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Debug|x86.Build.0 = Debug|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.ActiveCfg = Release|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x64.Build.0 = Release|x64 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.ActiveCfg = Release|Win32 + {34671B80-54F9-46F5-8310-AC429C11D4FB}.Release|x86.Build.0 = Release|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.ActiveCfg = Debug|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x64.Build.0 = Debug|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.ActiveCfg = Debug|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Debug|x86.Build.0 = Debug|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.ActiveCfg = Release|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x64.Build.0 = Release|x64 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.ActiveCfg = Release|Win32 + {B98C92B7-2874-4537-9D46-D14E5C237F04}.Release|x86.Build.0 = Release|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.ActiveCfg = Debug|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x64.Build.0 = Debug|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.ActiveCfg = Debug|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Debug|x86.Build.0 = Debug|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.ActiveCfg = Release|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x64.Build.0 = Release|x64 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.ActiveCfg = Release|Win32 + {7D6FDEEB-B299-4A23-85EE-F67C4DED47BE}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {030760DE-1214-461B-B241-39608AD6FB66} + EndGlobalSection +EndGlobal diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj similarity index 92% rename from toolsrc/vcpkg/vcpkg.vcxproj rename to toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj index 917cd3b9c86123..b6229d9a3fb115 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -139,10 +139,10 @@ - + - + diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters similarity index 88% rename from toolsrc/vcpkg/vcpkg.vcxproj.filters rename to toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters index 3821d89b399d94..3710939ca920b3 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj.filters +++ b/toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters @@ -15,12 +15,12 @@ - + Source Files - + Source Files diff --git a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj new file mode 100644 index 00000000000000..909f6e87064083 --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj @@ -0,0 +1,331 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {B98C92B7-2874-4537-9D46-D14E5C237F04} + vcpkglib + 8.1 + v140 + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + 0 + + + + + + + + + $(SolutionDir)msbuild.x86.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x86.debug\ + + + $(SolutionDir)msbuild.x86.release\ + $(SolutionDir)msbuild.x86.release\$(ProjectName)\ + + + $(SolutionDir)msbuild.x64.debug\$(ProjectName)\ + $(SolutionDir)msbuild.x64.debug\ + + + $(SolutionDir)msbuild.x64.release\$(ProjectName)\ + $(SolutionDir)msbuild.x64.release\ + + + + Level4 + Disabled + true + ..\..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + pch.h + false + + + + + Level4 + Disabled + true + ..\..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + pch.h + false + + + + + Level3 + MaxSpeed + true + true + true + ..\..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + pch.h + + + true + true + + + + + Level3 + MaxSpeed + true + true + true + ..\..\include + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + /std:c++latest %(AdditionalOptions) + true + Use + pch.h + pch.h + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters new file mode 100644 index 00000000000000..f1772fa5f8ceb6 --- /dev/null +++ b/toolsrc/windows-bootstrap/vcpkglib/vcpkglib.vcxproj.filters @@ -0,0 +1,540 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {69f6b6e6-5ac4-4419-a256-b8a6b0392720} + + + {4a229410-0d09-4dab-953b-f434d6483f96} + + + {75592043-ab63-4905-beee-568a6ab8bf93} + + + {fa1f10e7-58d2-4f7c-ac26-a979baa70061} + + + + + Source Files + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + + + Header Files + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg\base + + + Header Files\vcpkg\base + + + diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj similarity index 93% rename from toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj rename to toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 9e2e8c08ac122e..027ef1917b50fe 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -74,7 +74,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -88,7 +88,7 @@ Level4 Disabled true - ..\include + ..\..\include /std:c++latest %(AdditionalOptions) true false @@ -104,7 +104,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -122,7 +122,7 @@ true true true - ..\include + ..\..\include _MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true @@ -134,7 +134,7 @@ - + diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters similarity index 90% rename from toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters rename to toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters index ad56c0c7214e35..d103d50c26ed8b 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters +++ b/toolsrc/windows-bootstrap/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files diff --git a/triplets/community/arm64-osx.cmake b/triplets/community/arm64-osx.cmake index 44c0b2852af1e1..62325a696759f3 100644 --- a/triplets/community/arm64-osx.cmake +++ b/triplets/community/arm64-osx.cmake @@ -3,3 +3,4 @@ set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) diff --git a/triplets/community/s390x-linux.cmake b/triplets/community/s390x-linux.cmake new file mode 100644 index 00000000000000..0aaefda4e34d16 --- /dev/null +++ b/triplets/community/s390x-linux.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE s390x) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Linux) From ea07bb965ef239c3a5644798053371df992d9638 Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 20 Aug 2020 16:33:24 +0200 Subject: [PATCH 11/95] final fixes for static build + improving out messages --- ports/tensorflow-cc/portfile.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8dc269f93c0299..306be50cc7aefd 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -70,7 +70,7 @@ if(CMAKE_HOST_WIN32) endif() # tensorflow has long file names, which will not work on windows -set(ENV{TEST_TMPDIR} ${CURRENT_BUILDTREES_DIR}/../.bzl) +set(ENV{TEST_TMPDIR} ${BUILDTREES_DIR}/.bzl) set(ENV{USE_DEFAULT_PYTHON_LIB_PATH} 1) set(ENV{TF_NEED_KAFKA} 0) @@ -131,7 +131,7 @@ foreach(BUILD_TYPE dbg rel) message(STATUS "Warning: Building TensorFlow can take an hour or more.") if(BUILD_TYPE STREQUAL dbg) if(CMAKE_HOST_WIN32) - set(BUILD_OPTS "--compilation_mode=fastbuild") # link with /DEBUG:FASTBUILD instead of /DEBUG:FULL to avoid .pdb >4GB error + set(BUILD_OPTS "--compilation_mode=dbg --features=fastbuild") # link with /DEBUG:FASTLINK instead of /DEBUG:FULL to avoid .pdb >4GB error else() set(BUILD_OPTS "--compilation_mode=dbg") endif() @@ -153,7 +153,7 @@ foreach(BUILD_TYPE dbg rel) set(CRT_OPT "-MT") endif() vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt=${CRT_OPT} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --copt=${CRT_OPT} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -182,7 +182,7 @@ foreach(BUILD_TYPE dbg rel) ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -211,7 +211,7 @@ foreach(BUILD_TYPE dbg rel) ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -247,7 +247,7 @@ foreach(BUILD_TYPE dbg rel) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) if(BUILD_TYPE STREQUAL dbg) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.pdb DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) - message(STATUS "Warning: debug information tensorflow_cc.pdb will be of limited use because only reduced set could be produced due to 4GB internal pdb limit") + message(STATUS "Warning: debug information tensorflow_cc.pdb will be of limited use because only a reduced set could be produced due to the 4GB internal PDB file limit even on x64.") endif() else() file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) @@ -303,4 +303,4 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAG file(COPY ${CMAKE_CURRENT_LIST_DIR}/TensorflowCCConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/TensorflowCCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) -message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${CURRENT_BUILDTREES_DIR}/../.bzl to free diskspace.") +message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${BUILDTREES_DIR}/.bzl to free diskspace.") From a12d22f2a7ccd2965315169c865832d15957e3c3 Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 20 Aug 2020 16:36:19 +0200 Subject: [PATCH 12/95] enabling linux and osx in CI to see if it works now --- scripts/ci.baseline.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 12e226ef60ccbc..824a305e98aae0 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1710,8 +1710,6 @@ teemo:x64-osx=fail telnetpp:arm-uwp=fail telnetpp:x64-uwp=fail tensorflow-cc:arm64-windows=fail -tensorflow-cc:x64-linux=skip -tensorflow-cc:x64-osx=skip tensorflow-cc:x86-windows=fail tesseract:x64-windows=fail tesseract:x64-windows-static=fail From 6e31cd616d3e4197eed6ebd6db9add40aaec3cc4 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 21 Aug 2020 15:50:26 +0200 Subject: [PATCH 13/95] simplified code, fixed version numbers, fixed generated include cmake file --- ports/tensorflow-cc/TensorflowCCConfig.cmake | 90 -------------- ports/tensorflow-cc/portfile.cmake | 112 ++++++++++++------ .../tensorflow-cc-config-windows-dll.cmake | 10 ++ .../tensorflow-cc-config-windows-lib.cmake | 10 ++ .../tensorflow-cc-config.cmake.in | 16 +++ 5 files changed, 111 insertions(+), 127 deletions(-) delete mode 100644 ports/tensorflow-cc/TensorflowCCConfig.cmake create mode 100644 ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake create mode 100644 ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake create mode 100644 ports/tensorflow-cc/tensorflow-cc-config.cmake.in diff --git a/ports/tensorflow-cc/TensorflowCCConfig.cmake b/ports/tensorflow-cc/TensorflowCCConfig.cmake deleted file mode 100644 index d86f82c6d0a7e8..00000000000000 --- a/ports/tensorflow-cc/TensorflowCCConfig.cmake +++ /dev/null @@ -1,90 +0,0 @@ -set(tensorflow_cc_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../include") - -message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") -set(tensorflow_cc_INCLUDE_DIRS - ${tensorflow_cc_INCLUDE_DIR} - ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/ - ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/tensorflow/ - ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/external/com_google_absl - ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/bazel-out/k8-opt/bin/ - ${tensorflow_cc_INCLUDE_DIR}/tensorflow-external/external/protobuf_archive/src/ -) - -if(CMAKE_HOST_WIN32) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../bin/tensorflow.dll - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - else() - add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/tensorflow.lib - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - endif() - set(tensorflow_cc_FOUND TRUE) -elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.1.14.0.dylib - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.1.14.0.dylib - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - else() - add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.1.14.0.a - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - add_library(tensorflow_cc::tensorflow_framework STATIC IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.1.14.0.a - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - endif() - set(tensorflow_cc_FOUND TRUE) - set(tensorflow_framework_FOUND TRUE) -else() - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.so.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.so.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - else() - add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow.a.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - add_library(tensorflow_cc::tensorflow_framework STATIC IMPORTED) - set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../../lib/libtensorflow_framework.a.1.14.0 - INTERFACE_INCLUDE_DIRECTORIES "${tensorflow_cc_INCLUDE_DIRS}" - ) - endif() - set(tensorflow_cc_FOUND TRUE) - set(tensorflow_framework_FOUND TRUE) -endif() diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 306be50cc7aefd..8b67a48bc3d8d4 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -4,34 +4,23 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) message(FATAL_ERROR "TensorFlow does not support 32bit systems.") endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO tensorflow/tensorflow - REF v2.3.0 - SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac - HEAD_REF master - PATCHES - file-exists.patch # required or otherwise it cant find python lib path on windows - fix-build-error.patch # Fix namespace error - fix-dbg-build-errors.patch # Fix no return statement - fix-more-build-errors.patch # Fix no return statement - ) -else() - vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO tensorflow/tensorflow - REF v2.3.0 - SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac - HEAD_REF master - PATCHES - file-exists.patch # required or otherwise it cant find python lib path on windows - fix-build-error.patch # Fix namespace error - fix-dbg-build-errors.patch # Fix no return statement - fix-more-build-errors.patch # Fix no return statement - change-macros-for-static-lib.patch # there is no static build option - change macros via patch and link library manually at the end - ) +set(STATIC_ONLY_PATCHES "") +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end endif() +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tensorflow/tensorflow + REF v2.3.0 + SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac + HEAD_REF master + PATCHES + file-exists.patch # required or otherwise it cant find python lib path on windows + fix-build-error.patch # Fix namespace error + fix-dbg-build-errors.patch # Fix no return statement + fix-more-build-errors.patch # Fix no return statement + ${STATIC_ONLY_PATCHES} +) vcpkg_find_acquire_program(BAZEL) get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) @@ -251,10 +240,12 @@ foreach(BUILD_TYPE dbg rel) endif() else() file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(TF_LIB_SUFFIXES "") # library might have been split because no more than 4GB are supported even on x64 Windows foreach(PART_NO RANGE 2 100) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + list(APPEND TF_LIB_SUFFIXES "-part${PART_NO}") else() if(BUILD_TYPE STREQUAL dbg) break() @@ -274,23 +265,40 @@ foreach(BUILD_TYPE dbg rel) endif() elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.1.14.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.1.14.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.2.3.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.2.3.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(TF_LIB_NAME libtensorflow_cc.2.3.0.dylib) + set(TF_FRAMEWORK_NAME libtensorflow_framework.2.3.0.dylib) else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.1.14.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.1.14.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.2.3.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.2.3.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(TF_LIB_NAME libtensorflow_cc.2.3.0.a) + set(TF_FRAMEWORK_NAME libtensorflow_framework.2.3.0.dylib) endif() else() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.so.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.so.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.so.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(TF_LIB_NAME libtensorflow_cc.so.2.3.0) + set(TF_FRAMEWORK_NAME libtensorflow_framework.so.2.3.0) else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.a.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.a.1.14.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.a.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.a.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(TF_LIB_NAME libtensorflow_cc.a.2.3.0) + set(TF_FRAMEWORK_NAME libtensorflow_framework.so.2.3.0) endif() endif() endforeach() +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/kernels.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/ops.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -300,7 +308,37 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/TensorflowCCConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/TensorflowCCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) +if(CMAKE_HOST_WIN32) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-dll.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + else() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-lib.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + set(ALL_PARTS "tensorflow_cc::tensorflow_cc-part1") + foreach(part ${TF_LIB_SUFFIXES}) + file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\ +add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\ +set_target_properties(tensorflow_cc::tensorflow_cc${part}\ + PROPERTIES\ + IMPORTED_LOCATION \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\ + INTERFACE_INCLUDE_DIRECTORIES \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external\"\ +)\ +") + list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") + endforeach() + file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\ +add_library(tensorflow_cc::tensorflow_cc INTERFACE IMPORTED)\ +set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\ +") + endif() +else() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(TF_LINKAGE_TYPE SHARED) + else() + set(TF_LINKAGE_TYPE STATIC) + endif() + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) +endif() message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${BUILDTREES_DIR}/.bzl to free diskspace.") diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake new file mode 100644 index 00000000000000..113fac28e54907 --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake @@ -0,0 +1,10 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/bin/tensorflow.dll" + IMPORTED_IMPLIB "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/bin/tensorflow.lib" + INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" +) +set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake new file mode 100644 index 00000000000000..467142e570bc4d --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake @@ -0,0 +1,10 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +set(tensorflow_cc_FOUND TRUE) + +add_library(tensorflow_cc::tensorflow_cc-part1 STATIC IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_cc-part1 + PROPERTIES + IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow.lib" + INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" +) diff --git a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in new file mode 100644 index 00000000000000..02a9f44425fa8f --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in @@ -0,0 +1,16 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow_cc::tensorflow_cc ${TF_LINKAGE_TYPE} IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" +) +add_library(tensorflow_cc::tensorflow_framework ${TF_LINKAGE_TYPE} IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" +) +set(tensorflow_cc_FOUND TRUE) +set(tensorflow_framework_FOUND TRUE) From afc7f1ec8fa08a26f6541d614ae66661c64c2a96 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 21 Aug 2020 16:22:09 +0200 Subject: [PATCH 14/95] fix failing postbuild check on handcrafted empty dummy library by spreading the last real libraries contents over the required number of libraries --- .../convert_lib_params_windows.py | 24 ++++++++++++++++++- ports/tensorflow-cc/portfile.cmake | 18 ++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py index 6b7fd828f395aa..95b7fea783c2c8 100644 --- a/ports/tensorflow-cc/convert_lib_params_windows.py +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -1,9 +1,12 @@ import os +import sys +required_number = int(sys.argv[1]) + +file_no = 1 with open("tensorflow_cc.dll-2.params", "r") as f_in: lib_name = None acc_size = 0 - file_no = 1 f_out = open("tensorflow_cc.lib-2.params", "w") for line in f_in: if line.startswith("/OUT:"): @@ -23,3 +26,22 @@ acc_size += size f_out.write(line) f_out.close() + +if file_no < required_number: # vcpkg requires the same number of libs for release build + missing = required_number - file_no + lines = None + with open("tensorflow_cc.lib-2.params-part%d" % file_no, "r") as f_in: + lines = f_in.readlines() + if len(lines) < missing + 2: # last lib to small, also use the one before + lines = lines[1:] + file_no -= 1 + missing += 1 + with open("tensorflow_cc.lib-2.params-part%d" % file_no, "r") as f_in: + lines = f_in.readlines() + lines + assert len(lines) >= missing + 2 + with open("tensorflow_cc.lib-2.params-part%d" % file_no, "w") as f_out: + f_out.writelines(lines[:-missing]) + for i in range(missing): + with open("tensorflow_cc.lib-2.params-part%d" % (file_no + i + 1), "w") as f_out: + f_out.writeline(lines[0]) + f_out.writeline(lines[-(missing - i)]) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 8b67a48bc3d8d4..23f1c6630ca4ad 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -89,6 +89,7 @@ file(GLOB SOURCES ${SOURCE_PATH}/*) vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-${TARGET_TRIPLET}) +set(N_DBG_LIB_PARTS 0) foreach(BUILD_TYPE dbg rel) message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) @@ -147,7 +148,7 @@ foreach(BUILD_TYPE dbg rel) LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" "${N_DBG_LIB_PARTS}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -245,21 +246,10 @@ foreach(BUILD_TYPE dbg rel) foreach(PART_NO RANGE 2 100) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + set(N_DBG_LIB_PARTS ${PART_NO}) list(APPEND TF_LIB_SUFFIXES "-part${PART_NO}") else() - if(BUILD_TYPE STREQUAL dbg) - break() - else() - # vcpkg postbuild checks require the same number of libs for debug and release => copy dummy libs in release case - # dummy libs must be empty so that no symbol redefinition conflicts occur - # empty handcrafted_dummy.lib built using reverse-engineered .lib format using ArHandler.cpp from 7zip sources - if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/tensorflow_cc-part${PART_NO}.lib) - # misuse configure_file to achieve atomic copy+rename to avoid anti-malware scanners blocking file after copy and making rename fail - configure_file(${CMAKE_CURRENT_LIST_DIR}/handcrafted_dummy.lib ${CURRENT_PACKAGES_DIR}/lib/tensorflow_cc-part${PART_NO}.lib COPYONLY) - else() - break() - endif() - endif() + break() endif() endforeach() endif() From 898bbbe7b884f78ab5954856a67c4a2bbdd588c1 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 21 Aug 2020 16:23:07 +0200 Subject: [PATCH 15/95] remove dead code commit by mistake again --- ports/tensorflow-cc/portfile.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 23f1c6630ca4ad..3c0d12c31d712a 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -280,15 +280,6 @@ foreach(BUILD_TYPE dbg rel) endif() endforeach() -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/kernels.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -#file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/ops.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) From 350b151b53852861f301759633d2891b498af559 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 21 Aug 2020 23:33:48 +0200 Subject: [PATCH 16/95] improvements from code review --- ports/tensorflow-cc/handcrafted_dummy.lib | Bin 260 -> 0 bytes ports/tensorflow-cc/portfile.cmake | 41 +++++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 ports/tensorflow-cc/handcrafted_dummy.lib diff --git a/ports/tensorflow-cc/handcrafted_dummy.lib b/ports/tensorflow-cc/handcrafted_dummy.lib deleted file mode 100644 index 5d4d05f76c6783cd5d6e0c464786d66629e2f7e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmY$iNi0gvu;bEKKm~@TmgWX#CZ>kQsNx1tt_fT?fr|kMNY!tFrXOqunjwVT0CS6i OLIRgQf&(_06ukgYL?rhB diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 3c0d12c31d712a..1532d6d7d64e51 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -27,20 +27,27 @@ get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) set(ENV{BAZEL_BIN_PATH} "${BAZEL}") -if(CMAKE_HOST_WIN32) - # vcpkg_find_acquire_program not suitable on Windows because it only installs python embedded, but we need full python - find_package(Python3 COMPONENTS Interpreter) - if(NOT Python3_Interpreter_FOUND) - message(FATAL_ERROR "Python3 not found. Please install and add to PATH.") - endif() +find_package(Python3 COMPONENTS Interpreter) +if(Python3_Interpreter_FOUND) set(PYTHON3 "${Python3_EXECUTABLE}") else() vcpkg_find_acquire_program(PYTHON3) endif() + get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") +find_package(Python3 COMPONENTS Interpreter NumPy) +if(NOT Python3_NumPy_FOUND) + set(PIP3 "${PYTHON3_DIR}/pip3") + vcpkg_execute_required_process(COMMAND ${PIP3} install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) + find_package(Python3 COMPONENTS NumPy) + if(NOT Python3_NumPy_FOUND) + message(FATAL_ERROR "Failed to install NumPy.") + endif() +endif() + function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) if(EXISTS "${PATH_TO_REMOVE}") @@ -51,7 +58,7 @@ endfunction() if(CMAKE_HOST_WIN32) vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) - vcpkg_add_to_path(PREPEND ${MSYS_ROOT}/usr/bin) + vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) @@ -87,8 +94,6 @@ set(ENV{TF_CONFIGURE_IOS} 0) file(GLOB SOURCES ${SOURCE_PATH}/*) -vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-${TARGET_TRIPLET}) - set(N_DBG_LIB_PARTS 0) foreach(BUILD_TYPE dbg rel) message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") @@ -120,7 +125,7 @@ foreach(BUILD_TYPE dbg rel) message(STATUS "Warning: Building TensorFlow can take an hour or more.") if(BUILD_TYPE STREQUAL dbg) - if(CMAKE_HOST_WIN32) + if(VCPKG_TARGET_IS_WINDOWS) set(BUILD_OPTS "--compilation_mode=dbg --features=fastbuild") # link with /DEBUG:FASTLINK instead of /DEBUG:FULL to avoid .pdb >4GB error else() set(BUILD_OPTS "--compilation_mode=dbg") @@ -129,7 +134,7 @@ foreach(BUILD_TYPE dbg rel) set(BUILD_OPTS "--compilation_mode=opt") endif() - if(CMAKE_HOST_WIN32) + if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" @@ -137,10 +142,12 @@ foreach(BUILD_TYPE dbg rel) LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() - if(BUILD_TYPE STREQUAL dbg) - set(CRT_OPT "-MTd") - else() - set(CRT_OPT "-MT") + if(VCPKG_CRT_LINKAGE STREQUAL static) + if(BUILD_TYPE STREQUAL dbg) + set(CRT_OPT "-MTd") + else() + set(CRT_OPT "-MT") + endif() endif() vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --copt=${CRT_OPT} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" @@ -229,7 +236,7 @@ foreach(BUILD_TYPE dbg rel) set(DIR_PREFIX "") endif() - if(CMAKE_HOST_WIN32) + if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.dll DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) # rename before copy because after copy the file might be locked by anti-malware scanners for some time so that renaming fails @@ -289,7 +296,7 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) -if(CMAKE_HOST_WIN32) +if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-dll.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) From 630e890c2ddc9177709c56b8b66cf536e823bc6f Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 22 Aug 2020 01:03:58 +0200 Subject: [PATCH 17/95] cleaner fix for debug code --- ports/tensorflow-cc/fix-dbg-build-errors.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/fix-dbg-build-errors.patch b/ports/tensorflow-cc/fix-dbg-build-errors.patch index ee2f9bad2afa79..b5f1bcc1eba448 100644 --- a/ports/tensorflow-cc/fix-dbg-build-errors.patch +++ b/ports/tensorflow-cc/fix-dbg-build-errors.patch @@ -17,7 +17,7 @@ diff --git a/tensorflow/core/framework/device_base.cc b/tensorflow/core/framewor const DeviceAttributes& DeviceBase::attributes() const { LOG(FATAL) << "Device does not implement attributes()"; -+ return *((DeviceAttributes*)this); // nonsense that will crash if ever invoked -- just to make it compile ++ std::abort(); } const string& DeviceBase::name() const { From 2c66c4badb6138ce81041a9d973affa5a57c6a30 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 22 Aug 2020 22:28:51 +0200 Subject: [PATCH 18/95] find pip3 in PATH (PYTHON3_DIR apparently not valid for pip3) --- ports/tensorflow-cc/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 1532d6d7d64e51..46797d7db5c391 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -40,8 +40,7 @@ set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") find_package(Python3 COMPONENTS Interpreter NumPy) if(NOT Python3_NumPy_FOUND) - set(PIP3 "${PYTHON3_DIR}/pip3") - vcpkg_execute_required_process(COMMAND ${PIP3} install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) + vcpkg_execute_required_process(COMMAND pip3 install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) find_package(Python3 COMPONENTS NumPy) if(NOT Python3_NumPy_FOUND) message(FATAL_ERROR "Failed to install NumPy.") From 40954e48ccad35f33985ce0b71ffc1b6bdb86730 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 22 Aug 2020 22:55:44 +0200 Subject: [PATCH 19/95] fix error in python helper script --- ports/tensorflow-cc/convert_lib_params_windows.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py index 95b7fea783c2c8..4aed2c6ae78126 100644 --- a/ports/tensorflow-cc/convert_lib_params_windows.py +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -43,5 +43,5 @@ f_out.writelines(lines[:-missing]) for i in range(missing): with open("tensorflow_cc.lib-2.params-part%d" % (file_no + i + 1), "w") as f_out: - f_out.writeline(lines[0]) - f_out.writeline(lines[-(missing - i)]) + f_out.write(lines[0]) + f_out.write(lines[-(missing - i)]) From d198bf10a0005840ecef1d5a860cf204d4798d86 Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 24 Aug 2020 12:14:03 +0200 Subject: [PATCH 20/95] fix wrong libname in postbuild script --- ports/tensorflow-cc/convert_lib_params_windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py index 4aed2c6ae78126..c63bc7b0f548b4 100644 --- a/ports/tensorflow-cc/convert_lib_params_windows.py +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -43,5 +43,5 @@ f_out.writelines(lines[:-missing]) for i in range(missing): with open("tensorflow_cc.lib-2.params-part%d" % (file_no + i + 1), "w") as f_out: - f_out.write(lines[0]) + f_out.write(lib_name.replace(".dll", "-part%d.lib" % (file_no + i + 1))) f_out.write(lines[-(missing - i)]) From f6acaeb449a2f709de69858b48c720daeea51b3c Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 24 Aug 2020 14:08:32 +0200 Subject: [PATCH 21/95] fix python detection + switch to python on msys2 (instead of embedded python) for Windows as we need numpy --- ports/tensorflow-cc/portfile.cmake | 35 ++++++++++++------------------ 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 46797d7db5c391..6c6df46d1ef05c 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -27,26 +27,6 @@ get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) set(ENV{BAZEL_BIN_PATH} "${BAZEL}") -find_package(Python3 COMPONENTS Interpreter) -if(Python3_Interpreter_FOUND) - set(PYTHON3 "${Python3_EXECUTABLE}") -else() - vcpkg_find_acquire_program(PYTHON3) -endif() - -get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) -vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) -set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") - -find_package(Python3 COMPONENTS Interpreter NumPy) -if(NOT Python3_NumPy_FOUND) - vcpkg_execute_required_process(COMMAND pip3 install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) - find_package(Python3 COMPONENTS NumPy) - if(NOT Python3_NumPy_FOUND) - message(FATAL_ERROR "Failed to install NumPy.") - endif() -endif() - function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) if(EXISTS "${PATH_TO_REMOVE}") @@ -56,13 +36,26 @@ function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) endfunction() if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git mingw-w64-x86_64-python-numpy) vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) + set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) + + set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") +else() + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) + vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) + + vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip --user install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy1-${TARGET_TRIPLET}) endif() +set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") + +# check if numpy can be loaded +vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy2-${TARGET_TRIPLET}) # tensorflow has long file names, which will not work on windows set(ENV{TEST_TMPDIR} ${BUILDTREES_DIR}/.bzl) From efd0c93e641fa98dd17ccb58e13baa9bb45eea0e Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 24 Aug 2020 21:02:46 +0200 Subject: [PATCH 22/95] fix order of arguments --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 6c6df46d1ef05c..5fed5189dfbb01 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -50,7 +50,7 @@ else() get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) - vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip --user install -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy1-${TARGET_TRIPLET}) + vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy1-${TARGET_TRIPLET}) endif() set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") From 5c1f7ae73e3617ec250d6a8e83ffb71691b8d15c Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 13:04:24 +0200 Subject: [PATCH 23/95] fix command (it may contain spaces such as C:\Program Files\...) --- scripts/cmake/vcpkg_build_nmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_build_nmake.cmake b/scripts/cmake/vcpkg_build_nmake.cmake index 8cf0747398ec05..e5dc21e9172f35 100644 --- a/scripts/cmake/vcpkg_build_nmake.cmake +++ b/scripts/cmake/vcpkg_build_nmake.cmake @@ -111,7 +111,7 @@ function(vcpkg_build_nmake) set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") # Set make command and install command - set(MAKE ${NMAKE} /NOLOGO /G /U) + set(MAKE "${NMAKE}" /NOLOGO /G /U) set(MAKE_OPTS_BASE -f ${MAKEFILE_NAME} all) set(INSTALL_OPTS_BASE install) # Add subpath to work directory From 3b95e18c15e375bacd825aa1e767d678c6a89bad Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 13:55:06 +0200 Subject: [PATCH 24/95] revert last commit (root cause for CI failures is something different: there are line breaks in path) --- scripts/cmake/vcpkg_build_nmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_build_nmake.cmake b/scripts/cmake/vcpkg_build_nmake.cmake index e5dc21e9172f35..8cf0747398ec05 100644 --- a/scripts/cmake/vcpkg_build_nmake.cmake +++ b/scripts/cmake/vcpkg_build_nmake.cmake @@ -111,7 +111,7 @@ function(vcpkg_build_nmake) set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") # Set make command and install command - set(MAKE "${NMAKE}" /NOLOGO /G /U) + set(MAKE ${NMAKE} /NOLOGO /G /U) set(MAKE_OPTS_BASE -f ${MAKEFILE_NAME} all) set(INSTALL_OPTS_BASE install) # Add subpath to work directory From bfffec6adf517c3e4716d995db963df8dcf8dbd5 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 15:02:33 +0200 Subject: [PATCH 25/95] fix regex comparision (value needs to be escaped as it may contains regex special characters such as brackets, eg C:/Program Files (x86)/...) --- scripts/cmake/execute_process.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/cmake/execute_process.cmake b/scripts/cmake/execute_process.cmake index 992e5f1b2fb302..cfd180c6dbccbd 100644 --- a/scripts/cmake/execute_process.cmake +++ b/scripts/cmake/execute_process.cmake @@ -37,6 +37,8 @@ if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) set(more_commands_following 1) math(EXPR first_arg_idx "${idx} + 1") list(GET ARGV ${first_arg_idx} first_fractional_arg) + # we need to escape all regex special charaters because we want to use first_fractional_arg in regex matching + string(REGEX REPLACE "([][.?*+|()^$])" "\\\\\\1" first_fractional_arg "${first_fractional_arg}") break() endif() endforeach() @@ -52,6 +54,8 @@ if (NOT DEFINED OVERRIDEN_EXECUTE_PROCESS) set(more_commands_following 1) math(EXPR first_arg_idx "${idx} + 1") list(GET ARGV ${first_arg_idx} first_fractional_arg) + # we need to escape all regex special charaters because we want to use first_fractional_arg in regex matching + string(REGEX REPLACE "([][.?*+|()^$])" "\\\\\\1" first_fractional_arg "${first_fractional_arg}") break() endif() endforeach() From c9d08e9650d94b42b44b0858cd4aa76f93573ffa Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 15:24:52 +0200 Subject: [PATCH 26/95] fix linebreaks in generated file --- ports/tensorflow-cc/portfile.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 5fed5189dfbb01..6487889598c4cd 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -297,19 +297,19 @@ if(VCPKG_TARGET_IS_WINDOWS) file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-lib.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) set(ALL_PARTS "tensorflow_cc::tensorflow_cc-part1") foreach(part ${TF_LIB_SUFFIXES}) - file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\ -add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\ -set_target_properties(tensorflow_cc::tensorflow_cc${part}\ - PROPERTIES\ - IMPORTED_LOCATION \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\ - INTERFACE_INCLUDE_DIRECTORIES \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external\"\ -)\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\n\ +add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\n\ +set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ + PROPERTIES\n\ + IMPORTED_LOCATION \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\n\ + INTERFACE_INCLUDE_DIRECTORIES \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external\"\n\ +)\n\ ") list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") endforeach() - file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\ -add_library(tensorflow_cc::tensorflow_cc INTERFACE IMPORTED)\ -set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\n\ +add_library(tensorflow_cc::tensorflow_cc INTERFACE IMPORTED)\n\ +set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\n\ ") endif() else() From cdfdc6524f97183fa7f86f5a74ee049d58f91f71 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 16:04:53 +0200 Subject: [PATCH 27/95] fix CRT linkage (macOS doesn't support static CRT linkage; it's set to dynamic even static target triplets for macOS and linux) --- ports/tensorflow-cc/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 6487889598c4cd..5e0f122c3bbe95 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -171,7 +171,7 @@ foreach(BUILD_TYPE dbg rel) ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -200,7 +200,7 @@ foreach(BUILD_TYPE dbg rel) ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From c8c12b878a70a5673809f48bdebe1f313256d285 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 25 Aug 2020 18:44:50 +0200 Subject: [PATCH 28/95] refactor implemenation to avoid as much code duplication as possible -- algorithmically identical --- ports/tensorflow-cc/portfile.cmake | 157 +++++++++++------------------ 1 file changed, 61 insertions(+), 96 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 5e0f122c3bbe95..5bdd268b38a570 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -4,6 +4,8 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) message(FATAL_ERROR "TensorFlow does not support 32bit systems.") endif() +set(TF_VERSION 2.3.0) + set(STATIC_ONLY_PATCHES "") if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end @@ -11,7 +13,7 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow - REF v2.3.0 + REF "v${TF_VERSION}" SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac HEAD_REF master PATCHES @@ -50,12 +52,12 @@ else() get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) - vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy1-${TARGET_TRIPLET}) + vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) endif() set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") # check if numpy can be loaded -vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy2-${TARGET_TRIPLET}) +vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) # tensorflow has long file names, which will not work on windows set(ENV{TEST_TMPDIR} ${BUILDTREES_DIR}/.bzl) @@ -86,6 +88,34 @@ set(ENV{TF_CONFIGURE_IOS} 0) file(GLOB SOURCES ${SOURCE_PATH}/*) +if(VCPKG_TARGET_IS_WINDOWS) + set(BAZEL_LIB_NAME tensorflow_cc.dll) + set(SCRIPT_SUFFIX windows) + set(STATIC_LINK_CMD static_link.bat) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(BAZEL_LIB_NAME libtensorflow_cc.dylib) + set(SCRIPT_SUFFIX macos) + set(STATIC_LINK_CMD sh static_link.sh) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(TF_LIB_NAME "libtensorflow_cc.${TF_VERSION}.dylib") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.${TF_VERSION}.dylib") + else() + set(TF_LIB_NAME "libtensorflow_cc.${TF_VERSION}.a") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.${TF_VERSION}.a") + endif() +else() + set(BAZEL_LIB_NAME libtensorflow_cc.so) + set(SCRIPT_SUFFIX linux) + set(STATIC_LINK_CMD sh static_link.sh) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(TF_LIB_NAME "libtensorflow_cc.so.${TF_VERSION}") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.so.${TF_VERSION}") + else() + set(TF_LIB_NAME "libtensorflow_cc.a.${TF_VERSION}") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.a.${TF_VERSION}") + endif() +endif() + set(N_DBG_LIB_PARTS 0) foreach(BUILD_TYPE dbg rel) message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") @@ -126,14 +156,22 @@ foreach(BUILD_TYPE dbg rel) set(BUILD_OPTS "--compilation_mode=opt") endif() - if(VCPKG_TARGET_IS_WINDOWS) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() + vcpkg_execute_build_process( + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() + else() + if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_CRT_LINKAGE STREQUAL static) if(BUILD_TYPE STREQUAL dbg) set(CRT_OPT "-MTd") @@ -146,80 +184,28 @@ foreach(BUILD_TYPE dbg rel) WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_windows.py" "${N_DBG_LIB_PARTS}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_windows.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND static_link.bat - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - endif() - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - else() - vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.dylib //tensorflow:install_headers - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_macos.py" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_macos.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND sh static_link.sh - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - endif() - else() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} - ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:libtensorflow_cc.so //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_linux.py" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_linux.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND sh static_link.sh - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} - LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} - ) endif() + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${SCRIPT_SUFFIX}.py" "${N_DBG_LIB_PARTS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${SCRIPT_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + vcpkg_execute_build_process( + COMMAND ${STATIC_LINK_CMD} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} + LOGNAME postbuild3-${TARGET_TRIPLET}-${BUILD_TYPE} + ) endif() if(BUILD_TYPE STREQUAL dbg) @@ -252,30 +238,9 @@ foreach(BUILD_TYPE dbg rel) endif() endforeach() endif() - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.2.3.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.2.3.0.dylib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - set(TF_LIB_NAME libtensorflow_cc.2.3.0.dylib) - set(TF_FRAMEWORK_NAME libtensorflow_framework.2.3.0.dylib) - else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.2.3.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.2.3.0.a DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - set(TF_LIB_NAME libtensorflow_cc.2.3.0.a) - set(TF_FRAMEWORK_NAME libtensorflow_framework.2.3.0.dylib) - endif() else() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.so.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.so.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - set(TF_LIB_NAME libtensorflow_cc.so.2.3.0) - set(TF_FRAMEWORK_NAME libtensorflow_framework.so.2.3.0) - else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_cc.a.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/libtensorflow_framework.a.2.3.0 DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - set(TF_LIB_NAME libtensorflow_cc.a.2.3.0) - set(TF_FRAMEWORK_NAME libtensorflow_framework.so.2.3.0) - endif() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_LIB_NAME} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_FRAMEWORK_NAME} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) endif() endforeach() From 5d09b867b6787e7d13f88a5c0b3195be6ace5776 Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 26 Aug 2020 13:56:22 +0200 Subject: [PATCH 29/95] fix version numbers in helper scripts --- ports/tensorflow-cc/convert_lib_params_linux.py | 4 ++-- ports/tensorflow-cc/convert_lib_params_macos.py | 4 ++-- ports/tensorflow-cc/generate_static_link_cmd_linux.py | 4 ++-- ports/tensorflow-cc/generate_static_link_cmd_macos.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index 37222499ef3790..71473dc8c7dddd 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,6 +1,6 @@ for sub in ("cc", "framework"): - with open("libtensorflow_" + sub + ".so.1.14.0-2.params", "r") as f_in: - with open("libtensorflow_" + sub + ".a.1.14.0-2.params", "w") as f_out: + with open("libtensorflow_" + sub + ".so.2.3.0-2.params", "r") as f_in: + with open("libtensorflow_" + sub + ".a.2.3.0-2.params", "w") as f_out: for line in f_in: if line.startswith("-o "): line = line.replace(".so", ".a") diff --git a/ports/tensorflow-cc/convert_lib_params_macos.py b/ports/tensorflow-cc/convert_lib_params_macos.py index 5cad8b9af0bf6b..2ae44c5bc621ec 100644 --- a/ports/tensorflow-cc/convert_lib_params_macos.py +++ b/ports/tensorflow-cc/convert_lib_params_macos.py @@ -1,6 +1,6 @@ for sub in ("cc", "framework"): - with open("libtensorflow_" + sub + ".1.14.0.dylib-2.params", "r") as f_in: - with open("libtensorflow_" + sub + ".1.14.0.a-2.params", "w") as f_out: + with open("libtensorflow_" + sub + ".2.3.0.dylib-2.params", "r") as f_in: + with open("libtensorflow_" + sub + ".2.3.0.a-2.params", "w") as f_out: for line in f_in: if line.startswith("-o "): line = line.replace(".dylib", ".a") diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 2542e085877e57..5fc2788d4ea10f 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -3,8 +3,8 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.so\\.1\\.14\\.0).+(@bazel-out\\S+libtensorflow_cc\\.so\\.1\\.14\\.0-2\\.params).*") - p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.so\\.1\\.14\\.0).+(@bazel-out\\S+libtensorflow_framework\\.so\\.1\\.14\\.0-2\\.params).*") + p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0).+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") + p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0).+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] found1 = False diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 707acb9b2c283e..e509491d121d9b 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -3,8 +3,8 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.1\\.14\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_cc\\.1\\.14\\.0\\.dylib-2\\.params).*") - p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.1\\.14\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_framework\\.1\\.14\\.0\\.dylib-2\\.params).*") + p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib-2\\.params).*") + p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] found1 = False From 6cb4e5b5ac45359d5fd035bad1498f7d3ed41ddd Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 26 Aug 2020 13:59:19 +0200 Subject: [PATCH 30/95] enable work-around for Windows until bazel fix is available --- ports/tensorflow-cc/portfile.cmake | 8 +++++++- scripts/ci.baseline.txt | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 5bdd268b38a570..f5bc8b06e72984 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -46,7 +46,13 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) - set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") + #set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") + # workaround: use local installation until bazel fix https://github.com/bazelbuild/bazel/pull/12002 is available + find_package(Python3 COMPONENTS Interpreter) + if(NOT Python3_Interpreter_FOUND) + message(FATAL_ERROR "Can't find python 3. Please install and re-run vcpkg.") + endif() + set(PYTHON3 "${Python3_EXECUTABLE}") else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index c1f2076e2991f6..0a8fc68f2c2187 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1678,6 +1678,8 @@ telnetpp:arm-uwp=fail telnetpp:x64-uwp=fail tensorflow-cc:arm64-windows=fail tensorflow-cc:x86-windows=fail +tensorflow-cc:x64-windows=fail +tensorflow-cc:x64-windows-static=fail tesseract:x64-windows=fail tesseract:x64-windows-static=fail tesseract:x86-windows=fail From 5376c01cdf94a8e840123ea466be4e61089be8cc Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 26 Aug 2020 14:04:36 +0200 Subject: [PATCH 31/95] install missing python3-pip on linux --- ports/tensorflow-cc/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index f5bc8b06e72984..6c7d2f40f561ac 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -58,6 +58,10 @@ else() get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) + if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + vcpkg_execute_required_process(COMMAND sudo apt-get -y install python3-pip WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME install-pip-${TARGET_TRIPLET}) + endif() + vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) endif() set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") From 692c742f6d3cb93dd9c4188a53a0f2082c182333 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 28 Aug 2020 15:27:46 +0200 Subject: [PATCH 32/95] fix linux build by patching --- ports/tensorflow-cc/fix-linux-build.patch | 84 +++++++++++++++++++++++ ports/tensorflow-cc/portfile.cmake | 5 ++ 2 files changed, 89 insertions(+) create mode 100644 ports/tensorflow-cc/fix-linux-build.patch diff --git a/ports/tensorflow-cc/fix-linux-build.patch b/ports/tensorflow-cc/fix-linux-build.patch new file mode 100644 index 00000000000000..7a685017d4005b --- /dev/null +++ b/ports/tensorflow-cc/fix-linux-build.patch @@ -0,0 +1,84 @@ +diff --git a/third_party/aws/aws-checksums.bazel b/third_party/aws/aws-checksums.bazel +--- a/third_party/aws/aws-checksums.bazel ++++ b/third_party/aws/aws-checksums.bazel +@@ -7,6 +7,13 @@ + + exports_files(["LICENSE"]) + ++load("@bazel_skylib//lib:selects.bzl", "selects") ++ ++selects.config_setting_group( ++ name = "is_linux_debug", ++ match_all = ["@org_tensorflow//tensorflow:linux_x86_64", "@org_tensorflow//tensorflow:debug"], ++) ++ + cc_library( + name = "aws-checksums", + srcs = select({ +@@ -27,4 +34,10 @@ + deps = [ + "@aws-c-common", + ], ++ defines = select({ ++ ":is_linux_debug": [ ++ "DEBUG_BUILD" ++ ], ++ "//conditions:default": [], ++ }), + ) + +diff --git a/tensorflow/core/kernels/data/experimental/io_ops.cc b/tensorflow/core/kernels/data/experimental/io_ops.cc +--- a/tensorflow/core/kernels/data/experimental/io_ops.cc ++++ b/tensorflow/core/kernels/data/experimental/io_ops.cc +@@ -113,7 +113,7 @@ + snapshot_util::ShardDirectory(run_dir, shard_index); + auto writer_thread = std::make_unique( + ctx->env(), shard_index, snapshot_shard_directory, +- /*checkpoint_id=*/0, compression_, kFileFormatVersion, ++ /*checkpoint_id=*/0, compression_, SaveDatasetOp::kFileFormatVersion, + dataset->output_dtypes(), [&mu, &status](Status s) { + mutex_lock l(mu); + status.Update(s); +@@ -234,9 +234,9 @@ + TF_RETURN_IF_ERROR(b->AddDataset( + this, {std::make_pair(0, path_node)}, // Single tensor inputs. + {std::make_pair(1, reader_func_other_args)}, // Tensor list inputs. +- {std::make_pair(kCompression, compression_attr), +- std::make_pair(kReaderFunc, reader_func_attr), +- std::make_pair(kReaderFuncTarguments, ++ {std::make_pair(LoadDatasetOp::kCompression, compression_attr), ++ std::make_pair(LoadDatasetOp::kReaderFunc, reader_func_attr), ++ std::make_pair(LoadDatasetOp::kReaderFuncTarguments, + reader_func_arguments_types_attr)}, // Attrs + output)); + return Status::OK(); + +diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc +--- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc ++++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc +@@ -364,11 +364,11 @@ + {std::make_pair(2, reader_func_other_args), + std::make_pair(3, shard_func_other_args)}, + /*attrs=*/ +- {{kCompression, compression_attr}, +- {kReaderFunc, reader_func_attr}, +- {kShardFunc, shard_func_attr}, +- {kReaderFuncTarguments, reader_func_arguments_types_attr}, +- {kShardFuncTarguments, shard_func_arguments_types_attr}}, ++ {{SnapshotDatasetV2Op::kCompression, compression_attr}, ++ {SnapshotDatasetV2Op::kReaderFunc, reader_func_attr}, ++ {SnapshotDatasetV2Op::kShardFunc, shard_func_attr}, ++ {SnapshotDatasetV2Op::kReaderFuncTarguments, reader_func_arguments_types_attr}, ++ {SnapshotDatasetV2Op::kShardFuncTarguments, shard_func_arguments_types_attr}}, + output); + } + +@@ -687,7 +687,7 @@ + snapshot_util::ShardDirectory(run_dir_, shard_index); + auto writer = std::make_unique( + ctx->env(), shard_index, snapshot_shard_directory, +- current_checkpoint_id_, dataset()->compression_, kFileFormatVersion, ++ current_checkpoint_id_, dataset()->compression_, SnapshotDatasetV2Op::kFileFormatVersion, + dataset()->output_dtypes(), [this](Status s) { + if (!s.ok()) { + mutex_lock l(mu_); diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 6c7d2f40f561ac..ce04185f5b267e 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -7,9 +7,13 @@ endif() set(TF_VERSION 2.3.0) set(STATIC_ONLY_PATCHES "") +set(LINUX_ONLY_PATCHES "") if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end endif() +if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(LINUX_ONLY_PATCHES fix-linux-build.patch) +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow @@ -22,6 +26,7 @@ vcpkg_from_github( fix-dbg-build-errors.patch # Fix no return statement fix-more-build-errors.patch # Fix no return statement ${STATIC_ONLY_PATCHES} + ${LINUX_ONLY_PATCHES} ) vcpkg_find_acquire_program(BAZEL) From 1246969da18ab381b873269defd5ca200f413af8 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 28 Aug 2020 15:32:13 +0200 Subject: [PATCH 33/95] apply timeout feature now available via merged master branch --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index ce04185f5b267e..cec6c456675620 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -43,7 +43,7 @@ function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) endfunction() if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git mingw-w64-x86_64-python-numpy) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES unzip patch diffutils git mingw-w64-x86_64-python-numpy TIMEOUT 1800) vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) From c9182141eba68d894bdd5c2720a9b70c289e28f2 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 28 Aug 2020 18:06:13 +0200 Subject: [PATCH 34/95] correct linux build patch --- ports/tensorflow-cc/fix-linux-build.patch | 161 ++++++++++++++-------- 1 file changed, 107 insertions(+), 54 deletions(-) diff --git a/ports/tensorflow-cc/fix-linux-build.patch b/ports/tensorflow-cc/fix-linux-build.patch index 7a685017d4005b..8d6ccf478e855a 100644 --- a/ports/tensorflow-cc/fix-linux-build.patch +++ b/ports/tensorflow-cc/fix-linux-build.patch @@ -27,58 +27,111 @@ diff --git a/third_party/aws/aws-checksums.bazel b/third_party/aws/aws-checksums + }), ) -diff --git a/tensorflow/core/kernels/data/experimental/io_ops.cc b/tensorflow/core/kernels/data/experimental/io_ops.cc ---- a/tensorflow/core/kernels/data/experimental/io_ops.cc -+++ b/tensorflow/core/kernels/data/experimental/io_ops.cc -@@ -113,7 +113,7 @@ - snapshot_util::ShardDirectory(run_dir, shard_index); - auto writer_thread = std::make_unique( - ctx->env(), shard_index, snapshot_shard_directory, -- /*checkpoint_id=*/0, compression_, kFileFormatVersion, -+ /*checkpoint_id=*/0, compression_, SaveDatasetOp::kFileFormatVersion, - dataset->output_dtypes(), [&mu, &status](Status s) { - mutex_lock l(mu); - status.Update(s); -@@ -234,9 +234,9 @@ - TF_RETURN_IF_ERROR(b->AddDataset( - this, {std::make_pair(0, path_node)}, // Single tensor inputs. - {std::make_pair(1, reader_func_other_args)}, // Tensor list inputs. -- {std::make_pair(kCompression, compression_attr), -- std::make_pair(kReaderFunc, reader_func_attr), -- std::make_pair(kReaderFuncTarguments, -+ {std::make_pair(LoadDatasetOp::kCompression, compression_attr), -+ std::make_pair(LoadDatasetOp::kReaderFunc, reader_func_attr), -+ std::make_pair(LoadDatasetOp::kReaderFuncTarguments, - reader_func_arguments_types_attr)}, // Attrs - output)); - return Status::OK(); +diff --git a/tensorflow/core/kernels/data/experimental/io_ops.h b/tensorflow/core/kernels/data/experimental/io_ops.h +--- a/tensorflow/core/kernels/data/experimental/io_ops.h ++++ b/tensorflow/core/kernels/data/experimental/io_ops.h +@@ -26,23 +26,28 @@ + namespace data { + namespace experimental { -diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc ---- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc -+++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc -@@ -364,11 +364,11 @@ - {std::make_pair(2, reader_func_other_args), - std::make_pair(3, shard_func_other_args)}, - /*attrs=*/ -- {{kCompression, compression_attr}, -- {kReaderFunc, reader_func_attr}, -- {kShardFunc, shard_func_attr}, -- {kReaderFuncTarguments, reader_func_arguments_types_attr}, -- {kShardFuncTarguments, shard_func_arguments_types_attr}}, -+ {{SnapshotDatasetV2Op::kCompression, compression_attr}, -+ {SnapshotDatasetV2Op::kReaderFunc, reader_func_attr}, -+ {SnapshotDatasetV2Op::kShardFunc, shard_func_attr}, -+ {SnapshotDatasetV2Op::kReaderFuncTarguments, reader_func_arguments_types_attr}, -+ {SnapshotDatasetV2Op::kShardFuncTarguments, shard_func_arguments_types_attr}}, - output); - } - -@@ -687,7 +687,7 @@ - snapshot_util::ShardDirectory(run_dir_, shard_index); - auto writer = std::make_unique( - ctx->env(), shard_index, snapshot_shard_directory, -- current_checkpoint_id_, dataset()->compression_, kFileFormatVersion, -+ current_checkpoint_id_, dataset()->compression_, SnapshotDatasetV2Op::kFileFormatVersion, - dataset()->output_dtypes(), [this](Status s) { - if (!s.ok()) { - mutex_lock l(mu_); ++constexpr const char* const kCompression = "compression"; ++constexpr const char* const kPath = "path"; ++constexpr const char* const kShardFunc = "shard_func"; ++constexpr const char* const kShardFuncOtherArgs = "shard_func_other_args"; ++constexpr const char* const kUseShardFunc = "use_shard_func"; ++constexpr const char* const kDatasetType = "Load"; ++constexpr const char* const kOutputTypes = "output_types"; ++constexpr const char* const kOutputShapes = "output_shapes"; ++constexpr const char* const kReaderFunc = "reader_func"; ++constexpr const char* const kReaderFuncOtherArgs = "reader_func_other_args"; ++constexpr const char* const kReaderFuncTarguments = "Treader_func_args"; ++ ++constexpr const int kFileFormatVersion = 2; ++ + // An operation that can save a dataset to one or more files. + class SaveDatasetOp : public HybridAsyncOpKernel { + public: +- static constexpr const char* const kCompression = "compression"; +- static constexpr const char* const kPath = "path"; +- static constexpr const char* const kShardFunc = "shard_func"; +- static constexpr const char* const kShardFuncOtherArgs = +- "shard_func_other_args"; +- static constexpr const char* const kUseShardFunc = "use_shard_func"; +- + explicit SaveDatasetOp(OpKernelConstruction* ctx); + + Status DoCompute(OpKernelContext* ctx) override; + + private: +- static constexpr const int kFileFormatVersion = 2; +- + Status ConsumeElement(); + + Status GetShardIndex(IteratorContext* ctx, +@@ -65,17 +70,6 @@ + // An operation that can load a dataset from one or more files. + class LoadDatasetOp : public DatasetOpKernel { + public: +- static constexpr const char* const kCompression = "compression"; +- static constexpr const char* const kDatasetType = "Load"; +- static constexpr const char* const kOutputTypes = "output_types"; +- static constexpr const char* const kOutputShapes = "output_shapes"; +- static constexpr const char* const kPath = "path"; +- static constexpr const char* const kReaderFunc = "reader_func"; +- static constexpr const char* const kReaderFuncOtherArgs = +- "reader_func_other_args"; +- static constexpr const char* const kReaderFuncTarguments = +- "Treader_func_args"; +- + explicit LoadDatasetOp(OpKernelConstruction* ctx); + + void MakeDataset(OpKernelContext* ctx, DatasetBase** output) override; + +diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h +--- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h ++++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h +@@ -38,22 +38,21 @@ + namespace data { + namespace experimental { + ++constexpr const char* const kDatasetType = "Snapshot"; ++constexpr const char* const kOutputTypes = "output_types"; ++constexpr const char* const kOutputShapes = "output_shapes"; ++constexpr const char* const kCompression = "compression"; ++constexpr const char* const kReaderFunc = "reader_func"; ++constexpr const char* const kShardFunc = "shard_func"; ++constexpr const char* const kReaderFuncOtherArgs = "reader_func_other_args"; ++constexpr const char* const kShardFuncOtherArgs = "shard_func_other_args"; ++constexpr const char* const kReaderFuncTarguments = "Treader_func_args"; ++constexpr const char* const kShardFuncTarguments = "Tshard_func_args"; ++ ++constexpr const int kFileFormatVersion = 2; ++ + class SnapshotDatasetV2Op : public UnaryDatasetOpKernel { + public: +- static constexpr const char* const kDatasetType = "Snapshot"; +- static constexpr const char* const kOutputTypes = "output_types"; +- static constexpr const char* const kOutputShapes = "output_shapes"; +- static constexpr const char* const kCompression = "compression"; +- static constexpr const char* const kReaderFunc = "reader_func"; +- static constexpr const char* const kShardFunc = "shard_func"; +- static constexpr const char* const kReaderFuncOtherArgs = +- "reader_func_other_args"; +- static constexpr const char* const kShardFuncOtherArgs = +- "shard_func_other_args"; +- static constexpr const char* const kReaderFuncTarguments = +- "Treader_func_args"; +- static constexpr const char* const kShardFuncTarguments = "Tshard_func_args"; +- + explicit SnapshotDatasetV2Op(OpKernelConstruction* ctx); + + protected: +@@ -61,8 +60,6 @@ + DatasetBase** output) override; + + private: +- static constexpr const int kFileFormatVersion = 2; +- + class Dataset; + + const int graph_def_version_; From e78a3df6da378637fb88e9ef10fb48f8d43170af Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 28 Aug 2020 18:08:30 +0200 Subject: [PATCH 35/95] improve debug build patches (no functional difference because LOG(FATAL, ...) macro internally anyway calls abort(), which the compiler doesn't detect in debug mode... --- ports/tensorflow-cc/fix-dbg-build-errors.patch | 4 ++-- ports/tensorflow-cc/fix-more-build-errors.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/fix-dbg-build-errors.patch b/ports/tensorflow-cc/fix-dbg-build-errors.patch index b5f1bcc1eba448..63e95dbb872601 100644 --- a/ports/tensorflow-cc/fix-dbg-build-errors.patch +++ b/ports/tensorflow-cc/fix-dbg-build-errors.patch @@ -5,7 +5,7 @@ diff --git a/tensorflow/core/platform/path.cc b/tensorflow/core/platform/path.cc } LOG(FATAL) << "No temp directory found."; #endif -+ return ""; ++ std::abort(); } bool GetTestUndeclaredOutputsDir(string* dir) { @@ -22,7 +22,7 @@ diff --git a/tensorflow/core/framework/device_base.cc b/tensorflow/core/framewor const string& DeviceBase::name() const { LOG(FATAL) << "Device does not implement name()"; -+ return ""; ++ std::abort(); } void DeviceBase::set_eigen_cpu_device(Eigen::ThreadPoolDevice* d) { diff --git a/ports/tensorflow-cc/fix-more-build-errors.patch b/ports/tensorflow-cc/fix-more-build-errors.patch index 32ab019b69a5f1..c7d6a9b7fa355e 100644 --- a/ports/tensorflow-cc/fix-more-build-errors.patch +++ b/ports/tensorflow-cc/fix-more-build-errors.patch @@ -5,7 +5,7 @@ diff --git a/tensorflow/core/distributed_runtime/remote_device.cc b/tensorflow/c ResourceMgr* resource_manager() override { LOG(FATAL) << "Accessing the resource manager of a remote device is not " << "supported."; -+ return nullptr; ++ std::abort(); } bool IsLocal() const override { return false; } From 91031285846fc6f64609f4c0296924453dc54a17 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 28 Aug 2020 20:09:42 +0200 Subject: [PATCH 36/95] improve linux patch --- ports/tensorflow-cc/fix-linux-build.patch | 119 +++++----------------- 1 file changed, 23 insertions(+), 96 deletions(-) diff --git a/ports/tensorflow-cc/fix-linux-build.patch b/ports/tensorflow-cc/fix-linux-build.patch index 8d6ccf478e855a..81a6a3be8c63fb 100644 --- a/ports/tensorflow-cc/fix-linux-build.patch +++ b/ports/tensorflow-cc/fix-linux-build.patch @@ -27,111 +27,38 @@ diff --git a/third_party/aws/aws-checksums.bazel b/third_party/aws/aws-checksums + }), ) -diff --git a/tensorflow/core/kernels/data/experimental/io_ops.h b/tensorflow/core/kernels/data/experimental/io_ops.h ---- a/tensorflow/core/kernels/data/experimental/io_ops.h -+++ b/tensorflow/core/kernels/data/experimental/io_ops.h -@@ -26,23 +26,28 @@ +diff --git a/tensorflow/core/kernels/data/experimental/io_ops.cc b/tensorflow/core/kernels/data/experimental/io_ops.cc +--- a/tensorflow/core/kernels/data/experimental/io_ops.cc ++++ b/tensorflow/core/kernels/data/experimental/io_ops.cc +@@ -28,6 +28,12 @@ namespace data { namespace experimental { -+constexpr const char* const kCompression = "compression"; -+constexpr const char* const kPath = "path"; -+constexpr const char* const kShardFunc = "shard_func"; -+constexpr const char* const kShardFuncOtherArgs = "shard_func_other_args"; -+constexpr const char* const kUseShardFunc = "use_shard_func"; -+constexpr const char* const kDatasetType = "Load"; -+constexpr const char* const kOutputTypes = "output_types"; -+constexpr const char* const kOutputShapes = "output_shapes"; -+constexpr const char* const kReaderFunc = "reader_func"; -+constexpr const char* const kReaderFuncOtherArgs = "reader_func_other_args"; -+constexpr const char* const kReaderFuncTarguments = "Treader_func_args"; ++/*static*/ constexpr const char* const LoadDatasetOp::kCompression; ++/*static*/ constexpr const char* const LoadDatasetOp::kReaderFunc; ++/*static*/ constexpr const char* const LoadDatasetOp::kReaderFuncTarguments; + -+constexpr const int kFileFormatVersion = 2; ++/*static*/ constexpr const int SaveDatasetOp::kFileFormatVersion; + - // An operation that can save a dataset to one or more files. - class SaveDatasetOp : public HybridAsyncOpKernel { - public: -- static constexpr const char* const kCompression = "compression"; -- static constexpr const char* const kPath = "path"; -- static constexpr const char* const kShardFunc = "shard_func"; -- static constexpr const char* const kShardFuncOtherArgs = -- "shard_func_other_args"; -- static constexpr const char* const kUseShardFunc = "use_shard_func"; -- - explicit SaveDatasetOp(OpKernelConstruction* ctx); + SaveDatasetOp::SaveDatasetOp(OpKernelConstruction* ctx) + : HybridAsyncOpKernel(ctx, "tf_data_save_dataset") { + OP_REQUIRES_OK(ctx, ctx->GetAttr(kCompression, &compression_)); - Status DoCompute(OpKernelContext* ctx) override; - - private: -- static constexpr const int kFileFormatVersion = 2; -- - Status ConsumeElement(); - - Status GetShardIndex(IteratorContext* ctx, -@@ -65,17 +70,6 @@ - // An operation that can load a dataset from one or more files. - class LoadDatasetOp : public DatasetOpKernel { - public: -- static constexpr const char* const kCompression = "compression"; -- static constexpr const char* const kDatasetType = "Load"; -- static constexpr const char* const kOutputTypes = "output_types"; -- static constexpr const char* const kOutputShapes = "output_shapes"; -- static constexpr const char* const kPath = "path"; -- static constexpr const char* const kReaderFunc = "reader_func"; -- static constexpr const char* const kReaderFuncOtherArgs = -- "reader_func_other_args"; -- static constexpr const char* const kReaderFuncTarguments = -- "Treader_func_args"; -- - explicit LoadDatasetOp(OpKernelConstruction* ctx); - - void MakeDataset(OpKernelContext* ctx, DatasetBase** output) override; - -diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h ---- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h -+++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.h -@@ -38,22 +38,21 @@ +diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc +--- a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc ++++ b/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc +@@ -63,6 +63,14 @@ namespace data { namespace experimental { -+constexpr const char* const kDatasetType = "Snapshot"; -+constexpr const char* const kOutputTypes = "output_types"; -+constexpr const char* const kOutputShapes = "output_shapes"; -+constexpr const char* const kCompression = "compression"; -+constexpr const char* const kReaderFunc = "reader_func"; -+constexpr const char* const kShardFunc = "shard_func"; -+constexpr const char* const kReaderFuncOtherArgs = "reader_func_other_args"; -+constexpr const char* const kShardFuncOtherArgs = "shard_func_other_args"; -+constexpr const char* const kReaderFuncTarguments = "Treader_func_args"; -+constexpr const char* const kShardFuncTarguments = "Tshard_func_args"; ++/*static*/ constexpr const char* const SnapshotDatasetV2Op::kCompression; ++/*static*/ constexpr const char* const SnapshotDatasetV2Op::kReaderFunc; ++/*static*/ constexpr const char* const SnapshotDatasetV2Op::kShardFunc; ++/*static*/ constexpr const char* const SnapshotDatasetV2Op::kReaderFuncTarguments; ++/*static*/ constexpr const char* const SnapshotDatasetV2Op::kShardFuncTarguments; + -+constexpr const int kFileFormatVersion = 2; ++/*static*/ constexpr const int SnapshotDatasetV2Op::kFileFormatVersion; + - class SnapshotDatasetV2Op : public UnaryDatasetOpKernel { - public: -- static constexpr const char* const kDatasetType = "Snapshot"; -- static constexpr const char* const kOutputTypes = "output_types"; -- static constexpr const char* const kOutputShapes = "output_shapes"; -- static constexpr const char* const kCompression = "compression"; -- static constexpr const char* const kReaderFunc = "reader_func"; -- static constexpr const char* const kShardFunc = "shard_func"; -- static constexpr const char* const kReaderFuncOtherArgs = -- "reader_func_other_args"; -- static constexpr const char* const kShardFuncOtherArgs = -- "shard_func_other_args"; -- static constexpr const char* const kReaderFuncTarguments = -- "Treader_func_args"; -- static constexpr const char* const kShardFuncTarguments = "Tshard_func_args"; -- - explicit SnapshotDatasetV2Op(OpKernelConstruction* ctx); - - protected: -@@ -61,8 +60,6 @@ - DatasetBase** output) override; - - private: -- static constexpr const int kFileFormatVersion = 2; -- - class Dataset; + // ==== Snapshot Implementation ==== - const int graph_def_version_; + /* The current snapshot on-disk layout is as follows: From fc4404a7f3782ffed2c6467f7534dcaffb91e18c Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 29 Aug 2020 20:19:41 +0200 Subject: [PATCH 37/95] temporarily add debug to inspect what's going on on macOS CI --- ports/tensorflow-cc/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index cec6c456675620..f5aba1a9e39c8d 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -206,6 +206,11 @@ foreach(BUILD_TYPE dbg rel) LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) endif() + vcpkg_execute_build_process( + COMMAND ls -l + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild-debug-${TARGET_TRIPLET}-${BUILD_TYPE} + ) vcpkg_execute_build_process( COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${SCRIPT_SUFFIX}.py" "${N_DBG_LIB_PARTS}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow From 74cc334b1a0e4e76eb51d27db5b6018608d7d3e1 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sun, 30 Aug 2020 20:56:53 +0200 Subject: [PATCH 38/95] remove temporary debug code and fix static linking scripts for linux and macOS --- .../tensorflow-cc/convert_lib_params_macos.py | 9 ------- .../generate_static_link_cmd_linux.py | 25 +++++++++---------- .../generate_static_link_cmd_macos.py | 25 ++++++++++--------- ports/tensorflow-cc/portfile.cmake | 17 ++++++------- 4 files changed, 32 insertions(+), 44 deletions(-) delete mode 100644 ports/tensorflow-cc/convert_lib_params_macos.py diff --git a/ports/tensorflow-cc/convert_lib_params_macos.py b/ports/tensorflow-cc/convert_lib_params_macos.py deleted file mode 100644 index 2ae44c5bc621ec..00000000000000 --- a/ports/tensorflow-cc/convert_lib_params_macos.py +++ /dev/null @@ -1,9 +0,0 @@ -for sub in ("cc", "framework"): - with open("libtensorflow_" + sub + ".2.3.0.dylib-2.params", "r") as f_in: - with open("libtensorflow_" + sub + ".2.3.0.a-2.params", "w") as f_out: - for line in f_in: - if line.startswith("-o "): - line = line.replace(".dylib", ".a") - f_out.write(line) - elif line.startswith("bazel-out"): - f_out.write(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 5fc2788d4ea10f..5c1879f9bcdec5 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -3,36 +3,35 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0).+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") - p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0).+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") + p_cd = re.compile("^\\((cd .*) && \\$") + p_linker1 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") + p_linker2 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") - env = [] + env = None found1 = False found2 = False for line in f_in: if line.startswith("(cd"): # new command, reset - env = [line] + env = line else: m1 = p_linker1.match(line) m2 = p_linker2.match(line) if m1: - for e in env: - f_out.write(e) + m = p_cd.match(env) + f_out.write(m.group(1) + "\n") tokens = line.split() - line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2).replace(".so", ".a") + " " + m1.group(3).replace(".so", ".a") + ")" + line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2)[:-9].replace(".so", ".a") + " " + m1.group(2).replace(".so", ".a") f_out.write(line + "\n") found1 = True if found2: break - elif m2 and len(env) > 4: - for e in env: - f_out.write(e) + elif m2: + m = p_cd.match(env) + f_out.write(m.group(1) + "\n") tokens = line.split() - line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2).replace(".so", ".a") + " " + m2.group(3).replace(".so", ".a") + ")" + line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2)[:-9].replace(".so", ".a") + " " + m2.group(2).replace(".so", ".a") f_out.write(line + "\n") found2 = True if found1: break - else: - env.append(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index e509491d121d9b..f1cc1640e8da3d 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -3,36 +3,37 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_linker1 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib-2\\.params).*") - p_linker2 = re.compile("^\\s*(.+)gcc.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib).+(@bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib-2\\.params).*") + p_cd = re.compile("^\\((cd .*) && \\$") + p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib)") + p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") - env = [] + env = None found1 = False found2 = False for line in f_in: if line.startswith("(cd"): # new command, reset - env = [line] + env = line else: m1 = p_linker1.match(line) m2 = p_linker2.match(line) if m1: - for e in env: - f_out.write(e) + m = p_cd.match(env) + f_out.write(m.group(1) + "\n") tokens = line.split() - line = "\"" + m1.group(1) + "ar\" -rcs " + m1.group(2).replace(".dylib", ".a") + " " + m1.group(3).replace(".dylib", ".a") + ")" + parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + line = "ar -rcs " + m1.group(1).replace(".dylib", ".a") + " " + " ".join(parts) f_out.write(line + "\n") found1 = True if found2: break elif m2 and len(env) > 4: - for e in env: - f_out.write(e) + m = p_cd.match(env) + f_out.write(m.group(1) + "\n") tokens = line.split() - line = "\"" + m2.group(1) + "ar\" -rcs " + m2.group(2).replace(".dylib", ".a") + " " + m2.group(3).replace(".dylib", ".a") + ")" + parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + line = "ar -rcs " + m2.group(1).replace(".dylib", ".a") + " " + " ".join(parts) f_out.write(line + "\n") found2 = True if found1: break - else: - env.append(line) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index f5aba1a9e39c8d..2b92c8b53a51f1 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -206,16 +206,13 @@ foreach(BUILD_TYPE dbg rel) LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) endif() - vcpkg_execute_build_process( - COMMAND ls -l - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild-debug-${TARGET_TRIPLET}-${BUILD_TYPE} - ) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${SCRIPT_SUFFIX}.py" "${N_DBG_LIB_PARTS}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} - ) + if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${SCRIPT_SUFFIX}.py" "${N_DBG_LIB_PARTS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() vcpkg_execute_build_process( COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${SCRIPT_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} From ee1082f791fafd1a217879808775b40624df6ecd Mon Sep 17 00:00:00 2001 From: jgehw Date: Sun, 30 Aug 2020 21:38:58 +0200 Subject: [PATCH 39/95] fix regex escaping --- ports/tensorflow-cc/generate_static_link_cmd_linux.py | 4 ++-- ports/tensorflow-cc/generate_static_link_cmd_macos.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 5c1879f9bcdec5..6a4c69dcec8922 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -3,7 +3,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_cd = re.compile("^\\((cd .*) && \\$") + p_cd = re.compile("^\\((cd .*) && \\\\$") p_linker1 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") p_linker2 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") @@ -26,7 +26,7 @@ found1 = True if found2: break - elif m2: + elif m2 and not found2: m = p_cd.match(env) f_out.write(m.group(1) + "\n") tokens = line.split() diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index f1cc1640e8da3d..cc5c45fb60220d 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -3,7 +3,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: - p_cd = re.compile("^\\((cd .*) && \\$") + p_cd = re.compile("^\\((cd .*) && \\\\$") p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib)") p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") @@ -27,7 +27,7 @@ found1 = True if found2: break - elif m2 and len(env) > 4: + elif m2 and not found2: m = p_cd.match(env) f_out.write(m.group(1) + "\n") tokens = line.split() From 381066a672afe857bf92718ed2bfc0501f24050c Mon Sep 17 00:00:00 2001 From: jgehw Date: Sun, 30 Aug 2020 23:27:24 +0200 Subject: [PATCH 40/95] fix ambiguous match while grepping for the framework link command --- .../generate_static_link_cmd_linux.py | 16 +++++++--------- .../generate_static_link_cmd_macos.py | 10 +++++----- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 6a4c69dcec8922..8d504fd89e5d6d 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -7,30 +7,28 @@ p_linker1 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") p_linker2 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") - env = None + env = [] found1 = False found2 = False for line in f_in: if line.startswith("(cd"): # new command, reset - env = line + env = [line] else: m1 = p_linker1.match(line) m2 = p_linker2.match(line) if m1: - m = p_cd.match(env) + m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") - tokens = line.split() - line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2)[:-9].replace(".so", ".a") + " " + m1.group(2).replace(".so", ".a") + line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2)[1:-9].replace(".so", ".a") + " " + m1.group(2).replace(".so", ".a") f_out.write(line + "\n") found1 = True if found2: break - elif m2 and not found2: - m = p_cd.match(env) + elif m2 and len(env) > 4: + m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") - tokens = line.split() - line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2)[:-9].replace(".so", ".a") + " " + m2.group(2).replace(".so", ".a") + line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2)[1:-9].replace(".so", ".a") + " " + m2.group(2).replace(".so", ".a") f_out.write(line + "\n") found2 = True if found1: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index cc5c45fb60220d..daddd2eb52aa95 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -7,18 +7,18 @@ p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib)") p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") - env = None + env = [] found1 = False found2 = False for line in f_in: if line.startswith("(cd"): # new command, reset - env = line + env = [line] else: m1 = p_linker1.match(line) m2 = p_linker2.match(line) if m1: - m = p_cd.match(env) + m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") tokens = line.split() parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] @@ -27,8 +27,8 @@ found1 = True if found2: break - elif m2 and not found2: - m = p_cd.match(env) + elif m2 and len(env) > 4: + m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") tokens = line.split() parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] From 006a21a36ea80cea4f5be7a4fce8917fa624812e Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 31 Aug 2020 13:24:49 +0200 Subject: [PATCH 41/95] extend fix of ambiguous match while grepping for the framework link command --- ports/tensorflow-cc/generate_static_link_cmd_linux.py | 2 ++ ports/tensorflow-cc/generate_static_link_cmd_macos.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 8d504fd89e5d6d..8d5936f585e7f0 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -33,3 +33,5 @@ found2 = True if found1: break + else: + env.append(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index daddd2eb52aa95..5aca2362a8f308 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -37,3 +37,5 @@ found2 = True if found1: break + else: + env.append(line) From d77a47c2655b2b84478e83eda490229dcee4d7a3 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 1 Sep 2020 14:45:49 +0200 Subject: [PATCH 42/95] fix what merge of master broke --- ports/tensorflow-cc/portfile.cmake | 59 +++++++++++++----------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index a190bf7a27294f..72cb0b09a33636 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -6,29 +6,6 @@ endif() set(TF_VERSION 2.3.0) -set(STATIC_ONLY_PATCHES "") -set(LINUX_ONLY_PATCHES "") -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end -endif() -if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) - set(LINUX_ONLY_PATCHES fix-linux-build.patch) -endif() -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO tensorflow/tensorflow - REF "v${TF_VERSION}" - SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac - HEAD_REF master - PATCHES - file-exists.patch # required or otherwise it cant find python lib path on windows - fix-build-error.patch # Fix namespace error - fix-dbg-build-errors.patch # Fix no return statement - fix-more-build-errors.patch # Fix no return statement - ${STATIC_ONLY_PATCHES} - ${LINUX_ONLY_PATCHES} -) - vcpkg_find_acquire_program(BAZEL) get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) vcpkg_add_to_path(PREPEND ${BAZEL_DIR}) @@ -47,7 +24,7 @@ get_filename_component(GIT_DIR "${GIT}" DIRECTORY) vcpkg_add_to_path(PREPEND ${GIT_DIR}) if(CMAKE_HOST_WIN32) - vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils mingw-w64-x86_64-python-numpy) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils mingw-w64-x86_64-python-numpy) vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) @@ -78,11 +55,6 @@ set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") # check if numpy can be loaded vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) -# we currently only support the release version -tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -file(RENAME ${SOURCE_PATH} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - # tensorflow has long file names, which will not work on windows set(ENV{TEST_TMPDIR} ${BUILDTREES_DIR}/.bzl) @@ -110,8 +82,6 @@ set(ENV{CC_OPT_FLAGS} "/arch:AVX") set(ENV{TF_NEED_CUDA} 0) set(ENV{TF_CONFIGURE_IOS} 0) -file(GLOB SOURCES ${SOURCE_PATH}/*) - if(VCPKG_TARGET_IS_WINDOWS) set(BAZEL_LIB_NAME tensorflow_cc.dll) set(SCRIPT_SUFFIX windows) @@ -142,10 +112,33 @@ endif() set(N_DBG_LIB_PARTS 0) foreach(BUILD_TYPE dbg rel) + set(STATIC_ONLY_PATCHES "") + set(LINUX_ONLY_PATCHES "") + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end + endif() + if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + set(LINUX_ONLY_PATCHES fix-linux-build.patch) + endif() + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tensorflow/tensorflow + REF "v${TF_VERSION}" + SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac + HEAD_REF master + PATCHES + file-exists.patch # required or otherwise it cant find python lib path on windows + fix-build-error.patch # Fix namespace error + fix-dbg-build-errors.patch # Fix no return statement + fix-more-build-errors.patch # Fix no return statement + ${STATIC_ONLY_PATCHES} + ${LINUX_ONLY_PATCHES} + ) + message(STATUS "Configuring TensorFlow (${BUILD_TYPE})") tensorflow_try_remove_recurse_wait(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) - file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + file(RENAME ${SOURCE_PATH} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}) + set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}") vcpkg_execute_required_process( COMMAND ${PYTHON3} ${SOURCE_PATH}/configure.py --workspace "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}" From f81922c0a6b47a16a6daa18808a81163d4620fe0 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 1 Sep 2020 16:57:07 +0200 Subject: [PATCH 43/95] fix more what got broken by merging master (all packages and their dependencies are now maintained manually instead of using pacman...) --- scripts/cmake/vcpkg_acquire_msys.cmake | 149 +++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index ee1626151a9f19..b121b81c915662 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -274,6 +274,155 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) SHA512 f094a7f4926195ef7ba015f0c5c56587b1faa94d85530f07aaaa5557a1494c3bd75257d4687c8401cbf1328d23e5586a92b05f0a872caebb1a7e941a07829776 ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-numpy-1.19.0-1-any.pkg.tar.zst" + SHA512 15791fff23deda17a4452c9ca3f23210ed77ee20dcdd6e0c31d0e626a63aeb93d15ed814078729101f1cce96129b4b5e3c898396b003d794a52d7169dd027465 + DEPS mingw-w64-x86_64-openblas mingw-w64-x86_64-python + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openblas-0.3.10-2-any.pkg.tar.zst" + SHA512 3cf15ef191ceb303a7e40ad98aca94c56211b245617c17682379b5606a1a76e12d04fa1a83c6109e89620200a74917bcd981380c7749dda12fa8e79f0b923877 + DEPS mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libwinpthread + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst" + SHA512 c2dee2957356fa51aae39d907d0cc07f966028b418f74a1ea7ea551ff001c175d86781f980c0cf994207794322dcd369fa122ab78b6c6d0f0ab01e39a754e780 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-3.8.5-1-any.pkg.tar.zst" + SHA512 49bbcaa9479ff95fd21b473a1bc286886b204ec3e2e0d9466322e96a9ee07ccd8116024b54b967a87e4752057004475cac5060605e87bd5057de45efe5122a25 + DEPS mingw-w64-x86_64-bzip2 mingw-w64-x86_64-expat mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libffi mingw-w64-x86_64-mpdecimal mingw-w64-x86_64-ncurses mingw-w64-x86_64-openssl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-tcl mingw-w64-x86_64-tk mingw-w64-x86_64-xz mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-bzip2-1.0.8-1-any.pkg.tar.xz" + SHA512 6e01b26a2144f99ca00406dbce5b8c3e928ec8a3ff77e0b741b26aaf9c927e9bea8cb1b5f38cd59118307e10dd4523a0ea2a1ea61f798f99e6d605ef1d100503 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpdecimal-2.5.0-1-any.pkg.tar.zst" + SHA512 48130ff676c0235bad4648527021e597ee00aa49a4443740a134005877e2ff2ca27b30a0ac86b923192a65348b36de4e8d3f9c57d76ab42b2e21d1a92dbf7ccf + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-ncurses-6.2-1-any.pkg.tar.xz" + SHA512 1cbffe0e181a3d4ceaa8f39b2a649584b2c7d689e6a057d85cb9f84edece2cf60eddc220127c7fa4f29e4aa6e8fb4f568ef9d73582d08168607135af977407e0 + DEPS mingw-w64-x86_64-libsystre + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libsystre-1.0.1-4-any.pkg.tar.xz" + SHA512 6540e896636d00d1ea4782965b3fe4d4ef1e32e689a98d25e2987191295b319eb1de2e56be3a4b524ff94f522a6c3e55f8159c1a6f58c8739e90f8e24e2d40d8 + DEPS mingw-w64-x86_64-libtre + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libtre-git-r128.6fb7206-2-any.pkg.tar.xz" + NAME mingw-w64-x86_64-libtre + VERSION git-r128.6fb7206-2 + ANY + REPO mingw/x86_64 + SHA512 d595dbcf3a3b6ed098e46f370533ab86433efcd6b4d3dcf00bbe944ab8c17db7a20f6535b523da43b061f071a3b8aa651700b443ae14ec752ae87500ccc0332d + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-gettext + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openssl-1.1.1.g-1-any.pkg.tar.xz" + SHA512 81681089a19cae7dbdee1bc9d3148f03458fa7a1d2fd105be39299b3a0c91b34450bcfe2ad86622bc6819da1558d7217deb0807b4a7bed942a9a7a786fcd54a3 + DEPS mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-ca-certificates-20200601-1-any.pkg.tar.zst" + SHA512 21a81e1529a3ad4f6eceb3b7d4e36400712d3a690d3991131573d4aae8364965757f9b02054d93c853eb75fbb7f6173a278b122450c800b2c9a1e8017dd35e28 + DEPS mingw-w64-x86_64-p11-kit + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-p11-kit-0.23.20-2-any.pkg.tar.xz" + SHA512 c441c4928465a98aa53917df737b728275bc0f6e9b41e13de7c665a37d2111b46f057bb652a1d5a6c7cdf8a74ea15e365a727671b698f5bbb5a7cfd0b889935e + DEPS mingw-w64-x86_64-gettext mingw-w64-x86_64-libffi mingw-w64-x86_64-libtasn1 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libtasn1-4.16.0-1-any.pkg.tar.xz" + SHA512 c450cd49391b46af552a89f2f6e2c21dd5da7d40e7456b380290c514a0f06bcbd63f0f972b3c173c4237bec7b652ff22d2d330e8fdf5c888558380bd2667be64 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-sqlite3-3.33.0-1-any.pkg.tar.zst" + SHA512 eae319f87c9849049347f132efc2ecc46e9ac1ead55542e31a3ea216932a4fa5c5bae8d468d2f050e1e22068ac9fbe9d8e1aa7612cc0110cafe6605032adeb0f + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-readline mingw-w64-x86_64-tcl + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-readline-8.0.004-1-any.pkg.tar.xz" + SHA512 e3fb3030a50f677697bec0da39ba2eb979dc28991ad0e29012cbf1bda82723176148510bf924b7fce7a0b79e7b078232d69e07f3fbb7d657b8ee631841730120 + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-termcap + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-termcap-1.3.1-6-any.pkg.tar.zst" + SHA512 602d182ba0f1e20c4c51ae09b327c345bd736e6e4f22cd7d58374ac68c705dd0af97663b9b94d41870457f46bb9110abb29186d182196133618fc460f71d1300 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-tk-8.6.10-1-any.pkg.tar.xz" + SHA512 3be88b87d5e77a875ea98f0bce4192242e550eeb1b0d44abfee9c8797135a45dd3219b89006de99458dd3f9ae47da77dccc63dab25cea93fbc285af756264eb8 + DEPS mingw-w64-x86_64-tcl + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-tcl-8.6.10-1-any.pkg.tar.xz" + SHA512 c3f21588e19725598878ef13145fbe7a995c2a0c678ef0a4782e28fd64d65fe3271178369bf0c54e92123eba82f2d3da6ae2fc34acd3b20150d1e173be1c0f8f + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-xz-5.2.5-1-any.pkg.tar.xz" + SHA512 0e1336a1565cda6e78996d69ba973aaa3522392ab586f70b0b93dbe09be50baf3e14f8ba0afcc665bc885508f1a898b16f206f89eaa3cbc9985afeea6ff1c02b + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-gettext + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gettext-0.19.8.1-9-any.pkg.tar.zst" + SHA512 571a36cf60e40172aaa7a5a40b1db60bbea145d9f399603a625a57ca106679f6feb53fda73d935ce8f0057935cad5b9a8770ae4f065e54e1554a1932b48eec97 + DEPS mingw-w64-x86_64-expat mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libiconv + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-1-any.pkg.tar.zst" + SHA512 d17eff08c83d08ef020d999a2ead0d25036ada1c1bf6ed7c02bad9b56840ee5a3304acd790d86f52b83b09c1e788f0cecdf7254dc6760c3c7e478f65882cd32d + DEPS mingw-w64-x86_64-gmp mingw-w64-x86_64-libwinpthread mingw-w64-x86_64-mpc mingw-w64-x86_64-mpfr + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.2.0-1-any.pkg.tar.zst" + SHA512 e2e561ef7c1bd85bbf021ecbe4df1cfd377a5b426ec0091f267111b9f18d476d5f95a40e0ffbd97aee5f331c49dc7a8dfc2111d54cc979643fae30e564d671aa + DEPS mingw-w64-x86_64-mpfr + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.1.0-2-any.pkg.tar.zst" + SHA512 14739667242b8852f0d26547eb3297899a51fd1edafc7101b4e7489273e1efb9cb8422fc067361e3c3694c2afcc6c49fc89537f9f811ad5b9b595873112ee890 + DEPS mingw-w64-x86_64-gmp + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz" + SHA512 0b22b7363e27cec706eb79ee0c45b5fe7088a5ca69e0868e7366481ed2ea9b3f6623d340cebba0b5ed3d79e4dfc7cf15f53530eb260c6d4057bfc3d92eb8c7bc + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-expat-2.2.9-1-any.pkg.tar.xz" + SHA512 1f747b9c7e6ee680b6d8f76429e81a42e2d4ab72d5d930207c90f4513cca5158c08c8296889fd27fe07a275cdeff5d34b5de0e6d1cd982d2e1d05765d6c8c31a + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libffi-3.3-1-any.pkg.tar.xz" + SHA512 90451ac2dadcd3f1310b6af977d4c56d239500743a3d67e4f8df915e6e6f65f34d4244843d8bac5718642973be5312c17cb3fb0b4c64732cda06437e9f1ce86d + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz" + SHA512 c8e2fda532c753e0b1004596bf737c3669355f32af9b45d96c23fcef14994ba21ddf4f75138bdecc94cbf8a8c449eff530d24b74a0da47793e24ce92d154f411 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz" + SHA512 bbd4a549efc2a5f4b1e9f1be00331e8726d80401a9c6117afa9d5dd92f4ac42a06cf2ce491a988e5c6ed7a6e536f8f1746081f4944bc6d473ccd16390fea27fe + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + NAME mingw-w64-x86_64-libwinpthread + VERSION git-8.0.0.5906.c9a21571-1 + ANY + ZST + REPO mingw/x86_64 + SHA512 a6969a5db1c55ba458c1a047d0a2a9d2db6cc24266ea47f740598b149a601995d2de734a0984ac5e57ee611d5982cbc03fd6fc0f498435e8d6401bf15724caad + ) + if(PACKAGES) message(FATAL_ERROR "Unknown packages were required for vcpkg_acquire_msys(${_am_PACKAGES}): ${PACKAGES}\nThis can be resolved by explicitly passing URL/SHA pairs to DIRECT_PACKAGES.") endif() From 3d8e2f2d92e6ad18a20faaa860a5255db35fc3ef Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 2 Sep 2020 19:47:13 +0200 Subject: [PATCH 44/95] remove "unofficial" from filename --- ports/tensorflow-cc/portfile.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 72cb0b09a33636..f8ff3653057acf 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -274,14 +274,14 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAG if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-dll.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) else() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/tensorflow-cc-config-windows-lib.cmake ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) + file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) set(ALL_PARTS "tensorflow_cc::tensorflow_cc-part1") foreach(part ${TF_LIB_SUFFIXES}) - file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\n\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake "\n\ add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\n\ set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ PROPERTIES\n\ @@ -291,7 +291,7 @@ set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ ") list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") endforeach() - file(APPEND ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake "\n\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake "\n\ add_library(tensorflow_cc::tensorflow_cc INTERFACE IMPORTED)\n\ set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\n\ ") @@ -302,7 +302,7 @@ else() else() set(TF_LINKAGE_TYPE STATIC) endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/unofficial-tensorflow-cc/unofficial-tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) endif() message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${BUILDTREES_DIR}/.bzl to free diskspace.") From 2051e9e183ac6a8412defe5db97e4af0021d9347 Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 2 Sep 2020 21:53:00 +0200 Subject: [PATCH 45/95] added switch do distinct classic and manifest mode when generating config.cmake file --- ports/tensorflow-cc/portfile.cmake | 17 +++++++++++------ .../tensorflow-cc-config-windows-dll.cmake | 10 ---------- .../tensorflow-cc-config-windows-dll.cmake.in | 12 ++++++++++++ ...> tensorflow-cc-config-windows-lib.cmake.in} | 6 ++++-- .../tensorflow-cc/tensorflow-cc-config.cmake.in | 12 ++++++++---- 5 files changed, 35 insertions(+), 22 deletions(-) delete mode 100644 ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake create mode 100644 ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in rename ports/tensorflow-cc/{tensorflow-cc-config-windows-lib.cmake => tensorflow-cc-config-windows-lib.cmake.in} (53%) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index f8ff3653057acf..a25cbc1190b838 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -272,21 +272,26 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) +if(VCPKG_MANIFEST_MODE) + set(INSTALL_PREFIX ${CMAKE_BINARY_DIR}/vcpkg_installed) +else() + set(INSTALL_PREFIX ${VCPKG_INSTALLATION_ROOT}/installed) +endif() if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) else() - file(COPY ${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) - file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) set(ALL_PARTS "tensorflow_cc::tensorflow_cc-part1") foreach(part ${TF_LIB_SUFFIXES}) file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake "\n\ add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\n\ set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ PROPERTIES\n\ - IMPORTED_LOCATION \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\n\ - INTERFACE_INCLUDE_DIRECTORIES \"${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external\"\n\ + IMPORTED_LOCATION \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\n\ + INTERFACE_INCLUDE_DIRECTORIES\n\ + \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external\"\n\ + \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external\src\"\n\ )\n\ ") list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake deleted file mode 100644 index 113fac28e54907..00000000000000 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake +++ /dev/null @@ -1,10 +0,0 @@ -message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") - -add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/bin/tensorflow.dll" - IMPORTED_IMPLIB "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/bin/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" -) -set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in new file mode 100644 index 00000000000000..e78049b80d3d81 --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in @@ -0,0 +1,12 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.dll" + IMPORTED_IMPLIB "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.lib" + INTERFACE_INCLUDE_DIRECTORIES + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" +) +set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in similarity index 53% rename from ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake rename to ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in index 467142e570bc4d..260e04dbc09b3d 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in @@ -5,6 +5,8 @@ set(tensorflow_cc_FOUND TRUE) add_library(tensorflow_cc::tensorflow_cc-part1 STATIC IMPORTED) set_target_properties(tensorflow_cc::tensorflow_cc-part1 PROPERTIES - IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow.lib" + INTERFACE_INCLUDE_DIRECTORIES + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) diff --git a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in index 02a9f44425fa8f..ed02b3f2ee9c92 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in +++ b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in @@ -3,14 +3,18 @@ message(WARNING "Tensorflow has vendored dependencies. You may need to manually add_library(tensorflow_cc::tensorflow_cc ${TF_LINKAGE_TYPE} IMPORTED) set_target_properties(tensorflow_cc::tensorflow_cc PROPERTIES - IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" - INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" + INTERFACE_INCLUDE_DIRECTORIES + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) add_library(tensorflow_cc::tensorflow_framework ${TF_LINKAGE_TYPE} IMPORTED) set_target_properties(tensorflow_cc::tensorflow_framework PROPERTIES - IMPORTED_LOCATION "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" - INTERFACE_INCLUDE_DIRECTORIES "${VCPKG_INSTALLATION_ROOT}/installed/${TARGET_TRIPLET}/include/tensorflow-external" + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" + INTERFACE_INCLUDE_DIRECTORIES + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" + "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) set(tensorflow_cc_FOUND TRUE) set(tensorflow_framework_FOUND TRUE) From 1241b678255c960fec6291298b6e3340c66c72fb Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 3 Sep 2020 16:48:40 +0200 Subject: [PATCH 46/95] create symlinks for libraries without version number --- ports/tensorflow-cc/portfile.cmake | 40 ++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index a25cbc1190b838..1d2d2e5aa1a6bb 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -91,22 +91,38 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) set(SCRIPT_SUFFIX macos) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(TF_LIB_NAME "libtensorflow_cc.${TF_VERSION}.dylib") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.${TF_VERSION}.dylib") + set(TF_LIB_NAME "libtensorflow_cc.dylib") + set(TF_LIB_NAME_SHORT "libtensorflow_cc.2.dylib") + set(TF_LIB_NAME_FULL "libtensorflow_cc.${TF_VERSION}.dylib") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.dylib") + set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.2.dylib") + set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.${TF_VERSION}.dylib") else() - set(TF_LIB_NAME "libtensorflow_cc.${TF_VERSION}.a") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.${TF_VERSION}.a") + set(TF_LIB_NAME "libtensorflow_cc.a") + set(TF_LIB_NAME_SHORT "libtensorflow_cc.2.a") + set(TF_LIB_NAME_FULL "libtensorflow_cc.${TF_VERSION}.a") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.a") + set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.2.a") + set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.${TF_VERSION}.a") endif() else() set(BAZEL_LIB_NAME libtensorflow_cc.so) set(SCRIPT_SUFFIX linux) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(TF_LIB_NAME "libtensorflow_cc.so.${TF_VERSION}") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.so.${TF_VERSION}") + set(TF_LIB_NAME "libtensorflow_cc.so") + set(TF_LIB_NAME_SHORT "libtensorflow_cc.so.2") + set(TF_LIB_NAME_FULL "libtensorflow_cc.so.${TF_VERSION}") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.so") + set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.so.2") + set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.so.${TF_VERSION}") else() - set(TF_LIB_NAME "libtensorflow_cc.a.${TF_VERSION}") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.a.${TF_VERSION}") + set(TF_LIB_NAME "libtensorflow_cc.a") + set(TF_LIB_NAME_SHORT "libtensorflow_cc.a.2") + set(TF_LIB_NAME_FULL "libtensorflow_cc.a.${TF_VERSION}") + set(TF_FRAMEWORK_NAME "libtensorflow_framework.a") + set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.a.2") + set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.a.${TF_VERSION}") endif() endif() @@ -258,8 +274,12 @@ foreach(BUILD_TYPE dbg rel) endforeach() endif() else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_LIB_NAME} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_FRAMEWORK_NAME} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_LIB_NAME_FULL} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_SHORT} SYMBOLIC) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME} SYMBOLIC) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_FRAMEWORK_NAME_FULL} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_SHORT} SYMBOLIC) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME} SYMBOLIC) endif() endforeach() From 1da9b92de254c2abe1cbf8d9b34660f3afc513fd Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 3 Sep 2020 16:49:01 +0200 Subject: [PATCH 47/95] fix linux postbuild script --- ports/tensorflow-cc/convert_lib_params_linux.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index 71473dc8c7dddd..e42e178f57caf0 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,9 +1,12 @@ for sub in ("cc", "framework"): with open("libtensorflow_" + sub + ".so.2.3.0-2.params", "r") as f_in: with open("libtensorflow_" + sub + ".a.2.3.0-2.params", "w") as f_out: + skip_next = False for line in f_in: - if line.startswith("-o "): - line = line.replace(".so", ".a") - f_out.write(line) + if skip_next: + skip_next = False + continue + if line.startswith("-o"): + skip_next = True elif line.startswith("bazel-out"): f_out.write(line) From fb609b5eef13c8d3da4aa4e80a2a049b75a02de0 Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 3 Sep 2020 20:02:40 +0200 Subject: [PATCH 48/95] temporarily disable code making problems --- ports/tensorflow-cc/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 1d2d2e5aa1a6bb..25cc2e2b42d6b8 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -44,9 +44,9 @@ else() get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) - if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) - vcpkg_execute_required_process(COMMAND sudo apt-get -y install python3-pip WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME install-pip-${TARGET_TRIPLET}) - endif() + #if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + # vcpkg_execute_required_process(COMMAND sudo apt-get -y install python3-pip WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME install-pip-${TARGET_TRIPLET}) + #endif() vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) endif() From ec687416a2e48102aecb287c2ea3559e37236d88 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 4 Sep 2020 15:09:23 +0200 Subject: [PATCH 49/95] add note for linking on Linux and macOS --- ports/tensorflow-cc/portfile.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 25cc2e2b42d6b8..b988f87831d983 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,5 +1,3 @@ -message(STATUS "This TensorFlow port currently is experimental.") - if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) message(FATAL_ERROR "TensorFlow does not support 32bit systems.") endif() @@ -287,11 +285,18 @@ file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/i if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") + if(NOT VCPKG_TARGET_IS_WINDOWS) + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") + endif() endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) +if(NOT VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow) +endif() + if(VCPKG_MANIFEST_MODE) set(INSTALL_PREFIX ${CMAKE_BINARY_DIR}/vcpkg_installed) else() From 84af4a066999e6e988216fabe6a5811a2c123245 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 4 Sep 2020 15:10:14 +0200 Subject: [PATCH 50/95] forget to add README file in previous commit --- ports/tensorflow-cc/README | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ports/tensorflow-cc/README diff --git a/ports/tensorflow-cc/README b/ports/tensorflow-cc/README new file mode 100644 index 00000000000000..6d5439816f4027 --- /dev/null +++ b/ports/tensorflow-cc/README @@ -0,0 +1,2 @@ +Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., + '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' From 7f599a258c082006230b64060d8559397cf320e8 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 4 Sep 2020 15:45:49 +0200 Subject: [PATCH 51/95] add file forgotton in macro fixing patch --- .../change-macros-for-static-lib.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ports/tensorflow-cc/change-macros-for-static-lib.patch b/ports/tensorflow-cc/change-macros-for-static-lib.patch index e338c0b378a5df..b000d5f0ea5239 100644 --- a/ports/tensorflow-cc/change-macros-for-static-lib.patch +++ b/ports/tensorflow-cc/change-macros-for-static-lib.patch @@ -207,6 +207,35 @@ diff --git a/tensorflow/c/tf_status.h b/tensorflow/c/tf_status.h #ifdef __cplusplus extern "C" { +diff --git a/tensorflow/c/tf_tensor.h b/tensorflow/c/tf_tensor.h +--- a/tensorflow/c/tf_tensor.h ++++ b/tensorflow/c/tf_tensor.h +@@ -22,24 +22,7 @@ + #include "tensorflow/c/tf_datatype.h" + #include "tensorflow/c/tf_status.h" + +-// Macro to control visibility of exported symbols in the shared library (.so, +-// .dylib, .dll). +-// This duplicates the TF_EXPORT macro definition in +-// tensorflow/core/platform/macros.h in order to keep this .h file independent +-// of any other includes. +-#ifdef SWIG + #define TF_CAPI_EXPORT +-#else +-#if defined(_WIN32) +-#ifdef TF_COMPILE_LIBRARY +-#define TF_CAPI_EXPORT __declspec(dllexport) +-#else +-#define TF_CAPI_EXPORT __declspec(dllimport) +-#endif // TF_COMPILE_LIBRARY +-#else +-#define TF_CAPI_EXPORT __attribute__((visibility("default"))) +-#endif // _WIN32 +-#endif // SWIG + + #ifdef __cplusplus + extern "C" { + diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h --- a/tensorflow/c/eager/c_api.h +++ b/tensorflow/c/eager/c_api.h From e4f15a8d3323ed5516bf33c6b0e04dabb2a23213 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 11 Sep 2020 14:26:02 +0200 Subject: [PATCH 52/95] fix python library path --- ports/tensorflow-cc/file-exists.patch | 13 ------- ports/tensorflow-cc/portfile.cmake | 9 +++-- .../vcpkg_execute_required_process.cmake | 35 ++++++++++++++++--- 3 files changed, 35 insertions(+), 22 deletions(-) delete mode 100644 ports/tensorflow-cc/file-exists.patch diff --git a/ports/tensorflow-cc/file-exists.patch b/ports/tensorflow-cc/file-exists.patch deleted file mode 100644 index 8cefb4828c7b27..00000000000000 --- a/ports/tensorflow-cc/file-exists.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure.py b/configure.py -index 43af22d..7989b1f 100644 ---- a/configure.py -+++ b/configure.py -@@ -183,7 +183,7 @@ def get_python_path(environ_cp, python_bin_path): - - paths = [] - for path in all_paths: -- if os.path.isdir(path): -+ if os.path.isdir(path) or True: - paths.append(path) - return paths - diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index b988f87831d983..056b4a51f38e92 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -37,18 +37,18 @@ if(CMAKE_HOST_WIN32) message(FATAL_ERROR "Can't find python 3. Please install and re-run vcpkg.") endif() set(PYTHON3 "${Python3_EXECUTABLE}") + # end workaround + vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) vcpkg_add_to_path(PREPEND ${PYTHON3_DIR}) - #if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) - # vcpkg_execute_required_process(COMMAND sudo apt-get -y install python3-pip WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME install-pip-${TARGET_TRIPLET}) - #endif() - vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) + vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getusersitepackages())" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) endif() set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") +set(ENV{PYTHON_LIB_PATH} "${PYTHON_LIB_PATH}") # check if numpy can be loaded vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import numpy" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-numpy-${TARGET_TRIPLET}) @@ -141,7 +141,6 @@ foreach(BUILD_TYPE dbg rel) SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac HEAD_REF master PATCHES - file-exists.patch # required or otherwise it cant find python lib path on windows fix-build-error.patch # Fix namespace error fix-dbg-build-errors.patch # Fix no return statement fix-more-build-errors.patch # Fix no return statement diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index b59675c35a5343..454d97b806a3ee 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -9,6 +9,8 @@ ## WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg> ## LOGNAME ## [TIMEOUT ] +## [OUTPUT_VARIABLE ] +## [ERROR_VARIABLE ] ## ) ## ``` ## ## Parameters @@ -28,6 +30,12 @@ ## ### TIMEOUT ## Optional timeout after which to terminate the command. ## +## ### OUTPUT_VARIABLE +## Optional variable to receive stdout of the command. +## +## ### ERROR_VARIABLE +## Optional variable to receive stderr of the command. +## ## This should be a unique name for different triplets so that the logs don't conflict when building multiple at once. ## ## ## Examples @@ -41,14 +49,25 @@ include(vcpkg_prettify_command) include(vcpkg_execute_in_download_mode) function(vcpkg_execute_required_process) - cmake_parse_arguments(vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME;TIMEOUT" "COMMAND" ${ARGN}) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME;TIMEOUT;OUTPUT_VARIABLE;ERROR_VARIABLE" "COMMAND") set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") if(vcpkg_execute_required_process_TIMEOUT) - set(TIMEOUT_PARAM "TIMEOUT;${vcpkg_execute_required_process_TIMEOUT}") + set(TIMEOUT_PARAM "TIMEOUT;${vcpkg_execute_required_process_TIMEOUT}") + else() + set(TIMEOUT_PARAM "") + endif() + if(vcpkg_execute_required_process_OUTPUT_VARIABLE) + set(OUTPUT_VARIABLE_PARAM "OUTPUT_VARIABLE;${vcpkg_execute_required_process_OUTPUT_VARIABLE}") else() - set(TIMEOUT_PARAM "") + set(OUTPUT_VARIABLE_PARAM "") + endif() + if(vcpkg_execute_required_process_ERROR_VARIABLE) + set(ERROR_VARIABLE_PARAM "ERROR_VARIABLE;${vcpkg_execute_required_process_ERROR_VARIABLE}") + else() + set(ERROR_VARIABLE_PARAM "") endif() if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) @@ -65,7 +84,9 @@ Halting portfile execution. ERROR_FILE ${LOG_ERR} RESULT_VARIABLE error_code WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY} - ${TIMEOUT_PARAM}) + ${TIMEOUT_PARAM} + ${OUTPUT_VARIABLE_PARAM} + ${ERROR_VARIABLE_PARAM}) if(error_code) set(LOGS) file(READ "${LOG_OUT}" out_contents) @@ -90,4 +111,10 @@ Halting portfile execution. ${STRINGIFIED_LOGS} ) endif() + # pass output parameters back to caller's scope + foreach(arg OUTPUT_VARIABLE ERROR_VARIABLE) + if(vcpkg_execute_required_process_${arg}) + set(${vcpkg_execute_required_process_${arg}} ${${vcpkg_execute_required_process_${arg}}} PARENT_SCOPE) + endif() + endforeach() endfunction() From da3cb5a3bc4459db0279fbe0d439381638f36b60 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 11 Sep 2020 16:10:07 +0200 Subject: [PATCH 53/95] fix macOS static link command --- ports/tensorflow-cc/generate_static_link_cmd_macos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 5aca2362a8f308..0ccf36e6248a9e 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -22,17 +22,17 @@ f_out.write(m.group(1) + "\n") tokens = line.split() parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] - line = "ar -rcs " + m1.group(1).replace(".dylib", ".a") + " " + " ".join(parts) + line = "libtool -static -o " + m1.group(1).replace(".dylib", ".a") + " " + " ".join(parts) f_out.write(line + "\n") found1 = True if found2: break - elif m2 and len(env) > 4: + elif m2 and len(env) > 5: m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") tokens = line.split() parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] - line = "ar -rcs " + m2.group(1).replace(".dylib", ".a") + " " + " ".join(parts) + line = "libtool -static -o " + m2.group(1).replace(".dylib", ".a") + " " + " ".join(parts) f_out.write(line + "\n") found2 = True if found1: From 7273f86780d8280c3187047ed1967166c7ff427a Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 11 Sep 2020 22:29:49 +0200 Subject: [PATCH 54/95] update linkage instructions in README --- ports/tensorflow-cc/README | 3 ++- .../tensorflow-cc/generate_static_link_cmd_macos.py | 2 +- ports/tensorflow-cc/portfile.cmake | 12 +++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ports/tensorflow-cc/README b/ports/tensorflow-cc/README index 6d5439816f4027..b762ae19ec65de 100644 --- a/ports/tensorflow-cc/README +++ b/ports/tensorflow-cc/README @@ -1,2 +1,3 @@ Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., - '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' + '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' on Linux and + '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' on macOS diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 0ccf36e6248a9e..601f01b4cbfa58 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -27,7 +27,7 @@ found1 = True if found2: break - elif m2 and len(env) > 5: + elif m2 and len(env) > 6: m = p_cd.match(env[0]) f_out.write(m.group(1) + "\n") tokens = line.split() diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 056b4a51f38e92..73e27fe12b7fdd 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -285,17 +285,19 @@ file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/i if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") if(NOT VCPKG_TARGET_IS_WINDOWS) - message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") + if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation'") + else() + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") + endif() + + file(COPY ${CMAKE_CURRENT_LIST_DIR}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) endif() endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) -if(NOT VCPKG_TARGET_IS_WINDOWS) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow) -endif() - if(VCPKG_MANIFEST_MODE) set(INSTALL_PREFIX ${CMAKE_BINARY_DIR}/vcpkg_installed) else() From fdc5cf699d4fc45da08918a27d16ce697156e741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Mon, 14 Sep 2020 01:27:09 -0700 Subject: [PATCH 55/95] Update ports/tensorflow-cc/CONTROL --- ports/tensorflow-cc/CONTROL | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 89cdcdeba1679f..72d9da5aeb0371 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,6 +1,5 @@ Source: tensorflow-cc Version: 2.3 -Port-Version: 1 Description: Library for computation using data flow graphs for scalable machine learning Build-Depends: c-ares Supports: !x86 From 05be090112c2f9e84bb6d437a2bf3f3f5ec14d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Mon, 14 Sep 2020 01:54:09 -0700 Subject: [PATCH 56/95] Update ports/tensorflow-cc/portfile.cmake --- ports/tensorflow-cc/portfile.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 73e27fe12b7fdd..13a5b2027437b8 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,6 +1,4 @@ -if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) - message(FATAL_ERROR "TensorFlow does not support 32bit systems.") -endif() +vcpkg_fail_port_install(ON_ARCH "x86") set(TF_VERSION 2.3.0) From faf3447ad4a2936d17072573f94df7068c546b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Mon, 14 Sep 2020 01:54:20 -0700 Subject: [PATCH 57/95] Update scripts/ci.baseline.txt --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index dc67035a54c69a..5e190a7d4c6f4e 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1662,7 +1662,6 @@ teemo:x64-osx=fail telnetpp:arm-uwp=fail telnetpp:x64-uwp=fail tensorflow-cc:arm64-windows=fail -tensorflow-cc:x86-windows=fail tensorflow-cc:x64-windows=fail tensorflow-cc:x64-windows-static=fail tesseract:x64-windows=fail From 3787012c2b0e96d150e0246381016f800025189e Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 14 Sep 2020 11:30:26 +0200 Subject: [PATCH 58/95] use vcpkg_execute_required_process --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 13a5b2027437b8..23ba05b89ac517 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -10,7 +10,7 @@ set(ENV{BAZEL_BIN_PATH} "${BAZEL}") function(tensorflow_try_remove_recurse_wait PATH_TO_REMOVE) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) if(EXISTS "${PATH_TO_REMOVE}") - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) + vcpkg_execute_required_process(COMMAND ${CMAKE_COMMAND} -E sleep 5 WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-sleep-${TARGET_TRIPLET}) file(REMOVE_RECURSE ${PATH_TO_REMOVE}) endif() endfunction() From 087722916213d3239fc942a781ad59037e63ac2f Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 14 Sep 2020 16:43:18 +0200 Subject: [PATCH 59/95] pass C_FLAGS and CXX_FLAGS to bazel --- ports/tensorflow-cc/portfile.cmake | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 23ba05b89ac517..4520f3e89ef6bb 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -180,20 +180,26 @@ foreach(BUILD_TYPE dbg rel) else() set(BUILD_OPTS "--compilation_mode=dbg") endif() + + set(COPT "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") + set(CXXOPT "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") else() set(BUILD_OPTS "--compilation_mode=opt") + + set(COPT "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") + set(CXXOPT "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --copt='${COPT}' --cxxopt='${CXXOPT}' --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -202,19 +208,19 @@ foreach(BUILD_TYPE dbg rel) if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_CRT_LINKAGE STREQUAL static) if(BUILD_TYPE STREQUAL dbg) - set(CRT_OPT "-MTd") + set(COPT "-MTd ${COPT}") else() - set(CRT_OPT "-MT") + set(COPT "-MT ${COPT}") endif() endif() vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --copt=${CRT_OPT} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From eaf1d7cb708e7b62dd62e819838fd691fb724cfa Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 14 Sep 2020 19:05:03 +0200 Subject: [PATCH 60/95] fix INTERFACE_INCLUDE_DIRECTORIES --- ports/tensorflow-cc/portfile.cmake | 6 ++---- .../tensorflow-cc-config-windows-dll.cmake.in | 4 +--- .../tensorflow-cc-config-windows-lib.cmake.in | 4 +--- ports/tensorflow-cc/tensorflow-cc-config.cmake.in | 8 ++------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 23ba05b89ac517..77a7c371457629 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -299,7 +299,7 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAG if(VCPKG_MANIFEST_MODE) set(INSTALL_PREFIX ${CMAKE_BINARY_DIR}/vcpkg_installed) else() - set(INSTALL_PREFIX ${VCPKG_INSTALLATION_ROOT}/installed) + set(INSTALL_PREFIX ${VCPKG_ROOT_DIR}/installed) endif() if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -313,9 +313,7 @@ add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\n\ set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ PROPERTIES\n\ IMPORTED_LOCATION \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\n\ - INTERFACE_INCLUDE_DIRECTORIES\n\ - \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external\"\n\ - \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external\src\"\n\ + INTERFACE_INCLUDE_DIRECTORIES \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src\"\n\ )\n\ ") list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in index e78049b80d3d81..2fac4d2f9a68e7 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in @@ -5,8 +5,6 @@ set_target_properties(tensorflow_cc::tensorflow_cc PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.dll" IMPORTED_IMPLIB "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in index 260e04dbc09b3d..b54fe2645b2fc0 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in +++ b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in @@ -6,7 +6,5 @@ add_library(tensorflow_cc::tensorflow_cc-part1 STATIC IMPORTED) set_target_properties(tensorflow_cc::tensorflow_cc-part1 PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) diff --git a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in index ed02b3f2ee9c92..3c389ca06afe2e 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in +++ b/ports/tensorflow-cc/tensorflow-cc-config.cmake.in @@ -4,17 +4,13 @@ add_library(tensorflow_cc::tensorflow_cc ${TF_LINKAGE_TYPE} IMPORTED) set_target_properties(tensorflow_cc::tensorflow_cc PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" - INTERFACE_INCLUDE_DIRECTORIES - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) add_library(tensorflow_cc::tensorflow_framework ${TF_LINKAGE_TYPE} IMPORTED) set_target_properties(tensorflow_cc::tensorflow_framework PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" - INTERFACE_INCLUDE_DIRECTORIES - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external" - "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) set(tensorflow_cc_FOUND TRUE) set(tensorflow_framework_FOUND TRUE) From 0a986ac23ff45c53bad0328df9d51f2655a59d45 Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 17 Sep 2020 21:18:42 +0200 Subject: [PATCH 61/95] fix optional c/cxx arguments --- ports/tensorflow-cc/portfile.cmake | 42 +++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 4520f3e89ef6bb..f5958cef30cb80 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -174,6 +174,8 @@ foreach(BUILD_TYPE dbg rel) endif() message(STATUS "Warning: Building TensorFlow can take an hour or more.") + set(COPTS "") + set(CXXOPTS "") if(BUILD_TYPE STREQUAL dbg) if(VCPKG_TARGET_IS_WINDOWS) set(BUILD_OPTS "--compilation_mode=dbg --features=fastbuild") # link with /DEBUG:FASTLINK instead of /DEBUG:FULL to avoid .pdb >4GB error @@ -181,25 +183,43 @@ foreach(BUILD_TYPE dbg rel) set(BUILD_OPTS "--compilation_mode=dbg") endif() - set(COPT "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") - set(CXXOPT "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_DEBUG}") + separate_arguments(VCPKG_C_FLAGS) + separate_arguments(VCPKG_C_FLAGS_DEBUG) + foreach(OPT IN LISTS VCPKG_C_FLAGS VCPKG_C_FLAGS_DEBUG) + list(APPEND COPTS "--copt=${OPT}") + endforeach() + separate_arguments(VCPKG_CXX_FLAGS) + separate_arguments(VCPKG_CXX_FLAGS_DEBUG) + foreach(OPT IN LISTS VCPKG_CXX_FLAGS VCPKG_CXX_FLAGS_DEBUG) + list(APPEND CXXOPTS "--copt=${OPT}") + endforeach() else() set(BUILD_OPTS "--compilation_mode=opt") - set(COPT "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") - set(CXXOPT "${VCPKG_CXX_FLAGS} ${VCPKG_CXX_FLAGS_RELEASE}") + separate_arguments(VCPKG_C_FLAGS) + separate_arguments(VCPKG_C_FLAGS_RELEASE) + foreach(OPT IN LISTS VCPKG_C_FLAGS VCPKG_C_FLAGS_RELEASE) + list(APPEND COPTS "--copt=${OPT}") + endforeach() + separate_arguments(VCPKG_CXX_FLAGS) + separate_arguments(VCPKG_CXX_FLAGS_RELEASE) + foreach(OPT IN LISTS VCPKG_CXX_FLAGS VCPKG_CXX_FLAGS_RELEASE) + list(APPEND CXXOPTS "--copt=${OPT}") + endforeach() endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) + list(JOIN COPTS " " COPTS) + list(JOIN CXXOPTS " " CXXOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} --copt='${COPT}' --cxxopt='${CXXOPT}' --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} ${COPTS} ${CXXOPTS} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -208,19 +228,21 @@ foreach(BUILD_TYPE dbg rel) if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_CRT_LINKAGE STREQUAL static) if(BUILD_TYPE STREQUAL dbg) - set(COPT "-MTd ${COPT}") + list(APPEND COPTS "--copt=-MTd") else() - set(COPT "-MT ${COPT}") + list(APPEND COPTS "--copt=-MT") endif() endif() + list(JOIN COPTS " " COPTS) + list(JOIN CXXOPTS " " CXXOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --copt='${COPT}' --cxxopt='${CXXOPT}' --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From bb63d8c785bf49eec94ef226043f72a3899ffff4 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 22 Sep 2020 13:44:19 +0200 Subject: [PATCH 62/95] also add linker opts --- ports/tensorflow-cc/portfile.cmake | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index f5958cef30cb80..c0c05df2f6541c 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -176,6 +176,7 @@ foreach(BUILD_TYPE dbg rel) message(STATUS "Warning: Building TensorFlow can take an hour or more.") set(COPTS "") set(CXXOPTS "") + set(LINKOPTS "") if(BUILD_TYPE STREQUAL dbg) if(VCPKG_TARGET_IS_WINDOWS) set(BUILD_OPTS "--compilation_mode=dbg --features=fastbuild") # link with /DEBUG:FASTLINK instead of /DEBUG:FULL to avoid .pdb >4GB error @@ -193,6 +194,11 @@ foreach(BUILD_TYPE dbg rel) foreach(OPT IN LISTS VCPKG_CXX_FLAGS VCPKG_CXX_FLAGS_DEBUG) list(APPEND CXXOPTS "--copt=${OPT}") endforeach() + separate_arguments(VCPKG_LINKER_FLAGS) + separate_arguments(VCPKG_LINKER_FLAGS_DEBUG) + foreach(OPT IN LISTS VCPKG_LINKER_FLAGS VCPKG_LINKER_FLAGS_DEBUG) + list(APPEND LINKOPTS "--linkopt=${OPT}") + endforeach() else() set(BUILD_OPTS "--compilation_mode=opt") @@ -206,20 +212,26 @@ foreach(BUILD_TYPE dbg rel) foreach(OPT IN LISTS VCPKG_CXX_FLAGS VCPKG_CXX_FLAGS_RELEASE) list(APPEND CXXOPTS "--copt=${OPT}") endforeach() + separate_arguments(VCPKG_LINKER_FLAGS) + separate_arguments(VCPKG_LINKER_FLAGS_RELEASE) + foreach(OPT IN LISTS VCPKG_LINKER_FLAGS VCPKG_LINKER_FLAGS_RELEASE) + list(APPEND LINKOPTS "--linkopt=${OPT}") + endforeach() endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) list(JOIN COPTS " " COPTS) list(JOIN CXXOPTS " " CXXOPTS) + list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} ${COPTS} ${CXXOPTS} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build --verbose_failures ${BUILD_OPTS} --python_path=${PYTHON3} ${COPTS} ${CXXOPTS} ${LINKOPTS} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -235,14 +247,15 @@ foreach(BUILD_TYPE dbg rel) endif() list(JOIN COPTS " " COPTS) list(JOIN CXXOPTS " " CXXOPTS) + list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers + COMMAND ${BAZEL} build -s --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true //tensorflow:${BAZEL_LIB_NAME} //tensorflow:install_headers WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From ca81fb9457e3332cb2e7c741d74404ca80f6d52f Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 30 Sep 2020 13:47:14 +0200 Subject: [PATCH 63/95] update README --- ports/tensorflow-cc/README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/tensorflow-cc/README b/ports/tensorflow-cc/README index b762ae19ec65de..3768b4423c5bd4 100644 --- a/ports/tensorflow-cc/README +++ b/ports/tensorflow-cc/README @@ -1,3 +1,7 @@ Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' on Linux and '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' on macOS + + For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole framework, i.e., + '-Wl,--whole-archive -ltensorflow_framework -Wl,--no-whole-archive -ltensorflow_cc -lstdc++ -lm -ldl -lpthread' on Linux and + '-Wl,-force_load,path/to/libtensorflow_framework.a -ltensorflow_cc -lstdc++ -framework CoreFoundation -framework Security' on macOS From 8e16503289e598c9e0f1989e568fa538d39909f9 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Thu, 1 Oct 2020 21:17:31 +0200 Subject: [PATCH 64/95] merge static libs into one to support force_load (cannot force_load both due to duplicate symbols) --- .../tensorflow-cc/convert_lib_params_linux.py | 35 ++++++++++++------ .../generate_static_link_cmd_linux.py | 23 ++---------- .../generate_static_link_cmd_macos.py | 37 +++++++++++-------- ports/tensorflow-cc/portfile.cmake | 19 ++++------ ...n => tensorflow-cc-config-shared.cmake.in} | 4 +- .../tensorflow-cc-config-static.cmake.in | 9 +++++ 6 files changed, 67 insertions(+), 60 deletions(-) rename ports/tensorflow-cc/{tensorflow-cc-config.cmake.in => tensorflow-cc-config-shared.cmake.in} (84%) create mode 100644 ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index e42e178f57caf0..20ad73646b29ef 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,12 +1,25 @@ -for sub in ("cc", "framework"): - with open("libtensorflow_" + sub + ".so.2.3.0-2.params", "r") as f_in: - with open("libtensorflow_" + sub + ".a.2.3.0-2.params", "w") as f_out: - skip_next = False - for line in f_in: - if skip_next: - skip_next = False - continue - if line.startswith("-o"): - skip_next = True - elif line.startswith("bazel-out"): +with open("libtensorflow_cc.a.2.3.0-2.params", "w") as f_out: + parts = [] + with open("libtensorflow_framework.so.2.3.0-2.params", "r") as f_in: + skip_next = False + for line in f_in: + if skip_next: + skip_next = False + continue + if line.startswith("-o"): + skip_next = True + elif line.startswith("bazel-out"): + f_out.write(line) + parts.append(line) + parts = set(parts) + with open("libtensorflow_cc.so.2.3.0-2.params", "r") as f_in: + skip_next = False + for line in f_in: + if skip_next: + skip_next = False + continue + if line.startswith("-o"): + skip_next = True + elif line.startswith("bazel-out"): + if line not in parts: f_out.write(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 8d5936f585e7f0..da4ebe6f95e6ef 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -4,34 +4,19 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker1 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") - p_linker2 = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_framework\\.so\\.2\\.3\\.0-2\\.params).*") + p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] - found1 = False - found2 = False for line in f_in: if line.startswith("(cd"): # new command, reset env = [line] else: - m1 = p_linker1.match(line) - m2 = p_linker2.match(line) + m1 = p_linker.match(line) if m1: - m = p_cd.match(env[0]) - f_out.write(m.group(1) + "\n") + m2 = p_cd.match(env[0]) + f_out.write(m2.group(1) + "\n") line = "\"" + m1.group(1) + "ar\" rcs " + m1.group(2)[1:-9].replace(".so", ".a") + " " + m1.group(2).replace(".so", ".a") f_out.write(line + "\n") - found1 = True - if found2: - break - elif m2 and len(env) > 4: - m = p_cd.match(env[0]) - f_out.write(m.group(1) + "\n") - line = "\"" + m2.group(1) + "ar\" rcs " + m2.group(2)[1:-9].replace(".so", ".a") + " " + m2.group(2).replace(".so", ".a") - f_out.write(line + "\n") - found2 = True - if found1: - break else: env.append(line) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 601f01b4cbfa58..acd588840e82e1 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -8,8 +8,7 @@ p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] - found1 = False - found2 = False + parts = None for line in f_in: if line.startswith("(cd"): # new command, reset @@ -18,24 +17,30 @@ m1 = p_linker1.match(line) m2 = p_linker2.match(line) if m1: - m = p_cd.match(env[0]) - f_out.write(m.group(1) + "\n") tokens = line.split() - parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] - line = "libtool -static -o " + m1.group(1).replace(".dylib", ".a") + " " + " ".join(parts) - f_out.write(line + "\n") - found1 = True - if found2: + if parts is None: + parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + else: + m = p_cd.match(env[0]) + f_out.write(m.group(1) + "\n") + tmp = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + old = set(parts) + parts += [t for t in tmp if t not in old] + line = "libtool -static -o " + m1.group(1).replace(".dylib", ".a") + " " + " ".join(parts) + f_out.write(line + "\n") break elif m2 and len(env) > 6: - m = p_cd.match(env[0]) - f_out.write(m.group(1) + "\n") tokens = line.split() - parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] - line = "libtool -static -o " + m2.group(1).replace(".dylib", ".a") + " " + " ".join(parts) - f_out.write(line + "\n") - found2 = True - if found1: + if parts is None: + parts = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + else: + m = p_cd.match(env[0]) + f_out.write(m.group(1) + "\n") + tmp = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] + old = set(parts) + parts += [t for t in tmp if t not in old] + line = "libtool -static -o " + m2.group(1).replace("_framework", "_cc").replace(".dylib", ".a") + " " + " ".join(parts) + f_out.write(line + "\n") break else: env.append(line) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 72d5c5027fed2a..cda7f8541e09d0 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -97,9 +97,6 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) set(TF_LIB_NAME "libtensorflow_cc.a") set(TF_LIB_NAME_SHORT "libtensorflow_cc.2.a") set(TF_LIB_NAME_FULL "libtensorflow_cc.${TF_VERSION}.a") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.a") - set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.2.a") - set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.${TF_VERSION}.a") endif() else() set(BAZEL_LIB_NAME libtensorflow_cc.so) @@ -116,9 +113,6 @@ else() set(TF_LIB_NAME "libtensorflow_cc.a") set(TF_LIB_NAME_SHORT "libtensorflow_cc.a.2") set(TF_LIB_NAME_FULL "libtensorflow_cc.a.${TF_VERSION}") - set(TF_FRAMEWORK_NAME "libtensorflow_framework.a") - set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.a.2") - set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.a.${TF_VERSION}") endif() endif() @@ -313,9 +307,11 @@ foreach(BUILD_TYPE dbg rel) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_LIB_NAME_FULL} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_SHORT} SYMBOLIC) file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_LIB_NAME} SYMBOLIC) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_FRAMEWORK_NAME_FULL} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) - file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_SHORT} SYMBOLIC) - file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME} SYMBOLIC) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/${TF_FRAMEWORK_NAME_FULL} DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_SHORT} SYMBOLIC) + file(CREATE_LINK ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME_FULL} ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib/${TF_FRAMEWORK_NAME} SYMBOLIC) + endif() endif() endforeach() @@ -366,11 +362,10 @@ set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARI endif() else() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(TF_LINKAGE_TYPE SHARED) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-shared.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) else() - set(TF_LINKAGE_TYPE STATIC) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-static.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) endif() message(STATUS "You may want to delete ${CURRENT_BUILDTREES_DIR} and ${BUILDTREES_DIR}/.bzl to free diskspace.") diff --git a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in similarity index 84% rename from ports/tensorflow-cc/tensorflow-cc-config.cmake.in rename to ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in index 3c389ca06afe2e..53bf1f7f0e3542 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config.cmake.in +++ b/ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in @@ -1,12 +1,12 @@ message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") -add_library(tensorflow_cc::tensorflow_cc ${TF_LINKAGE_TYPE} IMPORTED) +add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) set_target_properties(tensorflow_cc::tensorflow_cc PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" ) -add_library(tensorflow_cc::tensorflow_framework ${TF_LINKAGE_TYPE} IMPORTED) +add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) set_target_properties(tensorflow_cc::tensorflow_framework PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" diff --git a/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in new file mode 100644 index 00000000000000..0a0b9e0e7203be --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in @@ -0,0 +1,9 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) +set_target_properties(tensorflow_cc::tensorflow_cc + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" +) +set(tensorflow_cc_FOUND TRUE) From 8677bdb8d53da6d228bfed9482526ced6b02d83b Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Thu, 1 Oct 2020 21:42:33 +0200 Subject: [PATCH 65/95] update README --- ports/tensorflow-cc/README | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/README b/ports/tensorflow-cc/README index 3768b4423c5bd4..205502d3e34855 100644 --- a/ports/tensorflow-cc/README +++ b/ports/tensorflow-cc/README @@ -2,6 +2,9 @@ Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' on Linux and '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' on macOS - For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole framework, i.e., - '-Wl,--whole-archive -ltensorflow_framework -Wl,--no-whole-archive -ltensorflow_cc -lstdc++ -lm -ldl -lpthread' on Linux and - '-Wl,-force_load,path/to/libtensorflow_framework.a -ltensorflow_cc -lstdc++ -framework CoreFoundation -framework Security' on macOS + For the static port build libtensorflow_framework.a got merged into libtensorflow_cc.a to avoid linking conflicts, + so you only need '-ltensorflow_cc'. + + For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., + '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread' on Linux and + '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security' on macOS From 180925f6b56e03e0157c4bd39b1727b1456025c4 Mon Sep 17 00:00:00 2001 From: jgehw Date: Thu, 22 Oct 2020 19:18:30 +0200 Subject: [PATCH 66/95] quote python path (it might contain spaces that don't get escaped inside outer quotes of bash command) --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index cda7f8541e09d0..a0854281c75c6c 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -219,7 +219,7 @@ foreach(BUILD_TYPE dbg rel) list(JOIN CXXOPTS " " CXXOPTS) list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From 4584d3a6eec95b68688cea9bb31205eda28f4990 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 24 Oct 2020 13:41:23 +0200 Subject: [PATCH 67/95] fix python path also for static build --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index a0854281c75c6c..21952ea2553dbf 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -243,7 +243,7 @@ foreach(BUILD_TYPE dbg rel) list(JOIN CXXOPTS " " CXXOPTS) list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path=${PYTHON3} --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) From 49f6f3847b5fd23b88211529706d216af46a074e Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 24 Oct 2020 13:54:26 +0200 Subject: [PATCH 68/95] add arm(64) as currently unsupported arch --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 21952ea2553dbf..faff67060d279e 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(ON_ARCH "x86") +vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") set(TF_VERSION 2.3.0) From a174637cdfe01c022852b639a7888a95521d6986 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 24 Oct 2020 13:55:25 +0200 Subject: [PATCH 69/95] bazel 3.7 is available -> remove workaround --- ports/tensorflow-cc/portfile.cmake | 9 +-------- scripts/ci.baseline.txt | 3 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index faff67060d279e..e5591b328630c2 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -28,14 +28,7 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) - #set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") - # workaround: use local installation until bazel fix https://github.com/bazelbuild/bazel/pull/12002 is available - find_package(Python3 COMPONENTS Interpreter) - if(NOT Python3_Interpreter_FOUND) - message(FATAL_ERROR "Can't find python 3. Please install and re-run vcpkg.") - endif() - set(PYTHON3 "${Python3_EXECUTABLE}") - # end workaround + set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) else() vcpkg_find_acquire_program(PYTHON3) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index f745eb68ee3b07..c8b3f3029e8d51 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1633,9 +1633,6 @@ teemo:arm64-windows=fail teemo:x64-osx=fail telnetpp:arm-uwp=fail telnetpp:x64-uwp=fail -tensorflow-cc:arm64-windows=fail -tensorflow-cc:x64-windows=fail -tensorflow-cc:x64-windows-static=fail tesseract:x64-windows=fail tesseract:x64-windows-static=fail tesseract:x86-windows=fail diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index d7a2f887d28ce2..edf0d6b27d4e44 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -394,7 +394,7 @@ function(vcpkg_find_acquire_program VAR) set(SUBDIR 6bac47ec55-25c819fd77) elseif(VAR MATCHES "BAZEL") set(PROGNAME bazel) - set(BAZEL_VERSION 3.1.0) + set(BAZEL_VERSION 3.7.0) set(_vfa_RENAME "bazel") if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_vfa_SUPPORTED ON) @@ -402,19 +402,19 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") set(ARCHIVE "bazel-${SUBDIR}-x86_64") set(NOEXTRACT ON) - set(HASH 605118766dbe07d04f4f15a809b231247eef3f302c431dcb712a514244662a47d3eb784add3b20d69d415954f7a95f9988215560911079289170a383343398d1) + set(HASH 1118eb939627cc5570616f7bd41c72a90df9bb4a3c802eb8149b5b2eebf27090535c029590737557e270c5a8556267b8c1843eb0ff55dc9e4b82581a64e07ec1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(_vfa_SUPPORTED ON) set(SUBDIR ${BAZEL_VERSION}-darwin) set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") set(ARCHIVE "bazel-${SUBDIR}-x86_64") set(NOEXTRACT ON) - set(HASH 8b21ee801a84009455ab6668c9b1f3225fffc517ffa6af5e8112e64a40558210a7a6384c6c30edabb320532d5c6d71bb476b001b6b07fb65e5378bfa3a9de082) + set(HASH e2d792f0fc03a4a57a4c2c8345141d86a2dc25a09757f26cb18534426f73d10b4de021e2a3d439956a92d2a712aae9ad75357db24d02f9b0890cc643615a997c) else() set(SUBDIR ${BAZEL_VERSION}-windows) set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64.zip") set(ARCHIVE "bazel-${SUBDIR}-x86_64.zip") - set(HASH a17fdc04e9ae12a06366a7a96c89240f95debc428ff8efba6b6d8ea160bfd25fed76b2d14cc49c07ec68d4e6bd8dd5ef3872ecc3f35dba3824e70a78245ec40a) + set(HASH 410b6788f624b3b0b9f13f5b4d12c1b24447f133210a68e2f110aff8d95bb954e40ea1d863a8cc3473402d1c2f15c38042e6af0cb207056811e4cc7bd0b9ca00) endif() elseif(VAR MATCHES "ARIA2") set(PROGNAME aria2c) From 292013fca965188d24c187031c9658d21287e399 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sun, 25 Oct 2020 00:09:38 +0200 Subject: [PATCH 70/95] update README, remove necessary c-ares from deps --- ports/tensorflow-cc/CONTROL | 3 +-- ports/tensorflow-cc/{README => README-linux} | 6 ++---- ports/tensorflow-cc/README-macos | 8 ++++++++ ports/tensorflow-cc/README-windows | 2 ++ ports/tensorflow-cc/portfile.cmake | 14 +++++++------- 5 files changed, 20 insertions(+), 13 deletions(-) rename ports/tensorflow-cc/{README => README-linux} (65%) create mode 100644 ports/tensorflow-cc/README-macos create mode 100644 ports/tensorflow-cc/README-windows diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 72d9da5aeb0371..edcdf8db6c9859 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,5 +1,4 @@ Source: tensorflow-cc Version: 2.3 Description: Library for computation using data flow graphs for scalable machine learning -Build-Depends: c-ares -Supports: !x86 +Supports: !x86 !arm !arm64 diff --git a/ports/tensorflow-cc/README b/ports/tensorflow-cc/README-linux similarity index 65% rename from ports/tensorflow-cc/README rename to ports/tensorflow-cc/README-linux index 205502d3e34855..28f5f516ac115e 100644 --- a/ports/tensorflow-cc/README +++ b/ports/tensorflow-cc/README-linux @@ -1,10 +1,8 @@ Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., - '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' on Linux and - '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' on macOS + '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' For the static port build libtensorflow_framework.a got merged into libtensorflow_cc.a to avoid linking conflicts, so you only need '-ltensorflow_cc'. For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., - '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread' on Linux and - '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security' on macOS + '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread' diff --git a/ports/tensorflow-cc/README-macos b/ports/tensorflow-cc/README-macos new file mode 100644 index 00000000000000..d89c92f9b9b62c --- /dev/null +++ b/ports/tensorflow-cc/README-macos @@ -0,0 +1,8 @@ +Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., + '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' + + For the static port build libtensorflow_framework.a got merged into libtensorflow_cc.a to avoid linking conflicts, + so you only need '-ltensorflow_cc'. + + For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., + '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security' diff --git a/ports/tensorflow-cc/README-windows b/ports/tensorflow-cc/README-windows new file mode 100644 index 00000000000000..33ae7a936db086 --- /dev/null +++ b/ports/tensorflow-cc/README-windows @@ -0,0 +1,2 @@ +Note: For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., link using options + '/WHOLEARCHIVE:tensorflow_cc.lib /WHOLEARCHIVE:tensorflow_cc-part2.lib ... /WHOLEARCHIVE:tensorflow_cc-part6.lib' diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index e5591b328630c2..df641787a2474c 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -73,11 +73,11 @@ set(ENV{TF_CONFIGURE_IOS} 0) if(VCPKG_TARGET_IS_WINDOWS) set(BAZEL_LIB_NAME tensorflow_cc.dll) - set(SCRIPT_SUFFIX windows) + set(PLATFORM_SUFFIX windows) set(STATIC_LINK_CMD static_link.bat) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) set(BAZEL_LIB_NAME libtensorflow_cc.dylib) - set(SCRIPT_SUFFIX macos) + set(PLATFORM_SUFFIX macos) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(TF_LIB_NAME "libtensorflow_cc.dylib") @@ -93,7 +93,7 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) endif() else() set(BAZEL_LIB_NAME libtensorflow_cc.so) - set(SCRIPT_SUFFIX linux) + set(PLATFORM_SUFFIX linux) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(TF_LIB_NAME "libtensorflow_cc.so") @@ -249,13 +249,13 @@ foreach(BUILD_TYPE dbg rel) endif() if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${SCRIPT_SUFFIX}.py" "${N_DBG_LIB_PARTS}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) endif() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${SCRIPT_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -318,9 +318,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) else() message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") endif() - - file(COPY ${CMAKE_CURRENT_LIST_DIR}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) endif() + + configure_file(${CMAKE_CURRENT_LIST_DIR}/README-${PLATFORM_SUFFIX} ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/README COPYONLY) endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) From f8e004c907465a674b8bb923b0b7b686c7101cd6 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 00:55:17 +0200 Subject: [PATCH 71/95] update msys package --- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index cbe4fc548d5d1b..32c271f8a90d73 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -289,8 +289,8 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) DEPS libiconv ) msys_package( - URL "https://repo.msys2.org/msys/x86_64/libiconv-1.16-1-x86_64.pkg.tar.xz" - SHA512 6f9b778d449410273a50cdd1af737cdcb8890a5536d78211477eed7382340253c7aadfb04977f1038ae4f4cef5a641f1acfda26fd06323d0b196a3e6da7fd425 + URL "https://repo.msys2.org/msys/x86_64/libiconv-1.16-2-x86_64.pkg.tar.zst" + SHA512 3ab569eca9887ef85e7dd5dbca3143d8a60f7103f370a7ecc979a58a56b0c8dcf1f54ac3df4495bc306bd44bf36ee285aaebbb221c4eebfc912cf47d347d45fc DEPS gcc-libs ) msys_package( From 0ab5c4e971b9e95dd3fe95bf2abbfded36c21307 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 15:33:36 +0100 Subject: [PATCH 72/95] add uwp specific options, and minor general improvements --- ports/tensorflow-cc/portfile.cmake | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index df641787a2474c..06a7149f0f6573 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,6 +1,7 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") set(TF_VERSION 2.3.0) +set(TF_VERSION_SHORT 2.3) vcpkg_find_acquire_program(BAZEL) get_filename_component(BAZEL_DIR "${BAZEL}" DIRECTORY) @@ -22,6 +23,7 @@ vcpkg_add_to_path(PREPEND ${GIT_DIR}) if(CMAKE_HOST_WIN32) vcpkg_acquire_msys(MSYS_ROOT PACKAGES bash unzip patch diffutils libintl gzip coreutils mingw-w64-x86_64-python-numpy) vcpkg_add_to_path(${MSYS_ROOT}/usr/bin) + vcpkg_add_to_path(${MSYS_ROOT}/mingw64/bin) set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) set(ENV{BAZEL_SH} ${MSYS_ROOT}/usr/bin/bash.exe) @@ -30,6 +32,8 @@ if(CMAKE_HOST_WIN32) set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) + + string(REGEX REPLACE "/" "\\\\" PYTHON3 $ENV{PYTHON_BIN_PATH}) else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) @@ -37,8 +41,9 @@ else() vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getusersitepackages())" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) + + set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") endif() -set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") set(ENV{PYTHON_LIB_PATH} "${PYTHON_LIB_PATH}") # check if numpy can be loaded @@ -65,7 +70,7 @@ set(ENV{TF_NEED_IGNITE} 0) set(ENV{TF_NEED_ROCM} 0) set(ENV{TF_SET_ANDROID_WORKSPACE} 0) set(ENV{TF_DOWNLOAD_CLANG} 0) -set(ENV{TF_NCCL_VERSION} 2.3) +set(ENV{TF_NCCL_VERSION} ${TF_VERSION_SHORT}) set(ENV{NCCL_INSTALL_PATH} "") set(ENV{CC_OPT_FLAGS} "/arch:AVX") set(ENV{TF_NEED_CUDA} 0) @@ -75,7 +80,7 @@ if(VCPKG_TARGET_IS_WINDOWS) set(BAZEL_LIB_NAME tensorflow_cc.dll) set(PLATFORM_SUFFIX windows) set(STATIC_LINK_CMD static_link.bat) -elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) +elseif(VCPKG_TARGET_IS_OSX) set(BAZEL_LIB_NAME libtensorflow_cc.dylib) set(PLATFORM_SUFFIX macos) set(STATIC_LINK_CMD sh static_link.sh) @@ -116,7 +121,7 @@ foreach(BUILD_TYPE dbg rel) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end endif() - if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_OSX) set(LINUX_ONLY_PATCHES fix-linux-build.patch) endif() vcpkg_from_github( @@ -206,6 +211,12 @@ foreach(BUILD_TYPE dbg rel) endforeach() endif() + if (VCPKG_TARGET_IS_UWP) + list(APPEND COPTS "--copt=-DWINAPI_FAMILY=WINAPI_FAMILY_APP") + list(APPEND COPTS "--copt=-D_WIN32_WINNT=0x0A00") + list(APPEND LINKOPTS "--linkopt=-APPCONTAINER") + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) list(JOIN COPTS " " COPTS) @@ -247,7 +258,7 @@ foreach(BUILD_TYPE dbg rel) LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) endif() - if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(NOT VCPKG_TARGET_IS_OSX) vcpkg_execute_build_process( COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow @@ -313,7 +324,7 @@ file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/i if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") if(NOT VCPKG_TARGET_IS_WINDOWS) - if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(VCPKG_TARGET_IS_OSX) message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation'") else() message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") From 920af34be49821f23ad615137fc87bd72b89e443 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 16:05:19 +0100 Subject: [PATCH 73/95] fix string replace --- ports/tensorflow-cc/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 06a7149f0f6573..fce6cb4d841e92 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -33,7 +33,7 @@ if(CMAKE_HOST_WIN32) set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) - string(REGEX REPLACE "/" "\\\\" PYTHON3 $ENV{PYTHON_BIN_PATH}) + string(REPLACE "/" "\\\\" ENV{PYTHON_BIN_PATH} $PYTHON3) else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) From 6594588be860c45b7827afd3c3fda2ed8c654b34 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 16:51:59 +0100 Subject: [PATCH 74/95] fix control file and windows path separator --- ports/tensorflow-cc/CONTROL | 2 +- ports/tensorflow-cc/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index edcdf8db6c9859..6b277bdfd9aae1 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,4 +1,4 @@ Source: tensorflow-cc Version: 2.3 Description: Library for computation using data flow graphs for scalable machine learning -Supports: !x86 !arm !arm64 +Supports: !(x86|arm|arm64) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index fce6cb4d841e92..bae42671c79886 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -33,7 +33,7 @@ if(CMAKE_HOST_WIN32) set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) - string(REPLACE "/" "\\\\" ENV{PYTHON_BIN_PATH} $PYTHON3) + string(REPLACE "/" "\\" ENV{PYTHON_BIN_PATH} $PYTHON3) else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) From 0a2292078fdd7398f58b417c23339f14f29727ab Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 18:01:35 +0100 Subject: [PATCH 75/95] revert backslashes-fix -- the root cause was missing .exe extension --- ports/tensorflow-cc/portfile.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index bae42671c79886..0866abca737ee5 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -30,10 +30,8 @@ if(CMAKE_HOST_WIN32) set(ENV{BAZEL_VC} $ENV{VCInstallDir}) set(ENV{BAZEL_VC_FULL_VERSION} $ENV{VCToolsVersion}) - set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3") + set(PYTHON3 "${MSYS_ROOT}/mingw64/bin/python3.exe") vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getsitepackages()[0])" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) - - string(REPLACE "/" "\\" ENV{PYTHON_BIN_PATH} $PYTHON3) else() vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) @@ -41,9 +39,8 @@ else() vcpkg_execute_required_process(COMMAND ${PYTHON3} -m pip install --user -U numpy WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pip-${TARGET_TRIPLET}) vcpkg_execute_required_process(COMMAND ${PYTHON3} -c "import site; print(site.getusersitepackages())" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} LOGNAME prerequesits-pypath-${TARGET_TRIPLET} OUTPUT_VARIABLE PYTHON_LIB_PATH) - - set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") endif() +set(ENV{PYTHON_BIN_PATH} "${PYTHON3}") set(ENV{PYTHON_LIB_PATH} "${PYTHON_LIB_PATH}") # check if numpy can be loaded From 4ef92525f44a0472af1f3c805b1526be48ff9283 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 20:55:06 +0100 Subject: [PATCH 76/95] upgrade to tf 2.3.1 --- ports/tensorflow-cc/CONTROL | 2 +- ports/tensorflow-cc/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 6b277bdfd9aae1..415b146540c83d 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,4 +1,4 @@ Source: tensorflow-cc -Version: 2.3 +Version: 2.3.1 Description: Library for computation using data flow graphs for scalable machine learning Supports: !(x86|arm|arm64) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 0866abca737ee5..ce3b053d2f905f 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,6 +1,6 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") -set(TF_VERSION 2.3.0) +set(TF_VERSION 2.3.1) set(TF_VERSION_SHORT 2.3) vcpkg_find_acquire_program(BAZEL) @@ -125,7 +125,7 @@ foreach(BUILD_TYPE dbg rel) OUT_SOURCE_PATH SOURCE_PATH REPO tensorflow/tensorflow REF "v${TF_VERSION}" - SHA512 86aa087ea84dac1ecc1023b23a378100d41cc6778ccd20404a4b955fc67cef11b3dc08abcc5b88020124d221e6fb172b33bd5206e9c9db6bc8fbeed399917eac + SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0 HEAD_REF master PATCHES fix-build-error.patch # Fix namespace error From 41e2f801fbc2a8c28f4900b3501dfa4c444c11f4 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler Date: Sun, 25 Oct 2020 22:57:24 +0100 Subject: [PATCH 77/95] fix hard-coded version --- .../tensorflow-cc/convert_lib_params_linux.py | 10 +++++++--- .../generate_static_link_cmd_linux.py | 2 +- .../generate_static_link_cmd_macos.py | 4 ++-- ports/tensorflow-cc/portfile.cmake | 18 +++++++++++++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index 20ad73646b29ef..d694ecc5ff1bb1 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,6 +1,10 @@ -with open("libtensorflow_cc.a.2.3.0-2.params", "w") as f_out: +import sys + +version = sys.argv[1] + +with open("libtensorflow_cc.a." + version + "-2.params", "w") as f_out: parts = [] - with open("libtensorflow_framework.so.2.3.0-2.params", "r") as f_in: + with open("libtensorflow_framework.so." + version + "-2.params", "r") as f_in: skip_next = False for line in f_in: if skip_next: @@ -12,7 +16,7 @@ f_out.write(line) parts.append(line) parts = set(parts) - with open("libtensorflow_cc.so.2.3.0-2.params", "r") as f_in: + with open("libtensorflow_cc.so." + version + "-2.params", "r") as f_in: skip_next = False for line in f_in: if skip_next: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index da4ebe6f95e6ef..209db7580ba4a5 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -4,7 +4,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.2\\.3\\.0-2\\.params).*") + p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.\\d\\.\\d\\.\\d-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] for line in f_in: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index acd588840e82e1..3c0b0e6e1100db 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -4,8 +4,8 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.2\\.3\\.0\\.dylib)") - p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.2\\.3\\.0\\.dylib)") + p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.\\d\\.\\d\\.\\d\\.dylib)") + p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.\\d\\.\\d\\.\\d\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] parts = None diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index ce3b053d2f905f..43d1943be48703 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -256,11 +256,19 @@ foreach(BUILD_TYPE dbg rel) ) endif() if(NOT VCPKG_TARGET_IS_OSX) - vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow - LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} - ) + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + else() + vcpkg_execute_build_process( + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow + LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} + ) + endif() endif() vcpkg_execute_build_process( COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr From f064862eabf1ab5dcf3f7241a4c0ce725dd3c933 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 27 Oct 2020 13:12:29 +0100 Subject: [PATCH 78/95] remove uwp work-in-progress code so that PR can be merged --- ports/tensorflow-cc/CONTROL | 2 +- ports/tensorflow-cc/portfile.cmake | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 415b146540c83d..d422260e33bb20 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,4 +1,4 @@ Source: tensorflow-cc Version: 2.3.1 Description: Library for computation using data flow graphs for scalable machine learning -Supports: !(x86|arm|arm64) +Supports: !(x86|arm|uwp) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 43d1943be48703..278888b8e01d06 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,4 +1,4 @@ -vcpkg_fail_port_install(ON_ARCH "x86" "arm" "arm64") +vcpkg_fail_port_install(ON_ARCH "x86" "arm") set(TF_VERSION 2.3.1) set(TF_VERSION_SHORT 2.3) @@ -208,12 +208,6 @@ foreach(BUILD_TYPE dbg rel) endforeach() endif() - if (VCPKG_TARGET_IS_UWP) - list(APPEND COPTS "--copt=-DWINAPI_FAMILY=WINAPI_FAMILY_APP") - list(APPEND COPTS "--copt=-D_WIN32_WINNT=0x0A00") - list(APPEND LINKOPTS "--linkopt=-APPCONTAINER") - endif() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) list(JOIN COPTS " " COPTS) From a68ae0720a4789b267e9825f917c261e7609f299 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 27 Oct 2020 14:50:59 +0100 Subject: [PATCH 79/95] add [tensorflow] C API port --- ports/tensorflow-cc/CONTROL | 2 +- .../tensorflow-cc/convert_lib_params_linux.py | 5 +- .../convert_lib_params_windows.py | 15 +-- .../generate_static_link_cmd_linux.py | 3 +- .../generate_static_link_cmd_macos.py | 5 +- .../generate_static_link_cmd_windows.py | 5 +- .../tensorflow-cc-config-shared.cmake.in | 16 --- .../tensorflow-cc-config-static.cmake.in | 9 -- .../tensorflow-cc-config-windows-lib.cmake.in | 10 -- ...portfile.cmake => tensorflow-common.cmake} | 105 +++++++++--------- .../tensorflow-config-shared.cmake.in | 16 +++ .../tensorflow-config-static.cmake.in | 9 ++ ...=> tensorflow-config-windows-dll.cmake.in} | 6 +- .../tensorflow-config-windows-lib.cmake.in | 10 ++ ports/tensorflow/CONTROL | 4 + ports/tensorflow/portfile.cmake | 16 +++ 16 files changed, 130 insertions(+), 106 deletions(-) delete mode 100644 ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in delete mode 100644 ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in delete mode 100644 ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in rename ports/tensorflow-cc/{portfile.cmake => tensorflow-common.cmake} (72%) create mode 100644 ports/tensorflow-cc/tensorflow-config-shared.cmake.in create mode 100644 ports/tensorflow-cc/tensorflow-config-static.cmake.in rename ports/tensorflow-cc/{tensorflow-cc-config-windows-dll.cmake.in => tensorflow-config-windows-dll.cmake.in} (53%) create mode 100644 ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in create mode 100644 ports/tensorflow/CONTROL create mode 100644 ports/tensorflow/portfile.cmake diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index d422260e33bb20..2be1ccb14cdd76 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,4 +1,4 @@ Source: tensorflow-cc Version: 2.3.1 -Description: Library for computation using data flow graphs for scalable machine learning +Description: Library for computation using data flow graphs for scalable machine learning (C++ API version) Supports: !(x86|arm|uwp) diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index d694ecc5ff1bb1..6db7bff627bbc6 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,8 +1,9 @@ import sys version = sys.argv[1] +lib_suffix = sys.argv[2] -with open("libtensorflow_cc.a." + version + "-2.params", "w") as f_out: +with open("libtensorflow" + lib_suffix + ".a." + version + "-2.params", "w") as f_out: parts = [] with open("libtensorflow_framework.so." + version + "-2.params", "r") as f_in: skip_next = False @@ -16,7 +17,7 @@ f_out.write(line) parts.append(line) parts = set(parts) - with open("libtensorflow_cc.so." + version + "-2.params", "r") as f_in: + with open("libtensorflow" + lib_suffix + ".so." + version + "-2.params", "r") as f_in: skip_next = False for line in f_in: if skip_next: diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py index c63bc7b0f548b4..db95a90540e920 100644 --- a/ports/tensorflow-cc/convert_lib_params_windows.py +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -2,12 +2,13 @@ import sys required_number = int(sys.argv[1]) +lib_suffix = sys.argv[2] file_no = 1 -with open("tensorflow_cc.dll-2.params", "r") as f_in: +with open("tensorflow" + lib_suffix + ".dll-2.params", "r") as f_in: lib_name = None acc_size = 0 - f_out = open("tensorflow_cc.lib-2.params", "w") + f_out = open("tensorflow" + lib_suffix + ".lib-2.params", "w") for line in f_in: if line.startswith("/OUT:"): lib_name = line @@ -20,7 +21,7 @@ # we need to split the library if it is >4GB, because it's not supported even on x64 Windows f_out.close() file_no += 1 - f_out = open("tensorflow_cc.lib-2.params-part%d" % file_no, "w") + f_out = open("tensorflow" + lib_suffix + ".lib-2.params-part%d" % file_no, "w") acc_size = 0 f_out.write(lib_name.replace(".dll", "-part%d.lib" % file_no)) acc_size += size @@ -30,18 +31,18 @@ if file_no < required_number: # vcpkg requires the same number of libs for release build missing = required_number - file_no lines = None - with open("tensorflow_cc.lib-2.params-part%d" % file_no, "r") as f_in: + with open("tensorflow" + lib_suffix + ".lib-2.params-part%d" % file_no, "r") as f_in: lines = f_in.readlines() if len(lines) < missing + 2: # last lib to small, also use the one before lines = lines[1:] file_no -= 1 missing += 1 - with open("tensorflow_cc.lib-2.params-part%d" % file_no, "r") as f_in: + with open("tensorflow" + lib_suffix + ".lib-2.params-part%d" % file_no, "r") as f_in: lines = f_in.readlines() + lines assert len(lines) >= missing + 2 - with open("tensorflow_cc.lib-2.params-part%d" % file_no, "w") as f_out: + with open("tensorflow" + lib_suffix + ".lib-2.params-part%d" % file_no, "w") as f_out: f_out.writelines(lines[:-missing]) for i in range(missing): - with open("tensorflow_cc.lib-2.params-part%d" % (file_no + i + 1), "w") as f_out: + with open("tensorflow" + lib_suffix + ".lib-2.params-part%d" % (file_no + i + 1), "w") as f_out: f_out.write(lib_name.replace(".dll", "-part%d.lib" % (file_no + i + 1))) f_out.write(lines[-(missing - i)]) diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 209db7580ba4a5..e0938b94c9eab2 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -1,10 +1,11 @@ import re import sys +lib_suffix = sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow_cc\\.so\\.\\d\\.\\d\\.\\d-2\\.params).*") + p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow" + lib_suffix + "\\.so\\.\\d\\.\\d\\.\\d-2\\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] for line in f_in: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 3c0b0e6e1100db..cf1a7fd359deb6 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -1,10 +1,11 @@ import re import sys +lib_suffix = sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_cc\\.\\d\\.\\d\\.\\d\\.dylib)") + p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow" + lib_suffix + "\\.\\d\\.\\d\\.\\d\\.dylib)") p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.\\d\\.\\d\\.\\d\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] @@ -39,7 +40,7 @@ tmp = [t[16:] for t in tokens if t.startswith("-Wl,-force_load,")] old = set(parts) parts += [t for t in tmp if t not in old] - line = "libtool -static -o " + m2.group(1).replace("_framework", "_cc").replace(".dylib", ".a") + " " + " ".join(parts) + line = "libtool -static -o " + m2.group(1).replace("_framework", lib_suffix).replace(".dylib", ".a") + " " + " ".join(parts) f_out.write(line + "\n") break else: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_windows.py b/ports/tensorflow-cc/generate_static_link_cmd_windows.py index b3c01d2d218772..0895336148c9fb 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_windows.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_windows.py @@ -2,10 +2,11 @@ import re import sys +lib_suffix = sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.bat", "w") as f_out: p_setenv = re.compile("^\s*(SET .+=.*)$") - p_linker = re.compile(".+link\\.exe.+tensorflow_cc\\.dll-2\\.params.*") + p_linker = re.compile(".+link\\.exe.+tensorflow" + lib_suffix + "\\.dll-2\\.params.*") env = [] for line in f_in: if line.startswith("cd"): @@ -28,7 +29,7 @@ t = t[:-len("link.exe")] + "lib.exe\"" elif t == "/DLL" or t.lower()[1:].startswith("defaultlib:") or t.lower()[1:].startswith("ignore") or t.startswith("/OPT:") or t.startswith("/DEF:") or t.startswith("/DEBUG:") or t.startswith("/INCREMENTAL:"): continue - elif t[0] == '@' and t.endswith("tensorflow_cc.dll-2.params"): + elif t[0] == '@' and t.endswith("tensorflow" + lib_suffix + ".dll-2.params"): t = t[:-len("dll-2.params")] + "lib-2.params" params_file = t[1:] line += t + " " diff --git a/ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in deleted file mode 100644 index 53bf1f7f0e3542..00000000000000 --- a/ports/tensorflow-cc/tensorflow-cc-config-shared.cmake.in +++ /dev/null @@ -1,16 +0,0 @@ -message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") - -add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" - INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" -) -add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_framework - PROPERTIES - IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" - INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" -) -set(tensorflow_cc_FOUND TRUE) -set(tensorflow_framework_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in deleted file mode 100644 index 0a0b9e0e7203be..00000000000000 --- a/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in +++ /dev/null @@ -1,9 +0,0 @@ -message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") - -add_library(tensorflow_cc::tensorflow_cc STATIC IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc - PROPERTIES - IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" - INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" -) -set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in b/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in deleted file mode 100644 index b54fe2645b2fc0..00000000000000 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-lib.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") - -set(tensorflow_cc_FOUND TRUE) - -add_library(tensorflow_cc::tensorflow_cc-part1 STATIC IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc-part1 - PROPERTIES - IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" -) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/tensorflow-common.cmake similarity index 72% rename from ports/tensorflow-cc/portfile.cmake rename to ports/tensorflow-cc/tensorflow-common.cmake index 278888b8e01d06..abe1be4addc8d9 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -74,40 +74,40 @@ set(ENV{TF_NEED_CUDA} 0) set(ENV{TF_CONFIGURE_IOS} 0) if(VCPKG_TARGET_IS_WINDOWS) - set(BAZEL_LIB_NAME tensorflow_cc.dll) + set(BAZEL_LIB_NAME "tensorflow${TF_LIB_SUFFIX}.dll") set(PLATFORM_SUFFIX windows) set(STATIC_LINK_CMD static_link.bat) elseif(VCPKG_TARGET_IS_OSX) - set(BAZEL_LIB_NAME libtensorflow_cc.dylib) + set(BAZEL_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.dylib") set(PLATFORM_SUFFIX macos) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(TF_LIB_NAME "libtensorflow_cc.dylib") - set(TF_LIB_NAME_SHORT "libtensorflow_cc.2.dylib") - set(TF_LIB_NAME_FULL "libtensorflow_cc.${TF_VERSION}.dylib") + set(TF_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.dylib") + set(TF_LIB_NAME_SHORT "libtensorflow${TF_LIB_SUFFIX}.2.dylib") + set(TF_LIB_NAME_FULL "libtensorflow${TF_LIB_SUFFIX}.${TF_VERSION}.dylib") set(TF_FRAMEWORK_NAME "libtensorflow_framework.dylib") set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.2.dylib") set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.${TF_VERSION}.dylib") else() - set(TF_LIB_NAME "libtensorflow_cc.a") - set(TF_LIB_NAME_SHORT "libtensorflow_cc.2.a") - set(TF_LIB_NAME_FULL "libtensorflow_cc.${TF_VERSION}.a") + set(TF_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.a") + set(TF_LIB_NAME_SHORT "libtensorflow${TF_LIB_SUFFIX}.2.a") + set(TF_LIB_NAME_FULL "libtensorflow${TF_LIB_SUFFIX}.${TF_VERSION}.a") endif() else() - set(BAZEL_LIB_NAME libtensorflow_cc.so) + set(BAZEL_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.so") set(PLATFORM_SUFFIX linux) set(STATIC_LINK_CMD sh static_link.sh) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(TF_LIB_NAME "libtensorflow_cc.so") - set(TF_LIB_NAME_SHORT "libtensorflow_cc.so.2") - set(TF_LIB_NAME_FULL "libtensorflow_cc.so.${TF_VERSION}") + set(TF_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.so") + set(TF_LIB_NAME_SHORT "libtensorflow${TF_LIB_SUFFIX}.so.2") + set(TF_LIB_NAME_FULL "libtensorflow${TF_LIB_SUFFIX}.so.${TF_VERSION}") set(TF_FRAMEWORK_NAME "libtensorflow_framework.so") set(TF_FRAMEWORK_NAME_SHORT "libtensorflow_framework.so.2") set(TF_FRAMEWORK_NAME_FULL "libtensorflow_framework.so.${TF_VERSION}") else() - set(TF_LIB_NAME "libtensorflow_cc.a") - set(TF_LIB_NAME_SHORT "libtensorflow_cc.a.2") - set(TF_LIB_NAME_FULL "libtensorflow_cc.a.${TF_VERSION}") + set(TF_LIB_NAME "libtensorflow${TF_LIB_SUFFIX}.a") + set(TF_LIB_NAME_SHORT "libtensorflow${TF_LIB_SUFFIX}.a.2") + set(TF_LIB_NAME_FULL "libtensorflow${TF_LIB_SUFFIX}.a.${TF_VERSION}") endif() endif() @@ -116,10 +116,10 @@ foreach(BUILD_TYPE dbg rel) set(STATIC_ONLY_PATCHES "") set(LINUX_ONLY_PATCHES "") if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(STATIC_ONLY_PATCHES change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end + set(STATIC_ONLY_PATCHES ${TF_PATCHES_PREFIX}change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end endif() if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_OSX) - set(LINUX_ONLY_PATCHES fix-linux-build.patch) + set(LINUX_ONLY_PATCHES ${TF_PATCHES_PREFIX}fix-linux-build.patch) endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -128,9 +128,9 @@ foreach(BUILD_TYPE dbg rel) SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0 HEAD_REF master PATCHES - fix-build-error.patch # Fix namespace error - fix-dbg-build-errors.patch # Fix no return statement - fix-more-build-errors.patch # Fix no return statement + ${TF_PATCHES_PREFIX}fix-build-error.patch # Fix namespace error + ${TF_PATCHES_PREFIX}fix-dbg-build-errors.patch # Fix no return statement + ${TF_PATCHES_PREFIX}fix-more-build-errors.patch # Fix no return statement ${STATIC_ONLY_PATCHES} ${LINUX_ONLY_PATCHES} ) @@ -214,7 +214,7 @@ foreach(BUILD_TYPE dbg rel) list(JOIN CXXOPTS " " CXXOPTS) list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build --verbose_failures ${BUILD_OPTS} ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -238,7 +238,7 @@ foreach(BUILD_TYPE dbg rel) list(JOIN CXXOPTS " " CXXOPTS) list(JOIN LINKOPTS " " LINKOPTS) vcpkg_execute_build_process( - COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:tensorflow_cc.dll ///tensorflow:install_headers" + COMMAND ${BASH} --noprofile --norc -c "${BAZEL} build -s --verbose_failures ${BUILD_OPTS} --features=fully_static_link ${COPTS} ${CXXOPTS} ${LINKOPTS} --python_path='${PYTHON3}' --define=no_tensorflow_py_deps=true ///tensorflow:${BAZEL_LIB_NAME} ///tensorflow:install_headers" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME build-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -252,20 +252,21 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) endif() endif() + # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" # for some reason stdout of bazel ends up in stderr + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -284,21 +285,21 @@ foreach(BUILD_TYPE dbg rel) if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.dll DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.dll DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) # rename before copy because after copy the file might be locked by anti-malware scanners for some time so that renaming fails - file(RENAME ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.dll.if.lib ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(RENAME ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.dll.if.lib ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) if(BUILD_TYPE STREQUAL dbg) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.pdb DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) - message(STATUS "Warning: debug information tensorflow_cc.pdb will be of limited use because only a reduced set could be produced due to the 4GB internal PDB file limit even on x64.") + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.pdb DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/bin) + message(STATUS "Warning: debug information tensorflow${TF_LIB_SUFFIX}.pdb will be of limited use because only a reduced set could be produced due to the 4GB internal PDB file limit even on x64.") endif() else() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) set(TF_LIB_SUFFIXES "") # library might have been split because no more than 4GB are supported even on x64 Windows foreach(PART_NO RANGE 2 100) - if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow_cc-part${PART_NO}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) + if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}-part${PART_NO}.lib) + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow/tensorflow${TF_LIB_SUFFIX}-part${PART_NO}.lib DESTINATION ${CURRENT_PACKAGES_DIR}${DIR_PREFIX}/lib) set(N_DBG_LIB_PARTS ${PART_NO}) list(APPEND TF_LIB_SUFFIXES "-part${PART_NO}") else() @@ -318,23 +319,21 @@ foreach(BUILD_TYPE dbg rel) endif() endforeach() -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") if(NOT VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_IS_OSX) - message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation'") + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow${TF_LIB_SUFFIX} -ltensorflow_framework -lstdc++ -framework CoreFoundation'") else() - message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow${TF_LIB_SUFFIX} -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") endif() endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/README-${PLATFORM_SUFFIX} ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/README COPYONLY) + configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/README-${PLATFORM_SUFFIX} ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/README COPYONLY) endif() -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/LICENSE ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/copyright) if(VCPKG_MANIFEST_MODE) set(INSTALL_PREFIX ${CMAKE_BINARY_DIR}/vcpkg_installed) @@ -343,31 +342,31 @@ else() endif() if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-dll.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-windows-dll.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) else() - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-windows-lib.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) - set(ALL_PARTS "tensorflow_cc::tensorflow_cc-part1") + configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-windows-lib.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) + set(ALL_PARTS "tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}-part1") foreach(part ${TF_LIB_SUFFIXES}) - file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake "\n\ -add_library(tensorflow_cc::tensorflow_cc${part} STATIC IMPORTED)\n\ -set_target_properties(tensorflow_cc::tensorflow_cc${part}\n\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake "\n\ +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}${part} STATIC IMPORTED)\n\ +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}${part}\n\ PROPERTIES\n\ IMPORTED_LOCATION \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow${part}.lib\"\n\ - INTERFACE_INCLUDE_DIRECTORIES \"${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src\"\n\ + INTERFACE_INCLUDE_DIRECTORIES \"${TF_INCLUDE_DIRS}\"\n\ )\n\ ") - list(APPEND ALL_PARTS "tensorflow_cc::tensorflow_cc${part}") + list(APPEND ALL_PARTS "tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}${part}") endforeach() - file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake "\n\ -add_library(tensorflow_cc::tensorflow_cc INTERFACE IMPORTED)\n\ -set_property(TARGET tensorflow_cc::tensorflow_cc PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\n\ + file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake "\n\ +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} INTERFACE IMPORTED)\n\ +set_property(TARGET tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} PROPERTY INTERFACE_LINK_LIBRARIES ${ALL_PARTS})\n\ ") endif() else() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-shared.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-shared.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) else() - configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-cc-config-static.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow-cc/tensorflow-cc-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-static.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) endif() endif() diff --git a/ports/tensorflow-cc/tensorflow-config-shared.cmake.in b/ports/tensorflow-cc/tensorflow-config-shared.cmake.in new file mode 100644 index 00000000000000..1380b747e23d47 --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-config-shared.cmake.in @@ -0,0 +1,16 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} SHARED IMPORTED) +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${TF_INCLUDE_DIRS}" +) +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow_framework SHARED IMPORTED) +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow_framework + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_FRAMEWORK_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${TF_INCLUDE_DIRS}" +) +set(tensorflow_cc_FOUND TRUE) +set(tensorflow_framework_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-config-static.cmake.in b/ports/tensorflow-cc/tensorflow-config-static.cmake.in new file mode 100644 index 00000000000000..a897e87cf58d6e --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-config-static.cmake.in @@ -0,0 +1,9 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} STATIC IMPORTED) +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/${TF_LIB_NAME}" + INTERFACE_INCLUDE_DIRECTORIES "${TF_INCLUDE_DIRS}" +) +set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in b/ports/tensorflow-cc/tensorflow-config-windows-dll.cmake.in similarity index 53% rename from ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in rename to ports/tensorflow-cc/tensorflow-config-windows-dll.cmake.in index 2fac4d2f9a68e7..c4f400d4fd1712 100644 --- a/ports/tensorflow-cc/tensorflow-cc-config-windows-dll.cmake.in +++ b/ports/tensorflow-cc/tensorflow-config-windows-dll.cmake.in @@ -1,10 +1,10 @@ message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") -add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED) -set_target_properties(tensorflow_cc::tensorflow_cc +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} SHARED IMPORTED) +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} PROPERTIES IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.dll" IMPORTED_IMPLIB "${INSTALL_PREFIX}/${TARGET_TRIPLET}/bin/tensorflow.lib" - INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src" + INTERFACE_INCLUDE_DIRECTORIES "${TF_INCLUDE_DIRS}" ) set(tensorflow_cc_FOUND TRUE) diff --git a/ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in b/ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in new file mode 100644 index 00000000000000..587cb24b7ccf55 --- /dev/null +++ b/ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in @@ -0,0 +1,10 @@ +message(WARNING "Tensorflow has vendored dependencies. You may need to manually include files from tensorflow-external") + +set(tensorflow_cc_FOUND TRUE) + +add_library(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}-part1 STATIC IMPORTED) +set_target_properties(tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}-part1 + PROPERTIES + IMPORTED_LOCATION "${INSTALL_PREFIX}/${TARGET_TRIPLET}/lib/tensorflow.lib" + INTERFACE_INCLUDE_DIRECTORIES "${TF_INCLUDE_DIRS}" +) diff --git a/ports/tensorflow/CONTROL b/ports/tensorflow/CONTROL new file mode 100644 index 00000000000000..1083193f56bdfb --- /dev/null +++ b/ports/tensorflow/CONTROL @@ -0,0 +1,4 @@ +Source: tensorflow +Version: 2.3.1 +Description: Library for computation using data flow graphs for scalable machine learning (C API version) +Supports: !(x86|arm|uwp) diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake new file mode 100644 index 00000000000000..d244cf88aed991 --- /dev/null +++ b/ports/tensorflow/portfile.cmake @@ -0,0 +1,16 @@ +set(TF_LIB_SUFFIX "") +set(TF_PORT_SUFFIX "") +set(TF_PORT_SUFFIX_INVERSE "-cc") +set(TF_PATCHES_PREFIX "../tensorflow-cc/") +set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") +include(../tensorflow-cc/tensorflow-common) + +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/kernels.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/ops.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) From b3a6018fda5da6dd4670553cf711d6107cc46093 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 27 Oct 2020 14:51:45 +0100 Subject: [PATCH 80/95] missing in previous commit --- ports/tensorflow-cc/portfile.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 ports/tensorflow-cc/portfile.cmake diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake new file mode 100644 index 00000000000000..f957d617ac202e --- /dev/null +++ b/ports/tensorflow-cc/portfile.cmake @@ -0,0 +1,8 @@ +set(TF_LIB_SUFFIX "_cc") +set(TF_PORT_SUFFIX "-cc") +set(TF_PORT_SUFFIX_INVERSE "") +set(TF_PATCHES_PREFIX "") +set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") +include(tensorflow-common) + +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) From e2b95d1c39b0f3856186fca25e6a56a87c54bda4 Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 27 Oct 2020 16:41:28 +0100 Subject: [PATCH 81/95] fix include file --- ports/tensorflow-cc/portfile.cmake | 1 + ports/tensorflow/portfile.cmake | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index f957d617ac202e..5b0bfb427730ce 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -3,6 +3,7 @@ set(TF_PORT_SUFFIX "-cc") set(TF_PORT_SUFFIX_INVERSE "") set(TF_PATCHES_PREFIX "") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) include(tensorflow-common) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index d244cf88aed991..9da6028469d7cd 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -3,7 +3,8 @@ set(TF_PORT_SUFFIX "") set(TF_PORT_SUFFIX_INVERSE "-cc") set(TF_PATCHES_PREFIX "../tensorflow-cc/") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") -include(../tensorflow-cc/tensorflow-common) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}-cc) +include(tensorflow-common) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) From 83149c4d2b6ea45e09e778f2e04a65ff473c4cd7 Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 28 Oct 2020 18:32:40 +0100 Subject: [PATCH 82/95] remove unnecessary suffix --- ports/tensorflow-cc/portfile.cmake | 1 - ports/tensorflow-cc/tensorflow-common.cmake | 16 ++++++++-------- ports/tensorflow/portfile.cmake | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 5b0bfb427730ce..869530ba17e22f 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,6 +1,5 @@ set(TF_LIB_SUFFIX "_cc") set(TF_PORT_SUFFIX "-cc") -set(TF_PORT_SUFFIX_INVERSE "") set(TF_PATCHES_PREFIX "") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index abe1be4addc8d9..5797cd59d0eeca 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -252,13 +252,13 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${N_DBG_LIB_PARTS}" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -266,7 +266,7 @@ foreach(BUILD_TYPE dbg rel) endif() # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "${TF_PORT_SUFFIX}" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -329,7 +329,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/README-${PLATFORM_SUFFIX} ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/README COPYONLY) + configure_file(${CMAKE_CURRENT_LIST_DIR}/README-${PLATFORM_SUFFIX} ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/README COPYONLY) endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}) @@ -342,9 +342,9 @@ else() endif() if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-windows-dll.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-dll.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) else() - configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-windows-lib.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-windows-lib.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) set(ALL_PARTS "tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX}-part1") foreach(part ${TF_LIB_SUFFIXES}) file(APPEND ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake "\n\ @@ -364,9 +364,9 @@ set_property(TARGET tensorflow${TF_LIB_SUFFIX}::tensorflow${TF_LIB_SUFFIX} PROPE endif() else() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-shared.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-shared.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) else() - configure_file(${CMAKE_CURRENT_LIST_DIR}${TF_PORT_SUFFIX_INVERSE}/tensorflow-config-static.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) + configure_file(${CMAKE_CURRENT_LIST_DIR}/tensorflow-config-static.cmake.in ${CURRENT_PACKAGES_DIR}/share/tensorflow${TF_PORT_SUFFIX}/tensorflow${TF_PORT_SUFFIX}-config.cmake) endif() endif() diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index 9da6028469d7cd..688088c6763cc6 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -1,6 +1,5 @@ set(TF_LIB_SUFFIX "") set(TF_PORT_SUFFIX "") -set(TF_PORT_SUFFIX_INVERSE "-cc") set(TF_PATCHES_PREFIX "../tensorflow-cc/") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external;${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}-cc) From 48402509583ff5085ba77bc76c24f22650848b46 Mon Sep 17 00:00:00 2001 From: jgehw Date: Wed, 4 Nov 2020 16:01:09 +0100 Subject: [PATCH 83/95] update README and print out usage info in portfile --- ports/tensorflow-cc/README-linux | 14 ++++++++------ ports/tensorflow-cc/README-macos | 14 ++++++++------ ports/tensorflow-cc/README-windows | 5 ++++- ports/tensorflow-cc/portfile.cmake | 11 ++++++++--- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/ports/tensorflow-cc/README-linux b/ports/tensorflow-cc/README-linux index 28f5f516ac115e..aa7a4cb903b97d 100644 --- a/ports/tensorflow-cc/README-linux +++ b/ports/tensorflow-cc/README-linux @@ -1,8 +1,10 @@ -Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., - '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread' +Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts + (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on). - For the static port build libtensorflow_framework.a got merged into libtensorflow_cc.a to avoid linking conflicts, - so you only need '-ltensorflow_cc'. +Notes: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., + '-ltensorflow_cc -lstdc++ -lm -ldl -lpthread' - For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., - '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread' + There is no separate libtensorflow_framework.a as it got merged into libtensorflow_cc.a to avoid linking conflicts. + + For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., + '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread' diff --git a/ports/tensorflow-cc/README-macos b/ports/tensorflow-cc/README-macos index d89c92f9b9b62c..a3452046f8e63e 100644 --- a/ports/tensorflow-cc/README-macos +++ b/ports/tensorflow-cc/README-macos @@ -1,8 +1,10 @@ -Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., - '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation' +Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts + (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on). - For the static port build libtensorflow_framework.a got merged into libtensorflow_cc.a to avoid linking conflicts, - so you only need '-ltensorflow_cc'. +Notes: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., + '-ltensorflow_cc -lstdc++ -framework CoreFoundation' - For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., - '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security' + There is no separate libtensorflow_framework.a as it got merged into libtensorflow_cc.a to avoid linking conflicts. + + For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., + '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security' diff --git a/ports/tensorflow-cc/README-windows b/ports/tensorflow-cc/README-windows index 33ae7a936db086..4e1bddf17ad710 100644 --- a/ports/tensorflow-cc/README-windows +++ b/ports/tensorflow-cc/README-windows @@ -1,2 +1,5 @@ +Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts + (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on). + Note: For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., link using options - '/WHOLEARCHIVE:tensorflow_cc.lib /WHOLEARCHIVE:tensorflow_cc-part2.lib ... /WHOLEARCHIVE:tensorflow_cc-part6.lib' + '/WHOLEARCHIVE:tensorflow_cc.lib /WHOLEARCHIVE:tensorflow_cc-part2.lib /WHOLEARCHIVE:tensorflow_cc-part3.lib ...' diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 278888b8e01d06..c0e0dafd375dde 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -322,11 +322,16 @@ file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/i if(VCPKG_LIBRARY_LINKAGE STREQUAL static) message(STATUS "Warning: Static TensorFlow build contains several external dependancies that may cause linking conflicts (e.g. you cannot use openssl in your projects as TensorFlow contains boringssl and so on).") - if(NOT VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_TARGET_IS_WINDOWS) + message(STATUS "Note: For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., link using options '/WHOLEARCHIVE:tensorflow_cc.lib /WHOLEARCHIVE:tensorflow_cc-part2.lib /WHOLEARCHIVE:tensorflow_cc-part3.lib ...'") + else() + message(STATUS "Note: There is no separate libtensorflow_framework.a as it got merged into libtensorflow_cc.a to avoid linking conflicts.") if(VCPKG_TARGET_IS_OSX) - message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -framework CoreFoundation'") + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -lstdc++ -framework CoreFoundation'") + message(STATUS "Note: For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., '-Wl,-force_load,path/to/libtensorflow_cc.a -lstdc++ -framework CoreFoundation -framework Security'") else() - message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -ltensorflow_framework -lstdc++ -lm -ldl -lpthread'") + message(STATUS "Note: Beside TensorFlow itself, you'll need to also pass its dependancies on the linker commandline, i.e., '-ltensorflow_cc -lstdc++ -lm -ldl -lpthread'") + message(STATUS "Note: For some TensorFlow features (e.g. OpRegistry), it might be necessary to convince the linker to include the whole library, i.e., '-Wl,--whole-archive -ltensorflow_cc -Wl,--no-whole-archive -lstdc++ -lm -ldl -lpthread'") endif() endif() From e1c55ed5fada637c925e1aaabb791a308c6a6483 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler <44170764+jgehw@users.noreply.github.com> Date: Sat, 14 Nov 2020 23:44:04 +0100 Subject: [PATCH 84/95] Update ports/tensorflow-cc/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/tensorflow-cc/CONTROL | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/tensorflow-cc/CONTROL b/ports/tensorflow-cc/CONTROL index 2be1ccb14cdd76..392ce10136d039 100644 --- a/ports/tensorflow-cc/CONTROL +++ b/ports/tensorflow-cc/CONTROL @@ -1,4 +1,6 @@ Source: tensorflow-cc Version: 2.3.1 +Port-Version: 1 +Homepage: https://github.com/tensorflow/tensorflow Description: Library for computation using data flow graphs for scalable machine learning (C++ API version) Supports: !(x86|arm|uwp) From 51cae0de109f05fa4ae9566d196cae9da7d98d08 Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler <44170764+jgehw@users.noreply.github.com> Date: Sat, 14 Nov 2020 23:44:48 +0100 Subject: [PATCH 85/95] Update ports/tensorflow/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/tensorflow/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index 15a6adc765e4e9..7ff15a22cd0aa8 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "uwp") + set(TF_LIB_SUFFIX "") set(TF_PORT_SUFFIX "") set(TF_PATCHES_PREFIX "../tensorflow-cc/") From 52a905d294173500a8bcc70e3b8423880ba10c86 Mon Sep 17 00:00:00 2001 From: jgehw Date: Sat, 14 Nov 2020 23:48:01 +0100 Subject: [PATCH 86/95] follow-up to code review --- ports/tensorflow-cc/portfile.cmake | 2 ++ ports/tensorflow-cc/tensorflow-common.cmake | 2 -- ports/tensorflow/CONTROL | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index 5f9bb6cdabb569..ed7a0824719dea 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP") + set(TF_LIB_SUFFIX "_cc") set(TF_PORT_SUFFIX "-cc") set(TF_PATCHES_PREFIX "") diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index cbb2abbaa2e998..8cff3187f149e5 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -1,5 +1,3 @@ -vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP") - set(TF_VERSION 2.3.1) set(TF_VERSION_SHORT 2.3) diff --git a/ports/tensorflow/CONTROL b/ports/tensorflow/CONTROL index 1083193f56bdfb..dd492d8afc618f 100644 --- a/ports/tensorflow/CONTROL +++ b/ports/tensorflow/CONTROL @@ -1,4 +1,6 @@ Source: tensorflow Version: 2.3.1 +Port-Version: 1 +Homepage: https://github.com/tensorflow/tensorflow Description: Library for computation using data flow graphs for scalable machine learning (C API version) Supports: !(x86|arm|uwp) From d9549301dfb2f2bd6db0755dd366ed47d621f3fe Mon Sep 17 00:00:00 2001 From: jgehw Date: Sun, 15 Nov 2020 21:44:16 +0100 Subject: [PATCH 87/95] fix suffix parameter --- ports/tensorflow-cc/tensorflow-common.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index 8cff3187f149e5..f3053ce3e7e256 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -255,13 +255,13 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" \"${TF_LIB_SUFFIX}\" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "${TF_VERSION}" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} \"${TF_LIB_SUFFIX}\" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -269,7 +269,7 @@ foreach(BUILD_TYPE dbg rel) endif() # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "${TF_PORT_SUFFIX}" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" \"${TF_LIB_SUFFIX}\" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) From f3351f5ba36c89b39f30f622bd1fc2c2452231fe Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 16 Nov 2020 17:49:29 +0100 Subject: [PATCH 88/95] fix quoting --- ports/tensorflow-cc/tensorflow-common.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index f3053ce3e7e256..a6c8958b06cfcd 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -255,13 +255,13 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" \"${TF_LIB_SUFFIX}\" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} \"${TF_LIB_SUFFIX}\" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -269,7 +269,7 @@ foreach(BUILD_TYPE dbg rel) endif() # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" \"${TF_LIB_SUFFIX}\" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) From 43039bc2f6bfc560713f1eb5f9b7a361e7b60044 Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 16 Nov 2020 19:00:06 +0100 Subject: [PATCH 89/95] extend linux patch --- ports/tensorflow-cc/fix-linux-build.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ports/tensorflow-cc/fix-linux-build.patch b/ports/tensorflow-cc/fix-linux-build.patch index 81a6a3be8c63fb..224f28fe339a9e 100644 --- a/ports/tensorflow-cc/fix-linux-build.patch +++ b/ports/tensorflow-cc/fix-linux-build.patch @@ -62,3 +62,16 @@ diff --git a/tensorflow/core/kernels/data/experimental/snapshot_dataset_op.cc b/ // ==== Snapshot Implementation ==== /* The current snapshot on-disk layout is as follows: + +diff --git a/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc b/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc +--- a/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc ++++ b/tensorflow/core/kernels/data/experimental/data_service_dataset_op.cc +@@ -52,6 +52,8 @@ + /* static */ constexpr const char* const + DataServiceDatasetOp::kMaxOutstandingRequests; + /* static */ constexpr const char* const ++ DataServiceDatasetOp::kTaskRefreshIntervalHintMs; ++/* static */ constexpr const char* const + DataServiceDatasetOp::kIterationCounter; + /* static */ constexpr const char* const DataServiceDatasetOp::kOutputTypes; + /* static */ constexpr const char* const DataServiceDatasetOp::kOutputShapes; From d005d4d3ab79a6ade3d14e12584bd7148a7cc5ff Mon Sep 17 00:00:00 2001 From: jgehw Date: Mon, 16 Nov 2020 20:47:14 +0100 Subject: [PATCH 90/95] another try to fix quoting of possibly empty string parameter --- ports/tensorflow-cc/tensorflow-common.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index a6c8958b06cfcd..b7dfee8557fd05 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -255,13 +255,13 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_LIB_SUFFIX} + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "'${TF_LIB_SUFFIX}'" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} ${TF_LIB_SUFFIX} + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} "'${TF_LIB_SUFFIX}'" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -269,7 +269,7 @@ foreach(BUILD_TYPE dbg rel) endif() # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" ${TF_LIB_SUFFIX} + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "'${TF_LIB_SUFFIX}'" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) From 6374836b4c8a88bfb792812f22f9a7b9eea117cb Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 17 Nov 2020 15:00:40 +0100 Subject: [PATCH 91/95] different approach to fix empty string arguments --- ports/tensorflow-cc/convert_lib_params_linux.py | 2 +- ports/tensorflow-cc/convert_lib_params_windows.py | 2 +- ports/tensorflow-cc/generate_static_link_cmd_linux.py | 2 +- ports/tensorflow-cc/generate_static_link_cmd_macos.py | 2 +- ports/tensorflow-cc/generate_static_link_cmd_windows.py | 2 +- ports/tensorflow-cc/tensorflow-common.cmake | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-cc/convert_lib_params_linux.py index d49beddc3d77f9..b24d45d634f3aa 100644 --- a/ports/tensorflow-cc/convert_lib_params_linux.py +++ b/ports/tensorflow-cc/convert_lib_params_linux.py @@ -1,7 +1,7 @@ import sys version = sys.argv[1] -lib_suffix = sys.argv[2] +lib_suffix = "" if len(sys.argv) < 3 else sys.argv[2] with open(f"libtensorflow{lib_suffix}.a.{version}-2.params", "w") as f_out: parts = [] diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-cc/convert_lib_params_windows.py index c34c323ae18c5f..e150b4e5be525a 100644 --- a/ports/tensorflow-cc/convert_lib_params_windows.py +++ b/ports/tensorflow-cc/convert_lib_params_windows.py @@ -1,7 +1,7 @@ import os import sys -lib_suffix = sys.argv[1] +lib_suffix = "" if len(sys.argv) < 2 else sys.argv[1] file_no = 1 with open(f"tensorflow{lib_suffix}.dll-2.params", "r") as f_in: diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-cc/generate_static_link_cmd_linux.py index 6b3b0ea59977a0..ada87e38360f93 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_linux.py @@ -1,7 +1,7 @@ import re import sys -lib_suffix = sys.argv[2] +lib_suffix = "" if len(sys.argv) < 3 else sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-cc/generate_static_link_cmd_macos.py index 15c2b727b74111..35462ba30cb0d1 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_macos.py @@ -1,7 +1,7 @@ import re import sys -lib_suffix = sys.argv[2] +lib_suffix = "" if len(sys.argv) < 3 else sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") diff --git a/ports/tensorflow-cc/generate_static_link_cmd_windows.py b/ports/tensorflow-cc/generate_static_link_cmd_windows.py index 7e1c4ffb7e0040..6141c370567d5a 100644 --- a/ports/tensorflow-cc/generate_static_link_cmd_windows.py +++ b/ports/tensorflow-cc/generate_static_link_cmd_windows.py @@ -2,7 +2,7 @@ import re import sys -lib_suffix = sys.argv[2] +lib_suffix = "" if len(sys.argv) < 3 else sys.argv[2] with open(sys.argv[1], "r") as f_in: with open("static_link.bat", "w") as f_out: p_setenv = re.compile("^\s*(SET .+=.*)$") diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-cc/tensorflow-common.cmake index b7dfee8557fd05..a6c8958b06cfcd 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-cc/tensorflow-common.cmake @@ -255,13 +255,13 @@ foreach(BUILD_TYPE dbg rel) if(NOT VCPKG_TARGET_IS_OSX) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" "'${TF_LIB_SUFFIX}'" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) else() vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} "'${TF_LIB_SUFFIX}'" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/convert_lib_params_${PLATFORM_SUFFIX}.py" ${TF_VERSION} ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-bin/tensorflow LOGNAME postbuild1-${TARGET_TRIPLET}-${BUILD_TYPE} ) @@ -269,7 +269,7 @@ foreach(BUILD_TYPE dbg rel) endif() # for some reason stdout of bazel ends up in stderr, so use err log file in the following command vcpkg_execute_build_process( - COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" "'${TF_LIB_SUFFIX}'" + COMMAND ${PYTHON3} "${CMAKE_CURRENT_LIST_DIR}/generate_static_link_cmd_${PLATFORM_SUFFIX}.py" "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-${BUILD_TYPE}-err.log" ${TF_LIB_SUFFIX} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BUILD_TYPE}/bazel-${TARGET_TRIPLET}-${BUILD_TYPE} LOGNAME postbuild2-${TARGET_TRIPLET}-${BUILD_TYPE} ) From e45fdcf4695e008300c750e52908c0b06cc83a3c Mon Sep 17 00:00:00 2001 From: jgehw Date: Tue, 17 Nov 2020 17:51:20 +0100 Subject: [PATCH 92/95] update list of headers for tensorflow 2.3.1 (was still 2.3.0) --- ports/tensorflow/portfile.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index 7ff15a22cd0aa8..81a0b0201a1624 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -8,11 +8,13 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}-cc) include(tensorflow-common) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tensor_interface.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_attrtype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_datatype.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_file_statistics.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_status.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/tf_tensor.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/kernels.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) -file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/ops.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/c_api_experimental.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) +file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/eager/dlpack.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c/eager) From 3b3ef9ffadd15c4f7bfe2b352d331459a033668b Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler <44170764+jgehw@users.noreply.github.com> Date: Wed, 18 Nov 2020 13:31:29 +0100 Subject: [PATCH 93/95] Update ports/tensorflow/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/tensorflow/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/tensorflow/CONTROL b/ports/tensorflow/CONTROL index dd492d8afc618f..0f775ae8d9d46a 100644 --- a/ports/tensorflow/CONTROL +++ b/ports/tensorflow/CONTROL @@ -1,6 +1,6 @@ Source: tensorflow Version: 2.3.1 -Port-Version: 1 +Port-Version: 0 Homepage: https://github.com/tensorflow/tensorflow Description: Library for computation using data flow graphs for scalable machine learning (C API version) Supports: !(x86|arm|uwp) From bb1a320eeda2002034fcc594c3025e0c1cc5aa33 Mon Sep 17 00:00:00 2001 From: jgehw Date: Fri, 20 Nov 2020 15:49:34 +0100 Subject: [PATCH 94/95] move common stuff into tensorflow-common as discussed in review --- ports/tensorflow-cc/portfile.cmake | 3 +-- ports/tensorflow-common/CONTROL | 6 ++++++ .../{tensorflow-cc => tensorflow-common}/README-linux | 0 .../{tensorflow-cc => tensorflow-common}/README-macos | 0 .../README-windows | 0 .../change-macros-for-static-lib.patch | 0 .../convert_lib_params_linux.py | 0 .../convert_lib_params_windows.py | 0 .../fix-build-error.patch | 0 .../fix-dbg-build-errors.patch | 0 .../fix-linux-build.patch | 0 .../fix-more-build-errors.patch | 0 .../generate_static_link_cmd_linux.py | 0 .../generate_static_link_cmd_macos.py | 0 .../generate_static_link_cmd_windows.py | 0 ports/tensorflow-common/portfile.cmake | 1 + .../tensorflow-common.cmake | 10 +++++----- .../tensorflow-config-shared.cmake.in | 0 .../tensorflow-config-static.cmake.in | 0 .../tensorflow-config-windows-dll.cmake.in | 0 .../tensorflow-config-windows-lib.cmake.in | 0 ports/tensorflow/portfile.cmake | 3 +-- 22 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 ports/tensorflow-common/CONTROL rename ports/{tensorflow-cc => tensorflow-common}/README-linux (100%) rename ports/{tensorflow-cc => tensorflow-common}/README-macos (100%) rename ports/{tensorflow-cc => tensorflow-common}/README-windows (100%) rename ports/{tensorflow-cc => tensorflow-common}/change-macros-for-static-lib.patch (100%) rename ports/{tensorflow-cc => tensorflow-common}/convert_lib_params_linux.py (100%) rename ports/{tensorflow-cc => tensorflow-common}/convert_lib_params_windows.py (100%) rename ports/{tensorflow-cc => tensorflow-common}/fix-build-error.patch (100%) rename ports/{tensorflow-cc => tensorflow-common}/fix-dbg-build-errors.patch (100%) rename ports/{tensorflow-cc => tensorflow-common}/fix-linux-build.patch (100%) rename ports/{tensorflow-cc => tensorflow-common}/fix-more-build-errors.patch (100%) rename ports/{tensorflow-cc => tensorflow-common}/generate_static_link_cmd_linux.py (100%) rename ports/{tensorflow-cc => tensorflow-common}/generate_static_link_cmd_macos.py (100%) rename ports/{tensorflow-cc => tensorflow-common}/generate_static_link_cmd_windows.py (100%) create mode 100644 ports/tensorflow-common/portfile.cmake rename ports/{tensorflow-cc => tensorflow-common}/tensorflow-common.cmake (97%) rename ports/{tensorflow-cc => tensorflow-common}/tensorflow-config-shared.cmake.in (100%) rename ports/{tensorflow-cc => tensorflow-common}/tensorflow-config-static.cmake.in (100%) rename ports/{tensorflow-cc => tensorflow-common}/tensorflow-config-windows-dll.cmake.in (100%) rename ports/{tensorflow-cc => tensorflow-common}/tensorflow-config-windows-lib.cmake.in (100%) diff --git a/ports/tensorflow-cc/portfile.cmake b/ports/tensorflow-cc/portfile.cmake index ed7a0824719dea..783fe8b70e459b 100644 --- a/ports/tensorflow-cc/portfile.cmake +++ b/ports/tensorflow-cc/portfile.cmake @@ -2,10 +2,9 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "UWP") set(TF_LIB_SUFFIX "_cc") set(TF_PORT_SUFFIX "-cc") -set(TF_PATCHES_PREFIX "") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external ${INSTALL_PREFIX}/${TARGET_TRIPLET}/include/tensorflow-external/src") -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common") include(tensorflow-common) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow-external) diff --git a/ports/tensorflow-common/CONTROL b/ports/tensorflow-common/CONTROL new file mode 100644 index 00000000000000..a5f0364afd17eb --- /dev/null +++ b/ports/tensorflow-common/CONTROL @@ -0,0 +1,6 @@ +Source: tensorflow-common +Version: 2.3.1 +Port-Version: 0 +Homepage: https://github.com/tensorflow/tensorflow +Description: This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own. +Supports: false diff --git a/ports/tensorflow-cc/README-linux b/ports/tensorflow-common/README-linux similarity index 100% rename from ports/tensorflow-cc/README-linux rename to ports/tensorflow-common/README-linux diff --git a/ports/tensorflow-cc/README-macos b/ports/tensorflow-common/README-macos similarity index 100% rename from ports/tensorflow-cc/README-macos rename to ports/tensorflow-common/README-macos diff --git a/ports/tensorflow-cc/README-windows b/ports/tensorflow-common/README-windows similarity index 100% rename from ports/tensorflow-cc/README-windows rename to ports/tensorflow-common/README-windows diff --git a/ports/tensorflow-cc/change-macros-for-static-lib.patch b/ports/tensorflow-common/change-macros-for-static-lib.patch similarity index 100% rename from ports/tensorflow-cc/change-macros-for-static-lib.patch rename to ports/tensorflow-common/change-macros-for-static-lib.patch diff --git a/ports/tensorflow-cc/convert_lib_params_linux.py b/ports/tensorflow-common/convert_lib_params_linux.py similarity index 100% rename from ports/tensorflow-cc/convert_lib_params_linux.py rename to ports/tensorflow-common/convert_lib_params_linux.py diff --git a/ports/tensorflow-cc/convert_lib_params_windows.py b/ports/tensorflow-common/convert_lib_params_windows.py similarity index 100% rename from ports/tensorflow-cc/convert_lib_params_windows.py rename to ports/tensorflow-common/convert_lib_params_windows.py diff --git a/ports/tensorflow-cc/fix-build-error.patch b/ports/tensorflow-common/fix-build-error.patch similarity index 100% rename from ports/tensorflow-cc/fix-build-error.patch rename to ports/tensorflow-common/fix-build-error.patch diff --git a/ports/tensorflow-cc/fix-dbg-build-errors.patch b/ports/tensorflow-common/fix-dbg-build-errors.patch similarity index 100% rename from ports/tensorflow-cc/fix-dbg-build-errors.patch rename to ports/tensorflow-common/fix-dbg-build-errors.patch diff --git a/ports/tensorflow-cc/fix-linux-build.patch b/ports/tensorflow-common/fix-linux-build.patch similarity index 100% rename from ports/tensorflow-cc/fix-linux-build.patch rename to ports/tensorflow-common/fix-linux-build.patch diff --git a/ports/tensorflow-cc/fix-more-build-errors.patch b/ports/tensorflow-common/fix-more-build-errors.patch similarity index 100% rename from ports/tensorflow-cc/fix-more-build-errors.patch rename to ports/tensorflow-common/fix-more-build-errors.patch diff --git a/ports/tensorflow-cc/generate_static_link_cmd_linux.py b/ports/tensorflow-common/generate_static_link_cmd_linux.py similarity index 100% rename from ports/tensorflow-cc/generate_static_link_cmd_linux.py rename to ports/tensorflow-common/generate_static_link_cmd_linux.py diff --git a/ports/tensorflow-cc/generate_static_link_cmd_macos.py b/ports/tensorflow-common/generate_static_link_cmd_macos.py similarity index 100% rename from ports/tensorflow-cc/generate_static_link_cmd_macos.py rename to ports/tensorflow-common/generate_static_link_cmd_macos.py diff --git a/ports/tensorflow-cc/generate_static_link_cmd_windows.py b/ports/tensorflow-common/generate_static_link_cmd_windows.py similarity index 100% rename from ports/tensorflow-cc/generate_static_link_cmd_windows.py rename to ports/tensorflow-common/generate_static_link_cmd_windows.py diff --git a/ports/tensorflow-common/portfile.cmake b/ports/tensorflow-common/portfile.cmake new file mode 100644 index 00000000000000..4d51544d829d29 --- /dev/null +++ b/ports/tensorflow-common/portfile.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This meta package holds common files for the C [tensorflow] and the C++ [tensorflow-cc] API version of TensorFlow but is not installable on its own.") diff --git a/ports/tensorflow-cc/tensorflow-common.cmake b/ports/tensorflow-common/tensorflow-common.cmake similarity index 97% rename from ports/tensorflow-cc/tensorflow-common.cmake rename to ports/tensorflow-common/tensorflow-common.cmake index a6c8958b06cfcd..1f9a7203c59f20 100644 --- a/ports/tensorflow-cc/tensorflow-common.cmake +++ b/ports/tensorflow-common/tensorflow-common.cmake @@ -114,10 +114,10 @@ foreach(BUILD_TYPE dbg rel) set(STATIC_ONLY_PATCHES) set(LINUX_ONLY_PATCHES) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(STATIC_ONLY_PATCHES ${TF_PATCHES_PREFIX}change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end + set(STATIC_ONLY_PATCHES ../tensorflow-common/change-macros-for-static-lib.patch) # there is no static build option - change macros via patch and link library manually at the end endif() if(VCPKG_TARGET_IS_LINUX) - set(LINUX_ONLY_PATCHES ${TF_PATCHES_PREFIX}fix-linux-build.patch) + set(LINUX_ONLY_PATCHES ../tensorflow-common/fix-linux-build.patch) endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -126,9 +126,9 @@ foreach(BUILD_TYPE dbg rel) SHA512 e497ef4564f50abf9f918be4522cf702f4cf945cb1ebf83af1386ac4ddc7373b3ba70c7f803f8ca06faf2c6b5396e60b1e0e9b97bfbd667e733b08b6e6d70ef0 HEAD_REF master PATCHES - ${TF_PATCHES_PREFIX}fix-build-error.patch # Fix namespace error - ${TF_PATCHES_PREFIX}fix-dbg-build-errors.patch # Fix no return statement - ${TF_PATCHES_PREFIX}fix-more-build-errors.patch # Fix no return statement + ../tensorflow-common/fix-build-error.patch # Fix namespace error + ../tensorflow-common/fix-dbg-build-errors.patch # Fix no return statement + ../tensorflow-common/fix-more-build-errors.patch # Fix no return statement ${STATIC_ONLY_PATCHES} ${LINUX_ONLY_PATCHES} ) diff --git a/ports/tensorflow-cc/tensorflow-config-shared.cmake.in b/ports/tensorflow-common/tensorflow-config-shared.cmake.in similarity index 100% rename from ports/tensorflow-cc/tensorflow-config-shared.cmake.in rename to ports/tensorflow-common/tensorflow-config-shared.cmake.in diff --git a/ports/tensorflow-cc/tensorflow-config-static.cmake.in b/ports/tensorflow-common/tensorflow-config-static.cmake.in similarity index 100% rename from ports/tensorflow-cc/tensorflow-config-static.cmake.in rename to ports/tensorflow-common/tensorflow-config-static.cmake.in diff --git a/ports/tensorflow-cc/tensorflow-config-windows-dll.cmake.in b/ports/tensorflow-common/tensorflow-config-windows-dll.cmake.in similarity index 100% rename from ports/tensorflow-cc/tensorflow-config-windows-dll.cmake.in rename to ports/tensorflow-common/tensorflow-config-windows-dll.cmake.in diff --git a/ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in b/ports/tensorflow-common/tensorflow-config-windows-lib.cmake.in similarity index 100% rename from ports/tensorflow-cc/tensorflow-config-windows-lib.cmake.in rename to ports/tensorflow-common/tensorflow-config-windows-lib.cmake.in diff --git a/ports/tensorflow/portfile.cmake b/ports/tensorflow/portfile.cmake index 81a0b0201a1624..f3a43d24c2c370 100644 --- a/ports/tensorflow/portfile.cmake +++ b/ports/tensorflow/portfile.cmake @@ -2,9 +2,8 @@ vcpkg_fail_port_install(ON_ARCH "x86" "arm" ON_TARGET "uwp") set(TF_LIB_SUFFIX "") set(TF_PORT_SUFFIX "") -set(TF_PATCHES_PREFIX "../tensorflow-cc/") set(TF_INCLUDE_DIRS "${INSTALL_PREFIX}/${TARGET_TRIPLET}/include") -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}-cc) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tensorflow-common") include(tensorflow-common) file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bazel-bin/tensorflow/include/tensorflow/c/c_api.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/tensorflow/c) From d468baf53b5859479f34d7d797f5ba95f3c944fd Mon Sep 17 00:00:00 2001 From: Joachim Gehweiler <44170764+jgehw@users.noreply.github.com> Date: Sat, 21 Nov 2020 21:34:45 +0100 Subject: [PATCH 95/95] Apply suggestions from code review Co-authored-by: nicole mazzuca --- ports/tensorflow-common/generate_static_link_cmd_linux.py | 2 +- ports/tensorflow-common/generate_static_link_cmd_macos.py | 2 +- ports/tensorflow-common/generate_static_link_cmd_windows.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/tensorflow-common/generate_static_link_cmd_linux.py b/ports/tensorflow-common/generate_static_link_cmd_linux.py index ada87e38360f93..34c8db13400919 100644 --- a/ports/tensorflow-common/generate_static_link_cmd_linux.py +++ b/ports/tensorflow-common/generate_static_link_cmd_linux.py @@ -5,7 +5,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker = re.compile("^\\s*(.+)gcc.+(@bazel-out\\S+libtensorflow" + lib_suffix + "\\.so\\.\\d\\.\\d\\.\\d-2\\.params).*") + p_linker = re.compile(fr"^\s*(.+)gcc.+(@bazel-out\S+libtensorflow{lib_suffix}\.so\.\d\.\d\.\d-2\.params).*") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] for line in f_in: diff --git a/ports/tensorflow-common/generate_static_link_cmd_macos.py b/ports/tensorflow-common/generate_static_link_cmd_macos.py index 35462ba30cb0d1..bb8f6faa21f43a 100644 --- a/ports/tensorflow-common/generate_static_link_cmd_macos.py +++ b/ports/tensorflow-common/generate_static_link_cmd_macos.py @@ -5,7 +5,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.sh", "w") as f_out: p_cd = re.compile("^\\((cd .*) && \\\\$") - p_linker1 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow" + lib_suffix + "\\.\\d\\.\\d\\.\\d\\.dylib)") + p_linker1 = re.compile(fr"^.*cc_wrapper.sh.+-shared.+-o (bazel-out\S+libtensorflow{lib_suffix}\.\d\.\d\.\d\.dylib)") p_linker2 = re.compile("^.*cc_wrapper.sh.+-shared.+-o (bazel-out\\S+libtensorflow_framework\\.\\d\\.\\d\\.\\d\\.dylib)") f_out.write("#!/bin/bash\n# note: ar/binutils version 2.27 required to support output files > 4GB\n") env = [] diff --git a/ports/tensorflow-common/generate_static_link_cmd_windows.py b/ports/tensorflow-common/generate_static_link_cmd_windows.py index 6141c370567d5a..780334ad98ab83 100644 --- a/ports/tensorflow-common/generate_static_link_cmd_windows.py +++ b/ports/tensorflow-common/generate_static_link_cmd_windows.py @@ -6,7 +6,7 @@ with open(sys.argv[1], "r") as f_in: with open("static_link.bat", "w") as f_out: p_setenv = re.compile("^\s*(SET .+=.*)$") - p_linker = re.compile(".+link\\.exe.+tensorflow" + lib_suffix + "\\.dll-2\\.params.*") + p_linker = re.compile(fr".+link\.exe.+tensorflow{lib_suffix}\.dll-2\.params.*") env = [] for line in f_in: if line.startswith("cd"):