'Getting away with only writing target_link_libraries(not specify include path) in CMakeLIsts.txt

I found that when I use target_link_libraries in CMaksList.txt , I get to ignore the include path(target_include_directories) and run the application successfully for example :

cmake_minimum_required(VERSION 3.5)
project(hello)

find_package(OpenCV REQUIRED)
add_executable(test test.cpp) #or add_library(test SHARED test.cpp)

target_link_libraries(  yolo
                        ${OpenCV_LIBS})

And it turns out that everything works correctly and I am able to run application without any problem. Here${OpenCV_LIBS} and ${InferenceEngine_LIBRARIES} is just.so file locate in somewhere in the system.

I would like to know why this is working ? In the other word, What kind of information does .so file contain ? Does it contains include path ? How does this work behind the scene ? Thanks !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source