* cmake error at … library not found

Posted on December 30th, 2011 by Alex. Filed under Linux.


If you use cmake and have a library whose header files cannot be found, since you compiled your own library and put it somewhere where you can find it again, cmake will most likely abort with an error message like:

– Current HG revision is cf9be9344356
– Assuming this is a tarball (release) build for 2011.4.0
– Found wxWidgets: TRUE
– Found TIFF: /usr/include
– Found JPEG: /usr/include
– Found PNG: /usr/include
– WARNING: you are using the obsolete ‘PKGCONFIG’ macro use FindPkgConfig
– Found OPENEXR: /usr/lib/libImath.so;/usr/lib/libIlmImf.so;/usr/lib/libIex.so;/usr/lib/libHalf.so;/usr/lib/libIlmThread.so
– GLUT Found
– Found Glew:
CMake Error at CMakeModules/FindPANO13.cmake:76 (MESSAGE):
libpano13 version: 2.9.18 required, 2.9.14 found
Call Stack (most recent call first):
CMakeLists.txt:235 (FIND_PACKAGE)

(This comes from the compilation of hugin.) So how to tell cmake, where to find it? Open CMakeModules/FindPANO13.cmake in an editor of your choice. Somewhere at the beginning you can find an code snippet looking similar to this one:

FIND_PATH(PANO13_INCLUDE_DIR pano13/panorama.h
/usr/local/include
/usr/include
${SOURCE_BASE_DIR}/libpano13/include
${SOURCE_BASE_DIR}/libpano
${SOURCE_BASE_DIR}
)
FIND_LIBRARY(PANO13_LIBRARIES
NAMES pano13
PATHS ${SYSTEM_LIB_DIRS}
“${PANO13_INCLUDE_DIR}/pano13/Release LIB CMD”
“${PANO13_INCLUDE_DIR}/pano13/Release CMD/Win32″
${PANO13_INCLUDE_DIR}/pano13/Release
${SOURCE_BASE_DIR}/libpano13/lib
${SOURCE_BASE_DIR}/pano13
)

As you can see, a few standard directories are searched for the panorama.h file. If for whatever reason the library cannot be found, remember the name of the include path (here: PANO13_INCLUDE_DIR) and invoke cmake like in the following example:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DPANO13_INCLUDE_DIR=/path/to/your/library/

This should work.



Trackback URI | Comments RSS

Leave a Reply


RSS Feeds:

Search:


Pages:

Categories:

Archives: