]> Creatis software - cpPlugins.git/blob - lib/third_party/Pluma/Config.hpp
2fa7df5a21627b5ad983ffc12e1f75cba07f9924
[cpPlugins.git] / lib / third_party / Pluma / Config.hpp
1 ////////////////////////////////////////////////////////////\r
2 //\r
3 // Pluma - Plug-in Management Framework\r
4 // Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)\r
5 //\r
6 // This software is provided 'as-is', without any express or implied warranty.\r
7 // In no event will the authors be held liable for any damages arising from the use of this software.\r
8 //\r
9 // Permission is granted to anyone to use this software for any purpose,\r
10 // including commercial applications, and to alter it and redistribute it freely,\r
11 // subject to the following restrictions:\r
12 //\r
13 // 1. The origin of this software must not be misrepresented;\r
14 //    you must not claim that you wrote the original software.\r
15 //    If you use this software in a product, an acknowledgment\r
16 //    in the product documentation would be appreciated but is not required.\r
17 //\r
18 // 2. Altered source versions must be plainly marked as such,\r
19 //    and must not be misrepresented as being the original software.\r
20 //\r
21 // 3. This notice may not be removed or altered from any source distribution.\r
22 //\r
23 ////////////////////////////////////////////////////////////\r
24 \r
25 \r
26 ////////////////////////////////////////////////////////////\r
27 //\r
28 // Based on SFML configuration header\r
29 // SFML Config.hpp:\r
30 // http://www.sfml-dev.org/documentation/2.0/Config_8hpp-source.htm\r
31 //\r
32 // Acknowledgements to Simple and Fast Multimedia Library\r
33 // http://www.sfml-dev.org/\r
34 //\r
35 ////////////////////////////////////////////////////////////\r
36 \r
37 \r
38 #ifndef PLUMA_CONFIG_HPP\r
39 #define PLUMA_CONFIG_HPP\r
40 \r
41 \r
42 ////////////////////////////////////////////////////////////\r
43 // Identify the operating system\r
44 ////////////////////////////////////////////////////////////\r
45 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)\r
46 \r
47     // Windows\r
48     #define PLUMA_SYS_WINDOWS\r
49     #ifndef WIN32_LEAN_AND_MEAN\r
50         #define WIN32_LEAN_AND_MEAN\r
51     #endif\r
52     #ifndef NOMINMAX\r
53         #define NOMINMAX\r
54     #endif\r
55 \r
56 #elif defined(linux) || defined(__linux)\r
57 \r
58     // Linux\r
59     #define PLUMA_SYS_LINUX\r
60 \r
61 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)\r
62 \r
63     // MacOS\r
64     #define PLUMA_SYS_MACOS\r
65 \r
66 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)\r
67 \r
68     // FreeBSD\r
69     #define PLUMA_SYS_FREEBSD\r
70 \r
71 #else\r
72 \r
73     // Unsupported system\r
74     #error This operating system is not supported by this library\r
75 \r
76 #endif\r
77 \r
78 \r
79 \r
80 ////////////////////////////////////////////////////////////\r
81 // Define library file extension based on OS\r
82 ////////////////////////////////////////////////////////////\r
83 #ifdef PLUMA_SYS_WINDOWS\r
84      #define PLUMA_LIB_EXTENSION "dll"\r
85 #elif defined(PLUMA_SYS_MACOS)\r
86      #define PLUMA_LIB_EXTENSION "dylib"\r
87 #elif defined(PLUMA_SYS_LINUX) || defined(PLUMA_SYS_FREEBSD)\r
88      #define PLUMA_LIB_EXTENSION "so"\r
89 #else\r
90    // unknown library file type\r
91     #error Unknown library file extension for this operating system\r
92 #endif\r
93 \r
94 \r
95 ////////////////////////////////////////////////////////////\r
96 // Define portable import / export macros\r
97 ////////////////////////////////////////////////////////////\r
98 \r
99 #include <Pluma/cpPlugins_Pluma_Export.h>\r
100 #define PLUMA_API cpPlugins_Pluma_EXPORT\r
101 \r
102 /* ===================================================================\r
103  * florez-l@javeriana.edu.co: use dll macro defined from cmake instead\r
104  * ===================================================================\r
105  #if defined(PLUMA_SYS_WINDOWS)\r
106 \r
107  #ifndef PLUMA_STATIC\r
108 \r
109  // Windows platforms\r
110  #ifdef PLUMA_EXPORTS\r
111 \r
112  // From DLL side, we must export\r
113  #define PLUMA_API __declspec(dllexport)\r
114 \r
115  #else\r
116 \r
117  // From client application side, we must import\r
118  #define PLUMA_API __declspec(dllimport)\r
119 \r
120  #endif\r
121 \r
122  // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.\r
123  // You can read lots ot different things about it, but the point is the code will\r
124  // just work fine, and so the simplest way to get rid of this warning is to disable it\r
125  #ifdef _MSC_VER\r
126 \r
127  #pragma warning(disable : 4251)\r
128 \r
129  #endif\r
130 \r
131  #else\r
132 \r
133  // No specific directive needed for static build\r
134  #define PLUMA_API\r
135 \r
136  #endif\r
137 \r
138  #else\r
139 \r
140  // Other platforms don't need to define anything\r
141  #define PLUMA_API\r
142 \r
143  #endif\r
144 */\r
145 \r
146 #endif // PLUMA_CONFIG_HPP\r