I am trying to build two libraries (say A and B) from one project. I use add_subdirectorycmake in the root cmake file. B depends on A.
add_subdirectory
When i try to add
INSTALL (TARGETS B EXPORT B PUBLIC_HEADER DESTINATION "include/B" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib") INSTALL (EXPORT B DESTINATION "./")
CMake warns me of an error according to INSTALL (EXPORT...He prints:
INSTALL (EXPORT...
CMake Error: INSTALL (EXPORT "B" ...) includes target "B", which requires target "A", which is not in the export set.
, , . - . CMakeLists.txt,
install( TARGETS A B ... )
, , , CMakeLists.txt ( add_subdirectory). , "MyInstall".
...
install( TARGETS A EXPORT MyInstall ... )
B, "MyInstall" CMakeLists.txt :
install( EXPORT MyInstall ... )