Commit 9538626d authored by Fernando Herrero's avatar Fernando Herrero

Merge branch 'packaging'

parents ce10d407 c16cf939
bin
build
lib
image: docker.io/labrobotica/labrobotica
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
- test
- deploy
build-package:
stage: build
script:
- apt update
#- apt -y install iri-iriutils-dev iri-comm-dev #fill dependencies
- apt-get -y install libboost-all-dev
- wget http://static.matrix-vision.com/mvIMPACT_Acquire/2.26.0/mvGenTL_Acquire-x86_64_ABI2-2.26.0.tgz -O mvGenTL_Acquire-x86_64_ABI2-2.26.0.tgz
- wget https://www.matrix-vision.com/USB3-vision-camera-mvbluefox3.html?file=tl_files/mv11/support/mvIMPACT_Acquire/01/install_mvGenTL_Acquire.sh -O install_mvGenTL_Acquire.sh
- chmod +x install_mvGenTL_Acquire.sh
- ./install_mvGenTL_Acquire.sh -u
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG ..
- ls ..
- make package -j $(nproc)
artifacts:
paths:
- build/*.deb
expire_in: 2 weeks
only:
- tags
update_repo:
stage: deploy
script:
- cd build
- "scp -i /root/.ssh/iriLabKeyNopwd -r *mvbluefox3*.deb irilabo@147.83.76.226:packages/"
- "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh mvbluefox3"
only:
- tags
\ No newline at end of file
......@@ -9,6 +9,7 @@ endif(COMMAND cmake_policy)
# The project name and the type of project
PROJECT(mvbluefox3)
SET(PACKAGE_NAME mvbluefox3)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
......@@ -60,4 +61,25 @@ ELSE(UNIX)
)
ENDIF(UNIX)
IF (UNIX)
SET(CPACK_PACKAGE_FILE_NAME "iri-${PACKAGE_NAME}-dev-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_PACKAGE_NAME "iri-${PACKAGE_NAME}-dev")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at https://gitlab.iri.upc.edu/labrobotica")
SET(CPACK_PACKAGING_INSTALL_PREFIX /usr)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
# Uncomment to add the necessary mantainer scripts
# 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})")
INCLUDE(CPack)
ELSE(UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "packaging only implemented in unix"
TARGET uninstall
)
ENDIF(UNIX)
SET(name mvIMPACT)
#edit the following line to add the librarie's header files
FIND_PATH(mvIMPACT_INCLUDE_DIRS mvIMPACT_CPP/mvIMPACT_acquire.h /opt/mvIMPACT_Acquire)
SET(header_files mvIMPACT_CPP/mvIMPACT_acquire.h)
FIND_LIBRARY(mvIMPACT_LIBRARIES
NAMES mvDeviceManager
PATHS /opt/mvIMPACT_Acquire/lib/x86_64)
FIND_PATH(${name}_INCLUDE_DIRS ${header_files} /opt/mvIMPACT_Acquire)
SET(mvIMPACT_INCLUDE_DIR ${mvIMPACT_INCLUDE_DIRS})
SET(mvIMPACT_LIBRARY ${mvIMPACT_LIBRARIES})
FIND_LIBRARY(${name}_LIBRARIES
NAMES mvDeviceManager
PATHS /opt/mvIMPACT_Acquire/lib/x86_64)
IF (mvIMPACT_INCLUDE_DIRS AND mvIMPACT_LIBRARIES)
SET(mvIMPACT_FOUND TRUE)
ENDIF (mvIMPACT_INCLUDE_DIRS AND mvIMPACT_LIBRARIES)
SET(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
SET(${name}_LIBRARY ${${name}_LIBRARIES})
IF (mvIMPACT_FOUND)
MESSAGE(STATUS "Found mvIMPACT: ${mvIMPACT_LIBRARIES}")
ELSE (mvIMPACT_FOUND)
MESSAGE(FATAL_ERROR "Could not find mvIMPACT. Please install Matrix Vision drivers.")
ENDIF (mvIMPACT_FOUND)
IF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
SET(${name}_FOUND TRUE)
ENDIF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
IF (${name}_FOUND)
IF (NOT ${name}_FIND_QUIETLY)
MESSAGE(STATUS "Found ${name}: ${${name}_LIBRARIES}")
ENDIF (NOT ${name}_FIND_QUIETLY)
ELSE (${name}_FOUND)
IF (${name}_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find ${name}")
ENDIF (${name}_FIND_REQUIRED)
ENDIF (${name}_FOUND)
SET(name mvbluefox3)
#edit the following line to add the librarie's header files
FIND_PATH(mvbluefox3_INCLUDE_DIRS mvbluefox3.h /usr/include/iri/mvbluefox3 /usr/local/include/iri/mvbluefox3)
SET(header_files mvbluefox3.h mvbluefox_mvfunc.h mvbluefox_settings.h)
FIND_LIBRARY(mvbluefox3_LIBRARIES
NAMES mvbluefox3
PATHS /usr/lib /usr/lib/mvbluefox3 /usr/local/lib /usr/local/lib/iri/mvbluefox3)
FIND_PATH(${name}_INCLUDE_DIRS ${header_files} /usr/include/iri/${name} /usr/local/include/iri/${name})
SET(mvbluefox3_INCLUDE_DIR ${mvbluefox3_INCLUDE_DIRS})
SET(mvbluefox3_LIBRARY ${mvbluefox3_LIBRARIES})
FIND_LIBRARY(${name}_LIBRARIES
NAMES ${name}
PATHS /usr/lib /usr/lib/iri/${name} /usr/local/lib /usr/local/lib/iri/${name})
IF (mvbluefox3_INCLUDE_DIRS AND mvbluefox3_LIBRARIES)
SET(mvbluefox3_FOUND TRUE)
ENDIF (mvbluefox3_INCLUDE_DIRS AND mvbluefox3_LIBRARIES)
SET(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
SET(${name}_LIBRARY ${${name}_LIBRARIES})
IF (mvbluefox3_FOUND)
IF (NOT mvbluefox3_FIND_QUIETLY)
MESSAGE(STATUS "Found mvbluefox3: ${mvbluefox3_LIBRARIES}")
ENDIF (NOT mvbluefox3_FIND_QUIETLY)
ELSE (mvbluefox3_FOUND)
IF (mvbluefox3_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find mvbluefox3")
ENDIF (mvbluefox3_FIND_REQUIRED)
ENDIF (mvbluefox3_FOUND)
IF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
SET(${name}_FOUND TRUE)
ENDIF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
IF (${name}_FOUND)
IF (NOT ${name}_FIND_QUIETLY)
MESSAGE(STATUS "Found ${name}: ${${name}_LIBRARIES}")
ENDIF (NOT ${name}_FIND_QUIETLY)
ELSE (${name}_FOUND)
IF (${name}_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find ${name}")
ENDIF (${name}_FIND_REQUIRED)
ENDIF (${name}_FOUND)
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
......
......@@ -5,10 +5,10 @@ SET(sources_ex exceptions/exceptions.cpp exceptions/mvbluefox3_exceptions.cpp
SET(sources_mut mutex/mutex.cpp)
# application header files
SET(headers mvbluefox3.h mvbluefox3_settings.h mvbluefox3_mvfunc.h)
SET(headers_ex mvbluefox3.h exceptions/exceptions.h
exceptions/mvbluefox3_exceptions.h exceptions/mutex_exceptions.h)
SET(headers_mut mutex/mutex.h)
SET(headers ../include/mvbluefox3.h ../include/mvbluefox3_settings.h ../include/mvbluefox3_mvfunc.h)
SET(headers_ex ../include/mvbluefox3.h ../include/exceptions/exceptions.h
../include/exceptions/mvbluefox3_exceptions.h ../include/exceptions/mutex_exceptions.h)
SET(headers_mut ../include/mutex/mutex.h)
#IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release)
......@@ -36,7 +36,8 @@ else(OpenCV_FOUND)
endif(OpenCV_FOUND)
# add the necessary include directories
INCLUDE_DIRECTORIES(. ${mvIMPACT_INCLUDE_DIR})
INCLUDE_DIRECTORIES(../include)
INCLUDE_DIRECTORIES(${mvIMPACT_INCLUDE_DIRS})
# create the shared library
ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut})
......@@ -44,9 +45,9 @@ ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut})
#if CV then add the libraries
if (USE_CV)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY} ${OpenCV_LIBRARIES})
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARIES} ${OpenCV_LIBRARIES})
else(USE_CV)
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY})
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARIES})
endif(USE_CV)
# link necessary libraries
......
......@@ -17,7 +17,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "exceptions.h"
#include "exceptions/exceptions.h"
#include <stdio.h>
#include <string.h>
......@@ -44,4 +44,4 @@ CException::~CException() throw()
/* the error message is destroyed by its own destructor */
}
} // End of CMvbluefox3 namespace
\ No newline at end of file
} // End of CMvbluefox3 namespace
......@@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "mutex_exceptions.h"
#include "exceptions/mutex_exceptions.h"
#include <string.h>
#include <stdio.h>
......@@ -29,4 +29,4 @@ CMutexException::CMutexException(const std::string& where,const std::string& err
this->error_msg+=error_msg;
}
} // End of CMvbluefox3 namespace
\ No newline at end of file
} // End of CMvbluefox3 namespace
#include "mvbluefox3_exceptions.h"
#include "exceptions/mvbluefox3_exceptions.h"
#include <sstream>
#include <stdio.h>
#include <string.h>
......@@ -16,4 +16,4 @@ CmvBlueFOX3Exception::CmvBlueFOX3Exception(const std::string& where,
this->error_msg += error_msg;
}
} // End of CMvbluefox3 namespace
\ No newline at end of file
} // End of CMvbluefox3 namespace
......@@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "mutex.h"
#include "mutex/mutex.h"
#include <cerrno>
#include <stdio.h>
#include "exceptions/mutex_exceptions.h"
......@@ -85,4 +85,4 @@ CMutex::~CMutex()
}
}
} // End of CMvbluefox3 namespace
\ No newline at end of file
} // End of CMvbluefox3 namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment