CMakeLists.txt 11 KB

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