Recent

Author Topic: Converting from Delphi to Lazarus - include files in my shared package  (Read 2424 times)

MISV

  • Hero Member
  • *****
  • Posts: 792
Relatively new to Lazaus:

I have a shared source directory containing maybe 100 source .pas and .dfm files. It also includes some visual components. Hence it also has a package. All this is shared beween all projects.

Each project then have some include files (e.g. banned serials, if running in debug mode etc.) in each project direcory.

The shared library source code tries cerain places to include these files that vary beween each project.

In Delphi I solve the problem byhaving "dummy"/"default" include files in my shared source directory. That works when compiling packages themselves in both Delphi and Lazarus.

However, when compiling projects, I set Delphi to use the include files in the project path which works great... Now, if I am correct... With the way Lazarus handles/requires packages, this will not be possible? In Lazarus I can not just point a project to search paths for source files. Instead I have to point to packages that all have their own search paths?

Am I correct I will need to "redesign" my usage of include files?


hinst

  • Sr. Member
  • ****
  • Posts: 303
In package options: Compiler Options -> Paths -> Include files -> Enter: $(LOLPATH)
In project options: Compiler Options -> Additions and Overrides -> Add IDE Macro, stored in project -> Enter LOLPATH := $(ProjPath) or any other path, ProjPath points directory to where your .lpi and .lpr files are

so LOLPATH will get propagated from project to package, and package will search for include files in specified directory while compiling. I found that it propagates only when creating "IDE macro" thing, not "Custom macro"

http://wiki.freepascal.org/IDE_Macros_in_paths_and_filenames
http://wiki.freepascal.org/IDE_Window:_Compiler_Options#Project_macros

-------
and that is how you can alter package behavior for specific projects......
« Last Edit: July 29, 2014, 06:29:29 pm by hinst »
Too late to escape fate

MISV

  • Hero Member
  • *****
  • Posts: 792
Thanks - I am keeping this! Thought I had to refactor quite a bit of source
« Last Edit: August 14, 2014, 01:37:28 pm by MISV »

 

TinyPortal © 2005-2018