CMakeLists.txt 10 KB

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