CMakeLists.txt 2.8 KB

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