On 2016-07-27 18:49, Michael Legleux wrote:
> I have 2 projects (one built with cmake, one in the process of being
> converted to using it)
> 
> Project A (built with cmake) builds lib_a that Project B requires.
> I'm thinking I'm doing something wrong around here:
> project(lib_a)
> ....
> add_library(lib_a STATIC ${SRC})
>  target_link_libraries(${PROJECT_NAME}
>    PRIVATE lib_b
>    )
> export(TARGETS lib_a FILE lib_a.cmake)
> 
> cmake complains that lib_b is not in the target export set. I do not WANT
> it exported and it is not required by project b.
> I simply want lib_a to be found/used by Project B via find_package(Project
> A)
> 
> I do not want to have to install/ or create a package for this behavior,
> just allow another project to reference the libs in the build tree and
> headers in the source tree.
> 
> I can't seem to find the correct way to express this with cmake despite
> looking at many solutions of near similar functionality.

Did you ever solve this? Offhand, I would guess that lib_a is a static
library. If this is the case, using lib_a requires also linking to
lib_b, because the symbols in lib_a require lib_b, and lib_a is not
actually linked yet.

-- 
Matthew

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to