CMakeLists.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. project(CTKCommandLineModulesFrontendQtWebKit)
  2. #
  3. # 3rd party dependencies
  4. #
  5. #
  6. # See CTK/CMake/ctkMacroBuildLib.cmake for details
  7. #
  8. set(KIT_export_directive "CTK_CMDLINEMODULEQTWEBKIT_EXPORT")
  9. # Additional directories to include
  10. # Source files
  11. set(KIT_SRCS
  12. ctkCmdLineModuleFrontendFactoryQtWebKit.cpp
  13. ctkCmdLineModuleFrontendQtWebKit.cpp
  14. ctkCmdLineModuleFrontendQtWebKit_p.h
  15. )
  16. # Headers that should run through moc
  17. set(KIT_MOC_SRCS
  18. )
  19. # UI files
  20. set(KIT_UI_FORMS
  21. )
  22. # Resources
  23. set(KIT_resources
  24. Resources/ctkCmdLineModulesFrontendQtWebKit.qrc
  25. )
  26. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  27. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  28. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  29. if(CTK_QT_VERSION VERSION_GREATER "4")
  30. if(TARGET Qt5::WebKitWidgets)
  31. list(APPEND KIT_target_libraries Qt5::WebKitWidgets)
  32. else()
  33. list(APPEND KIT_target_libraries Qt5::WebEngineWidgets)
  34. endif()
  35. else()
  36. set(QT_USE_QTWEBKIT 1)
  37. include(${QT_USE_FILE})
  38. endif()
  39. ctkMacroBuildLib(
  40. NAME ${PROJECT_NAME}
  41. EXPORT_DIRECTIVE ${KIT_export_directive}
  42. SRCS ${KIT_SRCS}
  43. MOC_SRCS ${KIT_MOC_SRCS}
  44. UI_FORMS ${KIT_UI_FORMS}
  45. TARGET_LIBRARIES ${KIT_target_libraries}
  46. RESOURCES ${KIT_resources}
  47. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  48. )
  49. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
  50. if(CTK_WRAP_PYTHONQT_LIGHT)
  51. ctkMacroBuildLibWrapper(
  52. TARGET ${PROJECT_NAME}
  53. SRCS ${KIT_SRCS}
  54. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  55. )
  56. endif()
  57. # Testing
  58. if(BUILD_TESTING)
  59. # add_subdirectory(Testing)
  60. endif()