From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 964B9138359 for ; Sun, 30 Aug 2020 19:02:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 18CD9E0AF0; Sun, 30 Aug 2020 19:02:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F2D61E0AF0 for ; Sun, 30 Aug 2020 19:02:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AEFF9340DDF for ; Sun, 30 Aug 2020 19:02:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E442D33E for ; Sun, 30 Aug 2020 19:02:18 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1598808183.7c8eb2dee113a4770eb562ebcd5c8e08ef01c672.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 7c8eb2dee113a4770eb562ebcd5c8e08ef01c672 X-VCS-Branch: master Date: Sun, 30 Aug 2020 19:02:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e01bb0a8-7087-423a-9b5c-0a17faf13e3a X-Archives-Hash: f305ec1f13948ff0d96263fcc9f5cc02 commit: 7c8eb2dee113a4770eb562ebcd5c8e08ef01c672 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Aug 30 16:30:28 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sun Aug 30 17:23:03 2020 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=7c8eb2de cmake.eclass: cmake_run_in: New function Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 9f47538018..240ab87bf6 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -147,6 +147,22 @@ _cmake_check_build_dir() { einfo "Working in BUILD_DIR: \"$BUILD_DIR\"" } +# @FUNCTION: cmake_run_in +# @USAGE: +# @DESCRIPTION: +# Set the desired working dir for a function or command. +cmake_run_in() { + if [[ -z ${2} ]]; then + die "${FUNCNAME[0]} must be passed at least two arguments" + fi + + [[ -e ${1} ]] || die "${FUNCNAME[0]}: Nonexistent path: ${1}" + + pushd ${1} > /dev/null || die + "${@:2}" + popd > /dev/null || die +} + # @FUNCTION: cmake_comment_add_subdirectory # @USAGE: # @DESCRIPTION: