diff options
Diffstat (limited to 'Source/CMakeSetupCMD.cxx')
-rw-r--r-- | Source/CMakeSetupCMD.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/CMakeSetupCMD.cxx b/Source/CMakeSetupCMD.cxx index 8e64324..8fecfad 100644 --- a/Source/CMakeSetupCMD.cxx +++ b/Source/CMakeSetupCMD.cxx @@ -1,6 +1,7 @@ -#include "cmDSWMakefile.h" -#include "cmDSPMakefile.h" -#include <iostream> +#include "cmStandardIncludes.h" +#include "cmMakefile.h" +#include "cmMSProjectGenerator.h" + // this is the command line version of CMakeSetup. // It is called from Visual Studio when a CMakeLists.txt @@ -21,7 +22,6 @@ void SetArgs(cmMakefile& builder, int ac, char** av) if(arg.find("-D",0) != std::string::npos) { std::string path = arg.substr(2); - std::cerr << "set makefile dir " << path.c_str() << std::endl; builder.SetCurrentDirectory(path.c_str()); } if(arg.find("-O",0) != std::string::npos) @@ -44,24 +44,25 @@ main(int ac, char** av) if(ac < 3) { std::cerr << "Usage: " << av[0] << - " Makefile.in -[DSP|DSW] -Hinsighthome -Dcurrentdir -Ooutput directory" << std::endl; + " CMakeLists.txt -[DSP|DSW] -Hinsighthome -Dcurrentdir" + " -Ooutput directory" << std::endl; return -1; } std::string arg = av[2]; + cmMakefile builder; + SetArgs(builder, ac, av); + cmMSProjectGenerator* pg = new cmMSProjectGenerator; if(arg.find("-DSP", 0) != std::string::npos) { - cmDSPMakefile builder; - SetArgs(builder, ac, av); - builder.ReadMakefile(av[1]); - builder.OutputDSPFile(); + pg->SetBuildDSP(); } else { - cmDSWMakefile builder; - SetArgs(builder, ac, av); - builder.ReadMakefile(av[1]); - builder.OutputDSWFile(); + pg->SetBuildDSW(); } + builder.SetMakefileGenerator(pg); + builder.ReadMakefile(av[1]); + builder.GenerateMakefile(); return 0; } |