importing header files using target_link_library

asked 2018-09-18 16:42:02 -0500

debonair gravatar image

I have one package and cmakeList.txt inside that package makes add_library(X y.cpp z.cpp). y.cpp is including A.h. I have another package B in which source files are using A.h from first package. Now one way to use these header files is do catkin_make() install() and add package dependency. But if I dont want to include package dependency and instead target_link_library() to import header files from X. can i just do add_dependency(curret_target X) without adding any package dependency? Do i still need catkin_make() and install() in first package?

edit retag flag offensive close merge delete

Comments

target_link_libraries(..) links libraries, it doesn't do anything with headers.

Can you clarify what is your actual question?

gvdhoorn gravatar image gvdhoorn  ( 2018-09-19 01:31:25 -0500 )edit