[cmake-developers] Trouble with FindPNG module

Robert Dailey rcdailey.lists at gmail.com
Tue Apr 25 10:25:34 EDT 2017


To give you some context, this is an Ubuntu 14 installation for
hosting our Atlassian Bamboo build server. We use it to build a 32-bit
application. The OS itself is 64-bit, but our app does not compile 64
bit (code is too crappy). So I had to make sure to be careful that I'm
using the correct toolchain (gcc 4.9) and 32-bit libs. CMake uses
find_package() for most libraries, and those libs must be the 32-bit
versions.

What instructions would you suggest for setting up the VM like you
mentioned? It needs to be something I can "initialize" from within
Bamboo. Basically as part of the build process, before doing anything,
I need to be able to tell bamboo to use a specific environment (in
this case specific VM). I'm not incredibly familiar with Linux, so
hopefully there is a recommended path here.

Thanks.

On Mon, Apr 24, 2017 at 1:17 PM, Roger Leigh <rleigh at codelibre.net> wrote:
> On 24/04/2017 15:54, Robert Dailey wrote:
>>
>> Sorry to bump; any info on this? I'm completely blocked :-(
>>
>> On Fri, Apr 21, 2017 at 4:48 PM, Robert Dailey <rcdailey.lists at gmail.com>
>> wrote:
>>>
>>> I'm running CMake 3.8.0 on Ubuntu 14. I invoke the following:
>>>
>>> find_package(PNG REQUIRED)
>>>
>>> Which gives me the output in CMake:
>>>
>>> Could NOT find PNG (missing: PNG_LIBRARY) (found version "1.2.50")
>>>
>>> The CMakeCache.txt file has these variables set:
>>>
>>> PNG_LIBRARY_DEBUG:FILEPATH=PNG_LIBRARY_DEBUG-NOTFOUND
>>> PNG_LIBRARY_RELEASE:FILEPATH=PNG_LIBRARY_RELEASE-NOTFOUND
>>> PNG_PNG_INCLUDE_DIR:PATH=/usr/include
>>>
>>> So it found the headers, but not the libs. Why did it not find the
>>> libs? Note that my version of Ubuntu is 64-bit, and I've installed the
>>> 32-bit libs like so:
>>>
>>> $ sudo apt-get install libpng12-dev:i386
>>>
>>> Would the find module be confused because it is trying to find the
>>> 64-bit library? What's the issue?
>
>
> Sounds like that's exactly the problem.  You can only have one libpng
> *development* package installed at once.  You probably want the regular
> "libpng-dev" package installed if you want to build against the standard
> libpng.
>
> What's your goal here?  Why did you install a single i386 development
> package?
>
> If you want to build i386 binaries, it's usually simpler to build in a
> virtual machine, i.e. a chroot, container, full VM or whatever you like,
> where you have a fully 32-bit environment.  The multiarch library support is
> primarily intended for *deploying and running* 32-bit code rather than
> development.  While you can use it for development, it gets painful due to
> the conflicts with the headers and other bits in the native development
> packages.
>
>
> Regards,
> Roger
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers


More information about the cmake-developers mailing list