Author Topic: how to design the template  (Read 4945 times)

realmeat

  • Guest
how to design the template
« on: May 16, 2006, 10:44:10 am »
I want to design a template for work

Have any document ?

thx a lot.

« Last Edit: May 16, 2006, 11:08:02 am by realmeat »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: how to make the template
« Reply #1 on: May 16, 2006, 10:45:58 am »
Hello,

Did you try to search in the forum?

I am quite sure that you will find your answer after a small search :).

Best wishes,
Michael

realmeat

  • Guest
Re: how to design the template
« Reply #2 on: May 17, 2006, 03:57:54 am »
This is FLTK template file code

Xml
------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_template_file>
<CodeBlocks_template_file>
      <Template name="FLTK" title="FLTK Application" category="GUI" bitmap="fltk.png">
      <Notice value="This template expects FLTK to be located at C:\fltk-1.1.6.
                  If this is not the case, you will have to update the relevant
                  custom variable accordingly.

                  To do this, click on &quot;Project->Build options->Custom variables&quot;"
            isWarning="1"/>
      <FileSet name="s" title="Default">
         <File source="fltk-main.cpp" destination="main.cpp"/>
      </FileSet>
      <Option name="FLTK Application">
         <Project file="fltk.cbp"/>
      </Option>
   </Template>
</CodeBlocks_template_file>
-------------------------------------------------------------------------
In this template, i know how to do FileSet and Project Name
but how about the project linking to lib?
If I have a special lib,how shall I do?
Otherwise, I must set the linking before using the template
« Last Edit: May 17, 2006, 04:54:59 am by realmeat »

realmeat

  • Guest
Re: how to design the template
« Reply #3 on: May 17, 2006, 07:25:09 am »
I find out the point.
In *.cbp

<Linker>
  <Add library = "lib path"/>
</Linker>

but, I have more one question.

have any variables which define the path of codeblocks dir ?
Just like $(FLTK_DIR) ,$(#WX.lib) defined some path.

« Last Edit: May 17, 2006, 09:08:54 am by realmeat »

sethjackson

  • Guest
Re: how to design the template
« Reply #4 on: May 17, 2006, 01:39:57 pm »
Yes.

http://wiki.codeblocks.org/index.php?title=Builtin_variables

$(CODEBLOCKS) $(APP_PATH) $(APPPATH) $(APP-PATH)

realmeat

  • Guest
Re: how to design the template
« Reply #5 on: May 18, 2006, 05:03:53 am »
thank you very much!! :D

but I have some problem in using the variable.

If I want to set the directory by using $(CODEBLOCKS )to C:\program files\CODEBLOCKS\personal_include,

(my code::blocks program dirctory is C:\program files\CODEBLOCKS)

I set the follow :(Build Options->Directorys->compiler)

    $(CODEBLOCKS)\personal_include

after the building , the compiler tell me it can't find directory / file.

   $(CODEBLOCKS)  ==  "C:\program files\CODEBLOCKS"   ??

I'm confused... :?

--
By the way,

(Build Options->Custom variables)
I set the Variable $(CODE) = "c:\program files\CODEBLOCKS"

and change the path to the follow:
$(CODE)\personal_include

No error.
« Last Edit: May 18, 2006, 05:21:13 am by realmeat »

realmeat

  • Guest
Re: how to design the template
« Reply #6 on: May 18, 2006, 08:08:58 am »
I solve this problem.

Maybe that's a bug.

$(CODEBLOCKS)  == "c:\program files\codeblocks";

but in compiling, $(CODEBLOCKS) becomes "c:\program" and "file\codeblocks",two variables.

so, it search "c:\program" and "files\codeblocks\personal_include\"

It's so ridiculous.....

But I use other way to slove this.

in the custom variable

<Environment>
    <Variable name="PATH" value='&quot;$(CODEBLOCKS)&quot;' />
</Environment>

and... 
   $(PATH)\personal_include

use another variable replace the default.

Maybe that's all fault because of WIN system.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: how to design the template
« Reply #7 on: May 18, 2006, 08:46:32 am »
This is a bug that has been fixed many months ago, so you must be using quite an old version (probably RC2).
If you were using a more recent version, you would want to use the $(#cb.include) global user variable for that purpose, too. That will do the same thing, but won't require you to set the path again and again with every project.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."