How to add AppWizard in KDevelop

zhaozj2021-02-16  79

KDevelop is a program-idE of Linux, like the VC under Windows, of course, I don't think there is no VC, and I am a open source code, but he is also a good IDE under Linux. And as long as you are interested, you can customize the source code for KDevelop.

Due to the project needs, KDevelop's AppWizard has recently been studied. And I did a Wizard, this Wizard is a HelloWord on the high-pass mobile phone and compiled. SO library.

Here are how to write such a Wizard by writing in the KDevelop source code:

?? 1. You can see all KDevelop's Wizard is in the directory ??? $ (kdevelop_src) / language / cpp / app_templates

2. Let's take a few key files in each Wizard directory (such as CPPHELLO):

?? app.kdevelop - some information when generating Wizard is recorded, such as Author, Email, and some compile options after Creating Wizard, such as CPPFlags, etc.

CPPHELLO? - This is a configuration file that describes some information from Wizard, such as

? src-makefile.am - made Makefile.am when you create Wizard

? Script - Perl scripts performed when creating wizard

Configure.in - Configure.in generated when you create Wizard

3. Write your own wizard:

Several key files are as follows

? App.kdevelop --- and CPPHELLO

? MyWizard - configuration file

# KDE Config File [General] Name = mywiardName [fr] = Un simple programme de test? Hello world? Icon = chello.pngCategory = C Comment = Generates a simple Hello world program in brew-handset FrameWorldComment [fr] = G閚鑢 E UN SIMPLE PROGRAMME DE TEST DU TYPE? HELLO World? Dans Le Language C.FileTemplates = H, CStyle, CPP, CStyleshowFilesAftergeneration = src / appnamelc.cpppp

SRC-MAKEFILE.AM - this makefile can generate the source code .so

lib_LTLIBRARIES = lib $ APPNAMELC $ .la # $ APPNAMELC $ _SOURCES = $ APPNAMELC $ .c AEEModGen.c AEEAppGen.clib $ APPNAMELC $ _la_SOURCES = $ APPNAMELC $ .cpp AEEModGen.c AEEAppGen.c

# set the incrude path found by configureincludes = $ (all_includes)

Script - The script that executes when winning wizard is used to copy some files.

#! / usr / bin / perl

Use kdevelop;

INTALLFETEMPLATE (); installincadmin (); installincadmin (); installincadmin (); installincadmin ();

Print "Installing Project File / N"; INSTALL ("$ {src} /template-cppapplecore/app.project", ???? "$ {dest} / $ {appnamelc} .project"); Print "Installing Application Framework / N "; MKDIR (" $ {DEST} / src ", 0777); INSTALL (" $ {src} /template-cppapplecore/cpp-makefile.am "," $ {dest} /makefile.am); Install ($ {src} /template-cvs "," $ {DEST} /makefile.cvs "); install (" $ {src} /template-cppapplecore/configure.in ", ?? ?? "$ {dest} /configure.in");

Print "Installing Application Sources / N"; Install ("$ {src} /template-cppapplecore/src-makefile.am", "$ {dest} /src/makefile.am"); ​​$ {appnamelc} .cpp ); INSTALL ("$ {src} /template-cppapplecore/helloworld.c", ????????? "$ {dest} / src / $ {appnamelc} .c"); install ("$ {" SRC} /Template-cppapplecore/aeemodgen.c ", ?????????" $ {dest} /src/aeemodgen.c "); install (" $ {src} /template-cppapplecore/aeeppgen.c) ", ?????????" $ {dest} /src/aeeppgen.c "); install (" $ {src} /template-cppapplecore/helloWorld.bid ", ???????? ? "$ {dest} /src/helloworld.bid");

?

Print "Finished / N";

Configure.in - can be the same as CPPHELLO

4. In addition, you have to ensure that the files that perform Script copy are in the directory, such as my wizard, there is aeemodgen.c, aeeeappgen.c, helloworld.c, etc.

Writing a Wizard is so easy, if you want to see your wiard when you start in Kdeveop,

Add your own MyWizard directory name under MakeFile.am under $ (KDevelop_src) / Language / CPP / App_Templates, recompile KDevelop, and install it. You can also check the relevant information to the KDevelop site, which will tell you how to write AppWiard.

Because the first write article, I feel that I don't know enough. However, I want to write better after tomorrow. :)

转载请注明原文地址:https://www.9cbs.com/read-17835.html

New Post(0)