The latest version of this document lives in the vcpkg repo.
Runs a cmake configure with a dummy project to extract certain cmake variables
vcpkg_cmake_get_vars(<out-var>)
vcpkg_cmake_get_vars(<out-var>)
sets <out-var>
to
a path to a generated CMake file, with the detected CMAKE_*
variables
re-exported as VCPKG_DETECTED_CMAKE_*
.
Avoid usage in portfiles.
All calls to vcpkg_cmake_get_vars
will result in the same output file;
the output file is not generated multiple times.
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
message(STATUS "detected CXX flags: ${VCPKG_DETECTED_CMAKE_CXX_FLAGS}")