summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-09-21 15:38:59 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-09-21 16:11:00 (GMT)
commit59ad7a1c243022284f8475e0bebbe1864ee23928 (patch)
treee18411eb48077bc54128e29394474bce7a913c5b
parentedf67dd039f40a4222e41cc15a197cb6395bf885 (diff)
downloadCMake-59ad7a1c243022284f8475e0bebbe1864ee23928.zip
CMake-59ad7a1c243022284f8475e0bebbe1864ee23928.tar.gz
CMake-59ad7a1c243022284f8475e0bebbe1864ee23928.tar.bz2
Move helpers functions from cmStringAlgorithms.h to cmValue.h
Helpers functions related to cmValue semantic are now part of cmValue.h header.
-rw-r--r--Source/CTest/cmCTestGIT.cxx1
-rw-r--r--Source/CTest/cmCTestVC.cxx2
-rw-r--r--Source/cmAddLibraryCommand.cxx1
-rw-r--r--Source/cmComputeTargetDepends.cxx1
-rw-r--r--Source/cmFileInstaller.cxx1
-rw-r--r--Source/cmGlobalCommonGenerator.cxx1
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx1
-rw-r--r--Source/cmInstalledFile.cxx1
-rw-r--r--Source/cmOutputConverter.cxx1
-rw-r--r--Source/cmQtAutoGenerator.cxx1
-rw-r--r--Source/cmSiteNameCommand.cxx1
-rw-r--r--Source/cmStringAlgorithms.h78
-rw-r--r--Source/cmSystemTools.cxx1
-rw-r--r--Source/cmTest.cxx1
-rw-r--r--Source/cmValue.h78
-rw-r--r--Source/cmcmd.cxx1
16 files changed, 88 insertions, 83 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 568b091..d85edcc 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -18,6 +18,7 @@
#include "cmProcessTools.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
static unsigned int cmCTestGITVersion(unsigned int epic, unsigned int major,
unsigned int minor, unsigned int fix)
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 452d714..423b506 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -10,8 +10,8 @@
#include "cmsys/Process.h"
#include "cmCTest.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
#include "cmXMLWriter.h"
cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log)
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 92e04e4..a5d1f6a 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -12,6 +12,7 @@
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
+#include "cmValue.h"
bool cmAddLibraryCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index d85dea3..2f29610 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -22,7 +22,6 @@
#include "cmSourceFileLocationKind.h"
#include "cmState.h"
#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetDepend.h"
diff --git a/Source/cmFileInstaller.cxx b/Source/cmFileInstaller.cxx
index 0d8ba2d..9bfbd13 100644
--- a/Source/cmFileInstaller.cxx
+++ b/Source/cmFileInstaller.cxx
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
using namespace cmFSPermissions;
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 31ff52f..3ae66f0 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -14,7 +14,6 @@
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmake.h"
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index b408f72..23427a1 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -13,6 +13,7 @@
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
static void GetIncludes(cmMakefile& mf, const std::string& arg,
std::vector<std::string>& incs);
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 32395d1..0974eea 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -8,6 +8,7 @@
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
+#include "cmValue.h"
cmInstalledFile::cmInstalledFile() = default;
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 840fdb9..bda2fe5 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -12,6 +12,7 @@
#include "cmStateDirectory.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
namespace {
bool PathEqOrSubDir(std::string const& a, std::string const& b)
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 568926e..e5c7bda 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -9,6 +9,7 @@
#include "cmQtAutoGen.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
cmQtAutoGenerator::Logger::Logger()
{
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 34fdefe..61d1c30 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -7,7 +7,6 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index fd5febf..492e588 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -219,84 +219,6 @@ std::string cmWrap(char prefix, Range const& rng, char suffix,
sep);
}
-/**
- * Does a string indicates that CMake/CPack/CTest internally
- * forced this value. This is not the same as On, but this
- * may be considered as "internally switched on".
- */
-inline bool cmIsInternallyOn(cm::string_view val)
-{
- return cmValue::IsInternallyOn(val);
-}
-inline bool cmIsInternallyOn(const char* val)
-{
- return cmValue::IsInternallyOn(val);
-}
-inline bool cmIsInternallyOn(cmValue val)
-{
- return val.IsInternallyOn();
-}
-
-/** Check for non-empty Property/Variable value. */
-inline bool cmNonempty(cm::string_view val)
-{
- return !cmValue::IsEmpty(val);
-}
-inline bool cmNonempty(const char* val)
-{
- return !cmValue::IsEmpty(val);
-}
-inline bool cmNonempty(cmValue val)
-{
- return !val.IsEmpty();
-}
-
-/** Return true if value is NOTFOUND or ends in -NOTFOUND. */
-inline bool cmIsNOTFOUND(cm::string_view val)
-{
- return cmValue::IsNOTFOUND(val);
-}
-inline bool cmIsNOTFOUND(cmValue val)
-{
- return val.IsNOTFOUND();
-}
-
-/**
- * Does a string indicate a true or ON value? This is not the same as ifdef.
- */
-inline bool cmIsOn(cm::string_view val)
-{
- return cmValue::IsOn(val);
-}
-inline bool cmIsOn(const char* val)
-{
- return cmValue::IsOn(val);
-}
-inline bool cmIsOn(cmValue val)
-{
- return val.IsOn();
-}
-
-/**
- * Does a string indicate a false or off value ? Note that this is
- * not the same as !IsOn(...) because there are a number of
- * ambiguous values such as "/usr/local/bin" a path will result in
- * IsON and IsOff both returning false. Note that the special path
- * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
- */
-inline bool cmIsOff(cm::string_view val)
-{
- return cmValue::IsOff(val);
-}
-inline bool cmIsOff(const char* val)
-{
- return cmValue::IsOff(val);
-}
-inline bool cmIsOff(cmValue val)
-{
- return val.IsOff();
-}
-
/** Returns true if string @a str starts with the character @a prefix. */
inline bool cmHasPrefix(cm::string_view str, char prefix)
{
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 27cb90f..75a5a8d 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -25,6 +25,7 @@
#include "cmProcessOutput.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
+#include "cmValue.h"
#if !defined(CMAKE_BOOTSTRAP)
# include <cm3p/archive.h>
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 5618487..7c0f9e7 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -5,7 +5,6 @@
#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmState.h"
-#include "cmStringAlgorithms.h"
#include "cmValue.h"
cmTest::cmTest(cmMakefile* mf)
diff --git a/Source/cmValue.h b/Source/cmValue.h
index c79b997..f96d2f5 100644
--- a/Source/cmValue.h
+++ b/Source/cmValue.h
@@ -234,3 +234,81 @@ inline bool operator>=(cmValue l, std::nullptr_t) noexcept
{
return l.Compare(cmValue{}) >= 0;
}
+
+/**
+ * Does a string indicate a true or ON value? This is not the same as ifdef.
+ */
+inline bool cmIsOn(cm::string_view val)
+{
+ return cmValue::IsOn(val);
+}
+inline bool cmIsOn(const char* val)
+{
+ return cmValue::IsOn(val);
+}
+inline bool cmIsOn(cmValue val)
+{
+ return val.IsOn();
+}
+
+/**
+ * Does a string indicate a false or off value ? Note that this is
+ * not the same as !IsOn(...) because there are a number of
+ * ambiguous values such as "/usr/local/bin" a path will result in
+ * IsON and IsOff both returning false. Note that the special path
+ * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true.
+ */
+inline bool cmIsOff(cm::string_view val)
+{
+ return cmValue::IsOff(val);
+}
+inline bool cmIsOff(const char* val)
+{
+ return cmValue::IsOff(val);
+}
+inline bool cmIsOff(cmValue val)
+{
+ return val.IsOff();
+}
+
+/** Return true if value is NOTFOUND or ends in -NOTFOUND. */
+inline bool cmIsNOTFOUND(cm::string_view val)
+{
+ return cmValue::IsNOTFOUND(val);
+}
+inline bool cmIsNOTFOUND(cmValue val)
+{
+ return val.IsNOTFOUND();
+}
+
+/** Check for non-empty Property/Variable value. */
+inline bool cmNonempty(cm::string_view val)
+{
+ return !cmValue::IsEmpty(val);
+}
+inline bool cmNonempty(const char* val)
+{
+ return !cmValue::IsEmpty(val);
+}
+inline bool cmNonempty(cmValue val)
+{
+ return !val.IsEmpty();
+}
+
+/**
+ * Does a string indicates that CMake/CPack/CTest internally
+ * forced this value. This is not the same as On, but this
+ * may be considered as "internally switched on".
+ */
+inline bool cmIsInternallyOn(cm::string_view val)
+{
+ return cmValue::IsInternallyOn(val);
+}
+inline bool cmIsInternallyOn(const char* val)
+{
+ return cmValue::IsInternallyOn(val);
+}
+inline bool cmIsInternallyOn(cmValue val)
+{
+ return val.IsInternallyOn();
+}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 3e36f97..4eb98b9 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -23,6 +23,7 @@
#include "cmTransformDepfile.h"
#include "cmUVProcessChain.h"
#include "cmUtils.hxx"
+#include "cmValue.h"
#include "cmVersion.h"
#include "cmake.h"