diff --git a/src/find-pypy.ts b/src/find-pypy.ts index 1008ed6ea..42c54bcd2 100644 --- a/src/find-pypy.ts +++ b/src/find-pypy.ts @@ -55,6 +55,12 @@ export async function findPyPyVersion( ); const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir); core.exportVariable('pythonLocation', pythonLocation); + // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython + core.exportVariable('Python_ROOT_DIR', pythonLocation); + // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2 + core.exportVariable('Python2_ROOT_DIR', pythonLocation); + // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3 + core.exportVariable('Python3_ROOT_DIR', pythonLocation); core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig'); core.addPath(pythonLocation); core.addPath(_binDir); diff --git a/src/find-python.ts b/src/find-python.ts index 0a3dde138..3fe741595 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -70,6 +70,12 @@ export async function useCpythonVersion( } core.exportVariable('pythonLocation', installDir); + // https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython + core.exportVariable('Python_ROOT_DIR', installDir); + // https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2 + core.exportVariable('Python2_ROOT_DIR', installDir); + // https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3 + core.exportVariable('Python3_ROOT_DIR', installDir); core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig'); if (IS_LINUX) {