forked from commontk/CTK
/
CMakeLists.txt
183 lines (163 loc) · 4.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
project(CTKCore)
#
# 3rd party dependencies
#
# CMake modules
set(CMAKE_MODULE_PATH ${CTKCore_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
# CMake Macros
include(CMake/ctkMacroBFDCheck.cmake) # HAVE_BFD will be set to True if it applies
#
# See CTK/CMake/ctkMacroBuildLib.cmake for details
#
set(KIT_export_directive "CTK_CORE_EXPORT")
# Copied from Modules/Core/CMakeLists.txt for one include file.
file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
# Source files
set(KIT_SRCS
ctkAbstractFactory.h
ctkAbstractFactory.tpp
ctkAbstractFileBasedFactory.h
ctkAbstractFileBasedFactory.tpp
ctkAbstractObjectFactory.h
ctkAbstractObjectFactory.tpp
ctkAbstractPluginFactory.h
ctkAbstractPluginFactory.tpp
ctkAbstractQObjectFactory.h
ctkAbstractQObjectFactory.tpp
ctkAbstractLibraryFactory.h
ctkAbstractLibraryFactory.tpp
ctkBackTrace.cpp
ctkBooleanMapper.cpp
ctkBooleanMapper.h
ctkCallback.cpp
ctkCallback.h
ctkCommandLineParser.cpp
ctkCommandLineParser.h
ctkCoreSettings.cpp
ctkCoreSettings.h
ctkCoreTestingUtilities.cpp
ctkCoreTestingUtilities.tpp
ctkCoreTestingUtilities.h
ctkDependencyGraph.cpp
ctkDependencyGraph.h
ctkErrorLogAbstractMessageHandler.cpp
ctkErrorLogAbstractMessageHandler.h
ctkErrorLogAbstractModel.cpp
ctkErrorLogAbstractModel.h
ctkErrorLogContext.h
ctkErrorLogFDMessageHandler.cpp
ctkErrorLogFDMessageHandler.h
ctkErrorLogFDMessageHandler_p.h
ctkErrorLogLevel.cpp
ctkErrorLogLevel.h
ctkErrorLogQtMessageHandler.cpp
ctkErrorLogQtMessageHandler.h
ctkErrorLogStreamMessageHandler.cpp
ctkErrorLogStreamMessageHandler.h
ctkErrorLogTerminalOutput.cpp
ctkErrorLogTerminalOutput.h
ctkException.cpp
ctkException.h
ctkFileLogger.cpp
ctkFileLogger.h
ctkHighPrecisionTimer.cpp
ctkLinearValueProxy.cpp
ctkLinearValueProxy.h
ctkLogger.cpp
ctkLogger.h
ctkModelTester.cpp
ctkModelTester.h
ctkPimpl.h
ctkScopedCurrentDir.cpp
ctkScopedCurrentDir.h
ctkSingleton.h
ctkUtils.cpp
ctkUtils.h
ctkValueProxy.cpp
ctkValueProxy.h
ctkWorkflow.h
ctkWorkflow.cpp
ctkWorkflow_p.h
ctkWorkflowStep.h
ctkWorkflowStep.cpp
ctkWorkflowStep_p.h
ctkWorkflowTransitions.h
ctkSetName.cpp
ctkSetName.h
)
if(HAVE_BFD)
list(APPEND KIT_SRCS
ctkBinaryFileDescriptor.cpp
ctkBinaryFileDescriptor.h
)
endif()
# Headers that should run through moc
set(KIT_MOC_SRCS
ctkBooleanMapper.h
ctkCallback.h
ctkCommandLineParser.h
ctkCoreSettings.h
ctkErrorLogAbstractMessageHandler.h
ctkErrorLogAbstractModel.h
ctkErrorLogFDMessageHandler_p.h
ctkErrorLogLevel.h
ctkErrorLogQtMessageHandler.h
ctkErrorLogTerminalOutput.h
ctkFileLogger.h
ctkLinearValueProxy.h
ctkLogger.h
ctkModelTester.h
ctkErrorLogQtMessageHandler.h
ctkValueProxy.h
ctkWorkflow.h
ctkWorkflow_p.h
ctkWorkflowStep_p.h
ctkWorkflowTransitions.h
)
# UI files
set(KIT_UI_FORMS
)
# Resources
set(KIT_resources
)
# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
# The following macro will read the target libraries from the file 'target_libraries.cmake'
set(KIT_target_libraries)
ctkFunctionGetTargetLibraries(KIT_target_libraries)
if(CTK_QT_VERSION VERSION_GREATER "4")
list(APPEND KIT_target_libraries Qt5::Core)
endif()
ctkMacroBuildLib(
NAME ${PROJECT_NAME}
EXPORT_DIRECTIVE ${KIT_export_directive}
SRCS ${KIT_SRCS}
MOC_SRCS ${KIT_MOC_SRCS}
UI_FORMS ${KIT_UI_FORMS}
TARGET_LIBRARIES ${KIT_target_libraries}
RESOURCES ${KIT_resources}
LIBRARY_TYPE ${CTK_LIBRARY_MODE}
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include}
)
# Needed for ctkBackTrace
if(UNIX)
# FreeBSD: The same functionality that is in linux's libdl is provided in FreeBSD's libc
find_library(HAVE_LIBDL dl)
if(HAVE_LIBDL)
target_link_libraries(${PROJECT_NAME} dl)
endif()
elseif(WIN32 AND NOT MINGW)
target_link_libraries(${PROJECT_NAME} dbghelp)
endif()
if(CTK_WRAP_PYTHONQT_LIGHT)
ctkMacroBuildLibWrapper(
TARGET ${PROJECT_NAME}
SRCS ${KIT_SRCS}
WRAPPER_LIBRARY_TYPE ${CTK_LIBRARY_MODE}
)
endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
# Compile source code snippets
add_subdirectory(Documentation/Snippets)
endif()