CMakeLists.txt 10 KB

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