summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmFindCommon.cxx10
-rw-r--r--Source/cmFindPackageCommand.cxx12
-rw-r--r--Source/cmMakefile.cxx9
-rw-r--r--Source/cmMakefile.h3
4 files changed, 19 insertions, 15 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 70c0f73..f4c0064 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -324,14 +324,10 @@ void cmFindCommon::AddUserPath(std::string const& p,
// it.
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_32;
cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_64;
- if(const char* psize =
- this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
+ if(this->Makefile->PlatformIs64Bit())
{
- if(atoi(psize) == 8)
- {
- view = cmSystemTools::KeyWOW64_64;
- other_view = cmSystemTools::KeyWOW64_32;
- }
+ view = cmSystemTools::KeyWOW64_64;
+ other_view = cmSystemTools::KeyWOW64_32;
}
// Expand using the view of the target application.
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index e7beb84..165dbc2 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -329,15 +329,11 @@ bool cmFindPackageCommand
this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE");
// Lookup whether lib64 paths should be used.
- if(const char* sizeof_dptr =
- this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
+ if(this->Makefile->PlatformIs64Bit() &&
+ this->Makefile->GetCMakeInstance()
+ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
{
- if(atoi(sizeof_dptr) == 8 &&
- this->Makefile->GetCMakeInstance()
- ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
- {
- this->UseLib64Paths = true;
- }
+ this->UseLib64Paths = true;
}
// Find the current root path mode.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e49ec3d..7aa1202 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2050,6 +2050,15 @@ bool cmMakefile::IsSet(const char* name) const
return true;
}
+bool cmMakefile::PlatformIs64Bit() const
+{
+ if(const char* sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P"))
+ {
+ return atoi(sizeof_dptr) == 8;
+ }
+ return false;
+}
+
bool cmMakefile::CanIWriteThisFile(const char* fileName)
{
if ( !this->IsOn("CMAKE_DISABLE_SOURCE_CHANGES") )
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ea9eb17..485d9e2 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -588,6 +588,9 @@ public:
bool IsOn(const char* name) const;
bool IsSet(const char* name) const;
+ /** Return whether the target platform is 64-bit. */
+ bool PlatformIs64Bit() const;
+
/**
* Get a list of preprocessor define flags.
*/