CMakeLists.txt 12 KB

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