diff options
| author | manuel <manuel@mausz.at> | 2019-04-29 12:22:05 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2019-04-29 12:22:05 +0200 |
| commit | e317daf081a1048904fdf0b548946fa3ba6593a7 (patch) | |
| tree | 285a58fe8c6b4a95c9a6020afbe7bcc9cb913ea7 /cmake/scripts/common/HandleDepends.cmake | |
| parent | 483c0b88bfc1b798396c31a4dd2f5239399ce59e (diff) | |
| download | kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.tar.gz kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.tar.bz2 kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.zip | |
sync with upstream
Diffstat (limited to 'cmake/scripts/common/HandleDepends.cmake')
| -rw-r--r-- | cmake/scripts/common/HandleDepends.cmake | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 47f7d9b..40e382b 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake | |||
| @@ -88,16 +88,12 @@ function(add_addon_depends addon searchpath) | |||
| 88 | message(${BUILD_ARGS}) | 88 | message(${BUILD_ARGS}) |
| 89 | endif() | 89 | endif() |
| 90 | 90 | ||
| 91 | # prepare patchfile. ensure we have a clean file after reconfiguring | 91 | set(PATCH_COMMAND) |
| 92 | set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) | ||
| 93 | file(REMOVE ${PATCH_FILE}) | ||
| 94 | 92 | ||
| 95 | # if there's a CMakeLists.txt use it to prepare the build | 93 | # if there's a CMakeLists.txt use it to prepare the build |
| 96 | if(EXISTS ${dir}/CMakeLists.txt) | 94 | if(EXISTS ${dir}/CMakeLists.txt) |
| 97 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt) | 95 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt) |
| 98 | file(APPEND ${PATCH_FILE} | 96 | list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${dir}/CMakeLists.txt ${BUILD_DIR}/${id}/src/${id}) |
| 99 | "file(COPY ${dir}/CMakeLists.txt | ||
| 100 | DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") | ||
| 101 | endif() | 97 | endif() |
| 102 | 98 | ||
| 103 | # check if we have patches to apply | 99 | # check if we have patches to apply |
| @@ -124,14 +120,13 @@ function(add_addon_depends addon searchpath) | |||
| 124 | file(READ ${patch} patch_content_hex HEX) | 120 | file(READ ${patch} patch_content_hex HEX) |
| 125 | # Force handle LF-only line endings | 121 | # Force handle LF-only line endings |
| 126 | if(NOT patch_content_hex MATCHES "0d0a") | 122 | if(NOT patch_content_hex MATCHES "0d0a") |
| 127 | set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") | 123 | list(APPEND PATCH_PROGRAM --binary) |
| 128 | endif() | 124 | endif() |
| 129 | endif() | 125 | endif() |
| 130 | endif() | 126 | endif() |
| 131 | 127 | ||
| 132 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch}) | 128 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch}) |
| 133 | file(APPEND ${PATCH_FILE} | 129 | list(APPEND PATCH_COMMAND COMMAND ${PATCH_PROGRAM} -p1 -i ${patch}) |
| 134 | "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") | ||
| 135 | endforeach() | 130 | endforeach() |
| 136 | 131 | ||
| 137 | 132 | ||
| @@ -168,18 +163,11 @@ function(add_addon_depends addon searchpath) | |||
| 168 | if(CROSS_AUTOCONF AND AUTOCONF_FILES) | 163 | if(CROSS_AUTOCONF AND AUTOCONF_FILES) |
| 169 | foreach(afile ${AUTOCONF_FILES}) | 164 | foreach(afile ${AUTOCONF_FILES}) |
| 170 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile}) | 165 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile}) |
| 171 | file(APPEND ${PATCH_FILE} | 166 | list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E echo "AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}") |
| 172 | "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n | 167 | list(APPEND PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${afile} ${BUILD_DIR}/${id}/src/${id}) |
| 173 | file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") | ||
| 174 | endforeach() | 168 | endforeach() |
| 175 | endif() | 169 | endif() |
| 176 | 170 | ||
| 177 | # if the patch file exists we need to set the PATCH_COMMAND | ||
| 178 | set(PATCH_COMMAND "") | ||
| 179 | if(EXISTS ${PATCH_FILE}) | ||
| 180 | set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) | ||
| 181 | endif() | ||
| 182 | |||
| 183 | # prepare the setup of the call to externalproject_add() | 171 | # prepare the setup of the call to externalproject_add() |
| 184 | set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id} | 172 | set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id} |
| 185 | CMAKE_ARGS ${extraflags} ${BUILD_ARGS} | 173 | CMAKE_ARGS ${extraflags} ${BUILD_ARGS} |
