forked from Slicer/SlicerExecutionModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlicerExecutionModelConfig.cmake.in
152 lines (132 loc) · 5.75 KB
/
SlicerExecutionModelConfig.cmake.in
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
#
# Typical usage could be something like:
# find_package(SlicerExecutionModel REQUIRED GenerateCLP)
# include(${SlicerExecutionModel_USE_FILE})
# generateclp(...)
##
# When using the components argument, SlicerExecutionModel_USE_* variables are
# automatically set for the SlicerExecutionModel_USE_FILE to pick up.
# If one wishes to manually set them, the available ones to set include:
# SlicerExecutionModel_USE_GENERATECLP
# SlicerExecutionModel_USE_MODULEDESCRIPTIONPARSER
# SlicerExecutionModel_USE_TCLAP
# SlicerExecutionModel_USE_SERIALIZER
# Check if components where passed to find_package()
if(SlicerExecutionModel_FIND_COMPONENTS)
foreach(component ${SlicerExecutionModel_FIND_COMPONENTS})
string(TOUPPER ${component} _COMPONENT)
set(SlicerExecutionModel_USE_${_COMPONENT} 1)
endforeach()
endif()
# If no components are passed, let's assume all components built by default are expected to be enabled.
if(NOT SlicerExecutionModel_FIND_COMPONENTS)
set(SlicerExecutionModel_USE_GENERATECLP 1)
set(SlicerExecutionModel_USE_MODULEDESCRIPTIONPARSER 1)
set(SlicerExecutionModel_USE_TCLAP 1)
endif()
# SlicerExecutionModel_USE_SERIALIZER is optional and it must be turned on at
# build time.
if(SlicerExecutionModel_USE_SERIALIZER AND NOT "@SlicerExecutionModel_USE_SERIALIZER@")
message(SEND_ERROR "The SERIALIZER COMPONENT for SlicerExecutionModel was requested,
but SlicerExecutionModel was not built with SlicerExecutionModel_USE_SERIALIZER ON.")
endif()
set(SlicerExecutionModel_USE_SERIALIZER "@SlicerExecutionModel_USE_SERIALIZER@")
if(SlicerExecutionModel_USE_SERIALIZER)
find_package(ParameterSerializer REQUIRED)
endif()
# Set SlicerExecutionModel variables
set(SlicerExecutionModel_INCLUDE_DIRS
"@SlicerExecutionModel_INCLUDE_DIRS_CONFIG@"
)
set(SlicerExecutionModel_LIBRARIES
@SlicerExecutionModel_LIBRARIES_CONFIG@
)
set(DEFAULT_SEM_TARGET_LIBRARIES
@DEFAULT_SEM_TARGET_LIBRARIES_CONFIG@
)
set(SlicerExecutionModel_USE_FILE
"@SlicerExecutionModel_USE_FILE_CONFIG@"
)
set(SlicerExecutionModel_CMAKE_DIR ${SlicerExecutionModel_DIR}/CMake)
# If not already defined, set default "output directories" used by SEMMacroBuildCLI.cmake
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY)
set(SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY
"@SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY_CONFIG@"
)
endif()
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY)
set(SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY
"@SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY_CONFIG@"
)
endif()
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY)
set(SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY
"@SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY_CONFIG@"
)
endif()
# If not already defined, set default "install destination" used by SEMMacroBuildCLI.cmake
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION)
set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION
"@SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION_CONFIG@"
)
endif()
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION)
set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION
"@SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION_CONFIG@"
)
endif()
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION)
set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION
"@SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION_CONFIG@"
)
endif()
# If not already defined, set rpath flags used by SEMMacroBuildCLI.cmake
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_EXECUTABLE_LINK_FLAGS)
set(SlicerExecutionModel_DEFAULT_CLI_EXECUTABLE_LINK_FLAGS
"@SlicerExecutionModel_DEFAULT_CLI_EXECUTABLE_LINK_FLAGS@"
)
endif()
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_LIBRARY_LINK_FLAGS)
set(SlicerExecutionModel_DEFAULT_CLI_LIBRARY_LINK_FLAGS
"@SlicerExecutionModel_DEFAULT_CLI_LIBRARY_LINK_FLAGS@"
)
endif()
# If not already defined, set default library wrapper used by SEMMacroBuildCLI.cmake
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_LIBRARY_WRAPPER_CXX)
set(SlicerExecutionModel_DEFAULT_CLI_LIBRARY_WRAPPER_CXX
"@SlicerExecutionModel_DEFAULT_CLI_LIBRARY_WRAPPER_CXX_CONFIG@"
)
endif()
# If not already defined, set default "cli targets folder prefix" used by SEMMacroBuildCLI.cmake
if(NOT DEFINED SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX)
set(SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX
"@SlicerExecutionModel_DEFAULT_CLI_TARGETS_FOLDER_PREFIX_CONFIG@"
)
endif()
# The SlicerExecutionModel targets file.
if(NOT TARGET GenerateCLP AND EXISTS "@SlicerExecutionModel_EXPORT_FILE@")
include("@SlicerExecutionModel_EXPORT_FILE@")
endif()
# Set *_DIR variable so that find_package() works appropriately
set(ModuleDescriptionParser_DIR ${SlicerExecutionModel_DIR}/ModuleDescriptionParser)
set(GenerateCLP_DIR ${SlicerExecutionModel_DIR}/GenerateCLP)
set(TCLAP_DIR ${SlicerExecutionModel_DIR}/tclap)
#
# Find ModuleDescriptionParser, GenerateCLP and TCLAP so that the associated
# variables (ModuleDescriptionParser_INCLUDE_DIRS, ...) are exposed.
#
if(SlicerExecutionModel_USE_MODULEDESCRIPTIONPARSER)
find_package(ModuleDescriptionParser REQUIRED)
endif()
if(SlicerExecutionModel_USE_GENERATECLP)
find_package(GenerateCLP REQUIRED)
endif()
if(SlicerExecutionModel_USE_TCLAP)
find_package(TCLAP REQUIRED)
endif()
set(SlicerExecutionModel_LIBRARY_DIRS
"@SlicerExecutionModel_LIBRARY_DIRS_CONFIG@"
${GenerateCLP_LIBRARY_DIRS}
${ModuleDescriptionParser_LIBRARY_DIRS}
${TCLAP_LIBRARY_DIRS}
)