Shape, Time and Pizza - Xc++ libraries built with CMake

The Pizza example contains three libraries expressed in the Xc++ language:

Project Description
Shapes The Shapes sample library defines data types which represent shapes.
Time The Time sample library defines data types which represent dates and times.
Pizza The Pizza sample library defines data types for a pizza delivery business.

They have the following link dependencies:

link dependencies

These three libraries are built using CMake, using the following statements in the MyCompany/CMakeLists.txt file:


cedaTarget(XCPP NAMESPACE MyCompany PROJPATH MyCompany/Time)
target_link_libraries(Time 
    PUBLIC Ceda::cxUtils 
           Ceda::cxObject 
           Ceda::cxPersistStore)

cedaTarget(XCPP NAMESPACE MyCompany PROJPATH MyCompany/Shapes)
target_link_libraries(Shapes 
    PUBLIC Ceda::cxUtils 
           Ceda::cxObject 
           Ceda::cxPersistStore)

cedaTarget(XCPP NAMESPACE MyCompany PROJPATH MyCompany/Pizza)
target_link_libraries(Pizza 
    PUBLIC Ceda::cxUtils 
           Ceda::cxObject 
           Ceda::cxPersistStore
           MyCompany::Time
           MyCompany::Shapes)

Note that the link dependencies have to be repeated in the xcpj files (see the subproj section in MyCompany/Pizza/src/Pizza.xcpj ).


subproj
{
    "Ceda/cxUtils"
    "Ceda/cxObject"
    "Ceda/cxPersistStore"
    "MyCompany/Time"
    "MyCompany/Shapes"
}

If the sub-projects aren't defined correctly then the Xc++ compiler doesn't generate the right code to register the reflected data types.

Needing to express the link dependencies twice - i.e. in both the CMakeLists.txt file and the xcpj files happened because Xc++ originally had it's own build system before using CMake. This deficiency will be addressed in the future.