vcpkg/docs/maintainers/vcpkg_configure_cmake.md
nicole mazzuca 0e1dc12185
[rollup] Rollup PR 2021-07-16 (#19001)
* [rollup:2021-07-16 1/7] PR #18201 (@JackBoosY)

[vcpkg-cmake] Add check for unused cmake variables

* [rollup:2021-07-16 2/7] PR #18397 (@strega-nil)

[vcpkg_list] add new function

* [rollup:2021-07-16 3/7] PR #18782 (@strega-nil)

[scripts-audit] vcpkg_build_ninja

* [rollup:2021-07-16 4/7] PR #18784 (@strega-nil)

[scripts-audit] vcpkg_minimum_required

* [rollup:2021-07-16 5/7] PR #18785 (@strega-nil)

[scripts-audit] vcpkg_replace_string

* [rollup:2021-07-16 6/7] PR #18786 (@strega-nil)

[scripts-audit] windows scripts

* [rollup:2021-07-16 7/7] PR #18945 (@strega-nil)

[many ports] remove deprecated vcpkg_check_features call [1/5]

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com>
2021-07-20 10:24:58 -07:00

2.8 KiB

vcpkg_configure_cmake

This function has been deprecated in favor of vcpkg_cmake_configure from the vcpkg-cmake port.

The latest version of this document lives in the vcpkg repo.

Configure CMake for Debug and Release builds of a project.

Usage

vcpkg_configure_cmake(
    SOURCE_PATH <${SOURCE_PATH}>
    [PREFER_NINJA]
    [DISABLE_PARALLEL_CONFIGURE]
    [NO_CHARSET_FLAG]
    [GENERATOR <"NMake Makefiles">]
    [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
    [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
    [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
    [MAYBE_UNUSED_VARIABLES <option-name>...]
)

Parameters

SOURCE_PATH

Specifies the directory containing the CMakeLists.txt. By convention, this is usually set in the portfile as the variable SOURCE_PATH.

PREFER_NINJA

Indicates that, when available, Vcpkg should use Ninja to perform the build. This should be specified unless the port is known to not work under Ninja.

DISABLE_PARALLEL_CONFIGURE

Disables running the CMake configure step in parallel. This is needed for libraries which write back into their source directory during configure.

This also disables CMAKE_DISABLE_SOURCE_CHANGES.

NO_CHARSET_FLAG

Disables passing utf-8 as the default character set to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.

This is needed for libraries that set their own source code's character set.

GENERATOR

Specifies the precise generator to use.

This is useful if some project-specific buildsystem has been wrapped in a cmake script that won't perform an actual build. If used for this purpose, it should be set to "NMake Makefiles".

OPTIONS

Additional options passed to CMake during the configuration.

OPTIONS_RELEASE

Additional options passed to CMake during the Release configuration. These are in addition to OPTIONS.

OPTIONS_DEBUG

Additional options passed to CMake during the Debug configuration. These are in addition to OPTIONS.

MAYBE_UNUSED_VARIABLES

Any CMake variables which are explicitly passed in, but which may not be used on all platforms.

LOGNAME

Name of the log to write the output of the configure call to.

Notes

This command supplies many common arguments to CMake. To see the full list, examine the source.

Examples

Source

scripts/cmake/vcpkg_configure_cmake.cmake