Re: [Lazarus] Build modes, macros and conditionals

2010-10-29 Thread Sven Barth

Am 29.10.2010 10:06, schrieb Mattias Gaertner:

On Fri, 29 Oct 2010 09:48:39 +0200
Zaher Dirkey  wrote:


On Sun, Oct 24, 2010 at 10:49 PM, Mattias Gaertner<
nc-gaert...@netcologne.de>  wrote:


Hi all,

There are some new options to create
* sets of compiler options - called "Build modes",
* project and package macros - called "Build macros"
* and rules to set macros, paths and options automatically depending on
target platform - called "Conditionals".

See here for details and examples:

http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Build_modes
http://wiki.lazarus.freepascal.org/Macros_and_Conditionals

Please test.

Important compatibility note:
When opening a new project with an old IDE, you will only see the
default mode. If you save the project with the old IDE you will loose
all other modes, all macros and conditionals.




I prefer to be a Combobox in the top of the options form, to easy swtich
between profiles.
And the compiler options must include debugger to override the IDE options
debugger, for WINCE debug we choose another gdb.exe.


Note: At the moment the debugger exe is part of the global options - not
part of the project.


The ability to override selected global options per project/per build 
mode might be a nice feature. :)


Regards,
Sven

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-29 Thread Zaher Dirkey
On Fri, Oct 29, 2010 at 10:06 AM, Mattias Gaertner <
nc-gaert...@netcologne.de> wrote:

> Note: At the moment the debugger exe is part of the global options - not
> part of the project.
>

Yes I know, but when i want to debug my project (WinCE) in my Device i need
special build of gdb.exe.
Switching between profiles Win32 or WinCE must change that gdb, i know it is
need more work but is its make the profiles more useful for us.

-- 
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-29 Thread Mattias Gaertner
On Fri, 29 Oct 2010 09:48:39 +0200
Zaher Dirkey  wrote:

> On Sun, Oct 24, 2010 at 10:49 PM, Mattias Gaertner <
> nc-gaert...@netcologne.de> wrote:
> 
> > Hi all,
> >
> > There are some new options to create
> > * sets of compiler options - called "Build modes",
> > * project and package macros - called "Build macros"
> > * and rules to set macros, paths and options automatically depending on
> > target platform - called "Conditionals".
> >
> > See here for details and examples:
> >
> > http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Build_modes
> > http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
> >
> > Please test.
> >
> > Important compatibility note:
> > When opening a new project with an old IDE, you will only see the
> > default mode. If you save the project with the old IDE you will loose
> > all other modes, all macros and conditionals.
> >
> >
> >
> I prefer to be a Combobox in the top of the options form, to easy swtich
> between profiles.
> And the compiler options must include debugger to override the IDE options
> debugger, for WINCE debug we choose another gdb.exe.

Note: At the moment the debugger exe is part of the global options - not
part of the project.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-29 Thread Zaher Dirkey
On Sun, Oct 24, 2010 at 10:49 PM, Mattias Gaertner <
nc-gaert...@netcologne.de> wrote:

> Hi all,
>
> There are some new options to create
> * sets of compiler options - called "Build modes",
> * project and package macros - called "Build macros"
> * and rules to set macros, paths and options automatically depending on
> target platform - called "Conditionals".
>
> See here for details and examples:
>
> http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Build_modes
> http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
>
> Please test.
>
> Important compatibility note:
> When opening a new project with an old IDE, you will only see the
> default mode. If you save the project with the old IDE you will loose
> all other modes, all macros and conditionals.
>
>
>
I prefer to be a Combobox in the top of the options form, to easy swtich
between profiles.
And the compiler options must include debugger to override the IDE options
debugger, for WINCE debug we choose another gdb.exe.

