CMakeLists.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. project(CTKVisualizationVTKCore)
  2. #
  3. # 3rd party dependencies
  4. #
  5. include(${VTK_USE_FILE})
  6. if(CTK_LIB_Scripting/Python/Core AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
  7. find_package(PythonQt REQUIRED)
  8. endif()
  9. #
  10. # See CTK/CMake/ctkMacroBuildLib.cmake for details
  11. #
  12. set(KIT_export_directive "CTK_VISUALIZATION_VTK_CORE_EXPORT")
  13. # Source files
  14. set(KIT_SRCS
  15. ctkVTKColorTransferFunction.cpp
  16. ctkVTKColorTransferFunction.h
  17. ctkVTKCompositeFunction.cpp
  18. ctkVTKCompositeFunction.h
  19. ctkVTKConnection.cpp
  20. ctkVTKConnection.h
  21. ctkVTKErrorLogMessageHandler.cpp
  22. ctkVTKErrorLogMessageHandler.h
  23. ctkVTKHistogram.cpp
  24. ctkVTKHistogram.h
  25. ctkVTKLookupTable.cpp
  26. ctkVTKLookupTable.h
  27. ctkVTKObject.h
  28. ctkVTKObjectEventsObserver.cpp
  29. ctkVTKObjectEventsObserver.h
  30. ctkVTKPiecewiseFunction.cpp
  31. ctkVTKPiecewiseFunction.h
  32. vtkLightBoxRendererManager.cpp
  33. vtkLightBoxRendererManager.h
  34. )
  35. # Headers that should run through moc
  36. set(KIT_MOC_SRCS
  37. ctkVTKColorTransferFunction.h
  38. ctkVTKConnection.h
  39. ctkVTKCompositeFunction.h
  40. ctkVTKLookupTable.h
  41. ctkVTKHistogram.h
  42. ctkVTKObjectEventsObserver.h
  43. ctkVTKPiecewiseFunction.h
  44. )
  45. # UI files
  46. set(KIT_UI_FORMS
  47. )
  48. # Resources
  49. set(KIT_resources
  50. )
  51. if(CTK_LIB_Scripting/Python/Core AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
  52. list(APPEND KIT_SRCS
  53. ctkVTKPythonQtWrapperFactory.cpp
  54. )
  55. endif()
  56. set(KIT_INCLUDE_DIRECTORIES )
  57. if(CTK_LIB_Scripting/Python/Core AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
  58. list(APPEND KIT_INCLUDE_DIRECTORIES
  59. ${PYTHON_INCLUDE_DIRS}
  60. ${PYTHONQT_INCLUDE_DIR}
  61. )
  62. endif()
  63. # Set VTK_LIBRARIES variable
  64. set(VTK_LIBRARIES
  65. vtkCommon
  66. vtkFiltering
  67. vtkRendering
  68. vtkHybrid
  69. )
  70. if(CTK_LIB_Scripting/Python/Core AND CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)
  71. list(APPEND VTK_LIBRARIES ${PYTHON_LIBRARY} ${PYTHONQT_LIBRARIES})
  72. if(${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR} VERSION_GREATER 5.6)
  73. list(APPEND VTK_LIBRARIES vtkPythonCore)
  74. else()
  75. list(APPEND VTK_LIBRARIES vtkCommonPythonD)
  76. endif()
  77. endif()
  78. if(Q_WS_X11)
  79. # If the faster 'gold' linker is used, to avoid complaints about undefined symbol
  80. # 'XGetWindowAttributes', 'XCreateWindow', ..., let's link against X11 libraries.
  81. find_package(X11)
  82. list(APPEND VTK_LIBRARIES ${X11_LIBRARIES})
  83. endif()
  84. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  85. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  86. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  87. ctkMacroBuildLib(
  88. NAME ${PROJECT_NAME}
  89. EXPORT_DIRECTIVE ${KIT_export_directive}
  90. SRCS ${KIT_SRCS}
  91. MOC_SRCS ${KIT_MOC_SRCS}
  92. UI_FORMS ${KIT_UI_FORMS}
  93. INCLUDE_DIRECTORIES ${KIT_INCLUDE_DIRECTORIES}
  94. TARGET_LIBRARIES ${KIT_target_libraries}
  95. RESOURCES ${KIT_resources}
  96. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  97. )
  98. if(CTK_WRAP_PYTHONQT_FULL OR CTK_WRAP_PYTHONQT_LIGHT)
  99. ctkMacroBuildLibWrapper(
  100. TARGET ${PROJECT_NAME}
  101. SRCS ${KIT_SRCS}
  102. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  103. )
  104. endif()
  105. # Plugins
  106. #if(CTK_BUILD_QTDESIGNER_PLUGINS)
  107. # add_subdirectory(Plugins)
  108. #endif()
  109. # Testing
  110. if(BUILD_TESTING)
  111. add_subdirectory(Testing)
  112. endif()