[CMake] INCLUDE_DIRECTORIES oddity

Salvatore Iovene salvatore at iovene.com
Sat Mar 24 06:42:37 EST 2007


Hello,
I'm experiencing an odd behaviour of the INCLUDE_DIRECTORY command.
Here's the relevant code:

INCLUDE(UsePkgConfig)
FOREACH(library sdl libpng freetype2)
  PKGCONFIG(${library} INC LIB LD C)
  IF(C)
    INCLUDE_DIRECTORIES(${C})
    TARGET_LINK_LIBRARIES(wowtris ${LD})
  ELSE(C)
    MESSAGE(FATAL_ERROR "${library} is missing.")
  ENDIF(C)
ENDFOREACH(library)

Here's what happens when I make:

/usr/bin/c++   -I/home/siovene/projects/wowtris
-I/home/siovene/projects/wowtris/-D_GNU_SOURCE=1\ -D_REENTRANT\
-I/usr/include/SDL
-I/home/siovene/projects/wowtris/
-I/home/siovene/projects/wowtris/-I/usr/include/freetype2
-I/usr/include/GL   -o CMakeFiles/wowtris.dir/src/Application.o
-c /home/siovene/projects/wowtris/src/Application.cpp

Notice how things like -I/usr/include/libpng12 get _prefixed_ by
-I/home/siovene/projects/wowtris/, so that the final include path will
be wrong.

Am I doing something obviously wrong?

My cmake version is 2.4-patch 5.

Thank you.

-- 
Salvatore Iovene
http://www.iovene.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070324/07c87246/signature.pgp


More information about the CMake mailing list