<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <small>Hello,<br>
      <br>
      I would like to set up a "superbuild" for my project.<br>
      I would like it to be as clean/basic as possible.<br>
      <br>
      Let's say I want to build VTK as my "ExternalProject". How should
      I proceed to link it to my current project.<br>
      <br>
      My current project requires VTK to be built.<br>
      So FIND_PACKAGE cannot work. (vtk source code not there during the
      configuration step)<br>
      And I didn't get any success manually setting VTK_DIR,
      VTK_INCLUDE_DIRS, etc. at the end of my </small><small>External-VTK.cmake
      file. Is it the way to go?<br>
      <br>
      How should I proceed to do it?<br>
      Is there any tutorial on the net? (I couldn't find any)<br>
      I had a look at CTK's and Slicer's superbuilds but we would like
      something more basic and straight forward. Is it possible?<br>
      Is there a special option in CMake/ExternalProjects to be enabled
      or anything we can do about it?<br>
      <br>
      A workaround was to build "myProject" as an ExternalProject linked
      to the "VTK </small><small>ExternalProject"</small><small>, and
      to turn off USE_SUPERBUILD but I don't really like this solution.<br>
      <br>
      Any help would be greatly appreciated,<br>
      <br>
      Thanks<br>
    </small><small><br>
      <b><u>CMAKELISTS.TXT</u><br>
        PROJECT</b>( MYPROJECT )<br>
      ...<br>
      <b>OPTION</b>( USE_SUPERBUILD "Use SuperBuild" ON )<br>
      ...<br>
      <b>IF</b>( USE_SUPERBUILD )<br>
      &nbsp; <b>INCLUDE</b>(
      "${GOFIGURE2_SOURCE_DIR}/CMake/SuperBuild/External-VTK.cmake" )<br>
      <b>ENDIF</b>( USE_SUPERBUILD )</small><br>
    <small>...<br>
      <b>FIND_PACKAGE</b>( VTK )</small>??? //NOT WORKING<br>
    ...<br>
    <u><b><br>
        <small>External-VTK.cmake</small></b></u><br>
    <small><br>
      set(proj VTK)<br>
      ...<br>
      &nbsp; ExternalProject_Add(${proj}<br>
      &nbsp;&nbsp;&nbsp; SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}<br>
      &nbsp;&nbsp;&nbsp; BINARY_DIR ${proj}-build<br>
      &nbsp;&nbsp;&nbsp; GIT_REPOSITORY "${git_protocol}://vtk.org/VTK.git"<br>
      &nbsp;&nbsp;&nbsp; GIT_TAG "origin/release"<br>
      &nbsp;&nbsp;&nbsp; CMAKE_GENERATOR ${gen}<br>
      &nbsp;&nbsp;&nbsp; CMAKE_ARGS<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${ep_common_args}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DBUILD_EXAMPLES:BOOL=OFF<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DBUILD_SHARED_LIBS:BOOL=ON<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DVTK_USE_PARALLEL:BOOL=ON<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DVTK_DEBUG_LEAKS:BOOL=${USE_VTK_DEBUG_LEAKS}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DVTK_USE_RPATH:BOOL=ON<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -DVTK_INSTALL_LIB_DIR:PATH=${MyProject_INSTALL_LIB_DIR}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${VTK_QT_ARGS}<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${VTK_MAC_ARGS}<br>
      &nbsp;&nbsp;&nbsp; INSTALL_COMMAND ""<br>
      &nbsp;&nbsp;&nbsp; DEPENDS<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${VTK_DEPENDENCIES}<br>
      &nbsp;&nbsp;&nbsp; )<br>
      ...</small><br>
    set(VTK_DIR ${CMAKE_BINARY_DIR}/${proj}-build)??? // NOT WORKING<br>
  </body>
</html>