CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. project(CTKCommandLineModulesCore)
  2. #
  3. # 3rd party dependencies
  4. #
  5. #
  6. # See CTK/CMake/ctkMacroBuildLib.cmake for details
  7. #
  8. set(KIT_export_directive "CTK_CMDLINEMODULECORE_EXPORT")
  9. # Additional directories to include
  10. # Source files
  11. set(KIT_SRCS
  12. ctkCmdLineModuleBackend.cpp
  13. ctkCmdLineModuleCache.cpp
  14. ctkCmdLineModuleCache_p.h
  15. ctkCmdLineModuleConcurrentHelpers.cpp
  16. ctkCmdLineModuleDefaultPathBuilder.cpp
  17. ctkCmdLineModuleDescription.cpp
  18. ctkCmdLineModuleDescription_p.h
  19. ctkCmdLineModuleDirectoryWatcher.cpp
  20. ctkCmdLineModuleDirectoryWatcher_p.h
  21. ctkCmdLineModuleFrontend.h
  22. ctkCmdLineModuleFrontend.cpp
  23. ctkCmdLineModuleFrontendFactory.cpp
  24. ctkCmdLineModuleFuture.cpp
  25. ctkCmdLineModuleFutureInterface_p.h
  26. ctkCmdLineModuleFutureInterface.cpp
  27. ctkCmdLineModuleFutureWatcher.cpp
  28. ctkCmdLineModuleManager.cpp
  29. ctkCmdLineModuleParameter.cpp
  30. ctkCmdLineModuleParameter_p.h
  31. ctkCmdLineModuleParameterGroup.cpp
  32. ctkCmdLineModuleParameterGroup_p.h
  33. ctkCmdLineModuleParameterParsers_p.h
  34. ctkCmdLineModulePathBuilder.cpp
  35. ctkCmdLineModuleResult.cpp
  36. ctkCmdLineModuleXmlProgressWatcher.h
  37. ctkCmdLineModuleXmlProgressWatcher.cpp
  38. ctkCmdLineModuleReference.cpp
  39. ctkCmdLineModuleRunException.cpp
  40. ctkCmdLineModuleTimeoutException.cpp
  41. ctkCmdLineModuleXmlException.cpp
  42. ctkCmdLineModuleXmlMsgHandler_p.h
  43. ctkCmdLineModuleXmlMsgHandler.cpp
  44. ctkCmdLineModuleXmlParser_p.h
  45. ctkCmdLineModuleXmlParser.cpp
  46. ctkCmdLineModuleXmlValidator.cpp
  47. ctkCmdLineModuleXslTransform.cpp
  48. )
  49. # Headers that should run through moc
  50. set(KIT_MOC_SRCS
  51. ctkCmdLineModuleDirectoryWatcher.h
  52. ctkCmdLineModuleDirectoryWatcher_p.h
  53. ctkCmdLineModuleFutureWatcher.h
  54. ctkCmdLineModuleManager.h
  55. )
  56. set(KIT_GENERATE_MOC_SRCS
  57. ctkCmdLineModuleFrontend.h
  58. ctkCmdLineModuleXmlProgressWatcher.h
  59. )
  60. # UI files
  61. set(KIT_UI_FORMS
  62. )
  63. # Resources
  64. set(KIT_resources
  65. Resources/ctkCmdLineModules.qrc
  66. )
  67. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  68. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  69. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  70. if(CTK_QT_VERSION VERSION_GREATER "4")
  71. list(APPEND KIT_target_libraries Qt5::XmlPatterns Qt5::Gui Qt5::Concurrent)
  72. else()
  73. set(QT_USE_QTXMLPATTERNS 1)
  74. include(${QT_USE_FILE})
  75. endif()
  76. ctkMacroBuildLib(
  77. NAME ${PROJECT_NAME}
  78. EXPORT_DIRECTIVE ${KIT_export_directive}
  79. SRCS ${KIT_SRCS}
  80. MOC_SRCS ${KIT_MOC_SRCS}
  81. GENERATE_MOC_SRCS ${KIT_GENERATE_MOC_SRCS}
  82. UI_FORMS ${KIT_UI_FORMS}
  83. TARGET_LIBRARIES ${KIT_target_libraries}
  84. RESOURCES ${KIT_resources}
  85. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  86. )
  87. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
  88. if(CTK_WRAP_PYTHONQT_LIGHT)
  89. ctkMacroBuildLibWrapper(
  90. TARGET ${PROJECT_NAME}
  91. SRCS ${KIT_SRCS}
  92. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  93. )
  94. endif()
  95. # Testing
  96. if(BUILD_TESTING)
  97. add_subdirectory(Testing)
  98. endif()