Skip to content

Commit

Permalink
Merge branch 'jb50531' into 'master'
Browse files Browse the repository at this point in the history
[cmake] Allow to control the file API path. JB#50531

See merge request mer-core/cmake!13
  • Loading branch information
Matti Kosola committed Mar 29, 2021
2 parents 9e31790 + 4588b0c commit cb2decc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rpm/0002-cmFileAPI-Allow-to-control-the-file-API-path.patch
@@ -0,0 +1,32 @@
From 06455df67e65df50c2eabb1ae81e57f63d037aea Mon Sep 17 00:00:00 2001
From: Martin Kampas <martin.kampas@jolla.com>
Date: Fri, 26 Mar 2021 12:05:58 +0100
Subject: [PATCH] cmFileAPI: Allow to control the file API path

Allow postprocessing of the reply before the IDE gets to it.
---
Source/cmFileAPI.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
index c2ab2f10b0..1903c93332 100644
--- a/Source/cmFileAPI.cxx
+++ b/Source/cmFileAPI.cxx
@@ -27,8 +27,13 @@
cmFileAPI::cmFileAPI(cmake* cm)
: CMakeInstance(cm)
{
+ std::string prefix;
+ cmSystemTools::GetEnv("CMAKE_FILE_API_PREFIX", prefix);
+ if (prefix.empty())
+ prefix = ".cmake";
+
this->APIv1 =
- this->CMakeInstance->GetHomeOutputDirectory() + "/.cmake/api/v1";
+ this->CMakeInstance->GetHomeOutputDirectory() + "/" + prefix + "/api/v1";

Json::CharReaderBuilder rbuilder;
rbuilder["collectComments"] = false;
--
2.30.1

1 change: 1 addition & 0 deletions rpm/cmake.spec
Expand Up @@ -7,6 +7,7 @@ Url: http://www.cmake.org
Source0: %{name}-%{version}.tar.gz
Source1: macros.cmake
Patch0: 0001-Revert-Autogen-Reenable-passing-compiler-implicit-in.patch
Patch1: 0002-cmFileAPI-Allow-to-control-the-file-API-path.patch
BuildRequires: expat-devel
BuildRequires: bzip2-devel
BuildRequires: xz-devel
Expand Down

0 comments on commit cb2decc

Please sign in to comment.