[CMake] Troubles with ExternalProject_Add and PATCH_COMMAND

Steven Truppe workbench at gmx.at
Thu Jul 18 11:29:57 EDT 2019


Hi everyone,

i try to patch a file from an externalprojects with the PATCH_COMMAND.

The patch file looks like:

--- 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 ;

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:

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()

But when running cmake i get the following output:

patching file /home/stuv/projects/programming/bsEdit/build/boost/src/external_boost/project-config.jam

Hunk #1 FAILED at 18.


I have no idea what i'm doing wrong here, i hope someone here can help
me out.


best regards,

Steven Truppe




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190718/e644c55e/attachment.html>


More information about the CMake mailing list