<div dir="ltr"><div>Vadtec,</div><div><br></div><div>> My main problem is getting cmake to use only my locally installed/compiled copies of the libs. I need those libs to live along side the binaries, and using the versions I compile is important.</div><div><br></div><div>I'll answer the question of finding the libraries and not the building problem. We (in my company) are facing similar problems. This is the workflow which has been working for us:</div><div><br></div><div>1. we make sure that all 3rdparty dependencies can be built with CMake and install a config-module</div><div><br></div><div>Note that the "can be built with CMake" needs to be interpreted loosely:</div><div><br></div><div>- some 3rdparty libs already provide CMake builds which can be used as is. In case of anything is missing (config-module) we fork and modify</div><div>- when a 3rdparty lib uses autotools we rewrite its build system in CMake for windows compatibility</div><div>- in case the lib's build system is too complex we just wrap it in a CMake build which launches autotools and also installs a config-module</div><div>- when only the binaries of the 3rdparty lib are available we create a CMakeLists for the lib which detects the platform, installs the required binaries and config-modules</div><div><br></div><div>In any case we end up having a project that can be built with cmake command lines and installs a proper config-module.</div><div><br></div><div>2. For these 3rdparty libs we don't use the find-modules distributed with CMake. We Set the CMAKE_PREFIX_PATH to the install prefix where we installed our 3rdparty deps to make sure only those will be found by our own projects.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 31, 2016 at 9:40 AM, Cristian Adam <span dir="ltr"><<a href="mailto:cristian.adam@gmail.com" target="_blank">cristian.adam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <div>On 31-Jan-16 03:42, vadtec wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif"><br>
        <div>curl, libiconv, libpng, libssh2, and zlib are the libs I
          want to build and use both on Linux and Windows. I know all of
          those are available on Linux and I could use the system
          installed versions, but I want to use the same vesions on
          Windows as well. The server is only built on Linux, while the
          client needs to be built for Linux and Windows. All the libs,
          headers, etc go into the build directory, and the final "make
          install" puts everything into the bundle directory, so it can
          be packaged for distribution.</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    <br></span>
    Have a look at <a href="https://github.com/ruslo/hunter/" target="_blank">hunter</a>
    – Cross-platform package manager for C++ (based on CMake
    ExternalProject).<br>
    <br>
    Hunter has CMake versions for:<br>
    <ul>
      <li><a href="https://github.com/ruslo/hunter/wiki/pkg.png" target="_blank">libpng</a></li>
      <li><a href="https://github.com/ruslo/hunter/wiki/pkg.libssh2" target="_blank">libssh2</a></li>
      <li><a href="https://github.com/ruslo/hunter/wiki/pkg.zlib" target="_blank">zlib</a></li>
    </ul>
    <p><a href="https://github.com/bagder/curl" target="_blank">Curl</a> has CMake
      support by itself. The only library missing is libiconv. It seems
      that <br>
      LuaDist project has added  a CMake build <a href="https://github.com/LuaDist/libiconv" target="_blank">here</a>.<br>
    </p>
    <p>You could either take all the libraries and include in your
      project or open hunter <a href="https://github.com/ruslo/hunter/issues" target="_blank">tickets.</a><br>
    </p>
    <p>Cheers,<br>
      Cristian.<br>
    </p>
  </div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>