On Sep 11, 2007, at 3:03 AM, Jesper Eskilson wrote:

A related question: if I include an external project in my solution
using

include_external_msproject(Bar ../../Bar/Bar.vcproj)

can I later refer to this project using

target_link_libraries(Foo Bar)

More generally, what is the correct way to specify that a CMake
target should be linked with some external library?

It is this last question I would like to get an answer to.


Say you have another project that produces a library called libBar.dll and that library is located in C:\Libs then you can refer to that library in CMake directly. In other words, the cmake code you have is absolutely correct:

Target_link_Libraries(Foo Bar)

with the following caveat: libBar.dll MUST be in a known directory that the linker will look in. You can make sure of this by adding the following cmake code above the "target_link_libraries" code:

 LINK_DIRECTORIES ("C:\Libs")


 ---- Here is the documentation for the command ---------
[EMAIL PROTECTED]:mjackson]$ cmake --help LINK_DIRECTORIES
  LINK_DIRECTORIES
       Specify directories in which to search for libraries.

         LINK_DIRECTORIES(directory1 directory2 ...)

Specify the paths in which the linker should search for libraries.

Hope that helps.
--
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to