Skip to content

Commit 8a63945

Browse files
pasnoxAllen Winter
authored andcommitted
Add basic qmake out of the box usage
Forward headers are now automatically generated when qmake'ing the project and examples can be disabled using CONFIG+=no_examples. The forward headers are unconditionally regenerated at each qmake call, while that is not optimal, it is sufficient most of the time as the project file is likely not to be modified.
1 parent 10c9537 commit 8a63945

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

autogen/autogen.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def checkVCS( sourceDirectory ):
6363

6464
return ( repositoryRevision, isTagged )
6565

66-
def autogen(project, version, subprojects, prefixed, forwardHeaderMap = {}, steps=["generate-cpack", "generate-configure", "generate-forward-headers"], installPrefix="$$INSTALL_PREFIX", policyVersion = 1):
66+
def autogen(project, version, subprojects, prefixed, forwardHeaderMap = {}, steps = ["generate-cpack", "generate-configure", "generate-forward-headers"], installPrefix="$$INSTALL_PREFIX", policyVersion = 1):
6767
global __policyVersion
6868
__policyVersion = policyVersion
6969
sourceDirectory = os.path.abspath( os.path.dirname( os.path.dirname( __file__ ) ) )
@@ -95,7 +95,7 @@ def autogen(project, version, subprojects, prefixed, forwardHeaderMap = {}, step
9595
includePath = os.path.join( sourceDirectory, "include" )
9696
srcPath = os.path.join( sourceDirectory, "src" )
9797

98-
if subprojects and "generate-cpack" in steps:
98+
if subprojects and "generate-forward-headers" in steps:
9999
forwardHeaderGenerator = ForwardHeaderGenerator(
100100
copy = True, path = sourceDirectory, includepath = includePath, srcpath = srcPath,
101101
project = project, subprojects = subprojects, prefix = installPrefix, prefixed = prefixed,
@@ -109,6 +109,10 @@ def autogen(project, version, subprojects, prefixed, forwardHeaderMap = {}, step
109109
os.utime( ".license.accepted", None )
110110
print( "-- License marked as accepted." )
111111

112+
if steps == ["generate-forward-headers"]:
113+
sys.stdout.flush()
114+
return
115+
112116
print( "-- Wrote build files to: {0}".format( buildDirectory ) )
113117
print( "-- Now running configure script." )
114118
print( "" )

gen-forward-headers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python
2+
from autogen.autogen import autogen
3+
4+
project = "KDReports"
5+
version = "1.7.50"
6+
subprojects = ["KDReports"]
7+
prefixed = True
8+
9+
autogen(project, version, subprojects, prefixed, steps = ["generate-forward-headers"], policyVersion = 2)

kdreports.pro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
TEMPLATE = subdirs
2-
SUBDIRS = src examples include
2+
system($$system_path(./gen-forward-headers.py))|error("Can't generate forward headers, please ensure python is available from this shell.")
3+
SUBDIRS = include src
4+
!no_examples: SUBDIRS += examples
35
unittests: SUBDIRS += unittests
46
CONFIG += ordered
57
VERSION = 1.8.0

0 commit comments

Comments
 (0)