CMakeLists.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. project(CTKWidgets)
  2. #
  3. # See CTK/CMake/ctkMacroBuildLib.cmake for details
  4. #
  5. set(KIT_export_directive "CTK_WIDGETS_EXPORT")
  6. #
  7. # Add the libraries QtTesting
  8. #
  9. if(CTK_USE_QTTESTING)
  10. find_package(QtTesting REQUIRED)
  11. include_directories(
  12. ${QtTesting_INCLUDE_DIRS}
  13. ${CMAKE_BINARY_DIR} # For ctkConfig.h
  14. )
  15. endif()
  16. # Source files
  17. set(KIT_SRCS
  18. ctkActionsWidget.cpp
  19. ctkActionsWidget.h
  20. ctkAddRemoveComboBox.cpp
  21. ctkAddRemoveComboBox.h
  22. ctkAxesWidget.cpp
  23. ctkAxesWidget.h
  24. ctkBasePopupWidget.cpp
  25. ctkBasePopupWidget.h
  26. ctkBasePopupWidget_p.h
  27. ctkButtonGroup.cpp
  28. ctkButtonGroup.h
  29. ctkCheckableComboBox.cpp
  30. ctkCheckableComboBox.h
  31. ctkCheckableHeaderView.cpp
  32. ctkCheckableHeaderView.h
  33. ctkCheckBox.cpp
  34. ctkCheckBox.h
  35. ctkCheckBoxPixmaps.cpp
  36. ctkCheckBoxPixmaps.h
  37. ctkCheckablePushButton.cpp
  38. ctkCheckablePushButton.h
  39. ctkComboBox.cpp
  40. ctkComboBox.h
  41. ctkCompleter.cpp
  42. ctkCompleter.h
  43. ctkCollapsibleButton.cpp
  44. ctkCollapsibleButton.h
  45. ctkCollapsibleGroupBox.cpp
  46. ctkCollapsibleGroupBox.h
  47. ctkColorDialog.cpp
  48. ctkColorDialog.h
  49. ctkColorPickerButton.cpp
  50. ctkColorPickerButton.h
  51. ctkConsole.cpp
  52. ctkConsole.h
  53. ctkConsole_p.h
  54. ctkCoordinatesWidget.cpp
  55. ctkCoordinatesWidget.h
  56. ctkCrosshairLabel.cpp
  57. ctkCrosshairLabel.h
  58. ctkDateRangeWidget.cpp
  59. ctkDateRangeWidget.h
  60. ctkDirectoryButton.cpp
  61. ctkDirectoryButton.h
  62. ctkDoubleRangeSlider.cpp
  63. ctkDoubleRangeSlider.h
  64. ctkDoubleSlider.cpp
  65. ctkDoubleSlider.h
  66. ctkDynamicSpacer.cpp
  67. ctkDynamicSpacer.h
  68. ctkErrorLogStatusMessageHandler.cpp
  69. ctkErrorLogStatusMessageHandler.h
  70. ctkErrorLogWidget.cpp
  71. ctkErrorLogWidget.h
  72. ctkExpandButton.cpp
  73. ctkExpandButton.h
  74. ctkFileDialog.cpp
  75. ctkFileDialog.h
  76. ctkFittedTextBrowser.cpp
  77. ctkFittedTextBrowser.h
  78. ctkFlatProxyModel.cpp
  79. ctkFlatProxyModel.h
  80. ctkFlowLayout.cpp
  81. ctkFlowLayout.h
  82. ctkFontButton.cpp
  83. ctkFontButton.h
  84. ctkIconEnginePlugin.cpp
  85. ctkIconEnginePlugin.h
  86. ctkLanguageComboBox.cpp
  87. ctkLanguageComboBox.h
  88. ctkLayoutManager.cpp
  89. ctkLayoutManager.h
  90. ctkMaterialPropertyPreviewLabel.cpp
  91. ctkMaterialPropertyPreviewLabel.h
  92. ctkMaterialPropertyWidget.cpp
  93. ctkMaterialPropertyWidget.h
  94. ctkMatrixWidget.cpp
  95. ctkMatrixWidget.h
  96. ctkMenuButton.cpp
  97. ctkMenuButton.h
  98. ctkMenuComboBox.cpp
  99. ctkMenuComboBox.h
  100. ctkMenuComboBox_p.h
  101. ctkMessageBox.cpp
  102. ctkMessageBox.h
  103. ctkModalityWidget.cpp
  104. ctkModalityWidget.h
  105. ctkPathLineEdit.cpp
  106. ctkPathLineEdit.h
  107. ctkPixmapIconEngine.cpp
  108. ctkPixmapIconEngine.h
  109. ctkPopupWidget.cpp
  110. ctkPopupWidget.h
  111. ctkPopupWidget_p.h
  112. ctkQImageView.cpp
  113. ctkQImageView.h
  114. ctkRangeSlider.cpp
  115. ctkRangeSlider.h
  116. ctkRangeWidget.cpp
  117. ctkRangeWidget.h
  118. ctkScreenshotDialog.cpp
  119. ctkScreenshotDialog.h
  120. ctkScreenshotDialog_p.h
  121. ctkSearchBox.cpp
  122. ctkSearchBox.h
  123. ctkSettings.cpp
  124. ctkSettings.h
  125. ctkSettingsDialog.cpp
  126. ctkSettingsDialog.h
  127. ctkSettingsPanel.cpp
  128. ctkSettingsPanel.h
  129. ctkSignalMapper.cpp
  130. ctkSignalMapper.h
  131. ctkSimpleLayoutManager.cpp
  132. ctkSimpleLayoutManager.h
  133. ctkSliderWidget.cpp
  134. ctkSliderWidget.h
  135. ctkTestApplication.cpp
  136. ctkTestApplication.h
  137. ctkThumbnailLabel.cpp
  138. ctkThumbnailLabel.h
  139. ctkThumbnailListWidget.cpp
  140. ctkThumbnailListWidget.h
  141. ctkThumbnailListWidget_p.h
  142. ctkToolTipTrapper.cpp
  143. ctkToolTipTrapper.h
  144. ctkTransferFunctionBarsItem.cpp
  145. ctkTransferFunctionBarsItem.h
  146. ctkTransferFunctionControlPointsItem.cpp
  147. ctkTransferFunctionControlPointsItem.h
  148. ctkTransferFunctionGradientItem.cpp
  149. ctkTransferFunctionGradientItem.h
  150. ctkTransferFunctionItem.cpp
  151. ctkTransferFunctionItem.h
  152. ctkTransferFunctionScene.cpp
  153. ctkTransferFunctionScene.h
  154. ctkTransferFunctionView.cpp
  155. ctkTransferFunctionView.h
  156. ctkTreeComboBox.cpp
  157. ctkTreeComboBox.h
  158. ctkWidgetsUtils.cpp
  159. ctkWidgetsUtils.h
  160. ctkWorkflowAbstractPagedWidget.cpp
  161. ctkWorkflowAbstractPagedWidget.h
  162. ctkWorkflowButtonBoxWidget.cpp
  163. ctkWorkflowButtonBoxWidget.h
  164. ctkWorkflowGroupBox.cpp
  165. ctkWorkflowGroupBox.h
  166. ctkWorkflowStackedWidget.cpp
  167. ctkWorkflowStackedWidget.h
  168. ctkWorkflowTabWidget.cpp
  169. ctkWorkflowTabWidget.h
  170. ctkWorkflowWidget.cpp
  171. ctkWorkflowWidget.h
  172. ctkWorkflowWidgetStep.cpp
  173. ctkWorkflowWidgetStep_p.h
  174. ctkWorkflowWidgetStep.h
  175. )
  176. # Headers that should run through moc
  177. set(KIT_MOC_SRCS
  178. ctkActionsWidget.h
  179. ctkAxesWidget.h
  180. ctkAddRemoveComboBox.h
  181. ctkBasePopupWidget.h
  182. ctkBasePopupWidget_p.h
  183. ctkButtonGroup.h
  184. ctkCheckableComboBox.h
  185. ctkCheckableHeaderView.h
  186. ctkCheckablePushButton.h
  187. ctkCheckBox.h
  188. ctkCheckBoxPixmaps.h
  189. ctkComboBox.h
  190. ctkCompleter.h
  191. ctkCollapsibleButton.h
  192. ctkCollapsibleGroupBox.h
  193. ctkColorDialog.h
  194. ctkColorPickerButton.h
  195. ctkConsole.h
  196. ctkConsole_p.h
  197. ctkCoordinatesWidget.h
  198. ctkCrosshairLabel.h
  199. ctkDateRangeWidget.h
  200. ctkDirectoryButton.h
  201. ctkDoubleRangeSlider.h
  202. ctkDoubleSlider.h
  203. ctkDynamicSpacer.h
  204. ctkErrorLogWidget.h
  205. ctkErrorLogStatusMessageHandler.h
  206. ctkExpandButton.h
  207. ctkFileDialog.h
  208. ctkFittedTextBrowser.h
  209. ctkFlatProxyModel.h
  210. ctkFlowLayout.h
  211. ctkFontButton.h
  212. ctkIconEnginePlugin.h
  213. ctkLanguageComboBox.h
  214. ctkLayoutManager.h
  215. ctkMaterialPropertyPreviewLabel.h
  216. ctkMaterialPropertyWidget.h
  217. ctkMatrixWidget.h
  218. ctkMenuButton.h
  219. ctkMenuComboBox.h
  220. ctkMenuComboBox_p.h
  221. ctkMessageBox.h
  222. ctkModalityWidget.h
  223. ctkPathLineEdit.h
  224. ctkPopupWidget.h
  225. ctkPopupWidget_p.h
  226. ctkQImageView.h
  227. ctkRangeSlider.h
  228. ctkRangeWidget.h
  229. ctkScreenshotDialog.h
  230. ctkScreenshotDialog_p.h
  231. ctkSearchBox.h
  232. ctkSettings.h
  233. ctkSettingsDialog.h
  234. ctkSettingsPanel.h
  235. ctkSignalMapper.h
  236. ctkSimpleLayoutManager.h
  237. ctkSliderWidget.h
  238. ctkTestApplication.h
  239. ctkThumbnailLabel.h
  240. ctkThumbnailListWidget.h
  241. ctkToolTipTrapper.h
  242. ctkTransferFunctionBarsItem.h
  243. ctkTransferFunctionControlPointsItem.h
  244. ctkTransferFunctionGradientItem.h
  245. ctkTransferFunctionItem.h
  246. ctkTransferFunctionScene.h
  247. ctkTransferFunctionView.h
  248. ctkTreeComboBox.h
  249. ctkWorkflowAbstractPagedWidget.h
  250. ctkWorkflowButtonBoxWidget.h
  251. ctkWorkflowGroupBox.h
  252. ctkWorkflowStackedWidget.h
  253. ctkWorkflowTabWidget.h
  254. ctkWorkflowWidget.h
  255. ctkWorkflowWidgetStep.h
  256. ctkWorkflowWidgetStep_p.h
  257. )
  258. # UI files
  259. set(KIT_UI_FORMS
  260. Resources/UI/ctkAddRemoveComboBox.ui
  261. Resources/UI/ctkRangeWidget.ui
  262. Resources/UI/ctkDateRangeWidget.ui
  263. Resources/UI/ctkErrorLogWidget.ui
  264. Resources/UI/ctkMaterialPropertyWidget.ui
  265. Resources/UI/ctkModalityWidget.ui
  266. Resources/UI/ctkScreenshotDialog.ui
  267. Resources/UI/ctkSettingsDialog.ui
  268. Resources/UI/ctkSliderWidget.ui
  269. Resources/UI/ctkThumbnailLabel.ui
  270. Resources/UI/ctkThumbnailListWidget.ui
  271. Resources/UI/ctkWorkflowGroupBox.ui
  272. )
  273. # Resources
  274. set(KIT_resources
  275. Resources/ctkWidgets.qrc
  276. )
  277. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  278. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  279. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  280. # A player and a translator must be added for custom Qt widgets
  281. if(CTK_USE_QTTESTING)
  282. list(APPEND KIT_SRCS
  283. ctkAxesWidgetEventPlayer.cpp
  284. ctkAxesWidgetEventPlayer.h
  285. ctkAxesWidgetEventTranslator.cpp
  286. ctkAxesWidgetEventTranslator.h
  287. ctkCheckableComboBoxEventPlayer.cpp
  288. ctkCheckableComboBoxEventPlayer.h
  289. ctkCheckableComboBoxEventTranslator.cpp
  290. ctkCheckableComboBoxEventTranslator.h
  291. ctkCheckableHeaderViewEventPlayer.cpp
  292. ctkCheckableHeaderViewEventPlayer.h
  293. ctkCheckableHeaderViewEventTranslator.cpp
  294. ctkCheckableHeaderViewEventTranslator.h
  295. ctkConsoleEventPlayer.cpp
  296. ctkConsoleEventPlayer.h
  297. ctkConsoleEventTranslator.cpp
  298. ctkConsoleEventTranslator.h
  299. ctkDoubleRangeSliderEventPlayer.cpp
  300. ctkDoubleRangeSliderEventPlayer.h
  301. ctkDoubleRangeSliderEventTranslator.cpp
  302. ctkDoubleRangeSliderEventTranslator.h
  303. ctkFileDialogEventPlayer.cpp
  304. ctkFileDialogEventPlayer.h
  305. ctkFileDialogEventTranslator.cpp
  306. ctkFileDialogEventTranslator.h
  307. ctkFontButtonEventPlayer.cpp
  308. ctkFontButtonEventPlayer.h
  309. ctkFontButtonEventTranslator.cpp
  310. ctkFontButtonEventTranslator.h
  311. ctkMatrixWidgetEventPlayer.cpp
  312. ctkMatrixWidgetEventPlayer.h
  313. ctkMatrixWidgetEventTranslator.cpp
  314. ctkMatrixWidgetEventTranslator.h
  315. ctkMenuComboBoxEventPlayer.cpp
  316. ctkMenuComboBoxEventPlayer.h
  317. ctkMenuComboBoxEventTranslator.cpp
  318. ctkMenuComboBoxEventTranslator.h
  319. ctkPathLineEditEventPlayer.cpp
  320. ctkPathLineEditEventPlayer.h
  321. ctkPathLineEditEventTranslator.cpp
  322. ctkPathLineEditEventTranslator.h
  323. ctkPopupWidgetEventPlayer.cpp
  324. ctkPopupWidgetEventPlayer.h
  325. ctkPopupWidgetEventTranslator.cpp
  326. ctkPopupWidgetEventTranslator.h
  327. ctkRangeSliderEventPlayer.cpp
  328. ctkRangeSliderEventPlayer.h
  329. ctkRangeSliderEventTranslator.cpp
  330. ctkRangeSliderEventTranslator.h
  331. ctkTreeComboBoxEventPlayer.cpp
  332. ctkTreeComboBoxEventPlayer.h
  333. ctkTreeComboBoxEventTranslator.cpp
  334. ctkTreeComboBoxEventTranslator.h
  335. )
  336. list(APPEND KIT_MOC_SRCS
  337. ctkAxesWidgetEventPlayer.h
  338. ctkAxesWidgetEventTranslator.h
  339. ctkCheckableComboBoxEventPlayer.h
  340. ctkCheckableComboBoxEventTranslator.h
  341. ctkCheckableHeaderViewEventPlayer.h
  342. ctkCheckableHeaderViewEventTranslator.h
  343. ctkConsoleEventPlayer.h
  344. ctkConsoleEventTranslator.h
  345. ctkDoubleRangeSliderEventPlayer.h
  346. ctkDoubleRangeSliderEventTranslator.h
  347. ctkFileDialogEventPlayer.h
  348. ctkFileDialogEventTranslator.h
  349. ctkFontButtonEventPlayer.h
  350. ctkFontButtonEventTranslator.h
  351. ctkMatrixWidgetEventPlayer.h
  352. ctkMatrixWidgetEventTranslator.h
  353. ctkMenuComboBoxEventPlayer.h
  354. ctkMenuComboBoxEventTranslator.h
  355. ctkPathLineEditEventPlayer.h
  356. ctkPathLineEditEventTranslator.h
  357. ctkPopupWidgetEventPlayer.h
  358. ctkPopupWidgetEventTranslator.h
  359. ctkRangeSliderEventPlayer.h
  360. ctkRangeSliderEventTranslator.h
  361. ctkTreeComboBoxEventPlayer.h
  362. ctkTreeComboBoxEventTranslator.h
  363. )
  364. list(APPEND KIT_target_libraries QtTesting)
  365. endif()
  366. ctkMacroBuildLib(
  367. NAME ${PROJECT_NAME}
  368. EXPORT_DIRECTIVE ${KIT_export_directive}
  369. SRCS ${KIT_SRCS}
  370. MOC_SRCS ${KIT_MOC_SRCS}
  371. UI_FORMS ${KIT_UI_FORMS}
  372. TARGET_LIBRARIES ${KIT_target_libraries}
  373. RESOURCES ${KIT_resources}
  374. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  375. )
  376. if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
  377. ctkMacroBuildLibWrapper(
  378. TARGET ${PROJECT_NAME}
  379. SRCS ${KIT_SRCS}
  380. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  381. )
  382. endif()
  383. # Plugins
  384. if(CTK_BUILD_QTDESIGNER_PLUGINS)
  385. add_subdirectory(Plugins)
  386. endif()
  387. # Testing
  388. if(BUILD_TESTING)
  389. add_subdirectory(Testing)
  390. endif()