]> git.saurik.com Git - wxWidgets.git/blob - include/msvc/wx/setup.h
significantly simplify this file by using token pasting in #incoude and #pragma comme...
[wxWidgets.git] / include / msvc / wx / setup.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msvc/wx/msw/setup.h
3 // Purpose: wrapper around the real wx/setup.h for Visual C++
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 2004-12-12
7 // RCS-ID: $Id$
8 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but
13 // the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined
14 // explicitly!
15
16 #ifdef _MSC_VER
17 #include "wx/version.h"
18 #include "wx/cpp.h"
19
20 // notice that wxSUFFIX_DEBUG is a string but wxSUFFIX itself must be an
21 // identifier as string concatenation is not done inside #include where we
22 // need it
23 #ifdef _DEBUG
24 #define wxSUFFIX_DEBUG "d"
25 #ifdef _UNICODE
26 #define wxSUFFIX ud
27 #else // !_UNICODE
28 #define wxSUFFIX d
29 #endif // _UNICODE/!_UNICODE
30 #else
31 #define wxSUFFIX_DEBUG ""
32 #ifdef _UNICODE
33 #define wxSUFFIX u
34 #else // !_UNICODE
35 #define wxSUFFIX
36 #endif // _UNICODE/!_UNICODE
37 #endif
38
39 #ifdef WXUSINGDLL
40 #define wxLIB_SUBDIR vc_dll
41 #else // !DLL
42 #define wxLIB_SUBDIR vc_lib
43 #endif // DLL/!DLL
44
45
46 // the real setup.h header file we need is in the build-specific directory,
47 // construct the path to it
48 #define wxSETUPH_PATH \
49 wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /msw, wxSUFFIX, /wx/setup.h)
50 #define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH)
51
52 #include wxSETUPH_PATH_STR
53
54
55 // the library names depend on the build, these macro builds the correct
56 // library name for the given base name
57 #define wxSUFFIX_STR wxSTRINGIZE(wxSUFFIX)
58 #define wxSHORT_VERSION_STRING \
59 wxSTRINGIZE(wxMAJOR_VERSION) wxSTRINGIZE(wxMINOR_VERSION)
60
61 #define wxWX_LIB_NAME(name, subname) \
62 "wx" name wxSHORT_VERSION_STRING wxSUFFIX_STR subname
63
64 #define wxBASE_LIB_NAME(name) wxWX_LIB_NAME("base", "_" name)
65 #define wxMSW_LIB_NAME(name) wxWX_LIB_NAME("msw", "_" name)
66
67 // this one is for 3rd party libraries: they don't have the version number
68 // in their names and usually exist in ANSI version only (except for regex)
69 #define wx3RD_PARTY_LIB_NAME(name) "wx" name wxSUFFIX_DEBUG
70
71 // special version for regex as it does have a Unicode version
72 #define wx3RD_PARTY_LIB_NAME_U(name) "wx" name wxSUFFIX_STR
73
74 #pragma comment(lib, wxWX_LIB_NAME("base", ""))
75 #pragma comment(lib, wxBASE_LIB_NAME("net"))
76 #pragma comment(lib, wxBASE_LIB_NAME("xml"))
77 #if wxUSE_REGEX
78 #pragma comment(lib, wx3RD_PARTY_LIB_NAME_U("regex"))
79 #endif
80
81 #if wxUSE_GUI
82 #if wxUSE_XML
83 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("expat"))
84 #endif
85 #if wxUSE_LIBJPEG
86 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("jpeg"))
87 #endif
88 #if wxUSE_LIBPNG
89 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("png"))
90 #endif
91 #if wxUSE_LIBTIFF
92 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("tiff"))
93 #endif
94 #if wxUSE_ZLIB
95 #pragma comment(lib, wx3RD_PARTY_LIB_NAME("zlib"))
96 #endif
97
98 #pragma comment(lib, wxMSW_LIB_NAME("adv"))
99 #pragma comment(lib, wxMSW_LIB_NAME("core"))
100 #pragma comment(lib, wxMSW_LIB_NAME("html"))
101 #if wxUSE_GLCANVAS
102 #pragma comment(lib, wxMSW_LIB_NAME("gl"))
103 #endif
104 #if wxUSE_DEBUGREPORT
105 #pragma comment(lib, wxMSW_LIB_NAME("qa"))
106 #endif
107 #if wxUSE_XRC
108 #pragma comment(lib, wxMSW_LIB_NAME("xrc"))
109 #endif
110 #if wxUSE_AUI
111 #pragma comment(lib, wxMSW_LIB_NAME("aui"))
112 #endif
113 #if wxUSE_RICHTEXT
114 #pragma comment(lib, wxMSW_LIB_NAME("richtext"))
115 #endif
116 #if wxUSE_MEDIACTRL
117 #pragma comment(lib, wxMSW_LIB_NAME("media"))
118 #endif
119 #if wxUSE_ODBC
120 #pragma comment(lib, wxMSW_LIB_NAME("odbc"))
121 #endif
122 #endif // wxUSE_GUI
123 #else
124 #error "This file should only be included when using Microsoft Visual C++"
125 #endif
126