CMakeLists.txt 12 KB

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