Make it possible to set Cura version from CMake

This helps with automating build so we can set version from one single
spot.
This commit is contained in:
Arjen Hiemstra 2015-11-01 22:02:54 +01:00
parent 2efcbc3c1f
commit 8d0924849f
3 changed files with 17 additions and 3 deletions

View file

@ -51,6 +51,11 @@ import numpy
import copy
numpy.seterr(all="ignore")
try:
from cura.CuraVersion import CuraVersion
except ImportError:
CuraVersion = "master"
class CuraApplication(QtApplication):
class ResourceTypes:
QmlFiles = Resources.UserType + 1
@ -62,7 +67,7 @@ class CuraApplication(QtApplication):
if not hasattr(sys, "frozen"):
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), ".."))
super().__init__(name = "cura", version = "15.09.91")
super().__init__(name = "cura", version = CuraVersion)
self.setWindowIcon(QIcon(Resources.getPath(Resources.Images, "cura-icon.png")))

4
cura/CuraVersion.py.in Normal file
View file

@ -0,0 +1,4 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
CuraVersion = "@CURA_VERSION@"