CMakeLists.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. project(CTKCore)
  2. #
  3. # 3rd party dependencies
  4. #
  5. # CMake modules
  6. set(CMAKE_MODULE_PATH ${CTKCore_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
  7. # CMake Macros
  8. include(CMake/ctkMacroBFDCheck.cmake) # HAVE_BFD will be set to True if it applies
  9. #
  10. # See CTK/CMake/ctkMacroBuildLib.cmake for details
  11. #
  12. set(KIT_export_directive "CTK_CORE_EXPORT")
  13. # Source files
  14. set(KIT_SRCS
  15. ctkAbstractFactory.h
  16. ctkAbstractFactory.tpp
  17. ctkAbstractFileBasedFactory.h
  18. ctkAbstractFileBasedFactory.tpp
  19. ctkAbstractObjectFactory.h
  20. ctkAbstractObjectFactory.tpp
  21. ctkAbstractPluginFactory.h
  22. ctkAbstractPluginFactory.tpp
  23. ctkAbstractQObjectFactory.h
  24. ctkAbstractQObjectFactory.tpp
  25. ctkAbstractLibraryFactory.h
  26. ctkAbstractLibraryFactory.tpp
  27. ctkBackTrace.cpp
  28. ctkBooleanMapper.cpp
  29. ctkBooleanMapper.h
  30. ctkCallback.cpp
  31. ctkCallback.h
  32. ctkCommandLineParser.cpp
  33. ctkCommandLineParser.h
  34. ctkDependencyGraph.cpp
  35. ctkDependencyGraph.h
  36. ctkErrorLogAbstractMessageHandler.cpp
  37. ctkErrorLogAbstractMessageHandler.h
  38. ctkErrorLogFDMessageHandler.cpp
  39. ctkErrorLogFDMessageHandler.h
  40. ctkErrorLogFDMessageHandler_p.h
  41. ctkErrorLogLevel.cpp
  42. ctkErrorLogLevel.h
  43. ctkErrorLogQtMessageHandler.cpp
  44. ctkErrorLogQtMessageHandler.h
  45. ctkErrorLogStreamMessageHandler.cpp
  46. ctkErrorLogStreamMessageHandler.h
  47. ctkErrorLogTerminalOutput.cpp
  48. ctkErrorLogTerminalOutput.h
  49. ctkException.cpp
  50. ctkException.h
  51. ctkHighPrecisionTimer.cpp
  52. ctkLinearValueProxy.cpp
  53. ctkLinearValueProxy.h
  54. ctkLogger.cpp
  55. ctkLogger.h
  56. ctkModelTester.cpp
  57. ctkModelTester.h
  58. ctkPimpl.h
  59. ctkScopedCurrentDir.cpp
  60. ctkScopedCurrentDir.h
  61. ctkSingleton.h
  62. ctkUtils.cpp
  63. ctkUtils.h
  64. ctkValueProxy.cpp
  65. ctkValueProxy.h
  66. ctkWorkflow.h
  67. ctkWorkflow.cpp
  68. ctkWorkflow_p.h
  69. ctkWorkflowStep.h
  70. ctkWorkflowStep.cpp
  71. ctkWorkflowStep_p.h
  72. ctkWorkflowTransitions.h
  73. ctkSetName.cpp
  74. ctkSetName.h
  75. )
  76. if(HAVE_BFD)
  77. list(APPEND KIT_SRCS
  78. ctkBinaryFileDescriptor.cpp
  79. ctkBinaryFileDescriptor.h
  80. )
  81. endif()
  82. # Headers that should run through moc
  83. set(KIT_MOC_SRCS
  84. ctkBooleanMapper.h
  85. ctkCallback.h
  86. ctkCommandLineParser.h
  87. ctkErrorLogAbstractMessageHandler.h
  88. ctkErrorLogFDMessageHandler_p.h
  89. ctkErrorLogLevel.h
  90. ctkErrorLogQtMessageHandler.h
  91. ctkErrorLogTerminalOutput.h
  92. ctkLinearValueProxy.h
  93. ctkLogger.h
  94. ctkModelTester.h
  95. ctkErrorLogQtMessageHandler.h
  96. ctkValueProxy.h
  97. ctkWorkflow.h
  98. ctkWorkflow_p.h
  99. ctkWorkflowStep_p.h
  100. ctkWorkflowTransitions.h
  101. )
  102. # UI files
  103. set(KIT_UI_FORMS
  104. )
  105. # Resources
  106. set(KIT_resources
  107. )
  108. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  109. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  110. set(KIT_target_libraries)
  111. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  112. if(CTK_QT_VERSION VERSION_GREATER "4")
  113. list(APPEND KIT_target_libraries Qt5::Core)
  114. endif()
  115. ctkMacroBuildLib(
  116. NAME ${PROJECT_NAME}
  117. EXPORT_DIRECTIVE ${KIT_export_directive}
  118. SRCS ${KIT_SRCS}
  119. MOC_SRCS ${KIT_MOC_SRCS}
  120. UI_FORMS ${KIT_UI_FORMS}
  121. TARGET_LIBRARIES ${KIT_target_libraries}
  122. RESOURCES ${KIT_resources}
  123. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  124. )
  125. # Needed for ctkBackTrace
  126. if(UNIX)
  127. target_link_libraries(${PROJECT_NAME} dl)
  128. elseif(WIN32 AND NOT MINGW)
  129. target_link_libraries(${PROJECT_NAME} dbghelp)
  130. endif()
  131. if(CTK_WRAP_PYTHONQT_LIGHT)
  132. ctkMacroBuildLibWrapper(
  133. TARGET ${PROJECT_NAME}
  134. SRCS ${KIT_SRCS}
  135. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  136. )
  137. endif()
  138. # Testing
  139. if(BUILD_TESTING)
  140. add_subdirectory(Testing)
  141. # Compile source code snippets
  142. add_subdirectory(Documentation/Snippets)
  143. endif()