Call CMake from python script results in "Could not create named generator"
cmake, python
Solution
You need to split the `-G` flag from its value in the command. Python appears to be effectively invoking
cmake "-G Visual Studio 11 Win64" <build_path>
What you want is more like:
cmakeCmd = ["cmake.exe", "-G", "Visual Studio 11 Win64", build_path]
Problem
I'm building a project that should be able to move freely between machines. In order to not have hundreds of MB of libs I'm writing a series of python scripts that download and build the dependencies as well as my own project. I'm using CMake to generate VS projects. To call CMake I build a command line and I use python `subprocess.check_call` as below ``` cmakeCmd = ["cmake.exe", '-G "Visual Studio 11 Win64"', build_path] retCode = subprocess.check_call(cmakeCmd, stderr=subprocess.STDOUT, shell=True) ``` The problem is that if I use `-G` option from CMake I get the following error regardless of the generator I choose: ``` CMake Error: Could not create named generator "Visual Studio 11 Win64" ``` I was thinking that should be some enviroment variable missing but the python path is complete with all my systems' variables. What is odd is that if I don't set the generator and let CMake choose the default one the script runs fine. I have no ideia why.