<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I think your question make sense, I
      would be interested to know proposed solutions, as likely have
      similar problems.<br>
      <br>
      I' m far from being a cmake guru, but I like SuperBuild pattern as
      well .<br>
      I would do these steps:<br>
      <br>
      0) define where are on the different platform the sources of the
      SDL library&nbsp;&nbsp; you want&nbsp; ( is it
      <a class="moz-txt-link-freetext" href="http://www.libsdl.org/download-1.2.php">http://www.libsdl.org/download-1.2.php</a> ?) <br>
      &nbsp;&nbsp;&nbsp;&nbsp; also you should think&nbsp; if is likely to find it already
      installed and you want to let your users to use it<br>
      1) test the currently available FindSDL.cmake with latest cmake
      release with find_package(SDL) and see if it is working on all
      target&nbsp;&nbsp;&nbsp; platforms.<br>
      &nbsp; &nbsp; If it is not suitable, build one which fits your need.<br>
      2) build your simple project hello world by using
      find_package(SDL), eventually using your own FindSDL.cmake<br>
      3) build one hello_world_SDL_superbuild project which <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; find_package(SDL)<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(NOT SDL_FOUND)<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add_external_project(SDL<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..............<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..............<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add_external_project(HELLO_WORLD_SDL<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .................<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .................<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEPENDS SDL<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
      <br>
      If the SDL external project has an INSTALL_PREFIX path that is
      reported inside as CMAKE_PREFIX_PATH, the find should work in both
      situations<br>
      <br>
      when everything works fine, it is likely that your SDL external
      project as well as your Find_SDL.cmake could be of interest to
      others ;-)<br>
      <br>
      <br>
      <br>
      If the cmake gurus agree that this form of SuperBuild pattern is
      the right one, it could be good&nbsp; to develop it as an example, with
      proper FindSDL.cmake<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      On 04/02/2013 15.14, Ansis M&#257;li&#326;&#353; wrote:<br>
    </div>
    <blockquote
cite="mid:CAKFqKXNtOovbW+MwVRJ-eCkgb5q1xqJOfs3AjJvHU+GJWpPpnw@mail.gmail.com"
      type="cite">
      <div dir="ltr">It looks like I'm still asking the wrong questions.<br>
        <div><br>
        </div>
        <div style="">As a last resort, here's my specific problem: I
          want to compile and run a hello world SDL2 application on
          Windows, Linux, and OS X - purely as an exercise in CMake. How
          would YOU do this?</div>
        <div style=""><br>
        </div>
        <div style="">SDL2 only exists in source form in their
          repository.<br>
        </div>
        <div style=""><br>
        </div>
        <div style="">This is my main.cpp:</div>
        <div style="">
          <div><font face="courier new, monospace">#include
              &lt;SDL.h&gt;</font></div>
          <div><font face="courier new, monospace">int main(int argc,
              char** argv)</font></div>
          <div><font face="courier new, monospace">{</font></div>
          <div><font face="courier new, monospace"><span class=""
                style="white-space:pre"> </span>if
              (SDL_Init(SDL_INIT_VIDEO) &lt; 0) printf("FAILURE\n");</font></div>
          <div><font face="courier new, monospace"><span class=""
                style="white-space:pre"> </span>else
              printf("SUCCESS\n");</font></div>
          <div><font face="courier new, monospace"><span class=""
                style="white-space:pre"> </span>SDL_Quit();</font></div>
          <div><font face="courier new, monospace"><span class=""
                style="white-space:pre"> </span>return 0;</font></div>
          <div><font face="courier new, monospace">}</font></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--

Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Luigi Calori
SuperComputing Applications and Innovation Department 
CINECA - via Magnanelli, 6/3, 40033 Casalecchio di Reno (Bologna) - ITALY
Tel: +39 051 6171509  Fax: +39 051 6132198
hpc.cineca.it
</pre>
  </body>
</html>