I am new to CMake and just want to understand some details about how target_link_libraries works.
To include a library, let's say boost. We can simply do include_directories(BOOST_LIBRARY_PATH). This allows my project to compile correctly and no errors report.
But after reading some posts online, I notice that people usually add target_link_libraries(executable boost_library) after include directories, so I just wonder why this line is needed.
Since my project is quite sensitive in terms of performance (i.e., I want it to run as fast as possible) my questions are as follows:
(1) What target_link_libraries actually do? (2) If we don't add this line, does it hurt performance? (3) What are the advantages of including target_link_libraries?