Author Topic: C++ Code generation and folders  (Read 680 times)

Thomas Arnbjerg

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
C++ Code generation and folders
« on: October 11, 2024, 05:55:21 pm »
The default C++ code generator in EA places header and body files in the same location.
Is there a way to configure EA to separate the two while maintaining the tree structure in the model - i.e.

In the EA model:

<Namespace root package>
  |___Class1
  |
  |_Child_Package
             |
             |__Class2

The wanted structure of the generated code with destination folder <Source Root>->Inc:

<Source Root>
  |__Inc
  |      |_Package     
  |           |_Class1.hpp
  |           |_Child_Package
  |                     |__Class2.hpp
  |__Src     
          |_Class1.cpp
          |_Child_Package
                    |__Class2.cpp

If I set the 'Source Path' property for C++ to '../Src' under preferences the tree structure works for the header files (hpp) but the body files are generated under 'Inc->Src' and the tree structure is removed - i.e. the structure of the generated code becomes (the location of 'Class2.cpp' is wrong):

<Source Root>
  |__Inc
  |      |_Class1.hpp
  |      |_Child_Package
  |      |           |__Class2.hpp
  |      |_Src
  |           |_Class2.ccpp         
  |__Src       
         |_Class1.cpp
 

Any suggestions?