summaryrefslogtreecommitdiffstats
path: root/win/common.pro
blob: f5c2f1af7b52fcfc0d2c36c09705910f06dc8cd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#
# common.pro - Common definitions for KDElibs/win32 .pro files
# (c) 2003-2005, Jaroslaw Staniek, js@iidea.pl
#

# to avoid a need for using Q_WS_WIN in C source code
DEFINES += _WINDOWS WIN32_LEAN_AND_MEAN

# custom definitions, options on which KDElibs do not depend
exists( custom_defs.pro ) {
  include( custom_defs.pro )
}

# common version info for all libs:
!contains( CONFIG, trinitylib ) {
	VER_MAJ = $(KDE_VER_MAJ)
	VER_MIN = $(KDE_VER_MIN)
	VER_PAT = $(KDE_VER_PAT)
}

CONFIG += qt thread warn_on 
isEmpty( KW_CONFIG ) {
  KW_CONFIG += debug
  #KW_CONFIG += release
  #KW_CONFIG += windows
  KW_CONFIG += console
}

# release switch has priority over debug
contains(KW_CONFIG,release) {
  CONFIG -= debug
  CONFIG += release
}
contains(KW_CONFIG,debug) {
  CONFIG += debug
  CONFIG -= release
}
contains(KW_CONFIG,windows) {
  CONFIG += windows
  CONFIG -= console
}
contains(KW_CONFIG,console) {
  CONFIG -= windows
  CONFIG += console
}

# global binary destination directory
isEmpty( KDEBINDESTDIR ) {
	KDEBINDESTDIR = $(TDEDIR)
}

# global library destination directory 
KDELIBDESTDIR = $$KDEBINDESTDIR\bin #shared with all binaries
###KDELIBDESTDIR = $$KDEBINDESTDIR\lib

# dlls suffixes for given target
isEmpty( KDEBUG ) {
  contains(CONFIG,debug) {
		KDEBUG=_d
		KDELIBDEBUG=_d
		KDELIBDEBUGLIB=_d.lib
  }
  !contains(CONFIG,debug) {
		KDEBUG=_
		contains(CONFIG,trinitylib) {
			KDELIBDEBUG=
		}
		!contains(CONFIG,trinitylib) {
			KDELIBDEBUG=_
		}
		KDELIBDEBUGLIB=.lib
  }
}
KDELIB_SUFFIX=$$KDEBUG$(KDE_VER).lib

contains( TEMPLATE, app ) {
  # default dest dir for "app"
#  contains(CONFIG,debug) {
    DESTDIR = $$KDEBINDESTDIR\bin
#  }
#  !contains(CONFIG,debug) {
#    DESTDIR = $$KDEBINDESTDIR\release-bin
#  }
	!contains(CONFIG,notdecore) {
			LIBS += $$KDELIBDESTDIR/tdecore$$KDELIB_SUFFIX
	}
	!contains(CONFIG,notdeui) {
			LIBS += $$KDELIBDESTDIR/tdeui$$KDELIB_SUFFIX
	}
	!contains(CONFIG,notdefx) {
			LIBS += $$KDELIBDESTDIR/tdefx$$KDELIB_SUFFIX
	}
}
# default template is "lib"
isEmpty( TEMPLATE ) {
  TEMPLATE = lib
}
contains( TEMPLATE, lib ) {
	CONFIG	+= dll

	# indicate that we building a library
	QMAKE_CXXFLAGS += -DKDE_MAKE_LIB=1

	# lib/trinity dest dir (for modules)
	contains( CONFIG, trinitylib ) {
	  DESTDIR = $$KDEBINDESTDIR/lib/trinity
	  TARGET_EXT = .dll #- no ver. in filename
	}
	!contains( CONFIG, trinitylib ) {
	  DESTDIR = $$KDELIBDESTDIR
	}
	contains( CONFIG, tdestyle ) {
	  DESTDIR = $$KDEBINDESTDIR/lib/trinity/plugins/styles
	  CONFIG += plugin
	}
#  !contains(CONFIG,debug) {
#    DESTDIR = $$KDEBINDESTDIR\release-lib
#  }

  VERSION		= $(KDE_VER_MAJ).$(KDE_VER_MIN).$(KDE_VER_PAT)
#  VER_MAJ	= $(KDE_VER_MAJ)
#  VER_MIN = $(KDE_VER_MIN)
#  VER_PAT = $(KDE_VER_PAT)
}

# win32 dependent lib
!contains( DEFINES, MAKE_KDEWIN32_LIB ) {
  LIBS += $$KDELIBDESTDIR/kdewin32$$KDELIB_SUFFIX
}

# libltdl:
!contains( DEFINES, MAKE_LTDL_LIB ) {
  !contains( DEFINES, MAKE_KDEWIN32_LIB ) {
    LIBS += $$KDELIBDESTDIR/ltdl$$KDELIB_SUFFIX
    DEFINES += LIBLTDL_DLL_IMPORT
  }
}

!contains( DEFINES, QT_DLL) {
  DEFINES += QT_DLL
}

# global definitions
win32-borland {
    QMAKE_CXXFLAGS += /I $(KDELIBS)/win/tdelibs_global_win.h
    QMAKE_CFLAGS += /I $(KDELIBS)/win/tdelibs_global_win.h
}
win32-msvc* {
    QMAKE_CXXFLAGS += /FI$(KDELIBS)/win/tdelibs_global_win.h
    QMAKE_CFLAGS += /FI$(KDELIBS)/win/tdelibs_global_win.h

    # Language Extensions
    QMAKE_CXXFLAGS += /Ze
}

# enable Run-Time Type Information (needed by dynamic_cast)
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_RTTI_ON  # /GR for msvc

# enables synchronous exception 
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EXCEPTIONS_ON # /GX for msvc

# catch Release-Build Errors in Debug Build
#DISABLED for msvc.net
#contains( CONFIG, debug ) {
#	contains( KW_CONFIG, debug ) {
#		QMAKE_CXXFLAGS += /GZ
#	}
#}

# create an output file whether or not LINK finds an undefined symbol
# (warning 4006 will be raised instead of error):
QMAKE_LFLAGS += /FORCE:MULTIPLE

# Specify that filename is a C++ source file, even if it doesn’t have 
# a .cpp or .cxx extension, thus .cc files are compiled properly with msvc
QMAKE_CXXFLAGS += /TP

INCLUDEPATH	+= moc $(KDELIBS)/win $(KDELIBS)

contains(KW_CONFIG,release) {
OBJECTS_DIR = obj_rel
}
!contains(KW_CONFIG,release) {
OBJECTS_DIR = obj
}

MOC_DIR = moc

# enable this to temporary add debug info!
# CONFIG += debug
# CONFIG -= release

!contains(CONFIG,debug) {
QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCR71D /NODEFAULTLIB:MSVCP71D
}
contains(CONFIG,debug) {
QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCR71 /NODEFAULTLIB:MSVCP71 /NODEFAULTLIB:libc
}