diff --git a/.gitlab-ci_template.yml b/.gitlab-ci_template.yml index 6044eb9b63bc44b9b219c646784e941e75e322e7..046cc25944d4706735b544b644419748cf28ef85 100644 --- a/.gitlab-ci_template.yml +++ b/.gitlab-ci_template.yml @@ -15,7 +15,7 @@ #- git submodule update --init --recursive - apt update ##Install dependencies - #- apt -y install iri-iriutils-dev iri-comm-dev iri-dynamixel-dev + #- apt -y install iri-dep1-dev iri-dep2-dev - mkdir -pv build - cd build - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG .. diff --git a/CMakeLists_template.txt b/CMakeLists_template.txt index 636978d76ef79a4e004ba4525aff616576d512d8..dcccd3019c2fcc6cb9896547c3dadf612187baa8 100755 --- a/CMakeLists_template.txt +++ b/CMakeLists_template.txt @@ -80,8 +80,8 @@ IF (UNIX) #SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/scripts/debian/preinst;${CMAKE_SOURCE_DIR}/scripts/debian/postinst;${CMAKE_SOURCE_DIR}/scripts/debian/prerm;${CMAKE_SOURCE_DIR}/scripts/debian/postrm") #Uncomment to add dependencies comma separated - #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-<package_name>-dev (>= 1.0~${DISTRIB})") - #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB}), iri-comm-dev (>= 1.0~${DISTRIB})") + #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-dep1-dev (>= 1.0~${DISTRIB}), iri-dep2-dev (>= 1.0~${DISTRIB})") + INCLUDE(CPack) ELSE(UNIX) ADD_CUSTOM_COMMAND( diff --git a/new_project.sh b/new_project.sh index 84fadb0043161ad1402a9cd6abbc31144dd5fb04..21d01887da8163761e6ad4fa20ed29fe32522f56 100755 --- a/new_project.sh +++ b/new_project.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash DEP= TYPE= @@ -204,6 +204,20 @@ else rm temp1.txt fi +#Add to CMakeLists.txt line wit dependencies like SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-dep1-dev (>= 1.0~${DISTRIB}), iri-dep2-dev (>= 1.0~${DISTRIB})") +cpack_depends="SET(CPACK_DEBIAN_PACKAGE_DEPENDS \"" +for x in $arr +do + dep_line="iri-$x-dev (>= 1.0~\${DISTRIB})" + cpack_depends="$cpack_depends$dep_line, " +done +cpack_depends=${cpack_depends%??} #remove last ', ' +cpack_depends="$cpack_depends\")" +line_to_add="\ \ $cpack_depends" +file=./CMakeLists.txt +comment="#Uncomment to add dependencies comma separated" +sed -i "/${comment}/ a ${line_to_add}" ${file} + rm CMakeLists_test_template.txt rm CMakeLists_template.txt @@ -341,6 +355,18 @@ fi sed 's/library-name/'$NAME_WITH_DASHES'/g' <.gitlab-ci_template.yml >./.gitlab-ci.yml +#Add to .gitlab-ci.yml apt install dependencies like - apt -y install iri-dep1-dev iri-dep2-dev +apt_deps="" +for x in $arr +do + dep_line="iri-$x-dev" + apt_deps="$apt_deps$dep_line " +done +line_to_add="\ \ \ \ \ \ - apt -y install $apt_deps" +file=./.gitlab-ci.yml +comment="##Install dependencies" +sed -i "/${comment}/ a ${line_to_add}" ${file} + if [ $TEST = 1 ] then Library_name=$(echo $NAME | sed 's/\([a-zA-Z]\)\([a-zA-Z0-9]*\)/\u\1\2/g') @@ -360,4 +386,4 @@ rm driver_example_src_template.cpp rm Findlib_template.cmake rm .gitlab-ci_template.yml rm new_project.sh -rm -rf .git +rm -rf .git \ No newline at end of file