CMakeLists.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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. ctkDoubleSpinBox.cpp
  67. ctkDoubleSpinBox.h
  68. ctkDynamicSpacer.cpp
  69. ctkDynamicSpacer.h
  70. ctkErrorLogStatusMessageHandler.cpp
  71. ctkErrorLogStatusMessageHandler.h
  72. ctkErrorLogWidget.cpp
  73. ctkErrorLogWidget.h
  74. ctkExpandButton.cpp
  75. ctkExpandButton.h
  76. ctkExpandableWidget.cpp
  77. ctkExpandableWidget.h
  78. ctkFileDialog.cpp
  79. ctkFileDialog.h
  80. ctkFittedTextBrowser.cpp
  81. ctkFittedTextBrowser.h
  82. ctkFlatProxyModel.cpp
  83. ctkFlatProxyModel.h
  84. ctkFlowLayout.cpp
  85. ctkFlowLayout.h
  86. ctkFontButton.cpp
  87. ctkFontButton.h
  88. ctkIconEnginePlugin.cpp
  89. ctkIconEnginePlugin.h
  90. ctkLanguageComboBox.cpp
  91. ctkLanguageComboBox.h
  92. ctkLayoutManager.cpp
  93. ctkLayoutManager.h
  94. ctkMaterialPropertyPreviewLabel.cpp
  95. ctkMaterialPropertyPreviewLabel.h
  96. ctkMaterialPropertyWidget.cpp
  97. ctkMaterialPropertyWidget.h
  98. ctkMatrixWidget.cpp
  99. ctkMatrixWidget.h
  100. ctkMenuButton.cpp
  101. ctkMenuButton.h
  102. ctkMenuComboBox.cpp
  103. ctkMenuComboBox.h
  104. ctkMenuComboBox_p.h
  105. ctkMessageBox.cpp
  106. ctkMessageBox.h
  107. ctkModalityWidget.cpp
  108. ctkModalityWidget.h
  109. ctkPathLineEdit.cpp
  110. ctkPathLineEdit.h
  111. ctkPathListButtonsWidget.cpp
  112. ctkPathListButtonsWidget.h
  113. ctkPathListButtonsWidget_p.h
  114. ctkPathListWidget.cpp
  115. ctkPathListWidget.h
  116. ctkPixmapIconEngine.cpp
  117. ctkPixmapIconEngine.h
  118. ctkPopupWidget.cpp
  119. ctkPopupWidget.h
  120. ctkPopupWidget_p.h
  121. ctkProxyStyle.cpp
  122. ctkProxyStyle.h
  123. ctkPushButton.cpp
  124. ctkPushButton.h
  125. ctkPushButton_p.h
  126. ctkQImageView.cpp
  127. ctkQImageView.h
  128. ctkRangeSlider.cpp
  129. ctkRangeSlider.h
  130. ctkRangeWidget.cpp
  131. ctkRangeWidget.h
  132. ctkScreenshotDialog.cpp
  133. ctkScreenshotDialog.h
  134. ctkScreenshotDialog_p.h
  135. ctkSearchBox.cpp
  136. ctkSearchBox.h
  137. ctkSettings.cpp
  138. ctkSettings.h
  139. ctkSettingsDialog.cpp
  140. ctkSettingsDialog.h
  141. ctkSettingsPanel.cpp
  142. ctkSettingsPanel.h
  143. ctkSignalMapper.cpp
  144. ctkSignalMapper.h
  145. ctkSimpleLayoutManager.cpp
  146. ctkSimpleLayoutManager.h
  147. ctkSizeGrip.cpp
  148. ctkSizeGrip.h
  149. ctkSliderWidget.cpp
  150. ctkSliderWidget.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. ctkDoubleSpinBox.h
  220. ctkDoubleSpinBox_p.h
  221. ctkDynamicSpacer.h
  222. ctkErrorLogWidget.h
  223. ctkErrorLogStatusMessageHandler.h
  224. ctkExpandButton.h
  225. ctkExpandableWidget.h
  226. ctkFileDialog.h
  227. ctkFittedTextBrowser.h
  228. ctkFlatProxyModel.h
  229. ctkFlowLayout.h
  230. ctkFontButton.h
  231. ctkIconEnginePlugin.h
  232. ctkLanguageComboBox.h
  233. ctkLayoutManager.h
  234. ctkMaterialPropertyPreviewLabel.h
  235. ctkMaterialPropertyWidget.h
  236. ctkMatrixWidget.h
  237. ctkMenuButton.h
  238. ctkMenuComboBox.h
  239. ctkMenuComboBox_p.h
  240. ctkMessageBox.h
  241. ctkModalityWidget.h
  242. ctkPathListButtonsWidget.h
  243. ctkPathListButtonsWidget_p.h
  244. ctkPopupWidget.h
  245. ctkPopupWidget_p.h
  246. ctkProxyStyle.h
  247. ctkPushButton.h
  248. ctkQImageView.h
  249. ctkRangeSlider.h
  250. ctkRangeWidget.h
  251. ctkScreenshotDialog.h
  252. ctkScreenshotDialog_p.h
  253. ctkSearchBox.h
  254. ctkSettings.h
  255. ctkSettingsDialog.h
  256. ctkSettingsPanel.h
  257. ctkSignalMapper.h
  258. ctkSimpleLayoutManager.h
  259. ctkSizeGrip.h
  260. ctkSliderWidget.h
  261. ctkTestApplication.h
  262. ctkThumbnailLabel.h
  263. ctkThumbnailListWidget.h
  264. ctkToolTipTrapper.h
  265. ctkTransferFunctionBarsItem.h
  266. ctkTransferFunctionControlPointsItem.h
  267. ctkTransferFunctionGradientItem.h
  268. ctkTransferFunctionItem.h
  269. ctkTransferFunctionScene.h
  270. ctkTransferFunctionView.h
  271. ctkTreeComboBox.h
  272. ctkWorkflowAbstractPagedWidget.h
  273. ctkWorkflowButtonBoxWidget.h
  274. ctkWorkflowGroupBox.h
  275. ctkWorkflowStackedWidget.h
  276. ctkWorkflowTabWidget.h
  277. ctkWorkflowWidget.h
  278. ctkWorkflowWidgetStep.h
  279. ctkWorkflowWidgetStep_p.h
  280. )
  281. QT4_GENERATE_MOCS(
  282. ctkPathLineEdit.h
  283. ctkPathListWidget.h
  284. )
  285. # UI files
  286. set(KIT_UI_FORMS
  287. Resources/UI/ctkAddRemoveComboBox.ui
  288. Resources/UI/ctkRangeWidget.ui
  289. Resources/UI/ctkDateRangeWidget.ui
  290. Resources/UI/ctkErrorLogWidget.ui
  291. Resources/UI/ctkMaterialPropertyWidget.ui
  292. Resources/UI/ctkModalityWidget.ui
  293. Resources/UI/ctkPathListButtonsWidget.ui
  294. Resources/UI/ctkScreenshotDialog.ui
  295. Resources/UI/ctkSettingsDialog.ui
  296. Resources/UI/ctkSliderWidget.ui
  297. Resources/UI/ctkThumbnailLabel.ui
  298. Resources/UI/ctkThumbnailListWidget.ui
  299. Resources/UI/ctkWorkflowGroupBox.ui
  300. )
  301. # Resources
  302. set(KIT_resources
  303. Resources/ctkWidgets.qrc
  304. )
  305. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  306. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  307. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  308. # A player and a translator must be added for custom Qt widgets
  309. if(CTK_USE_QTTESTING)
  310. list(APPEND KIT_SRCS
  311. ctkAxesWidgetEventPlayer.cpp
  312. ctkAxesWidgetEventPlayer.h
  313. ctkAxesWidgetEventTranslator.cpp
  314. ctkAxesWidgetEventTranslator.h
  315. ctkCheckableComboBoxEventPlayer.cpp
  316. ctkCheckableComboBoxEventPlayer.h
  317. ctkCheckableComboBoxEventTranslator.cpp
  318. ctkCheckableComboBoxEventTranslator.h
  319. ctkCheckableHeaderViewEventPlayer.cpp
  320. ctkCheckableHeaderViewEventPlayer.h
  321. ctkCheckableHeaderViewEventTranslator.cpp
  322. ctkCheckableHeaderViewEventTranslator.h
  323. ctkConsoleEventPlayer.cpp
  324. ctkConsoleEventPlayer.h
  325. ctkConsoleEventTranslator.cpp
  326. ctkConsoleEventTranslator.h
  327. ctkDoubleRangeSliderEventPlayer.cpp
  328. ctkDoubleRangeSliderEventPlayer.h
  329. ctkDoubleRangeSliderEventTranslator.cpp
  330. ctkDoubleRangeSliderEventTranslator.h
  331. ctkFileDialogEventPlayer.cpp
  332. ctkFileDialogEventPlayer.h
  333. ctkFileDialogEventTranslator.cpp
  334. ctkFileDialogEventTranslator.h
  335. ctkFontButtonEventPlayer.cpp
  336. ctkFontButtonEventPlayer.h
  337. ctkFontButtonEventTranslator.cpp
  338. ctkFontButtonEventTranslator.h
  339. ctkMatrixWidgetEventPlayer.cpp
  340. ctkMatrixWidgetEventPlayer.h
  341. ctkMatrixWidgetEventTranslator.cpp
  342. ctkMatrixWidgetEventTranslator.h
  343. ctkMenuComboBoxEventPlayer.cpp
  344. ctkMenuComboBoxEventPlayer.h
  345. ctkMenuComboBoxEventTranslator.cpp
  346. ctkMenuComboBoxEventTranslator.h
  347. ctkPathLineEditEventPlayer.cpp
  348. ctkPathLineEditEventPlayer.h
  349. ctkPathLineEditEventTranslator.cpp
  350. ctkPathLineEditEventTranslator.h
  351. ctkPopupWidgetEventPlayer.cpp
  352. ctkPopupWidgetEventPlayer.h
  353. ctkPopupWidgetEventTranslator.cpp
  354. ctkPopupWidgetEventTranslator.h
  355. ctkRangeSliderEventPlayer.cpp
  356. ctkRangeSliderEventPlayer.h
  357. ctkRangeSliderEventTranslator.cpp
  358. ctkRangeSliderEventTranslator.h
  359. ctkTreeComboBoxEventPlayer.cpp
  360. ctkTreeComboBoxEventPlayer.h
  361. ctkTreeComboBoxEventTranslator.cpp
  362. ctkTreeComboBoxEventTranslator.h
  363. )
  364. list(APPEND KIT_MOC_SRCS
  365. ctkAxesWidgetEventPlayer.h
  366. ctkAxesWidgetEventTranslator.h
  367. ctkCheckableComboBoxEventPlayer.h
  368. ctkCheckableComboBoxEventTranslator.h
  369. ctkCheckableHeaderViewEventPlayer.h
  370. ctkCheckableHeaderViewEventTranslator.h
  371. ctkConsoleEventPlayer.h
  372. ctkConsoleEventTranslator.h
  373. ctkDoubleRangeSliderEventPlayer.h
  374. ctkDoubleRangeSliderEventTranslator.h
  375. ctkFileDialogEventPlayer.h
  376. ctkFileDialogEventTranslator.h
  377. ctkFontButtonEventPlayer.h
  378. ctkFontButtonEventTranslator.h
  379. ctkMatrixWidgetEventPlayer.h
  380. ctkMatrixWidgetEventTranslator.h
  381. ctkMenuComboBoxEventPlayer.h
  382. ctkMenuComboBoxEventTranslator.h
  383. ctkPathLineEditEventPlayer.h
  384. ctkPathLineEditEventTranslator.h
  385. ctkPopupWidgetEventPlayer.h
  386. ctkPopupWidgetEventTranslator.h
  387. ctkRangeSliderEventPlayer.h
  388. ctkRangeSliderEventTranslator.h
  389. ctkTreeComboBoxEventPlayer.h
  390. ctkTreeComboBoxEventTranslator.h
  391. )
  392. list(APPEND KIT_target_libraries QtTesting)
  393. endif()
  394. ctkMacroBuildLib(
  395. NAME ${PROJECT_NAME}
  396. EXPORT_DIRECTIVE ${KIT_export_directive}
  397. SRCS ${KIT_SRCS}
  398. MOC_SRCS ${KIT_MOC_SRCS}
  399. UI_FORMS ${KIT_UI_FORMS}
  400. TARGET_LIBRARIES ${KIT_target_libraries}
  401. RESOURCES ${KIT_resources}
  402. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  403. )
  404. if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
  405. ctkMacroBuildLibWrapper(
  406. TARGET ${PROJECT_NAME}
  407. SRCS ${KIT_SRCS}
  408. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  409. )
  410. endif()
  411. # Plugins
  412. if(CTK_BUILD_QTDESIGNER_PLUGINS)
  413. add_subdirectory(Plugins)
  414. endif()
  415. # Testing
  416. if(BUILD_TESTING)
  417. add_subdirectory(Testing)
  418. endif()