Importing and Exporting Guide — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpHere we use the export() command to generate the export targets for the build tree. In this case, we'll create a file called MathFunctionsTargets.cmake in the cmake subdirectory of the build directory. The generated file contains the required code to import the target and may be loaded by an outside project that is aware of the project build tree.
export — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpSee the install (EXPORT) command to export targets from an install tree. The options are: NAMESPACE <namespace>. Prepend the <namespace> string to all target names written to the file. APPEND. Append to the file instead of overwriting it. This can be used to incrementally export multiple targets to the same file. EXPORT_LINK_INTERFACE_LIBRARIES.