make_win32.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ############################################################
  2. # FlatCAM: 2D Post-processing for Manufacturing #
  3. # http://flatcam.org #
  4. # Author: Juan Pablo Caram (c) #
  5. # Date: 2/5/2014 #
  6. # MIT Licence #
  7. # #
  8. # Creates a portlable copy of FlatCAM, including Python #
  9. # itself and all dependencies. #
  10. # #
  11. # This is not an aid to install FlatCAM from source on #
  12. # Windows platforms. It is only useful when FlatCAM is up #
  13. # and running and ready to be packaged. #
  14. ############################################################
  15. # Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/,
  16. # scipy.lib.lapack.flapack.pyd, scipy.lib.blas.fblas.pyd,
  17. # numpy.core._dotblas.pyd, scipy.sparse.sparsetools._bsr.pyd,
  18. # scipy.sparse.sparsetools._csr.pyd, scipy.sparse.sparsetools._csc.pyd,
  19. # scipy.sparse.sparsetools._coo.pyd
  20. import os, site, sys
  21. from cx_Freeze import setup, Executable
  22. ## Get the site-package folder, not everybody will install
  23. ## Python into C:\PythonXX
  24. site_dir = site.getsitepackages()[1]
  25. include_files = []
  26. include_files.append((os.path.join(site_dir, "shapely"), "shapely"))
  27. include_files.append((os.path.join(site_dir, "matplotlib"), "matplotlib"))
  28. include_files.append(("share", "share"))
  29. include_files.append((os.path.join(site_dir, "rtree"), "rtree"))
  30. include_files.append(("README.md", "README.md"))
  31. include_files.append(("LICENSE", "LICENSE"))
  32. base = None
  33. ## Lets not open the console while running the app
  34. if sys.platform == "win32":
  35. base = "Win32GUI"
  36. buildOptions = dict(
  37. compressed=False,
  38. include_files=include_files,
  39. icon='share/flatcam_icon48.ico',
  40. # excludes=['PyQt4', 'tk', 'tcl']
  41. excludes=['scipy.lib.lapack.flapack.pyd',
  42. 'scipy.lib.blas.fblas.pyd',
  43. 'QtOpenGL4.dll']
  44. )
  45. print(("INCLUDE_FILES", include_files))
  46. exec(compile(open('clean.py').read(), 'clean.py', 'exec'))
  47. setup(
  48. name="FlatCAM",
  49. author="Juan Pablo Caram",
  50. version="8.5",
  51. description="FlatCAM: 2D Computer Aided PCB Manufacturing",
  52. options=dict(build_exe=buildOptions),
  53. executables=[Executable("FlatCAM.py", base=base)]
  54. )