Skip to content

Commit

Permalink
Merge branch 'holiday_cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
drdanz committed Jan 4, 2016
2 parents 74dfb0b + 42781bc commit 65847b4
Show file tree
Hide file tree
Showing 138 changed files with 2,090 additions and 1,832 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ tags
/source-package/
*.dox.fail
*.kate-swp
/CMakeLists.txt.user
*.bak
*.pyc
/compile_commands.json
/.ycm_extra_conf.py
/.clang-format
26 changes: 19 additions & 7 deletions bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ endforeach()

if(YARP_COMPILE_BINDINGS)


#############################################################################
## Discourage inplace compilation

Expand Down Expand Up @@ -92,6 +93,17 @@ link_libraries(${YARP_LIBRARIES})
set_source_files_properties(yarp.i PROPERTIES CPLUSPLUS ON)


#############################################################################
## Disable deprecated warnings, since we are building bindings also for
## deprecated methods

if(NOT YARP_NO_DEPRECATED)
check_cxx_compiler_flag("-Wno-deprecated-declarations" CXX_HAS_WNO_DEPRECATED_DECLARATIONS)
if(CXX_HAS_WNO_DEPRECATED_DECLARATIONS)
add_definitions(-Wno-deprecated-declarations)
endif()
endif()


#############################################################################
## Create Java bindings
Expand All @@ -113,7 +125,7 @@ if(CREATE_JAVA)
set(JAVA_SRCS LoadYarp.java
YarpImageHelper.java
Example1.java)
include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
include_directories(SYSTEM ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
set(target_name jyarp)
swig_add_module(${target_name} java yarp.i)
if(PREPARE_CLASS_FILES)
Expand Down Expand Up @@ -172,7 +184,7 @@ if(CREATE_PYTHON)
set (YARP_USE_PYTHON_VERSION ${PYTHON_VERSION_STRING})
endif()
find_package(PythonLibs ${YARP_USE_PYTHON_VERSION} EXACT)
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(SYSTEM ${PYTHON_INCLUDE_PATH})

## in Windows it seems necessary to declare explictly the link_directory
if(WIN32)
Expand Down Expand Up @@ -229,7 +241,7 @@ endif(CREATE_PYTHON)
if(CREATE_PERL)
set(CMAKE_SWIG_FLAGS "-Wall;-module;yarp")
find_package(PerlLibs)
include_directories(${PERL_INCLUDE_PATH})
include_directories(SYSTEM ${PERL_INCLUDE_PATH})

get_filename_component(_CMAKE_INSTALL_PERLDIR ${PERL_LIBRARY} PATH)
file(RELATIVE_PATH _CMAKE_INSTALL_PERLDIR "${_CMAKE_INSTALL_PERLDIR}" "${PERL_VENDORARCH}")
Expand Down Expand Up @@ -327,7 +339,7 @@ endif()
if(CREATE_TCL)
set(CMAKE_SWIG_FLAGS "-Wall;-module;yarp")
find_package(TCL REQUIRED)
include_directories(${TCL_INCLUDE_PATH})
include_directories(SYSTEM ${TCL_INCLUDE_PATH})
link_libraries(${TCL_LIBRARY})
swig_add_module(libtclyarp tcl yarp.i)
set(YARP_COLLISION_AVOIDANCE TRUE)
Expand Down Expand Up @@ -384,7 +396,7 @@ endif(CREATE_CSHARP)
if(CREATE_RUBY)
find_package(Ruby)
set(CMAKE_SWIG_FLAGS "-Wall;-module;yarp")
include_directories(${RUBY_INCLUDE_PATH})
include_directories(SYSTEM ${RUBY_INCLUDE_PATH})
set(target_name yarp)
if(YARP_COLLISION_AVOIDANCE)
set(target_name yarp_ruby)
Expand All @@ -406,7 +418,7 @@ if(CREATE_LUA)
set(CMAKE_SWIG_FLAGS "-Wall;-module;yarp")
find_package(Lua REQUIRED)
set(target_name yarp_lua)
include_directories(${LUA_INCLUDE_DIR})
include_directories(SYSTEM ${LUA_INCLUDE_DIR})
swig_add_module(${target_name} lua yarp.i)
swig_link_libraries(${target_name} ${LUA_LIBRARY})
set_target_properties(${target_name} PROPERTIES PREFIX "")
Expand All @@ -431,7 +443,7 @@ if(CREATE_OCTAVE)
find_package(Octave REQUIRED)
set(target_name yarp_octave)
get_filename_component(OCTAVE_INCLUDE_TOP ${OCTAVE_INCLUDE_DIR} DIRECTORY)
include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_TOP})
include_directories(SYSTEM ${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_TOP})
swig_add_module(${target_name} octave yarp.i)
swig_link_libraries(${target_name} ${OCTAVE_LIBRARIES})
set_target_properties(${target_name} PROPERTIES PREFIX "")
Expand Down
16 changes: 13 additions & 3 deletions conf/YarpIDL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@ function(YARP_IDL_TO_DIR yarpidl_file_base output_dir)
message(FATAL_ERROR "yarp_idl_to_dir does not know what to do with ${yarpidl_file}, unrecognized extension ${yarpidlExt}")
endif ()

if("${family}" STREQUAL "rosmsg")
get_filename_component(rospkg_name "${include_prefix}" NAME)
get_filename_component(include_prefix "${include_prefix}" PATH)
set(yarpidl_target_name "${rospkg_name}_${yarpidlName}${yarpidlExt}")
else()
set(yarpidl_target_name "${yarpidlName}${yarpidlExt}")
endif()
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" yarpidl_target_name ${yarpidl_target_name})

string(LENGTH "${include_prefix}" include_prefix_len)
if (include_prefix_len GREATER 0)
if (include_prefix_len GREATER 0)
set(include_prefix "/${include_prefix}")
endif ()

# Set intermediate output directory.
set(dir ${CMAKE_CURRENT_BINARY_DIR}/_yarp_idl_${include_prefix}${dir_add})
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" yarpidl_target_name ${yarpidl_file})
set(settings_file ${output_dir}/${yarpidl_target_name}.cmake)

# Check if generation has never happened.
Expand All @@ -89,7 +97,9 @@ function(YARP_IDL_TO_DIR yarpidl_file_base output_dir)
# Go ahead and generate files.
execute_process(COMMAND ${YARPIDL_${family}_LOCATION} --out ${dir} --gen yarp:include_prefix --I ${CMAKE_CURRENT_SOURCE_DIR} ${yarpidl_file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE res)
RESULT_VARIABLE res
OUTPUT_QUIET
ERROR_QUIET)
# Failure is bad news, let user know.
if (NOT "${res}" STREQUAL "0")
message(FATAL_ERROR "yarpidl_${family} (${YARPIDL_${family}_LOCATION}) failed, aborting.")
Expand Down
42 changes: 35 additions & 7 deletions conf/YarpSystemCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,51 @@ else()
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wcast-align")
endif()

check_cxx_compiler_flag("-Wunused" CXX_HAS_UNUSED)
check_cxx_compiler_flag("-Wunused" CXX_HAS_WUNUSED)
if(CXX_HAS_WUNUSED)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wunused")
endif()

check_cxx_compiler_flag("-Wunused-but-set-variable" CXX_HAS_WUNUSED_BUT_SET_VARIABLE)
if(CXX_HAS_WUNUSED_BUT_SET_VARIABLE)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wunused-but-set-variable")
endif()

check_cxx_compiler_flag("-Wvla" CXX_HAS_WVLA)
if(CXX_HAS_WVLA)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wvla")
endif()

check_cxx_compiler_flag("-Wmissing-include-dirs" CXX_HAS_WMISSING_INCLUDE_DIRS)
if(CXX_HAS_WMISSING_INCLUDE_DIRS)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wmissing-include-dirs")
endif()

check_cxx_compiler_flag("-Wlogical-op" CXX_HAS_WLOGICAL_OP)
if(CXX_HAS_WLOGICAL_OP)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wlogical-op")
endif()

check_cxx_compiler_flag("-Wreorder" CXX_HAS_WREORDER)
if(CXX_HAS_WREORDER)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wreorder")
endif()

check_cxx_compiler_flag("-Wsizeof-pointer-memaccess" CXX_HAS_WSIZEOF_POINTER_MEMACCESS)
if(CXX_HAS_WSIZEOF_POINTER_MEMACCESS)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Wsizeof-pointer-memaccess")
endif()

check_cxx_compiler_flag("-Woverloaded-virtual" CXX_HAS_WOVERLOADED_VIRTUAL)
if(CXX_HAS_WOVERLOADED_VIRTUAL)
set(WANTED_WARNING_FLAGS "${WANTED_WARNING_FLAGS} -Woverloaded-virtual")
endif()

check_cxx_compiler_flag("-Wc++11-compat" CXX_HAS_CXX11_COMPAT)
if(CXX_HAS_CXX11_COMPAT)
set(CXX11_FLAGS "${CXX11_FLAGS} -Wc++11-compat")
endif()


## Unwanted warning flags ##

set(UNWANTED_WARNING_FLAGS)
Expand Down Expand Up @@ -253,11 +282,6 @@ else()
set(EXPERIMENTAL_WARNING_FLAGS "${EXPERIMENTAL_WARNING_FLAGS} -Wundef")
endif()

check_cxx_compiler_flag("-Woverloaded-virtual" CXX_HAS_WOVERLOADED_VIRTUAL)
if(CXX_HAS_WOVERLOADED_VIRTUAL)
set(EXPERIMENTAL_WARNING_FLAGS "${EXPERIMENTAL_WARNING_FLAGS} -Woverloaded-virtual")
endif()

check_cxx_compiler_flag("-Wconversion" CXX_HAS_WCONVERSION)
if(CXX_HAS_WCONVERSION)
set(EXPERIMENTAL_WARNING_FLAGS "${EXPERIMENTAL_WARNING_FLAGS} -Wconversion")
Expand All @@ -283,6 +307,10 @@ else()
set(EXPERIMENTAL_WARNING_FLAGS "${EXPERIMENTAL_WARNING_FLAGS} -Winline")
endif()

check_cxx_compiler_flag("-Wfloat-equal" CXX_HAS_FLOAT_EQUAL)
if(CXX_HAS_FLOAT_EQUAL)
set(EXPERIMENTAL_WARNING_FLAGS "${EXPERIMENTAL_WARNING_FLAGS} -Wfloat-equal")
endif()


## Visibility hidden flags ##
Expand Down
14 changes: 7 additions & 7 deletions conf/template/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ABBREVIATE_BRIEF =
# description.
# The default value is: NO.

ALWAYS_DETAILED_SEC = NO
ALWAYS_DETAILED_SEC = YES

# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
Expand Down Expand Up @@ -759,7 +759,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).

WARN_LOGFILE =
WARN_LOGFILE = @CMAKE_BINARY_DIR@/doxygen.log

#---------------------------------------------------------------------------
# Configuration options related to the input files
Expand Down Expand Up @@ -1231,7 +1231,7 @@ DOCSET_FEEDNAME = "YARP Doxygen generated docs"
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_DOCSET is set to YES.

DOCSET_BUNDLE_ID = eu.robotology.YARP
DOCSET_BUNDLE_ID = eu.robotology.YARP-@YARP_VERSION@

# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
Expand Down Expand Up @@ -1330,7 +1330,7 @@ QCH_FILE = YARP.qch
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.

QHP_NAMESPACE = eu.robotology.YARP
QHP_NAMESPACE = eu.robotology.YARP-@YARP_VERSION@

# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
Expand All @@ -1339,7 +1339,7 @@ QHP_NAMESPACE = eu.robotology.YARP
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.

QHP_VIRTUAL_FOLDER = doc
QHP_VIRTUAL_FOLDER = YARP-@YARP_VERSION@

# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
Expand Down Expand Up @@ -1389,7 +1389,7 @@ GENERATE_ECLIPSEHELP = @DOX_GENERATE_ECLIPSEHELP@
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.

ECLIPSE_DOC_ID = eu.robotology.YARP
ECLIPSE_DOC_ID = eu.robotology.YARP-@YARP_VERSION@

# If you want full control over the layout of the generated HTML pages it might
# be necessary to disable the index and replace it with your own. The
Expand Down Expand Up @@ -2397,7 +2397,7 @@ MAX_DOT_GRAPH_DEPTH = 0
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_TRANSPARENT = NO
DOT_TRANSPARENT = YES

# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
Expand Down
43 changes: 21 additions & 22 deletions conf/template/placeGeneratedYarpIdlFiles.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# Authors: Elena Ceseracciu
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT

file(GLOB globbedHeaders RELATIVE @dir@/ "@dir@/*.h")
file(GLOB globbedSources RELATIVE @dir@/ "@dir@/*.cpp")

set(headers)
set(sources)

Expand All @@ -14,42 +11,44 @@ if (include_prefix)
set(prefix ${include_prefix}/)
endif()

# check that globbed files are really the ones we need from generated listfile
file(STRINGS @dir@/@yarpidlName@_indexALL.txt index)
#prepare include and src directories in the source tree
make_directory("@output_dir@/include/${prefix}")
make_directory("@output_dir@/src/${prefix}")

foreach(genFile ${index})
get_filename_component(type ${genFile} EXT)
get_filename_component(main ${genFile} NAME_WE)
if(${type} STREQUAL ".h")
list(FIND globbedHeaders ${genFile} inclFound)
if(${inclFound} EQUAL -1)
message(WARNING "${genFile} not found in @yarpidlName@ dir!")
if(EXISTS @dir@/${genFile})
configure_file("@dir@/${genFile}"
"@output_dir@/include/${genFile}"
COPYONLY)
list(APPEND headers "include/${genFile}")
list(REMOVE_DUPLICATES headers)
else()
file(COPY @dir@/${genFile} DESTINATION @output_dir@/include/${prefix})
list(APPEND headers "include/${prefix}${genFile}")
message(WARNING "${genFile} not found in @yarpidlName@ dir!")
endif()
list(FIND globbedHeaders ${main}Reply${type} inclFound)
if (NOT ${inclFound} EQUAL -1)
file(COPY @dir@/${main}Reply${type} DESTINATION @output_dir@/include/${prefix})
list(APPEND headers "include/${prefix}${main}Reply${type}")
if(EXISTS @dir@/${main}Reply${type})
configure_file("@dir@/${main}Reply${type}"
"@output_dir@/include/${main}Reply${type}"
COPYONLY)
list(APPEND headers "include/${main}Reply${type}")
list(REMOVE_DUPLICATES headers)
endif()
elseif(${type} STREQUAL ".cpp")
list(FIND globbedSources ${genFile} srcFound)
if (${srcFound} EQUAL -1)
message(WARNING "${genFile} not found in @yarpidlName@ dir!")
if(EXISTS @dir@/${genFile})
configure_file("@dir@/${genFile}"
"@output_dir@/src/${genFile}"
COPYONLY)
list(APPEND sources "src/${genFile}")
list(REMOVE_DUPLICATES sources)
else()
file(COPY @dir@/${genFile} DESTINATION @output_dir@/src/${prefix})
list(APPEND sources "src/${prefix}${genFile}")
message(WARNING "${genFile} not found in @yarpidlName@ dir!")
endif()

else()
message(WARNING "Filename extension of ${genFile} is neither .h nor .cpp")
endif()
endforeach(genFile)


file(WRITE @output_dir@/@[email protected]
"## This is an automatically-generated file.
## It could get re-generated if the ALLOW_IDL_GENERATION flag is on
Expand Down
16 changes: 9 additions & 7 deletions doc/port_expert.dox
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ know what type of data they are dealing with.
You can override the port's onRead method:
\code
class DataPort : public BufferedPort<Bottle> {
virtual void onRead(Bottle& b) {
// process data in b
}
using BufferedPort<Bottle>::onRead;
virtual void onRead(Bottle& b) {
// process data in b
}
};
...
DataPort p;
Expand All @@ -180,9 +181,10 @@ Alternatively, you can leave the port unchanged and use
an external callback as follows:
\code
class DataProcessor : public TypedReaderCallback<Bottle> {
virtual void onRead(Bottle& b) {
// process data in b
}
using TypedReaderCallback<Bottle>::onRead;
virtual void onRead(Bottle& b) {
// process data in b
}
};
...
DataProcessor processor;
Expand Down Expand Up @@ -468,4 +470,4 @@ port information from a browser.


*
*/
*/
1 change: 1 addition & 0 deletions src/carriers/bayer_carrier/BayerCarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class yarp::os::BayerCarrier : public yarp::os::ModifyingCarrier,
////////////////////////////////////////////////////////////////////////
// InputStream methods

using yarp::os::InputStream::read;
virtual YARP_SSIZE_T read(const yarp::os::Bytes& b);

virtual void close() {
Expand Down
Loading

0 comments on commit 65847b4

Please sign in to comment.