On Sat, Aug 18, 2012 at 3:28 AM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de" target="_blank">apaku@gmx.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<div class="im"><br>
On Sat, Aug 18, 2012 at 12:16 AM, Edgar<br>
<<a href="mailto:edgarreynaldo@members.allegro.cc">edgarreynaldo@members.allegro.cc</a>> wrote:<br>
> I've already looked at the cmake tutorial, and it isn't that great. It<br>
> starts really simple but then goes into really complex things that most<br>
> people might not even use.<br>
><br>
> Also, there is currently no such thing as 'The Openlayer community' - the<br>
> project is unsupported, and no longer in active development due to inactive<br>
> development for Allegro 4. So if there is anyone who can help it is this<br>
> cmake mailing list, and that's all.<br>
><br>
> I am trying to get Openlayer 2pt1 to build with MinGW 4.5 and up, which it<br>
> currently doesn't do. I've been able to fix compilation errors, but not<br>
> build errors related to cmake.<br>
><br>
> I have these problems -<br>
> 1) Cmake cannot find ZLIB<br>
> 2) Cmake cannot find LIBPNG<br>
> 3) There are undefined reference errors during the linking process for the<br>
> OpenLayer demos, and I don't know how to properly link the necessary<br>
> libraries using cmake.<br>
><br>
> There are some .cmake files named FindALLEGRO, and FindFREETYPE, and those<br>
> work properly. Do I need to create similar cmake files for zlib and libpng?<br>
><br>
> How does cmake find required libraries and link to them?<br>
<br>
</div>find_library is used to find libraries, find_file or find_path to find<br>
the include directories. Usually those are bundled into a find-module<br>
called Find<LibName>.cmake similar to your FindALLEGRO.cmake file.<br>
<br>
You can configure where the functions search for libs when calling<br>
them and also via some special cmake-variables (cmake --help-command<br>
find_library gives you more information on that). The find-modules are<br>
usually set up in a way that they search the default-installation path<br>
of the library on the respective platforms. If users install the lib<br>
elsewhere they are required to set the cmake-variables when<br>
configuring the project.<br>
<span class="HOEnZb"><font color="#888888"><br>
Andreas<br>
</font></span><div class="HOEnZb"><div class="h5">--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><div><br></div><div>CMake already has built-in find modules for PNG and ZLIB.</div><div><br></div><div>You should be able to do:</div><div>find_package(PNG)</div><div><br></div><div>The FindPNG module internally does a find_package(ZLIB) so you don't have to do that if you're calling find_package(PNG).</div>
<div><br></div><div>That said, I don't know if these modules work as intended under a mingw system, or if you have to have your own mingw-based installs of png and zlib to get them to work. Or you might have to set some variables if the automatic "find" doesn't just find them where they are.</div>
<div><br></div><div>Hopefully somebody more intimately involved with regularly building under mingw, and also using PNG, will chime in here...</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div>