CMakeLists.txt 11 KB

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