QxOrm.pri 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. #############################################################################
  2. ##
  3. ## https://www.qxorm.com/
  4. ## Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
  5. ##
  6. ## This file is part of the QxOrm library
  7. ##
  8. ## This software is provided 'as-is', without any express or implied
  9. ## warranty. In no event will the authors be held liable for any
  10. ## damages arising from the use of this software
  11. ##
  12. ## Commercial Usage
  13. ## Licensees holding valid commercial QxOrm licenses may use this file in
  14. ## accordance with the commercial license agreement provided with the
  15. ## Software or, alternatively, in accordance with the terms contained in
  16. ## a written agreement between you and Lionel Marty
  17. ##
  18. ## GNU General Public License Usage
  19. ## Alternatively, this file may be used under the terms of the GNU
  20. ## General Public License version 3.0 as published by the Free Software
  21. ## Foundation and appearing in the file 'license.gpl3.txt' included in the
  22. ## packaging of this file. Please review the following information to
  23. ## ensure the GNU General Public License version 3.0 requirements will be
  24. ## met : http://www.gnu.org/copyleft/gpl.html
  25. ##
  26. ## If you are unsure which license is appropriate for your use, or
  27. ## if you have questions regarding the use of this file, please contact :
  28. ## contact@qxorm.com
  29. ##
  30. #############################################################################
  31. ###########################################
  32. # QxOrm library requires a C++11 compiler #
  33. ###########################################
  34. # Qt framework requires a C++11 compiler since version Qt 5.7
  35. # So for all previous Qt versions, we need to define CONFIG += c++11
  36. # Please note that QxOrm library doesn't require a full compliant C++11 compiler : for example, QxOrm library can be built and used with MSVC 2012, GCC 4.5 or Clang 3.2
  37. lessThan(QT_MAJOR_VERSION, 5) {
  38. CONFIG += c++11
  39. # QMAKE_CXXFLAGS += -std=c++11
  40. } else {
  41. equals(QT_MAJOR_VERSION, 5) {
  42. lessThan(QT_MINOR_VERSION, 7) {
  43. CONFIG += c++11
  44. } # lessThan(QT_MINOR_VERSION, 7)
  45. } # equals(QT_MAJOR_VERSION, 5)
  46. } # lessThan(QT_MAJOR_VERSION, 5)
  47. ###########################################
  48. # Boost Header-Only Dependency (optional) #
  49. ###########################################
  50. # Since QxOrm 1.4.4, QxOrm library doesn't depend on boost framework anymore (the boost dependency has been fully removed, replaced by some C++11 features)
  51. # So QxOrm library is now a pure Qt library which depends only on QtCore and QtSql by default
  52. # QxOrm library still supports some boost classes (boost smart-pointers, unordered containers, boost::optional, etc...) : you have to define _QX_ENABLE_BOOST compilation option to enable these features
  53. # DEFINES += _QX_ENABLE_BOOST
  54. ############################################################
  55. # Boost Serialization Shared Library Dependency (optional) #
  56. ############################################################
  57. # By default, QxOrm library doesn't depend on boost::serialization shared library, but it is possible to enable it defining the compilation option : _QX_ENABLE_BOOST_SERIALIZATION
  58. # Without this compilation option, QxOrm is a much lighter library, generated binaries based on QxOrm are smaller, and QxOrm depends only on Qt binaries (and boost header files)
  59. # But in this case, serialization features are limited (based on QDataStream and QJson engines) : limited qx::clone, no XML serialization, limited binary serialization, limited QxService module (network transactions), etc...
  60. # If you define _QX_ENABLE_BOOST_SERIALIZATION compilation option, then boost serialization is enabled with XML and binary engine by default (see _QX_ENABLE_BOOST_SERIALIZATION_BINARY and _QX_ENABLE_BOOST_SERIALIZATION_XML for more details)
  61. # Note : if you are not using serialization functions in projects based on QxOrm library, then you can define or not _QX_ENABLE_BOOST_SERIALIZATION compilation option without changing any line of your source code
  62. # Other note : to persist containers in database (not relationships, for example : std::vector<int>), without _QX_ENABLE_BOOST_SERIALIZATION it is stored as QByteArray (based on QDataStream engine), with _QX_ENABLE_BOOST_SERIALIZATION it is stored as XML (based on boost serialization XML engine) => so be careful, in this case it is not compatible
  63. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION
  64. contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION) {
  65. !contains(DEFINES, _QX_ENABLE_BOOST) {
  66. DEFINES += _QX_ENABLE_BOOST
  67. } # !contains(DEFINES, _QX_ENABLE_BOOST)
  68. } # contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION)
  69. ######################################
  70. # Boost Library Configuration / Path #
  71. ######################################
  72. # In this section, it's necessary to specify boost directories (lib + include) and boost serialization module name (debug + release) :
  73. # - QX_BOOST_INCLUDE_PATH (required) : your boost include path (by default, environment variable named BOOST_INCLUDE)
  74. # - QX_BOOST_LIB_PATH (optional) : your boost lib path (by default, environment variable named BOOST_LIB)
  75. # - QX_BOOST_LIB_SERIALIZATION_DEBUG (optional) : your boost serialization module name in debug mode (by default, environment variable named BOOST_LIB_SERIALIZATION_DEBUG)
  76. # - QX_BOOST_LIB_SERIALIZATION_RELEASE (optional) : your boost serialization module name in release mode (by default, environment variable named BOOST_LIB_SERIALIZATION_RELEASE)
  77. # - QX_BOOST_LIB_WIDE_SERIALIZATION_DEBUG (optional) : your boost wide serialization module name in debug mode (default is empty)
  78. # - QX_BOOST_LIB_WIDE_SERIALIZATION_RELEASE (optional) : your boost wide serialization module name in release mode (default is empty)
  79. # Note : if _QX_ENABLE_BOOST_SERIALIZATION is not defined, then the only option used is QX_BOOST_INCLUDE_PATH (other options are ignored, QxOrm just needs to know how to find boost header files)
  80. contains(DEFINES, _QX_ENABLE_BOOST) {
  81. isEmpty(QX_BOOST_INCLUDE_PATH) { QX_BOOST_INCLUDE_PATH = $$quote($$(BOOST_INCLUDE)) }
  82. contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION) {
  83. isEmpty(QX_BOOST_LIB_PATH) { QX_BOOST_LIB_PATH = $$quote($$(BOOST_LIB)) }
  84. isEmpty(QX_BOOST_LIB_SERIALIZATION_DEBUG) { QX_BOOST_LIB_SERIALIZATION_DEBUG = "$$(BOOST_LIB_SERIALIZATION_DEBUG)" }
  85. isEmpty(QX_BOOST_LIB_SERIALIZATION_RELEASE) { QX_BOOST_LIB_SERIALIZATION_RELEASE = "$$(BOOST_LIB_SERIALIZATION_RELEASE)" }
  86. # isEmpty(QX_BOOST_LIB_WIDE_SERIALIZATION_DEBUG) { QX_BOOST_LIB_WIDE_SERIALIZATION_DEBUG = "$$(BOOST_LIB_WIDE_SERIALIZATION_DEBUG)" }
  87. # isEmpty(QX_BOOST_LIB_WIDE_SERIALIZATION_RELEASE) { QX_BOOST_LIB_WIDE_SERIALIZATION_RELEASE = "$$(BOOST_LIB_WIDE_SERIALIZATION_RELEASE)" }
  88. } # contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION)
  89. } # contains(DEFINES, _QX_ENABLE_BOOST)
  90. ####################################
  91. # Check Boost Configuration / Path #
  92. ####################################
  93. contains(DEFINES, _QX_ENABLE_BOOST) {
  94. isEmpty(QX_BOOST_INCLUDE_PATH) {
  95. error("Error in QxOrm.pri configuration file : QX_BOOST_INCLUDE_PATH variable is empty, please define in QX_BOOST_INCLUDE_PATH variable where boost header files *.hpp are located, or define an environment variable named BOOST_INCLUDE (read QxOrm.pri configuration file for more details)")
  96. } # isEmpty(QX_BOOST_INCLUDE_PATH)
  97. QX_CHECK_BOOST_INCLUDE_PATH = $${QX_BOOST_INCLUDE_PATH}/boost/version.hpp
  98. greaterThan(QT_MAJOR_VERSION, 4) {
  99. QX_CHECK_BOOST_INCLUDE_PATH = $$clean_path($${QX_CHECK_BOOST_INCLUDE_PATH})
  100. } else { # greaterThan(QT_MAJOR_VERSION, 4)
  101. QX_CHECK_BOOST_INCLUDE_PATH = $$replace(QX_CHECK_BOOST_INCLUDE_PATH, \\\\, /)
  102. QX_CHECK_BOOST_INCLUDE_PATH = $$replace(QX_CHECK_BOOST_INCLUDE_PATH, \\, /)
  103. } # greaterThan(QT_MAJOR_VERSION, 4)
  104. !exists($${QX_CHECK_BOOST_INCLUDE_PATH}) {
  105. message("Check if boost header file exists : $${QX_CHECK_BOOST_INCLUDE_PATH}")
  106. error("Error in QxOrm.pri configuration file : QX_BOOST_INCLUDE_PATH variable is not valid ($${QX_BOOST_INCLUDE_PATH}), please define in QX_BOOST_INCLUDE_PATH variable where boost header files *.hpp are located, or define an environment variable named BOOST_INCLUDE (read QxOrm.pri configuration file for more details)")
  107. } # !exists($${QX_CHECK_BOOST_INCLUDE_PATH})
  108. } # contains(DEFINES, _QX_ENABLE_BOOST)
  109. ############################
  110. # Qt GUI Module Dependency #
  111. ############################
  112. # By default, QxOrm library doesn't depend on Qt GUI shared library
  113. # If you want to serialize Qt GUI objects (QBrush, QColor, QFont, QImage, QMatrix, QPicture, QPixmap, QRegion), then you have to define _QX_ENABLE_QT_GUI compilation option
  114. # DEFINES += _QX_ENABLE_QT_GUI
  115. contains(DEFINES, _QX_ENABLE_QT_GUI) {
  116. QT += gui
  117. } # contains(DEFINES, _QX_ENABLE_QT_GUI)
  118. ################################
  119. # Qt Network Module Dependency #
  120. ################################
  121. # By default, QxOrm library doesn't depend on Qt Network shared library => it means that QxService module (network transactions to transfer your persistent layer) and QxHttpServer module (standalone multi-threaded HTTP 1.1 web server) are not enabled by default
  122. # To enable these features (QxService and QxHttpServer modules), just define the compilation option : _QX_ENABLE_QT_NETWORK
  123. # For more details about QxService module, a tutorial (qxClientServer) is available on QxOrm website : https://www.qxorm.com/qxorm_en/tutorial_2.html
  124. # For more details about QxHttpServer module, a manual is available on QxOrm website : https://www.qxorm.com/qxorm_en/manual.html#manual_96
  125. # DEFINES += _QX_ENABLE_QT_NETWORK
  126. contains(DEFINES, _QX_ENABLE_QT_NETWORK) {
  127. QT += network
  128. } # contains(DEFINES, _QX_ENABLE_QT_NETWORK)
  129. ############################################
  130. # QxOrm Library Boost Serialization Engine #
  131. ############################################
  132. # In this section, you can enable/disable different boost serialization engine, by default, there is :
  133. # - _QX_ENABLE_BOOST_SERIALIZATION_BINARY
  134. # - _QX_ENABLE_BOOST_SERIALIZATION_XML
  135. # Note : if _QX_ENABLE_BOOST_SERIALIZATION is not defined, then these options are not used
  136. contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION) {
  137. DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_BINARY
  138. DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_XML
  139. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_POLYMORPHIC
  140. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_TEXT
  141. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_PORTABLE_BINARY
  142. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_WIDE_BINARY
  143. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_WIDE_TEXT
  144. # DEFINES += _QX_ENABLE_BOOST_SERIALIZATION_WIDE_XML
  145. } # contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION)
  146. #######################################
  147. # MongoDB Driver Library Dependencies #
  148. #######################################
  149. # If you enable _QX_ENABLE_MONGODB option, then QxOrm library will be able to use mongoc driver to store all QxOrm registered classes in a MongoDB database
  150. # When _QX_ENABLE_MONGODB compilation option is defined, you must provide following paths to manage mongoc library dependencies :
  151. # - a BSON_INCLUDE environment variable to define where bson library source code is located (or a QX_BSON_INCLUDE_PATH qmake variable)
  152. # - a MONGOC_INCLUDE environment variable to define where mongoc library source code is located (or a QX_MONGOC_INCLUDE_PATH qmake variable)
  153. # - a BSON_LIB environment variable to define where bson library is located (or a QX_BSON_LIB_PATH qmake variable)
  154. # - a MONGOC_LIB environment variable to define where mongoc library is located (or a QX_MONGOC_LIB_PATH qmake variable)
  155. # DEFINES += _QX_ENABLE_MONGODB
  156. contains(DEFINES, _QX_ENABLE_MONGODB) {
  157. # Check bson library include path
  158. isEmpty(QX_BSON_INCLUDE_PATH) { QX_BSON_INCLUDE_PATH = $$quote($$(BSON_INCLUDE)) }
  159. isEmpty(QX_BSON_INCLUDE_PATH) {
  160. error("Error in QxOrm.pri configuration file : QX_BSON_INCLUDE_PATH variable is empty, please define in QX_BSON_INCLUDE_PATH variable where bson library source code is located, or define an environment variable named BSON_INCLUDE (read QxOrm.pri configuration file for more details)")
  161. } # isEmpty(QX_BSON_INCLUDE_PATH)
  162. QX_CHECK_BSON_INCLUDE_PATH = $${QX_BSON_INCLUDE_PATH}/bson.h
  163. greaterThan(QT_MAJOR_VERSION, 4) {
  164. QX_CHECK_BSON_INCLUDE_PATH = $$clean_path($${QX_CHECK_BSON_INCLUDE_PATH})
  165. } else { # greaterThan(QT_MAJOR_VERSION, 4)
  166. QX_CHECK_BSON_INCLUDE_PATH = $$replace(QX_CHECK_BSON_INCLUDE_PATH, \\\\, /)
  167. QX_CHECK_BSON_INCLUDE_PATH = $$replace(QX_CHECK_BSON_INCLUDE_PATH, \\, /)
  168. } # greaterThan(QT_MAJOR_VERSION, 4)
  169. !exists($${QX_CHECK_BSON_INCLUDE_PATH}) {
  170. message("Check if bson header file exists : $${QX_CHECK_BSON_INCLUDE_PATH}")
  171. error("Error in QxOrm.pri configuration file : QX_BSON_INCLUDE_PATH variable is not valid ($${QX_BSON_INCLUDE_PATH}), please define in QX_BSON_INCLUDE_PATH variable where bson library source code is located, or define an environment variable named BSON_INCLUDE (read QxOrm.pri configuration file for more details)")
  172. } # !exists($${QX_CHECK_BSON_INCLUDE_PATH})
  173. # Check mongoc library include path
  174. isEmpty(QX_MONGOC_INCLUDE_PATH) { QX_MONGOC_INCLUDE_PATH = $$quote($$(MONGOC_INCLUDE)) }
  175. isEmpty(QX_MONGOC_INCLUDE_PATH) {
  176. error("Error in QxOrm.pri configuration file : QX_MONGOC_INCLUDE_PATH variable is empty, please define in QX_MONGOC_INCLUDE_PATH variable where mongoc library source code is located, or define an environment variable named MONGOC_INCLUDE (read QxOrm.pri configuration file for more details)")
  177. } # isEmpty(QX_MONGOC_INCLUDE_PATH)
  178. QX_CHECK_MONGOC_INCLUDE_PATH = $${QX_MONGOC_INCLUDE_PATH}/mongoc.h
  179. greaterThan(QT_MAJOR_VERSION, 4) {
  180. QX_CHECK_MONGOC_INCLUDE_PATH = $$clean_path($${QX_CHECK_MONGOC_INCLUDE_PATH})
  181. } else { # greaterThan(QT_MAJOR_VERSION, 4)
  182. QX_CHECK_MONGOC_INCLUDE_PATH = $$replace(QX_CHECK_MONGOC_INCLUDE_PATH, \\\\, /)
  183. QX_CHECK_MONGOC_INCLUDE_PATH = $$replace(QX_CHECK_MONGOC_INCLUDE_PATH, \\, /)
  184. } # greaterThan(QT_MAJOR_VERSION, 4)
  185. !exists($${QX_CHECK_MONGOC_INCLUDE_PATH}) {
  186. message("Check if mongoc header file exists : $${QX_CHECK_MONGOC_INCLUDE_PATH}")
  187. error("Error in QxOrm.pri configuration file : QX_MONGOC_INCLUDE_PATH variable is not valid ($${QX_MONGOC_INCLUDE_PATH}), please define in QX_MONGOC_INCLUDE_PATH variable where mongoc library source code is located, or define an environment variable named MONGOC_INCLUDE (read QxOrm.pri configuration file for more details)")
  188. } # !exists($${QX_CHECK_MONGOC_INCLUDE_PATH})
  189. INCLUDEPATH += $${QX_BSON_INCLUDE_PATH}
  190. INCLUDEPATH += $${QX_MONGOC_INCLUDE_PATH}
  191. isEmpty(QX_BSON_LIB_PATH) { QX_BSON_LIB_PATH = $$quote($$(BSON_LIB)) }
  192. isEmpty(QX_MONGOC_LIB_PATH) { QX_MONGOC_LIB_PATH = $$quote($$(MONGOC_LIB)) }
  193. LIBS += -L$${QX_BSON_LIB_PATH}
  194. LIBS += -L$${QX_MONGOC_LIB_PATH}
  195. LIBS += -lbson-1.0
  196. LIBS += -lmongoc-1.0
  197. } # contains(DEFINES, _QX_ENABLE_MONGODB)
  198. #####################
  199. # Global Parameters #
  200. #####################
  201. QT += sql
  202. CONFIG += debug_and_release
  203. DEPENDPATH += .
  204. INCLUDEPATH += ./include
  205. MOC_DIR = ./qt/moc
  206. RCC_DIR = ./qt/rcc/src
  207. UI_DIR = ./qt/ui
  208. UI_HEADERS_DIR = ./qt/ui/include
  209. UI_SOURCES_DIR = ./qt/ui/src
  210. contains(DEFINES, _QX_ENABLE_BOOST) {
  211. INCLUDEPATH += $${QX_BOOST_INCLUDE_PATH}
  212. } # contains(DEFINES, _QX_ENABLE_BOOST)
  213. CONFIG(debug, debug|release) {
  214. DEFINES += _QX_MODE_DEBUG
  215. } else {
  216. DEFINES += _QX_MODE_RELEASE
  217. } # CONFIG(debug, debug|release)
  218. #######################
  219. # Externals Libraries #
  220. #######################
  221. # If _QX_ENABLE_BOOST_SERIALIZATION compilation option is not defined, then there is no external dependency : QxOrm library depends only on Qt binaries
  222. contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION) {
  223. LIBS += -L$${QX_BOOST_LIB_PATH}
  224. CONFIG(debug, debug|release) {
  225. LIBS += -l$${QX_BOOST_LIB_SERIALIZATION_DEBUG}
  226. !isEmpty(QX_BOOST_LIB_WIDE_SERIALIZATION_DEBUG) { LIBS += -l$${QX_BOOST_LIB_WIDE_SERIALIZATION_DEBUG} }
  227. } else {
  228. LIBS += -l$${QX_BOOST_LIB_SERIALIZATION_RELEASE}
  229. !isEmpty(QX_BOOST_LIB_WIDE_SERIALIZATION_RELEASE) { LIBS += -l$${QX_BOOST_LIB_WIDE_SERIALIZATION_RELEASE} }
  230. } # CONFIG(debug, debug|release)
  231. } # contains(DEFINES, _QX_ENABLE_BOOST_SERIALIZATION)
  232. #####################################
  233. # Output Binaries Size Optimization #
  234. #####################################
  235. # To compile faster classes registered into QxOrm context and to produce smaller binaries size, you should :
  236. # - not define the compilation option _QX_ENABLE_BOOST_SERIALIZATION to disable boost::serialization dependency ;
  237. # - or define only the _QX_ENABLE_BOOST_SERIALIZATION_BINARY compilation option (and disable the default _QX_ENABLE_BOOST_SERIALIZATION_XML compilation option) ;
  238. # - if you need the XML engine, you could consider enable only the _QX_ENABLE_BOOST_SERIALIZATION_POLYMORPHIC compilation option ;
  239. # - under Windows, use MSVC++ instead of MinGW GCC ;
  240. # - with GCC compiler, use the following optimizations options (uncomment it) :
  241. # QMAKE_CXXFLAGS_RELEASE += -ffunction-sections -fdata-sections -Os -pipe
  242. # QMAKE_CFLAGS_RELEASE += -ffunction-sections -fdata-sections -Os -pipe
  243. # QMAKE_LFLAGS_RELEASE += -Wl,--gc-sections -s
  244. #############################
  245. # Compiler / Linker Options #
  246. #############################
  247. win32 {
  248. # For MinGW : we need to add these linker flags because of some issues to dll export extern template instantiations from shared library
  249. win32-g++: QMAKE_LFLAGS += -Wl,-export-all-symbols -Wl,-enable-auto-import
  250. } # win32
  251. #########################
  252. # No Precompiled Header #
  253. #########################
  254. # Some versions of MinGW on Windows have a bug with large precompiled headers (for example, MinGW GCC 4.8)
  255. # More detais about this problem here : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926
  256. # And here : http://stackoverflow.com/questions/10841306/cc1plus-exe-crash-when-using-large-precompiled-header-file
  257. # To fix the crash during compilation, you have to disable precompiled headers : just enable the following compilation option _QX_NO_PRECOMPILED_HEADER
  258. # Note : there is a side effect disabling precompiled headers => compilation times are considerably increased !
  259. # Other note : to reduce compilation times, it is recommended to define _QX_UNITY_BUILD compilation option
  260. # DEFINES += _QX_NO_PRECOMPILED_HEADER
  261. !contains(DEFINES, _QX_NO_PRECOMPILED_HEADER) {
  262. CONFIG += precompile_header
  263. } # !contains(DEFINES, _QX_NO_PRECOMPILED_HEADER)
  264. ################################
  265. # No RTTI C++ Type Information #
  266. ################################
  267. # You can build QxOrm library without C++ RTTI type information defining the compilation option : _QX_NO_RTTI
  268. # With _QX_NO_RTTI compilation option, dynamic_cast and typeid from QxOrm library are removed
  269. # Note : you cannot define this compilation option if you enable boost serialization feature (_QX_ENABLE_BOOST_SERIALIZATION)
  270. # Other note : it seems that on Unix system, CONFIG += rtti_off doesn't add the compilation flag -fno-rtti for GCC (there is a Qt bug report here : https://bugreports.qt.io/browse/QTBUG-26595), so in this case, just add the compilation flag to QMAKE_CXXFLAGS and QMAKE_CFLAGS variables
  271. # DEFINES += _QX_NO_RTTI
  272. contains(DEFINES, _QX_NO_RTTI) {
  273. CONFIG -= rtti
  274. CONFIG += rtti_off
  275. # unix {
  276. # QMAKE_CXXFLAGS += -fno-rtti
  277. # QMAKE_CFLAGS += -fno-rtti
  278. # } # unix
  279. } # contains(DEFINES, _QX_NO_RTTI)
  280. ##############################
  281. # QxOrm Library Static Build #
  282. ##############################
  283. # To create only 1 EXE including Qt, boost serialization and QxOrm libraries without any dependency :
  284. # 1- be sure to build Qt and boost::serialization using static mode
  285. # 2- in "./QxOrm.pri" file, add the following line : "DEFINES += _QX_STATIC_BUILD"
  286. # 3- BUT PLEASE : in your program, add a "readme.txt" file and a "about my program..." window to indicate that your application is based on Qt, boost and QxOrm libraries !
  287. # Note : on Windows, static mode works with only 1 EXE, it will never work mixing DLL and EXE (because of singleton implementation of boost::serialization and QxOrm libraries)
  288. # DEFINES += _QX_STATIC_BUILD
  289. ################################
  290. # No JSON Serialization Engine #
  291. ################################
  292. # QxOrm library supports JSON serialization : this feature is enabled by default if you are not working with Qt4 (JSON engine requires Qt5)
  293. # To disable this feature, you can define the compilation option : _QX_NO_JSON
  294. # Using _QX_NO_JSON compilation option, qx::serialization::json namespace will be not available
  295. # DEFINES += _QX_NO_JSON
  296. ##########################################
  297. # Unity Build : Reduce Compilation Times #
  298. ##########################################
  299. # QxOrm provides a way to compile the library faster using the Unity Build system : http://stackoverflow.com/questions/543697/include-all-cpp-files-into-a-single-compilation-unit
  300. # To enable QxOrm Unity Build feature, just define the _QX_UNITY_BUILD compilation option
  301. # This compilation option changes the make file : instead of compiling each *.cpp files separately, QxOrm is compiled using a unique 'all.cpp' file (which #include all QxOrm *.cpp files)
  302. # Note : your environment must have enough memory to support this compilation option, and your compiler must support it too, otherwise your compiler can crash with a memory error
  303. # Other note : C++ projects generated by QxEntityEditor application support this compilation option => this is a way to reduce compilation times of C++ persistent classes generated by QxEntityEditor
  304. # Other note : if you define _QX_UNITY_BUILD compilation option, it can be interesting too to define the _QX_NO_PRECOMPILED_HEADER compilation option to reduce compilation times (it depends on number of other *.cpp files to compile, like moc files for example)
  305. # DEFINES += _QX_UNITY_BUILD
  306. contains(DEFINES, _QX_UNITY_BUILD) {
  307. win32-msvc*: QMAKE_CXXFLAGS += -bigobj
  308. # win32-g++: QMAKE_CXXFLAGS += -Wa,-mbig-obj
  309. } # contains(DEFINES, _QX_UNITY_BUILD)
  310. ##########################################
  311. # More Efficient Qt QString Construction #
  312. ##########################################
  313. # Qt provides some optimizations for QString class (construction, concatenation, etc...)
  314. # More details about these optimizations are available on Qt web site : http://doc.qt.io/qt-5/qstring.html#more-efficient-string-construction
  315. # To enable these optimizations, you can define QT_USE_QSTRINGBUILDER compilation option
  316. # DEFINES *= QT_USE_QSTRINGBUILDER