Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

Project defined Macros?

15 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I've come across a relatively recent project of mine that has project defined macros in the LPI file, but for the life of me I can't see where in the Project Options dialog that is defined. See the <MacroValues> shown below. The Wiki also doesn't mention it.

I just updated my Lazarus to the latest Trunk, but it doesn't seem to have such an option either. I remember trying out CodeTyphon a couple weeks back, so not sure if that is maybe a feature they added, and it modified my LPI in the process?

This project doesn't define dependency packages, so it seems to have used the Project Macros instead to find the correct source code. The Compiler Options -> Paths also use these macros. For example:

  $(tiopf)UnitTests/Common;
  $(tiopf)UnitTests/Tests;
  $(tiopf)Core;
  $(tiopf)Options;
  $(tiopf)GUI/fpGUI;
  $(fpgui)src;
  ...snip..

I'm a bit puzzled here. :-)

==========================================
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<MacroValues Count="4">
<Macro1 Name="fpgui" Value="/data/devel/fpgui/"/>
<Macro2 Name="tiopf" Value="/data/devel/tiopf/"/>
<Macro3 Name="fblib" Value="/data/devel/opensource/FBLib/"/> <Macro4 Name="fptest" Value="/data/devel/fptest/"/> </MacroValues>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
...snip...
====================================================

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
I've come across a relatively recent project of mine that has project defined macros in the LPI file, but for the life of me I can't see where in the Project Options dialog that is defined.

I thought maybe it is the IDE macros as can be seen in this screenshot.

http://wiki.freepascal.org/IDE_Window:_Project_Options#Project_macros

But my Lazarus IDE (Lazarus 1.5 r49362 FPC 2.6.4 x86_64-freebsd-gtk 2) doesn't have a "Build Modes" node (seen in screenshot) under the Compiler Options either???

I'm loosing my mind here. :-/

Regards,
- Graeme -

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

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: I've come across a relatively recent project of mine that has project defined macros in…
Show quoted text 6 lines
Hi, I've come across a relatively recent project of mine that has project defined macros in the LPI file, but for the life of me I can't see where in the Project Options dialog that is defined. See the <MacroValues> shown below. The Wiki also doesn't mention it.

Macros are now under Additions and Overrides.
http://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Additions_and_Overrides

I will update the wiki paragraphs you found.

Mattias

Reply by email

Juha Manninen
to Graeme Geldenhuys: I thought maybe it is the IDE macros as can be seen in this screenshot.…
Graeme Geldenhuys wrote
I thought maybe it is the IDE macros as can be seen in this screenshot.

That wiki page is badly outdated. Somebody should fix it ... IDE macros were replaced with "Additions and Overrides" which is more versatile and its settings affect dependent packages, too. Build Modes are now managed in a separate dialog window. You see its GUI at the top of the Options window when some of compiler options pages is selected. Thus it is now more obvious that all compiler options are saved in Build Modes.

Juha

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: I've come across a relatively recent project of mine that has project defined macros in…
Graeme Geldenhuys wrote
I've come across a relatively recent project of mine that has project defined macros in the LPI file, but for the life of me I can't see where in the Project Options dialog that is defined. See the <MacroValues> shown below. The Wiki also doesn't mention it.

Ah... The mystery is solved! The wiki is well out of date (another reason Lazarus IDE needs versioned help!).

Contratry to so many screenshots and text in the wiki, the "Build Modes" node doesn't exist any more in Compiler Options.

I found similar functionality well hidden in "Additions and Overrides". Open that sceen, then you have to click on the down arrow next to "Add", then select "IDE Macros". New macro entries are then created under the odd looking grid under "Stored in project (.lpi)". Define your Name=Value pairs there, and they generate the <MacroValues> seen in the LPI file.

So, how old is the wiki text and screenshots then? I just checked, and the release Lazarus v1.4 doesn't have the "Build modes" under Compiler Options, and obviously neither does v1.5 (trunk).

Feature Request:
----------------
Please, please add versioned documentation (docs per release) as a priority for Lazarus. The wiki is currently a mess, and from what I experienced, definitely not very ,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Juha Manninen: On Thu, Jun 18, 2015 at 3:26 PM, Graeme Geldenhuys That wiki page is badly outdated.…
Juha Manninen wrote
IDE macros were replaced with "Additions and Overrides" which is more versatile and its settings affect dependent packages, too.

Thanks for the info Juha (and Mattias). Which Lazarus release added the new "Additions and Overrides" functionality?

Regards,
- Graeme -

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

Reply by email

Juha Manninen
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Which Lazarus release added the new "Additions and Overrides" functionality?

Lazarus 1.2.
http://wiki.freepascal.org/New_IDE_features_since#Project_Additions_and_Overrides

When you look at the New_IDE_features_since page, you may notice that your EditorToolbar is now part of BigIde (installed by default). The next development step is to remove the whole package and integrate the code directly in IDE. In fact I am doing that right now. The configuration dialog will be shared between the new IDE Coolbar.

Juha

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: Thanks for the info Juha (and Mattias). Which Lazarus release added the new "Additions…
Show quoted text 6 lines
On 2015-06-18 13:46, Juha Manninen wrote: > IDE macros were replaced with "Additions and Overrides" which is more > versatile and its settings affect dependent packages, too. Thanks for the info Juha (and Mattias). Which Lazarus release added the new "Additions and Overrides" functionality?

1.2

http://wiki.freepascal.org/New_IDE_features_since#Project_Additions_and_Overrides

Mattias

Reply by email

Michael Schnell
to Graeme Geldenhuys: Ah... The mystery is solved! The wiki is well out of date (another reason Lazarus IDE…
Graeme Geldenhuys wrote
I found similar functionality well hidden in "Additions and Overrides".

I already often used this new kind of Build modes. Seemingly I am the only one ;-) . (I am always focused on ARCH/OS/GUI-System portability.)

For my degenerating mind it's by far too hidden and not really easy to use. I'd like the build modes to be more obvious.

-Michael

Reply by email

Graeme Geldenhuys
to Juha Manninen: On Thu, Jun 18, 2015 at 3:53 PM, Graeme Geldenhuys Lazarus 1.2.…
Juha Manninen wrote
When you look at the New_IDE_features_since page,

Glad to see that page is still going. :)

you may notice that your EditorToolbar is now part of BigIde (installed by default).

"We are the Borg. You will be assimilated. Resistance is futile." :-D

Yes, I'm a big Star Trek fan.

Regards,
- Graeme -

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

Reply by email

Juha Manninen
to Michael Schnell: I already often used this new kind of Build modes. Seemingly I am the only one ;-) . (I…
Michael Schnell wrote 7 lines
> I found similar functionality well hidden in "Additions and Overrides". I already often used this new kind of Build modes. Seemingly I am the only one ;-) . (I am always focused on ARCH/OS/GUI-System portability.) For my degenerating mind it's by far too hidden and not really easy to use. I'd like the build modes to be more obvious.

Is it possible that your degenerating mind now confuses "Build modes" with "Additions and Overrides" somehow?

Juha

Reply by email

Michael Schnell
to Juha Manninen
Juha Manninen wrote
Is it possible that your degenerating mind now confuses "Build modes" with "Additions and Overrides" somehow?

You're welcome ;-)

Anyway "Additions and Overrides" now has a "Set LCL Widget Type" dropdown box". To select the GUI system you want your project to attach to.

We can add another "target" Override but here is no selection for the different Targets (Archs and OSes) we might want to compile for. (Even though if the IDE runs in Linux you can select "win32" as "LCL Widget Type" in the dropdown box.)

Is the Arch and OS setting done in another page or do you need to just know what you need to set if compiling for another CPU or OS Target but the default one.

(Of course you need to have the appropriate FPC (cross) version installed to take advantage of this).

-Michael

Reply by email

Juha Manninen
to Michael Schnell
Michael Schnell wrote 11 lines
We can add another "target" Override but here is no selection for the different Targets (Archs and OSes) we might want to compile for. (Even though if the IDE runs in Linux you can select "win32" as "LCL Widget Type" in the dropdown box.) Is the Arch and OS setting done in another page or do you need to just know what you need to set if compiling for another CPU or OS Target but the default one. (Of course you need to have the appropriate FPC (cross) version installed to take advantage of this).

I haven't done cross-compilation really myself. I have only used the "Additions and Overrides" page for setting a define for the project + all dependent packages. It worked well for that.
Indeed this page is intimidating and maybe could be improved. I don't know exactly how.

Still I think you confused "Build modes" with "Additions and Overrides". They are very different things. A build mode contains all compiler options, including the "Additions and Overrides" part.

Juha

Reply by email

Michael Schnell
to Juha Manninen
Juha Manninen wrote
Still I think you confused "Build modes" with "Additions and Overrides". They are very different things. A build mode contains all compiler options, including the "Additions and Overrides" part.

Of course I do know this after I looked it up to prepare my last answer :-) .

-Michael

Reply by email