c++ - Embarcadero C++Builder: Transitive project dependencies and includes? -


let's have such project dependencies:

  • serialportdemo (exe) --> serialport (dll) -> byteio (dll).
  • xyz-app (exe) -> xyz-lib (dll) -> byteio (dll)

each dll project has 2 folders, include , src. include contains public interface header(s) , src/ implementation along non-public headers.

being used cmake's target_include_directories public, private , interface keywords, i'd tell byteio project if , directory consumers have add own list of include directories in order use byteio project. same applies linked libraries - again, target_link_libraries in cmake.

right forced add byteio's include directory manually each , every project directly or indirectly depending on byteio's headers. example, class serialport in serialport.dll project subclasses byteio defined in byteio.ddl project , therefore project serialportdemo.exe has add (public) include paths of both projects, byteio , serialport. tiny example above (serialportdemo, serialport, xyz-app , xyz-lib) huge waste of time , error-prone.

does not work:

  • option sets: limited of use relative include path needs change according location of consumer project of dll project. workaround come far add full paths include path list in option set - unacceptable.
  • environment variables: not acceptable solution, forces me check out projects on specific location and/or denies me possibility have project checked out multiple times on same machine.

does embarcadero c++builder xe8 offer sane, maintainable solution problem?

right forced add byteio's include directory manually each , every project directly or indirectly depending on byteio.

you need add projects directly depend on byteio (serialport , xyz-lib). there no reason other projects (serialportdemo , xyz-app) have reference byteio @ all.

does embarcadero c++builder xe8 offer solution problem?

one thing comes mind create option set contains shared settings, path byteio folders, , save .optset file. can apply option set each project needed. can import .optset file directly project, overwriting current configuration. or can create reference .optset file multiple projects can share it.

if not work, can create custom environment variable points @ byteio's include folder, , add variable includes path of each project.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -