Skip to content

Commit

Permalink
Fix build for both Ubuntu 16.04 Xenial and 18.04 Bionic
Browse files Browse the repository at this point in the history
  • Loading branch information
j1elo committed Jun 25, 2020
1 parent 4648e32 commit cffcf4b
Show file tree
Hide file tree
Showing 212 changed files with 30,317 additions and 591 deletions.
32 changes: 28 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,29 @@ include(CommonBuildFlags)
common_buildflags_set()
#common_buildflags_print()

# Development: Add here exceptions to the "Warnings are Errors" rule.
# Also, DOCUMENT WHY and always remove them as soon as the problem is fixed.
# For example:
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-function")

# FIXME Disable error from deprecated "soup_session_sync_new" in libsoup
# Introduced for Ubuntu 18.04
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")

# FIXME Disable miscellaneous errors from ALVAR library
# These all happen because the ALVAR library was written for GCC 4.4
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=return-type -Wno-error=reorder -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -Wno-error=comment -Wno-error=unused-value -Wno-error=delete-non-virtual-dtor")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=misleading-indentation")
endif()

# FIXME Disable error when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Wno-error=date-time" HAS_WARNING_DATE_TIME)
if(HAS_WARNING_DATE_TIME)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=date-time")
endif()

# FIXME Disable errors: [return-type, reorder, unused-variable]
# (libalvar has these errors)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=return-type -Wno-error=reorder -Wno-error=unused-variable")

# Generate file "config.h"
set(VERSION ${PROJECT_VERSION})
set(PACKAGE ${PROJECT_NAME})
Expand Down Expand Up @@ -63,4 +75,16 @@ pkg_check_modules(SOUP REQUIRED libsoup-2.4>=${SOUP_REQUIRED})

set(CMAKE_INSTALL_GST_PLUGINS_DIR ${CMAKE_INSTALL_LIBDIR}/gstreamer-1.5)

# Patch and build the ALVAR library
message("Patch ALVAR library sources for OpenCV compatibility:")
execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND git apply --verbose --directory=alvar-2.0.0-src-opencv3 alvar-compat-opencv-2-3.patch
RESULT_VARIABLE GIT_RESULT
)
if(NOT GIT_RESULT EQUAL "0")
message(FATAL_ERROR "git apply failed on ALVAR library")
endif()
add_subdirectory(alvar-2.0.0-src-opencv3)

add_subdirectory(src)
18 changes: 5 additions & 13 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ AR MarkerDetector Kurento module
Here is a very short explanation of needed steps to
use the AR MarkerDetector Kurento module.

To try out the module, you need to have libalvar200.so
somewhere on the lib path.
To try out the module, you need to and restart kurento

> tar xvfz alvar-2.0.0-sdk-linux64-gcc44
> cd alvar-2.0.0-sdk-linux64-gcc44/bin
> sudo cp libalvar200.so /usr/lib

Then you need to install the module and restart kurento

> dpkg -i ar-markerdetector-dev_0.0.1~rc1_amd64.deb
> dpkg -i kms-markerdetector_*.deb
> sudo /etc/init.d/kurento restart

To download the latest binaries you can get them here:
Expand Down Expand Up @@ -121,11 +114,11 @@ src/server/CMakeLists.txt

generate_code (
MODELS ${CMAKE_CURRENT_SOURCE_DIR}/interface
INTERFACE_LIB_EXTRA_INCLUDE_DIRS ${ALVAR_INC}
INTERFACE_LIB_EXTRA_INCLUDE_DIRS ${ALVAR_INCLUDE_DIRS}
SERVER_IMPL_LIB_EXTRA_SOURCES implementation/objects/Process.cpp
SERVER_IMPL_LIB_EXTRA_HEADERS implementation/objects/Process.h
SERVER_IMPL_LIB_EXTRA_INCLUDE_DIRS ${ALVAR_INC} ${SOUP_INCLUDE_DIRS}
SERVER_IMPL_LIB_EXTRA_LIBRARIES ${ALVAR_LIB} ${SOUP_LIBRARIES}
SERVER_IMPL_LIB_EXTRA_INCLUDE_DIRS ${ALVAR_INCLUDE_DIRS} ${SOUP_INCLUDE_DIRS}
SERVER_IMPL_LIB_EXTRA_LIBRARIES ${ALVAR_LIBRARIES} ${SOUP_LIBRARIES}
SERVER_STUB_DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/implementation/objects
)

Expand Down Expand Up @@ -193,4 +186,3 @@ somewhere. For example if you have compiled some packages yourself
and they are installed e.g. on somewhere in /usr/local/? However,
if you have the kurento-media-server path settings as described above
it should not be a problem.

309 changes: 0 additions & 309 deletions alvar-2.0.0-sdk-linux64-gcc44/CMakeLists.txt

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed alvar-2.0.0-sdk-linux64-gcc44/bin/libalvar200.so
Binary file not shown.
Binary file removed alvar-2.0.0-sdk-linux64-gcc44/bin/libalvar200d.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit cffcf4b

Please sign in to comment.