Skip to content
Snippets Groups Projects
Commit 9a647efa authored by Arnaud Degroote's avatar Arnaud Degroote
Browse files

[wip/MPC] Add a patch to fix incorrect use of substring on cmake < 2.8

parent 740cb90f
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,4 @@ SHA1 (MPC-1.0.tar.gz) = a45fe2e16fb0d93673b014ddff38c074218a0517
RMD160 (MPC-1.0.tar.gz) = 0383006d9f413d201b7b3dc6da8d6169beaf5a4e
Size (MPC-1.0.tar.gz) = 803443 bytes
SHA1 (patch-aa) = 66e1c649e6adbb86e6c49256ce8abcc4293f2bc5
SHA1 (patch-ab) = 6883ab33b9e2e1a469c872d6cbb05ca6c5dc43e3
[CMakeLists.txt] Fix it for cmake < 2.8
cmake 2.8 allows a length of -1 in substring, but not previous
version. So do manually the size computation before calling
substring !
--- MPC/CMakeLists.txt
+++ MPC/CMakeLists.txt
@@ -5,7 +5,9 @@ set(PACKAGE_VERSION 1.0)
macro(GET_LIBRARY_NAME LIBRARY_FULL LIBRARY_NAME)
get_filename_component(LIBRARY_BASE ${LIBRARY_FULL} NAME_WE)
- string(SUBSTRING ${LIBRARY_BASE} 3 -1 PIPO)
+ string(LENGTH ${LIBRARY_BASE} LEN)
+ math(EXPR SUB_LEN "${LEN} - 3")
+ string(SUBSTRING ${LIBRARY_BASE} 3 ${SUB_LEN} PIPO)
set(${LIBRARY_NAME} ${PIPO})
endmacro()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment