KDE/kdevelop [POSSIBLY UNSAFE]
Andreas Pakulat
apaku at gmx.de
Wed Apr 25 15:29:13 UTC 2007
On 25.04.07 16:01:56, David Nolden wrote:
> On Wednesday 25 April 2007 11:41:44 Andreas Pakulat wrote:
> > I already commented there, we need to find out how to fix that, because
> > the headers might not always be in /usr/include.
> >
> > Andreas
>
> Yep we'll have to look at it. Btw. why did you not use pkgconfig for finding
> the libraries and include-files? I used that in a simpler way before to get
> the include-path, and it worked.
i didn't. That was Laurent Montell. One problem with pkg-config is that
its not available under windows.
> The code was:
> include(UsePkgConfig)
> pkgconfig(libccgnu2 ccgnu2_includes ccgnu2_linkdir ccgnu2_linkflags
> ccgnu2_cflags)
>
> I don't know those FIND_PATH and FIND_PACKAGE cmake-functions, so I don't know
> how conveniently they work for the task.
Thats the "normal" way a CMake macro to find a library is written. How
the macro finds includes, linkflags and libraries as well as defines
doesn't matter, the important thing is that the XXX_LIBRARY_DIRS,
XXX_INCLUDE_DIRS, XXX_LIBRARIES, XXX_DEFINES and XXX_FOUND are defined
variables after executing the macro. The reason is simply that this is
somewhat standard for CMake macros.
FIND_PACKAGE(Foo) just executes the code in FindFoo.cmake in CMake's
Module dir. And you can add REQUIRE then if the lib is not found cmake
stops at that point.
Andreas
--
Domestic happiness and faithful friends.
More information about the KDevelop-devel
mailing list