[cmake-commits] king committed cmComputeLinkInformation.cxx 1.9 1.10
cmExportFileGenerator.cxx 1.1 1.2
cmExportInstallFileGenerator.cxx 1.1 1.2 cmGlobalGenerator.cxx
1.219 1.220 cmGlobalXCodeGenerator.cxx 1.181 1.182
cmInstallCommand.cxx 1.40 1.41 cmInstallCommand.h 1.25 1.26
cmInstallTargetGenerator.cxx 1.51 1.52
cmMakefileLibraryTargetGenerator.cxx 1.50 1.51 cmTarget.cxx
1.180 1.181 cmTarget.h 1.97 1.98
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Jan 28 13:06:00 EST 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv6911/Source
Modified Files:
cmComputeLinkInformation.cxx cmExportFileGenerator.cxx
cmExportInstallFileGenerator.cxx cmGlobalGenerator.cxx
cmGlobalXCodeGenerator.cxx cmInstallCommand.cxx
cmInstallCommand.h cmInstallTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx cmTarget.cxx cmTarget.h
Log Message:
ENH: Support exporting/importing of Framework targets.
- Imported frameworks have the FRAMEWORK property set
- Added cmTarget::IsFrameworkOnApple method to simplify checks
- Also remove separate IMPORTED_ENABLE_EXPORTS property and just use ENABLE_EXPORTS since, like FRAMEWORK, it just represents the target type.
- Document FRAMEWORK keyword in INSTALL command.
- Updated IMPORTED_LOCATION property documentation for Frameworks
Index: cmExportFileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportFileGenerator.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmExportFileGenerator.cxx 28 Jan 2008 13:38:35 -0000 1.1
+++ cmExportFileGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.2
@@ -237,10 +237,21 @@
default: // should never happen
break;
}
+
+ // Mark the imported executable if it has exports.
if(target->IsExecutableWithExports())
{
os << "SET_PROPERTY(TARGET " << targetName
- << " PROPERTY IMPORTED_ENABLE_EXPORTS 1)\n";
+ << " PROPERTY ENABLE_EXPORTS 1)\n";
+ }
+
+ // Mark the imported framework. This is done even on non-Apple
+ // platforms for reference and consistency purposes.
+ if(target->GetType() == cmTarget::SHARED_LIBRARY &&
+ target->GetPropertyAsBool("FRAMEWORK"))
+ {
+ os << "SET_PROPERTY(TARGET " << targetName
+ << " PROPERTY FRAMEWORK 1)\n";
}
os << "\n";
}
Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- cmGlobalXCodeGenerator.cxx 28 Jan 2008 13:38:35 -0000 1.181
+++ cmGlobalXCodeGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.182
@@ -498,8 +498,7 @@
// Is this a "private" or "public" framework header file?
// Set the ATTRIBUTES attribute appropriately...
//
- if(cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
- cmtarget.GetPropertyAsBool("FRAMEWORK"))
+ if(cmtarget.IsFrameworkOnApple())
{
if(tsFlags.PrivateHeader)
{
@@ -710,8 +709,7 @@
}
// some build phases only apply to bundles and/or frameworks
- bool isFrameworkTarget = cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
- cmtarget.GetPropertyAsBool("FRAMEWORK");
+ bool isFrameworkTarget = cmtarget.IsFrameworkOnApple();
bool isBundleTarget = cmtarget.GetPropertyAsBool("MACOSX_BUNDLE");
cmXCodeObject* buildFiles = 0;
@@ -1359,8 +1357,7 @@
target.GetType() == cmTarget::EXECUTABLE)
{
std::string pndir = target.GetDirectory();
- if (target.GetType() == cmTarget::SHARED_LIBRARY &&
- target.GetPropertyAsBool("FRAMEWORK"))
+ if(target.IsFrameworkOnApple())
{
pndir += "/..";
pndir = cmSystemTools::CollapseFullPath(pndir.c_str());
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmComputeLinkInformation.cxx 28 Jan 2008 13:38:35 -0000 1.9
+++ cmComputeLinkInformation.cxx 28 Jan 2008 18:05:58 -0000 1.10
@@ -337,9 +337,8 @@
// Pass the full path to the target file.
std::string lib = tgt->GetFullPath(config, implib);
this->Depends.push_back(lib);
-#ifdef __APPLE__
- if(tgt->GetType() == cmTarget::SHARED_LIBRARY &&
- tgt->GetPropertyAsBool("FRAMEWORK"))
+
+ if(tgt->IsFrameworkOnApple())
{
// Frameworks on OS X need only the framework directory to
// link.
@@ -347,7 +346,6 @@
this->AddFrameworkItem(fw);
}
else
-#endif
{
this->AddTargetItem(lib, tgt);
this->AddLibraryRuntimeInfo(lib, tgt);
Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- cmGlobalGenerator.cxx 28 Jan 2008 13:38:35 -0000 1.219
+++ cmGlobalGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.220
@@ -1359,8 +1359,7 @@
if(cmTarget* tgt = this->FindTarget(0, libname.c_str()))
{
- if(tgt->GetType() == cmTarget::SHARED_LIBRARY &&
- tgt->GetPropertyAsBool("FRAMEWORK"))
+ if(tgt->IsFrameworkOnApple())
{
return true;
}
Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- cmMakefileLibraryTargetGenerator.cxx 28 Dec 2007 19:59:06 -0000 1.50
+++ cmMakefileLibraryTargetGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.51
@@ -111,13 +111,11 @@
//----------------------------------------------------------------------------
void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
{
-#ifdef __APPLE__
- if (this->Target->GetPropertyAsBool("FRAMEWORK"))
+ if(this->Target->IsFrameworkOnApple())
{
this->WriteFrameworkRules(relink);
return;
}
-#endif
const char* linkLanguage =
this->Target->GetLinkerLanguage(this->GlobalGenerator);
std::string linkRuleVar = "CMAKE_";
@@ -479,14 +477,13 @@
outpathImp += "/";
}
}
-#if defined(__APPLE__)
+
// If we're creating a framework, place the output into a framework directory
- if (this->Target->GetType() == cmTarget::SHARED_LIBRARY &&
- this->Target->GetPropertyAsBool("FRAMEWORK"))
+ if(this->Target->IsFrameworkOnApple())
{
this->CreateFramework(targetName, outpath);
}
-#endif
+
std::string targetFullPath = outpath + targetName;
std::string targetFullPathPDB = outpath + targetNamePDB;
std::string targetFullPathSO = outpath + targetNameSO;
Index: cmInstallCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.cxx,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cmInstallCommand.cxx 28 Jan 2008 13:38:35 -0000 1.40
+++ cmInstallCommand.cxx 28 Jan 2008 18:05:58 -0000 1.41
@@ -376,7 +376,7 @@
// This is a non-DLL platform.
// If it is marked with FRAMEWORK property use the FRAMEWORK set of
// INSTALL properties. Otherwise, use the LIBRARY properties.
- if(target.GetPropertyAsBool("FRAMEWORK"))
+ if(target.IsFrameworkOnApple())
{
// Use the FRAMEWORK properties.
if (!frameworkArgs.GetDestination().empty())
@@ -512,9 +512,7 @@
//
bool createInstallGeneratorsForTargetFileSets = true;
- if(cmTarget::SHARED_LIBRARY == target.GetType() &&
- target.GetPropertyAsBool("FRAMEWORK") &&
- this->Makefile->IsOn("APPLE"))
+ if(target.IsFrameworkOnApple())
{
createInstallGeneratorsForTargetFileSets = false;
}
Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- cmTarget.h 28 Jan 2008 13:38:36 -0000 1.97
+++ cmTarget.h 28 Jan 2008 18:05:58 -0000 1.98
@@ -320,6 +320,10 @@
enabled. */
bool IsExecutableWithExports();
+ /** Return whether this target is a shared library Framework on
+ Apple. */
+ bool IsFrameworkOnApple();
+
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.
Index: cmInstallCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cmInstallCommand.h 28 Jan 2008 13:38:35 -0000 1.25
+++ cmInstallCommand.h 28 Jan 2008 18:05:58 -0000 1.26
@@ -99,7 +99,7 @@
"\n"
"The TARGETS signature:\n"
" install(TARGETS targets... [EXPORT <export-name>]\n"
- " [[ARCHIVE|LIBRARY|RUNTIME]\n"
+ " [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK]\n"
" [DESTINATION <dir>]\n"
" [PERMISSIONS permissions...]\n"
" [CONFIGURATIONS [Debug|Release|...]]\n"
@@ -107,19 +107,20 @@
" [OPTIONAL]\n"
" ] [...])\n"
"The TARGETS form specifies rules for installing targets from a "
- "project. There are three kinds of target files that may be "
- "installed: archive, library, and runtime. "
+ "project. There are four kinds of target files that may be "
+ "installed: archive, library, runtime, and framework. "
"Executables are always treated as runtime targets. "
"Static libraries are always treated as archive targets. "
"Module libraries are always treated as library targets. "
"For non-DLL platforms shared libraries are treated as library "
- "targets. "
+ "targets, except that those marked with the FRAMEWORK property "
+ "are treated as framework targets on OS X. "
"For DLL platforms the DLL part of a shared library is treated as "
"a runtime target and the corresponding import library is treated as "
"an archive target. "
"All Windows-based systems including Cygwin are DLL platforms. "
- "The ARCHIVE, LIBRARY, and RUNTIME "
+ "The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK "
"arguments change the type of target to which the subsequent "
"properties "
"apply. If none is given the installation properties apply to "
Index: cmInstallTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallTargetGenerator.cxx,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- cmInstallTargetGenerator.cxx 28 Jan 2008 13:38:35 -0000 1.51
+++ cmInstallTargetGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.52
@@ -222,8 +222,7 @@
// An import library looks like a static library.
type = cmTarget::STATIC_LIBRARY;
}
- else if(this->Target->GetMakefile()->IsOn("APPLE") &&
- this->Target->GetPropertyAsBool("FRAMEWORK"))
+ else if(this->Target->IsFrameworkOnApple())
{
// Compute the build tree location of the framework directory
std::string from1 = fromDirConfig;
Index: cmExportInstallFileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportInstallFileGenerator.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmExportInstallFileGenerator.cxx 28 Jan 2008 13:38:35 -0000 1.1
+++ cmExportInstallFileGenerator.cxx 28 Jan 2008 18:05:58 -0000 1.2
@@ -158,8 +158,9 @@
te->LibraryGenerator, properties);
this->SetImportLocationProperty(config, suffix,
te->RuntimeGenerator, properties);
+ this->SetImportLocationProperty(config, suffix,
+ te->FrameworkGenerator, properties);
- // TODO: Frameworks?
// TODO: Bundles?
// If any file location was set for the target add it to the
@@ -223,7 +224,15 @@
value += "/";
// Append the installed file name.
- value += itgen->GetInstallFilename(config);
+ std::string fname = itgen->GetInstallFilename(config);
+ value += fname;
+
+ // Fix name for frameworks.
+ if(itgen->GetTarget()->IsFrameworkOnApple())
+ {
+ value += ".framework/";
+ value += fname;
+ }
// Store the property.
properties[prop] = value;
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -d -r1.180 -r1.181
--- cmTarget.cxx 28 Jan 2008 13:38:36 -0000 1.180
+++ cmTarget.cxx 28 Jan 2008 18:05:58 -0000 1.181
@@ -125,7 +125,7 @@
cm->DefineProperty
("FRAMEWORK", cmProperty::TARGET,
"This target is a framework on the Mac.",
- "Is set to true then if this target is a shared library, it will "
+ "If a shared library target has this property set to true it will "
"be built as a framework when built on the mac. It will have the "
"directory structure required for a framework and will be suitable "
"to be used with the -framework option");
@@ -172,14 +172,6 @@
"Ignored for non-imported targets.");
cm->DefineProperty
- ("IMPORTED_ENABLE_EXPORTS", cmProperty::TARGET,
- "Enable linking to an IMPORTED executable target.",
- "Indicates that an IMPORTED executable target exports symbols for "
- "use by plugin modules. "
- "This is the imported target equivalent of the ENABLE_EXPORTS "
- "property.");
-
- cm->DefineProperty
("IMPORTED_IMPLIB", cmProperty::TARGET,
"Full path to the import library for an IMPORTED target.",
"Specifies the location of the \".lib\" part of a windows DLL. "
@@ -217,6 +209,8 @@
"library or module. "
"For shared libraries on non-DLL platforms this is the location of "
"the shared library. "
+ "For frameworks on OS X this is the location of the library file "
+ "symlink just inside the framework folder. "
"For DLLs this is the location of the \".dll\" part of the library. "
"Ignored for non-imported targets.");
@@ -599,20 +593,16 @@
//----------------------------------------------------------------------------
bool cmTarget::IsExecutableWithExports()
{
- if(this->GetType() == cmTarget::EXECUTABLE)
- {
- if(this->IsImported())
- {
- // The "IMPORTED_" namespace is used for properties exported
- // from the project providing imported targets.
- return this->GetPropertyAsBool("IMPORTED_ENABLE_EXPORTS");
- }
- else
- {
- return this->GetPropertyAsBool("ENABLE_EXPORTS");
- }
- }
- return false;
+ return (this->GetType() == cmTarget::EXECUTABLE &&
+ this->GetPropertyAsBool("ENABLE_EXPORTS"));
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsFrameworkOnApple()
+{
+ return (this->GetType() == cmTarget::SHARED_LIBRARY &&
+ this->Makefile->IsOn("APPLE") &&
+ this->GetPropertyAsBool("FRAMEWORK"));
}
//----------------------------------------------------------------------------
@@ -2090,15 +2080,13 @@
{
targetSuffix = this->Makefile->GetSafeDefinition(suffixVar);
}
-#if defined(__APPLE__)
+
// frameworks do not have a prefix or a suffix
- if (this->GetType() == cmTarget::SHARED_LIBRARY &&
- this->GetPropertyAsBool("FRAMEWORK"))
+ if(this->IsFrameworkOnApple())
{
targetPrefix = 0;
targetSuffix = 0;
}
-#endif
// Begin the final name with the prefix.
outPrefix = targetPrefix?targetPrefix:"";
@@ -2715,16 +2703,12 @@
cmSystemTools::CollapseFullPath
(out.c_str(), this->Makefile->GetStartOutputDirectory());
-#if defined(__APPLE__)
- // frameworks do not have a prefix or a suffix
- if (this->GetType() == cmTarget::SHARED_LIBRARY &&
- this->GetPropertyAsBool("FRAMEWORK"))
+ if(this->IsFrameworkOnApple())
{
out += "/";
out += this->GetFullName(0, implib);
out += ".framework";
}
-#endif
// Optionally make sure the output path exists on disk.
if(create)
More information about the Cmake-commits
mailing list