From c15dacc0d55deb1c054cd67f551cccb632dc0b2c Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 30 Jan 2024 13:44:28 -0800 Subject: [PATCH 01/32] initial --- .../functions/vcpkg_make_configure.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 vcpkg/maintainers/functions/vcpkg_make_configure.md diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md new file mode 100644 index 00000000..80e37f88 --- /dev/null +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -0,0 +1,151 @@ +--- +title: vcpkg_make_configure +description: Use vcpkg_make_configure to configure a Make-based project. +ms.date: 01/30/2024 +--- +# vcpkg_cmake_configure + +Configure a Make-based project. + +## Usage + +```cmake +vcpkg_make_configure( + SOURCE_PATH + [DISABLE_PARALLEL_CONFIGURE] + [NO_CHARSET_FLAG] + [WINDOWS_USE_MSBUILD] + [GENERATOR ] + [LOGFILE_BASE ] + [OPTIONS + ...] + [OPTIONS_RELEASE + ...] + [OPTIONS_DEBUG + ...] + [MAYBE_UNUSED_VARIABLES + ...] +) +``` + +To use this function, you must depend on the helper port `vcpkg-cmake`: + +```json +"dependencies": [ + { + "name": "vcpkg-make", + "host": true + } +] +``` + +## Parameters + +### SOURCE_PATH + +Specifies the directory containing the `CMakeLists.txt`. + +This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). + +### DISABLE_PARALLEL_CONFIGURE + +Disables running the CMake configure step in parallel. + +By default vcpkg disables writing back to the source directory (via the undocumented CMake flag `CMAKE_DISABLE_SOURCE_CHANGES`) and (on Windows) configures Release and Debug in parallel. This flag instructs vcpkg to allow source directory writes and to execute the configure steps sequentially. + +### NO_CHARSET_FLAG + +Disables passing `/utf-8` when using the [built-in Windows toolchain](../../users/triplets.md#vcpkg_chainload_toolchain_file). + +This is needed for libraries that set their own source code's character set when targeting MSVC. See the [MSVC documentation for `/utf-8`](/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8) for more information. + +### WINDOWS_USE_MSBUILD + +Use MSBuild instead of another generator when targeting a Windows platform. + +By default vcpkg prefers to use [Ninja](https://ninja-build.org/) as the CMake Generator for all platforms. However, there are edge cases where MSBuild has different behavior than Ninja. This flag should only be passed if the project requires MSBuild to build correctly. +This flag has no effect for MinGW targets. + +### GENERATOR + +Specifies the Generator to use. + +By default vcpkg prefers to use Ninja as the CMake Generator for all platforms, +or "Unix Makefiles" for non-Windows platforms when Ninja is not available. +This parameter can be used for edge cases where project-specific buildsystems depend on a particular generator. + +### LOGFILE_BASE + +An alternate root name for the configure logs. + +Defaults to `config-${TARGET_TRIPLET}`. It should not contain any path separators. Logs will be generated matching the pattern `${CURRENT_BUILDTREES_DIR}/${LOGFILE_BASE}-.log` + +### OPTIONS + +Additional options to pass to CMake during the configuration. + +See also [Implicit Options](#implicit-options). + +### OPTIONS_RELEASE + +Additional options to pass to CMake during the Release configuration. + +These are in addition to `OPTIONS`. + +### OPTIONS_DEBUG + +Additional options to pass to CMake during the Debug configuration. + +These are in addition to `OPTIONS`. + +### MAYBE_UNUSED_VARIABLES + +List of CMake options that may not be read during the configure step. + +vcpkg will warn about any options outside this list that were not read during the CMake configure step. This list should contain options that are only read during certain configurations (such as when `VCPKG_LIBRARY_LINKAGE` is `"static"` or when certain features are enabled). + +## Implicit Options + +This command automatically provides several options to CMake. + +- [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) is set to `"Release"` or `"Debug"` as appropriate. +- [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) is set according to the value of [`VCPKG_LIBRARY_LINKAGE`](../../users/triplets.md#vcpkg_library_linkage). +- [`CMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) as appropriate to the configuration +- [`CMAKE_TOOLCHAIN_FILE`](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html) and `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` are set to include the [vcpkg toolchain file](../../users/buildsystems/cmake-integration.md#cmake_toolchain_file) and the [triplet toolchain](../../users/triplets.md#vcpkg_chainload_toolchain_file). +- [`CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}`](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html). If `VCPKG_CMAKE_SYSTEM_NAME` is unset, defaults to `"Windows"`. +- [`CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}`](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_VERSION.html) if `VCPKG_CMAKE_SYSTEM_VERSION` is set. +- [`CMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.html) +- [`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.html) +- [`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.html) +- [`CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE`](https://cmake.org/cmake/help/latest/module/InstallRequiredSystemLibraries.html) +- [`CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION.html) +- [`CMAKE_INSTALL_LIBDIR:STRING=lib`](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) +- [`CMAKE_INSTALL_BINDIR:STRING=bin`](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) +- [`FETCHCONTENT_FULLY_DISCONNECTED=ON`](https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_FULLY_DISCONNECTED) (_since version 2022-10-30_) + +This command also passes all options in [`VCPKG_CMAKE_CONFIGURE_OPTIONS`](../../users/triplets.md#vcpkg_cmake_configure_options) and the configuration-specific options from `VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE` or `VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG`. + +Finally, there are additional internal options passed in (with a `VCPKG_` prefix) that should not be depended upon. + +## Examples + +```cmake +vcpkg_from_github(OUT_SOURCE_PATH source_path ...) +vcpkg_cmake_configure( + SOURCE_PATH "${source_path}" + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF +) +vcpkg_cmake_install() +``` + +[Search microsoft/vcpkg for Examples](https://github.com/microsoft/vcpkg/search?q=vcpkg_cmake_configure+path%3A%2Fports) + +## Remarks + +This command replaces [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). + +## Source + +[ports/vcpkg-cmake/vcpkg\_cmake\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake) From 4695b0241f1297101adf9d9a4a4653e0315da688 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 31 Jan 2024 11:14:46 -0800 Subject: [PATCH 02/32] draft of configure --- .../functions/vcpkg_make_configure.md | 134 +++++++++--------- 1 file changed, 64 insertions(+), 70 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 80e37f88..8a860f02 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -8,26 +8,29 @@ ms.date: 01/30/2024 Configure a Make-based project. ## Usage - + ```cmake vcpkg_make_configure( SOURCE_PATH - [DISABLE_PARALLEL_CONFIGURE] - [NO_CHARSET_FLAG] - [WINDOWS_USE_MSBUILD] - [GENERATOR ] - [LOGFILE_BASE ] - [OPTIONS - ...] - [OPTIONS_RELEASE - ...] - [OPTIONS_DEBUG - ...] - [MAYBE_UNUSED_VARIABLES - ...] + [COPY_SOURCE] + [DISABLE_MSVC_WRAPPERS] + [NO_CPPFLAGS] + [ADD_BIN_TO_PATH] + [NO_DEFAULT_OPTIONS] + [NO_MSVC_FLAG_ESCAPING] + [USE_RESPONSE_FILES] + [SHELL ] + [OPTIONS ...] + [OPTIONS_RELEASE ...] + [OPTIONS_DEBUG ...] + [PRE_CONFIGURE_CMAKE_COMMANDS ...] + [POST_CONFIGURE_CMAKE_COMMANDS ...] + [LANGUAGES ...] ) + ``` + To use this function, you must depend on the helper port `vcpkg-cmake`: ```json @@ -43,109 +46,100 @@ To use this function, you must depend on the helper port `vcpkg-cmake`: ### SOURCE_PATH -Specifies the directory containing the `CMakeLists.txt`. +The directory containing the project's source files This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). -### DISABLE_PARALLEL_CONFIGURE +### COPY_SOURCE -Disables running the CMake configure step in parallel. +If specified, the source directory will be copied to the build directory before the configuration process begins. Useful for projects that modify the source tree during configuration or build. -By default vcpkg disables writing back to the source directory (via the undocumented CMake flag `CMAKE_DISABLE_SOURCE_CHANGES`) and (on Windows) configures Release and Debug in parallel. This flag instructs vcpkg to allow source directory writes and to execute the configure steps sequentially. +### DISABLE_MSVC_WRAPPERS -### NO_CHARSET_FLAG +Disables the use of MSVC compiler wrappers. Useful for projects that are not compatible with the wrappers. -Disables passing `/utf-8` when using the [built-in Windows toolchain](../../users/triplets.md#vcpkg_chainload_toolchain_file). +### NO_CPPFLAGS -This is needed for libraries that set their own source code's character set when targeting MSVC. See the [MSVC documentation for `/utf-8`](/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8) for more information. +Prevents the addition of C Preprocessor flags to the compiler command line. Use this if the project does not use or incorrectly handles these flags. -### WINDOWS_USE_MSBUILD +If set, the `CPPFLAGS` environment variable, typically used for specifying C preprocessor flags, will not be automatically populated based on vcpkg's settings. This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. -Use MSBuild instead of another generator when targeting a Windows platform. +### ADD_BIN_TO_PATH -By default vcpkg prefers to use [Ninja](https://ninja-build.org/) as the CMake Generator for all platforms. However, there are edge cases where MSBuild has different behavior than Ninja. This flag should only be passed if the project requires MSBuild to build correctly. -This flag has no effect for MinGW targets. +Adds the `bin` directory to the system path. This is useful for builds that require executables to be available on the path. -### GENERATOR +### NO_DEFAULT_OPTIONS -Specifies the Generator to use. +Disables the inclusion of default configure options provided by `vcpkg_make_configure`. This gives you full control over the configure command line. -By default vcpkg prefers to use Ninja as the CMake Generator for all platforms, -or "Unix Makefiles" for non-Windows platforms when Ninja is not available. -This parameter can be used for edge cases where project-specific buildsystems depend on a particular generator. +### NO_MSVC_FLAG_ESCAPING -### LOGFILE_BASE +Turns off the escaping of MSVC flags. This might be necessary for projects that do not expect or handle escaped compiler flags properly. -An alternate root name for the configure logs. +### USE_RESPONSE_FILES -Defaults to `config-${TARGET_TRIPLET}`. It should not contain any path separators. Logs will be generated matching the pattern `${CURRENT_BUILDTREES_DIR}/${LOGFILE_BASE}-.log` +Enables the use of response files to pass arguments to the configure script. This can help avoid command line length limitations. -### OPTIONS +### SHELL -Additional options to pass to CMake during the configuration. +Specifies the shell to use for running the configuration scripts. Useful for ensuring compatibility in environments where the default shell might not behave as expected. -See also [Implicit Options](#implicit-options). +### OPTIONS + +Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. ### OPTIONS_RELEASE -Additional options to pass to CMake during the Release configuration. +Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. These are in addition to `OPTIONS`. ### OPTIONS_DEBUG -Additional options to pass to CMake during the Debug configuration. +Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. These are in addition to `OPTIONS`. -### MAYBE_UNUSED_VARIABLES +### PRE_CONFIGURE_CMAKE_COMMANDS -List of CMake options that may not be read during the configure step. +Specifies a list of CMake commands to execute before the configure process. This can be used to set up the environment or prepare the build in a way that the configure script requires. -vcpkg will warn about any options outside this list that were not read during the CMake configure step. This list should contain options that are only read during certain configurations (such as when `VCPKG_LIBRARY_LINKAGE` is `"static"` or when certain features are enabled). +### POST_CONFIGURE_CMAKE_COMMANDS -## Implicit Options +Specifies a list of CMake commands to execute after the configure process. This can be used for cleanup or to prepare for the next steps in the build process. -This command automatically provides several options to CMake. +### LANGUAGES -- [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) is set to `"Release"` or `"Debug"` as appropriate. -- [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) is set according to the value of [`VCPKG_LIBRARY_LINKAGE`](../../users/triplets.md#vcpkg_library_linkage). -- [`CMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) as appropriate to the configuration -- [`CMAKE_TOOLCHAIN_FILE`](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html) and `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` are set to include the [vcpkg toolchain file](../../users/buildsystems/cmake-integration.md#cmake_toolchain_file) and the [triplet toolchain](../../users/triplets.md#vcpkg_chainload_toolchain_file). -- [`CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}`](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html). If `VCPKG_CMAKE_SYSTEM_NAME` is unset, defaults to `"Windows"`. -- [`CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}`](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_VERSION.html) if `VCPKG_CMAKE_SYSTEM_VERSION` is set. -- [`CMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.html) -- [`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.html) -- [`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.html) -- [`CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE`](https://cmake.org/cmake/help/latest/module/InstallRequiredSystemLibraries.html) -- [`CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION.html) -- [`CMAKE_INSTALL_LIBDIR:STRING=lib`](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) -- [`CMAKE_INSTALL_BINDIR:STRING=bin`](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) -- [`FETCHCONTENT_FULLY_DISCONNECTED=ON`](https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_FULLY_DISCONNECTED) (_since version 2022-10-30_) +Specifies the programming languages your project uses. This can influence environment variables and other settings that the configuration process uses. -This command also passes all options in [`VCPKG_CMAKE_CONFIGURE_OPTIONS`](../../users/triplets.md#vcpkg_cmake_configure_options) and the configuration-specific options from `VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE` or `VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG`. +## Implicit Options -Finally, there are additional internal options passed in (with a `VCPKG_` prefix) that should not be depended upon. +TODO: Implicit options to configure script ## Examples ```cmake -vcpkg_from_github(OUT_SOURCE_PATH source_path ...) -vcpkg_cmake_configure( - SOURCE_PATH "${source_path}" +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO example/examplelib + REF v1.2.3 + SHA512 123456... +) + +vcpkg_make_configure( + SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DBUILD_EXAMPLES=OFF - -DBUILD_TESTS=OFF + --disable-silent-rules + --enable-foo + OPTIONS_DEBUG + --enable-debug-logs ) -vcpkg_cmake_install() -``` -[Search microsoft/vcpkg for Examples](https://github.com/microsoft/vcpkg/search?q=vcpkg_cmake_configure+path%3A%2Fports) +vcpkg_make_install() +``` ## Remarks -This command replaces [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +This command replaces [`vcpkg_configure_make()`](vcpkg_configure_make.md). ## Source - -[ports/vcpkg-cmake/vcpkg\_cmake\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake) From 6b393c96a5a8ab78da11286c68791cfb61b8037d Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 31 Jan 2024 11:26:09 -0800 Subject: [PATCH 03/32] draft of vcpkg_make_install docs --- .../functions/vcpkg_make_install.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 vcpkg/maintainers/functions/vcpkg_make_install.md diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md new file mode 100644 index 00000000..c067aea1 --- /dev/null +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -0,0 +1,109 @@ +--- +title: vcpkg_make_install +description: Use vcpkg_make_install to build and install a CMake project. +ms.date: 01/31/2024 +--- +# vcpkg_make_install + +Build and install a Make-based project. + +## Usage + +```cmake +vcpkg_make_install( + [ADD_BIN_TO_PATH] + [DISABLE_PARALLEL] + [NO_DESTDIR] + [NO_MSVC_FLAG_ESCAPING] + [USE_RESPONSE_FILES] + [LOGFILE_ROOT ] + [SUBPATH ] + [MAKEFILE ] + [TARGETS ...] + [SHELL ] + [OPTIONS ...] + [OPTIONS_RELEASE ...] + [OPTIONS_DEBUG ...] +) +``` + +To use this function, you must depend on the helper port `vcpkg-make`: + +```json +"dependencies": [ + { + "name": "vcpkg-make", + "host": true + } +] +``` + +## Parameters + +### ADD_BIN_TO_PATH + +DAdds the `bin` directory to the `PATH` during the build. This is useful when executables from the build are required for subsequent build steps. + +### DISABLE_PARALLEL + +Disables parallel building. By default, `make` is called with `-j` to parallelize the build. Use this if the project does not support parallel building. + +### NO_DESTDIR + +By default, `make install` will use the `DESTDIR` variable to redirect installation to the package directory. Use this flag if `DESTDIR` should not be set. + +### NO_MSVC_FLAG_ESCAPING + +Prevents escaping of MSVC flags. Use this if the project's makefiles do not expect escaped flags. + +### USE_RESPONSE_FILES + +Enables the use of response files for passing arguments to `make`, circumventing command line length limits on some platforms. + +### LOGFILE_ROOT + +Specifies the base name for log files generated by the build. Defaults to "make". + +### SUBPATH + +Specifies a sub-directory within the source tree where the makefile is located or where the build should be executed. + +### MAKEFILE + +Specifies the name of the makefile to use. Defaults to "Makefile". + +### TARGETS + +Specifies the targets to pass to make. Defaults to "all;install". + +### SHELL + +Specifies the shell to use for running `make`. Useful for environments where the default shell might not be compatible with the makefiles. + +### OPTIONS + +Additional options to pass to `make` during the build. + +### OPTIONS_RELEASE + +Additional options to pass to `make` during the release build. + +### OPTIONS_DEBUG + +Additional options to pass to `make` during the release build. + +## Examples + +```cmake +vcpkg_from_github(OUT_SOURCE_PATH source_path ...) +vcpkg_make_configure(SOURCE_PATH "${source_path}") +vcpkg_make_install() +``` + +## Remarks + +This command replaces [`vcpkg_install_make()`](vcpkg_install_make.md). + +## Source + +TODO \ No newline at end of file From e3a738ec39ad2a0c023be63aab6990cc6393c560 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 26 Feb 2024 14:15:09 -0800 Subject: [PATCH 04/32] update docs --- .../functions/vcpkg_make_configure.md | 48 ++++++++++++------- .../functions/vcpkg_make_install.md | 12 ++--- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 8a860f02..d3d894aa 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -3,7 +3,7 @@ title: vcpkg_make_configure description: Use vcpkg_make_configure to configure a Make-based project. ms.date: 01/30/2024 --- -# vcpkg_cmake_configure +# vcpkg_make_configure Configure a Make-based project. @@ -11,7 +11,7 @@ Configure a Make-based project. ```cmake vcpkg_make_configure( - SOURCE_PATH + [AUTOCONFIG] [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] [NO_CPPFLAGS] @@ -19,6 +19,7 @@ vcpkg_make_configure( [NO_DEFAULT_OPTIONS] [NO_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] + [SOURCE_PATH ] [SHELL ] [OPTIONS ...] [OPTIONS_RELEASE ...] @@ -27,11 +28,9 @@ vcpkg_make_configure( [POST_CONFIGURE_CMAKE_COMMANDS ...] [LANGUAGES ...] ) - ``` - -To use this function, you must depend on the helper port `vcpkg-cmake`: +To use this function, you must depend on the helper port `vcpkg-make`: ```json "dependencies": [ @@ -44,11 +43,9 @@ To use this function, you must depend on the helper port `vcpkg-cmake`: ## Parameters -### SOURCE_PATH - -The directory containing the project's source files +### AUTOCONFIG -This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). +Boolean value that runs autoreconf when set. ### COPY_SOURCE @@ -70,7 +67,24 @@ Adds the `bin` directory to the system path. This is useful for builds that requ ### NO_DEFAULT_OPTIONS -Disables the inclusion of default configure options provided by `vcpkg_make_configure`. This gives you full control over the configure command line. +When set, this flag disables the automatic inclusion of the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line: + +General Defaults: +* --disable-silent-rules - Makes the build process output more verbose, which can be helpful for debugging. +* --verbose - Enables verbose output from the configure script. + +Library Linkage: +* For dynamic library builds: --enable-shared and --disable-static +* For static library builds: --disable-shared and --enable-static + +Installation Directories: +* Adjusts standard directories (bin, lib, share, etc.) to conform with vcpkg's layout, ensuring correct installation paths. + +Platform-Specific Tweaks: +* On Windows: Ensures compatibility with Windows-specific filesystem and library behaviors. +* On Unix-like systems: Assures the script accommodates the typical filesystem layout and toolchain behaviors. + +Removing these defaults gives you the responsibility to specify all necessary configuration options manually, ensuring the project is correctly configured for building with vcpkg. ### NO_MSVC_FLAG_ESCAPING @@ -80,6 +94,12 @@ Turns off the escaping of MSVC flags. This might be necessary for projects that Enables the use of response files to pass arguments to the configure script. This can help avoid command line length limitations. +### SOURCE_PATH + +The directory containing the project's source files + +This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). + ### SHELL Specifies the shell to use for running the configuration scripts. Useful for ensuring compatibility in environments where the default shell might not behave as expected. @@ -110,11 +130,7 @@ Specifies a list of CMake commands to execute after the configure process. This ### LANGUAGES -Specifies the programming languages your project uses. This can influence environment variables and other settings that the configuration process uses. - -## Implicit Options - -TODO: Implicit options to configure script +Specifies the programming languages your project uses. ## Examples @@ -141,5 +157,3 @@ vcpkg_make_install() ## Remarks This command replaces [`vcpkg_configure_make()`](vcpkg_configure_make.md). - -## Source diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index c067aea1..23452637 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -1,6 +1,6 @@ --- title: vcpkg_make_install -description: Use vcpkg_make_install to build and install a CMake project. +description: Use vcpkg_make_install to build and install a Make-based project. ms.date: 01/31/2024 --- # vcpkg_make_install @@ -42,7 +42,7 @@ To use this function, you must depend on the helper port `vcpkg-make`: ### ADD_BIN_TO_PATH -DAdds the `bin` directory to the `PATH` during the build. This is useful when executables from the build are required for subsequent build steps. +Adds the `bin` directory to the `PATH` during the build. This is useful when executables from the build are required for subsequent build steps. ### DISABLE_PARALLEL @@ -90,7 +90,7 @@ Additional options to pass to `make` during the release build. ### OPTIONS_DEBUG -Additional options to pass to `make` during the release build. +Additional options to pass to `make` during the debug build. ## Examples @@ -102,8 +102,4 @@ vcpkg_make_install() ## Remarks -This command replaces [`vcpkg_install_make()`](vcpkg_install_make.md). - -## Source - -TODO \ No newline at end of file +This command replaces [`vcpkg_install_make()`](vcpkg_install_make.md). \ No newline at end of file From c19584bda5a689e1d2b6db68be9e0a2ac00f6fe5 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 13:36:56 -0400 Subject: [PATCH 05/32] provide more detail and context for on NO_* options --- .../functions/vcpkg_make_configure.md | 26 ++++++++++++++----- .../functions/vcpkg_make_install.md | 2 +- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index c48ba370..22d6b611 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -43,7 +43,7 @@ To use this function, you must depend on the helper port `vcpkg-make`: ### AUTOCONFIG -Boolean value that runs autoreconf when set. +Runs autoreconf when set. ### COPY_SOURCE @@ -51,11 +51,16 @@ If specified, the source directory will be copied to the build directory before ### DISABLE_MSVC_WRAPPERS -The `DISABLE_MSVC_WRAPPERS` option controls the use of wrapper scripts specifically for tools such as Microsoft's `cl.exe` and the `windres` resource compiler. These wrappers translate and reorder command-line flags to accommodate the expected syntax and operational requirements of these tools. When this option is enabled, the cl.exe and windres tools will directly interpret command-line flags without any modifications +Disables the use of wrapper scripts for MSVC tools (cl.exe, windres). +These wrappers translate and reorder command-line flags to accommodate the expected syntax and operational requirements of these tools. When this option is enabled, the `cl.exe` and `windres` tools will directly interpret command-line flags without any modifications. ### NO_CPPFLAGS -Disable the extraction of C preprocessor/target/arch flags from `CCFLAGS` into `CPPFLAGS`. Use this if the project does not use `CPPFLAGS`. +Disables the extraction of C preprocessor flags (`-D` and `-isystem`) from `CFLAGS` into `CPPFLAGS`. + +By default (when `NO_CPPFLAGS` is not set or is false), vcpkg automatically identifies and extracts these flags from the `CFLAGS` and `CXXFLAGS` variables, which typically contain general compiler options. It then consolidates these specific flags into a separate `CPPFLAGS` variable, dedicated to preprocessor and include path settings. + +However, if you explicitly set `NO_CPPFLAGS` to true, you override this default behavior. Vcpkg will then leave the `-D` and `-isystem` flags untouched in their original variables (`CFLAGS` and `CXXFLAGS`). If set, the `CPPFLAGS` environment variable, typically used for specifying C preprocessor flags, will not be automatically populated based on vcpkg's settings. This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. @@ -68,7 +73,7 @@ Adds the configure dependent `(debug/)bin` directory to the system path. This is When set, this flag disables the automatic inclusion of the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line: General Defaults: -* --disable-silent-rules - Makes the build process output more verbose, which can be helpful for debugging. +* --disable-silent-rules - Makes the build process output more verbose. * --verbose - Enables verbose output from the configure script. Library Linkage: @@ -86,11 +91,20 @@ Removing these defaults gives you the responsibility to specify all necessary co ### NO_MSVC_FLAG_ESCAPING -Turns off the escaping of MSVC flags. This might be necessary for projects that do not expect or handle escaped compiler flags properly. +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before flags to ensure that MSVC interprets them correctly. These escape characters help prevent issues caused by spaces, quotes, or other special characters that might be misinterpreted by the MSVC command-line tools. + +When you set `NO_MSVC_FLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: + +- You know your flags are formatted correctly: If you're confident that your compiler and linker flags don't contain problematic characters, you can avoid unnecessary escaping. +- You're using custom build scripts: If you have custom build scripts or tools that require specific flag formatting, disabling automatic escaping might be necessary for compatibility. ### USE_RESPONSE_FILES -Enables the use of response files to pass arguments to the configure script. This can help avoid command line length limitations. +Enables the use of response files to pass arguments to the linker. + +If set, the code generates response files for the linker flags (`CPPFLAGS`, `CFLAGS`, `CXXFLAGS`, `LDFLAGS`) and passes the response file path to the linker instead of the individual flags. If it's false, the flags are passed directly. + +This can be helpful when dealing with long command lines that exceed the maximum allowed length. ### SOURCE_PATH diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 359cb62d..106dd09a 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -44,7 +44,7 @@ Adds the configure dependent `(debug/)bin` directory to the system path. This is ### DISABLE_PARALLEL -Disables parallel building. By default, `make` is called with `-j` to parallelize the build. Use this if the project does not support parallel building. +By default, `vcpkg_make_install` will run make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This will cause make to be executed without the -j option, running build steps sequentially. ### NO_DESTDIR From ac0c6c211f834a342687ef7591065b56c84f2f1b Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 19 Jun 2024 15:49:39 -0400 Subject: [PATCH 06/32] clarify NO_MSVC_FLAG_ESCAPING --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 22d6b611..b52d61df 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -91,13 +91,16 @@ Removing these defaults gives you the responsibility to specify all necessary co ### NO_MSVC_FLAG_ESCAPING -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before flags to ensure that MSVC interprets them correctly. These escape characters help prevent issues caused by spaces, quotes, or other special characters that might be misinterpreted by the MSVC command-line tools. +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. This is done to ensure that these flags, which might contain spaces or other special characters, are correctly interpreted by the underlying MSVC tools (cl.exe, link.exe) When you set `NO_MSVC_FLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: - You know your flags are formatted correctly: If you're confident that your compiler and linker flags don't contain problematic characters, you can avoid unnecessary escaping. - You're using custom build scripts: If you have custom build scripts or tools that require specific flag formatting, disabling automatic escaping might be necessary for compatibility. +>[!NOTE] +>If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`NO_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. + ### USE_RESPONSE_FILES Enables the use of response files to pass arguments to the linker. From 0d850438c79196ea4ceb759ac7466f81d4209a6a Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 24 Jun 2024 11:16:02 -0400 Subject: [PATCH 07/32] respond to feedback --- .../functions/vcpkg_make_configure.md | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index b52d61df..b54cbfed 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -15,7 +15,6 @@ vcpkg_make_configure( [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] [NO_CPPFLAGS] - [ADD_BIN_TO_PATH] [NO_DEFAULT_OPTIONS] [NO_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] @@ -51,26 +50,34 @@ If specified, the source directory will be copied to the build directory before ### DISABLE_MSVC_WRAPPERS -Disables the use of wrapper scripts for MSVC tools (cl.exe, windres). -These wrappers translate and reorder command-line flags to accommodate the expected syntax and operational requirements of these tools. When this option is enabled, the `cl.exe` and `windres` tools will directly interpret command-line flags without any modifications. +By default, `vcpkg_make_configure` supplies wrappers that translate and reorder 'unix / gcc-style' flags into 'msvc-style' flags. This accommodates build systems that assume unix or gcc conventions. -### NO_CPPFLAGS +Setting `DISABLE_MSVC_WRAPPERS` removes these wrappers and allows the underlying make build system to supply 'msvc-style' flags directly without translation. When this option is enabled, the `cl` and `windres` tools will directly interpret command-line flags without any modifications. -Disables the extraction of C preprocessor flags (`-D` and `-isystem`) from `CFLAGS` into `CPPFLAGS`. +### NO_MSVC_FLAG_ESCAPING -By default (when `NO_CPPFLAGS` is not set or is false), vcpkg automatically identifies and extracts these flags from the `CFLAGS` and `CXXFLAGS` variables, which typically contain general compiler options. It then consolidates these specific flags into a separate `CPPFLAGS` variable, dedicated to preprocessor and include path settings. +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. +When you set `NO_MSVC_FeLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: -However, if you explicitly set `NO_CPPFLAGS` to true, you override this default behavior. Vcpkg will then leave the `-D` and `-isystem` flags untouched in their original variables (`CFLAGS` and `CXXFLAGS`). +- You know your flags are formatted correctly: If you're confident that your compiler and linker flags don't contain problematic characters, you can avoid unnecessary escaping. +- You're using custom build scripts: If you have custom build scripts or tools that require specific flag formatting, disabling automatic escaping might be necessary for compatibility. -If set, the `CPPFLAGS` environment variable, typically used for specifying C preprocessor flags, will not be automatically populated based on vcpkg's settings. This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. +>[!NOTE] +>If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`NO_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. -### ADD_BIN_TO_PATH +### NO_CPPFLAGS + +Disables the extraction of C preprocessor flags (`-D` and `-isystem`) from `CFLAGS` and `CXXFLAGS` into `CPPFLAGS`. + +By default, `vcpkg_make_configure` extracts preprocessor relevant flags from the `CFLAGS` and `CXXFLAGS` environment variables into `CPPFLAGS`, because preprocessor flags in vcpkg are normally supplied through compiler settings variables like `VCPKG_C_FLAGS` or `VCPKG_CXX_FLAGS`. -Adds the configure dependent `(debug/)bin` directory to the system path. This is useful if configure builds and runs executables with vcpkg integrated dependencies. +Setting `NO_CPPFLAGS` disables that behavior, leaving preprocessor relevant flags in `CFLAGS` and `CXXFLAGS`. + +This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. ### NO_DEFAULT_OPTIONS -When set, this flag disables the automatic inclusion of the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line: +Setting this flag disables the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line. General Defaults: * --disable-silent-rules - Makes the build process output more verbose. @@ -89,18 +96,6 @@ Platform-Specific Tweaks: Removing these defaults gives you the responsibility to specify all necessary configuration options manually, ensuring the project is correctly configured for building with vcpkg. -### NO_MSVC_FLAG_ESCAPING - -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. This is done to ensure that these flags, which might contain spaces or other special characters, are correctly interpreted by the underlying MSVC tools (cl.exe, link.exe) - -When you set `NO_MSVC_FLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: - -- You know your flags are formatted correctly: If you're confident that your compiler and linker flags don't contain problematic characters, you can avoid unnecessary escaping. -- You're using custom build scripts: If you have custom build scripts or tools that require specific flag formatting, disabling automatic escaping might be necessary for compatibility. - ->[!NOTE] ->If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`NO_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. - ### USE_RESPONSE_FILES Enables the use of response files to pass arguments to the linker. @@ -133,7 +128,10 @@ These are in addition to `OPTIONS`. ### PRE_CONFIGURE_CMAKE_COMMANDS -Specifies a list of CMake commands to execute before the configure process. This can be used to set up the environment or prepare the build in a way that the configure script requires. +Specifies a list of CMake commands to execute before the configure process for each build type. That is, if `VCPKG_BUILD_TYPE` is empty (the default), these commands will run once for debug and once for release. If `VCPKG_BUILD_TYPE` is `release`, these commands will only be once for release. This can be used to set up the environment or prepare the build in a way that the configure script requires. + +>[!NOTE] +> When the `COPY_SOURCE` option is not set, the CMake commands in `PRE_CONFIGURE_CMAKE_COMMANDS` will operate directly on the files in the original source directory. ### LANGUAGES From 7ec426a44ed8a5937a52ced4e846a0be53d4b0be Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 24 Jun 2024 11:38:55 -0400 Subject: [PATCH 08/32] update docs from NO_CPPFLAGS to DISBALE_CPPFLAGS --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index b54cbfed..81e79163 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -14,7 +14,7 @@ vcpkg_make_configure( [AUTOCONFIG] [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] - [NO_CPPFLAGS] + [DISABLE_CPPFLAGS] [NO_DEFAULT_OPTIONS] [NO_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] @@ -65,13 +65,13 @@ When you set `NO_MSVC_FeLAG_ESCAPING`, you tell vcpkg not to perform this automa >[!NOTE] >If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`NO_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. -### NO_CPPFLAGS +### DSIABLE_CPPFLAGS Disables the extraction of C preprocessor flags (`-D` and `-isystem`) from `CFLAGS` and `CXXFLAGS` into `CPPFLAGS`. By default, `vcpkg_make_configure` extracts preprocessor relevant flags from the `CFLAGS` and `CXXFLAGS` environment variables into `CPPFLAGS`, because preprocessor flags in vcpkg are normally supplied through compiler settings variables like `VCPKG_C_FLAGS` or `VCPKG_CXX_FLAGS`. -Setting `NO_CPPFLAGS` disables that behavior, leaving preprocessor relevant flags in `CFLAGS` and `CXXFLAGS`. +Setting `DISABLE_CPPFLAGS` disables that behavior, leaving preprocessor relevant flags in `CFLAGS` and `CXXFLAGS`. This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. From d87f555b8dbbe6775a1fe79f1609b10db368cb64 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 2 Jul 2024 15:37:11 -0400 Subject: [PATCH 09/32] change NO_* to DISABLE_* --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 81e79163..79709803 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -15,8 +15,8 @@ vcpkg_make_configure( [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] [DISABLE_CPPFLAGS] - [NO_DEFAULT_OPTIONS] - [NO_MSVC_FLAG_ESCAPING] + [DISABLE_DEFAULT_OPTIONS] + [DISABLE_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] [SOURCE_PATH ] [OPTIONS ...] @@ -54,7 +54,7 @@ By default, `vcpkg_make_configure` supplies wrappers that translate and reorder Setting `DISABLE_MSVC_WRAPPERS` removes these wrappers and allows the underlying make build system to supply 'msvc-style' flags directly without translation. When this option is enabled, the `cl` and `windres` tools will directly interpret command-line flags without any modifications. -### NO_MSVC_FLAG_ESCAPING +### DISABLE_MSVC_FLAG_ESCAPING By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. When you set `NO_MSVC_FeLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: @@ -75,7 +75,7 @@ Setting `DISABLE_CPPFLAGS` disables that behavior, leaving preprocessor relevant This can be useful for projects that do not use standard environment variables or have specific preprocessor requirements. -### NO_DEFAULT_OPTIONS +### DISABLE_DEFAULT_OPTIONS Setting this flag disables the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line. From 81c01c85ab4ea345c42bcca5ccfd7a9fc7c0c657 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 2 Jul 2024 15:43:25 -0400 Subject: [PATCH 10/32] change NO_* to DISABLE_* in vcpkg_make_install --- vcpkg/maintainers/functions/vcpkg_make_install.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 106dd09a..0469b5a6 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -12,8 +12,8 @@ Build and install a Make-based project. ```cmake vcpkg_make_install( [DISABLE_PARALLEL] - [NO_DESTDIR] - [NO_MSVC_FLAG_ESCAPING] + [DISABLE_DESTDIR] + [DISABLE_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] [LOGFILE_ROOT ] [SUBPATH ] @@ -46,11 +46,11 @@ Adds the configure dependent `(debug/)bin` directory to the system path. This is By default, `vcpkg_make_install` will run make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This will cause make to be executed without the -j option, running build steps sequentially. -### NO_DESTDIR +### DISABLE_DESTDIR By default, `make install` will use the `DESTDIR` variable to redirect installation to the package directory. Use this flag if `DESTDIR` should not be set. -### NO_MSVC_FLAG_ESCAPING +### DISABLE_MSVC_FLAG_ESCAPING Prevents escaping of MSVC flags. Use this if the project's makefiles do not expect escaped flags. From 3abe74eab6368564c7f8f0fa987eeb9ef61f6acc Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Wed, 3 Jul 2024 13:33:22 -0400 Subject: [PATCH 11/32] respond to feedback --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 79709803..39ce799e 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -50,20 +50,18 @@ If specified, the source directory will be copied to the build directory before ### DISABLE_MSVC_WRAPPERS -By default, `vcpkg_make_configure` supplies wrappers that translate and reorder 'unix / gcc-style' flags into 'msvc-style' flags. This accommodates build systems that assume unix or gcc conventions. +By default, `vcpkg_make_configure` supplies wrappers that translate and reorder 'Unix / GCC-style' flags into 'MSVC-style' flags. This accommodates build systems that assume Unix or GCC conventions. -Setting `DISABLE_MSVC_WRAPPERS` removes these wrappers and allows the underlying make build system to supply 'msvc-style' flags directly without translation. When this option is enabled, the `cl` and `windres` tools will directly interpret command-line flags without any modifications. +Setting `DISABLE_MSVC_WRAPPERS` disables translation of flags, allowing tools like `cl` and `windres` to receive command-line flags without modifications. ### DISABLE_MSVC_FLAG_ESCAPING -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. -When you set `NO_MSVC_FeLAG_ESCAPING`, you tell vcpkg not to perform this automatic escaping. This can be useful in situations where: +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. Setting `DISABLE_MSVC_FLAG_ESCAPING` disables this behavior. -- You know your flags are formatted correctly: If you're confident that your compiler and linker flags don't contain problematic characters, you can avoid unnecessary escaping. -- You're using custom build scripts: If you have custom build scripts or tools that require specific flag formatting, disabling automatic escaping might be necessary for compatibility. +This can be useful in situations where you're using custom build scripts or tools that require specific flag formatting. >[!NOTE] ->If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`NO_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. +>If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`DISABLE_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. ### DSIABLE_CPPFLAGS From e0bf7d7ef3364040eb29dee73674ea2715d05346 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 16:08:33 -0500 Subject: [PATCH 12/32] fix typic in DISABLE_CPPFLAGS --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 39ce799e..fbc07e93 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -63,7 +63,7 @@ This can be useful in situations where you're using custom build scripts or tool >[!NOTE] >If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`DISABLE_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. -### DSIABLE_CPPFLAGS +### DISABLE_CPPFLAGS Disables the extraction of C preprocessor flags (`-D` and `-isystem`) from `CFLAGS` and `CXXFLAGS` into `CPPFLAGS`. From 7d606da48b93f96e8169eee2cc827b5e5274f5ec Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 16:16:28 -0500 Subject: [PATCH 13/32] Assure -> Ensure --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index fbc07e93..71434991 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -90,7 +90,7 @@ Installation Directories: Platform-Specific Tweaks: * On Windows: Ensures compatibility with Windows-specific filesystem and library behaviors. -* On Unix-like systems: Assures the script accommodates the typical filesystem layout and toolchain behaviors. +* On Unix-like systems: Ensures the script accommodates the typical filesystem layout and toolchain behaviors. Removing these defaults gives you the responsibility to specify all necessary configuration options manually, ensuring the project is correctly configured for building with vcpkg. From a7ffd4942b28ff9971594f8ffc597bec2eb0d413 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 16:44:57 -0500 Subject: [PATCH 14/32] Add specificity to NO_DEFAULT_OPTIONS --- .../maintainers/functions/vcpkg_make_configure.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 71434991..c44b4797 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -75,7 +75,7 @@ This can be useful for projects that do not use standard environment variables o ### DISABLE_DEFAULT_OPTIONS -Setting this flag disables the following default configure options provided by `vcpkg_make_configure`. Use this flag if you need full control over the configure command line. +Setting this flag disables the following default configure options provided by `vcpkg_make_configure`. Use this flag only if you need complete control over the configure command line and want to specify all options manually. General Defaults: * --disable-silent-rules - Makes the build process output more verbose. @@ -87,12 +87,19 @@ Library Linkage: Installation Directories: * Adjusts standard directories (bin, lib, share, etc.) to conform with vcpkg's layout, ensuring correct installation paths. + - `--prefix`: The base installation directory, adjusted per build type (release or debug). + - `--bindir`, `--sbindir`, `--libdir`, `--includedir` (if debug), `--mandir`, `--docdir`, `--datarootdir`: Subdirectories under the prefix, for different types of files. Platform-Specific Tweaks: -* On Windows: Ensures compatibility with Windows-specific filesystem and library behaviors. -* On Unix-like systems: Ensures the script accommodates the typical filesystem layout and toolchain behaviors. +* On Windows + - Sets `gl_cv_double_slash_root=yes` to signal to the configure script that it is running on Windows, where paths can begin with double slashes (//). + - Sets `ac_cv_func_memmove=yes` and `ac_cv_func_memset=yes` to indicate that the `memmove` and `memset` functions are available. + - sets `gl_cv_host_cpu_c_abi=no` on ARM64 builds to indicate that the compiler does not use the standard C ABI for floating-point numbers. -Removing these defaults gives you the responsibility to specify all necessary configuration options manually, ensuring the project is correctly configured for building with vcpkg. +* On Unix-like systems: + - Adjusts paths to match the typical Unix filesystem hierarchy (e.g., using /usr/local). + +>[!NOTE]These default options streamline the configuration process for most projects. If you need a highly customized build, you can set `DISABLE_DEFAULT_OPTIONS` and manually provide all the necessary configuration options. ### USE_RESPONSE_FILES From 6bc56cfa805f3755837ae40ca99e4ea46fcf3b94 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 17:06:06 -0500 Subject: [PATCH 15/32] list out flags in NO_DEFAULT_OPTIONS explanation --- .../functions/vcpkg_make_configure.md | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index c44b4797..b4ec3137 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -86,9 +86,40 @@ Library Linkage: * For static library builds: --disable-shared and --enable-static Installation Directories: -* Adjusts standard directories (bin, lib, share, etc.) to conform with vcpkg's layout, ensuring correct installation paths. - - `--prefix`: The base installation directory, adjusted per build type (release or debug). - - `--bindir`, `--sbindir`, `--libdir`, `--includedir` (if debug), `--mandir`, `--docdir`, `--datarootdir`: Subdirectories under the prefix, for different types of files. +* Adjusts standard directories (bin, lib, share, etc.) to conform with vcpkg's layout. + +Always Set: + - `--prefix` : The base installation directory, adjusted per build type (release or debug). + - `--bindir` : Subdirectory under the prefix for executable programs + - `--sbindir`: Subdirectory under the prefix for system administration programs + - `--libdir` : Subdirectory under the prefix for libraries (shared or static) + - `--mandir` : Subdirectory under the prefix for manual pages (man files) + - `--docdir` : Subdirectory under the prefix for documentation + - `--datarootdir` : Subdirectory under the prefix for architecture-independent data + +Debug builds only: + - `--includedir` : Subdirectory under the prefix for header files + +Example Paths: +* Release Configuration: + - `--prefix=${current_installed_dir_msys}` + - `--bindir=${prefix}/tools/${PORT}/bin` + - `--sbindir=${prefix}/tools/${PORT}/sbin` + - `--libdir=${prefix}/lib` + - `--mandir=${prefix}/share/${PORT}` + - `--docdir=${prefix}/share/${PORT}` + - `--datarootdir=${prefix}/share/${PORT}` + +* Debug Configuration: + - `--prefix=${current_installed_dir_msys}${path_suffix_DEBUG}` + - `--bindir=${prefix}/../tools/${PORT}${path_suffix_DEBUG}/bin` + - `--sbindir=${prefix}/../tools/${PORT}${path_suffix_DEBUG}/sbin` + - `--libdir=${prefix}/lib` + - `--includedir=${prefix}/../include` + - `--mandir=${prefix}/share/${PORT}` + - `--docdir=${prefix}/share/${PORT}` + - `--datarootdir=${prefix}/share/${PORT}` + Platform-Specific Tweaks: * On Windows From ad1d50364f4f578106280c9a0a7529909183c5f0 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 17:08:09 -0500 Subject: [PATCH 16/32] format --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index b4ec3137..0138bc32 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -87,8 +87,7 @@ Library Linkage: Installation Directories: * Adjusts standard directories (bin, lib, share, etc.) to conform with vcpkg's layout. - -Always Set: +* Always Set: - `--prefix` : The base installation directory, adjusted per build type (release or debug). - `--bindir` : Subdirectory under the prefix for executable programs - `--sbindir`: Subdirectory under the prefix for system administration programs @@ -96,8 +95,7 @@ Always Set: - `--mandir` : Subdirectory under the prefix for manual pages (man files) - `--docdir` : Subdirectory under the prefix for documentation - `--datarootdir` : Subdirectory under the prefix for architecture-independent data - -Debug builds only: +* Debug builds only: - `--includedir` : Subdirectory under the prefix for header files Example Paths: From 0f4fa4c65272e2125c19aba82bc5f72ad01b2ed0 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 17:56:07 -0500 Subject: [PATCH 17/32] 'vcpkg integrated' -> 'shared' --- vcpkg/maintainers/functions/vcpkg_make_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 0469b5a6..65a63ee5 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -40,7 +40,7 @@ To use this function, you must depend on the helper port `vcpkg-make`: ### ADD_BIN_TO_PATH -Adds the configure dependent `(debug/)bin` directory to the system path. This is useful if configure builds and runs executables with vcpkg integrated dependencies. +Adds the configure dependent `(debug/)bin` directory to the system path. This is useful if configure builds and runs executables with shared dependencies. ### DISABLE_PARALLEL From b92281b29224a5d543b49218c1927b54383f09cb Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Sat, 20 Jul 2024 18:06:55 -0500 Subject: [PATCH 18/32] add example to PRE_CONFIGURE_CMAKE_COMMANDS --- .../functions/vcpkg_make_configure.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 0138bc32..2c301a61 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -167,6 +167,31 @@ Specifies a list of CMake commands to execute before the configure process for e >[!NOTE] > When the `COPY_SOURCE` option is not set, the CMake commands in `PRE_CONFIGURE_CMAKE_COMMANDS` will operate directly on the files in the original source directory. +Example + +```cmake +function(my_preconfigure_command SRC BUILD_TYPE) + # Each source directory gets different version.txt files + if(BUILD_TYPE STREQUAL "release") + file(WRITE "${SRC}/version.txt" "This is a release version!") + else() + file(WRITE "${SRC}/version.txt" "This is a debug version!") + endif() + # The environment variable has different values for each configuration + set(ENV{SPECIAL} "${BUILD_TYPE} is magic") +endfunction() + +vcpkg_make_configure( + # ... + PRE_CONFIGURE_CMAKE_COMMANDS my_preconfigure_command +) +``` + +In this example, `my_preconfigure_command` will be executed twice (for "Debug" and "Release" if `VCPKG_BUILD_TYPE` is not set): + +Debug build: It will create `version.txt` with the content "This is a debug version!" and set the environment variable `SPECIAL` to "Debug is magic." +Release build: It will create `version.txt` with the content "This is a release version!" and set the environment variable `SPECIAL` to "Release is magic." + ### LANGUAGES Specifies the programming languages your project uses. From bdfea26057a9fb4b773a9daeecf070f72dc0b13a Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 30 Jul 2024 13:45:43 -0400 Subject: [PATCH 19/32] expand on LANGUAGES and SUBPATH --- .../functions/vcpkg_make_configure.md | 17 +++++++++++++++-- .../maintainers/functions/vcpkg_make_install.md | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 2c301a61..f62a7da8 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -18,7 +18,7 @@ vcpkg_make_configure( [DISABLE_DEFAULT_OPTIONS] [DISABLE_MSVC_FLAG_ESCAPING] [USE_RESPONSE_FILES] - [SOURCE_PATH ] + SOURCE_PATH [OPTIONS ...] [OPTIONS_RELEASE ...] [OPTIONS_DEBUG ...] @@ -194,7 +194,20 @@ Release build: It will create `version.txt` with the content "This is a release ### LANGUAGES -Specifies the programming languages your project uses. +The `LANGUAGES` argument specifies the programming languages to be considered during the configuration and build process. + +Valid values are `C`, `CXX`, `ASM`, `CUDA`, `Fortran`, `HIP`, `ISPC`, `Swift`, `OBJC`, `OBJCXX`. + +Appends the specified languages to `VCPKG_CMAKE_CONFIGURE_OPTIONS` as `-DVCPKG_LANGUAGES=`. `vcpkg_cmake_get_vars` uses the options stored in `VCPKG_CMAKE_CONFIGURE_OPTIONS`, including the `LANGUAGES` argument, to configure a dummy CMake project and extract the necessary CMake variables. The `LANGUAGES` argument affects the configuration of the dummy CMake project used in `vcpkg_cmake_get_vars`. +The configuration extracts relevant CMake variables for the specified languages and re-exports them as `VCPKG_DETECTED_CMAKE_*`. + +See, +```cmake +vcpkg_make_configure( + SOURCE_PATH "/path/to/source" + LANGUAGES "C;CXX;Fortran" +) +``` ## Examples diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 65a63ee5..92681f31 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -64,7 +64,7 @@ Specifies the base name for log files generated by the build. Defaults to "make" ### SUBPATH -Specifies a sub-directory within the source tree where the makefile is located or where the build should be executed. +Specifies a sub-directory within the working directory where the makefile is located or where the build should be executed. If not set, it defaults to an empty string, meaning the build is executed directly in the working directory. ### MAKEFILE From 39d00af9c82758dae2b04c786a9c9e1a68c9d2fd Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 5 Aug 2024 11:59:06 -0400 Subject: [PATCH 20/32] remove response files --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 9 --------- vcpkg/maintainers/functions/vcpkg_make_install.md | 7 +------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index f62a7da8..ec7b3701 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -17,7 +17,6 @@ vcpkg_make_configure( [DISABLE_CPPFLAGS] [DISABLE_DEFAULT_OPTIONS] [DISABLE_MSVC_FLAG_ESCAPING] - [USE_RESPONSE_FILES] SOURCE_PATH [OPTIONS ...] [OPTIONS_RELEASE ...] @@ -130,14 +129,6 @@ Platform-Specific Tweaks: >[!NOTE]These default options streamline the configuration process for most projects. If you need a highly customized build, you can set `DISABLE_DEFAULT_OPTIONS` and manually provide all the necessary configuration options. -### USE_RESPONSE_FILES - -Enables the use of response files to pass arguments to the linker. - -If set, the code generates response files for the linker flags (`CPPFLAGS`, `CFLAGS`, `CXXFLAGS`, `LDFLAGS`) and passes the response file path to the linker instead of the individual flags. If it's false, the flags are passed directly. - -This can be helpful when dealing with long command lines that exceed the maximum allowed length. - ### SOURCE_PATH The directory containing the project's source files diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 92681f31..882f0164 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -14,7 +14,6 @@ vcpkg_make_install( [DISABLE_PARALLEL] [DISABLE_DESTDIR] [DISABLE_MSVC_FLAG_ESCAPING] - [USE_RESPONSE_FILES] [LOGFILE_ROOT ] [SUBPATH ] [MAKEFILE ] @@ -52,11 +51,7 @@ By default, `make install` will use the `DESTDIR` variable to redirect installat ### DISABLE_MSVC_FLAG_ESCAPING -Prevents escaping of MSVC flags. Use this if the project's makefiles do not expect escaped flags. - -### USE_RESPONSE_FILES - -Enables the use of response files for passing arguments to `make`, circumventing command line length limits on some platforms. +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. ### LOGFILE_ROOT From 016dbd76fbd95c192ffdd9da9134387f887e22e6 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 5 Aug 2024 12:00:14 -0400 Subject: [PATCH 21/32] SOURCE_PATH is not optional --- .../maintainers/functions/vcpkg_make_configure.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index ec7b3701..882ea5a3 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -11,13 +11,13 @@ Configure a Make-based project. ```cmake vcpkg_make_configure( + SOURCE_PATH [AUTOCONFIG] [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] [DISABLE_CPPFLAGS] [DISABLE_DEFAULT_OPTIONS] [DISABLE_MSVC_FLAG_ESCAPING] - SOURCE_PATH [OPTIONS ...] [OPTIONS_RELEASE ...] [OPTIONS_DEBUG ...] @@ -39,6 +39,12 @@ To use this function, you must depend on the helper port `vcpkg-make`: ## Parameters +### SOURCE_PATH + +The directory containing the project's source files + +This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). + ### AUTOCONFIG Runs autoreconf when set. @@ -129,12 +135,6 @@ Platform-Specific Tweaks: >[!NOTE]These default options streamline the configuration process for most projects. If you need a highly customized build, you can set `DISABLE_DEFAULT_OPTIONS` and manually provide all the necessary configuration options. -### SOURCE_PATH - -The directory containing the project's source files - -This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). - ### OPTIONS Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. From 8e93d96270561c7bc261fb9dfebb77fa3099d3c5 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 5 Aug 2024 12:03:12 -0400 Subject: [PATCH 22/32] fix NOTE --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 882ea5a3..87c29bf3 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -133,7 +133,8 @@ Platform-Specific Tweaks: * On Unix-like systems: - Adjusts paths to match the typical Unix filesystem hierarchy (e.g., using /usr/local). ->[!NOTE]These default options streamline the configuration process for most projects. If you need a highly customized build, you can set `DISABLE_DEFAULT_OPTIONS` and manually provide all the necessary configuration options. +>[!NOTE] +> These default options streamline the configuration process for most projects. If you need a highly customized build, you can set `DISABLE_DEFAULT_OPTIONS` and manually provide all the necessary configuration options. ### OPTIONS From 00fbb249c099b0d419747120cf4b9f38d9fdec03 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Mon, 5 Aug 2024 13:20:48 -0400 Subject: [PATCH 23/32] remove SHELL argument --- vcpkg/maintainers/functions/vcpkg_make_install.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 882f0164..fae60596 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -69,10 +69,6 @@ Specifies the name of the makefile to use. Defaults to "Makefile". Specifies the targets to pass to make. Defaults to "all;install". -### SHELL - -Specifies the shell to use for running `make`. Useful for environments where the default shell might not be compatible with the makefiles. - ### OPTIONS Additional options to pass to `make` during the build. From 053c0b503825c00c7abf5599fa4ebeb8628b2cd1 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Thu, 8 Aug 2024 00:27:33 -0700 Subject: [PATCH 24/32] Update vcpkg/maintainers/functions/vcpkg_make_configure.md --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 87c29bf3..799a1279 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -41,7 +41,7 @@ To use this function, you must depend on the helper port `vcpkg-make`: ### SOURCE_PATH -The directory containing the project's source files +The directory containing the project's source files. This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). From 5a1d5dcd2801a951627b13799121fc9ae086fb7d Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Thu, 8 Aug 2024 19:15:47 -0400 Subject: [PATCH 25/32] remove unused options --- .../functions/vcpkg_make_configure.md | 1 + .../maintainers/functions/vcpkg_make_install.md | 17 +---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 87c29bf3..cc48bc59 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -100,6 +100,7 @@ Installation Directories: - `--mandir` : Subdirectory under the prefix for manual pages (man files) - `--docdir` : Subdirectory under the prefix for documentation - `--datarootdir` : Subdirectory under the prefix for architecture-independent data + * Debug builds only: - `--includedir` : Subdirectory under the prefix for header files diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index fae60596..44b0042a 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -12,10 +12,7 @@ Build and install a Make-based project. ```cmake vcpkg_make_install( [DISABLE_PARALLEL] - [DISABLE_DESTDIR] - [DISABLE_MSVC_FLAG_ESCAPING] [LOGFILE_ROOT ] - [SUBPATH ] [MAKEFILE ] [TARGETS ...] [OPTIONS ...] @@ -43,24 +40,12 @@ Adds the configure dependent `(debug/)bin` directory to the system path. This is ### DISABLE_PARALLEL -By default, `vcpkg_make_install` will run make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This will cause make to be executed without the -j option, running build steps sequentially. - -### DISABLE_DESTDIR - -By default, `make install` will use the `DESTDIR` variable to redirect installation to the package directory. Use this flag if `DESTDIR` should not be set. - -### DISABLE_MSVC_FLAG_ESCAPING - -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. +By default, `vcpkg_make_install` will run make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This will cause `make` to be executed without the `-j` option, running build steps sequentially. ### LOGFILE_ROOT Specifies the base name for log files generated by the build. Defaults to "make". -### SUBPATH - -Specifies a sub-directory within the working directory where the makefile is located or where the build should be executed. If not set, it defaults to an empty string, meaning the build is executed directly in the working directory. - ### MAKEFILE Specifies the name of the makefile to use. Defaults to "Makefile". From 7b6ee0d502fd95b7101f719d9375cf208549ec4f Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Thu, 8 Aug 2024 19:17:59 -0400 Subject: [PATCH 26/32] remove unused space --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 1 - 1 file changed, 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index e7166177..35d59dbb 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -124,7 +124,6 @@ Example Paths: - `--docdir=${prefix}/share/${PORT}` - `--datarootdir=${prefix}/share/${PORT}` - Platform-Specific Tweaks: * On Windows - Sets `gl_cv_double_slash_root=yes` to signal to the configure script that it is running on Windows, where paths can begin with double slashes (//). From 53261e71cc4242889c789ba2c6e1a4ec4cf5c6ee Mon Sep 17 00:00:00 2001 From: Javier Matos Denizac Date: Mon, 19 Aug 2024 12:28:07 -0400 Subject: [PATCH 27/32] fix prefix --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 35d59dbb..e42195e9 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -106,7 +106,7 @@ Installation Directories: Example Paths: * Release Configuration: - - `--prefix=${current_installed_dir_msys}` + - `--prefix=${current_installed_dir}` - `--bindir=${prefix}/tools/${PORT}/bin` - `--sbindir=${prefix}/tools/${PORT}/sbin` - `--libdir=${prefix}/lib` @@ -115,7 +115,7 @@ Example Paths: - `--datarootdir=${prefix}/share/${PORT}` * Debug Configuration: - - `--prefix=${current_installed_dir_msys}${path_suffix_DEBUG}` + - `--prefix=${current_installed_dir}${path_suffix_DEBUG}` - `--bindir=${prefix}/../tools/${PORT}${path_suffix_DEBUG}/bin` - `--sbindir=${prefix}/../tools/${PORT}${path_suffix_DEBUG}/sbin` - `--libdir=${prefix}/lib` From 4c37196e5af3d6bc2b90602a64975b13562b00a2 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 24 Sep 2024 16:50:17 -0400 Subject: [PATCH 28/32] AUTOCONFIG -> AUTORECONF --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index e42195e9..ba7bf4e0 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -12,7 +12,7 @@ Configure a Make-based project. ```cmake vcpkg_make_configure( SOURCE_PATH - [AUTOCONFIG] + [AUTORECONF] [COPY_SOURCE] [DISABLE_MSVC_WRAPPERS] [DISABLE_CPPFLAGS] @@ -197,7 +197,7 @@ See, ```cmake vcpkg_make_configure( SOURCE_PATH "/path/to/source" - LANGUAGES "C;CXX;Fortran" + LANGUAGES "C" "CXX" "Fortran" ) ``` From c52333cb64bbb3294b3c1e0657efe3088d255b64 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 24 Sep 2024 16:50:52 -0400 Subject: [PATCH 29/32] rename header section too --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index ba7bf4e0..bdeaa04f 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -45,7 +45,7 @@ The directory containing the project's source files. This value is usually obtained as a result of calling a source acquisition command like [`vcpkg_from_github()`](vcpkg_from_github.md). -### AUTOCONFIG +### AUTORECONF Runs autoreconf when set. From 496e186dcfec3f9de9e5c9485db0027aafa7854a Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Thu, 26 Sep 2024 12:45:38 -0400 Subject: [PATCH 30/32] respond to victors review --- .../functions/vcpkg_make_configure.md | 25 +++++++++---------- .../functions/vcpkg_make_install.md | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index bdeaa04f..24dd0eb8 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -47,11 +47,11 @@ This value is usually obtained as a result of calling a source acquisition comma ### AUTORECONF -Runs autoreconf when set. +Runs `autoreconf` when set. ### COPY_SOURCE -If specified, the source directory will be copied to the build directory before the configuration process begins. Useful for projects that modify the source tree during configuration or build. +If specified, the source directory is copied to the build directory before the configuration process begins. Useful for projects that modify the source tree during configuration or build. ### DISABLE_MSVC_WRAPPERS @@ -61,7 +61,7 @@ Setting `DISABLE_MSVC_WRAPPERS` disables translation of flags, allowing tools li ### DISABLE_MSVC_FLAG_ESCAPING -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are intended for use by the wrappers and libtool to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. Setting `DISABLE_MSVC_FLAG_ESCAPING` disables this behavior. +By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are used by wrappers and `libtool` to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. Setting `DISABLE_MSVC_FLAG_ESCAPING` disables this behavior. This can be useful in situations where you're using custom build scripts or tools that require specific flag formatting. @@ -138,26 +138,24 @@ Platform-Specific Tweaks: ### OPTIONS -Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. +Additional options to pass to the configure script regardless of the configuration type (debug or release). Use these to specify any custom flags or settings required by the project. ### OPTIONS_RELEASE -Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. - +Additional options to pass to the configure script only during a release build. Use these to specify any custom flags or settings required by the project. These are in addition to `OPTIONS`. ### OPTIONS_DEBUG -Additional options to pass to the configure script. Use these to specify any custom flags or settings required by the project. - +Additional options to pass to the configure script only during a debug build. Use these to specify any custom flags or settings required by the project. These are in addition to `OPTIONS`. ### PRE_CONFIGURE_CMAKE_COMMANDS -Specifies a list of CMake commands to execute before the configure process for each build type. That is, if `VCPKG_BUILD_TYPE` is empty (the default), these commands will run once for debug and once for release. If `VCPKG_BUILD_TYPE` is `release`, these commands will only be once for release. This can be used to set up the environment or prepare the build in a way that the configure script requires. +Specifies a list of CMake commands to execute before the configure process for each build type. That is, if `VCPKG_BUILD_TYPE` is empty (the default), these commands are run once for debug and once for release. If `VCPKG_BUILD_TYPE` is `release`, these commands are only run once for release. This can be used to set up the environment or prepare the build in a way that the configure script requires. >[!NOTE] -> When the `COPY_SOURCE` option is not set, the CMake commands in `PRE_CONFIGURE_CMAKE_COMMANDS` will operate directly on the files in the original source directory. +> When the `COPY_SOURCE` option is not set, the CMake commands in `PRE_CONFIGURE_CMAKE_COMMANDS` operate directly on the files in the original source directory. Example @@ -179,10 +177,11 @@ vcpkg_make_configure( ) ``` -In this example, `my_preconfigure_command` will be executed twice (for "Debug" and "Release" if `VCPKG_BUILD_TYPE` is not set): +In this example, `my_preconfigure_command` are executed twice (for "Debug" and "Release" if `VCPKG_BUILD_TYPE` is not set): + +Debug build: Creates `version.txt` with the content "This is a debug version!" and sets the environment variable `SPECIAL` to "Debug is magic." -Debug build: It will create `version.txt` with the content "This is a debug version!" and set the environment variable `SPECIAL` to "Debug is magic." -Release build: It will create `version.txt` with the content "This is a release version!" and set the environment variable `SPECIAL` to "Release is magic." +Release build: Creates `version.txt` with the content "This is a release version!" and sets the environment variable `SPECIAL` to "Release is magic." ### LANGUAGES diff --git a/vcpkg/maintainers/functions/vcpkg_make_install.md b/vcpkg/maintainers/functions/vcpkg_make_install.md index 44b0042a..a37636a3 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_install.md +++ b/vcpkg/maintainers/functions/vcpkg_make_install.md @@ -40,7 +40,7 @@ Adds the configure dependent `(debug/)bin` directory to the system path. This is ### DISABLE_PARALLEL -By default, `vcpkg_make_install` will run make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This will cause `make` to be executed without the `-j` option, running build steps sequentially. +By default, `vcpkg_make_install` runs make with the `-j` option to enable parallel building. If your project does not support parallel builds or you encounter issues with it, set this flag to disable parallel building. This causes `make` to be executed without the `-j` option, running build steps sequentially. ### LOGFILE_ROOT From 955f5ea37b4855cde5b52331c239634eeee371ec Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 22 Oct 2024 14:26:28 -0700 Subject: [PATCH 31/32] update DISABLE_MSVC_TRANSFORMATIONS description --- .../functions/vcpkg_make_configure.md | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 24dd0eb8..91231c0d 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -59,14 +59,34 @@ By default, `vcpkg_make_configure` supplies wrappers that translate and reorder Setting `DISABLE_MSVC_WRAPPERS` disables translation of flags, allowing tools like `cl` and `windres` to receive command-line flags without modifications. -### DISABLE_MSVC_FLAG_ESCAPING +### DISABLE_MSVC_TRANSFORMATIONS -By default, escape characters (e.g., -Xcompiler, -Xlinker) are added before compiler and linker flags when using MSVC. These escape characters are used by wrappers and `libtool` to protect flags that might contain spaces, quotes, or other special characters from being misinterpreted. Setting `DISABLE_MSVC_FLAG_ESCAPING` disables this behavior. +By default, when using `MSVC`, libraries and flags are transformed to fit Unix-style conventions. This is necessary for compatibility with Unix-based build tools, such as `libtool`, and because `MSVC` is invoked via wrappers in cross-platform environments. These wrappers (like the `ar-lib` and `compile` scripts) ensure that `MSVC` behaves more like a Unix compiler, simplifying the build process and making it compatible with Unix-centric tools. -This can be useful in situations where you're using custom build scripts or tools that require specific flag formatting. +Library Transformation: +- Libraries like `libexample.lib` are transformed into linker-friendly flags by adding a `-l` prefix and stripping the extension (e.g., `libexample.lib` becomes `-llibexample`). + +Flag Handling: +- Escape characters (such as `-Xcompiler` and `-Xlinker`) are added before compiler and linker flags (e.g., `-O2` becomes `-Xcompiler -O2`). These escape characters ensure proper handling by tools like `libtool`, which may otherwise misinterpret flags that include special characters or spaces. + +When `DISABLE_MSVC_TRANSFORMATIONS` is set, the default transformations are disabled, and libraries and flags are passed in their original form to MSVC. + +Example (Default Behavior): + +``` +libexample.lib → -llibexample +-O2 → -Xcompiler -O2 +``` + +Example (`DISABLE_MSVC_TRANSFORMATIONS`): + +``` +libexample.lib → libexample.lib +-O2 → -O2 +``` >[!NOTE] ->If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`DISABLE_MSVC_FLAG_ESCAPING`) has no effect because the escape characters are not added in the first place. +>If you disable the MSVC wrappers using `DISABLE_MSVC_WRAPPERS`, this option (`DISABLE_MSVC_TRANSFORMATIONS`) has no effect. ### DISABLE_CPPFLAGS From 00bba6ee50aabc3cee2a7d391d4cd5bf90063ad4 Mon Sep 17 00:00:00 2001 From: Javier Matos Date: Tue, 22 Oct 2024 14:26:54 -0700 Subject: [PATCH 32/32] update usage --- vcpkg/maintainers/functions/vcpkg_make_configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg/maintainers/functions/vcpkg_make_configure.md b/vcpkg/maintainers/functions/vcpkg_make_configure.md index 91231c0d..6e8daafb 100644 --- a/vcpkg/maintainers/functions/vcpkg_make_configure.md +++ b/vcpkg/maintainers/functions/vcpkg_make_configure.md @@ -17,7 +17,7 @@ vcpkg_make_configure( [DISABLE_MSVC_WRAPPERS] [DISABLE_CPPFLAGS] [DISABLE_DEFAULT_OPTIONS] - [DISABLE_MSVC_FLAG_ESCAPING] + [DISABLE_MSVC_TRANSFORMATIONS] [OPTIONS ...] [OPTIONS_RELEASE ...] [OPTIONS_DEBUG ...]