<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Steven,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">When you run patch manually, do you
      then supply the same absolute paths? Looking at the patch file I
      noticed that it contains a relative path. So maybe you should cd
      to ${CMAKE_BINARY_DIR}/boost/src/external_boost/project-config.jam
      before running the patch command.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Cheers,</div>
    <div class="moz-cite-prefix">Marcel.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Op 18-07-19 om 17:29 schreef Steven
      Truppe:<br>
    </div>
    <blockquote type="cite"
      cite="mid:860f827c-6cad-c150-9262-71bcd6aab0b6@gmx.at">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p>Hi everyone,</p>
      <p>i try to patch a file from an externalprojects with the
        PATCH_COMMAND.</p>
      <p>The patch file looks like: <br>
      </p>
      <pre>--- project-config.jam    2019-07-18 17:21:44.008695808 +0200
+++ project-config.jam.tmp    2019-07-18 17:23:28.236474532 +0200
@@ -18,7 +18,7 @@
 import python ;
 if ! [ python.configured ]
 {
-    using python : 2.7 : /usr ;
+    using python : 3.7 : /usr ;
 }
 
 path-constant ICU_PATH : /usr ;
</pre>
      <p>When i try to apply the patch manualy with patch originalfile
        < patchfile it's working, but when i try it with the
        externalproject_add command:</p>
      <pre>if(WITH_LIB_BOOST)
    message(STATUS "Build WITH_LIB_BOOST.")

    set(LIB_BOOST_INC_PATH ${OUTPUT_PATH}/libs/boost/include/)
    set(LIB_BOOST_LIB_PATH ${OUTPUT_PATH}/libs/boost/lib)
    set(LIB_BOOST_DEPS external_boost)
    set(LIB_BOOST_STATIC_LIBS boost_python27)
 
    ExternalProject_Add(external_boost
        PREFIX ${CMAKE_BINARY_DIR}/boost
        URL ${BOOST_URL}
        DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/boost
        URL_HASH MD5=${BOOST_HASH}
        PATCH_COMMAND /usr/bin/patch ${CMAKE_BINARY_DIR}/boost/src/external_boost/project-config.jam < ${CMAKE_SOURCE_DIR}/tools/patches/boost_python3.7.patch
        CONFIGURE_COMMAND cd ${CMAKE_BINARY_DIR}/boost/src/external_boost/ &&
                        ./bootstrap.sh --prefix=${OUTPUT_PATH}/libs/boost/ --with-libraries=python
        BUILD_COMMAND cd ${CMAKE_BINARY_DIR}/boost/src/external_boost/ &&
                      ./b2
        INSTALL_COMMAND cd ${CMAKE_BINARY_DIR}/boost/src/external_boost/ && ./bjam && ./bjam install
        INSTALL_DIR ${OUTPUT_PATH}/boost
    )

endif()
</pre>
      <p>But when running cmake i get the following output:</p>
      <pre>patching file /home/stuv/projects/programming/bsEdit/build/boost/src/external_boost/project-config.jam</pre>
      <pre>Hunk #1 FAILED at 18.</pre>
      <p><br>
      </p>
      <p>I have no idea what i'm doing wrong here, i hope someone here
        can help me out.</p>
      <p><br>
      </p>
      <p>best regards,</p>
      <p>Steven Truppe<br>
      </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>