mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-18 16:41:35 +00:00
Support for libraries added.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12933 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
aa5832cc64
commit
f0b7439483
2 changed files with 135 additions and 1 deletions
|
@ -62,5 +62,16 @@
|
|||
|
||||
@end
|
||||
|
||||
@interface PCMakefileFactory (LibraryProject)
|
||||
|
||||
- (void)appendLibrary;
|
||||
- (void)appendLibraryInstallDir:(NSString*)dir;
|
||||
- (void)appendLibraryLibraries:(NSArray*)array;
|
||||
- (void)appendLibraryHeaders:(NSArray*)array;
|
||||
- (void)appendLibraryClasses:(NSArray *)array;
|
||||
- (void)appendLibraryCFiles:(NSArray *)array;
|
||||
|
||||
@end
|
||||
|
||||
#endif // _PCMAKEFILEFACTORY_H_
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#define COMMENT_APP @"\n\n#\n# Main application\n#\n\n"
|
||||
#define COMMENT_LIBRARIES @"\n\n#\n# Additional libraries\n#\n\n"
|
||||
#define COMMENT_BUNDLE @"\n\n#\n# Bundle\n#\n\n"
|
||||
#define COMMENT_LIBRARY @"\n\n#\n# Library\n#\n\n"
|
||||
|
||||
@implementation PCMakefileFactory
|
||||
|
||||
|
@ -162,7 +163,18 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
- (void)appendTailForLibrary
|
||||
{
|
||||
[self appendString:@""];
|
||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
NSString *hinst;
|
||||
|
||||
[self appendString:@"\n\n"];
|
||||
|
||||
hinst = [NSString stringWithFormat:@"HEADERS_INSTALL = $(%@_HEADER_FILES)\n\n",libnme];
|
||||
[self appendString:hinst];
|
||||
|
||||
[self appendString:@"-include GNUmakefile.preamble\n"];
|
||||
[self appendString:@"-include GNUmakefile.local\n"];
|
||||
[self appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"];
|
||||
[self appendString:@"-include GNUmakefile.postamble\n"];
|
||||
}
|
||||
|
||||
- (void)appendTailForTool
|
||||
|
@ -289,3 +301,114 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
@end
|
||||
|
||||
@implementation PCMakefileFactory (LibraryProject)
|
||||
|
||||
- (void)appendLibrary
|
||||
{
|
||||
NSString *libnme;
|
||||
|
||||
[self appendString:COMMENT_LIBRARY];
|
||||
|
||||
[self appendString:[NSString stringWithFormat:@"PACKAGE_NAME=%@\n",pnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"LIBRARY_VAR=%@\n",[pnme uppercaseString]]];
|
||||
|
||||
libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
[self appendString:[NSString stringWithFormat:@"LIBRARY_NAME=%@\n",libnme]];
|
||||
|
||||
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_DIR=.\n",libnme]];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libnme,pnme]];
|
||||
|
||||
[self appendString:@"ADDITIONAL_INCLUDE_DIRS = -I..\n"];
|
||||
[self appendString:@"srcdir = .\n"];
|
||||
}
|
||||
|
||||
- (void)appendLibraryInstallDir:(NSString*)dir
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"GNUSTEP_INSTALLATION_DIR=%@\n",dir]];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_INSTALLATION_DIR=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_INSTALL_PREFIX=$(GNUSTEP_INSTALLATION_DIR)\n",[pnme uppercaseString]]];
|
||||
}
|
||||
|
||||
- (void)appendLibraryLibraries:(NSArray*)array
|
||||
{
|
||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
|
||||
[self appendString:COMMENT_LIBRARIES];
|
||||
|
||||
[self appendString:
|
||||
[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",libnme]];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
if (![tmp isEqualToString:@"gnustep-base"])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendLibraryHeaders:(NSArray*)array
|
||||
{
|
||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
|
||||
[self appendString:COMMENT_HEADERS];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_HEADER_FILES= ",libnme]];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendLibraryClasses:(NSArray *)array
|
||||
{
|
||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
|
||||
[self appendString:COMMENT_CLASSES];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_OBJC_FILES= ",libnme]];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendLibraryCFiles:(NSArray *)array
|
||||
{
|
||||
NSString *libnme = [NSString stringWithFormat:@"lib%@",pnme];
|
||||
|
||||
[self appendString:COMMENT_CFILES];
|
||||
[self appendString:[NSString stringWithFormat:@"%@_C_FILES= ",libnme]];
|
||||
|
||||
if( array && [array count] )
|
||||
{
|
||||
NSString *tmp;
|
||||
NSEnumerator *enumerator = [array objectEnumerator];
|
||||
|
||||
while (tmp = [enumerator nextObject])
|
||||
{
|
||||
[self appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue