CMakeLists.txt 3.8 KB

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