Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have both VCL and FMX in one application?

I have a VCL application and pretty isolated VCL code. I would like to include Fire Monkey forms for Mac OSX support.

I plan using heavily IFDEF to determine should I build for Windows with VCL or for Mac OSX with FireMonkey.

Unfortunately there is no way to add MacOS platform from the Project Manager if the application is VCL one.

Is there a way to hack this somehow? Maybe manually tweak the .dpr and .dproj files?

like image 737
Gad D Lord Avatar asked Feb 01 '26 23:02

Gad D Lord


1 Answers

What about doing it the other way around:

  • start with a FireMonkey application
  • add the OS X platform target
  • IFDEF it so that you can chooise between VCL or FireMonkey

It is not that hard to do this for a 1-form project, then add all the existing stuff from your current VCL dpr.

This might actually lead you to be able to figure out how the .dpr and .dproj of VCL and FireMonkey differ (I tried once, but it was too much to do in a short term way, so I shelved it for future research).

Note:

Be very careful when putting IFDEF in your DPR files. The Delphi IDE owns DPR files, and will remove the IFDEFS, for instance when you add new forms or change some project properties.

like image 72
Jeroen Wiert Pluimers Avatar answered Feb 04 '26 13:02

Jeroen Wiert Pluimers