[cmake-developers] [CMake 0014791]: Allow link directories to be set per target

Mantis Bug Tracker mantis at public.kitware.com
Thu Mar 6 10:21:30 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14791 
====================================================================== 
Reported By:                Philipp Möller
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14791
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-03-06 10:21 EST
Last Modified:              2014-03-06 10:21 EST
====================================================================== 
Summary:                    Allow link directories to be set per target
Description: 
Currently it is not possible to specify the directories in which libraries for
linking are to be searched on a per target basis. This is a standard flag in
most compilers.

Usually specifying the directory in which libraries are searched for is not
necessary as CMake convention is to use full paths for libraries. Unfortunately,
specifying the directory **only** (and not the actual libraries) is necessary to
get the Visual Studio auto-linking feature to work which is used by several C++
libraries (Boost, CGAL).

A common thing for VS users is to do:

find_package(Boost COMPONENTS system) # checks omitted
add_executable(main main.cpp) # executable using Boost.system
link_directories(${Boost_LIBRARY_DIRS}) # global sucks, enable this per target
# set includes and so on

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-03-06 10:21 Philipp Möller New Issue                                    
======================================================================



More information about the cmake-developers mailing list