-@@ -95,3 +95,4 @@
-
- # Enable use of lib64 search path variants by default.
- set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
-+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)
-diff -urN cmake-3.1.3/Source/cmExportInstallFileGenerator.cxx cmake-3.1.3.x32/Source/cmExportInstallFileGenerator.cxx
---- cmake-3.1.3/Source/cmExportInstallFileGenerator.cxx 2015-03-05 21:25:13.428466173 +0000
-+++ cmake-3.1.3.x32/Source/cmExportInstallFileGenerator.cxx 2015-03-05 21:13:54.475137755 +0000
-@@ -194,8 +194,10 @@
- << "get_filename_component(_IMPORT_PREFIX"
- << " \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n";
- if (cmHasLiteralPrefix(absDestS.c_str(), "/lib/") ||
-+ cmHasLiteralPrefix(absDestS.c_str(), "/libx32/") ||
- cmHasLiteralPrefix(absDestS.c_str(), "/lib64/") ||
- cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib/") ||
-+ cmHasLiteralPrefix(absDestS.c_str(), "/usr/libx32/") ||
- cmHasLiteralPrefix(absDestS.c_str(), "/usr/lib64/")) {
- // Handle "/usr move" symlinks created by some Linux distros.
- /* clang-format off */
-diff -urN cmake-3.1.3/Source/cmFindLibraryCommand.cxx cmake-3.1.3.x32/Source/cmFindLibraryCommand.cxx
---- cmake-3.1.3/Source/cmFindLibraryCommand.cxx 2015-02-11 16:17:39.000000000 +0000
-+++ cmake-3.1.3.x32/Source/cmFindLibraryCommand.cxx 2015-03-05 21:07:55.938473684 +0000
-@@ -65,6 +65,16 @@
- }
- }
-
-+ if(this->Makefile->GetCMakeInstance()
-+ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
-+ {
-+ // add special 64 bit paths if this is a 64 bit compile.
-+ if(this->Makefile->PlatformIsx32Bit())
-+ {
-+ this->AddArchitecturePaths("x32");
-+ }
-+ }
-+
- std::string library = this->FindLibrary();
- if(library != "")
- {
-diff -urN cmake-3.1.3/Source/cmFindPackageCommand.cxx cmake-3.1.3.x32/Source/cmFindPackageCommand.cxx
---- cmake-3.1.3/Source/cmFindPackageCommand.cxx 2015-02-11 16:17:39.000000000 +0000
-+++ cmake-3.1.3.x32/Source/cmFindPackageCommand.cxx 2015-03-05 21:10:49.355139095 +0000
-@@ -38,6 +38,7 @@
- this->UseFindModules = true;
- this->DebugMode = false;
- this->UseLib64Paths = false;
-+ this->UseLibx32Paths = false;
- this->PolicyScope = true;
- this->VersionMajor = 0;
- this->VersionMinor = 0;
-@@ -90,6 +91,14 @@
- this->UseLib64Paths = true;
- }
-
-+ // Lookup whether libx32 paths should be used.
-+ if(this->Makefile->PlatformIsx32Bit() &&
-+ this->Makefile->GetCMakeInstance()
-+ ->GetPropertyAsBool("FIND_LIBRARY_USE_LIBX32_PATHS"))
-+ {
-+ this->UseLibx32Paths = true;
-+ }
-+
- // Check if User Package Registry should be disabled
- if(this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY"))
- {
-@@ -2097,6 +2106,9 @@
- if (this->UseLib64Paths) {
- common.push_back("lib64");
- }
-+ if(this->UseLibx32Paths) {
-+ common.push_back("libx32");
-+ }
- common.push_back("lib");
- common.push_back("share");
-
-diff -urN cmake-3.1.3/Source/cmFindPackageCommand.h cmake-3.1.3.x32/Source/cmFindPackageCommand.h
---- cmake-3.1.3/Source/cmFindPackageCommand.h 2015-02-11 16:17:39.000000000 +0000
-+++ cmake-3.1.3.x32/Source/cmFindPackageCommand.h 2015-03-05 21:07:55.938473684 +0000
-@@ -124,6 +124,7 @@
- bool NoBuilds;
- bool DebugMode;
- bool UseLib64Paths;
-+ bool UseLibx32Paths;
- bool PolicyScope;
- std::string LibraryArchitecture;
- std::vector<std::string> Names;
-diff -urN cmake-3.1.3/Source/cmMakefile.cxx cmake-3.1.3.x32/Source/cmMakefile.cxx
---- cmake-3.1.3/Source/cmMakefile.cxx 2015-02-11 16:17:39.000000000 +0000
-+++ cmake-3.1.3.x32/Source/cmMakefile.cxx 2015-03-05 21:07:55.938473684 +0000
-@@ -2370,6 +2370,15 @@
- return false;
- }
-
-+bool cmMakefile::PlatformIsx32Bit() const
-+{
-+#ifdef __ILP32__
-+ return true;
-+#else
-+ return false;
-+#endif
-+}
-+
- const char* cmMakefile::GetSONameFlag(const std::string& language) const
- {
- std::string name = "CMAKE_SHARED_LIBRARY_SONAME";
-diff -urN cmake-3.1.3/Source/cmMakefile.h cmake-3.1.3.x32/Source/cmMakefile.h
---- cmake-3.1.3/Source/cmMakefile.h 2015-02-11 16:17:39.000000000 +0000
-+++ cmake-3.1.3.x32/Source/cmMakefile.h 2015-03-05 21:07:55.938473684 +0000
-@@ -648,6 +648,8 @@
-
- /** Return whether the target platform is 64-bit. */
- bool PlatformIs64Bit() const;
-+ /** Return whether the target platform is x32-bit. */
-+ bool PlatformIsx32Bit() const;
-
- /** Retrieve soname flag for the specified language if supported */
- const char* GetSONameFlag(const std::string& language) const;