bld 644 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python
  2. import subprocess
  3. import os
  4. import sys
  5. def configure():
  6. os.mkdir("build")
  7. os.chdir("build")
  8. subprocess.call(["cmake",".."])
  9. def make():
  10. if os.path.isdir("build"):
  11. os.chdir("build")
  12. subprocess.call(["make"])
  13. else:
  14. print "project is not configured: run ./bld configure"
  15. def install():#currently not used
  16. if os.path.isdir("build"):
  17. os.chdir("build")
  18. subprocess.call(["make","install"])
  19. else:
  20. print "project is not configured: run ./bld configure"
  21. if len(sys.argv)==2 and sys.argv[1]=="configure": configure()
  22. elif len(sys.argv)==1: make()
  23. #elif len(sys.argv)==2 and sys.argv[1]=="install": install()