<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All,<br>
Can I use FIND_LIBRARY to find multiple libraries? This is what I
want to do.<br>
<blockquote type="cite">FIND_LIBRARY(VTK_LIBRARIES_DEBUG <br>
NAMES vtkCommon vtkIO vtkFiltering vtkGraphics vtkViews
vtkRendering<br>
PATHS ${VTK_LIBRARY_DIRS_DEBUG}<br>
HINTS ${VTK_LIBRARY_DIRS_DEBUG}<br>
REQUIRED<br>
) <br>
</blockquote>
CMake only find the first match - vtkCommon.lib.<br>
This page<a
href="http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries">
http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries</a> shows
that you can handle multiple libraries with a single FIND_LIBRARY
call.<br>
<blockquote type="cite"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family: sans-serif;
font-size: 13px; line-height: 19px;">
<pre style="padding: 1em; border: 1px dashed rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em;"># - Try to find LibXml2
# Once done this will define
# LIBXML2_FOUND - System has LibXml2
# LIBXML2_INCLUDE_DIRS - The LibXml2 include directories
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
find_package(PkgConfig)
pkg_check_modules(PC_LIBXML QUIET libxml-2.0)
set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
find_path(LIBXML2_INCLUDE_DIR libxml/xpath.h
HINTS ${PC_LIBXML_INCLUDEDIR} ${PC_LIBXML_INCLUDE_DIRS}
PATH_SUFFIXES libxml2 )
find_library(LIBXML2_LIBRARY NAMES xml2 libxml2
HINTS ${PC_LIBXML_LIBDIR} ${PC_LIBXML_LIBRARY_DIRS} )
set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} )
set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY )
</pre>
</span></span><br class="Apple-interchange-newline">
</blockquote>
However, this thread tells me otherwise. <a
href="http://www.mail-archive.com/cmake@cmake.org/msg21545.html">http://www.mail-archive.com/cmake@cmake.org/msg21545.html</a><br>
<blockquote type="cite"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family: monospace;">
<pre>AFAIK, no. The usual way to do this is simply using find_library(
TBB_LIBRARY tbb ) and additionally find_library( TBBMALLOC_LIBRARY
tbbmalloc) and then produce the _LIBRARIES variable by putting the two
together.</pre>
</span></span></blockquote>
Would you please clarify? Thanks a lot.<br>
x<br>
<br>
<br>
</body>
</html>