[Kstars-devel] [PATCH] Xplanet support for display of planets
Jasem Mutlaq
mutlaqja at ikarustech.com
Tue Dec 16 06:36:44 CET 2008
> > The problem is that since this feature depends on xplanet, maybe some
> > users will not want to have the new page in config panel, the entry in
> > context menu, etc... but I dont know how to give the user the choice to
> > compile or not this feature.
>
> Same is my case; I'll try to figure out, though.
You'll have to write something like FindXPLANET.cmake to locate xplanet on the
system. You'll find plenty of examples of cmake files under
kdeedu/cmake/modules. Then you need to add to config-kstars.cmake the
following:
/* Define if you have xplanet */
#cmakedefine HAVE_XPLANET_H 1
Next, in kdeedu/kstars/CMakelists.txt, you can add the following:
macro_optional_find_package(XPLANET)
macro_bool_to_01(XPLANET_FOUND HAVE_XPLANET_H)
Finally, make sure to include config-kstars.h in your source files and you can
simply use:
#ifdef HAVE_XPLANET_H
code if we have xplanet
#endif
Hope this helps.
--
Regards,
Jasem Mutlaq
More information about the Kstars-devel
mailing list