CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. ctkErrorLogContext.h
  39. ctkErrorLogFDMessageHandler.cpp
  40. ctkErrorLogFDMessageHandler.h
  41. ctkErrorLogFDMessageHandler_p.h
  42. ctkErrorLogLevel.cpp
  43. ctkErrorLogLevel.h
  44. ctkErrorLogQtMessageHandler.cpp
  45. ctkErrorLogQtMessageHandler.h
  46. ctkErrorLogStreamMessageHandler.cpp
  47. ctkErrorLogStreamMessageHandler.h
  48. ctkErrorLogTerminalOutput.cpp
  49. ctkErrorLogTerminalOutput.h
  50. ctkException.cpp
  51. ctkException.h
  52. ctkFileLogger.cpp
  53. ctkFileLogger.h
  54. ctkHighPrecisionTimer.cpp
  55. ctkLinearValueProxy.cpp
  56. ctkLinearValueProxy.h
  57. ctkLogger.cpp
  58. ctkLogger.h
  59. ctkModelTester.cpp
  60. ctkModelTester.h
  61. ctkPimpl.h
  62. ctkScopedCurrentDir.cpp
  63. ctkScopedCurrentDir.h
  64. ctkSingleton.h
  65. ctkUtils.cpp
  66. ctkUtils.h
  67. ctkValueProxy.cpp
  68. ctkValueProxy.h
  69. ctkWorkflow.h
  70. ctkWorkflow.cpp
  71. ctkWorkflow_p.h
  72. ctkWorkflowStep.h
  73. ctkWorkflowStep.cpp
  74. ctkWorkflowStep_p.h
  75. ctkWorkflowTransitions.h
  76. ctkSetName.cpp
  77. ctkSetName.h
  78. )
  79. if(HAVE_BFD)
  80. list(APPEND KIT_SRCS
  81. ctkBinaryFileDescriptor.cpp
  82. ctkBinaryFileDescriptor.h
  83. )
  84. endif()
  85. # Headers that should run through moc
  86. set(KIT_MOC_SRCS
  87. ctkBooleanMapper.h
  88. ctkCallback.h
  89. ctkCommandLineParser.h
  90. ctkErrorLogAbstractMessageHandler.h
  91. ctkErrorLogFDMessageHandler_p.h
  92. ctkErrorLogLevel.h
  93. ctkErrorLogQtMessageHandler.h
  94. ctkErrorLogTerminalOutput.h
  95. ctkFileLogger.h
  96. ctkLinearValueProxy.h
  97. ctkLogger.h
  98. ctkModelTester.h
  99. ctkErrorLogQtMessageHandler.h
  100. ctkValueProxy.h
  101. ctkWorkflow.h
  102. ctkWorkflow_p.h
  103. ctkWorkflowStep_p.h
  104. ctkWorkflowTransitions.h
  105. )
  106. # UI files
  107. set(KIT_UI_FORMS
  108. )
  109. # Resources
  110. set(KIT_resources
  111. )
  112. # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
  113. # The following macro will read the target libraries from the file 'target_libraries.cmake'
  114. set(KIT_target_libraries)
  115. ctkFunctionGetTargetLibraries(KIT_target_libraries)
  116. if(CTK_QT_VERSION VERSION_GREATER "4")
  117. list(APPEND KIT_target_libraries Qt5::Core)
  118. endif()
  119. ctkMacroBuildLib(
  120. NAME ${PROJECT_NAME}
  121. EXPORT_DIRECTIVE ${KIT_export_directive}
  122. SRCS ${KIT_SRCS}
  123. MOC_SRCS ${KIT_MOC_SRCS}
  124. UI_FORMS ${KIT_UI_FORMS}
  125. TARGET_LIBRARIES ${KIT_target_libraries}
  126. RESOURCES ${KIT_resources}
  127. LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  128. )
  129. # Needed for ctkBackTrace
  130. if(UNIX)
  131. target_link_libraries(${PROJECT_NAME} dl)
  132. elseif(WIN32 AND NOT MINGW)
  133. target_link_libraries(${PROJECT_NAME} dbghelp)
  134. endif()
  135. if(CTK_WRAP_PYTHONQT_LIGHT)
  136. ctkMacroBuildLibWrapper(
  137. TARGET ${PROJECT_NAME}
  138. SRCS ${KIT_SRCS}
  139. WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
  140. )
  141. endif()
  142. # Testing
  143. if(BUILD_TESTING)
  144. add_subdirectory(Testing)
  145. # Compile source code snippets
  146. add_subdirectory(Documentation/Snippets)
  147. endif()