cmake - Install EXPORT requires target from subproject -
i'm trying write cmake script installing project i'm working on. part of necessary install(export lib_exports ...)
lib_exports
i've been using export property in various install(targets ...)
.
i have superbuild structure uses add_subdirectory
build projects (sdl2, civetweb) project depends on.
my problem when use target_link_libraries
add link subproject (sdl2-static sdl2, c-library civetweb) cmake complains these dependencies aren't in export set.
cmake error: install(export "lib_exports" ...) includes target "sc2api" requires target "c-library" not in export set. cmake error: install(export "lib_exports" ...) includes target "sc2renderer" requires target "sdl2-static" not in export set.
the way know add targets export set using install(targets ... export lib_exports)
can't install target subdirectory hasn't created. install(files ... export lib_exports)
if find sure library file's been generated have feeling install twice (once cmakelists.txt in project subdirectory, once here). frankly, i'm not sure why including these necessary, since libraries should statically linked targets in project.
my questions:
- how should include these external targets in export set?
- if shouldn't, correct way install export set?
- bonus question: these subprojects automatically add install targets project's install target. necessary? if isn't, how disable this?
Comments
Post a Comment