CMakeLists.txt 11 KB

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