LINK_DIRECTORIES ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

LINK_DIRECTORIES ?

mort.motes
I get the point of INCLUDE_DIRECTORIES (the various files used must be located). But what is the point of LINK_DIRECTORIES and TARGET_LINK_LIBRARIES? In a CMakeLists.txt file I have:



..
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Components/Optimizers/StandardGradientDescent)
...
...
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
...
...
TARGET_LINK_LIBRARIES(test ITKCommon ITKAlgorithms ITKBasicFilters ITKNumerics ITKIO ITKBasicFilters StandardGradientDescent elxCommon elxCore)




In the first line source files are located in the dir: (${ELASTIX_SRC}/Components/Optimizers/StandardGradientDescent). But the same dir is also used as a link library. In the last line various macros are used in a target link library, but why is that necessary when the LINK_DIRECTORIES are defined?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: LINK_DIRECTORIES ?

James C. Sutherland

On Aug 5, 2009, at 1:33 AM, motes motes wrote:

> I get the point of INCLUDE_DIRECTORIES (the various files used must  
> be located). But what is the point of LINK_DIRECTORIES and  
> TARGET_LINK_LIBRARIES?
>

LINK_DIRECTORIES specifies the path to search for libraries whereas  
TARGET_LINK_LIBRARIES specifies what libraries should be linked to the  
executable.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: LINK_DIRECTORIES ?

Andreas Pakulat-2
On 05.08.09 07:52:32, James C. Sutherland wrote:

>
> On Aug 5, 2009, at 1:33 AM, motes motes wrote:
>
>> I get the point of INCLUDE_DIRECTORIES (the various files used must be
>> located). But what is the point of LINK_DIRECTORIES and  
>> TARGET_LINK_LIBRARIES?
>>
>
> LINK_DIRECTORIES specifies the path to search for libraries whereas  
> TARGET_LINK_LIBRARIES specifies what libraries should be linked to the  
> executable.

However LINK_DIRECTORIES is deprecated in favor of passing absolue paths of
library files to TARGET_LINK_LIBRARIES.

Andreas

--
You are magnetic in your bearing.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake