How to recompile source file every time while using cmake 2.8.2 in single build for c++11 and c++98 for shared library creation?
I have a project directory structure of: Root Source Common MyFolder ++ My 3 source files and header When I am building my project it generates 3 to 4 shared libraries. Lib1 compiled using c++98 and others using c++11. Flags are added in CmakeList.txt which is at root. I need my 3 source files to be compiled for Lib1 and for other Libs as as well. but here what happens is compiler is first compiling my source file for lib using c++11 and then it is trying to use same .o file for Lib1 as well. So for .o file which is generated using c++11 is throwing exception when same is used for c++98