CMakeLists.txt 12 KB

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