Try:<div><span class="Apple-style-span" style="border-collapse: collapse; ">set_target_properties(qlom<br> PROPERTIES<br> LINK_FLAGS ${GLOM_LDFLAGS})</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">(without the double quotes).....</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span><br><div class="gmail_quote">
On Mon, Oct 26, 2009 at 2:46 PM, Murray Cumming <span dir="ltr"><<a href="mailto:murrayc@murrayc.com">murrayc@murrayc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 2009-10-23 at 13:42 +0200, Murray Cumming wrote:<br>
> pkg_search_module() defines SOMEPREFIX_LIBRARY_DIRS among other things,<br>
> as mentioned here<br>
> <a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindPkgConfig.cmake?root=CMake&view=markup" target="_blank">http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindPkgConfig.cmake?root=CMake&view=markup</a><br>
> (better than the documentation at<br>
> <a href="http://www.itk.org/Wiki/CMake:How_To_Find_Libraries" target="_blank">http://www.itk.org/Wiki/CMake:How_To_Find_Libraries</a><br>
> )<br>
><br>
> But how can I use those directories so my executable can actually be<br>
> linked against the SOMEPREFIX_LIBRARIES libraries that I've specified to<br>
> target_link_libraries().<br>
<br>
</div>I'm still stuck at this stage. I've tried doing this:<br>
<br>
set_target_properties(qlom<br>
PROPERTIES<br>
LINK_FLAGS "${GLOM_LDFLAGS}")<br>
<br>
But the linker flags then seem to be separated by ";" instead of spaces,<br>
leading to error such as this:<br>
<br>
c++: unrecognized option<br>
'-pthread;-L/opt/gnome228/lib;-lglom-1.12;-lgiomm-2.4;-lgdamm-4.0;-lxml<br>
++-2.6;-lgio-2.0;-lgmodule-2.0;-lgda-4.0;-lgthread-2.0;-lrt;-lxml2;-lglibmm-2.4;-lgobject-2.0;-lsigc-2.0;-lglib-2.0'<br>
<br>
Surely there must be a simple way to use pkg-config?<br>
<br>
<br>
My full CMakeList.txt so far is here, in case it's helpful:<br>
c++: unrecognized option<br>
'-pthread;-L/opt/gnome228/lib;-lglom-1.12;-lgiomm-2.4;-lgdamm-4.0;-lxml<br>
++-2.6;-lgio-2.0;-lgmodule-2.0;-lgda-4.0;-lgthread-2.0;-lrt;-lxml2;-lglibmm-2.4;-lgobject-2.0;-lsigc-2.0;-lglib-2.0'<br>
make[2]: Leaving directory `/home/murrayc/checkout/gnome/qlom_murrayc'<br>
<div><div></div><div class="h5"><br>
<br>
> Actually, I would much rather just tell the build system to use<br>
> SOMEPREFIX_LDFLAGS instead of dealing with the directories and libraries<br>
> separately. That's what I do with autoconf/automake.<br>
><br>
><br>
> Also, if I use several libraries, do I need separate pkg_search_module()<br>
> calls, and therefore several sets of variables? I'd much rather just<br>
> give a list of libraries and get one set of CFLAGS and LDFLAGS. Again,<br>
> that's what I do with autoconf/automake.<br>
<br>
--<br>
<a href="mailto:murrayc@murrayc.com">murrayc@murrayc.com</a><br>
<a href="http://www.murrayc.com" target="_blank">www.murrayc.com</a><br>
<a href="http://www.openismus.com" target="_blank">www.openismus.com</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>