summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeTestCCompiler.cmake2
-rw-r--r--Source/cmMakefile.cxx18
2 files changed, 19 insertions, 1 deletions
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index af9420f..f36d5c8 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -32,5 +32,7 @@ ELSE(NOT CMAKE_C_COMPILER_WORKS)
"Determining if the C compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
ENDIF(C_TEST_WAS_RUN)
+ INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
+ CHECK_TYPE_SIZE("void *" CMAKE_SIZEOF_VOID_P)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 34d44e2..baf3b0b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2184,7 +2184,23 @@ std::string cmMakefile::FindLibrary(const char* name,
}
}
}
-
+ if(m_LocalGenerator->GetGlobalGenerator()->GetLanguageEnabled("C"))
+ {
+ std::string voidsize = this->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P");
+ int size = atoi(voidsize.c_str());
+ if(size == 8)
+ {
+ path.push_back("/usr/X11R6/lib64");
+ path.push_back("/usr/local/lib64");
+ path.push_back("/usr/lib64");
+ }
+ if(size == 4)
+ {
+ path.push_back("/usr/X11R6/lib32");
+ path.push_back("/usr/local/lib32");
+ path.push_back("/usr/lib32");
+ }
+ }
return cmSystemTools::FindLibrary(name, path);
}