From d1266adf24b6c199ab250b9d0b29f2f90682f18d Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 26 Aug 2021 01:48:22 -0700 Subject: [PATCH 01/27] Add vcpkg-make --- ports/vcpkg-make/README.md | 7 + ports/vcpkg-make/copyright | 23 + ports/vcpkg-make/portfile.cmake | 14 + ports/vcpkg-make/vcpkg-port-config.cmake | 3 + ports/vcpkg-make/vcpkg.json | 4 + ports/vcpkg-make/vcpkg_make_build.cmake | 261 ++++++ ports/vcpkg-make/vcpkg_make_configure.cmake | 911 ++++++++++++++++++++ ports/vcpkg-make/vcpkg_make_install.cmake | 35 + 8 files changed, 1258 insertions(+) create mode 100644 ports/vcpkg-make/README.md create mode 100644 ports/vcpkg-make/copyright create mode 100644 ports/vcpkg-make/portfile.cmake create mode 100644 ports/vcpkg-make/vcpkg-port-config.cmake create mode 100644 ports/vcpkg-make/vcpkg.json create mode 100644 ports/vcpkg-make/vcpkg_make_build.cmake create mode 100644 ports/vcpkg-make/vcpkg_make_configure.cmake create mode 100644 ports/vcpkg-make/vcpkg_make_install.cmake diff --git a/ports/vcpkg-make/README.md b/ports/vcpkg-make/README.md new file mode 100644 index 00000000000000..4cb78d8fba1500 --- /dev/null +++ b/ports/vcpkg-make/README.md @@ -0,0 +1,7 @@ +# vcpkg-make + +This port contains make functions for dealing with a Make buildsystem. + +In the common case, `vcpkg_make_configure()` (with appropriate arguments) +followed by `vcpkg_make_install()` will be enough to build and install a port. +`vcpkg_make_build()` is provided for more complex cases. diff --git a/ports/vcpkg-make/copyright b/ports/vcpkg-make/copyright new file mode 100644 index 00000000000000..2e4eac8264fa4c --- /dev/null +++ b/ports/vcpkg-make/copyright @@ -0,0 +1,23 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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. diff --git a/ports/vcpkg-make/portfile.cmake b/ports/vcpkg-make/portfile.cmake new file mode 100644 index 00000000000000..25fca3be4dbb1e --- /dev/null +++ b/ports/vcpkg-make/portfile.cmake @@ -0,0 +1,14 @@ +if(NOT TARGET_TRIPLET STREQUAL _HOST_TRIPLET) + # make FATAL_ERROR in CI when issue #16773 fixed + message(WARNING "vcpkg-make is a host-only port; please mark it as a host port in your dependencies.") +endif() + +file(INSTALL + "${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_configure.cmake" + "${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_build.cmake" + "${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_install.cmake" + "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" + "${CMAKE_CURRENT_LIST_DIR}/copyright" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/vcpkg-make/vcpkg-port-config.cmake b/ports/vcpkg-make/vcpkg-port-config.cmake new file mode 100644 index 00000000000000..48f7cb8b8e30f9 --- /dev/null +++ b/ports/vcpkg-make/vcpkg-port-config.cmake @@ -0,0 +1,3 @@ +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_configure.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_build.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_make_install.cmake") diff --git a/ports/vcpkg-make/vcpkg.json b/ports/vcpkg-make/vcpkg.json new file mode 100644 index 00000000000000..a0b09becf7f7b9 --- /dev/null +++ b/ports/vcpkg-make/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "vcpkg-make", + "version-date": "2021-08-25" +} diff --git a/ports/vcpkg-make/vcpkg_make_build.cmake b/ports/vcpkg-make/vcpkg_make_build.cmake new file mode 100644 index 00000000000000..e8fb0273fa91b6 --- /dev/null +++ b/ports/vcpkg-make/vcpkg_make_build.cmake @@ -0,0 +1,261 @@ +#[===[.md: +# vcpkg_make_build + +Build a linux makefile project. + +```cmake +vcpkg_make_build( + [BUILD_TARGET ] + [ADD_BIN_TO_PATH] + [ENABLE_INSTALL] + [MAKEFILE ] + [LOGFILE_BASE ] +) +``` + +### BUILD_TARGET +The target passed to the make build command (`./make `). If not specified, the 'all' target will +be passed. + +### ADD_BIN_TO_PATH +Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. + +### ENABLE_INSTALL +IF the port supports the install target use vcpkgl_make_instal() instead of vcpkg_make_build() + +### MAKEFILE +Specifies the Makefile as a relative path from the root of the sources passed to `vcpkg_make_configure()` + +### BUILD_TARGET +The target passed to the make build command (`./make `). Defaults to 'all'. + +### INSTALL_TARGET +The target passed to the make build command (`./make `) if `ENABLE_INSTALL` is used. Defaults to 'install'. + +### DISABLE_PARALLEL +The underlying buildsystem will be instructed to not parallelize + +### SUBPATH +Additional subdir to invoke make in. Useful if only parts of a port should be built. + +## Notes: +This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). +You can use the alias [`vcpkgl_make_instal()`](vcpkgl_make_instal.md) function if your makefile supports the +"install" target + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) +#]===] + +if(Z_VCPKG_MAKE_BUILD_GUARD) + return() +endif() +set(Z_VCPKG_MAKE_BUILD_GUARD ON CACHE INTERNAL "guard variable") + +function(vcpkg_make_build) + z_vcpkg_get_cmake_vars(cmake_vars_file) + include("${cmake_vars_file}") + + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 arg + "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" + "LOGFILE_BASE;BUILD_TARGET;SUBPATH;MAKEFILE;INSTALL_TARGET" + "" + ) + + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_make_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + if(NOT DEFINED arg_LOGFILE_BASE) + set(arg_LOGFILE_BASE "build") + endif() + + if(NOT DEFINED arg_BUILD_TARGET) + set(arg_BUILD_TARGET "all") + endif() + + if (NOT DEFINED arg_MAKEFILE) + set(arg_MAKEFILE Makefile) + endif() + + if(NOT DEFINED arg_INSTALL_TARGET) + set(arg_INSTALL_TARGET "install") + endif() + + if(WIN32) + set(_vcpkg_prefix ${CURRENT_PACKAGES_DIR}) + set(_vcpkg_installed ${CURRENT_INSTALLED_DIR}) + else() + string(REPLACE " " "\ " _vcpkg_prefix "${CURRENT_PACKAGES_DIR}") + string(REPLACE " " "\ " _vcpkg_installed "${CURRENT_INSTALLED_DIR}") + endif() + + set(make_opts ) + set(install_opts ) + if (CMAKE_HOST_WIN32) + set(path_global "$ENV{PATH}") + vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") + if(NOT DEFINED Z_VCPKG_MAKE) + vcpkg_acquire_msys(MSYS_ROOT) + find_program(Z_VCPKG_MAKE make PATHS "${MSYS_ROOT}/usr/bin" NO_DEFAULT_PATH REQUIRED) + endif() + set(make_command "${Z_VCPKG_MAKE}") + set(make_opts ${arg_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + set(no_parallel_make_opts ${arg_MAKE_OPTIONS} -j 1 --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + + string(REPLACE " " "\\\ " _vcpkg_package_prefix ${CURRENT_PACKAGES_DIR}) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _vcpkg_package_prefix "${_vcpkg_package_prefix}") + set(install_opts -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${_vcpkg_package_prefix}) + #TODO: optimize for install-data (release) and install-exec (release/debug) + else() + if(VCPKG_HOST_IS_OPENBSD) + find_program(Z_VCPKG_MAKE gmake REQUIRED) + else() + find_program(Z_VCPKG_MAKE make REQUIRED) + endif() + set(make_command "${Z_VCPKG_MAKE}") + set(make_opts ${arg_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + set(no_parallel_make_opts ${arg_MAKE_OPTIONS} V=1 -j 1 -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + set(install_opts -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${CURRENT_PACKAGES_DIR}) + endif() + + # Since includes are buildtype independent those are setup by vcpkg_make_configure + _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + + foreach(buildtype IN ITEMS debug release) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL buildtype) + if(buildtype STREQUAL "debug") + # Skip debug generate + if (_VCPKG_NO_DEBUG) + continue() + 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) + set(short_buildtype "") + else() + set(short_buildtype "-rel") + endif() + set(cmake_buildtype "RELEASE") + set(path_suffix "") + endif() + + set(working_directory "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${short_buildtype}${arg_SUBPATH}") + message(STATUS "Building ${TARGET_TRIPLET}${short_buildtype}") + + _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${cmake_buildtype}) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(LINKER_FLAGS_${cmake_buildtype} "${VCPKG_DETECTED_STATIC_LINKER_FLAGS_${cmake_buildtype}}") + else() # dynamic + set(LINKER_FLAGS_${cmake_buildtype} "${VCPKG_DETECTED_SHARED_LINKER_FLAGS_${cmake_buildtype}}") + endif() + if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_C_COMPILER MATCHES "cl.exe") + set(LDFLAGS_${cmake_buildtype} "-L${_vcpkg_installed}${path_suffix}/lib -L${_vcpkg_installed}${path_suffix}/lib/manual-link") + set(LINK_ENV_${cmake_buildtype} "$ENV{_LINK_} ${LINKER_FLAGS_${cmake_buildtype}}") + else() + set(LDFLAGS_${cmake_buildtype} "-L${_vcpkg_installed}${path_suffix}/lib -L${_vcpkg_installed}${path_suffix}/lib/manual-link ${LINKER_FLAGS_${cmake_buildtype}}") + endif() + + # Setup environment + set(ENV{CPPFLAGS} "${CPPFLAGS_${cmake_buildtype}}") + set(ENV{CFLAGS} "${CFLAGS_${cmake_buildtype}}") + set(ENV{CXXFLAGS} "${CXXFLAGS_${cmake_buildtype}}") + set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${cmake_buildtype}}") + set(ENV{LDFLAGS} "${LDFLAGS_${cmake_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(LINK_ENV_${_VAR_SUFFIX}) + set(config_link_backup "$ENV{_LINK_}") + set(ENV{_LINK_} "${LINK_ENV_${_VAR_SUFFIX}}") + endif() + + if(arg_ADD_BIN_TO_PATH) + set(env_backup_path "$ENV{PATH}") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${path_suffix}/bin") + endif() + + if(MAKE_BASH) + set(make_cmd_line "${make_command} ${make_opts}") + set(no_parallel_make_cmd_line "${make_command} ${no_parallel_make_opts}") + else() + set(make_cmd_line ${make_command} ${make_opts}) + set(no_parallel_make_cmd_line ${make_command} ${no_parallel_make_opts}) + endif() + + if (arg_DISABLE_PARALLEL) + vcpkg_execute_build_process( + COMMAND "${MAKE_BASH}" ${no_parallel_make_cmd_line} + WORKING_DIRECTORY "${working_directory}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}${short_buildtype}" + ) + else() + vcpkg_execute_build_process( + COMMAND "${MAKE_BASH}" ${make_cmd_line} + NO_PARALLEL_COMMAND "${MAKE_BASH}" ${no_parallel_make_cmd_line} + WORKING_DIRECTORY "${working_directory}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}${short_buildtype}" + ) + endif() + + file(READ "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-${TARGET_TRIPLET}${short_buildtype}-out.log" logdata) + if(logdata MATCHES "Warning: linker path does not have real file for library") + message(FATAL_ERROR "libtool could not find a file being linked against!") + endif() + + if (arg_ENABLE_INSTALL) + message(STATUS "Installing ${TARGET_TRIPLET}${short_buildtype}") + if(MAKE_BASH) + set(make_cmd_line "${make_command} ${install_opts}") + else() + set(make_cmd_line ${make_command} ${install_opts}) + endif() + vcpkg_execute_build_process( + COMMAND "${MAKE_BASH}" ${make_cmd_line} + WORKING_DIRECTORY "${working_directory}" + LOGNAME "install-${TARGET_TRIPLET}${short_buildtype}" + ) + endif() + + if(config_link_backup) + set(ENV{_LINK_} "${config_link_backup}") + unset(config_link_backup) + endif() + + if(arg_ADD_BIN_TO_PATH) + set(ENV{PATH} "${env_backup_path}") + endif() + endif() + endforeach() + + if (arg_ENABLE_INSTALL) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") + file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}_tmp") + file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${_VCPKG_INSTALL_PREFIX}" "${CURRENT_PACKAGES_DIR}") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") + endif() + + # Remove libtool files since they contain absolute paths and are not necessary. + file(GLOB_RECURSE libtool_files "${CURRENT_PACKAGES_DIR}/**/*.la") + if(libtool_files) + file(REMOVE ${libtool_files}) + endif() + + 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/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake new file mode 100644 index 00000000000000..d8f0fa86437404 --- /dev/null +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -0,0 +1,911 @@ +#[===[.md: +# vcpkg_make_configure + +Configure configure for Debug and Release builds of a project. + +## Usage +```cmake +vcpkg_make_configure( + SOURCE_PATH <${source_path}> + [AUTOCONFIG] + [USE_WRAPPERS] + [DETERMINE_BUILD_TRIPLET] + [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}>] + [PRERUN_SHELL <${shell_path}>] + [OPTIONS <--use_this_in_all_builds=1>...] + [OPTIONS_RELEASE <--optimize=1>...] + [OPTIONS_DEBUG <--debuggable=1>...] +) +``` + +## Parameters +### SOURCE_PATH +Specifies the directory containing the `configure`/`configure.ac`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### PROJECT_SUBPATH +Specifies the directory containing the ``configure`/`configure.ac`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### SKIP_CONFIGURE +Skip configure process + +### USE_WRAPPERS +Use autotools ar-lib and compile wrappers (only applies to windows cl and lib) + +### BUILD_TRIPLET +Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET + +### DETERMINE_BUILD_TRIPLET +For ports having a configure script following the autotools rules for selecting the 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. + +### OPTIONS_RELEASE +Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`. + +### 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. + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) +#]===] + +if(Z_VCPKG_MAKE_CONFIGURE_GUARD) + return() +endif() +set(Z_VCPKG_CAKE_CONFIGURE_GUARD ON CACHE INTERNAL "guard variable") + +macro(z_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(${out_var} mingw64) + elseif(host_arch MATCHES "(x|X)86") + set(${out_var} mingw32) + else() + message(FATAL_ERROR "Unsupported mingw architecture ${host_arch} in z_vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(host_arch) +endmacro() + +macro(z_vcpkg_determine_autotools_host_cpu out_var) + # TODO: the host system processor architecture can differ from the host triplet target architecture + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(host_arch $ENV{PROCESSOR_ARCHITEW6432}) + elseif(DEFINED ENV{PROCESSOR_ARCHITECTURE}) + set(host_arch $ENV{PROCESSOR_ARCHITECTURE}) + else() + set(host_arch "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}") + 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(${out_var} aarch64) + elseif(host_arch MATCHES "^(ARM|arm)$") + set(${out_var} arm) + else() + message(FATAL_ERROR "Unsupported host architecture ${host_arch} in z_vcpkg_determine_autotools_host_cpu!" ) + endif() + unset(host_arch) +endmacro() + +macro(z_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 z_vcpkg_determine_autotools_target_cpu!" ) + endif() +endmacro() + +macro(z_vcpkg_determine_autotools_host_arch_mac out_var) + set(${out_var} "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}") +endmacro() + +macro(z_vcpkg_determine_autotools_target_arch_mac out_var) + list(LENGTH VCPKG_OSX_ARCHITECTURES osx_archs_num) + if(osx_archs_num EQUAL 0) + set(${out_var} "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}") + elseif(osx_archs_num GREATER_EQUAL 2) + set(${out_var} "universal") + else() + # Better match the arch behavior of config.guess + # See: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + if(VCPKG_OSX_ARCHITECTURES MATCHES "^(ARM|arm)64$") + set(${out_var} "aarch64") + else() + set(${out_var} "${VCPKG_OSX_ARCHITECTURES}") + endif() + endif() + unset(osx_archs_num) +endmacro() + +macro(z_vcpkg_backup_env_variable 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(z_vcpkg_backup_env_variables) + foreach(_var ${ARGV}) + z_vcpkg_backup_env_variable(${_var}) + endforeach() +endmacro() + +macro(z_vcpkg_restore_env_variable envvar) + if(${envvar}_backup) + set(ENV{${envvar}} "${${envvar}_backup}") + else() + unset(ENV{${envvar}}) + endif() +endmacro() + +macro(z_vcpkg_restore_env_variables) + foreach(_var ${ARGV}) + z_vcpkg_restore_env_variable(${_var}) + endforeach() +endmacro() + +macro(z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags flag_suffix) + string(REGEX MATCHALL "( |^)-D[^ ]+" CPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}") + string(REGEX MATCHALL "( |^)-D[^ ]+" CXXPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}") + list(JOIN CXXPPFLAGS_${flag_suffix} "|" CXXREGEX) + if(CXXREGEX) + list(FILTER CPPFLAGS_${flag_suffix} INCLUDE REGEX "(${CXXREGEX})") + else() + set(CPPFLAGS_${flag_suffix}) + endif() + list(JOIN CPPFLAGS_${flag_suffix} "|" CPPREGEX) + list(JOIN CPPFLAGS_${flag_suffix} " " CPPFLAGS_${flag_suffix}) + set(CPPFLAGS_${flag_suffix} "${CPPFLAGS_${flag_suffix}}") + if(CPPREGEX) + string(REGEX REPLACE "(${CPPREGEX})" "" CFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}") + string(REGEX REPLACE "(${CPPREGEX})" "" CXXFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}") + else() + set(CFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}") + set(CXXFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}") + endif() + string(REGEX REPLACE " +" " " CPPFLAGS_${flag_suffix} "${CPPFLAGS_${flag_suffix}}") + string(REGEX REPLACE " +" " " CFLAGS_${flag_suffix} "${CFLAGS_${flag_suffix}}") + string(REGEX REPLACE " +" " " CXXFLAGS_${flag_suffix} "${CXXFLAGS_${flag_suffix}}") + # libtool has and -R option so we need to guard against -RTC by using -Xcompiler + # while configuring there might be a lot of unknown compiler option warnings due to that + # just ignore them. + string(REGEX REPLACE "((-|/)RTC[^ ]+)" "-Xcompiler \\1" CFLAGS_${flag_suffix} "${CFLAGS_${flag_suffix}}") + string(REGEX REPLACE "((-|/)RTC[^ ]+)" "-Xcompiler \\1" CXXFLAGS_${flag_suffix} "${CXXFLAGS_${flag_suffix}}") + string(STRIP "${CPPFLAGS_${flag_suffix}}" CPPFLAGS_${flag_suffix}) + string(STRIP "${CFLAGS_${flag_suffix}}" CFLAGS_${flag_suffix}) + string(STRIP "${CXXFLAGS_${flag_suffix}}" CXXFLAGS_${flag_suffix}) + debug_message("CPPFLAGS_${flag_suffix}: ${CPPFLAGS_${flag_suffix}}") + debug_message("CFLAGS_${flag_suffix}: ${CFLAGS_${flag_suffix}}") + debug_message("CXXFLAGS_${flag_suffix}: ${CXXFLAGS_${flag_suffix}}") +endmacro() + +macro(z_vcpkg_convert_path_to_unix pathvar) + if (NOT cygpath) + find_program(cygpath NAMES cygpath PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) + endif() + foreach (curr_option IN LISTS ${pathvar}) + debug_message("curr_option: ${curr_option}") + string(REGEX REPLACE ".*=(.+)" "\\1" matched_path "${curr_option}") + debug_message("matched_path: ${matched_path}") + if (matched_path AND NOT (matched_path STREQUAL curr_option)) + execute_process( + COMMAND "${cygpath}" "${matched_path}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + OUTPUT_VARIABLE out_vars + ) + string(REGEX MATCH "[^\n]+" out_vars "${out_vars}") + debug_message("Converted path: ${out_vars}") + debug_message("replace \"${matched_path}\" with \"${out_vars}\" in \"${${pathvar}}\"") + list(TRANSFORM ${pathvar} REPLACE "${matched_path}" "${out_vars}") + debug_message("fixed_values: ${fixed_values}") + endif() + endforeach() +endmacro() + +function(vcpkg_make_configure) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 arg + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" + "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES" + ) + + z_vcpkg_get_cmake_vars(cmake_vars_file) + debug_message("Including cmake vars from: ${cmake_vars_file}") + include("${cmake_vars_file}") + if(DEFINED VCPKG_MAKE_BUILD_TRIPLET) + set(arg_BUILD_TRIPLET ${VCPKG_MAKE_BUILD_TRIPLET}) # Triplet overwrite for crosscompiling + endif() + + set(src_dir "${arg_SOURCE_PATH}/${arg_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(arg_AUTOCONFIG ON) + endif() + elseif(EXISTS "${src_dir}/configure" AND NOT arg_SKIP_CONFIGURE) # run normally; no autoconf or autgen required + elseif(EXISTS "${src_dir}/configure.ac") # Run autoconfig + set(requires_autoconfig TRUE) + set(arg_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}") + + if(CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") #only applies to windows (clang-)cl and lib + if(arg_AUTOCONFIG) + set(arg_USE_WRAPPERS TRUE) + else() + # Keep the setting from portfiles. + # 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. + endif() + else() + set(arg_USE_WRAPPERS FALSE) + endif() + + # Backup environment variables + # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y + set(cm_FLAGS AS CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y RC) + list(TRANSFORM cm_FLAGS APPEND "FLAGS") + z_vcpkg_backup_env_variables(${cm_FLAGS}) + + + # FC fotran compiler | FF Fortran 77 compiler + # LDFLAGS -> pass -L flags + # LIBS -> pass -l flags + + #Used by gcc/linux + z_vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) + + #Used by cl + z_vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) + + set(vcm_paths_with_spaces FALSE) + 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") + set(vcm_paths_with_spaces TRUE) + endif() + + # Pre-processing windows configure requirements + if (VCPKG_TARGET_IS_WINDOWS) + if(CMAKE_HOST_WIN32) + list(APPEND msys_require_packages binutils libtool autoconf automake-wrapper automake1.16 m4) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${msys_require_packages} ${arg_ADDITIONAL_MSYS_PACKAGES}) + message(STATUS "Checking and converting options...") + z_vcpkg_convert_path_to_unix(arg_OPTIONS) + z_vcpkg_convert_path_to_unix(arg_OPTIONS_DEBUG) + z_vcpkg_convert_path_to_unix(arg_OPTIONS_RELEASE) + message(STATUS "Checking and converting done...") + endif() + if (arg_AUTOCONFIG AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET OR VCPKG_CROSSCOMPILING AND NOT arg_BUILD_TRIPLET) + z_vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= + z_vcpkg_determine_autotools_target_cpu(TARGET_ARCH) + # --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(CMAKE_HOST_WIN32) + set(arg_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 + endif() + if(NOT TARGET_ARCH MATCHES "${BUILD_ARCH}" OR NOT CMAKE_HOST_WIN32) # we don't need to specify the additional flags if we build nativly, this does not hold when we are not on windows + string(APPEND arg_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 arg_BUILD_TRIPLET MATCHES "--host") + # Needs to be different from --build to enable cross builds. + string(APPEND arg_BUILD_TRIPLET " --host=${TARGET_ARCH}-unknown-mingw32") + endif() + debug_message("Using make triplet: ${arg_BUILD_TRIPLET}") + endif() + if(CMAKE_HOST_WIN32) + set(append_env) + if(arg_USE_WRAPPERS) + set(append_env ";${MSYS_ROOT}/usr/share/automake-1.16") + string(APPEND append_env ";${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there + endif() + # This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe) + string(REPLACE ";$ENV{SystemRoot}\\System32;" "${append_env};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}") + string(REPLACE ";$ENV{SystemRoot}\\system32;" "${append_env};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}") + set(ENV{PATH} "${NEWPATH}") + set(bash_executable "${MSYS_ROOT}/usr/bin/bash.exe") + endif() + + macro(z_vcpkg_append_to_configure_environment inoutstring var defaultval) + # Allows to overwrite settings in custom triplets via the environment on windows + if(CMAKE_HOST_WIN32 AND DEFINED ENV{${var}}) + string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") + else() + string(APPEND ${inoutstring} " ${var}='${defaultval}'") + endif() + endmacro() + + set(configure_env "V=1") + # Remove full filepaths due to spaces and prepend filepaths to PATH (cross-compiling tools are unlikely on path by default) + set(progs VCPKG_DETECTED_CMAKE_C_COMPILER VCPKG_DETECTED_CMAKE_CXX_COMPILER VCPKG_DETECTED_CMAKE_AR + VCPKG_DETECTED_CMAKE_LINKER VCPKG_DETECTED_CMAKE_RANLIB VCPKG_DETECTED_CMAKE_OBJDUMP + VCPKG_DETECTED_CMAKE_STRIP VCPKG_DETECTED_CMAKE_NM VCPKG_DETECTED_CMAKE_DLLTOOL VCPKG_DETECTED_CMAKE_RC_COMPILER) + foreach(prog IN LISTS progs) + if(${prog}) + set(path "${${prog}}") + unset(prog_found CACHE) + get_filename_component(${prog} "${${prog}}" NAME) + find_program(prog_found ${${prog}} PATHS ENV PATH NO_DEFAULT_PATH) + if(NOT path STREQUAL prog_found) + get_filename_component(path "${path}" DIRECTORY) + vcpkg_add_to_path(PREPEND ${path}) + endif() + endif() + endforeach() + if (arg_USE_WRAPPERS) + z_vcpkg_append_to_configure_environment(configure_env CPP "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER} -E") + + z_vcpkg_append_to_configure_environment(configure_env CC "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CXX "compile ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env RC "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env WINDRES "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + if(VCPKG_DETECTED_CMAKE_AR) + z_vcpkg_append_to_configure_environment(configure_env AR "ar-lib ${VCPKG_DETECTED_CMAKE_AR}") + else() + z_vcpkg_append_to_configure_environment(configure_env AR "ar-lib lib.exe -verbose") + endif() + else() + z_vcpkg_append_to_configure_environment(configure_env CPP "${VCPKG_DETECTED_CMAKE_C_COMPILER} -E") + z_vcpkg_append_to_configure_environment(configure_env CC "${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CC_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env CXX "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env RC "${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + z_vcpkg_append_to_configure_environment(configure_env WINDRES "${VCPKG_DETECTED_CMAKE_RC_COMPILER}") + if(VCPKG_DETECTED_CMAKE_AR) + z_vcpkg_append_to_configure_environment(configure_env AR "${VCPKG_DETECTED_CMAKE_AR}") + else() + z_vcpkg_append_to_configure_environment(configure_env AR "lib.exe -verbose") + endif() + endif() + z_vcpkg_append_to_configure_environment(configure_env LD "${VCPKG_DETECTED_CMAKE_LINKER} -verbose") + if(VCPKG_DETECTED_CMAKE_RANLIB) + z_vcpkg_append_to_configure_environment(configure_env RANLIB "${VCPKG_DETECTED_CMAKE_RANLIB}") # Trick to ignore the RANLIB call + else() + z_vcpkg_append_to_configure_environment(configure_env RANLIB ":") + endif() + if(VCPKG_DETECTED_CMAKE_OBJDUMP) #Objdump is required to make shared libraries. Otherwise define lt_cv_deplibs_check_method=pass_all + z_vcpkg_append_to_configure_environment(configure_env OBJDUMP "${VCPKG_DETECTED_CMAKE_OBJDUMP}") # Trick to ignore the RANLIB call + endif() + if(VCPKG_DETECTED_CMAKE_STRIP) # If required set the ENV variable STRIP in the portfile correctly + z_vcpkg_append_to_configure_environment(configure_env STRIP "${VCPKG_DETECTED_CMAKE_STRIP}") + else() + z_vcpkg_append_to_configure_environment(configure_env STRIP ":") + list(APPEND arg_OPTIONS ac_cv_prog_ac_ct_STRIP=:) + endif() + if(VCPKG_DETECTED_CMAKE_NM) # If required set the ENV variable NM in the portfile correctly + z_vcpkg_append_to_configure_environment(configure_env NM "${VCPKG_DETECTED_CMAKE_NM}") + else() + # 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) + z_vcpkg_append_to_configure_environment(configure_env NM "dumpbin.exe -symbols -headers") + endif() + if(VCPKG_DETECTED_CMAKE_DLLTOOL) # If required set the ENV variable DLLTOOL in the portfile correctly + z_vcpkg_append_to_configure_environment(configure_env DLLTOOL "${VCPKG_DETECTED_CMAKE_DLLTOOL}") + else() + z_vcpkg_append_to_configure_environment(configure_env DLLTOOL "link.exe -verbose -dll") + endif() + z_vcpkg_append_to_configure_environment(configure_env CCAS ":") # If required set the ENV variable CCAS in the portfile correctly + z_vcpkg_append_to_configure_environment(configure_env AS ":") # If required set the ENV variable AS in the portfile correctly + + foreach(_env IN LISTS arg_CONFIGURE_ENVIRONMENT_VARIABLES) + z_vcpkg_append_to_configure_environment(configure_env ${_env} "${${_env}}") + endforeach() + debug_message("configure_env: '${configure_env}'") + # 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. + # CXXCOMPILE The command used to actually compile a C++ source file. The file name is appended to form the complete command line. + # CXXLINK The command used to actually link a C++ program. + + # Variables not correctly detected by configure. In release builds. + list(APPEND arg_OPTIONS gl_cv_double_slash_root=yes + ac_cv_func_memmove=yes) + #list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all) # Just ignore libtool checks + if(VCPKG_TARGET_ARCHITECTURE MATCHES "^[Aa][Rr][Mm]64$") + list(APPEND arg_OPTIONS gl_cv_host_cpu_c_abi=no) + # Currently needed for arm64 because objdump yields: "unrecognised machine type (0xaa64) in Import Library Format archive" + list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^[Aa][Rr][Mm]$") + # Currently needed for arm because objdump yields: "unrecognised machine type (0x1c4) in Import Library Format archive" + list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all) + endif() + endif() + + if(CMAKE_HOST_WIN32) + #Some PATH handling for dealing with spaces....some tools will still fail with that! + string(REPLACE " " "\\\ " z_vcpkg_prefix_path ${CURRENT_INSTALLED_DIR}) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" z_vcpkg_prefix_path "${z_vcpkg_prefix_path}") + set(z_vcpkg_installed_path ${CURRENT_INSTALLED_DIR}) + set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile! + else() + string(REPLACE " " "\ " z_vcpkg_prefix_path ${CURRENT_INSTALLED_DIR}) + string(REPLACE " " "\ " z_vcpkg_installed_path ${CURRENT_INSTALLED_DIR}) + set(extra_quotes) + set(prefix_var "\${prefix}") + endif() + + # macOS - cross-compiling support + if(VCPKG_TARGET_IS_OSX) + if (arg_AUTOCONFIG AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET) + z_vcpkg_determine_autotools_host_arch_mac(BUILD_ARCH) # machine you are building on => --build= + z_vcpkg_determine_autotools_target_arch_mac(TARGET_ARCH) + # --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 "${TARGET_ARCH}" STREQUAL "${BUILD_ARCH}") # we don't need to specify the additional flags if we build natively. + set(arg_BUILD_TRIPLET "--host=${TARGET_ARCH}-apple-darwin") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target) + endif() + debug_message("Using make triplet: ${arg_BUILD_TRIPLET}") + endif() + endif() + + # Cleanup previous build dirs + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") + + # Set configure paths + set(arg_OPTIONS_RELEASE ${arg_OPTIONS_RELEASE} "--prefix=${extra_quotes}${z_vcpkg_prefix_path}${extra_quotes}") + set(arg_OPTIONS_DEBUG ${arg_OPTIONS_DEBUG} "--prefix=${extra_quotes}${z_vcpkg_prefix_path}/debug${extra_quotes}") + if(NOT arg_NO_ADDITIONAL_PATHS) + set(arg_OPTIONS_RELEASE ${arg_OPTIONS_RELEASE} + # Important: These should all be relative to prefix! + "--bindir=${prefix_var}/tools/${PORT}/bin" + "--sbindir=${prefix_var}/tools/${PORT}/sbin" + #"--libdir='\${prefix}'/lib" # already the default! + #"--includedir='\${prefix}'/include" # already the default! + "--mandir=${prefix_var}/share/${PORT}" + "--docdir=${prefix_var}/share/${PORT}" + "--datarootdir=${prefix_var}/share/${PORT}") + set(arg_OPTIONS_DEBUG ${arg_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 arg_DISABLE_VERBOSE_FLAGS) + list(APPEND arg_OPTIONS --disable-silent-rules --verbose) + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + list(APPEND arg_OPTIONS --enable-shared --disable-static) + else() + list(APPEND arg_OPTIONS --disable-shared --enable-static) + endif() + + # Can be set in the triplet to append options for configure + if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS) + list(APPEND arg_OPTIONS ${VCPKG_MAKE_CONFIGURE_OPTIONS}) + endif() + if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS_RELEASE) + list(APPEND arg_OPTIONS_RELEASE ${VCPKG_MAKE_CONFIGURE_OPTIONS_RELEASE}) + endif() + if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS_DEBUG) + list(APPEND arg_OPTIONS_DEBUG ${VCPKG_MAKE_CONFIGURE_OPTIONS_DEBUG}) + endif() + + file(RELATIVE_PATH relative_build_path "${CURRENT_BUILDTREES_DIR}" "${arg_SOURCE_PATH}/${arg_PROJECT_SUBPATH}") + + set(base_cmd) + if(CMAKE_HOST_WIN32) + set(base_cmd ${bash_executable} --noprofile --norc --debug) + else() + find_program(base_cmd bash REQUIRED) + endif() + if(VCPKG_TARGET_IS_WINDOWS) + list(JOIN arg_OPTIONS " " arg_OPTIONS) + list(JOIN arg_OPTIONS_RELEASE " " arg_OPTIONS_RELEASE) + list(JOIN arg_OPTIONS_DEBUG " " arg_OPTIONS_DEBUG) + endif() + + # Setup include environment (since these are buildtype independent restoring them is unnecessary) + macro(prepend_include_path var) + if("${${var}_backup}" STREQUAL "") + set(ENV{${var}} "${z_vcpkg_installed_path}/include") + else() + set(ENV{${var}} "${z_vcpkg_installed_path}/include${VCPKG_HOST_PATH_SEPARATOR}${${var}_backup}") + endif() + endmacro() + # Used by CL + prepend_include_path(INCLUDE) + # Used by GCC + prepend_include_path(C_INCLUDE_PATH) + prepend_include_path(CPLUS_INCLUDE_PATH) + + # 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(VCPKG_TARGET_IS_WINDOWS) + z_vcpkg_backup_env_variables(_CL_ _LINK_) + # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined + 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}") + # Can somebody please check if CMake's compiler flags for UWP are correct? + set(ENV{_CL_} "$ENV{_CL_} /D_UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"") + string(APPEND VCPKG_DETECTED_CMAKE_CXX_FLAGS_RELEASE " -ZW:nostdlib") + string(APPEND VCPKG_DETECTED_CMAKE_CXX_FLAGS_DEBUG " -ZW:nostdlib") + set(ENV{_LINK_} "$ENV{_LINK_} ${VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES} ${VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES} /MANIFEST /DYNAMICBASE /WINMD:NO /APPCONTAINER") + endif() + endif() + + macro(convert_to_list input output) + string(REGEX MATCHALL "(( +|^ *)[^ ]+)" ${output} "${${input}}") + endmacro() + convert_to_list(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES c_libs_list) + convert_to_list(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES cxx_libs_list) + set(all_libs_list ${c_libs_list} ${cxx_libs_list}) + list(REMOVE_DUPLICATES all_libs_list) + list(TRANSFORM all_libs_list STRIP) + #Do lib list transformation from name.lib to -lname if necessary + set(x_vcpkg_transform_libs TRUE) + if(VCPKG_TARGET_IS_UWP) + set(x_vcpkg_transform_libs FALSE) + # Avoid libtool choke: "Warning: linker path does not have real file for library -lWindowsApp." + # The problem with the choke is that libtool always falls back to built a static library even if a dynamic was requested. + # Note: Env LIBPATH;LIB are on the search path for libtool by default on windows. + # It even does unix/dos-short/unix transformation with the path to get rid of spaces. + endif() + set(l_prefix) + if(x_vcpkg_transform_libs) + set(l_prefix "-l") + list(TRANSFORM all_libs_list REPLACE "(.dll.lib|.lib|.a|.so)$" "") + if(VCPKG_TARGET_IS_WINDOWS) + list(REMOVE_ITEM all_libs_list "uuid") + endif() + list(TRANSFORM all_libs_list REPLACE "^(${l_prefix})" "") + endif() + list(JOIN all_libs_list " ${l_prefix}" all_libs_string) + if(VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + # libtool must be told explicitly that there is no dynamic linkage for uuid. + # The "-Wl,..." syntax is understood by libtool and gcc, but no by ld. + string(REPLACE " -luuid" " -Wl,-Bstatic,-luuid,-Bdynamic" all_libs_string "${all_libs_string}") + endif() + + if(all_libs_string) + set(all_libs_string "${l_prefix}${all_libs_string}") + if(DEFINED ENV{LIBS}) + set(ENV{LIBS} "$ENV{LIBS} ${all_libs_string}") + else() + set(ENV{LIBS} "${all_libs_string}") + endif() + endif() + debug_message("ENV{LIBS}:$ENV{LIBS}") + vcpkg_find_acquire_program(PKGCONFIG) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT PKGCONFIG STREQUAL "--static") + set(PKGCONFIG "${PKGCONFIG} --static") # Is this still required or was the PR changing the pc files accordingly merged? + endif() + + # Run autoconf if necessary + if (arg_AUTOCONFIG OR requires_autoconfig) + find_program(AUTORECONF autoreconf) + if(NOT AUTORECONF) + message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")") + endif() + message(STATUS "Generating configure for ${TARGET_TRIPLET}") + if (CMAKE_HOST_WIN32) + vcpkg_execute_required_process( + COMMAND "${base_cmd}" -c "autoreconf -vfi" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "autoconf-${TARGET_TRIPLET}" + ) + else() + vcpkg_execute_required_process( + COMMAND "${AUTORECONF}" -vfi + WORKING_DIRECTORY "${src_dir}" + LOGNAME "autoconf-${TARGET_TRIPLET}" + ) + endif() + message(STATUS "Finished generating configure for ${TARGET_TRIPLET}") + endif() + if(requires_autogen) + message(STATUS "Generating configure for ${TARGET_TRIPLET} via autogen.sh") + if (CMAKE_HOST_WIN32) + vcpkg_execute_required_process( + COMMAND "${base_cmd}" -c "./autogen.sh" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "autoconf-${TARGET_TRIPLET}" + ) + else() + vcpkg_execute_required_process( + COMMAND "./autogen.sh" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "autoconf-${TARGET_TRIPLET}" + ) + endif() + message(STATUS "Finished generating configure for ${TARGET_TRIPLET}") + endif() + + if (arg_PRERUN_SHELL) + message(STATUS "Prerun shell with ${TARGET_TRIPLET}") + vcpkg_execute_required_process( + COMMAND "${base_cmd}" -c "${arg_PRERUN_SHELL}" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "prerun-${TARGET_TRIPLET}" + ) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT arg_NO_DEBUG) + set(var_suffix DEBUG) + set(path_suffix_${var_suffix} "/debug") + set(short_name_${var_suffix} "dbg") + list(APPEND _buildtypes ${var_suffix}) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}") + else() # dynamic + set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${var_suffix}}") + endif() + z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix}) + if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") + if(NOT vcm_paths_with_spaces) + set(LDFLAGS_${var_suffix} "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + endif() + if(DEFINED ENV{_LINK_}) + set(LINK_ENV_${var_suffix} "$ENV{_LINK_} ${LINKER_FLAGS_${var_suffix}}") + else() + set(LINK_ENV_${var_suffix} "${LINKER_FLAGS_${var_suffix}}") + endif() + else() + set(link_required_dirs) + if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + endif() + if(EXISTS "{z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + endif() + string(STRIP "${link_required_dirs}" link_required_dirs) + set(LDFLAGS_${var_suffix} "${link_required_dirs} ${LINKER_FLAGS_${var_suffix}}") + endif() + unset(var_suffix) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(var_suffix RELEASE) + set(path_suffix_${var_suffix} "") + set(short_name_${var_suffix} "rel") + list(APPEND _buildtypes ${var_suffix}) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}") + else() # dynamic + set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${var_suffix}}") + endif() + z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${var_suffix}) + if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") + if(NOT vcm_paths_with_spaces) + set(LDFLAGS_${var_suffix} "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + endif() + if(DEFINED ENV{_LINK_}) + set(LINK_ENV_${var_suffix} "$ENV{_LINK_} ${LINKER_FLAGS_${var_suffix}}") + else() + set(LINK_ENV_${var_suffix} "${LINKER_FLAGS_${var_suffix}}") + endif() + else() + set(link_required_dirs) + if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + endif() + if(EXISTS "{z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + endif() + string(STRIP "${link_required_dirs}" link_required_dirs) + set(LDFLAGS_${var_suffix} "${link_required_dirs} ${LINKER_FLAGS_${var_suffix}}") + endif() + unset(var_suffix) + endif() + + foreach(_buildtype IN LISTS _buildtypes) + foreach(ENV_VAR ${arg_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(target_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_name_${_buildtype}}") + file(MAKE_DIRECTORY "${target_dir}") + file(RELATIVE_PATH relative_build_path "${target_dir}" "${src_dir}") + + if(arg_COPY_SOURCE) + file(COPY "${src_dir}/" DESTINATION "${target_dir}") + set(relative_build_path .) + endif() + + # Setup PKG_CONFIG_PATH + set(pkgconfig_installed_dir "${CURRENT_INSTALLED_DIR}${path_suffix_${_buildtype}}/lib/pkgconfig") + set(pkgconfig_installed_share_dir "${CURRENT_INSTALLED_DIR}/share/pkgconfig") + if(ENV{PKG_CONFIG_PATH}) + set(backup_env_pkg_config_path_${_buildtype} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${pkgconfig_installed_dir}${VCPKG_HOST_PATH_SEPARATOR}${pkgconfig_installed_share_dir}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${pkgconfig_installed_dir}${VCPKG_HOST_PATH_SEPARATOR}${pkgconfig_installed_share_dir}") + endif() + + # Setup environment + set(ENV{CPPFLAGS} "${CPPFLAGS_${_buildtype}}") + set(ENV{CFLAGS} "${CFLAGS_${_buildtype}}") + set(ENV{CXXFLAGS} "${CXXFLAGS_${_buildtype}}") + set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${_buildtype}}") + set(ENV{LDFLAGS} "${LDFLAGS_${_buildtype}}") + + # https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html + # -avoid-version is handled specially by libtool link mode, this flag is not forwarded to linker, + # and libtool tries to avoid versioning for shared libraries and no symbolic links are created. + if(VCPKG_TARGET_IS_ANDROID) + set(ENV{LDFLAGS} "-avoid-version $ENV{LDFLAGS}") + endif() + + if(LINK_ENV_${var_suffix}) + set(link_config_backup "$ENV{_LINK_}") + set(ENV{_LINK_} "${LINK_ENV_${var_suffix}}") + endif() + set(ENV{PKG_CONFIG} "${PKGCONFIG}") + + set(_lib_env_vars LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + foreach(_lib_env_var IN LISTS _lib_env_vars) + set(_link_path) + if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib") + set(_link_path "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib") + endif() + if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib/manual-link") + if(_link_path) + set(_link_path "${_link_path}${VCPKG_HOST_PATH_SEPARATOR}") + endif() + set(_link_path "${_link_path}${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib/manual-link") + endif() + set(ENV{${_lib_env_var}} "${_link_path}${${_lib_env_var}_pathlike_concat}") + endforeach() + unset(_link_path) + unset(_lib_env_vars) + + if(CMAKE_HOST_WIN32) + set(command "${base_cmd}" -c "${configure_env} ./${relative_build_path}/configure ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}") + elseif(VCPKG_TARGET_IS_WINDOWS) + set(command "${base_cmd}" -c "${configure_env} $@" -- "./${relative_build_path}/configure" ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}) + else() + set(command "${base_cmd}" "./${relative_build_path}/configure" ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}) + endif() + + if(arg_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 arg_SKIP_CONFIGURE) + message(STATUS "Configuring ${TARGET_TRIPLET}-${short_name_${_buildtype}}") + vcpkg_execute_required_process( + COMMAND "${command}" + WORKING_DIRECTORY "${target_dir}" + LOGNAME "config-${TARGET_TRIPLET}-${short_name_${_buildtype}}" + ) + if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(GLOB_RECURSE libtool_files "${target_dir}*/libtool") + foreach(lt_file IN LISTS libtool_files) + file(READ "${lt_file}" _contents) + string(REPLACE ".dll.lib" ".lib" _contents "${_contents}") + file(WRITE "${lt_file}" "${_contents}") + endforeach() + endif() + + if(EXISTS "${target_dir}/config.log") + file(RENAME "${target_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${short_name_${_buildtype}}.log") + endif() + endif() + + if(backup_env_pkg_config_path_${_buildtype}) + set(ENV{PKG_CONFIG_PATH} "${backup_env_pkg_config_path_${_buildtype}}") + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() + unset(backup_env_pkg_config_path_${_buildtype}) + + if(link_config_backup) + set(ENV{_LINK_} "${link_config_backup}") + unset(link_config_backup) + endif() + + if(arg_ADD_BIN_TO_PATH) + set(ENV{PATH} "${path_backup}") + endif() + # Restore environment (config dependent) + foreach(ENV_VAR ${arg_CONFIG_DEPENDENT_ENVIRONMENT}) + if(backup_config_${ENV_VAR}) + set(ENV{${ENV_VAR}} "${backup_config_${ENV_VAR}}") + else() + unset(ENV{${ENV_VAR}}) + endif() + endforeach() + endforeach() + + # Export matching make program for vcpkg_make_build (cache variable) + if(CMAKE_HOST_WIN32 AND MSYS_ROOT) + find_program(Z_VCPKG_MAKE make PATHS "${MSYS_ROOT}/usr/bin" NO_DEFAULT_PATH REQUIRED) + elseif(VCPKG_HOST_IS_OPENBSD) + find_program(Z_VCPKG_MAKE gmake REQUIRED) + else() + find_program(Z_VCPKG_MAKE make REQUIRED) + endif() + + # Restore environment + z_vcpkg_restore_env_variables(${cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + + set(_VCPKG_PROJECT_SOURCE_PATH ${arg_SOURCE_PATH} PARENT_SCOPE) + set(_VCPKG_PROJECT_SUBPATH ${arg_PROJECT_SUBPATH} PARENT_SCOPE) +endfunction() diff --git a/ports/vcpkg-make/vcpkg_make_install.cmake b/ports/vcpkg-make/vcpkg_make_install.cmake new file mode 100644 index 00000000000000..6527da1c336b5f --- /dev/null +++ b/ports/vcpkg-make/vcpkg_make_install.cmake @@ -0,0 +1,35 @@ +#[===[.md: +# vcpkg_install_make + +Build and install a make project. + +```cmake +vcpkg_make_install( + [DISABLE_PARALLEL] + [ADD_BIN_TO_PATH] +) +``` + +`vcpkg_make_install` transparently forwards to [`vcpkg_make_build()`], +with additional parameters to set `ENABLE_INSTALL`, +and to set the `LOGFILE_BASE` to `install` as well. + +[`vcpkg_make_build()`]: vcpkg_make_build.cmake + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +#]===] + +if(Z_VCPKG_MAKE_INSTALL_GUARD) + return() +endif() +set(Z_VCPKG_MAKE_INSTALL_GUARD ON CACHE INTERNAL "guard variable") + +function(vcpkg_make_install) + vcpkg_make_build( + ${ARGN} + LOGFILE_BASE install + ENABLE_INSTALL + ) +endfunction() From 206e29c03c85b6242a2e79e9589a2f384ba8421f Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 26 Aug 2021 01:53:10 -0700 Subject: [PATCH 02/27] Add depreciate message and check --- scripts/cmake/vcpkg_build_make.cmake | 5 +++++ scripts/cmake/vcpkg_configure_make.cmake | 6 ++++++ scripts/cmake/vcpkg_install_make.cmake | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 18f857fcede233..8616e4f9f5d2ca 100755 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -1,3 +1,4 @@ +# DEPRECATED BY ports/vcpkg-make/vcpkg_make_build #[===[.md: # vcpkg_build_make @@ -51,6 +52,10 @@ You can use the alias [`vcpkg_install_make()`](vcpkg_install_make.md) function i #]===] function(vcpkg_build_make) + if(Z_VCPKG_MAKE_BUILD_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-make; using both vcpkg-make and vcpkg_build_make in the same port is unsupported.") + endif() + z_vcpkg_get_cmake_vars(cmake_vars_file) include("${cmake_vars_file}") diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 067bf4da011f8c..3f699ea720101d 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -1,3 +1,4 @@ +# DEPRECATED BY ports/vcpkg-make/vcpkg_make_configure #[===[.md: # vcpkg_configure_make @@ -236,6 +237,11 @@ function(vcpkg_configure_make) "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES" ) + + if(NOT arg_Z_GET_MAKE_VARS_USAGE AND Z_VCPKG_MAKE_CONFIGURE_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-make; using both vcpkg-make and vcpkg_configure_make in the same port is unsupported.") + endif() + z_vcpkg_get_cmake_vars(cmake_vars_file) debug_message("Including cmake vars from: ${cmake_vars_file}") include("${cmake_vars_file}") diff --git a/scripts/cmake/vcpkg_install_make.cmake b/scripts/cmake/vcpkg_install_make.cmake index ce8a782d3c5953..411a8d074efb16 100644 --- a/scripts/cmake/vcpkg_install_make.cmake +++ b/scripts/cmake/vcpkg_install_make.cmake @@ -1,3 +1,4 @@ +# DEPRECATED BY ports/vcpkg-make/vcpkg_make_install #[===[.md: # vcpkg_install_make @@ -23,5 +24,8 @@ This command transparently forwards to [`vcpkg_build_make()`](vcpkg_build_make.m #]===] function(vcpkg_install_make) + if(Z_VCPKG_MAKE_INSTALL_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-make; using both vcpkg-make and vcpkg_install_make in the same port is unsupported.") + endif() vcpkg_build_make(${ARGN} LOGFILE_ROOT ENABLE_INSTALL) endfunction() From 82f0375b48809f2f5d6862e3110017d4d02b6c39 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 26 Aug 2021 02:50:37 -0700 Subject: [PATCH 03/27] update doc --- docs/maintainers/portfile-functions.md | 6 +++--- docs/maintainers/vcpkg_build_make.md | 2 ++ docs/maintainers/vcpkg_configure_make.md | 2 ++ docs/maintainers/vcpkg_install_make.md | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index 45aa4589bc481b..274e39b292c4c8 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -6,7 +6,7 @@ - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) - [vcpkg\_apply\_patches](vcpkg_apply_patches.md) (deprecated) - [vcpkg\_build\_cmake](vcpkg_build_cmake.md) (deprecated, use [vcpkg\_cmake\_build](ports/vcpkg-cmake/vcpkg_cmake_build.md)) -- [vcpkg\_build\_make](vcpkg_build_make.md) +- [vcpkg\_build\_make](vcpkg_build_make.md) (deprecated, use [vcpkg\_make\_build](ports/vcpkg-make/vcpkg_make_build.md)) - [vcpkg\_build\_msbuild](vcpkg_build_msbuild.md) - [vcpkg\_build\_ninja](vcpkg_build_ninja.md) - [vcpkg\_build\_nmake](vcpkg_build_nmake.md) @@ -19,7 +19,7 @@ - [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) (deprecated, use [vcpkg\_cmake\_configure](ports/vcpkg-cmake/vcpkg_cmake_configure.md)) - [vcpkg\_configure\_gn](vcpkg_configure_gn.md) -- [vcpkg\_configure\_make](vcpkg_configure_make.md) +- [vcpkg\_configure\_make](vcpkg_configure_make.md) (deprecated, use [vcpkg\_make\_configure](ports/vcpkg-make/vcpkg_make_configure.md)) - [vcpkg\_configure\_meson](vcpkg_configure_meson.md) - [vcpkg\_configure\_qmake](vcpkg_configure_qmake.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) @@ -46,7 +46,7 @@ - [vcpkg\_get\_windows\_sdk](vcpkg_get_windows_sdk.md) - [vcpkg\_install\_cmake](vcpkg_install_cmake.md) (deprecated, use [vcpkg\_cmake\_install](ports/vcpkg-cmake/vcpkg_cmake_install.md)) - [vcpkg\_install\_gn](vcpkg_install_gn.md) -- [vcpkg\_install\_make](vcpkg_install_make.md) +- [vcpkg\_install\_make](vcpkg_install_make.md) (deprecated, use [vcpkg\_make\_install](ports/vcpkg-make/vcpkg_make_install.md)) - [vcpkg\_install\_meson](vcpkg_install_meson.md) - [vcpkg\_install\_msbuild](vcpkg_install_msbuild.md) - [vcpkg\_install\_nmake](vcpkg_install_nmake.md) diff --git a/docs/maintainers/vcpkg_build_make.md b/docs/maintainers/vcpkg_build_make.md index a274b6f6e42ab1..638c331f41b7f3 100644 --- a/docs/maintainers/vcpkg_build_make.md +++ b/docs/maintainers/vcpkg_build_make.md @@ -1,5 +1,7 @@ # vcpkg_build_make +**This function has been deprecated in favor of [`vcpkg_make_build`](ports/vcpkg-make/vcpkg_make_build.md) from the vcpkg-make port.** + The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_build_make.md). Build a linux makefile project. diff --git a/docs/maintainers/vcpkg_configure_make.md b/docs/maintainers/vcpkg_configure_make.md index ebf80521af7718..e8ac99f6146ef2 100644 --- a/docs/maintainers/vcpkg_configure_make.md +++ b/docs/maintainers/vcpkg_configure_make.md @@ -1,5 +1,7 @@ # vcpkg_configure_make +**This function has been deprecated in favor of [`vcpkg_make_configure`](ports/vcpkg-make/vcpkg_make_configure.md) from the vcpkg-make port.** + The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_configure_make.md). Configure configure for Debug and Release builds of a project. diff --git a/docs/maintainers/vcpkg_install_make.md b/docs/maintainers/vcpkg_install_make.md index 19f4b5ca8f1e3b..4a39f226fd8a9f 100644 --- a/docs/maintainers/vcpkg_install_make.md +++ b/docs/maintainers/vcpkg_install_make.md @@ -1,5 +1,7 @@ # vcpkg_install_make +**This function has been deprecated in favor of [`vcpkg_make_install`](ports/vcpkg-make/vcpkg_make_install.md) from the vcpkg-make port.** + The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_install_make.md). Build and install a make project. From 657d28fea6dc7b076ea496d484ccfabc0458663b Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 26 Aug 2021 02:50:55 -0700 Subject: [PATCH 04/27] version --- versions/baseline.json | 4 ++++ versions/v-/vcpkg-make.json | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 versions/v-/vcpkg-make.json diff --git a/versions/baseline.json b/versions/baseline.json index 6364739fc0e4f2..f83593149dd1ab 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6636,6 +6636,10 @@ "baseline": "3", "port-version": 0 }, + "vcpkg-make": { + "baseline": "2021-08-25", + "port-version": 0 + }, "vcpkg-pkgconfig-get-modules": { "baseline": "2021-04-02", "port-version": 1 diff --git a/versions/v-/vcpkg-make.json b/versions/v-/vcpkg-make.json new file mode 100644 index 00000000000000..a8de35fe92f541 --- /dev/null +++ b/versions/v-/vcpkg-make.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "2478c2e3dd12c98c88c7f405d585c86dc801198c", + "version-date": "2021-08-25", + "port-version": 0 + } + ] +} From 56060faa4873562ee15884aafbd5f764784908a2 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 29 Aug 2021 23:12:21 -0700 Subject: [PATCH 05/27] Convert sample ports --- ports/gettext/portfile.cmake | 8 ++++---- ports/gettext/vcpkg.json | 8 ++++++-- ports/x264/portfile.cmake | 4 ++-- ports/x264/vcpkg.json | 6 +++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index b4f7f845fd3126..5d08d13c909ac1 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -64,7 +64,7 @@ function(build_libintl_and_tools) if(DEFINED arg_BUILD_TYPE) set(VCPKG_BUILD_TYPE "${arg_BUILD_TYPE}") endif() - vcpkg_configure_make(SOURCE_PATH "${SOURCE_PATH}" + vcpkg_make_configure(SOURCE_PATH "${SOURCE_PATH}" DETERMINE_BUILD_TRIPLET USE_WRAPPERS ADD_BIN_TO_PATH # So configure can check for working iconv @@ -72,7 +72,7 @@ function(build_libintl_and_tools) OPTIONS ${OPTIONS} ) - vcpkg_install_make(MAKEFILE "${CMAKE_CURRENT_LIST_DIR}/Makefile") + vcpkg_make_install(MAKEFILE "${CMAKE_CURRENT_LIST_DIR}/Makefile") endfunction() function(build_libintl_only) @@ -80,14 +80,14 @@ function(build_libintl_only) if(DEFINED arg_BUILD_TYPE) set(VCPKG_BUILD_TYPE "${arg_BUILD_TYPE}") endif() - vcpkg_configure_make(SOURCE_PATH "${SOURCE_PATH}/gettext-runtime" + vcpkg_make_configure(SOURCE_PATH "${SOURCE_PATH}/gettext-runtime" DETERMINE_BUILD_TRIPLET USE_WRAPPERS ADD_BIN_TO_PATH # So configure can check for working iconv OPTIONS ${OPTIONS} ) - vcpkg_install_make(SUBPATH "/intl") + vcpkg_make_install(SUBPATH "/intl") endfunction() if("tools" IN_LIST FEATURES) diff --git a/ports/gettext/vcpkg.json b/ports/gettext/vcpkg.json index dc1cefc4eabcc1..eabba0b644ffdc 100644 --- a/ports/gettext/vcpkg.json +++ b/ports/gettext/vcpkg.json @@ -1,11 +1,15 @@ { "name": "gettext", "version": "0.21", - "port-version": 5, + "port-version": 6, "description": "GNU gettext provides libintl and a set of tools to help produce multi-lingual messages.", "homepage": "https://www.gnu.org/software/gettext/", "dependencies": [ - "libiconv" + "libiconv", + { + "name": "vcpkg-make", + "host": true + } ], "features": { "tools": { diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index abd2f1d558a41f..69aca1d5ff163f 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -34,7 +34,7 @@ if(VCPKG_TARGET_IS_LINUX) list(APPEND OPTIONS --enable-pic) endif() -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} NO_ADDITIONAL_PATHS OPTIONS @@ -50,7 +50,7 @@ vcpkg_configure_make( ) -vcpkg_install_make() +vcpkg_make_install() if(NOT VCPKG_TARGET_IS_UWP) vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN) diff --git a/ports/x264/vcpkg.json b/ports/x264/vcpkg.json index 128d8ccf410125..2943f0de5d5be3 100644 --- a/ports/x264/vcpkg.json +++ b/ports/x264/vcpkg.json @@ -1,7 +1,7 @@ { "name": "x264", "version-string": "157-303c484ec828ed0", - "port-version": 15, + "port-version": 16, "description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format", "homepage": "https://github.com/mirror/x264", "supports": "!arm", @@ -9,6 +9,10 @@ { "name": "pthread", "platform": "linux & osx" + }, + { + "name": "vcpkg-make", + "host": true } ] } From 586c8c258c9b3ad2589e6ffbe0d2c6f739e8a782 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 29 Aug 2021 23:12:46 -0700 Subject: [PATCH 06/27] version --- versions/baseline.json | 4 ++-- versions/g-/gettext.json | 5 +++++ versions/x-/x264.json | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index dedff829a25210..57e1d51950b85d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2286,7 +2286,7 @@ }, "gettext": { "baseline": "0.21", - "port-version": 5 + "port-version": 6 }, "gettimeofday": { "baseline": "2017-10-14-3", @@ -6810,7 +6810,7 @@ }, "x264": { "baseline": "157-303c484ec828ed0", - "port-version": 15 + "port-version": 16 }, "x265": { "baseline": "3.4", diff --git a/versions/g-/gettext.json b/versions/g-/gettext.json index afcf5f51359e0a..c43b54aa428a15 100644 --- a/versions/g-/gettext.json +++ b/versions/g-/gettext.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "100b45fb256256a452eb8c53e5201c84f29feb2e", + "version": "0.21", + "port-version": 6 + }, { "git-tree": "d1089dfcf335a94ca47c5b918c56a7ab6fc0ae92", "version": "0.21", diff --git a/versions/x-/x264.json b/versions/x-/x264.json index d129da3b53d5ad..628e2f0c17fbc1 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8146fd54bc8d5884cd76ec4139a1ea61ea23d3de", + "version-string": "157-303c484ec828ed0", + "port-version": 16 + }, { "git-tree": "e766671c5f64574235784ce45b1668daf4cb9b44", "version-string": "157-303c484ec828ed0", From f84f421d544bc3881acee195317712b2050414ec Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 30 Aug 2021 01:56:20 -0700 Subject: [PATCH 07/27] Fix command line --- ports/vcpkg-make/vcpkg_make_configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index d8f0fa86437404..c41bf2eaa1d51e 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -851,7 +851,7 @@ function(vcpkg_make_configure) if (NOT arg_SKIP_CONFIGURE) message(STATUS "Configuring ${TARGET_TRIPLET}-${short_name_${_buildtype}}") vcpkg_execute_required_process( - COMMAND "${command}" + COMMAND ${command} WORKING_DIRECTORY "${target_dir}" LOGNAME "config-${TARGET_TRIPLET}-${short_name_${_buildtype}}" ) From bc3a0b914ec5c9b821efbb26eb610baa3d722e76 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 02:31:59 -0700 Subject: [PATCH 08/27] Try to use MAKEFILE instead of subpath --- ports/gettext/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index 5d08d13c909ac1..1a14e3f10f415b 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -87,7 +87,7 @@ function(build_libintl_only) OPTIONS ${OPTIONS} ) - vcpkg_make_install(SUBPATH "/intl") + vcpkg_make_install(MAKEFILE "/intl/Makefile") endfunction() if("tools" IN_LIST FEATURES) From 23ec7ec95ae6f3b10897ba44a62c401093a8d689 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Wed, 1 Sep 2021 23:52:38 -0700 Subject: [PATCH 09/27] Revert changes about SUBPATH --- ports/gettext/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index 1a14e3f10f415b..5d08d13c909ac1 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -87,7 +87,7 @@ function(build_libintl_only) OPTIONS ${OPTIONS} ) - vcpkg_make_install(MAKEFILE "/intl/Makefile") + vcpkg_make_install(SUBPATH "/intl") endfunction() if("tools" IN_LIST FEATURES) From cf3127d2d9a77c38542530f6092005cab9f247fa Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 00:26:57 -0700 Subject: [PATCH 10/27] generate vcpkg-make docs --- docs/regenerate.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/regenerate.ps1 b/docs/regenerate.ps1 index f2f888a770046a..af9dc24d4038c8 100755 --- a/docs/regenerate.ps1 +++ b/docs/regenerate.ps1 @@ -29,6 +29,7 @@ class CMakeDocumentation { 'vcpkg-cmake' 'vcpkg-cmake-config' 'vcpkg-pkgconfig-get-modules' + 'vcpkg-make' ) [CMakeDocumentation[]]$tableOfContents = @() From 825996a64bd090fabf393c438e7d289dae01779e Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 00:40:43 -0700 Subject: [PATCH 11/27] Update doc --- docs/maintainers/portfile-functions.md | 6 ++++++ docs/maintainers/ports/vcpkg-make.md | 7 +++++++ docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md | 0 docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md | 0 docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md | 0 5 files changed, 13 insertions(+) create mode 100644 docs/maintainers/ports/vcpkg-make.md create mode 100644 docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md create mode 100644 docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md create mode 100644 docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index 274e39b292c4c8..ed0b74cc27c491 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -79,3 +79,9 @@ ### [vcpkg-pkgconfig-get-modules](ports/vcpkg-pkgconfig-get-modules.md) - [x\_vcpkg\_pkgconfig\_get\_modules](ports/vcpkg-pkgconfig-get-modules/x_vcpkg_pkgconfig_get_modules.md) + +### [vcpkg-make](ports/vcpkg-make.md) + +- [vcpkg\_make\_build](ports/vcpkg-make/vcpkg_make_build.md) +- [vcpkg\_make\_configure](ports/vcpkg-make/vcpkg_make_configure.md) +- [vcpkg\_make\_install](ports/vcpkg-make/vcpkg_make_install.md) diff --git a/docs/maintainers/ports/vcpkg-make.md b/docs/maintainers/ports/vcpkg-make.md new file mode 100644 index 00000000000000..4cb78d8fba1500 --- /dev/null +++ b/docs/maintainers/ports/vcpkg-make.md @@ -0,0 +1,7 @@ +# vcpkg-make + +This port contains make functions for dealing with a Make buildsystem. + +In the common case, `vcpkg_make_configure()` (with appropriate arguments) +followed by `vcpkg_make_install()` will be enough to build and install a port. +`vcpkg_make_build()` is provided for more complex cases. diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md new file mode 100644 index 00000000000000..e69de29bb2d1d6 From 783c307b4e8e81ac632a9588691ca25ba7912cdd Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 00:43:08 -0700 Subject: [PATCH 12/27] Doc update --- .../ports/vcpkg-make/vcpkg_make_build.md | 55 +++++++++++ .../ports/vcpkg-make/vcpkg_make_configure.md | 93 +++++++++++++++++++ .../ports/vcpkg-make/vcpkg_make_install.md | 25 +++++ 3 files changed, 173 insertions(+) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md index e69de29bb2d1d6..c89580b0e70389 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md @@ -0,0 +1,55 @@ +# vcpkg_make_build + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md). + +Build a linux makefile project. + +```cmake +vcpkg_make_build( + [BUILD_TARGET ] + [ADD_BIN_TO_PATH] + [ENABLE_INSTALL] + [MAKEFILE ] + [LOGFILE_BASE ] +) +``` + +### BUILD_TARGET +The target passed to the make build command (`./make `). If not specified, the 'all' target will +be passed. + +### ADD_BIN_TO_PATH +Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. + +### ENABLE_INSTALL +IF the port supports the install target use vcpkgl_make_instal() instead of vcpkg_make_build() + +### MAKEFILE +Specifies the Makefile as a relative path from the root of the sources passed to `vcpkg_make_configure()` + +### BUILD_TARGET +The target passed to the make build command (`./make `). Defaults to 'all'. + +### INSTALL_TARGET +The target passed to the make build command (`./make `) if `ENABLE_INSTALL` is used. Defaults to 'install'. + +### DISABLE_PARALLEL +The underlying buildsystem will be instructed to not parallelize + +### SUBPATH +Additional subdir to invoke make in. Useful if only parts of a port should be built. + +## Notes: +This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). +You can use the alias [`vcpkgl_make_instal()`](vcpkgl_make_instal.md) function if your makefile supports the +"install" target + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) + +## Source +[ports/vcpkg-make/vcpkg\_make\_build.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_build.cmake) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md index e69de29bb2d1d6..c70a398bb711a5 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md @@ -0,0 +1,93 @@ +# vcpkg_make_configure + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md). + +Configure configure for Debug and Release builds of a project. + +## Usage +```cmake +vcpkg_make_configure( + SOURCE_PATH <${source_path}> + [AUTOCONFIG] + [USE_WRAPPERS] + [DETERMINE_BUILD_TRIPLET] + [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}>] + [PRERUN_SHELL <${shell_path}>] + [OPTIONS <--use_this_in_all_builds=1>...] + [OPTIONS_RELEASE <--optimize=1>...] + [OPTIONS_DEBUG <--debuggable=1>...] +) +``` + +## Parameters +### SOURCE_PATH +Specifies the directory containing the `configure`/`configure.ac`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### PROJECT_SUBPATH +Specifies the directory containing the ``configure`/`configure.ac`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### SKIP_CONFIGURE +Skip configure process + +### USE_WRAPPERS +Use autotools ar-lib and compile wrappers (only applies to windows cl and lib) + +### BUILD_TRIPLET +Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET + +### DETERMINE_BUILD_TRIPLET +For ports having a configure script following the autotools rules for selecting the 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. + +### OPTIONS_RELEASE +Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`. + +### 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. + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) + +## Source +[ports/vcpkg-make/vcpkg\_make\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_configure.cmake) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md index e69de29bb2d1d6..00f3f62428d48b 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md @@ -0,0 +1,25 @@ +# vcpkg_install_make + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md). + +Build and install a make project. + +```cmake +vcpkg_make_install( + [DISABLE_PARALLEL] + [ADD_BIN_TO_PATH] +) +``` + +`vcpkg_make_install` transparently forwards to [`vcpkg_make_build()`], +with additional parameters to set `ENABLE_INSTALL`, +and to set the `LOGFILE_BASE` to `install` as well. + +[`vcpkg_make_build()`]: vcpkg_make_build.cmake + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) + +## Source +[ports/vcpkg-make/vcpkg\_make\_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_install.cmake) From 5618cefe920fca4a8d115b8fdc10cbfaa69045c7 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 02:08:21 -0700 Subject: [PATCH 13/27] Modify docs, fix a bug --- ports/vcpkg-make/vcpkg_make_build.cmake | 47 +++++++------ ports/vcpkg-make/vcpkg_make_configure.cmake | 77 ++++++++------------- 2 files changed, 57 insertions(+), 67 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_build.cmake b/ports/vcpkg-make/vcpkg_make_build.cmake index e8fb0273fa91b6..1f92efa4ec1cc5 100644 --- a/ports/vcpkg-make/vcpkg_make_build.cmake +++ b/ports/vcpkg-make/vcpkg_make_build.cmake @@ -9,39 +9,46 @@ vcpkg_make_build( [ADD_BIN_TO_PATH] [ENABLE_INSTALL] [MAKEFILE ] + [SUBPATH ] + [DISABLE_PARALLEL] [LOGFILE_BASE ] ) ``` -### BUILD_TARGET -The target passed to the make build command (`./make `). If not specified, the 'all' target will -be passed. +`vcpkg_make_build` builds an already-configured make project. +You can use the alias [`vcpkg_make_install()`] function +if the Makefile build system supports the `install` TARGET, +and this is something we recommend doing whenever possible. +Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. -### ADD_BIN_TO_PATH -Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. +By default, `vcpkg_make_build` will call the `Makefile` in the build directory +and build all the targets. -### ENABLE_INSTALL -IF the port supports the install target use vcpkgl_make_instal() instead of vcpkg_make_build() +If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. +This path is based on the build path. +If the makefile comes from another path or the name is not `Makefile`, please +pass `MAKEFILE` and set the absolute path. +Please pass `BUILD_TARGET` to select the needed targets. -### MAKEFILE -Specifies the Makefile as a relative path from the root of the sources passed to `vcpkg_make_configure()` +When `ENABLE_INSTALL` is enabled, `vcpkg_make_build` will install all targets +unless `INSTALL_TARGET` is declared as some specific targets. -### BUILD_TARGET -The target passed to the make build command (`./make `). Defaults to 'all'. +`LOGFILE_BASE` is used to set the base of the logfile names; +by default, this is `build`, and thus the logfiles end up being something like +`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`, +this is set to `install`, so you'll get log names like `install-x86-windows-dbg.log`. -### INSTALL_TARGET -The target passed to the make build command (`./make `) if `ENABLE_INSTALL` is used. Defaults to 'install'. +For build systems that are buggy when run in parallel, +using `DISABLE_PARALLEL` will run the build with only one job. -### DISABLE_PARALLEL -The underlying buildsystem will be instructed to not parallelize - -### SUBPATH -Additional subdir to invoke make in. Useful if only parts of a port should be built. +Finally, `ADD_BIN_TO_PATH` adds the appropriate (either release or debug) +`bin/` directories to the path during the build, +such that executables run during the build will be able to access those DLLs. ## Notes: This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). -You can use the alias [`vcpkgl_make_instal()`](vcpkgl_make_instal.md) function if your makefile supports the -"install" target +You can use the alias [`vcpkgl_make_install()`](vcpkgl_make_install.md) function if your makefile +supports the "install" target. ## Examples diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index c41bf2eaa1d51e..7ae3e5ff5596be 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -1,9 +1,8 @@ #[===[.md: # vcpkg_make_configure -Configure configure for Debug and Release builds of a project. +Configure a Makefile buildsystem. -## Usage ```cmake vcpkg_make_configure( SOURCE_PATH <${source_path}> @@ -25,58 +24,42 @@ vcpkg_make_configure( ) ``` -## Parameters -### SOURCE_PATH -Specifies the directory containing the `configure`/`configure.ac`. -By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +`vcpkg_make_configure` configures a Makefile build system for use with +`vcpkg_make_buildsystem_build` and `vcpkg_make_buildsystem_install`. +`source-path` is where the source is located; by convention, +this is usually `${SOURCE_PATH}`, which is set by one of the `vcpkg_from_*` functions. +Use `PROJECT_SUBPATH` if `configure`/`configure.ac` is elsewhere in the source directory. +This function configures the build system for both Debug and Release builds by default, +assuming that `VCPKG_BUILD_TYPE` is not set; if it is, then it will only configure for +that build type. All default build configurations will be obtained from cmake +configuration through `z_vcpkg_get_cmake_vars`. -### PROJECT_SUBPATH -Specifies the directory containing the ``configure`/`configure.ac`. -By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +Use the `OPTIONS` argument to set the configure settings for both release and debug, +and use `OPTIONS_RELEASE` and `OPTIONS_DEBUG` to set the configure settings for +release only and debug only respectively. -### SKIP_CONFIGURE -Skip configure process +`vcpkg_make_configure` uses [mingw] as its build system on Windows and uses [GNU Make] +on non-Windows. +Do not use for batch files which simply call autoconf or configure. -### USE_WRAPPERS -Use autotools ar-lib and compile wrappers (only applies to windows cl and lib) +[mingw]: https://www.mingw-w64.org/ +[GNU Make]: https://www.gnu.org/software/make/ -### BUILD_TRIPLET -Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET +By default, `vcpkg_make_configure` uses the current architecture as the --build/--target/--host. +For cross-platform construction, use `DETERMINE_BUILD_TRIPLET` to adapt to the host platform. +You can also use `BUILD_TRIPLET` to specify --build/--target/--host, this option will overwrite +`VCPKG_MAKE_BUILD_TRIPLET` globally. -### DETERMINE_BUILD_TRIPLET -For ports having a configure script following the autotools rules for selecting the triplet +For some libraries, additional scripts need to be called before configure, pass `PRERUN_SHELL` +and set the script relative path. -### NO_ADDITIONAL_PATHS -Don't pass any additional paths except for --prefix to the configure call +Use `ADD_BIN_TO_PATH` during configuration to add the appropriate Release and Debug `bin\` +directories to the path so that the executable file can run against the in-tree DLL. +Use `NO_ADDITIONAL_PATHS `to not add additional paths except `--prefix` to configure. -### AUTOCONFIG -Need to use autoconfig to generate configure file. +Use `USE_WRAPPERS` to use autotools ar-lib and compile wrappers when building Windows. -### 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. - -### OPTIONS_RELEASE -Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`. - -### 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. +Use `DISABLE_VERBOSE_FLAGS` to not pass '--disable-silent-rules --verbose' to configure. ## Notes This command supplies many common arguments to configure. To see the full list, examine the source. @@ -276,7 +259,7 @@ function(vcpkg_make_configure) 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(EXISTS "${src_dir}/configure" AND EXISTS "${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 From 7493169f49542228bf224d9f8b46317ddab410c8 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 7 Sep 2021 02:28:20 -0700 Subject: [PATCH 14/27] fix doc --- ports/vcpkg-make/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-make/README.md b/ports/vcpkg-make/README.md index 4cb78d8fba1500..ae134c2163b520 100644 --- a/ports/vcpkg-make/README.md +++ b/ports/vcpkg-make/README.md @@ -1,6 +1,6 @@ # vcpkg-make -This port contains make functions for dealing with a Make buildsystem. +This port contains make functions for dealing with a Makefile buildsystem. In the common case, `vcpkg_make_configure()` (with appropriate arguments) followed by `vcpkg_make_install()` will be enough to build and install a port. From 032e461c0191bdf505e9f4e8b3404209558905a6 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 9 Sep 2021 23:09:36 -0700 Subject: [PATCH 15/27] Add IN LISTS to foreach; remove option AUTOCONFIG since it's by default; remove z_vcpkg_convert_path_to_unix --- ports/vcpkg-make/vcpkg_make_configure.cmake | 63 ++++++--------------- 1 file changed, 16 insertions(+), 47 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index 7ae3e5ff5596be..afa002a6eef5a5 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -6,7 +6,6 @@ Configure a Makefile buildsystem. ```cmake vcpkg_make_configure( SOURCE_PATH <${source_path}> - [AUTOCONFIG] [USE_WRAPPERS] [DETERMINE_BUILD_TRIPLET] [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] @@ -163,7 +162,7 @@ macro(z_vcpkg_backup_env_variable envvar) endmacro() macro(z_vcpkg_backup_env_variables) - foreach(_var ${ARGV}) + foreach(_var IN LISTS ${ARGV}) z_vcpkg_backup_env_variable(${_var}) endforeach() endmacro() @@ -177,7 +176,7 @@ macro(z_vcpkg_restore_env_variable envvar) endmacro() macro(z_vcpkg_restore_env_variables) - foreach(_var ${ARGV}) + foreach(_var IN LISTS ${ARGV}) z_vcpkg_restore_env_variable(${_var}) endforeach() endmacro() @@ -217,37 +216,14 @@ macro(z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags flag_suffix) debug_message("CXXFLAGS_${flag_suffix}: ${CXXFLAGS_${flag_suffix}}") endmacro() -macro(z_vcpkg_convert_path_to_unix pathvar) - if (NOT cygpath) - find_program(cygpath NAMES cygpath PATHS "${MSYS_ROOT}/usr/bin" REQUIRED) - endif() - foreach (curr_option IN LISTS ${pathvar}) - debug_message("curr_option: ${curr_option}") - string(REGEX REPLACE ".*=(.+)" "\\1" matched_path "${curr_option}") - debug_message("matched_path: ${matched_path}") - if (matched_path AND NOT (matched_path STREQUAL curr_option)) - execute_process( - COMMAND "${cygpath}" "${matched_path}" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" - OUTPUT_VARIABLE out_vars - ) - string(REGEX MATCH "[^\n]+" out_vars "${out_vars}") - debug_message("Converted path: ${out_vars}") - debug_message("replace \"${matched_path}\" with \"${out_vars}\" in \"${${pathvar}}\"") - list(TRANSFORM ${pathvar} REPLACE "${matched_path}" "${out_vars}") - debug_message("fixed_values: ${fixed_values}") - endif() - endforeach() -endmacro() - function(vcpkg_make_configure) # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 arg - "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" + "SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES" ) - + z_vcpkg_get_cmake_vars(cmake_vars_file) debug_message("Including cmake vars from: ${cmake_vars_file}") include("${cmake_vars_file}") @@ -259,16 +235,14 @@ function(vcpkg_make_configure) set(requires_autogen FALSE) # use autogen.sh set(requires_autoconfig FALSE) # use autotools and configure.ac - if(EXISTS "${src_dir}/configure" AND EXISTS "${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(arg_AUTOCONFIG ON) - endif() - elseif(EXISTS "${src_dir}/configure" AND NOT arg_SKIP_CONFIGURE) # run normally; no autoconf or autgen required - elseif(EXISTS "${src_dir}/configure.ac") # Run autoconfig + if(EXISTS "${src_dir}/configure.ac") # Run autoconf by default if configure.ac exist + if(VCPKG_MAINTAINER_SKIP_AUTOCONFIG AND NOT EXISTS "${src_dir}/configure") + message(FATAL_ERROR "file `configure` not found, please do not pass VCPKG_MAINTAINER_SKIP_AUTOCONFIG") + endif() + # remove configure; rerun autoconf set(requires_autoconfig TRUE) - set(arg_AUTOCONFIG ON) + file(REMOVE "${src_dir}/configure") # remove possible autodated configure scripts + elseif(EXISTS "${src_dir}/configure" AND NOT arg_SKIP_CONFIGURE) # run normally; no autoconf or autogen required elseif(EXISTS "${src_dir}/autogen.sh") # Run autogen set(requires_autogen TRUE) else() @@ -279,7 +253,7 @@ function(vcpkg_make_configure) debug_message("requires_autoconfig:${requires_autoconfig}") if(CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") #only applies to windows (clang-)cl and lib - if(arg_AUTOCONFIG) + if(requires_autoconfig) set(arg_USE_WRAPPERS TRUE) else() # Keep the setting from portfiles. @@ -319,13 +293,8 @@ function(vcpkg_make_configure) if(CMAKE_HOST_WIN32) list(APPEND msys_require_packages binutils libtool autoconf automake-wrapper automake1.16 m4) vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${msys_require_packages} ${arg_ADDITIONAL_MSYS_PACKAGES}) - message(STATUS "Checking and converting options...") - z_vcpkg_convert_path_to_unix(arg_OPTIONS) - z_vcpkg_convert_path_to_unix(arg_OPTIONS_DEBUG) - z_vcpkg_convert_path_to_unix(arg_OPTIONS_RELEASE) - message(STATUS "Checking and converting done...") endif() - if (arg_AUTOCONFIG AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET OR VCPKG_CROSSCOMPILING AND NOT arg_BUILD_TRIPLET) + if (requires_autoconfig AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET OR VCPKG_CROSSCOMPILING AND NOT arg_BUILD_TRIPLET) z_vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build= z_vcpkg_determine_autotools_target_cpu(TARGET_ARCH) # --build: the machine you are building on @@ -480,7 +449,7 @@ function(vcpkg_make_configure) # macOS - cross-compiling support if(VCPKG_TARGET_IS_OSX) - if (arg_AUTOCONFIG AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET) + if (requires_autoconfig AND NOT arg_BUILD_TRIPLET OR arg_DETERMINE_BUILD_TRIPLET) z_vcpkg_determine_autotools_host_arch_mac(BUILD_ARCH) # machine you are building on => --build= z_vcpkg_determine_autotools_target_arch_mac(TARGET_ARCH) # --build: the machine you are building on @@ -639,7 +608,7 @@ function(vcpkg_make_configure) endif() # Run autoconf if necessary - if (arg_AUTOCONFIG OR requires_autoconfig) + if (requires_autoconfig) find_program(AUTORECONF autoreconf) if(NOT AUTORECONF) message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")") @@ -868,7 +837,7 @@ function(vcpkg_make_configure) set(ENV{PATH} "${path_backup}") endif() # Restore environment (config dependent) - foreach(ENV_VAR ${arg_CONFIG_DEPENDENT_ENVIRONMENT}) + foreach(ENV_VAR IN LISTS ${arg_CONFIG_DEPENDENT_ENVIRONMENT}) if(backup_config_${ENV_VAR}) set(ENV{${ENV_VAR}} "${backup_config_${ENV_VAR}}") else() From 583199ba83415788886ad0a7585f9583ad1f859f Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 10 Sep 2021 00:55:28 -0700 Subject: [PATCH 16/27] Update docs --- docs/maintainers/ports/vcpkg-make.md | 2 +- .../ports/vcpkg-make/vcpkg_make_build.md | 47 +++++++----- .../ports/vcpkg-make/vcpkg_make_configure.md | 76 +++++++------------ 3 files changed, 57 insertions(+), 68 deletions(-) diff --git a/docs/maintainers/ports/vcpkg-make.md b/docs/maintainers/ports/vcpkg-make.md index 4cb78d8fba1500..ae134c2163b520 100644 --- a/docs/maintainers/ports/vcpkg-make.md +++ b/docs/maintainers/ports/vcpkg-make.md @@ -1,6 +1,6 @@ # vcpkg-make -This port contains make functions for dealing with a Make buildsystem. +This port contains make functions for dealing with a Makefile buildsystem. In the common case, `vcpkg_make_configure()` (with appropriate arguments) followed by `vcpkg_make_install()` will be enough to build and install a port. diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md index c89580b0e70389..6504c2df7c1776 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md @@ -10,39 +10,46 @@ vcpkg_make_build( [ADD_BIN_TO_PATH] [ENABLE_INSTALL] [MAKEFILE ] + [SUBPATH ] + [DISABLE_PARALLEL] [LOGFILE_BASE ] ) ``` -### BUILD_TARGET -The target passed to the make build command (`./make `). If not specified, the 'all' target will -be passed. +`vcpkg_make_build` builds an already-configured make project. +You can use the alias [`vcpkg_make_install()`] function +if the Makefile build system supports the `install` TARGET, +and this is something we recommend doing whenever possible. +Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. -### ADD_BIN_TO_PATH -Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. +By default, `vcpkg_make_build` will call the `Makefile` in the build directory +and build all the targets. -### ENABLE_INSTALL -IF the port supports the install target use vcpkgl_make_instal() instead of vcpkg_make_build() +If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. +This path is based on the build path. +If the makefile comes from another path or the name is not `Makefile`, please +pass `MAKEFILE` and set the absolute path. +Please pass `BUILD_TARGET` to select the needed targets. -### MAKEFILE -Specifies the Makefile as a relative path from the root of the sources passed to `vcpkg_make_configure()` +When `ENABLE_INSTALL` is enabled, `vcpkg_make_build` will install all targets +unless `INSTALL_TARGET` is declared as some specific targets. -### BUILD_TARGET -The target passed to the make build command (`./make `). Defaults to 'all'. +`LOGFILE_BASE` is used to set the base of the logfile names; +by default, this is `build`, and thus the logfiles end up being something like +`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`, +this is set to `install`, so you'll get log names like `install-x86-windows-dbg.log`. -### INSTALL_TARGET -The target passed to the make build command (`./make `) if `ENABLE_INSTALL` is used. Defaults to 'install'. +For build systems that are buggy when run in parallel, +using `DISABLE_PARALLEL` will run the build with only one job. -### DISABLE_PARALLEL -The underlying buildsystem will be instructed to not parallelize - -### SUBPATH -Additional subdir to invoke make in. Useful if only parts of a port should be built. +Finally, `ADD_BIN_TO_PATH` adds the appropriate (either release or debug) +`bin/` directories to the path during the build, +such that executables run during the build will be able to access those DLLs. ## Notes: This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). -You can use the alias [`vcpkgl_make_instal()`](vcpkgl_make_instal.md) function if your makefile supports the -"install" target +You can use the alias [`vcpkgl_make_install()`](vcpkgl_make_install.md) function if your makefile +supports the "install" target. ## Examples diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md index c70a398bb711a5..7363a49d80aa7a 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md @@ -2,13 +2,11 @@ The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md). -Configure configure for Debug and Release builds of a project. +Configure a Makefile buildsystem. -## Usage ```cmake vcpkg_make_configure( SOURCE_PATH <${source_path}> - [AUTOCONFIG] [USE_WRAPPERS] [DETERMINE_BUILD_TRIPLET] [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] @@ -26,58 +24,42 @@ vcpkg_make_configure( ) ``` -## Parameters -### SOURCE_PATH -Specifies the directory containing the `configure`/`configure.ac`. -By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +`vcpkg_make_configure` configures a Makefile build system for use with +`vcpkg_make_buildsystem_build` and `vcpkg_make_buildsystem_install`. +`source-path` is where the source is located; by convention, +this is usually `${SOURCE_PATH}`, which is set by one of the `vcpkg_from_*` functions. +Use `PROJECT_SUBPATH` if `configure`/`configure.ac` is elsewhere in the source directory. +This function configures the build system for both Debug and Release builds by default, +assuming that `VCPKG_BUILD_TYPE` is not set; if it is, then it will only configure for +that build type. All default build configurations will be obtained from cmake +configuration through `z_vcpkg_get_cmake_vars`. -### PROJECT_SUBPATH -Specifies the directory containing the ``configure`/`configure.ac`. -By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +Use the `OPTIONS` argument to set the configure settings for both release and debug, +and use `OPTIONS_RELEASE` and `OPTIONS_DEBUG` to set the configure settings for +release only and debug only respectively. -### SKIP_CONFIGURE -Skip configure process +`vcpkg_make_configure` uses [mingw] as its build system on Windows and uses [GNU Make] +on non-Windows. +Do not use for batch files which simply call autoconf or configure. -### USE_WRAPPERS -Use autotools ar-lib and compile wrappers (only applies to windows cl and lib) +[mingw]: https://www.mingw-w64.org/ +[GNU Make]: https://www.gnu.org/software/make/ -### BUILD_TRIPLET -Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET +By default, `vcpkg_make_configure` uses the current architecture as the --build/--target/--host. +For cross-platform construction, use `DETERMINE_BUILD_TRIPLET` to adapt to the host platform. +You can also use `BUILD_TRIPLET` to specify --build/--target/--host, this option will overwrite +`VCPKG_MAKE_BUILD_TRIPLET` globally. -### DETERMINE_BUILD_TRIPLET -For ports having a configure script following the autotools rules for selecting the triplet +For some libraries, additional scripts need to be called before configure, pass `PRERUN_SHELL` +and set the script relative path. -### NO_ADDITIONAL_PATHS -Don't pass any additional paths except for --prefix to the configure call +Use `ADD_BIN_TO_PATH` during configuration to add the appropriate Release and Debug `bin\` +directories to the path so that the executable file can run against the in-tree DLL. +Use `NO_ADDITIONAL_PATHS `to not add additional paths except `--prefix` to configure. -### AUTOCONFIG -Need to use autoconfig to generate configure file. +Use `USE_WRAPPERS` to use autotools ar-lib and compile wrappers when building Windows. -### 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. - -### OPTIONS_RELEASE -Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`. - -### 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. +Use `DISABLE_VERBOSE_FLAGS` to not pass '--disable-silent-rules --verbose' to configure. ## Notes This command supplies many common arguments to configure. To see the full list, examine the source. From 219555fa55f575a4e18efaaead8e488b11b582ea Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 10 Sep 2021 01:27:42 -0700 Subject: [PATCH 17/27] Pick some ports to test new functions --- ports/apr-util/portfile.cmake | 4 ++-- ports/apr-util/vcpkg.json | 8 ++++++-- ports/apr/portfile.cmake | 4 ++-- ports/apr/vcpkg.json | 8 +++++++- ports/fontconfig/portfile.cmake | 5 ++--- ports/fontconfig/vcpkg.json | 8 ++++++-- ports/gdal/portfile.cmake | 5 ++--- ports/gdal/vcpkg.json | 6 +++++- ports/healpix/portfile.cmake | 5 ++--- ports/healpix/vcpkg.json | 8 ++++++-- ports/hunspell/portfile.cmake | 8 +++----- ports/hunspell/vcpkg.json | 8 ++++++-- ports/icu/portfile.cmake | 6 +++--- ports/icu/vcpkg.json | 6 +++++- ports/libiconv/portfile.cmake | 21 +++++++++++---------- ports/libiconv/vcpkg.json | 10 ++++++++-- ports/liburing/portfile.cmake | 4 ++-- ports/liburing/vcpkg.json | 9 ++++++++- ports/ncurses/portfile.cmake | 4 ++-- ports/ncurses/vcpkg.json | 10 ++++++++-- ports/starlink-ast/portfile.cmake | 4 ++-- ports/starlink-ast/vcpkg.json | 8 +++++++- 22 files changed, 105 insertions(+), 54 deletions(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index 1065bdb7234c0c..f9c1f8baf6db8c 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -62,7 +62,7 @@ else(VCPKG_TARGET_IS_WINDOWS) message(STATUS "Configuring apr-util") endif() - vcpkg_configure_make( + vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" NO_DEBUG OPTIONS @@ -75,7 +75,7 @@ else(VCPKG_TARGET_IS_WINDOWS) "${CONFIGURE_PARAMETER_3}" ) - vcpkg_install_make() + vcpkg_make_install() endif() diff --git a/ports/apr-util/vcpkg.json b/ports/apr-util/vcpkg.json index aa7937210aa20c..a0082c567007ce 100644 --- a/ports/apr-util/vcpkg.json +++ b/ports/apr-util/vcpkg.json @@ -1,12 +1,16 @@ { "name": "apr-util", "version-string": "1.6.1", - "port-version": 4, + "port-version": 5, "description": "Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation", "homepage": "https://apr.apache.org/", "dependencies": [ "apr", "expat", - "openssl" + "openssl", + { + "name": "vcpkg-make", + "host": true + } ] } diff --git a/ports/apr/portfile.cmake b/ports/apr/portfile.cmake index 3b9bed66415f1c..f18f906f4d6680 100644 --- a/ports/apr/portfile.cmake +++ b/ports/apr/portfile.cmake @@ -66,7 +66,7 @@ else() message(STATUS "Configuring apr") endif() set(ENV{CFLAGS} "$ENV{CFLAGS} -Wno-error=implicit-function-declaration") - vcpkg_configure_make( + vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" NO_DEBUG OPTIONS @@ -76,7 +76,7 @@ else() "${CONFIGURE_PARAMETER_3}" ) - vcpkg_install_make() + vcpkg_make_install() vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/apr-1.pc "-lapr-\${APR_MAJOR_VERSION}" "-lapr-1" diff --git a/ports/apr/vcpkg.json b/ports/apr/vcpkg.json index 91fb9c71307363..a6b34ace35837a 100644 --- a/ports/apr/vcpkg.json +++ b/ports/apr/vcpkg.json @@ -1,10 +1,16 @@ { "name": "apr", "version": "1.7.0", - "port-version": 4, + "port-version": 5, "description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.", "homepage": "https://apr.apache.org/", "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-make", + "host": true + } + ], "features": { "private-headers": { "description": "Install non-standard files required for building Apache httpd" diff --git a/ports/fontconfig/portfile.cmake b/ports/fontconfig/portfile.cmake index 9635d185403353..7ed35794642c3e 100644 --- a/ports/fontconfig/portfile.cmake +++ b/ports/fontconfig/portfile.cmake @@ -23,8 +23,7 @@ vcpkg_find_acquire_program(GPERF) get_filename_component(GPERF_PATH ${GPERF} DIRECTORY) vcpkg_add_to_path(${GPERF_PATH}) -vcpkg_configure_make( - AUTOCONFIG +vcpkg_make_configure( COPY_SOURCE SOURCE_PATH ${SOURCE_PATH} OPTIONS @@ -44,7 +43,7 @@ vcpkg_configure_make( ADDITIONAL_MSYS_PACKAGES xz findutils gettext gettext-devel # for autopoint ) -vcpkg_install_make(ADD_BIN_TO_PATH) +vcpkg_make_install(ADD_BIN_TO_PATH) vcpkg_copy_pdbs() #Fix missing libintl static dependency if(NOT VCPKG_TARGET_IS_MINGW AND VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/fontconfig/vcpkg.json b/ports/fontconfig/vcpkg.json index c8b827de9756d6..7ca43088c74eb3 100644 --- a/ports/fontconfig/vcpkg.json +++ b/ports/fontconfig/vcpkg.json @@ -1,7 +1,7 @@ { "name": "fontconfig", "version-string": "2.13.1", - "port-version": 8, + "port-version": 9, "description": "Library for configuring and customizing font access.", "homepage": "https://www.freedesktop.org/software/fontconfig/front.html", "dependencies": [ @@ -15,6 +15,10 @@ "name": "libuuid", "platform": "!windows & !osx & !mingw" }, - "pthread" + "pthread", + { + "name": "vcpkg-make", + "host": true + } ] } diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index fc46f224d9ad6b..5ecd7e35be84bb 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -309,9 +309,8 @@ else() list(APPEND CONF_OPTS "--with-proj-extra-lib-for-test=-lstdc++") endif() - vcpkg_configure_make( + vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" - AUTOCONFIG COPY_SOURCE OPTIONS ${CONF_OPTS} @@ -340,7 +339,7 @@ else() endif() endforeach() - vcpkg_install_make(MAKEFILE GNUmakefile) + vcpkg_make_install(MAKEFILE GNUmakefile) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/gdalplugins" diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index 2bb7b63b114c34..5d15f3a034bc2b 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gdal", "version-semver": "3.2.2", - "port-version": 4, + "port-version": 5, "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data", "homepage": "https://gdal.org", "supports": "!arm", @@ -28,6 +28,10 @@ "proj4", "sqlite3", "tiff", + { + "name": "vcpkg-make", + "host": true + }, "zlib", "zstd" ], diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index dde1ac3c170adc..d792578cfe4e0b 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -10,8 +10,7 @@ vcpkg_from_sourceforge( PATCHES fix-dependency.patch ) -vcpkg_configure_make( - AUTOCONFIG +vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx COPY_SOURCE @@ -20,7 +19,7 @@ vcpkg_configure_make( --with-libcfitsio-lib=${CURRENT_INSTALLED_DIR}/lib ) -vcpkg_build_make(BUILD_TARGET compile_all) +vcpkg_make_build(BUILD_TARGET compile_all) #vcpkg_fixup_pkgconfig() # Install manually because healpix has no install target diff --git a/ports/healpix/vcpkg.json b/ports/healpix/vcpkg.json index 15b383f089fb74..dcdf0d609f1ac0 100644 --- a/ports/healpix/vcpkg.json +++ b/ports/healpix/vcpkg.json @@ -1,11 +1,15 @@ { "name": "healpix", "version-string": "1.12.10", - "port-version": 8, + "port-version": 9, "description": "HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere.", "homepage": "http://healpix.sourceforge.net/", "supports": "linux", "dependencies": [ - "cfitsio" + "cfitsio", + { + "name": "vcpkg-make", + "host": true + } ] } diff --git a/ports/hunspell/portfile.cmake b/ports/hunspell/portfile.cmake index 053d1dda4f70c4..05ed79ce555601 100644 --- a/ports/hunspell/portfile.cmake +++ b/ports/hunspell/portfile.cmake @@ -61,15 +61,13 @@ else() file(WRITE "${SOURCE_PATH}/src/Makefile.am" "${_contents}") endif() vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin") - vcpkg_configure_make( + vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} - OPTIONS - AUTOCONFIG ADDITIONAL_MSYS_PACKAGES gzip ) #install-pkgconfDATA: - vcpkg_build_make(BUILD_TARGET dist LOGFILE_ROOT build-dist) - vcpkg_install_make() + vcpkg_make_build(BUILD_TARGET dist LOGFILE_ROOT build-dist) + vcpkg_make_install() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug") vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin") diff --git a/ports/hunspell/vcpkg.json b/ports/hunspell/vcpkg.json index c89c4ca94ac102..dce20832fca90c 100644 --- a/ports/hunspell/vcpkg.json +++ b/ports/hunspell/vcpkg.json @@ -1,7 +1,7 @@ { "name": "hunspell", "version": "1.7.0", - "port-version": 5, + "port-version": 6, "description": "The most popular spellchecking library.", "homepage": "https://github.com/hunspell/hunspell", "supports": "!((arm | uwp) & windows)", @@ -13,7 +13,11 @@ "tools" ] }, - "libiconv" + "libiconv", + { + "name": "vcpkg-make", + "host": true + } ], "features": { "tools": { diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index 9731bf5b4b2138..9aaab80e4908ab 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -41,7 +41,7 @@ if(NOT "${TARGET_TRIPLET}" STREQUAL "${HOST_TRIPLET}") list(APPEND CONFIGURE_OPTIONS "--with-cross-build=${_VCPKG_TOOL_PATH}") endif() -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH source OPTIONS ${CONFIGURE_OPTIONS} @@ -52,7 +52,7 @@ vcpkg_configure_make( if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")) - vcpkg_build_make() + vcpkg_make_build() # remove this block if https://unicode-org.atlassian.net/browse/ICU-21458 # is resolved and use the configure script instead if(DEFINED CMAKE_INSTALL_NAME_DIR) @@ -121,7 +121,7 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND (NOT DEF ) endif() -vcpkg_install_make() +vcpkg_make_install() if(VCPKG_TARGET_IS_MINGW) file(GLOB ICU_TOOLS diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index c1e80e53057806..48540689d6c0b2 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,7 +1,7 @@ { "name": "icu", "version": "69.1", - "port-version": 14, + "port-version": 15, "description": "Mature and widely used Unicode and localization library.", "homepage": "http://icu-project.org/apiref/icu4c/", "supports": "!uwp", @@ -9,6 +9,10 @@ { "name": "icu", "host": true + }, + { + "name": "vcpkg-make", + "host": true } ] } diff --git a/ports/libiconv/portfile.cmake b/ports/libiconv/portfile.cmake index 9d8ff25aa030b1..63600584093d22 100644 --- a/ports/libiconv/portfile.cmake +++ b/ports/libiconv/portfile.cmake @@ -26,16 +26,17 @@ if (NOT VCPKG_TARGET_IS_ANDROID) list(APPEND OPTIONS --enable-relocatable) endif() -vcpkg_configure_make(SOURCE_PATH ${SOURCE_PATH} - DETERMINE_BUILD_TRIPLET - USE_WRAPPERS - OPTIONS - --enable-extra-encodings - --without-libiconv-prefix - --without-libintl-prefix - ${OPTIONS} - ) -vcpkg_install_make() +vcpkg_make_configure( + SOURCE_PATH ${SOURCE_PATH} + DETERMINE_BUILD_TRIPLET + USE_WRAPPERS + OPTIONS + --enable-extra-encodings + --without-libiconv-prefix + --without-libintl-prefix + ${OPTIONS} +) +vcpkg_make_install() vcpkg_copy_pdbs() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin) diff --git a/ports/libiconv/vcpkg.json b/ports/libiconv/vcpkg.json index 2cafb021836a0a..5a99bf148f62ab 100644 --- a/ports/libiconv/vcpkg.json +++ b/ports/libiconv/vcpkg.json @@ -1,7 +1,13 @@ { "name": "libiconv", "version": "1.16", - "port-version": 11, + "port-version": 12, "description": "GNU Unicode text conversion", - "homepage": "https://www.gnu.org/software/libiconv/" + "homepage": "https://www.gnu.org/software/libiconv/", + "dependencies": [ + { + "name": "vcpkg-make", + "host": true + } + ] } diff --git a/ports/liburing/portfile.cmake b/ports/liburing/portfile.cmake index 304bef5ecc676a..959f278efbca9c 100644 --- a/ports/liburing/portfile.cmake +++ b/ports/liburing/portfile.cmake @@ -12,12 +12,12 @@ vcpkg_from_github( ) # note: check ${SOURCE_PATH}/liburing.spec before updating configure options -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} COPY_SOURCE NO_DEBUG ) -vcpkg_install_make() +vcpkg_make_install() vcpkg_fixup_pkgconfig() file(INSTALL ${SOURCE_PATH}/LICENSE diff --git a/ports/liburing/vcpkg.json b/ports/liburing/vcpkg.json index e2bb1b53e23a5f..8d451da4b6dcae 100644 --- a/ports/liburing/vcpkg.json +++ b/ports/liburing/vcpkg.json @@ -1,7 +1,14 @@ { "name": "liburing", "version": "2.0", + "port-version": 1, "description": "Linux-native io_uring I/O access library", "homepage": "https://github.com/axboe/liburing", - "supports": "linux" + "supports": "linux", + "dependencies": [ + { + "name": "vcpkg-make", + "host": true + } + ] } diff --git a/ports/ncurses/portfile.cmake b/ports/ncurses/portfile.cmake index 71ccfda8b11826..bb1043be7f15f9 100644 --- a/ports/ncurses/portfile.cmake +++ b/ports/ncurses/portfile.cmake @@ -40,14 +40,14 @@ set(OPTIONS_RELEASE --without-debug ) -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS ${OPTIONS} OPTIONS_DEBUG ${OPTIONS_DEBUG} OPTIONS_RELEASE ${OPTIONS_RELEASE} NO_ADDITIONAL_PATHS ) -vcpkg_install_make() +vcpkg_make_install() vcpkg_fixup_pkgconfig() diff --git a/ports/ncurses/vcpkg.json b/ports/ncurses/vcpkg.json index a0aa9df575e10d..5692847150b75a 100644 --- a/ports/ncurses/vcpkg.json +++ b/ports/ncurses/vcpkg.json @@ -1,7 +1,13 @@ { "name": "ncurses", "version-string": "6.2", - "port-version": 1, + "port-version": 2, "description": "free software emulation of curses in System V Release 4.0", - "supports": "!(windows | uwp)" + "supports": "!(windows | uwp)", + "dependencies": [ + { + "name": "vcpkg-make", + "host": true + } + ] } diff --git a/ports/starlink-ast/portfile.cmake b/ports/starlink-ast/portfile.cmake index 054da29008f1e2..8a9e4932e26846 100644 --- a/ports/starlink-ast/portfile.cmake +++ b/ports/starlink-ast/portfile.cmake @@ -25,7 +25,7 @@ else() set(CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS} --without-pthreads") endif() -vcpkg_configure_make( +vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" USE_WRAPPERS DETERMINE_BUILD_TRIPLET @@ -35,7 +35,7 @@ vcpkg_configure_make( OPTIONS_DEBUG ${CONFIGURE_OPTIONS_DEBUG} ) -vcpkg_install_make() +vcpkg_make_install() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share") diff --git a/ports/starlink-ast/vcpkg.json b/ports/starlink-ast/vcpkg.json index 3248e265940b14..58b4027730613f 100644 --- a/ports/starlink-ast/vcpkg.json +++ b/ports/starlink-ast/vcpkg.json @@ -1,10 +1,16 @@ { "name": "starlink-ast", "version-semver": "9.2.4", - "port-version": 1, + "port-version": 2, "description": "The AST library provides a comprehensive range of facilities for attaching world coordinate systems to astronomical data, for retrieving and interpreting that information and for generating graphical output based on it", "homepage": "https://starlink.eao.hawaii.edu/starlink/AST", "supports": "windows", + "dependencies": [ + { + "name": "vcpkg-make", + "host": true + } + ], "features": { "pthreads": { "description": "build with POSIX threads support", From f5dc854757fc3d25c90a0357a9b57cee01cf6455 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 10 Sep 2021 02:38:04 -0700 Subject: [PATCH 18/27] update doc --- .../ports/vcpkg-make/vcpkg_make_build.md | 124 +++++++-------- .../ports/vcpkg-make/vcpkg_make_configure.md | 150 +++++++++--------- .../ports/vcpkg-make/vcpkg_make_install.md | 50 +++--- 3 files changed, 162 insertions(+), 162 deletions(-) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md index 6504c2df7c1776..a4157f00b0ad35 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md @@ -1,62 +1,62 @@ -# vcpkg_make_build - -The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md). - -Build a linux makefile project. - -```cmake -vcpkg_make_build( - [BUILD_TARGET ] - [ADD_BIN_TO_PATH] - [ENABLE_INSTALL] - [MAKEFILE ] - [SUBPATH ] - [DISABLE_PARALLEL] - [LOGFILE_BASE ] -) -``` - -`vcpkg_make_build` builds an already-configured make project. -You can use the alias [`vcpkg_make_install()`] function -if the Makefile build system supports the `install` TARGET, -and this is something we recommend doing whenever possible. -Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. - -By default, `vcpkg_make_build` will call the `Makefile` in the build directory -and build all the targets. - -If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. -This path is based on the build path. -If the makefile comes from another path or the name is not `Makefile`, please -pass `MAKEFILE` and set the absolute path. -Please pass `BUILD_TARGET` to select the needed targets. - -When `ENABLE_INSTALL` is enabled, `vcpkg_make_build` will install all targets -unless `INSTALL_TARGET` is declared as some specific targets. - -`LOGFILE_BASE` is used to set the base of the logfile names; -by default, this is `build`, and thus the logfiles end up being something like -`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`, -this is set to `install`, so you'll get log names like `install-x86-windows-dbg.log`. - -For build systems that are buggy when run in parallel, -using `DISABLE_PARALLEL` will run the build with only one job. - -Finally, `ADD_BIN_TO_PATH` adds the appropriate (either release or debug) -`bin/` directories to the path during the build, -such that executables run during the build will be able to access those DLLs. - -## Notes: -This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). -You can use the alias [`vcpkgl_make_install()`](vcpkgl_make_install.md) function if your makefile -supports the "install" target. - -## Examples - -* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) -* [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) - -## Source -[ports/vcpkg-make/vcpkg\_make\_build.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_build.cmake) +# vcpkg_make_build + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md). + +Build a linux makefile project. + +```cmake +vcpkg_make_build( + [BUILD_TARGET ] + [ADD_BIN_TO_PATH] + [ENABLE_INSTALL] + [MAKEFILE ] + [SUBPATH ] + [DISABLE_PARALLEL] + [LOGFILE_BASE ] +) +``` + +`vcpkg_make_build` builds an already-configured make project. +You can use the alias [`vcpkg_make_install()`] function +if the Makefile build system supports the `install` TARGET, +and this is something we recommend doing whenever possible. +Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. + +By default, `vcpkg_make_build` will call the `Makefile` in the build directory +and build all the targets. + +If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. +This path is based on the build path. +If the makefile comes from another path or the name is not `Makefile`, please +pass `MAKEFILE` and set the absolute path. +Please pass `BUILD_TARGET` to select the needed targets. + +When `ENABLE_INSTALL` is enabled, `vcpkg_make_build` will install all targets +unless `INSTALL_TARGET` is declared as some specific targets. + +`LOGFILE_BASE` is used to set the base of the logfile names; +by default, this is `build`, and thus the logfiles end up being something like +`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`, +this is set to `install`, so you'll get log names like `install-x86-windows-dbg.log`. + +For build systems that are buggy when run in parallel, +using `DISABLE_PARALLEL` will run the build with only one job. + +Finally, `ADD_BIN_TO_PATH` adds the appropriate (either release or debug) +`bin/` directories to the path during the build, +such that executables run during the build will be able to access those DLLs. + +## Notes: +This command should be preceded by a call to [`vcpkg_make_configure()`](vcpkg_make_configure.md). +You can use the alias [`vcpkgl_make_install()`](vcpkgl_make_install.md) function if your makefile +supports the "install" target. + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) + +## Source +[ports/vcpkg-make/vcpkg\_make\_build.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_build.cmake) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md index 7363a49d80aa7a..2c76c15380d2b6 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md @@ -1,75 +1,75 @@ -# vcpkg_make_configure - -The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md). - -Configure a Makefile buildsystem. - -```cmake -vcpkg_make_configure( - SOURCE_PATH <${source_path}> - [USE_WRAPPERS] - [DETERMINE_BUILD_TRIPLET] - [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}>] - [PRERUN_SHELL <${shell_path}>] - [OPTIONS <--use_this_in_all_builds=1>...] - [OPTIONS_RELEASE <--optimize=1>...] - [OPTIONS_DEBUG <--debuggable=1>...] -) -``` - -`vcpkg_make_configure` configures a Makefile build system for use with -`vcpkg_make_buildsystem_build` and `vcpkg_make_buildsystem_install`. -`source-path` is where the source is located; by convention, -this is usually `${SOURCE_PATH}`, which is set by one of the `vcpkg_from_*` functions. -Use `PROJECT_SUBPATH` if `configure`/`configure.ac` is elsewhere in the source directory. -This function configures the build system for both Debug and Release builds by default, -assuming that `VCPKG_BUILD_TYPE` is not set; if it is, then it will only configure for -that build type. All default build configurations will be obtained from cmake -configuration through `z_vcpkg_get_cmake_vars`. - -Use the `OPTIONS` argument to set the configure settings for both release and debug, -and use `OPTIONS_RELEASE` and `OPTIONS_DEBUG` to set the configure settings for -release only and debug only respectively. - -`vcpkg_make_configure` uses [mingw] as its build system on Windows and uses [GNU Make] -on non-Windows. -Do not use for batch files which simply call autoconf or configure. - -[mingw]: https://www.mingw-w64.org/ -[GNU Make]: https://www.gnu.org/software/make/ - -By default, `vcpkg_make_configure` uses the current architecture as the --build/--target/--host. -For cross-platform construction, use `DETERMINE_BUILD_TRIPLET` to adapt to the host platform. -You can also use `BUILD_TRIPLET` to specify --build/--target/--host, this option will overwrite -`VCPKG_MAKE_BUILD_TRIPLET` globally. - -For some libraries, additional scripts need to be called before configure, pass `PRERUN_SHELL` -and set the script relative path. - -Use `ADD_BIN_TO_PATH` during configuration to add the appropriate Release and Debug `bin\` -directories to the path so that the executable file can run against the in-tree DLL. -Use `NO_ADDITIONAL_PATHS `to not add additional paths except `--prefix` to configure. - -Use `USE_WRAPPERS` to use autotools ar-lib and compile wrappers when building Windows. - -Use `DISABLE_VERBOSE_FLAGS` to not pass '--disable-silent-rules --verbose' to configure. - -## Notes -This command supplies many common arguments to configure. To see the full list, examine the source. - -## Examples - -* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) -* [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) - -## Source -[ports/vcpkg-make/vcpkg\_make\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_configure.cmake) +# vcpkg_make_configure + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md). + +Configure a Makefile buildsystem. + +```cmake +vcpkg_make_configure( + SOURCE_PATH <${source_path}> + [USE_WRAPPERS] + [DETERMINE_BUILD_TRIPLET] + [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}>] + [PRERUN_SHELL <${shell_path}>] + [OPTIONS <--use_this_in_all_builds=1>...] + [OPTIONS_RELEASE <--optimize=1>...] + [OPTIONS_DEBUG <--debuggable=1>...] +) +``` + +`vcpkg_make_configure` configures a Makefile build system for use with +`vcpkg_make_buildsystem_build` and `vcpkg_make_buildsystem_install`. +`source-path` is where the source is located; by convention, +this is usually `${SOURCE_PATH}`, which is set by one of the `vcpkg_from_*` functions. +Use `PROJECT_SUBPATH` if `configure`/`configure.ac` is elsewhere in the source directory. +This function configures the build system for both Debug and Release builds by default, +assuming that `VCPKG_BUILD_TYPE` is not set; if it is, then it will only configure for +that build type. All default build configurations will be obtained from cmake +configuration through `z_vcpkg_get_cmake_vars`. + +Use the `OPTIONS` argument to set the configure settings for both release and debug, +and use `OPTIONS_RELEASE` and `OPTIONS_DEBUG` to set the configure settings for +release only and debug only respectively. + +`vcpkg_make_configure` uses [mingw] as its build system on Windows and uses [GNU Make] +on non-Windows. +Do not use for batch files which simply call autoconf or configure. + +[mingw]: https://www.mingw-w64.org/ +[GNU Make]: https://www.gnu.org/software/make/ + +By default, `vcpkg_make_configure` uses the current architecture as the --build/--target/--host. +For cross-platform construction, use `DETERMINE_BUILD_TRIPLET` to adapt to the host platform. +You can also use `BUILD_TRIPLET` to specify --build/--target/--host, this option will overwrite +`VCPKG_MAKE_BUILD_TRIPLET` globally. + +For some libraries, additional scripts need to be called before configure, pass `PRERUN_SHELL` +and set the script relative path. + +Use `ADD_BIN_TO_PATH` during configuration to add the appropriate Release and Debug `bin\` +directories to the path so that the executable file can run against the in-tree DLL. +Use `NO_ADDITIONAL_PATHS `to not add additional paths except `--prefix` to configure. + +Use `USE_WRAPPERS` to use autotools ar-lib and compile wrappers when building Windows. + +Use `DISABLE_VERBOSE_FLAGS` to not pass '--disable-silent-rules --verbose' to configure. + +## Notes +This command supplies many common arguments to configure. To see the full list, examine the source. + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) +* [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) + +## Source +[ports/vcpkg-make/vcpkg\_make\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_configure.cmake) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md index 00f3f62428d48b..e6b9a24cb67f43 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md @@ -1,25 +1,25 @@ -# vcpkg_install_make - -The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md). - -Build and install a make project. - -```cmake -vcpkg_make_install( - [DISABLE_PARALLEL] - [ADD_BIN_TO_PATH] -) -``` - -`vcpkg_make_install` transparently forwards to [`vcpkg_make_build()`], -with additional parameters to set `ENABLE_INSTALL`, -and to set the `LOGFILE_BASE` to `install` as well. - -[`vcpkg_make_build()`]: vcpkg_make_build.cmake - -## Examples - -* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) - -## Source -[ports/vcpkg-make/vcpkg\_make\_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_install.cmake) +# vcpkg_install_make + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/docs/maintainers/ports/vcpkg-make/vcpkg_make_install.md). + +Build and install a make project. + +```cmake +vcpkg_make_install( + [DISABLE_PARALLEL] + [ADD_BIN_TO_PATH] +) +``` + +`vcpkg_make_install` transparently forwards to [`vcpkg_make_build()`], +with additional parameters to set `ENABLE_INSTALL`, +and to set the `LOGFILE_BASE` to `install` as well. + +[`vcpkg_make_build()`]: vcpkg_make_build.cmake + +## Examples + +* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake) + +## Source +[ports/vcpkg-make/vcpkg\_make\_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-make/vcpkg_make_install.cmake) From 63bd67ee1d696b3f480a5adf40e9456e0ee09b62 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 13 Sep 2021 00:02:23 -0700 Subject: [PATCH 19/27] Revert changes about autoconfig, fix ENV bug --- ports/vcpkg-make/vcpkg_make_configure.cmake | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index afa002a6eef5a5..3820a9fa390ff9 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -162,7 +162,7 @@ macro(z_vcpkg_backup_env_variable envvar) endmacro() macro(z_vcpkg_backup_env_variables) - foreach(_var IN LISTS ${ARGV}) + foreach(_var IN ITEMS ${ARGV}) z_vcpkg_backup_env_variable(${_var}) endforeach() endmacro() @@ -176,7 +176,7 @@ macro(z_vcpkg_restore_env_variable envvar) endmacro() macro(z_vcpkg_restore_env_variables) - foreach(_var IN LISTS ${ARGV}) + foreach(_var IN ITEMS ${ARGV}) z_vcpkg_restore_env_variable(${_var}) endforeach() endmacro() @@ -233,18 +233,18 @@ function(vcpkg_make_configure) set(src_dir "${arg_SOURCE_PATH}/${arg_PROJECT_SUBPATH}") - set(requires_autogen FALSE) # use autogen.sh - set(requires_autoconfig FALSE) # use autotools and configure.ac - if(EXISTS "${src_dir}/configure.ac") # Run autoconf by default if configure.ac exist - if(VCPKG_MAINTAINER_SKIP_AUTOCONFIG AND NOT EXISTS "${src_dir}/configure") - message(FATAL_ERROR "file `configure` not found, please do not pass VCPKG_MAINTAINER_SKIP_AUTOCONFIG") + set(requires_autogen OFF) # use autogen.sh + set(requires_autoconfig OFF) # 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 ON) + file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts endif() - # remove configure; rerun autoconf - set(requires_autoconfig TRUE) - file(REMOVE "${src_dir}/configure") # remove possible autodated configure scripts elseif(EXISTS "${src_dir}/configure" AND NOT arg_SKIP_CONFIGURE) # run normally; no autoconf or autogen required + elseif(EXISTS "${src_dir}/configure.ac") # Run autoconfig + set(requires_autoconfig ON) elseif(EXISTS "${src_dir}/autogen.sh") # Run autogen - set(requires_autogen TRUE) + set(requires_autogen ON) else() message(FATAL_ERROR "Could not determine method to configure make") endif() @@ -254,14 +254,14 @@ function(vcpkg_make_configure) if(CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") #only applies to windows (clang-)cl and lib if(requires_autoconfig) - set(arg_USE_WRAPPERS TRUE) + set(arg_USE_WRAPPERS ON) else() # Keep the setting from portfiles. # 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. endif() else() - set(arg_USE_WRAPPERS FALSE) + set(arg_USE_WRAPPERS OFF) endif() # Backup environment variables @@ -281,11 +281,11 @@ function(vcpkg_make_configure) #Used by cl z_vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) - set(vcm_paths_with_spaces FALSE) + set(vcm_paths_with_spaces OFF) 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") - set(vcm_paths_with_spaces TRUE) + set(vcm_paths_with_spaces ON) endif() # Pre-processing windows configure requirements @@ -569,9 +569,9 @@ function(vcpkg_make_configure) list(REMOVE_DUPLICATES all_libs_list) list(TRANSFORM all_libs_list STRIP) #Do lib list transformation from name.lib to -lname if necessary - set(x_vcpkg_transform_libs TRUE) + set(x_vcpkg_transform_libs ON) if(VCPKG_TARGET_IS_UWP) - set(x_vcpkg_transform_libs FALSE) + set(x_vcpkg_transform_libs OFF) # Avoid libtool choke: "Warning: linker path does not have real file for library -lWindowsApp." # The problem with the choke is that libtool always falls back to built a static library even if a dynamic was requested. # Note: Env LIBPATH;LIB are on the search path for libtool by default on windows. @@ -799,7 +799,7 @@ function(vcpkg_make_configure) set(path_backup $ENV{PATH}) vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${path_suffix_${_buildtype}}/bin") endif() - debug_message("Configure command:'${command}'") + message("Configure command:'${command}'") if (NOT arg_SKIP_CONFIGURE) message(STATUS "Configuring ${TARGET_TRIPLET}-${short_name_${_buildtype}}") vcpkg_execute_required_process( From e2c252fa401b30f6e1f52713893464f42ddb0eab Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 14 Sep 2021 23:24:31 -0700 Subject: [PATCH 20/27] Restore option AUTOCONFIG --- ports/gdal/portfile.cmake | 1 + ports/healpix/portfile.cmake | 1 + ports/hunspell/portfile.cmake | 1 + ports/vcpkg-make/vcpkg_make_configure.cmake | 4 +++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 77d7b59556ff03..f6b07d5f177e6c 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -324,6 +324,7 @@ else() vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG COPY_SOURCE OPTIONS ${CONF_OPTS} diff --git a/ports/healpix/portfile.cmake b/ports/healpix/portfile.cmake index d792578cfe4e0b..56ea9635577e53 100644 --- a/ports/healpix/portfile.cmake +++ b/ports/healpix/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_sourceforge( vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH src/cxx + AUTOCONFIG COPY_SOURCE OPTIONS --with-libcfitsio-include=${CURRENT_INSTALLED_DIR}/include/cfitsio diff --git a/ports/hunspell/portfile.cmake b/ports/hunspell/portfile.cmake index f338463b16c7d3..751e50b6c0d5af 100644 --- a/ports/hunspell/portfile.cmake +++ b/ports/hunspell/portfile.cmake @@ -63,6 +63,7 @@ else() vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin") vcpkg_make_configure( SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG ADDITIONAL_MSYS_PACKAGES gzip ) #install-pkgconfDATA: diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index 3820a9fa390ff9..3a39a0b11ab9d3 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -235,7 +235,9 @@ function(vcpkg_make_configure) set(requires_autogen OFF) # use autogen.sh set(requires_autoconfig OFF) # use autotools and configure.ac - if(EXISTS "${src_dir}/configure" AND "${src_dir}/configure.ac") # remove configure; rerun autoconf + if(arg_AUTOCONFIG) + set(requires_autoconfig ON) + elseif(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 ON) file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts From 8362762e75187b7ffe84b2861c3c677bf0d17000 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Thu, 16 Sep 2021 01:44:34 -0700 Subject: [PATCH 21/27] Restore option AUTOCONFIG --- ports/vcpkg-make/vcpkg_make_configure.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index 3a39a0b11ab9d3..c62e5453fb5391 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -219,7 +219,7 @@ endmacro() function(vcpkg_make_configure) # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 arg - "SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" + "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET" "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES" ) @@ -238,7 +238,7 @@ function(vcpkg_make_configure) if(arg_AUTOCONFIG) set(requires_autoconfig ON) elseif(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 + if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time set(requires_autoconfig ON) file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts endif() From 95c7c8d104b1ee24a6b3bbfcb7b358ab53a95a06 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 17 Sep 2021 00:21:06 -0700 Subject: [PATCH 22/27] Remove option SUBPATH --- ports/vcpkg-make/vcpkg_make_build.cmake | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_build.cmake b/ports/vcpkg-make/vcpkg_make_build.cmake index 1f92efa4ec1cc5..19be23e8ff49ba 100644 --- a/ports/vcpkg-make/vcpkg_make_build.cmake +++ b/ports/vcpkg-make/vcpkg_make_build.cmake @@ -9,7 +9,6 @@ vcpkg_make_build( [ADD_BIN_TO_PATH] [ENABLE_INSTALL] [MAKEFILE ] - [SUBPATH ] [DISABLE_PARALLEL] [LOGFILE_BASE ] ) @@ -24,8 +23,6 @@ Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. By default, `vcpkg_make_build` will call the `Makefile` in the build directory and build all the targets. -If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. -This path is based on the build path. If the makefile comes from another path or the name is not `Makefile`, please pass `MAKEFILE` and set the absolute path. Please pass `BUILD_TARGET` to select the needed targets. @@ -70,10 +67,10 @@ function(vcpkg_make_build) # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 arg "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" - "LOGFILE_BASE;BUILD_TARGET;SUBPATH;MAKEFILE;INSTALL_TARGET" + "LOGFILE_BASE;BUILD_TARGET;MAKEFILE;INSTALL_TARGET" "" ) - + if(DEFINED arg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_make_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") endif() @@ -134,7 +131,7 @@ function(vcpkg_make_build) # Since includes are buildtype independent those are setup by vcpkg_make_configure _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) - foreach(buildtype IN ITEMS debug release) + foreach(buildtype IN ITEMS "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL buildtype) if(buildtype STREQUAL "debug") # Skip debug generate @@ -155,7 +152,7 @@ function(vcpkg_make_build) set(path_suffix "") endif() - set(working_directory "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${short_buildtype}${arg_SUBPATH}") + set(working_directory "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${short_buildtype}") message(STATUS "Building ${TARGET_TRIPLET}${short_buildtype}") _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${cmake_buildtype}) From 27d1d42ee4984386594cabf577102b1a4598f16c Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 17 Sep 2021 00:39:29 -0700 Subject: [PATCH 23/27] update doc --- docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md index a4157f00b0ad35..25d9a5c0f1b589 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_build.md @@ -10,7 +10,6 @@ vcpkg_make_build( [ADD_BIN_TO_PATH] [ENABLE_INSTALL] [MAKEFILE ] - [SUBPATH ] [DISABLE_PARALLEL] [LOGFILE_BASE ] ) @@ -25,8 +24,6 @@ Otherwise, you can directly call `vcpkg_make_build` without `ENABLE_INSTALL`. By default, `vcpkg_make_build` will call the `Makefile` in the build directory and build all the targets. -If the `Makefile` in another path, please pass the absolute path to `SUBPATH`. -This path is based on the build path. If the makefile comes from another path or the name is not `Makefile`, please pass `MAKEFILE` and set the absolute path. Please pass `BUILD_TARGET` to select the needed targets. From 23d5c0c1fba16753fc39d1d9f82ee64eb2414b89 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Fri, 22 Oct 2021 00:13:44 -0700 Subject: [PATCH 24/27] Merge latest changes --- ports/vcpkg-make/vcpkg_make_build.cmake | 93 +++---- ports/vcpkg-make/vcpkg_make_configure.cmake | 273 +++++++++----------- 2 files changed, 162 insertions(+), 204 deletions(-) diff --git a/ports/vcpkg-make/vcpkg_make_build.cmake b/ports/vcpkg-make/vcpkg_make_build.cmake index 19be23e8ff49ba..e87a79b62d6dca 100644 --- a/ports/vcpkg-make/vcpkg_make_build.cmake +++ b/ports/vcpkg-make/vcpkg_make_build.cmake @@ -68,7 +68,7 @@ function(vcpkg_make_build) cmake_parse_arguments(PARSE_ARGV 0 arg "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" "LOGFILE_BASE;BUILD_TARGET;MAKEFILE;INSTALL_TARGET" - "" + "OPTIONS" ) if(DEFINED arg_UNPARSED_ARGUMENTS) @@ -92,29 +92,27 @@ function(vcpkg_make_build) endif() if(WIN32) - set(_vcpkg_prefix ${CURRENT_PACKAGES_DIR}) - set(_vcpkg_installed ${CURRENT_INSTALLED_DIR}) + set(Z_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR}) else() - string(REPLACE " " "\ " _vcpkg_prefix "${CURRENT_PACKAGES_DIR}") - string(REPLACE " " "\ " _vcpkg_installed "${CURRENT_INSTALLED_DIR}") + string(REPLACE " " "\ " Z_VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}") endif() - set(make_opts ) - set(install_opts ) + vcpkg_list(SET make_opts) + vcpkg_list(SET install_opts) if (CMAKE_HOST_WIN32) - set(path_global "$ENV{PATH}") + set(path_backup "$ENV{PATH}") vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper") if(NOT DEFINED Z_VCPKG_MAKE) vcpkg_acquire_msys(MSYS_ROOT) find_program(Z_VCPKG_MAKE make PATHS "${MSYS_ROOT}/usr/bin" NO_DEFAULT_PATH REQUIRED) endif() set(make_command "${Z_VCPKG_MAKE}") - set(make_opts ${arg_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) - set(no_parallel_make_opts ${arg_MAKE_OPTIONS} -j 1 --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + vcpkg_list(SET make_opts ${arg_OPTIONS} ${arg_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + vcpkg_list(SET no_parallel_make_opts ${arg_OPTIONS} ${arg_MAKE_OPTIONS} -j 1 --trace -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) - string(REPLACE " " "\\\ " _vcpkg_package_prefix ${CURRENT_PACKAGES_DIR}) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _vcpkg_package_prefix "${_vcpkg_package_prefix}") - set(install_opts -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${_vcpkg_package_prefix}) + string(REPLACE " " [[\ ]] vcpkg_package_prefix "${CURRENT_PACKAGES_DIR}") + string(REGEX REPLACE [[([a-zA-Z]):/]] [[/\1/]] vcpkg_package_prefix "${vcpkg_package_prefix}") + vcpkg_list(SET install_opts -j ${VCPKG_CONCURRENCY} --trace -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${vcpkg_package_prefix}) #TODO: optimize for install-data (release) and install-exec (release/debug) else() if(VCPKG_HOST_IS_OPENBSD) @@ -123,31 +121,23 @@ function(vcpkg_make_build) find_program(Z_VCPKG_MAKE make REQUIRED) endif() set(make_command "${Z_VCPKG_MAKE}") - set(make_opts ${arg_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) - set(no_parallel_make_opts ${arg_MAKE_OPTIONS} V=1 -j 1 -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) - set(install_opts -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${CURRENT_PACKAGES_DIR}) + vcpkg_list(SET make_opts ${arg_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + vcpkg_list(SET no_parallel_make_opts ${arg_MAKE_OPTIONS} V=1 -j 1 -f ${arg_MAKEFILE} ${arg_BUILD_TARGET}) + vcpkg_list(SET install_opts -j ${VCPKG_CONCURRENCY} -f ${arg_MAKEFILE} ${arg_INSTALL_TARGET} DESTDIR=${CURRENT_PACKAGES_DIR}) endif() # Since includes are buildtype independent those are setup by vcpkg_make_configure - _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_backup_env_variables(VARS LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) foreach(buildtype IN ITEMS "debug" "release") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL buildtype) - if(buildtype STREQUAL "debug") - # Skip debug generate - if (_VCPKG_NO_DEBUG) - continue() - endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "${buildtype}") + if("${buildtype}" STREQUAL "debug") 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) - set(short_buildtype "") - else() - set(short_buildtype "-rel") - endif() + set(short_buildtype "-rel") set(cmake_buildtype "RELEASE") set(path_suffix "") endif() @@ -155,18 +145,18 @@ function(vcpkg_make_build) set(working_directory "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${short_buildtype}") message(STATUS "Building ${TARGET_TRIPLET}${short_buildtype}") - _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${cmake_buildtype}) + z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags("${cmake_buildtype}") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(LINKER_FLAGS_${cmake_buildtype} "${VCPKG_DETECTED_STATIC_LINKER_FLAGS_${cmake_buildtype}}") else() # dynamic set(LINKER_FLAGS_${cmake_buildtype} "${VCPKG_DETECTED_SHARED_LINKER_FLAGS_${cmake_buildtype}}") endif() - if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_C_COMPILER MATCHES "cl.exe") - set(LDFLAGS_${cmake_buildtype} "-L${_vcpkg_installed}${path_suffix}/lib -L${_vcpkg_installed}${path_suffix}/lib/manual-link") + if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") + set(LDFLAGS_${cmake_buildtype} "-L${Z_VCPKG_INSTALLED}${path_suffix}/lib -L${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link") set(LINK_ENV_${cmake_buildtype} "$ENV{_LINK_} ${LINKER_FLAGS_${cmake_buildtype}}") else() - set(LDFLAGS_${cmake_buildtype} "-L${_vcpkg_installed}${path_suffix}/lib -L${_vcpkg_installed}${path_suffix}/lib/manual-link ${LINKER_FLAGS_${cmake_buildtype}}") + set(LDFLAGS_${cmake_buildtype} "-L${Z_VCPKG_INSTALLED}${path_suffix}/lib -L${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link ${LINKER_FLAGS_${cmake_buildtype}}") endif() # Setup environment @@ -175,10 +165,10 @@ function(vcpkg_make_build) set(ENV{CXXFLAGS} "${CXXFLAGS_${cmake_buildtype}}") set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${cmake_buildtype}}") set(ENV{LDFLAGS} "${LDFLAGS_${cmake_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}") + vcpkg_host_path_list(PREPEND ENV{LIB} "${Z_VCPKG_INSTALLED}${path_suffix}/lib/" "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link/") + vcpkg_host_path_list(PREPEND ENV{LIBPATH} "${Z_VCPKG_INSTALLED}${path_suffix}/lib/" "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link/") + vcpkg_host_path_list(PREPEND ENV{LIBRARY_PATH} "${Z_VCPKG_INSTALLED}${path_suffix_${buildtype}}/lib/" "${Z_VCPKG_INSTALLED}${path_suffix}/lib/manual-link/") + #vcpkg_host_path_list(PREPEND ENV{LD_LIBRARY_PATH} "${Z_VCPKG_INSTALLED}${path_suffix}/lib/" "${Z_VCPKG_INSTALLED}${path_suffix_${buildtype}}/lib/manual-link/") if(LINK_ENV_${_VAR_SUFFIX}) set(config_link_backup "$ENV{_LINK_}") @@ -190,24 +180,19 @@ function(vcpkg_make_build) vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${path_suffix}/bin") endif() - if(MAKE_BASH) - set(make_cmd_line "${make_command} ${make_opts}") - set(no_parallel_make_cmd_line "${make_command} ${no_parallel_make_opts}") - else() - set(make_cmd_line ${make_command} ${make_opts}) - set(no_parallel_make_cmd_line ${make_command} ${no_parallel_make_opts}) - endif() + vcpkg_list(SET make_cmd_line ${make_command} ${make_opts}) + vcpkg_list(SET no_parallel_make_cmd_line ${make_command} ${no_parallel_make_opts}) if (arg_DISABLE_PARALLEL) vcpkg_execute_build_process( - COMMAND "${MAKE_BASH}" ${no_parallel_make_cmd_line} + COMMAND ${no_parallel_make_cmd_line} WORKING_DIRECTORY "${working_directory}" LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}${short_buildtype}" ) else() vcpkg_execute_build_process( - COMMAND "${MAKE_BASH}" ${make_cmd_line} - NO_PARALLEL_COMMAND "${MAKE_BASH}" ${no_parallel_make_cmd_line} + COMMAND ${make_cmd_line} + NO_PARALLEL_COMMAND ${no_parallel_make_cmd_line} WORKING_DIRECTORY "${working_directory}" LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}${short_buildtype}" ) @@ -220,13 +205,9 @@ function(vcpkg_make_build) if (arg_ENABLE_INSTALL) message(STATUS "Installing ${TARGET_TRIPLET}${short_buildtype}") - if(MAKE_BASH) - set(make_cmd_line "${make_command} ${install_opts}") - else() - set(make_cmd_line ${make_command} ${install_opts}) - endif() + vcpkg_list(SET make_cmd_line ${make_command} ${install_opts}) vcpkg_execute_build_process( - COMMAND "${MAKE_BASH}" ${make_cmd_line} + COMMAND ${make_cmd_line} WORKING_DIRECTORY "${working_directory}" LOGNAME "install-${TARGET_TRIPLET}${short_buildtype}" ) @@ -244,10 +225,10 @@ function(vcpkg_make_build) endforeach() if (arg_ENABLE_INSTALL) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" Z_VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}_tmp") - file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${_VCPKG_INSTALL_PREFIX}" "${CURRENT_PACKAGES_DIR}") + file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${Z_VCPKG_INSTALL_PREFIX}" "${CURRENT_PACKAGES_DIR}") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp") endif() @@ -258,8 +239,8 @@ function(vcpkg_make_build) endif() if (CMAKE_HOST_WIN32) - set(ENV{PATH} "${path_global}") + set(ENV{PATH} "${path_backup}") endif() - _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_restore_env_variables(VARS LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) endfunction() diff --git a/ports/vcpkg-make/vcpkg_make_configure.cmake b/ports/vcpkg-make/vcpkg_make_configure.cmake index c62e5453fb5391..6db4f543d9add0 100644 --- a/ports/vcpkg-make/vcpkg_make_configure.cmake +++ b/ports/vcpkg-make/vcpkg_make_configure.cmake @@ -6,6 +6,7 @@ Configure a Makefile buildsystem. ```cmake vcpkg_make_configure( SOURCE_PATH <${source_path}> + [AUTOCONFIG] [USE_WRAPPERS] [DETERMINE_BUILD_TRIPLET] [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"] @@ -151,36 +152,6 @@ macro(z_vcpkg_determine_autotools_target_arch_mac out_var) unset(osx_archs_num) endmacro() -macro(z_vcpkg_backup_env_variable 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(z_vcpkg_backup_env_variables) - foreach(_var IN ITEMS ${ARGV}) - z_vcpkg_backup_env_variable(${_var}) - endforeach() -endmacro() - -macro(z_vcpkg_restore_env_variable envvar) - if(${envvar}_backup) - set(ENV{${envvar}} "${${envvar}_backup}") - else() - unset(ENV{${envvar}}) - endif() -endmacro() - -macro(z_vcpkg_restore_env_variables) - foreach(_var IN ITEMS ${ARGV}) - z_vcpkg_restore_env_variable(${_var}) - endforeach() -endmacro() - macro(z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags flag_suffix) string(REGEX MATCHALL "( |^)-D[^ ]+" CPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}") string(REGEX MATCHALL "( |^)-D[^ ]+" CXXPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}") @@ -216,6 +187,32 @@ macro(z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags flag_suffix) debug_message("CXXFLAGS_${flag_suffix}: ${CXXFLAGS_${flag_suffix}}") endmacro() +macro(z_vcpkg_append_to_configure_environment inoutstring var defaultval) + # Allows to overwrite settings in custom triplets via the environment on windows + if(CMAKE_HOST_WIN32 AND DEFINED ENV{${var}}) + string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") + else() + string(APPEND ${inoutstring} " ${var}='${defaultval}'") + endif() +endmacro() + +# Setup include environment (since these are buildtype independent restoring them is unnecessary) +macro(z_prepend_include_path var) + unset(ENV{${var}}) + if(NOT DEFINED z_vcpkg_env_backup_${var} OR "${z_vcpkg_env_backup_${var}}" STREQUAL "") + vcpkg_host_path_list(APPEND ENV{${var}} "${CURRENT_INSTALLED_DIR}/include") + else() + foreach (one_bk IN ITEMS ${z_vcpkg_env_backup_${var}}) + vcpkg_host_path_list(PREPEND ENV{${var}} "${one_bk}") + endforeach() + vcpkg_host_path_list(PREPEND ENV{${var}} "${CURRENT_INSTALLED_DIR}/include") + endif() +endmacro() + +macro(z_convert_to_list input output) + string(REGEX MATCHALL "(( +|^ *)[^ ]+)" ${output} "${${input}}") +endmacro() + function(vcpkg_make_configure) # parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 arg @@ -270,7 +267,7 @@ function(vcpkg_make_configure) # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y set(cm_FLAGS AS CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y RC) list(TRANSFORM cm_FLAGS APPEND "FLAGS") - z_vcpkg_backup_env_variables(${cm_FLAGS}) + vcpkg_backup_env_variables(VARS ${cm_FLAGS}) # FC fotran compiler | FF Fortran 77 compiler @@ -278,10 +275,10 @@ function(vcpkg_make_configure) # LIBS -> pass -l flags #Used by gcc/linux - z_vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_backup_env_variables(VARS C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH) #Used by cl - z_vcpkg_backup_env_variables(INCLUDE LIB LIBPATH) + vcpkg_backup_env_variables(VARS INCLUDE LIB LIBPATH) set(vcm_paths_with_spaces OFF) if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ") @@ -290,6 +287,7 @@ function(vcpkg_make_configure) set(vcm_paths_with_spaces ON) endif() + set(configure_env "V=1") # Pre-processing windows configure requirements if (VCPKG_TARGET_IS_WINDOWS) if(CMAKE_HOST_WIN32) @@ -330,16 +328,6 @@ function(vcpkg_make_configure) set(bash_executable "${MSYS_ROOT}/usr/bin/bash.exe") endif() - macro(z_vcpkg_append_to_configure_environment inoutstring var defaultval) - # Allows to overwrite settings in custom triplets via the environment on windows - if(CMAKE_HOST_WIN32 AND DEFINED ENV{${var}}) - string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'") - else() - string(APPEND ${inoutstring} " ${var}='${defaultval}'") - endif() - endmacro() - - set(configure_env "V=1") # Remove full filepaths due to spaces and prepend filepaths to PATH (cross-compiling tools are unlikely on path by default) set(progs VCPKG_DETECTED_CMAKE_C_COMPILER VCPKG_DETECTED_CMAKE_CXX_COMPILER VCPKG_DETECTED_CMAKE_AR VCPKG_DETECTED_CMAKE_LINKER VCPKG_DETECTED_CMAKE_RANLIB VCPKG_DETECTED_CMAKE_OBJDUMP @@ -436,17 +424,16 @@ function(vcpkg_make_configure) endif() endif() + # Some PATH handling for dealing with spaces....some tools will still fail with that! + # In particular, the libtool install command is unable to install correctly to paths with spaces. + # CURRENT_INSTALLED_DIR: Pristine native path (unprotected spaces, Windows drive letters) + # z_vcpkg_installed_path: Native path with escaped space characters + # z_vcpkg_prefix_path: Path with unprotected spaces, but drive letters transformed for mingw/msys + string(REPLACE " " "\\ " z_vcpkg_installed_path "${CURRENT_INSTALLED_DIR}") if(CMAKE_HOST_WIN32) - #Some PATH handling for dealing with spaces....some tools will still fail with that! - string(REPLACE " " "\\\ " z_vcpkg_prefix_path ${CURRENT_INSTALLED_DIR}) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" z_vcpkg_prefix_path "${z_vcpkg_prefix_path}") - set(z_vcpkg_installed_path ${CURRENT_INSTALLED_DIR}) - set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile! + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" z_vcpkg_prefix_path "${CURRENT_INSTALLED_DIR}") else() - string(REPLACE " " "\ " z_vcpkg_prefix_path ${CURRENT_INSTALLED_DIR}) - string(REPLACE " " "\ " z_vcpkg_installed_path ${CURRENT_INSTALLED_DIR}) - set(extra_quotes) - set(prefix_var "\${prefix}") + set(z_vcpkg_prefix_path "${CURRENT_INSTALLED_DIR}") endif() # macOS - cross-compiling support @@ -472,25 +459,26 @@ function(vcpkg_make_configure) "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") # Set configure paths - set(arg_OPTIONS_RELEASE ${arg_OPTIONS_RELEASE} "--prefix=${extra_quotes}${z_vcpkg_prefix_path}${extra_quotes}") - set(arg_OPTIONS_DEBUG ${arg_OPTIONS_DEBUG} "--prefix=${extra_quotes}${z_vcpkg_prefix_path}/debug${extra_quotes}") + set(arg_OPTIONS_RELEASE ${arg_OPTIONS_RELEASE} "--prefix=${z_vcpkg_prefix_path}") + set(arg_OPTIONS_DEBUG ${arg_OPTIONS_DEBUG} "--prefix=${z_vcpkg_prefix_path}/debug") if(NOT arg_NO_ADDITIONAL_PATHS) + # ${prefix} has an extra backslash to prevent early expansion when calling `bash -c configure "..."`. set(arg_OPTIONS_RELEASE ${arg_OPTIONS_RELEASE} # Important: These should all be relative to prefix! - "--bindir=${prefix_var}/tools/${PORT}/bin" - "--sbindir=${prefix_var}/tools/${PORT}/sbin" - #"--libdir='\${prefix}'/lib" # already the default! + "--bindir=\\\${prefix}/tools/${PORT}/bin" + "--sbindir=\\\${prefix}/tools/${PORT}/sbin" + "--libdir=\\\${prefix}/lib" # On some Linux distributions lib64 is the default #"--includedir='\${prefix}'/include" # already the default! - "--mandir=${prefix_var}/share/${PORT}" - "--docdir=${prefix_var}/share/${PORT}" - "--datarootdir=${prefix_var}/share/${PORT}") + "--mandir=\\\${prefix}/share/${PORT}" + "--docdir=\\\${prefix}/share/${PORT}" + "--datarootdir=\\\${prefix}/share/${PORT}") set(arg_OPTIONS_DEBUG ${arg_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}") + "--bindir=\\\${prefix}/../tools/${PORT}/debug/bin" + "--sbindir=\\\${prefix}/../tools/${PORT}/debug/sbin" + "--libdir=\\\${prefix}/lib" # On some Linux distributions lib64 is the default + "--includedir=\\\${prefix}/../include" + "--datarootdir=\\\${prefix}/share/${PORT}") endif() # Setup common options if(NOT arg_DISABLE_VERBOSE_FLAGS) @@ -504,14 +492,14 @@ function(vcpkg_make_configure) endif() # Can be set in the triplet to append options for configure - if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS) - list(APPEND arg_OPTIONS ${VCPKG_MAKE_CONFIGURE_OPTIONS}) + if(DEFINED VCPKG_CONFIGURE_MAKE_OPTIONS) + list(APPEND arg_OPTIONS ${VCPKG_CONFIGURE_MAKE_OPTIONS}) endif() - if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS_RELEASE) - list(APPEND arg_OPTIONS_RELEASE ${VCPKG_MAKE_CONFIGURE_OPTIONS_RELEASE}) + if(DEFINED VCPKG_CONFIGURE_MAKE_OPTIONS_RELEASE) + list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CONFIGURE_MAKE_OPTIONS_RELEASE}) endif() - if(DEFINED VCPKG_MAKE_CONFIGURE_OPTIONS_DEBUG) - list(APPEND arg_OPTIONS_DEBUG ${VCPKG_MAKE_CONFIGURE_OPTIONS_DEBUG}) + if(DEFINED VCPKG_CONFIGURE_MAKE_OPTIONS_DEBUG) + list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CONFIGURE_MAKE_OPTIONS_DEBUG}) endif() file(RELATIVE_PATH relative_build_path "${CURRENT_BUILDTREES_DIR}" "${arg_SOURCE_PATH}/${arg_PROJECT_SUBPATH}") @@ -522,29 +510,16 @@ function(vcpkg_make_configure) else() find_program(base_cmd bash REQUIRED) endif() - if(VCPKG_TARGET_IS_WINDOWS) - list(JOIN arg_OPTIONS " " arg_OPTIONS) - list(JOIN arg_OPTIONS_RELEASE " " arg_OPTIONS_RELEASE) - list(JOIN arg_OPTIONS_DEBUG " " arg_OPTIONS_DEBUG) - endif() - - # Setup include environment (since these are buildtype independent restoring them is unnecessary) - macro(prepend_include_path var) - if("${${var}_backup}" STREQUAL "") - set(ENV{${var}} "${z_vcpkg_installed_path}/include") - else() - set(ENV{${var}} "${z_vcpkg_installed_path}/include${VCPKG_HOST_PATH_SEPARATOR}${${var}_backup}") - endif() - endmacro() + # Used by CL - prepend_include_path(INCLUDE) + z_prepend_include_path(INCLUDE) # Used by GCC - prepend_include_path(C_INCLUDE_PATH) - prepend_include_path(CPLUS_INCLUDE_PATH) + z_prepend_include_path(C_INCLUDE_PATH) + z_prepend_include_path(CPLUS_INCLUDE_PATH) # 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(VCPKG_TARGET_IS_WINDOWS) - z_vcpkg_backup_env_variables(_CL_ _LINK_) + vcpkg_backup_env_variables(VARS _CL_ _LINK_) # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined if(VCPKG_TARGET_IS_UWP) # Be aware that configure thinks it is crosscompiling due to: @@ -562,11 +537,8 @@ function(vcpkg_make_configure) endif() endif() - macro(convert_to_list input output) - string(REGEX MATCHALL "(( +|^ *)[^ ]+)" ${output} "${${input}}") - endmacro() - convert_to_list(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES c_libs_list) - convert_to_list(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES cxx_libs_list) + z_convert_to_list(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES c_libs_list) + z_convert_to_list(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES cxx_libs_list) set(all_libs_list ${c_libs_list} ${cxx_libs_list}) list(REMOVE_DUPLICATES all_libs_list) list(TRANSFORM all_libs_list STRIP) @@ -618,7 +590,7 @@ function(vcpkg_make_configure) message(STATUS "Generating configure for ${TARGET_TRIPLET}") if (CMAKE_HOST_WIN32) vcpkg_execute_required_process( - COMMAND "${base_cmd}" -c "autoreconf -vfi" + COMMAND ${base_cmd} -c "autoreconf -vfi" WORKING_DIRECTORY "${src_dir}" LOGNAME "autoconf-${TARGET_TRIPLET}" ) @@ -635,7 +607,7 @@ function(vcpkg_make_configure) message(STATUS "Generating configure for ${TARGET_TRIPLET} via autogen.sh") if (CMAKE_HOST_WIN32) vcpkg_execute_required_process( - COMMAND "${base_cmd}" -c "./autogen.sh" + COMMAND ${base_cmd} -c "./autogen.sh" WORKING_DIRECTORY "${src_dir}" LOGNAME "autoconf-${TARGET_TRIPLET}" ) @@ -651,18 +623,26 @@ function(vcpkg_make_configure) if (arg_PRERUN_SHELL) message(STATUS "Prerun shell with ${TARGET_TRIPLET}") - vcpkg_execute_required_process( - COMMAND "${base_cmd}" -c "${arg_PRERUN_SHELL}" - WORKING_DIRECTORY "${src_dir}" - LOGNAME "prerun-${TARGET_TRIPLET}" - ) + if (CMAKE_HOST_WIN32) + vcpkg_execute_required_process( + COMMAND ${base_cmd} -c "${arg_PRERUN_SHELL}" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "prerun-${TARGET_TRIPLET}" + ) + else() + vcpkg_execute_required_process( + COMMAND "${base_cmd}" -c "${arg_PRERUN_SHELL}" + WORKING_DIRECTORY "${src_dir}" + LOGNAME "prerun-${TARGET_TRIPLET}" + ) + endif() endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT arg_NO_DEBUG) set(var_suffix DEBUG) set(path_suffix_${var_suffix} "/debug") set(short_name_${var_suffix} "dbg") - list(APPEND _buildtypes ${var_suffix}) + list(APPEND all_buildtypes ${var_suffix}) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}") else() # dynamic @@ -680,10 +660,10 @@ function(vcpkg_make_configure) endif() else() set(link_required_dirs) - if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib") set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") endif() - if(EXISTS "{z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + if(EXISTS "{CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link") set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") endif() string(STRIP "${link_required_dirs}" link_required_dirs) @@ -695,7 +675,7 @@ function(vcpkg_make_configure) set(var_suffix RELEASE) set(path_suffix_${var_suffix} "") set(short_name_${var_suffix} "rel") - list(APPEND _buildtypes ${var_suffix}) + list(APPEND all_buildtypes ${var_suffix}) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(LINKER_FLAGS_${var_suffix} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${var_suffix}}") else() # dynamic @@ -713,10 +693,10 @@ function(vcpkg_make_configure) endif() else() set(link_required_dirs) - if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib") set(link_required_dirs "-L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib") endif() - if(EXISTS "{z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${var_suffix}}/lib/manual-link") set(link_required_dirs "${link_required_dirs} -L${z_vcpkg_installed_path}${path_suffix_${var_suffix}}/lib/manual-link") endif() string(STRIP "${link_required_dirs}" link_required_dirs) @@ -725,15 +705,24 @@ function(vcpkg_make_configure) unset(var_suffix) endif() - foreach(_buildtype IN LISTS _buildtypes) + foreach(var IN ITEMS arg_OPTIONS arg_OPTIONS_RELEASE arg_OPTIONS_DEBUG) + vcpkg_list(SET tmp) + foreach(element IN LISTS "${var}") + string(REPLACE [["]] [[\"]] element "${element}") + vcpkg_list(APPEND tmp "\"${element}\"") + endforeach() + vcpkg_list(JOIN tmp " " "${var}") + endforeach() + + foreach(current_buildtype IN LISTS all_buildtypes) foreach(ENV_VAR ${arg_CONFIG_DEPENDENT_ENVIRONMENT}) if(DEFINED ENV{${ENV_VAR}}) set(backup_config_${ENV_VAR} "$ENV{${ENV_VAR}}") endif() - set(ENV{${ENV_VAR}} "${${ENV_VAR}_${_buildtype}}") + set(ENV{${ENV_VAR}} "${${ENV_VAR}_${current_buildtype}}") endforeach() - set(target_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_name_${_buildtype}}") + set(target_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_name_${current_buildtype}}") file(MAKE_DIRECTORY "${target_dir}") file(RELATIVE_PATH relative_build_path "${target_dir}" "${src_dir}") @@ -743,21 +732,21 @@ function(vcpkg_make_configure) endif() # Setup PKG_CONFIG_PATH - set(pkgconfig_installed_dir "${CURRENT_INSTALLED_DIR}${path_suffix_${_buildtype}}/lib/pkgconfig") + set(pkgconfig_installed_dir "${CURRENT_INSTALLED_DIR}${path_suffix_${current_buildtype}}/lib/pkgconfig") set(pkgconfig_installed_share_dir "${CURRENT_INSTALLED_DIR}/share/pkgconfig") if(ENV{PKG_CONFIG_PATH}) - set(backup_env_pkg_config_path_${_buildtype} $ENV{PKG_CONFIG_PATH}) + set(backup_env_pkg_config_path_${current_buildtype} $ENV{PKG_CONFIG_PATH}) set(ENV{PKG_CONFIG_PATH} "${pkgconfig_installed_dir}${VCPKG_HOST_PATH_SEPARATOR}${pkgconfig_installed_share_dir}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") else() set(ENV{PKG_CONFIG_PATH} "${pkgconfig_installed_dir}${VCPKG_HOST_PATH_SEPARATOR}${pkgconfig_installed_share_dir}") endif() # Setup environment - set(ENV{CPPFLAGS} "${CPPFLAGS_${_buildtype}}") - set(ENV{CFLAGS} "${CFLAGS_${_buildtype}}") - set(ENV{CXXFLAGS} "${CXXFLAGS_${_buildtype}}") - set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${_buildtype}}") - set(ENV{LDFLAGS} "${LDFLAGS_${_buildtype}}") + set(ENV{CPPFLAGS} "${CPPFLAGS_${current_buildtype}}") + set(ENV{CFLAGS} "${CFLAGS_${current_buildtype}}") + set(ENV{CXXFLAGS} "${CXXFLAGS_${current_buildtype}}") + set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${current_buildtype}}") + set(ENV{LDFLAGS} "${LDFLAGS_${current_buildtype}}") # https://www.gnu.org/software/libtool/manual/html_node/Link-mode.html # -avoid-version is handled specially by libtool link mode, this flag is not forwarded to linker, @@ -766,48 +755,36 @@ function(vcpkg_make_configure) set(ENV{LDFLAGS} "-avoid-version $ENV{LDFLAGS}") endif() - if(LINK_ENV_${var_suffix}) + if(LINK_ENV_${current_buildtype}) set(link_config_backup "$ENV{_LINK_}") - set(ENV{_LINK_} "${LINK_ENV_${var_suffix}}") + set(ENV{_LINK_} "${LINK_ENV_${current_buildtype}}") endif() set(ENV{PKG_CONFIG} "${PKGCONFIG}") - set(_lib_env_vars LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) - foreach(_lib_env_var IN LISTS _lib_env_vars) - set(_link_path) - if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib") - set(_link_path "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib") + vcpkg_list(APPEND lib_env_vars LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + foreach(lib_env_var IN LISTS lib_env_vars) + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${current_buildtype}}/lib") + vcpkg_host_path_list(PREPEND ENV{${lib_env_var}} "${CURRENT_INSTALLED_DIR}${path_suffix_${current_buildtype}}/lib") endif() - if(EXISTS "${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib/manual-link") - if(_link_path) - set(_link_path "${_link_path}${VCPKG_HOST_PATH_SEPARATOR}") - endif() - set(_link_path "${_link_path}${z_vcpkg_installed_path}${path_suffix_${_buildtype}}/lib/manual-link") + if(EXISTS "${CURRENT_INSTALLED_DIR}${path_suffix_${current_buildtype}}/lib/manual-link") + vcpkg_host_path_list(PREPEND ENV{${lib_env_var}} "${CURRENT_INSTALLED_DIR}" "${path_suffix_${current_buildtype}}/lib/manual-link") endif() - set(ENV{${_lib_env_var}} "${_link_path}${${_lib_env_var}_pathlike_concat}") endforeach() - unset(_link_path) - unset(_lib_env_vars) + unset(lib_env_vars) - if(CMAKE_HOST_WIN32) - set(command "${base_cmd}" -c "${configure_env} ./${relative_build_path}/configure ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}") - elseif(VCPKG_TARGET_IS_WINDOWS) - set(command "${base_cmd}" -c "${configure_env} $@" -- "./${relative_build_path}/configure" ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}) - else() - set(command "${base_cmd}" "./${relative_build_path}/configure" ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${_buildtype}}) - endif() + set(command "${base_cmd}" -c "${configure_env} ./${relative_build_path}/configure ${arg_BUILD_TRIPLET} ${arg_OPTIONS} ${arg_OPTIONS_${current_buildtype}}") if(arg_ADD_BIN_TO_PATH) set(path_backup $ENV{PATH}) - vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${path_suffix_${_buildtype}}/bin") + vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${path_suffix_${current_buildtype}}/bin") endif() - message("Configure command:'${command}'") + debug_message("Configure command:'${command}'") if (NOT arg_SKIP_CONFIGURE) - message(STATUS "Configuring ${TARGET_TRIPLET}-${short_name_${_buildtype}}") + message(STATUS "Configuring ${TARGET_TRIPLET}-${short_name_${current_buildtype}}") vcpkg_execute_required_process( COMMAND ${command} WORKING_DIRECTORY "${target_dir}" - LOGNAME "config-${TARGET_TRIPLET}-${short_name_${_buildtype}}" + LOGNAME "config-${TARGET_TRIPLET}-${short_name_${current_buildtype}}" ) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(GLOB_RECURSE libtool_files "${target_dir}*/libtool") @@ -819,16 +796,16 @@ function(vcpkg_make_configure) endif() if(EXISTS "${target_dir}/config.log") - file(RENAME "${target_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${short_name_${_buildtype}}.log") + file(RENAME "${target_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${short_name_${current_buildtype}}.log") endif() endif() - if(backup_env_pkg_config_path_${_buildtype}) - set(ENV{PKG_CONFIG_PATH} "${backup_env_pkg_config_path_${_buildtype}}") + if(backup_env_pkg_config_path_${current_buildtype}) + set(ENV{PKG_CONFIG_PATH} "${backup_env_pkg_config_path_${current_buildtype}}") else() unset(ENV{PKG_CONFIG_PATH}) endif() - unset(backup_env_pkg_config_path_${_buildtype}) + unset(backup_env_pkg_config_path_${current_buildtype}) if(link_config_backup) set(ENV{_LINK_} "${link_config_backup}") @@ -858,7 +835,7 @@ function(vcpkg_make_configure) endif() # Restore environment - z_vcpkg_restore_env_variables(${cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) + vcpkg_restore_env_variables(VARS ${cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH) set(_VCPKG_PROJECT_SOURCE_PATH ${arg_SOURCE_PATH} PARENT_SCOPE) set(_VCPKG_PROJECT_SUBPATH ${arg_PROJECT_SUBPATH} PARENT_SCOPE) From 58aa6c4308406629fc5355866a997c63163832c2 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 24 Oct 2021 19:10:58 -0700 Subject: [PATCH 25/27] Revert some code, add port version --- ports/fontconfig/vcpkg.json | 6 +----- ports/icu/vcpkg.json | 2 +- ports/starlink-ast/vcpkg.json | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/fontconfig/vcpkg.json b/ports/fontconfig/vcpkg.json index 2912bd026fac1b..c0e13fdb83c94a 100644 --- a/ports/fontconfig/vcpkg.json +++ b/ports/fontconfig/vcpkg.json @@ -14,10 +14,6 @@ "name": "libuuid", "platform": "!windows & !osx & !mingw" }, - "pthread", - { - "name": "vcpkg-make", - "host": true - } + "pthread" ] } diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index ea8c224535e99d..babc7144c5df3e 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,7 +1,7 @@ { "name": "icu", "version": "69.1", - "port-version": 15, + "port-version": 16, "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "supports": "!uwp", diff --git a/ports/starlink-ast/vcpkg.json b/ports/starlink-ast/vcpkg.json index 58b4027730613f..c27361df757ecc 100644 --- a/ports/starlink-ast/vcpkg.json +++ b/ports/starlink-ast/vcpkg.json @@ -1,7 +1,7 @@ { "name": "starlink-ast", "version-semver": "9.2.4", - "port-version": 2, + "port-version": 3, "description": "The AST library provides a comprehensive range of facilities for attaching world coordinate systems to astronomical data, for retrieving and interpreting that information and for generating graphical output based on it", "homepage": "https://starlink.eao.hawaii.edu/starlink/AST", "supports": "windows", From 038ffb4e7f2149dc55fea6ad6a9f8029dc1f8ea5 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 24 Oct 2021 19:11:24 -0700 Subject: [PATCH 26/27] version --- versions/a-/apr-util.json | 5 +++++ versions/a-/apr.json | 5 +++++ versions/baseline.json | 22 +++++++++++----------- versions/g-/gdal.json | 5 +++++ versions/g-/gettext.json | 5 +++++ versions/h-/healpix.json | 5 +++++ versions/h-/hunspell.json | 5 +++++ versions/i-/icu.json | 5 +++++ versions/l-/libiconv.json | 5 +++++ versions/l-/liburing.json | 5 +++++ versions/n-/ncurses.json | 5 +++++ versions/s-/starlink-ast.json | 5 +++++ versions/v-/vcpkg-make.json | 2 +- versions/x-/x264.json | 2 +- 14 files changed, 68 insertions(+), 13 deletions(-) diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index a2629d38521bba..48d655e25b62ce 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6e039df30db545141c59425a585296777b110c7d", + "version-string": "1.6.1", + "port-version": 5 + }, { "git-tree": "cf1a0e97d00a5748dc58db7d0a5da0fd7d5efb66", "version-string": "1.6.1", diff --git a/versions/a-/apr.json b/versions/a-/apr.json index d652415aa93e90..c73d5fc3d2ed50 100644 --- a/versions/a-/apr.json +++ b/versions/a-/apr.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f3cb36f13b9cab10318f247494b23e5d2009f2ed", + "version": "1.7.0", + "port-version": 5 + }, { "git-tree": "b9e93acdaa680398eaed361f1df530096ded84ff", "version": "1.7.0", diff --git a/versions/baseline.json b/versions/baseline.json index eb544b02ad5180..8b12398ffc9df6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -106,11 +106,11 @@ }, "apr": { "baseline": "1.7.0", - "port-version": 4 + "port-version": 5 }, "apr-util": { "baseline": "1.6.1", - "port-version": 4 + "port-version": 5 }, "apsi": { "baseline": "0.3.1", @@ -2338,7 +2338,7 @@ }, "gdal": { "baseline": "3.3.2", - "port-version": 1 + "port-version": 2 }, "gdcm": { "baseline": "3.0.7", @@ -2390,7 +2390,7 @@ }, "gettext": { "baseline": "0.21", - "port-version": 6 + "port-version": 7 }, "gettimeofday": { "baseline": "2017-10-14", @@ -2638,7 +2638,7 @@ }, "healpix": { "baseline": "1.12.10", - "port-version": 8 + "port-version": 9 }, "hedley": { "baseline": "15", @@ -2682,7 +2682,7 @@ }, "hunspell": { "baseline": "1.7.0", - "port-version": 5 + "port-version": 6 }, "hwloc": { "baseline": "2.2.0", @@ -2702,7 +2702,7 @@ }, "icu": { "baseline": "69.1", - "port-version": 15 + "port-version": 16 }, "ideviceinstaller": { "baseline": "1.1.2.23", @@ -3482,7 +3482,7 @@ }, "libiconv": { "baseline": "1.16", - "port-version": 11 + "port-version": 12 }, "libics": { "baseline": "1.6.5", @@ -3926,7 +3926,7 @@ }, "liburing": { "baseline": "2.0", - "port-version": 0 + "port-version": 1 }, "libusb": { "baseline": "1.0.24", @@ -4570,7 +4570,7 @@ }, "ncurses": { "baseline": "6.2", - "port-version": 1 + "port-version": 2 }, "neargye-semver": { "baseline": "0.3.0", @@ -6430,7 +6430,7 @@ }, "starlink-ast": { "baseline": "9.2.4", - "port-version": 2 + "port-version": 3 }, "status-code": { "baseline": "1.0.0-ab3cd821", diff --git a/versions/g-/gdal.json b/versions/g-/gdal.json index af74f9006bc504..bcff6770e8ffb3 100644 --- a/versions/g-/gdal.json +++ b/versions/g-/gdal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0ba46f63f70a8d7ef1ff2253e48d4e45b0b0f629", + "version-semver": "3.3.2", + "port-version": 2 + }, { "git-tree": "6e90412cd51170a5ea63a0067005bb3afc3c6c36", "version-semver": "3.3.2", diff --git a/versions/g-/gettext.json b/versions/g-/gettext.json index adb7fea987cdb4..fbc69139491fe6 100644 --- a/versions/g-/gettext.json +++ b/versions/g-/gettext.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d1eba48f67dbbd9a07b89b0850e1e42777a409b2", + "version": "0.21", + "port-version": 7 + }, { "git-tree": "72394a1e7b0ea6333d78849f864c4b7bc8c7e8dc", "version": "0.21", diff --git a/versions/h-/healpix.json b/versions/h-/healpix.json index a85f5293c2107b..87a3d6364e0b4a 100644 --- a/versions/h-/healpix.json +++ b/versions/h-/healpix.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0eb7e3ec2016e2f927cb7c943f9434b5252366ec", + "version-string": "1.12.10", + "port-version": 9 + }, { "git-tree": "38bd9d397f3ba4e227f09a36ecb0af034f5f0c98", "version-string": "1.12.10", diff --git a/versions/h-/hunspell.json b/versions/h-/hunspell.json index af5756c9447935..c5b4354f7ca218 100644 --- a/versions/h-/hunspell.json +++ b/versions/h-/hunspell.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3d6529e3845ea7ae9aadc6abeef30985d863e91e", + "version": "1.7.0", + "port-version": 6 + }, { "git-tree": "2a0514dd8b3893b6d3a502fbf55156e9e971d6f7", "version": "1.7.0", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index 17f2df336b4293..851300c8c156a8 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "50a938c3cad21f9ede4746d59348e9810c54aef8", + "version": "69.1", + "port-version": 16 + }, { "git-tree": "2d08c0ceb1777074f3b31fe51e386c9ece0ca8cd", "version": "69.1", diff --git a/versions/l-/libiconv.json b/versions/l-/libiconv.json index 9423b2719d2fcf..7ecf38d519aa5c 100644 --- a/versions/l-/libiconv.json +++ b/versions/l-/libiconv.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "534ed78492de209c5a752b53ef6567b61a577c3d", + "version": "1.16", + "port-version": 12 + }, { "git-tree": "f82980bff6c23bcccd043300679ebf8afa3e0a22", "version": "1.16", diff --git a/versions/l-/liburing.json b/versions/l-/liburing.json index 0ec46a4a754a02..3cf5fcb96e0400 100644 --- a/versions/l-/liburing.json +++ b/versions/l-/liburing.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9eea2e30573c9bc095a193076d15896a98c6324d", + "version": "2.0", + "port-version": 1 + }, { "git-tree": "b4d90242721d15d6dc5287690c3b8d42c2e8d0f0", "version": "2.0", diff --git a/versions/n-/ncurses.json b/versions/n-/ncurses.json index 135f3c3b5ec239..1ef2b997836481 100644 --- a/versions/n-/ncurses.json +++ b/versions/n-/ncurses.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "dcdfbaf6aaf3b24ac3c4c189b05d82c0f6954d90", + "version-string": "6.2", + "port-version": 2 + }, { "git-tree": "f196044f9f7779e0bdb54015dbd3be84aaa00820", "version-string": "6.2", diff --git a/versions/s-/starlink-ast.json b/versions/s-/starlink-ast.json index 0ba8d7525f3ba6..ebd410fb2def2d 100644 --- a/versions/s-/starlink-ast.json +++ b/versions/s-/starlink-ast.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5de775aeb50b0553ac45537e3597fdbb4ecd8505", + "version-semver": "9.2.4", + "port-version": 3 + }, { "git-tree": "487c5e318ce957c09647d0d74a2b5b4a4e99ffef", "version-semver": "9.2.4", diff --git a/versions/v-/vcpkg-make.json b/versions/v-/vcpkg-make.json index a8de35fe92f541..ed5e754cc03201 100644 --- a/versions/v-/vcpkg-make.json +++ b/versions/v-/vcpkg-make.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "2478c2e3dd12c98c88c7f405d585c86dc801198c", + "git-tree": "be3d7001f8dd0c6e75b9a604c74f73edf4d202be", "version-date": "2021-08-25", "port-version": 0 } diff --git a/versions/x-/x264.json b/versions/x-/x264.json index 793b305952c0fd..cae2f1f24362e1 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "8146fd54bc8d5884cd76ec4139a1ea61ea23d3de", + "git-tree": "d95c7bd4f42aa5f0ce47b7e68fc8aad1de9566d7", "version-string": "157-303c484ec828ed0", "port-version": 17 }, From 8e15dbb0217e1487a69d8b6f525c1b01f49ffa27 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Sun, 24 Oct 2021 19:31:12 -0700 Subject: [PATCH 27/27] Update docs --- docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md index 2c76c15380d2b6..a40b318ee35cb0 100644 --- a/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md +++ b/docs/maintainers/ports/vcpkg-make/vcpkg_make_configure.md @@ -7,6 +7,7 @@ Configure a Makefile buildsystem. ```cmake vcpkg_make_configure( SOURCE_PATH <${source_path}> + [AUTOCONFIG] [USE_WRAPPERS] [DETERMINE_BUILD_TRIPLET] [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"]