CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. project(org_commontk_slicermodule)
  2. set(PLUGIN_export_directive "org_commontk_slicermodule_EXPORT")
  3. set(PLUGIN_SRCS
  4. ctkSlicerModulePlugin.cpp
  5. ctkSlicerModulePlugin_p.h
  6. ctkSlicerModuleReader.cpp
  7. ctkSlicerModuleReader.h
  8. ctkSlicerModuleStringConverter.h
  9. ctkSlicerModuleStringConverter.cpp
  10. )
  11. # Files which should be processed by Qts moc
  12. set(PLUGIN_MOC_SRCS
  13. ctkSlicerModulePlugin_p.h
  14. ctkSlicerModuleReader.h
  15. ctkSlicerModuleStringConverter.h
  16. )
  17. # Qt Designer files which should be processed by Qts uic
  18. set(PLUGIN_UI_FORMS
  19. )
  20. # QRC Files which should be compiled into the plugin
  21. set(PLUGIN_resources
  22. Resources/org_commontk_slicermodule.qrc
  23. )
  24. # Update CTK_BASE_LIBRARIES with QT libraries
  25. if(QT4_FOUND)
  26. set(CTK_BASE_LIBRARIES ${CTK_BASE_LIBRARIES} ${QT_LIBRARIES} CACHE INTERNAL "CTK base libraries" FORCE)
  27. endif()
  28. #Compute the plugin dependencies
  29. ctkMacroGetTargetLibraries(PLUGIN_target_libraries)
  30. ctkMacroBuildPlugin(
  31. NAME ${PROJECT_NAME}
  32. EXPORT_DIRECTIVE ${PLUGIN_export_directive}
  33. SRCS ${PLUGIN_SRCS}
  34. MOC_SRCS ${PLUGIN_MOC_SRCS}
  35. UI_FORMS ${PLUGIN_UI_FORMS}
  36. RESOURCES ${PLUGIN_resources}
  37. TARGET_LIBRARIES ${PLUGIN_target_libraries}
  38. )
  39. set( QT_USE_QTXML ON )
  40. set( QT_USE_QTXMLPATTERNS ON )
  41. include(${QT_USE_FILE})
  42. target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
  43. # Testing
  44. if(BUILD_TESTING)
  45. add_subdirectory(Testing)
  46. endif()