CMakeLists.txt 12 KB

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