Skip to main content

z_kmpkg_get_cmake_vars

warning

This is an internal helper function used internally to implement kmpkg. Behavior and arguments will change in breaking ways without notice. Do not use this function.

Runs a cmake configure with a dummy project to extract certain cmake variables

Usage

z_kmpkg_get_cmake_vars(<out-var>)

z_kmpkg_get_cmake_vars(cmake_vars_file) sets <out-var> to a path to a generated CMake file, with the detected CMAKE_* variables re-exported as KMPKG_DETECTED_*.

Notes

Avoid usage in portfiles.

All calls to z_kmpkg_get_cmake_vars will result in the same output file; the output file is not generated multiple times.

Examples

z_kmpkg_get_cmake_vars(cmake_vars_file)
include("${cmake_vars_file}")
message(STATUS "detected CXX flags: ${KMPKG_DETECTED_CXX_FLAGS}")

See also kmpkg_configure_make.

Source

scripts/cmake/z_kmpkg_get_cmake_vars.cmake