[Cmake-commits] CMake branch, next, updated. v3.1.0-2150-gd703c9b
Brad King
brad.king at kitware.com
Mon Jan 19 09:47:17 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via d703c9bdd288935967fb424535355b1c2cb2024e (commit)
via 98216ea8037650a284adcf4f7c314077ac3346a4 (commit)
from 50c85f8df978c864170024492e19ec68b73e631b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d703c9bdd288935967fb424535355b1c2cb2024e
commit d703c9bdd288935967fb424535355b1c2cb2024e
Merge: 50c85f8 98216ea
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 19 09:47:16 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 19 09:47:16 2015 -0500
Merge topic 'cdash_upload_file_mode' into next
98216ea8 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt'
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98216ea8037650a284adcf4f7c314077ac3346a4
commit 98216ea8037650a284adcf4f7c314077ac3346a4
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 16 15:35:36 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Jan 16 15:43:26 2015 -0500
cmake: Generate an internal 'Labels.json' file next to 'Labels.txt'
In each internal target directory we generate a "Labels.txt" file
containing labels for that target and its sources, but it uses an
internal format. In order to make the list of labels easier to
publish, use a json format and call it "Labels.json".
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 78bef91..4ce601d 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -500,7 +500,9 @@ add_library(CMakeLib ${SRCS})
target_link_libraries(CMakeLib cmsys
${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
- ${CMAKE_CURL_LIBRARIES} )
+ ${CMAKE_CURL_LIBRARIES}
+ cmjsoncpp
+ )
# On Apple we need CoreFoundation
if(APPLE)
@@ -584,7 +586,7 @@ set(CTEST_SRCS cmCTest.cxx
# Build CTestLib
add_library(CTestLib ${CTEST_SRCS})
-target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp)
+target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
#
# Sources for CPack
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d17710e..015e1dd 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -38,6 +38,8 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include <cmsys/MD5.h>
+# include "cm_jsoncpp_value.h"
+# include "cm_jsoncpp_writer.h"
#endif
#include <stdlib.h> // required for atof
@@ -2915,10 +2917,21 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
std::string dir = target->GetSupportDirectory();
std::string file = dir;
file += "/Labels.txt";
+ std::string json_file = dir + "/Labels.json";
+#ifdef CMAKE_BUILD_WITH_CMAKE
// Check whether labels are enabled for this target.
if(const char* value = target->GetProperty("LABELS"))
{
+ Json::Value lj_root(Json::objectValue);
+ Json::Value& lj_target =
+ lj_root["target"] = Json::objectValue;
+ lj_target["name"] = target->GetName();
+ Json::Value& lj_target_labels =
+ lj_target["labels"] = Json::arrayValue;
+ Json::Value& lj_sources =
+ lj_root["sources"] = Json::arrayValue;
+
cmSystemTools::MakeDirectory(dir.c_str());
cmGeneratedFileStream fout(file.c_str());
@@ -2933,6 +2946,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
li != labels.end(); ++li)
{
fout << " " << *li << "\n";
+ lj_target_labels.append(*li);
}
}
@@ -2958,23 +2972,33 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
{
continue;
}
+ Json::Value& lj_source = lj_sources.append(Json::objectValue);
cmSourceFile* sf = *si;
- fout << sf->GetFullPath() << "\n";
+ std::string const& sfp = sf->GetFullPath();
+ fout << sfp << "\n";
+ lj_source["file"] = sfp;
if(const char* svalue = sf->GetProperty("LABELS"))
{
labels.clear();
+ Json::Value& lj_source_labels =
+ lj_source["labels"] = Json::arrayValue;
cmSystemTools::ExpandListArgument(svalue, labels);
for(std::vector<std::string>::const_iterator li = labels.begin();
li != labels.end(); ++li)
{
fout << " " << *li << "\n";
+ lj_source_labels.append(*li);
}
}
}
+ cmGeneratedFileStream json_fout(json_file.c_str());
+ json_fout << lj_root;
}
else
+#endif
{
cmSystemTools::RemoveFile(file);
+ cmSystemTools::RemoveFile(json_file);
}
}
diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h
new file mode 100644
index 0000000..15e1088
--- /dev/null
+++ b/Utilities/cm_jsoncpp_value.h
@@ -0,0 +1,18 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_jsoncpp_value_h
+#define cm_jsoncpp_value_h
+
+/* Use the jsoncpp library configured for CMake. */
+#include <cmjsoncpp/include/json/value.h>
+
+#endif
diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h
new file mode 100644
index 0000000..c410369
--- /dev/null
+++ b/Utilities/cm_jsoncpp_writer.h
@@ -0,0 +1,18 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_jsoncpp_writer_h
+#define cm_jsoncpp_writer_h
+
+/* Use the jsoncpp library configured for CMake. */
+#include <cmjsoncpp/include/json/writer.h>
+
+#endif
-----------------------------------------------------------------------
Summary of changes:
Source/CMakeLists.txt | 6 +++--
Source/cmGlobalGenerator.cxx | 26 +++++++++++++++++++-
.../{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} | 6 ++---
.../{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} | 6 ++---
4 files changed, 35 insertions(+), 9 deletions(-)
copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} (86%)
copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} (86%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list