CMakeLists.txt 11 KB

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