summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-18 19:28:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-19 13:40:58 (GMT)
commita49751fb2eed0ca6415b243c35b23201b8060597 (patch)
treea96a9932ebefd4fb254ac2c769bee78fc6aefdb9 /Source/cmCoreTryCompile.cxx
parent0060391dffe824526b1f359db79c66c55e53d0c5 (diff)
downloadCMake-a49751fb2eed0ca6415b243c35b23201b8060597.zip
CMake-a49751fb2eed0ca6415b243c35b23201b8060597.tar.gz
CMake-a49751fb2eed0ca6415b243c35b23201b8060597.tar.bz2
cmState: Move TargetType enum to separate namespace
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index a409d40..cafba86 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -43,24 +43,25 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// which signature were we called with ?
this->SrcFileSignature = true;
- cmState::TargetType targetType = cmState::EXECUTABLE;
+ cmStateEnums::TargetType targetType = cmStateEnums::EXECUTABLE;
const char* tt =
this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_TARGET_TYPE");
if (!isTryRun && tt && *tt) {
- if (strcmp(tt, cmState::GetTargetTypeName(cmState::EXECUTABLE)) == 0) {
- targetType = cmState::EXECUTABLE;
+ if (strcmp(tt, cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) ==
+ 0) {
+ targetType = cmStateEnums::EXECUTABLE;
} else if (strcmp(tt, cmState::GetTargetTypeName(
- cmState::STATIC_LIBRARY)) == 0) {
- targetType = cmState::STATIC_LIBRARY;
+ cmStateEnums::STATIC_LIBRARY)) == 0) {
+ targetType = cmStateEnums::STATIC_LIBRARY;
} else {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR, std::string("Invalid value '") + tt +
"' for "
"CMAKE_TRY_COMPILE_TARGET_TYPE. Only "
"'" +
- cmState::GetTargetTypeName(cmState::EXECUTABLE) + "' and "
- "'" +
- cmState::GetTargetTypeName(cmState::STATIC_LIBRARY) +
+ cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) + "' and "
+ "'" +
+ cmState::GetTargetTypeName(cmStateEnums::STATIC_LIBRARY) +
"' "
"are allowed.");
return -1;
@@ -122,12 +123,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
if (cmTarget* tgt = this->Makefile->FindTargetToUse(argv[i])) {
switch (tgt->GetType()) {
- case cmState::SHARED_LIBRARY:
- case cmState::STATIC_LIBRARY:
- case cmState::INTERFACE_LIBRARY:
- case cmState::UNKNOWN_LIBRARY:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::STATIC_LIBRARY:
+ case cmStateEnums::INTERFACE_LIBRARY:
+ case cmStateEnums::UNKNOWN_LIBRARY:
break;
- case cmState::EXECUTABLE:
+ case cmStateEnums::EXECUTABLE:
if (tgt->IsExecutableWithExports()) {
break;
}
@@ -481,13 +482,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
? "NEW"
: "OLD");
- if (targetType == cmState::EXECUTABLE) {
+ if (targetType == cmStateEnums::EXECUTABLE) {
/* Put the executable at a known location (for COPY_FILE). */
fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
this->BinaryDirectory.c_str());
/* Create the actual executable. */
fprintf(fout, "add_executable(%s", targetName.c_str());
- } else // if (targetType == cmState::STATIC_LIBRARY)
+ } else // if (targetType == cmStateEnums::STATIC_LIBRARY)
{
/* Put the static library at a known location (for COPY_FILE). */
fprintf(fout, "set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY \"%s\")\n",
@@ -627,16 +628,16 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
- cmState::TargetType targetType)
+ cmStateEnums::TargetType targetType)
{
this->FindErrorMessage = "";
this->OutputFile = "";
std::string tmpOutputFile = "/";
- if (targetType == cmState::EXECUTABLE) {
+ if (targetType == cmStateEnums::EXECUTABLE) {
tmpOutputFile += targetName;
tmpOutputFile +=
this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
- } else // if (targetType == cmState::STATIC_LIBRARY)
+ } else // if (targetType == cmStateEnums::STATIC_LIBRARY)
{
tmpOutputFile +=
this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX");