Recent

Author Topic: How to edit Path-Templates  (Read 5406 times)

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
How to edit Path-Templates
« on: April 08, 2013, 02:04:14 am »
There is a dialog to edit the pathes to a units (-Fu)

And at the bottom are Path-Templates like:

$(LazarusDir)\lcl\units\$(TargetCPU)-$(TargetOS)
$(LazarusDir)\lcl\units\$(TargetCPU)-$(TargetOS)\$(LCLWidgetType)
$(LazarusDir)\components\codetools\units\$(TargetCPU)-$(TargetOS)
...


How can I add some own pathes to this list?

I have units which will be used in every project and its no fun to insert the pathes to a project every time  :( So it would be much faster with path templates.
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to edit Path-Templates
« Reply #1 on: April 08, 2013, 02:29:22 am »
You can add them as to project options and save as default.


But you better group your units into a package (just create a new empty package in a new folder, copy units into that folder, and in package: add files)

Then add that package to each project

DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Re: How to edit Path-Templates
« Reply #2 on: April 08, 2013, 02:56:20 am »
Quote
You can add them as to project options and save as default.

The projects are created from different Lazarus templates. So i need some of them  %)

Quote
But you better group your units into a package (just create a new empty package in a new folder, copy units into that folder, and in package: add files)

Then add that package to each project

There are different pathes, which i need, and some new comming additionally from time to time %)
Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: How to edit Path-Templates
« Reply #3 on: April 08, 2013, 04:31:47 am »
Well, I do recommend to find a way to use packages.
Experience (from what I read, what other people went through) shows that all else, will eventually get you into trouble.


But you can add the pathes in the fpc.cfg (same dir as fpc.exe)

That file is global, and pathes (or other settings) in there will be used by all projects


DimProfi

  • Full Member
  • ***
  • Posts: 126
    • http://www.dimprofi.de
Re: How to edit Path-Templates
« Reply #4 on: April 08, 2013, 04:37:46 am »
Packages are not good, because I'm compiling sometimes without Lazarus directly with FPC.

May be I will use a fpc.cfg solution or investigate Lazarus code, to find a source of path templates :)

Lazarus 1.2/FPC 2.6.4 (x86/x86_64/win32/win64/Linux) :: Be smart - use predictable {$INTERFACES CORBA}! :)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: How to edit Path-Templates
« Reply #5 on: April 08, 2013, 06:57:27 am »
Packages are not good, because I'm compiling sometimes without Lazarus directly with FPC.

You can also use lazbuild to build Lazarus projects/packages from the command line. Perhaps that could be useful?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Paul_

  • Full Member
  • ***
  • Posts: 143
Re: How to edit Path-Templates
« Reply #6 on: April 14, 2016, 03:46:52 pm »
It seems like $(TargetCPU)-$(TargetOS) doesn't work  in FPC.CFG. There is different tag?

Quote
-FuC:\Development\lib\zlib\$(TargetCPU)-$(TargetOS)

Unfortunately, nothing found in documentation about it.
« Last Edit: April 14, 2016, 05:49:22 pm by PaulCZ »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: How to edit Path-Templates
« Reply #7 on: April 15, 2016, 12:31:24 pm »
I have units which will be used in every project and its no fun to insert the pathes to a project every time
Alternatively you can use relative and absolute paths for your units when mentioning them in uses clause.
Code: Pascal  [Select][+][-]
  1. uses
  2.   MyLibUnit1 in '..\MyLib\MyLibUnit1.pas',      // relative path
  3.   MyLibUnit2 in 'C:\Prg\MyLib\MyLibUnit2.pas';  // absolute path
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018