[CMake] Cannot create named generator when executing cmake through script (python)

corey taylor corey.taylor at gmail.com
Sat Aug 25 21:38:52 EDT 2007


Thanks for the tip.  Was editing existing library which used the old
os. calls and using subprocess allows me to pass the generator as an
argument for both windows and linux without messing with the quotes!

corey

On 8/24/07, Raphael Cotty <raphael.cotty at googlemail.com> wrote:
> Hi,
> Try that:
> if platform.platform(True, True) == "Windows-XP":
>         p1 = subprocess.Popen( ['cmake', '-DCMAKE_INSTALL_PREFIX=' +
> installDir, '-DCMAKE_TOOLCHAIN_FILE=' + toolChainFile, '-G', generator,
> '-DCMAKE_BUILD_TYPE=' + buildType, sourceDir], shell=True )
>     else:
>         p1 = subprocess.Popen( ['cmake', '-DCMAKE_INSTALL_PREFIX=' +
> installDir, '-DCMAKE_TOOLCHAIN_FILE=' + toolChainFile, '-G', generator,
> '-DCMAKE_BUILD_TYPE=' + buildType, sourceDir] )
>     output = p1.communicate()[0]
>
> With the appropriate variables set.
>
> Raph
>
>
> On 8/24/07, corey taylor < corey.taylor at gmail.com> wrote:
> >
> > I ran into a strange issue where on linux if I run cmake -G "Unix
> > Makefiles" via python.
> >
> > eg. os.spawnvp(os.P_WAIT, program, args)
> >
> > then cmake will error saying that it cannot create named generator
> > "Unix Makefiles".
> >
> > However, if I copy and run the exact command in the terminal,
> > everything runs fine.
> >
> > Any ideas?
> >
> > corey
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>
>


More information about the CMake mailing list