CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. ctkCmdLineModuleUtils.cpp
  42. ctkCmdLineModuleXmlException.cpp
  43. ctkCmdLineModuleXmlMsgHandler_p.h
  44. ctkCmdLineModuleXmlMsgHandler.cpp
  45. ctkCmdLineModuleXmlParser_p.h
  46. ctkCmdLineModuleXmlParser.cpp
  47. ctkCmdLineModuleXmlValidator.cpp
  48. ctkCmdLineModuleXslTransform.cpp
  49. )
  50. # Headers that should run through moc
  51. set(KIT_MOC_SRCS
  52. ctkCmdLineModuleDirectoryWatcher.h
  53. ctkCmdLineModuleDirectoryWatcher_p.h
  54. ctkCmdLineModuleFutureWatcher.h
  55. ctkCmdLineModuleManager.h
  56. )
  57. set(KIT_GENERATE_MOC_SRCS
  58. ctkCmdLineModuleFrontend.h
  59. ctkCmdLineModuleXmlProgressWatcher.h
  60. )
  61. # UI files
  62. set(KIT_UI_FORMS
  63. )
  64. # Resources
  65. set(KIT_resources
  66. Resources/ctkCmdLineModules.qrc
  67. )
  68. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  69. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  70. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  71. if(CTK_QT_VERSION VERSION_GREATER "4")
  72. list(APPEND KIT_target_libraries Qt5::XmlPatterns Qt5::Widgets Qt5::Concurrent)
  73. else()
  74. set(QT_USE_QTXMLPATTERNS 1)
  75. include(${QT_USE_FILE})
  76. endif()
  77. ctkMacroBuildLib(
  78. NAME ${PROJECT_NAME}
  79. EXPORT_DIRECTIVE ${KIT_export_directive}
  80. SRCS ${KIT_SRCS}
  81. MOC_SRCS ${KIT_MOC_SRCS}
  82. GENERATE_MOC_SRCS ${KIT_GENERATE_MOC_SRCS}
  83. UI_FORMS ${KIT_UI_FORMS}
  84. TARGET_LIBRARIES ${KIT_target_libraries}
  85. RESOURCES ${KIT_resources}
  86. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  87. )
  88. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
  89. if(CTK_WRAP_PYTHONQT_LIGHT)
  90. ctkMacroBuildLibWrapper(
  91. TARGET ${PROJECT_NAME}
  92. SRCS ${KIT_SRCS}
  93. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  94. )
  95. endif()
  96. # Testing
  97. if(BUILD_TESTING)
  98. add_subdirectory(Testing)
  99. endif()