So, I will tell you how I do it so they work both on 32 and 64 Win platforms:
My packages
I have these major packages/folders:
- Graphics32
- Drag and Drop (Melander)
- 3rd Party (many small packages put together in a big package)
- CommonPackages (these are my own packages)
Package setup
Double click the DPK file to load it in Delphi. Go to project's settings and set xxxxxxxxxxxx.This will ensure that the IDE and app that use this package don't have access to the package's PAS files. If the IDE has access to the PAS file it will recompile the files every time you complile the app.Even worst, if the IDE recompiles package's files, it will put the DCUs in app's folder!
Also unckeck 'Build as needed'. xxxxxxxxxxx
IDE setup
IDE setup - Package output directory
- For Win32 platform set it to: $(BDSCOMMONDIR)\Bpl
- For Win64 platform set it to: $(BDSCOMMONDIR)\Bpl\$(Platform)
IDE setup - Library path settings
In Delphi options -> Library -> Library path, I set these paths for Win32 platform:
- c:\MyProjects\Packages\DragDrop\$(Platform)
- c:\MyProjects\Packages\Graphics32\$(Platform)
- c:\MyProjects\Packages\Third party packages\$(Platform)
- c:\MyProjects\Packages\CubicCommonControls\$(Platform)_$(Config)
CommonPackages are multi-platform (Win32/64) and multi-config (debug, prerelease, release). Therefore, we use $(Config) in the path.
If the control uses *.res files you need to manually copy them in the $(Platform) folder (the folder where the DCU are written)
This is Delphi's help page for Browsing path: Specifies search paths where the compiler can find the required files for the package, such as .dcp and .bpi files.
This is the Delphi global library path. The compiler can find only those files that exist on the Library path. If you try to build your package with a file that is not on the Library path, you receive a compiler error.
Some resource files (such as controls.res) are only available in the Release folder (not the Debug folder), so you should ensure that your project Release directory either is specified in the Library path or will be resolved by at least one variable in the Library path.
Browse path
In Delphi options -> Library ->:Enter the path to package's source code so the IDE will able to reach the code (for example to be able to open a file when you control+click a method in IDE):
- c:\MyProjects\Packages\DragDrop\
- c:\MyProjects\Packages\Graphics32\
- c:\MyProjects\Packages\Third party packages\
- c:\MyProjects\Packages\CubicCommonControls\
- The project Search path for Delphi ( Project > Options > Delphi Compiler ) or the Include path for C++ ( Project > Options > Directories and Conditionals).
- The global browsing path (this option) for Win32 Delphi language projects;
the directories specified with this option are appended to the debug source path
for the project. Therefore, the debugger search order for unit files is
determined by the following path settings:
- The Browsing path (this option).
- The project Source path (the directory in which the project was saved).
Search path
I am not sure you really need the thing below (I think you don't):The project's 'Search Path' is set like this (for all platforms):
- c:\MyProjects\Packages\DragDrop\$(Platform)
- c:\MyProjects\Packages\Graphics32\$(Platform)
- c:\MyProjects\Packages\Third party packages\$(Platform)
- c:\MyProjects\Packages\CubicCommonControls\$(Platform)_$(Config)
You have to do the same for 32 and 64 bit platforms (in the 'Selected Platform' dropdown menu).
The applications
For applications (DPR) that are using the packages specified above I set the 'Unit output directory' like this (for 'All configurations/All platforms'):- .\$(Platform)_$(Config)
__________
Update: I had problems making a project to work when when I used a combination of $(Platform)_$(Config) and $(Platform) in the paths. It worked after I replaced $(Platform)_$(Config) with $(Platform).
No comments:
Post a Comment