[CMake] Changing compiler at runtime

Brandon Van Every bvanevery at gmail.com
Sun Nov 25 02:39:06 EST 2007


On Nov 25, 2007 2:12 AM, Gonzalo Garramuño <ggarra at advancedsl.com.ar> wrote:
>
> Recently, Josef Karthauser was requesting the ability to change the
> compiler at runtime.
>
> I am now more or less seconding that request or asking for workarounds.
>
> The situation:
>         I have a complex project built for windows that has several plug-ins
> that, for each version of the project, needs to be compiled with a
> particular compiler version to keep binary compatibility.  Thus, my v3.0
> needs to be built against vc6, my v4.0 against vc7.1, my v5.0 against
> vc8, etc.
>         I am automating the build process for each build as an out of source
> build, but I also need to automate the changing of the compiler.

I don't get it.  Why do you need to resolve any of this at runtime?
Resolve it 5 times at configuration time, run 5 different
configurations.  It would be 10 lines in your favorite scripting
language.  Could invoke with "cmake -P mybuildscript" if you don't
mind CMake script and don't want another language dependency.


Cheers,
Brandon Van Every


More information about the CMake mailing list