Conditional dependency lazarus / 9-Editor ---------------------------------------------------------------------- Ocye · 2013-08-14 10:00 I'm using OpenGl in a project that is compiled as well for Qt which lacks on Gl binding hitherto. In this case I use to comment out those passages by {$ifdef LCLQt} but additionally I have to remove the dependency to LazOpenGlContext. Is there a convenient way to do it, perhaps by one of the newly introduced features? I'm using the most recent version from svn trunk. ---------------------------------------------------------------------- User137 · 2013-08-14 12:28 This is not something i have ever tried myself, but you could divide the project into 2 project files for unique settings. Both projects would then use same lfm and unit files, so changes to other would immediately be seen in the other too. ---------------------------------------------------------------------- Ocye · 2013-08-14 12:50 Good idea but it sounds similar time-consuming as removing/adding the dependency (which is not really demanding, so my issue is rather some kind of luxury problem). I've seen options to compile with conditions; something like this (sorry, I'm currently on a different PC) Quoteif Darwin then   //do something end;(I use to comment out the -XR MacOSX10.5.sdk stuff) ---------------------------------------------------------------------- hinst · 2013-09-20 16:01 I honestly absolutely don't get what you are doing and what you are trying to achieve If you have a package which you don't actually use in the project, it won't be compiled into the project, so if you have source like this   {$IfNDef LCLQt}     UnitFromLazOpenGLContext   {$EndIf} Then UnitFromLazOpenGLContext package won't be compiled unless LCLQt is undefined. You can add as many packages to project dependencies as you want; this does not mean that they will be necessarily used and compiled. So... you don't have to remove it. why would you remove it ---------------------------------------------------------------------- Ocye · 2013-09-20 16:20 And how do you deal with dependencies? The list of needed packages includes lazopenglcontext, or not in case of Qt. ---------------------------------------------------------------------- hinst · 2013-09-20 18:52 Quote from: Ocye on September 20, 2013, 06:20:20 pmAnd how do you deal with dependencies? The list of needed packages includes lazopenglcontext, or not in case of Qt. have them both. Like I said, even if some unused package is in the project required packages list, it is not something that bad