1 # Macros and other CMake code part of the Catalyst SDK i.e. 2 # API used to build Catalyst API implementations. 5 Mark a
target as the Catalyst API implementation.
10 [LIBRARY_DESTINATION <destination>]
11 [INSTALL_EXPORT_DEFAULT]
15 The `TARGET` identifies the
target added
using an `add_library` call.
16 This
function ensures that properties
on the
target are
set up
17 appropriately so that the generated library is ABI compatible
18 with the Catalyst stub implementation.
20 `LIBRARY_DESTINATION`
if specified, is used to determine the install destination.
21 If not specified, no install rule is added.
23 `INSTALL_EXPORT_DEFAULT` is useful in projects that include Catalyst as a
24 sub-project (instead of
using it externally) to build Catalyst implementations.
25 For such projects, the Catalyst library is often built as a part of the project.
26 Providing INSTALL_EXPORT_DEFAULT ensures that the Catalyst implementation is
27 added as a part of the export
set for the Catalyst targets so that
28 `find_package(catalyst ... )` can work seamlessly.
29 If `LIBRARY_DESTINATION` must be specified
if `INSTALL_EXPORT_DEFAULT`
35 cmake_parse_arguments(PARSE_ARGV 0 arg
"INSTALL_EXPORT_DEFAULT" "TARGET;LIBRARY_DESTINATION" "")
36 if (arg_UNPARSED_ARGUMENT)
38 "Unknown argument(s) passed to 'catalyst_library': '${arg_UNPARSED_ARGUMENT}'")
40 if (arg_INSTALL_EXPORT_DEFAULT AND NOT (arg_TARGET STREQUAL "catalyst"))
42 "Target not named 'catalyst'. find_package(catalyst .. ) may not work as "
45 if (arg_INSTALL_EXPORT_DEFAULT AND NOT DEFINED arg_LIBRARY_DESTINATION)
47 "'INSTALL_EXPORT_DEFAULT' specified without 'LIBRARY_DESTINATION'."
48 "Argument has no effect.")
51 target_link_libraries(${arg_TARGET}
54 catalyst::conduit_headers
58 set_target_properties(${arg_TARGET}
60 VERSION "${CATALYST_ABI_VERSION}" 61 SOVERSION
"${CATALYST_ABI_VERSION}" 62 OUTPUT_NAME
"catalyst")
65 if (arg_INSTALL_EXPORT_DEFAULT)
66 set (_exports
EXPORT Catalyst)
68 if (arg_LIBRARY_DESTINATION)
72 RUNTIME DESTINATION ${arg_LIBRARY_DESTINATION}
73 LIBRARY DESTINATION ${arg_LIBRARY_DESTINATION})
77 #------------------------------------------------------------- 79 #------------------------------------------------------------- 81 if (NOT DEFINED
"${variable}")
82 set(
"${variable}" ${ARGN})
91 DESTINATION
"${CATALYST_INSTALL_ARCHIVE_DIR}" 93 DESTINATION
"${CATALYST_INSTALL_LIBRARY_DIR}" 95 DESTINATION
"${CATALYST_INSTALL_RUNTIME_DIR}")
96 foreach (arg IN LISTS ARGN)
100 # all
static libraries are mangled
using `catalyst_` prefix.
101 # we don
't mangle shared libs since this project only builds the 102 # `catalyst` library as shared. 103 if (type STREQUAL STATIC_LIBRARY) 104 set_property(TARGET ${arg} 105 PROPERTY OUTPUT_NAME ${arg}${CATALYST_CUSTOM_LIBRARY_SUFFIX}) 110 function(c_install_headers) 111 cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "SUBDIR" "HEADERS") 112 if (arg_UNPARSED_ARGUMENTS) 118 DESTINATION "${CATALYST_INSTALL_INCLUDE_DIR}/${arg_SUBDIR}") boost::graph_traits< vtkGraph *>::vertex_descriptor target(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
function catalyst_library()
Mark a target as the Catalyst API implementation.
macro c_set_if_not_set(variable)
function c_install_targets()
function c_install_headers()