CMakeLists.txt 11 KB

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