MantisBT - CMake
View Issue Details
0015623CMakeCMakepublic2015-06-18 09:042016-01-04 11:51
Eric Wing 
 
normalminoralways
closedno change required 
Raspberry PiRaspbian (Debian Linux)3.18.11
CMake 3.2.3 
 
0015623: Raspbian puts some system libraries in /usr/lib/arm-linux-gnueabihf which CMake doesn't search
Raspbian, which is a streamlined offshoot of Debian for Raspberry Pi, puts a lot of system libraries in /usr/lib/arm-linux-gnueabihf, which CMake doesn't search for by default.

Some popular libraries include libpng, libjpeg, libcurl, openal, sdl, avahi, freetype, and a lot more.

When trying to build on a Raspberry Pi (not cross-compiling), CMake couldn't find and link a lot of common libraries.

Since Raspbian is essentially just another Linux distro and probably shouldn't be an entirely different platform,
the easiest fix seems to be to add
/usr/lib/arm-linux-gnueabihf
to
CMAKE_SYSTEM_LIBRARY_PATH
CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
in Modules/Platform/UnixPaths.cmake
I think I originally triggered this by trying to FIND_PACKAGE(OpenAL) on Raspbian.

No tags attached.
Issue History
2015-06-18 09:04Eric WingNew Issue
2015-06-18 09:25Brad KingNote Added: 0038947
2015-06-18 22:35Eric WingNote Added: 0038953
2015-06-19 08:31Brad KingStatusnew => resolved
2015-06-19 08:31Brad KingResolutionopen => no change required
2016-01-04 11:51Robert MaynardNote Added: 0040073
2016-01-04 11:51Robert MaynardStatusresolved => closed

Notes
(0038947)
Brad King   
2015-06-18 09:25   
This looks like a variant of the Debian multi-arch directory layout. CMake already knows how to search <prefix>/lib/<arch> if it can detect the <arch> part. CMake looks for such directories among the implicit linker search directories detected from the compiler.

Look for settings and use of CMAKE_LIBRARY_ARCHITECTURE_REGEX in the Modules directory. It could probably be updated to detect this architecture too.
(0038953)
Eric Wing   
2015-06-18 22:35   
You know, I think you can close this bug.

I checked CMake's CMAKE_LIBRARY_ARCHITECTURE_REGEX, and it is already correct.

Something strange happened since yesterday and my Pi just started working correctly. My current theory is that rebooting magically made things start working. (I was on a brand new, fresh install yesterday and had not even rebooted yet.)

Sorry for the noise.
(0040073)
Robert Maynard   
2016-01-04 11:51   
Closing resolved issues that have not been updated in more than 4 months.