MantisBT - CMake
View Issue Details
0015706CMakeCMakepublic2015-08-21 21:452016-06-10 14:31
ovz 
Kitware Robot 
normalmajoralways
closedmoved 
Linux
CMake 3.2.3 
 
0015706: link_directories ignores <some path>/lib
If I put the following line into CMakeLists.txt Unix Makefile generator doesn't add flag -L<env_dir_content>/lib to linker flags.

link_directories("${env_dir}/lib")

If I change the call to

link_directories("${env_dir}")

I can see -L<env_dir_content> among linker flags.
No tags attached.
Issue History
2015-08-21 21:45ovzNew Issue
2015-08-22 01:22Rolf Eike BeerNote Added: 0039315
2016-06-10 14:29Kitware RobotNote Added: 0042825
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0039315)
Rolf Eike Beer   
2015-08-22 01:22   
Just guessing: is ${env_dir}/lib maybe in the systems default linker paths (e.g. ich ${env_dir}=/usr)?

Otherwise, don't use link_directories. Pass absolute paths to target_link_libraries(), CMake will handle the rest.
(0042825)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.