[CMake] Problem with pkg_check_modules and imlib2

David Demelier demelier.david at gmail.com
Thu May 12 16:40:14 EDT 2011


Hello,

I have some trouble to link my project to the imlib2 library. The 
library is installed correctly and a command like :

gcc test.c -o test `pkg-config --libs --cflags imlib2`

works and link to imlib2.

I have this CMakeLists.txt http://markand.malikania.fr/CMakeLists.txt 
but it does not work, as you can see it detects fine the library dirs 
and include dirs :

markand at Melon ~/devel/wmfs/build $ cmake ..
-- INFO: XDG_CONFIG_DIR set /usr/local/etc/
-- INFO: imlib2 enabled
-- INFO: imlib2 under /usr/local/include;/usr/local/include/freetype2
-- INFO: imlib2 under /usr/local/lib
-- INFO: imlib2 under Imlib2

But it does not link :

markand at Melon ~/devel/wmfs/build $ make
Linking C executable wmfs
/usr/bin/ld: cannot find -lImlib2

What am I doing wrong? Also the CMakeCache is set with the good parameters :

[...]
IMLIB2_INCLUDEDIR:INTERNAL=/usr/local/include
IMLIB2_INCLUDE_DIRS:INTERNAL=/usr/local/include;/usr/local/include/freetype2
IMLIB2_LIBRARIES:INTERNAL=Imlib2
IMLIB2_LIBRARY_DIRS:INTERNAL=/usr/local/lib
IMLIB2_LDFLAGS:INTERNAL=-L/usr/local/lib;-lImlib2
[...]

Cheers,
-- 
David Demelier


More information about the CMake mailing list