title: ExternalProject_Add initial svn co not executed
body: <p><strong>UPDATE minimal working example</strong></p>
  
  <p>I have created a minimal working example in a public svn <a href="https://subversion.assembla.com/svn/eternapprojectmwe/trunk/proj" rel="nofollow noreferrer">repo</a>. <code>Checkout</code> the <code>proj</code> folder from trunk, it has a CMakeLists.txt and main.cpp (code below posted). In the trunk I also have the <code>lib</code> folder, which is the static library implementing a class. This class is used in my main. I'm behind a proxy, so I have in the <code>~/.subversion/server</code> added the global proxy setup.</p>
  
  <p><strong>Expected behavior</strong>: After checkout of <strong>proj</strong> do <code>cmake .</code> which also does a checkout  <strong>lib</strong> and executes a <code>make</code> to create <code>libmylib.a</code> prior to build my <code>main</code>. Finally <code>make</code> my main project.</p>
  
  <p><strong>Actual behavior</strong>: Does not checkout <strong>lib</strong> so <code>libmylib.a</code> is not built. Error message:</p>
  
  <pre><code>Re-run cmake no build system arguments
  -- Found Subversion: /usr/bin/svn (found version "1.8.8") 
  -- The C compiler identification is GNU 4.8.4
  -- The CXX compiler identification is GNU 4.8.4
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Configuring done
  CMake Error at CMakeLists.txt:48 (add_executable):
    Cannot find source file:
   /home/user/tmp/externalProject_Test/trunk/proj/project_mylib/lib/mylib.hpp
    Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
    .hxx .in .txx
  -- Build files have been written to: /home/user/tmp/externalProject_Test/trunk/proj
  </code></pre>
  
  <p>The folders are generated by <code>ExternalProject_add</code>, but no svn co in <code>trunk/proj/project_mylib/lib</code></p>
  
  <p>MWE main.cpp:</p>
  
  <pre><code>#include "project_mylib/lib/mylib.hpp"
  int main () {
    Talker me; 
    me.say(); 
    return 0;
  }
  </code></pre>
  
  <p>CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.3)
  
  ### Try to add external project 
  include(ExternalProject)
  ExternalProject_Add(project_mylib
      PREFIX project_mylib 
      SVN_REPOSITORY "https://subversion.assembla.com/svn/eternapprojectmwe/trunk/lib/"
  #   SVN_REVISION ""         
  #   SVN_USERNAME "" 
  #   SVN_PASSWORD ""
      SVN_TRUST_CERT 1  
      TIMEOUT 30
      UPDATE_COMMAND ""
      SOURCE_DIR "project_mylib/lib"
      CONFIGURE_COMMAND ""
      BINARY_DIR "project_mylib/lib"
      BUILD_COMMAND  make
      BUILD_IN_SOURCE 
      INSTALL_COMMAND ""
  )
  ExternalProject_Get_Property(project_mylib binary_dir) 
  project(main)
  SET(LIB_DIR ${binary_dir})
  SET(SOURCES ${PROJECT_SOURCE_DIR}/main.cpp)
  SET(HEADERS ${LIB_DIR}/mylib.hpp)
  add_custom_command(TARGET project_mylib
          POST_BUILD
          COMMAND echo ${LIB_DIR}
  )
  include_directories(
      include
      ${LIB_DIR}  
  )
  add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${LIB_DIR}) 
  add_dependencies(${PROJECT_NAME} project_mylib) 
  target_link_libraries(${PROJECT_NAME} ${LIB_DIR}/libmylib.a)
  </code></pre>
  
  <p>mylib.cpp:</p>
  
  <pre><code>#include "mylib.hpp"
   Talker::Talker()
  {
      this-&gt;text = "Hello!";
  }
   bool Talker::say(void)
  {
      cout &lt;&lt; this-&gt;text;
      return true;    
  }
  </code></pre>
  
  <p>mylib.hpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  class Talker {
     string text;
    public:
      Talker();
      bool say(void);
  };
  </code></pre>
  
  <p>Makefile for the static library</p>
  
  <pre><code># Specify extensions of files to delete when cleaning
  CLEANEXTS   = o a 
  
  # Specify the target file and the install directory
  OUTPUTFILE  = libmylib.a
  INSTALLDIR  = .
  
  # Default target
  .PHONY: all
  all: $(OUTPUTFILE)
  
  # Build libjohnpaul.a from john.o, paul.o, and johnpaul.o
  $(OUTPUTFILE): mylib.o
      ar ru $@ $^
      ranlib $@
  
  # No rule to build john.o, paul.o, and johnpaul.o from .cpp 
  # files is required; this is handled by make's database of
  # implicit rules
  
  .PHONY: install
  install:
      mkdir -p $(INSTALLDIR)
      cp -p $(OUTPUTFILE) $(INSTALLDIR)
  
  .PHONY: clean 
  clean:
      for file in $(CLEANEXTS); do rm -f *.$$file; done
  
  # Indicate dependencies of .ccp files on .hpp files
  mylib.o: mylib.hpp
  </code></pre>
  
  <p><strong>Original post</strong></p>
  
  <p>I have a <code>ROS</code> package (<strong>pomdp_planner</strong>) linked with a <code>Makefiel</code> project (<strong>project_appl</strong>). I have both projects on our <code>SVN</code> but different locations (I'm behind a proxy). If I have a fresh checkout of the ROS node and build it, it fails to download the <code>Makefile</code> project, so building fails at linking phase. In case I manually checkout the Makefile project at the desired location then the ROS PKG is built</p>
  
  <p>My issue is that the <code>Makefile</code> project in the <code>externalproject_add()</code> is not updated to the current version on SVN and it isn't even checked out at the beginning. To build the ROS pkg I use <code>catkin_tools</code>.</p>
  
  <p>I working on <code>Ubuntu</code> 14.04, <code>cmake</code> 2.8.12.2 (and ROS Indigo).</p>
  
  <p>My ROS pkg CMakeList:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.3)
  
  ### Try to add external project 
  include(ExternalProject)
  ExternalProject_Add(project_appl
      PREFIX project_appl 
      SVN_REPOSITORY "mySVN.server"
      SVN_REVISION ""         
      SVN_USERNAME "user" 
      SVN_PASSWORD "pwd"
      SVN_TRUST_CERT 1  
      UPDATE_COMMAND ""
      SOURCE_DIR "project_appl/src"
      CONFIGURE_COMMAND ""
      BINARY_DIR "project_appl/src"
      BUILD_COMMAND  make
      BUILD_IN_SOURCE 
      INSTALL_COMMAND ""
  )
  ExternalProject_Get_Property(project_appl binary_dir)
  
  project(pomdp_planner)    
  SET(APPL_LIB_DIR ${binary_dir})
  add_custom_command(TARGET project_appl
      POST_BUILD
      COMMAND cmake -E remove_directory ${binary_dir}/Utils/boost
      COMMAND cp ${binary_dir}/libappl.a ./CMakeFiles/pomdp_planner.dir/src/libappl.a
      COMMAND cp ${binary_dir}/OnlineOPSolver/OnlineOPsolver/solverOP_lib.hpp ../../devel/include/pomdp_planner/solverOP_lib.hpp
      )    
  find_package(catkin REQUIRED COMPONENTS 
    roscpp
    rospy
    std_msgs
    message_generation
  )    
   add_service_files(
     FILES
     PlannerAction.srv 
   )    
   generate_messages(
     DEPENDENCIES
     std_msgs
   )    
  SET(SOURCES ${PROJECT_SOURCE_DIR}/src/main.cpp)
  SET(HEADERS ${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver/solverOP_lib.hpp 
      ${APPL_LIB_DIR}/OfflineSolver/GlobalResource.h
      ${APPL_LIB_DIR}/OfflineSolver/solverUtils.h
      ${APPL_LIB_DIR}/Parser/Cassandra/Parser.h
      ${APPL_LIB_DIR}/Parser/Cassandra/POMDP.h
      ${APPL_LIB_DIR}/Parser/ParserSelector.h 
      ${APPL_LIB_DIR}/Models/MOMDP/MOMDP.h
      ${APPL_LIB_DIR}/Algorithms/SARSOP/SARSOP.h 
      ${APPL_LIB_DIR}/Algorithms/OPMDP/OPMDP.h
      ${APPL_LIB_DIR}/Bounds/BackupAlphaPlaneMOMDP.h
      ${APPL_LIB_DIR}/Bounds/BackupBeliefValuePairMOMDP.h 
      ${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver/dataLogger.h
      ${APPL_LIB_DIR}/Bounds/FastInfUBInitializer.h
      ${APPL_LIB_DIR}/Bounds/FullObsUBInitializer.h
      ${APPL_LIB_DIR}/Utils/CPTimer.h 
      ${APPL_LIB_DIR}/Core/BeliefCache.h
   )    
  SET(APPL_DIR 
      ${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver/
      ${APPL_LIB_DIR}/OfflineSolver/
      ${APPL_LIB_DIR}/Parser/Cassandra/include
      ${APPL_LIB_DIR}/Parser/Cassandra/
      ${APPL_LIB_DIR}/Parser/
      ${APPL_LIB_DIR}/Parser/POMDPX/
      ${APPL_LIB_DIR}/Models/MOMDP
      ${APPL_LIB_DIR}/Algorithms/SARSOP
      ${APPL_LIB_DIR}/Algorithms/OPMDP/
      ${APPL_LIB_DIR}/Bounds/
      ${APPL_LIB_DIR}/Utils/
      #${APPL_LIB_DIR}/Utils/boost
      ${APPL_LIB_DIR}/Core/
      ${APPL_LIB_DIR}/MathLib
      ${APPL_LIB_DIR}/Algorithms
      ${APPL_LIB_DIR}/Parser/POMDPX
  )    
  SET(LINKER_FLAG "-std=c++11 -fpermissive")    
  catkin_package(
    INCLUDE_DIRS ${APPL_LIB_DIR}  
    LIBRARIES pomdp_planner  project_appl
    CATKIN_DEPENDS roscpp rospy std_msgs message_generation
    DEPENDS system_lib 
  )    
  add_definitions(${LINKER_FLAG})
  ${APPL_DIR}/libappl.a)    
  include_directories(
      include
      ${catkin_INCLUDE_DIRS}
      ${APPL_LIB_DIR}
      ${APPL_DIR} 
  )     
  add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${APPL_LIB_DIR})     
  add_dependencies(${PROJECT_NAME} project_appl) 
  add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} )
  target_link_libraries(${PROJECT_NAME} ${ROS_LIBRARIES} ${catkin_LIBRARIES} ${APPL_LIB_DIR}/libappl.a)
  </code></pre>