Reputation: 545
I have a large, crossplatform, python-dependent project, which is built by CMake. In linux, python is either preinstalled or easily retrived by shell script. But on windows build, i have to install python manually from .msi before running CMake. Is there any good workaround using cmake scripts?
PS All other external dependencies are downloaded from dedicated FTP server.
Upvotes: 2
Views: 1332
Reputation: 7874
Python doesn't really have to be installed to function properly. For my own CMake based projects on Windows, I just use a .zip file containing the entire python tree. All you need to do is extract it to a temporary directory, add it to your path, and set your PYTHONHOME/PYTHONPATH environment variables. Once that's done, you have a fully operational Python interpreter at your disposal. About the only 'gotcha' on Windows is to make sure you remember to copy the Python DLL out of C:\Windows\system32 into the top-level Python directory prior to creating the .zip.
Upvotes: 2