Attached Files | cmake-cross-apple.patch [^] (2,462 bytes) 2010-11-30 22:28 [Show Content] [Hide Content]diff -urp cmake-2.8.3/Source/cmTarget.cxx cmake-2.8.3/Source/cmTarget.cxx
--- cmake-2.8.3/Source/cmTarget.cxx 2010-11-03 15:58:29.000000000 -0400
+++ cmake-2.8.3/Source/cmTarget.cxx 2010-11-30 21:34:04.000000000 -0500
@@ -1175,10 +1175,16 @@ bool cmTarget::HasImportLibrary()
}
//----------------------------------------------------------------------------
-bool cmTarget::IsFrameworkOnApple()
+bool cmTarget::IsSharedLibraryOnApple()
{
return (this->GetType() == cmTarget::SHARED_LIBRARY &&
- this->Makefile->IsOn("APPLE") &&
+ this->Makefile->IsOn("APPLE"));
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsFrameworkOnApple()
+{
+ return (this->IsSharedLibraryOnApple() &&
this->GetPropertyAsBool("FRAMEWORK"));
}
@@ -3195,26 +3201,25 @@ void cmTarget::GetLibraryNames(std::stri
name = prefix+base+suffix;
// The library's soname.
-#if defined(__APPLE__)
- soName = prefix+base;
-#else
- soName = name;
-#endif
+ if (this->IsSharedLibraryOnApple())
+ soName = prefix+base;
+ else
+ soName = name;
+
if(soversion)
{
soName += ".";
soName += soversion;
}
-#if defined(__APPLE__)
- soName += suffix;
-#endif
+ if (this->IsSharedLibraryOnApple())
+ soName += suffix;
// The library's real name on disk.
-#if defined(__APPLE__)
- realName = prefix+base;
-#else
- realName = name;
-#endif
+ if (this->IsSharedLibraryOnApple())
+ realName = prefix+base;
+ else
+ realName = name;
+
if(version)
{
realName += ".";
@@ -3225,9 +3230,9 @@ void cmTarget::GetLibraryNames(std::stri
realName += ".";
realName += soversion;
}
-#if defined(__APPLE__)
- realName += suffix;
-#endif
+
+ if (this->IsSharedLibraryOnApple())
+ realName += suffix;
// The import library name.
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
diff -urp cmake-2.8.3/Source/cmTarget.h cmake-2.8.3/Source/cmTarget.h
--- cmake-2.8.3/Source/cmTarget.h 2010-11-03 15:58:29.000000000 -0400
+++ cmake-2.8.3/Source/cmTarget.h 2010-11-30 21:34:04.000000000 -0500
@@ -426,6 +426,9 @@ public:
/** Return whether or not the target has a DLL import library. */
bool HasImportLibrary();
+ /** Return whether this target is a shared library on Apple. */
+ bool IsSharedLibraryOnApple();
+
/** Return whether this target is a shared library Framework on
Apple. */
bool IsFrameworkOnApple();
|