Thanks
-- 
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Graeme Geldenhuys
On 28 October 2010 00:14, Mattias Gaertner  wrote:
>> "File > New > Program (a free pascal application)"
>> Then Project Options dialog. The icon, Mac Application bundle
>> checkbox, the manifest checkbox. No matter what I do, I always get
>> those two checkboxes checked, and I always get a 150KB icon. :-(
>
> These are not compiler options.

I guess then we can contribute it to yet another UI layout/design
issue. It's just confusing now. I much preferred when Project Options
and Compiler Options were two separate dialogs. Because now that
checkbox is visible no matter which part of the information you
viewing, yet it old applied to half the available/shown data.


> What is the problem with the project templates?

They don't work, or are simply too limited for my needs. I'll have to
try them again before I can list the issues - I can't remember them
off the top of my head, but there was many issues.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Mattias Gaertner
On Thu, 28 Oct 2010 00:23:04 +0300
patspiper  wrote:

> On 10/27/2010 08:32 PM, Mattias Gaertner wrote:
> >
> > Not yet. Same for the export/import load function.
> >
> > I'm not sure what is the best solution:
> > - change the option to save all build modes
> > - add another check box
> > - move the option to the existing import/export dialog
> > - your idea
> >
> >
> Why not implement a project options profile, exactly like the IDE build 
> mode profiles that were implemented today? Each profile could store 
> compiler options including conditionals, and a default profile replaces 
> the project default options.

There is only one IDE with only a few options, but there are four
standard project default options plus a dozen others with lots of
options and files. There are myriad ideas what options should be
in the template, which ones should be set depending on some
environment options and which ones should be asked interactively.
I think the idea of Michael's package 'projecttemplates' is
right: cloning a directory. Maybe it needs some nicer dialogs/menu
items to fit the various tastes. 
For example for me it would be sufficient to select an existing project
and a dialog showing a few options what to clone. My set of 'few
options' will probably be insufficient for others.

In short:
Whatever someone will implement as 'default project options' will be
insufficient for others. So IMO it is best to put such a feature into a
package, like Michael did.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Mattias Gaertner
On Wed, 27 Oct 2010 23:16:04 +0200
Graeme Geldenhuys  wrote:

> On 27 October 2010 23:10, Graeme Geldenhuys  wrote:
> >
> > Even for "Free Pascal Applications"?  The non-LCL ones in "File > New
> >> Project"?
> 
> A quick example, just tested with the latest lazarus from trunk a few
> minutes ago.
> 
> "File > New > Program (a free pascal application)"
> Then Project Options dialog. The icon, Mac Application bundle
> checkbox, the manifest checkbox. No matter what I do, I always get
> those two checkboxes checked, and I always get a 150KB icon. :-(

These are not compiler options.


> My mouse already goes into auto-pilot whenever I start a new Free
> Pascal Program project (the only applications I use with Lazarus IDE),
> but still damn frustrating. Even creating a new project type package
> did not help in this regard.

What is the problem with the project templates?

Mattias
 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Mattias Gaertner
On Wed, 27 Oct 2010 23:10:38 +0200
Graeme Geldenhuys  wrote:

> On 27 October 2010 19:00, Mattias Gaertner  wrote:
> >
> > It saves the compiler options:
> > search paths, target, verbosity, code generation, ... in other
> > words: every page under projects compiler options except for the build
> > modes page.
> 
> Even for "Free Pascal Applications"?  The non-LCL ones in "File > New
> > Project"?

Yes.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread patspiper

On 10/28/2010 12:16 AM, Graeme Geldenhuys wrote:

A quick example, just tested with the latest lazarus from trunk a few
minutes ago.

"File>  New>  Program (a free pascal application)"
Then Project Options dialog. The icon, Mac Application bundle
checkbox, the manifest checkbox. No matter what I do, I always get
those two checkboxes checked, and I always get a 150KB icon. :-(

   

It saves defaults for the compiler options portion only.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread patspiper

On 10/27/2010 08:32 PM, Mattias Gaertner wrote:


Not yet. Same for the export/import load function.

I'm not sure what is the best solution:
- change the option to save all build modes
- add another check box
- move the option to the existing import/export dialog
- your idea

   
Why not implement a project options profile, exactly like the IDE build 
mode profiles that were implemented today? Each profile could store 
compiler options including conditionals, and a default profile replaces 
the project default options.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Graeme Geldenhuys
On 27 October 2010 23:10, Graeme Geldenhuys  wrote:
>
> Even for "Free Pascal Applications"?  The non-LCL ones in "File > New
>> Project"?

A quick example, just tested with the latest lazarus from trunk a few
minutes ago.

"File > New > Program (a free pascal application)"
Then Project Options dialog. The icon, Mac Application bundle
checkbox, the manifest checkbox. No matter what I do, I always get
those two checkboxes checked, and I always get a 150KB icon. :-(

My mouse already goes into auto-pilot whenever I start a new Free
Pascal Program project (the only applications I use with Lazarus IDE),
but still damn frustrating. Even creating a new project type package
did not help in this regard.

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Graeme Geldenhuys
On 27 October 2010 19:00, Mattias Gaertner  wrote:
>
> It saves the compiler options:
> search paths, target, verbosity, code generation, ... in other
> words: every page under projects compiler options except for the build
> modes page.

Even for "Free Pascal Applications"?  The non-LCL ones in "File > New
> Project"?


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Graeme Geldenhuys
Op 2010-10-26 15:05, patspiper het geskryf:
> 
> Can a part of the build modes be outside the project options, or have a 
> default starting set? (Such as having a build mode for each required 
> target without adding these to each and every project)

I think this will only be possible with new default project templates. I
don't know how customizable they are, I just know that the "project
templates" add-on really doesn't work for me. I found more problems than
solutions, so ended up creating new design time packages which install new
project templates for me. A lot more work, but at least this works.

As for the 'Project Options > Use as new project default' checkbox, it has
never worked for me. I have no idea what that setting saves, but it was
never the stuff I wanted.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net:8080/fpgui/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread patspiper

On 10/27/2010 12:41 PM, Felipe Monteiro de Carvalho wrote:

On Tue, Oct 26, 2010 at 6:27 PM, patspiper  wrote:
   

I am sure build modes can be defined for the above, but since the build
modes have to be defined over and over for each new project, I was wondering
if there was a way to have them as standard, perhaps for new projects (the
same way as a user can set default compiler options for all new projects)?
 

Just copy the build modes in the LPI file. It should be trivial and
take maybe 10 seconds to open both LPI files in a text editor and copy
the build modes.
   
On 10/26/2010 01:55 PM, Felipe Monteiro de Carvalho wrote:

Now I can say that Lazarus is trully the best IDE =)

 
It can be done manually, but for example, IIRC and as per Graeme, MSEide 
has build modes for different platforms.

I thought we agreed that Lazarus IDE rocks ;)

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-27 Thread Felipe Monteiro de Carvalho
On Tue, Oct 26, 2010 at 6:27 PM, patspiper  wrote:
> I am sure build modes can be defined for the above, but since the build
> modes have to be defined over and over for each new project, I was wondering
> if there was a way to have them as standard, perhaps for new projects (the
> same way as a user can set default compiler options for all new projects)?

Just copy the build modes in the LPI file. It should be trivial and
take maybe 10 seconds to open both LPI files in a text editor and copy
the build modes.

-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread patspiper

On 10/26/2010 06:58 PM, Mattias Gaertner wrote:

On Tue, 26 Oct 2010 16:05:22 +0300
patspiper  wrote:

   

[...]
Can a part of the build modes be outside the project options, or have a
default starting set? (Such as having a build mode for each required
target without adding these to each and every project)
 

I have not tried, but I guess the project templates should support this.

About global build modes:
A build mode contains all compiler options, including the search paths
and target file. So this won't work in general.

   
Normally, to recompile a project under win32 or linux, all I have to do 
is change in the project options the LCL widget type (in the paths page) 
and the target OS (in the code generation page). Paths are taken care of 
by using IFDEF linux and IFDEF win32 in fpc.cfg.


I am sure build modes can be defined for the above, but since the build 
modes have to be defined over and over for each new project, I was 
wondering if there was a way to have them as standard, perhaps for new 
projects (the same way as a user can set default compiler options for 
all new projects)?



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Mattias Gaertner
On Tue, 26 Oct 2010 17:14:09 +0200
Bernd  wrote:

> 2010/10/24 Mattias Gaertner :
> 
> > * sets of compiler options - called "Build modes",
> 
> Feature suggestion:
>[...]
> and/or the toolbar button with a dropdown (I think there is something
> similar in eclipse, not sure, I haven't used it for a while).

The toolbar button appears when you have more than one build mode.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Mattias Gaertner
On Tue, 26 Oct 2010 16:05:22 +0300
patspiper  wrote:

>[...]
> Can a part of the build modes be outside the project options, or have a 
> default starting set? (Such as having a build mode for each required 
> target without adding these to each and every project)

I have not tried, but I guess the project templates should support this.

About global build modes:
A build mode contains all compiler options, including the search paths
and target file. So this won't work in general.

If all your projects share a package you can add an option to the
package.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Bernd
2010/10/24 Mattias Gaertner :

> * sets of compiler options - called "Build modes",

Feature suggestion:

from the menu some clever way to quickly select the curently active
build mode without opening the options dialog. Or maybe even something
with sub menus like

run -> build as -> [x]  Default
run -> build as -> [_]  Debug
run -> build as -> [_] ...

run -> run as -> [x]  Default
run -> run as -> [_]  Debug
run -> run as -> [_] ...

and/or the toolbar button with a dropdown (I think there is something
similar in eclipse, not sure, I haven't used it for a while).

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread patspiper

On 10/26/2010 02:41 PM, Graeme Geldenhuys wrote:

Op 2010-10-26 12:55, Felipe Monteiro de Carvalho het geskryf:
   

Now I can say that Lazarus is trully the best IDE =)
 

..as long as you don't try and debug your source code with it. ;-)


Regards,
   - Graeme -

   
Even though debugging is weak and flawed to say the least, and even 
though there are other bugs, it is a fantastic and very powerful IDE 
which launches in a couple of seconds.


Can a part of the build modes be outside the project options, or have a 
default starting set? (Such as having a build mode for each required 
target without adding these to each and every project)



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Graeme Geldenhuys
Op 2010-10-26 12:55, Felipe Monteiro de Carvalho het geskryf:
> 
> Now I can say that Lazarus is trully the best IDE =)

...as long as you don't try and debug your source code with it. ;-)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net:8080/fpgui/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Felipe Monteiro de Carvalho
I haven't had yet an opportunity to test the build modes, but
congratulations and thank you very much =)

Now I can say that Lazarus is trully the best IDE =)

