[CMake] Lost include dir in subdirectory process

Philip Lowman philip at yhbt.com
Sun May 4 11:38:06 EDT 2008


On Sun, May 4, 2008 at 3:14 AM, Kertész Csaba <signfinnlista at gmail.com>
wrote:

> Hi all,
>
> I'm CMake newbie and I'm using the default CMake 2.4 patch 7 under
> Ubuntu Hardy. I have a project with autotools and I want to convert it
> to cmake. I don't know if I'm in wrong way, but I would like to detect
> the external libraries in the top level directory and use the detected
> include directories and libraries in src/ and other subdirectories if
> needs be.
>
> The PKGCONFIG module in CMake did not work me well in this situation,
> the results were quite wrong. Thus I decided to try the FIND_PACKAGE().
> I could find a FindGLIB.cmake for the glib detection on the net and the
> result is the following:
>
> The glib has two include directories. If I'm using the FIND_PACKAGE(GLIB
> REQUIRED) in the ./src directory, then everything is working fine,
> GLIB_INCLUDE_DIR comprises two directories. But if the FIND_PACKAGE is
> used in the top level directory, then the _second_ include directory is
> lost from GLIB_INCLUDE_DIR in the ./src directory (it is traced with
> message() ).
>
> Any idea?


Can you post the FindGLIB.cmake that you're using?

In general it shouldn't matter where you call FIND_PACKAGE() in your
directory structure.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080504/aefea683/attachment.htm>


More information about the CMake mailing list