Skip to content
Snippets Groups Projects
Commit 6d1ae0dc authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Add git ignore and ci files. Moved headers to include directory. Add cpack commands

parent ce10d407
No related branches found
No related tags found
No related merge requests found
Showing with 116 additions and 45 deletions
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
- 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
...@@ -9,6 +9,7 @@ endif(COMMAND cmake_policy) ...@@ -9,6 +9,7 @@ endif(COMMAND cmake_policy)
# The project name and the type of project # The project name and the type of project
PROJECT(mvbluefox3) PROJECT(mvbluefox3)
SET(PACKAGE_NAME mvbluefox3)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
...@@ -60,4 +61,25 @@ ELSE(UNIX) ...@@ -60,4 +61,25 @@ ELSE(UNIX)
) )
ENDIF(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 #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 FIND_PATH(${name}_INCLUDE_DIRS ${header_files} /opt/mvIMPACT_Acquire)
NAMES mvDeviceManager
PATHS /opt/mvIMPACT_Acquire/lib/x86_64)
SET(mvIMPACT_INCLUDE_DIR ${mvIMPACT_INCLUDE_DIRS}) FIND_LIBRARY(${name}_LIBRARIES
SET(mvIMPACT_LIBRARY ${mvIMPACT_LIBRARIES}) NAMES mvDeviceManager
PATHS /opt/mvIMPACT_Acquire/lib/x86_64)
IF (mvIMPACT_INCLUDE_DIRS AND mvIMPACT_LIBRARIES) SET(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
SET(mvIMPACT_FOUND TRUE) SET(${name}_LIBRARY ${${name}_LIBRARIES})
ENDIF (mvIMPACT_INCLUDE_DIRS AND mvIMPACT_LIBRARIES)
IF (mvIMPACT_FOUND) IF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
MESSAGE(STATUS "Found mvIMPACT: ${mvIMPACT_LIBRARIES}") SET(${name}_FOUND TRUE)
ELSE (mvIMPACT_FOUND) ENDIF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
MESSAGE(FATAL_ERROR "Could not find mvIMPACT. Please install Matrix Vision drivers.")
ENDIF (mvIMPACT_FOUND)
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 #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 FIND_PATH(${name}_INCLUDE_DIRS ${header_files} /usr/include/iri/${name} /usr/local/include/iri/${name})
NAMES mvbluefox3
PATHS /usr/lib /usr/lib/mvbluefox3 /usr/local/lib /usr/local/lib/iri/mvbluefox3)
SET(mvbluefox3_INCLUDE_DIR ${mvbluefox3_INCLUDE_DIRS}) FIND_LIBRARY(${name}_LIBRARIES
SET(mvbluefox3_LIBRARY ${mvbluefox3_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(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
SET(mvbluefox3_FOUND TRUE) SET(${name}_LIBRARY ${${name}_LIBRARIES})
ENDIF (mvbluefox3_INCLUDE_DIRS AND mvbluefox3_LIBRARIES)
IF (mvbluefox3_FOUND) IF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
IF (NOT mvbluefox3_FIND_QUIETLY) SET(${name}_FOUND TRUE)
MESSAGE(STATUS "Found mvbluefox3: ${mvbluefox3_LIBRARIES}") ENDIF (${name}_INCLUDE_DIRS AND ${name}_LIBRARIES)
ENDIF (NOT mvbluefox3_FIND_QUIETLY)
ELSE (mvbluefox3_FOUND) IF (${name}_FOUND)
IF (mvbluefox3_FIND_REQUIRED) IF (NOT ${name}_FIND_QUIETLY)
MESSAGE(FATAL_ERROR "Could not find mvbluefox3") MESSAGE(STATUS "Found ${name}: ${${name}_LIBRARIES}")
ENDIF (mvbluefox3_FIND_REQUIRED) ENDIF (NOT ${name}_FIND_QUIETLY)
ENDIF (mvbluefox3_FOUND) 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 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
......
File moved
File moved
File moved
File moved
File moved
...@@ -5,7 +5,7 @@ SET(sources_ex exceptions/exceptions.cpp exceptions/mvbluefox3_exceptions.cpp ...@@ -5,7 +5,7 @@ SET(sources_ex exceptions/exceptions.cpp exceptions/mvbluefox3_exceptions.cpp
SET(sources_mut mutex/mutex.cpp) SET(sources_mut mutex/mutex.cpp)
# application header files # application header files
SET(headers mvbluefox3.h mvbluefox3_settings.h mvbluefox3_mvfunc.h) SET(headers ../include/mvbluefox3.h ../include/mvbluefox3_settings.h ../include/mvbluefox3_mvfunc.h)
SET(headers_ex mvbluefox3.h exceptions/exceptions.h SET(headers_ex mvbluefox3.h exceptions/exceptions.h
exceptions/mvbluefox3_exceptions.h exceptions/mutex_exceptions.h) exceptions/mvbluefox3_exceptions.h exceptions/mutex_exceptions.h)
SET(headers_mut mutex/mutex.h) SET(headers_mut mutex/mutex.h)
...@@ -36,7 +36,8 @@ else(OpenCV_FOUND) ...@@ -36,7 +36,8 @@ else(OpenCV_FOUND)
endif(OpenCV_FOUND) endif(OpenCV_FOUND)
# add the necessary include directories # add the necessary include directories
INCLUDE_DIRECTORIES(. ${mvIMPACT_INCLUDE_DIR}) INCLUDE_DIRECTORIES(../include)
INCLUDE_DIRECTORIES(${mvIMPACT_INCLUDE_DIRS})
# create the shared library # create the shared library
ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut}) ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut})
...@@ -44,9 +45,9 @@ 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 CV then add the libraries
if (USE_CV) if (USE_CV)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY} ${OpenCV_LIBRARIES}) TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARIES} ${OpenCV_LIBRARIES})
else(USE_CV) else(USE_CV)
TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY}) TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARIES})
endif(USE_CV) endif(USE_CV)
# link necessary libraries # link necessary libraries
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
// You should have received a copy of the GNU Lesser General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "exceptions.h" #include "exceptions/exceptions.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -44,4 +44,4 @@ CException::~CException() throw() ...@@ -44,4 +44,4 @@ CException::~CException() throw()
/* the error message is destroyed by its own destructor */ /* the error message is destroyed by its own destructor */
} }
} // End of CMvbluefox3 namespace } // End of CMvbluefox3 namespace
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License // 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/>. // 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 <string.h>
#include <stdio.h> #include <stdio.h>
...@@ -29,4 +29,4 @@ CMutexException::CMutexException(const std::string& where,const std::string& err ...@@ -29,4 +29,4 @@ CMutexException::CMutexException(const std::string& where,const std::string& err
this->error_msg+=error_msg; this->error_msg+=error_msg;
} }
} // End of CMvbluefox3 namespace } // End of CMvbluefox3 namespace
\ No newline at end of file
#include "mvbluefox3_exceptions.h" #include "exceptions/mvbluefox3_exceptions.h"
#include <sstream> #include <sstream>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -16,4 +16,4 @@ CmvBlueFOX3Exception::CmvBlueFOX3Exception(const std::string& where, ...@@ -16,4 +16,4 @@ CmvBlueFOX3Exception::CmvBlueFOX3Exception(const std::string& where,
this->error_msg += error_msg; this->error_msg += error_msg;
} }
} // End of CMvbluefox3 namespace } // End of CMvbluefox3 namespace
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "mutex.h" #include "mutex/mutex.h"
#include <cerrno> #include <cerrno>
#include <stdio.h> #include <stdio.h>
#include "exceptions/mutex_exceptions.h" #include "exceptions/mutex_exceptions.h"
...@@ -85,4 +85,4 @@ CMutex::~CMutex() ...@@ -85,4 +85,4 @@ CMutex::~CMutex()
} }
} }
} // End of CMvbluefox3 namespace } // End of CMvbluefox3 namespace
\ No newline at end of file
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