CMakeLists.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. # ***** BEGIN GPL LICENSE BLOCK *****
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # The Original Code is Copyright (C) 2006, Blender Foundation
  18. # All rights reserved.
  19. # ***** END GPL LICENSE BLOCK *****
  20. set(INC
  21. .
  22. ../glew-mx
  23. ../string
  24. ../../source/blender/imbuf
  25. ../../source/blender/makesdna
  26. )
  27. set(INC_SYS
  28. ${GLEW_INCLUDE_PATH}
  29. )
  30. set(SRC
  31. intern/GHOST_Buttons.cpp
  32. intern/GHOST_C-api.cpp
  33. intern/GHOST_CallbackEventConsumer.cpp
  34. intern/GHOST_Context.cpp
  35. intern/GHOST_ContextNone.cpp
  36. intern/GHOST_DisplayManager.cpp
  37. intern/GHOST_EventManager.cpp
  38. intern/GHOST_ISystem.cpp
  39. intern/GHOST_ISystemPaths.cpp
  40. intern/GHOST_ModifierKeys.cpp
  41. intern/GHOST_Path-api.cpp
  42. intern/GHOST_Rect.cpp
  43. intern/GHOST_System.cpp
  44. intern/GHOST_TimerManager.cpp
  45. intern/GHOST_Window.cpp
  46. intern/GHOST_WindowManager.cpp
  47. GHOST_C-api.h
  48. GHOST_IContext.h
  49. GHOST_IEvent.h
  50. GHOST_IEventConsumer.h
  51. GHOST_ISystem.h
  52. GHOST_ISystemPaths.h
  53. GHOST_ITimerTask.h
  54. GHOST_IWindow.h
  55. GHOST_Path-api.h
  56. GHOST_Rect.h
  57. GHOST_Types.h
  58. intern/GHOST_Buttons.h
  59. intern/GHOST_CallbackEventConsumer.h
  60. intern/GHOST_Context.h
  61. intern/GHOST_ContextNone.h
  62. intern/GHOST_Debug.h
  63. intern/GHOST_DisplayManager.h
  64. intern/GHOST_Event.h
  65. intern/GHOST_EventButton.h
  66. intern/GHOST_EventCursor.h
  67. intern/GHOST_EventDragnDrop.h
  68. intern/GHOST_EventKey.h
  69. intern/GHOST_EventManager.h
  70. intern/GHOST_EventString.h
  71. intern/GHOST_EventTrackpad.h
  72. intern/GHOST_EventWheel.h
  73. intern/GHOST_ModifierKeys.h
  74. intern/GHOST_System.h
  75. intern/GHOST_SystemPaths.h
  76. intern/GHOST_TimerManager.h
  77. intern/GHOST_TimerTask.h
  78. intern/GHOST_Window.h
  79. intern/GHOST_WindowManager.h
  80. )
  81. set(LIB
  82. bf_intern_glew_mx
  83. bf_intern_string
  84. ${GLEW_LIBRARY}
  85. )
  86. if(WITH_GHOST_DEBUG)
  87. list(APPEND SRC
  88. intern/GHOST_EventPrinter.cpp
  89. intern/GHOST_EventPrinter.h
  90. )
  91. add_definitions(-DWITH_GHOST_DEBUG)
  92. endif()
  93. if(WITH_INPUT_NDOF)
  94. add_definitions(-DWITH_INPUT_NDOF)
  95. list(APPEND SRC
  96. intern/GHOST_NDOFManager.cpp
  97. intern/GHOST_EventNDOF.h
  98. intern/GHOST_NDOFManager.h
  99. )
  100. list(APPEND INC_SYS
  101. ${NDOF_INCLUDE_DIRS}
  102. )
  103. endif()
  104. if(WITH_HEADLESS OR WITH_GHOST_SDL)
  105. if(WITH_HEADLESS)
  106. list(APPEND SRC
  107. intern/GHOST_DisplayManagerNULL.h
  108. intern/GHOST_SystemNULL.h
  109. intern/GHOST_WindowNULL.h
  110. )
  111. add_definitions(-DWITH_HEADLESS)
  112. else()
  113. list(APPEND SRC
  114. intern/GHOST_ContextSDL.cpp
  115. intern/GHOST_DisplayManagerSDL.cpp
  116. intern/GHOST_SystemSDL.cpp
  117. intern/GHOST_WindowSDL.cpp
  118. intern/GHOST_ContextSDL.h
  119. intern/GHOST_DisplayManagerSDL.h
  120. intern/GHOST_SystemSDL.h
  121. intern/GHOST_WindowSDL.h
  122. )
  123. add_definitions(-DWITH_GHOST_SDL)
  124. endif()
  125. if(NOT WITH_HEADLESS)
  126. list(APPEND INC_SYS
  127. ${SDL_INCLUDE_DIR}
  128. )
  129. endif()
  130. elseif(APPLE AND NOT WITH_X11)
  131. list(APPEND SRC
  132. intern/GHOST_DisplayManagerCocoa.mm
  133. intern/GHOST_SystemCocoa.mm
  134. intern/GHOST_WindowCocoa.mm
  135. intern/GHOST_DisplayManagerCocoa.h
  136. intern/GHOST_SystemCocoa.h
  137. intern/GHOST_WindowCocoa.h
  138. )
  139. if(NOT WITH_GL_EGL)
  140. list(APPEND SRC
  141. intern/GHOST_ContextCGL.mm
  142. intern/GHOST_ContextCGL.h
  143. )
  144. endif()
  145. if(WITH_INPUT_NDOF)
  146. list(APPEND SRC
  147. intern/GHOST_NDOFManagerCocoa.mm
  148. intern/GHOST_NDOFManagerCocoa.h
  149. )
  150. endif()
  151. elseif(WITH_X11)
  152. list(APPEND INC_SYS
  153. ${X11_X11_INCLUDE_PATH}
  154. )
  155. list(APPEND SRC
  156. intern/GHOST_DisplayManagerX11.cpp
  157. intern/GHOST_SystemX11.cpp
  158. intern/GHOST_TaskbarX11.cpp
  159. intern/GHOST_WindowX11.cpp
  160. intern/GHOST_DisplayManagerX11.h
  161. intern/GHOST_SystemX11.h
  162. intern/GHOST_TaskbarX11.h
  163. intern/GHOST_WindowX11.h
  164. )
  165. if(NOT WITH_GL_EGL)
  166. list(APPEND SRC
  167. intern/GHOST_ContextGLX.cpp
  168. intern/GHOST_ContextGLX.h
  169. )
  170. endif()
  171. if(WITH_GHOST_XDND)
  172. add_definitions(-DWITH_XDND)
  173. list(APPEND LIB
  174. extern_xdnd
  175. )
  176. list(APPEND INC
  177. ../../extern/xdnd
  178. )
  179. list(APPEND SRC
  180. intern/GHOST_DropTargetX11.cpp
  181. intern/GHOST_DropTargetX11.h
  182. )
  183. endif()
  184. if(X11_XF86keysym_INCLUDE_PATH)
  185. add_definitions(-DWITH_XF86KEYSYM)
  186. list(APPEND INC_SYS
  187. ${X11_XF86keysym_INCLUDE_PATH}
  188. )
  189. endif()
  190. if(WITH_X11_XF86VMODE)
  191. add_definitions(-DWITH_X11_XF86VMODE)
  192. list(APPEND INC_SYS
  193. ${X11_xf86vmode_INCLUDE_PATH}
  194. )
  195. endif()
  196. if(WITH_X11_XFIXES)
  197. add_definitions(-DWITH_X11_XFIXES)
  198. list(APPEND INC_SYS
  199. ${X11_Xfixes_INCLUDE_PATH}
  200. )
  201. endif()
  202. if(WITH_X11_ALPHA)
  203. add_definitions(-DWITH_X11_ALPHA)
  204. endif()
  205. if(WITH_INPUT_NDOF)
  206. list(APPEND SRC
  207. intern/GHOST_NDOFManagerUnix.cpp
  208. intern/GHOST_NDOFManagerUnix.h
  209. )
  210. endif()
  211. if(NOT WITH_INSTALL_PORTABLE)
  212. add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
  213. endif()
  214. if(WITH_X11_XINPUT)
  215. add_definitions(-DWITH_X11_XINPUT)
  216. list(APPEND INC_SYS
  217. ${X11_Xinput_INCLUDE_PATH}
  218. )
  219. endif()
  220. add_definitions(-DWITH_X11)
  221. elseif(WIN32)
  222. ## Warnings as errors, this is too strict!
  223. #if(MSVC)
  224. # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
  225. #endif()
  226. list(APPEND INC_SYS
  227. ${WINTAB_INC}
  228. )
  229. list(APPEND SRC
  230. intern/GHOST_DisplayManagerWin32.cpp
  231. intern/GHOST_DropTargetWin32.cpp
  232. intern/GHOST_SystemWin32.cpp
  233. intern/GHOST_WindowWin32.cpp
  234. intern/GHOST_DisplayManagerWin32.h
  235. intern/GHOST_DropTargetWin32.h
  236. intern/GHOST_SystemWin32.h
  237. intern/GHOST_TaskbarWin32.h
  238. intern/GHOST_WindowWin32.h
  239. )
  240. if(NOT WITH_GL_EGL)
  241. list(APPEND SRC
  242. intern/GHOST_ContextWGL.cpp
  243. intern/GHOST_ContextWGL.h
  244. )
  245. endif()
  246. if(WITH_INPUT_IME)
  247. add_definitions(-DWITH_INPUT_IME)
  248. list(APPEND SRC
  249. intern/GHOST_ImeWin32.cpp
  250. intern/GHOST_ImeWin32.h
  251. )
  252. endif()
  253. if(WITH_INPUT_NDOF)
  254. list(APPEND SRC
  255. intern/GHOST_NDOFManagerWin32.cpp
  256. intern/GHOST_NDOFManagerWin32.h
  257. )
  258. endif()
  259. endif()
  260. if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
  261. list(APPEND SRC
  262. intern/GHOST_ContextEGL.cpp
  263. intern/GHOST_ContextEGL.h
  264. )
  265. endif()
  266. if(APPLE)
  267. list(APPEND SRC
  268. intern/GHOST_SystemPathsCocoa.h
  269. intern/GHOST_SystemPathsCocoa.mm
  270. )
  271. elseif(UNIX)
  272. list(APPEND SRC
  273. intern/GHOST_SystemPathsUnix.cpp
  274. intern/GHOST_SystemPathsUnix.h
  275. )
  276. if(NOT WITH_INSTALL_PORTABLE)
  277. add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
  278. endif()
  279. elseif(WIN32)
  280. list(APPEND SRC
  281. intern/GHOST_SystemPathsWin32.cpp
  282. intern/GHOST_SystemPathsWin32.h
  283. )
  284. list(APPEND INC
  285. ../utfconv
  286. )
  287. endif()
  288. add_definitions(${GL_DEFINITIONS})
  289. blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")