CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. if(CTK_QT_VERSION VERSION_GREATER "4")
  56. QT5_GENERATE_MOCS(
  57. ctkCmdLineModuleFrontend.h
  58. ctkCmdLineModuleXmlProgressWatcher.h
  59. )
  60. else()
  61. QT4_GENERATE_MOCS(
  62. ctkCmdLineModuleFrontend.h
  63. ctkCmdLineModuleXmlProgressWatcher.h
  64. )
  65. endif()
  66. #list(APPEND KIT_SRCS
  67. # ${CMAKE_CURRENT_BINARY_DIR}/moc_ctkCmdLineModuleXmlProgressWatcher.h
  68. #)
  69. # UI files
  70. set(KIT_UI_FORMS
  71. )
  72. # Resources
  73. set(KIT_resources
  74. Resources/ctkCmdLineModules.qrc
  75. )
  76. set(QT_USE_QTXMLPATTERNS 1)
  77. include(${QT_USE_FILE})
  78. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  79. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  80. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  81. ctkMacroBuildLib(
  82. NAME ${PROJECT_NAME}
  83. EXPORT_DIRECTIVE ${KIT_export_directive}
  84. INCLUDE_DIRECTORIES ${KIT_include_directories}
  85. SRCS ${KIT_SRCS}
  86. MOC_SRCS ${KIT_MOC_SRCS}
  87. UI_FORMS ${KIT_UI_FORMS}
  88. TARGET_LIBRARIES ${KIT_target_libraries}
  89. RESOURCES ${KIT_resources}
  90. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  91. )
  92. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
  93. if(CTK_WRAP_PYTHONQT_LIGHT)
  94. ctkMacroBuildLibWrapper(
  95. TARGET ${PROJECT_NAME}
  96. SRCS ${KIT_SRCS}
  97. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  98. )
  99. endif()
  100. # Testing
  101. if(BUILD_TESTING)
  102. add_subdirectory(Testing)
  103. endif()