-
multiproject approach
Hello..
So I'm working on solution that has 2 projects (2 applications).
A few source files are being used by both applications.
One file is almost identical, except a few lines should be changed (boost::shared_from_this() instead of this; )
for instance:
for project 1 I need:
project 2 needs:
Code:
return shared_from_this();
Is this the right approach to put macro in front of this like:
Code:
#ifdef IS_MACRO_RETURN_THIS
return this;
#else
return shared_from_this();
#endif
Is this the right way to solve that kind of problems?
I havent faced with anything similar so far..
If so, where should I #define IS_MACRO_RETURN_THIS ? On top of main .cpp file?
If not, what would be the right way?
-
It sounds like potential maintenance trouble to me. Wouldn't it be better to factor out the common code, and then implement for each project using that common base?
-
you can define it in the project properties