1
0
Fork 0
flightgear/src/Scripting/CMakeLists.txt
Florent Rougon 48f52f14c4 Improved infrastructure for add-ons: C++ classes, metadata file, Nasal interface
This commit adds C++ classes for add-on management, most notably
AddonManager, Addon and AddonVersion. The AddonManager is used to
register add-ons. It relies on an std::map<std::string, AddonRef> to
hold the metadata of each registered add-on (keys of the std::map are
add-on identifiers, and AddonRef is currently SGSharedPtr<Addon>).
Accessor methods are available for:

  - retrieving the list of registered or loaded add-ons (terminology
    explained in $FG_ROOT/Docs/README.add-ons);

  - checking if a particular add-on has already been registered or
    loaded;

  - for each add-on, obtaining an Addon instance which can be queried
    for its name, id, version, base path, the minimum and maximum
    FlightGear versions it requires, its base node in the Property Tree,
    its order in the load sequence, short and long description strings,
    home page, etc.

The most important metadata is made accessible in the Property Tree
under /addons/by-id/<addon-id> and the property
/addons/by-id/<addon-id>/loaded can be checked or listened to, in
order to determine when a particular add-on is loaded. There is also a
Nasal interface to access add-on metadata in a convenient way.

In order to provide this metadata, each add-on must from now on have in
its base directory a file called 'addon-metadata.xml'.

All this is documented in much more detail in
$FG_ROOT/Docs/README.add-ons.

Mailing-list discussion:

  https://sourceforge.net/p/flightgear/mailman/message/36146017/
2017-12-08 00:36:41 +01:00

48 lines
877 B
CMake

include(FlightGearComponent)
set(SOURCES
NasalSys.cxx
nasal-props.cxx
NasalAddons.cxx
NasalAircraft.cxx
NasalPositioned.cxx
NasalPositioned_cppbind.cxx
NasalCanvas.cxx
NasalClipboard.cxx
NasalCondition.cxx
NasalHTTP.cxx
NasalString.cxx
NasalModelData.cxx
NasalSGPath.cxx
)
set(HEADERS
NasalSys.hxx
NasalSys_private.hxx
NasalAddons.hxx
NasalAircraft.hxx
NasalPositioned.hxx
NasalCanvas.hxx
NasalClipboard.hxx
NasalCondition.hxx
NasalHTTP.hxx
NasalString.hxx
NasalModelData.hxx
NasalSGPath.hxx
)
if(WIN32)
list(APPEND SOURCES ClipboardWindows.cxx)
elseif(APPLE)
list(APPEND SOURCES ClipboardCocoa.mm)
else()
find_package(X11)
if(X11_FOUND)
list(APPEND SOURCES ClipboardX11.cxx)
else()
list(APPEND SOURCES ClipboardFallback.cxx)
endif()
endif()
flightgear_component(Scripting "${SOURCES}" "${HEADERS}")