-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Bernd
2010/10/26 Mattias Gaertner :

> On Mon, 25 Oct 2010 23:51:28 +0200
> Bernd  wrote:

>> Can these also be selected with lazbuild from the command line?
>
> Now it can.
>
> --build-mode=name

Great! Such a feature (or something comparable) was missing all the time.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-26 Thread Mattias Gaertner
On Mon, 25 Oct 2010 23:51:28 +0200
Bernd  wrote:

> 2010/10/24 Mattias Gaertner :
> 
> > * sets of compiler options - called "Build modes",
> 
> Can these also be selected with lazbuild from the command line?

Now it can. 

--build-mode=name

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-25 Thread Bernd
2010/10/24 Mattias Gaertner :

> * sets of compiler options - called "Build modes",

Can these also be selected with lazbuild from the command line?

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-24 Thread Mattias Gaertner
On Sun, 24 Oct 2010 23:15:31 +0200
Marco van de Voort  wrote:

> On Sun, Oct 24, 2010 at 10:49:11PM +0200, Mattias Gaertner wrote:
> > There are some new options to create 
> > * sets of compiler options - called "Build modes",
> > * project and package macros - called "Build macros"
> > * and rules to set macros, paths and options automatically depending on
> > target platform - called "Conditionals".
> > 
> > See here for details and examples:
> > 
> > http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Build_modes
> > http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
> > 
> > Please test.
> > 
> > Important compatibility note:
> > When opening a new project with an old IDE, you will only see the
> > default mode. If you save the project with the old IDE you will loose
> > all other modes, all macros and conditionals. 
> 
> Looks nice. One small interesting aspect: it might be worthwhile to set
> environment variables from the scripts.

The environment variables are in the run parameters and are independent
of the compiler options. At the moment you can not
use macros in the environment options.
If someone needs that please create a feature report and/or a patch.

 
> These values can then be included into the source (e.g. for an about box)
> using {$I %envvar%} syntax. 
> 
> See also the "Getting a program's "true name" thread.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Build modes, macros and conditionals

2010-10-24 Thread Marco van de Voort
On Sun, Oct 24, 2010 at 10:49:11PM +0200, Mattias Gaertner wrote:
> There are some new options to create 
> * sets of compiler options - called "Build modes",
> * project and package macros - called "Build macros"
> * and rules to set macros, paths and options automatically depending on
> target platform - called "Conditionals".
> 
> See here for details and examples:
> 
> http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Build_modes
> http://wiki.lazarus.freepascal.org/Macros_and_Conditionals
> 
> Please test.
> 
> Important compatibility note:
> When opening a new project with an old IDE, you will only see the
> default mode. If you save the project with the old IDE you will loose
> all other modes, all macros and conditionals. 

Looks nice. One small interesting aspect: it might be worthwhile to set
environment variables from the scripts.

These values can then be included into the source (e.g. for an about box)
using {$I %envvar%} syntax. 

See also the "Getting a program's "true name" thread.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus