# Extra rules for Windows builds
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
+if(MINGW)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+ # gcc options for release and debug builds
+ IF(CMAKE_BUILD_TYPE STREQUAL Release)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+ ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+
+ set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+
+else(MINGW)
+ # Assume a Microsoft Visual C++ compiler
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
+endif(MINGW)
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
#)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_add_resources(RCC_SRCS ${RCCS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
va_list ap;
#ifdef Q_OS_WIN32
va_start(ap, fmt);
+# ifdef Q_CC_GNU
+ vsnprintf(str, sizeof(str), fmt, ap);
+# else
_vsnprintf_s(str, sizeof(str), _TRUNCATE, fmt, ap);
+# endif
va_end(ap);
#else
::va_start(ap, fmt);
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
inline QString expandPluginName(QString const & name)
{
#ifdef Q_OS_WIN32
+# ifdef Q_CC_MINGW
+ return "lib" + name + ".dll";
+# else
return name + ".dll";
+# endif
#elif defined Q_OS_LINUX
return "lib" + name + ".so";
#else
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc cli.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
#)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc gui.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_add_resources(RCC_SRCS ${RCCS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
)
# Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})