Skip to content

Commit

Permalink
Merge pull request #1 from eProsima/master
Browse files Browse the repository at this point in the history
Pull upstream changes
  • Loading branch information
scherererer authored Aug 15, 2018
2 parents b50c03c + e12bbce commit 3de840e
Show file tree
Hide file tree
Showing 466 changed files with 236,462 additions and 7,048 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
url = https://github.com/chriskohlhoff/asio.git
[submodule "thirdparty/fastcdr"]
path = thirdparty/fastcdr
url = http://github.com/eProsima/Fast-CDR.git
url = https://github.com/eProsima/Fast-CDR.git
[submodule "thirdparty/idl"]
path = thirdparty/idl
url = http://github.com/eProsima/IDL-Parser.git
url = https://github.com/eProsima/IDL-Parser.git
[submodule "thirdparty/tinyxml2"]
path = thirdparty/tinyxml2
url = https://github.com/leethomason/tinyxml2.git
171 changes: 91 additions & 80 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,77 +17,87 @@
###############################################################################
cmake_minimum_required(VERSION 2.8.12)

set(IS_TOP_LEVEL TRUE)
if(PROJECT_SOURCE_DIR)
set(IS_TOP_LEVEL FALSE)
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
)
else()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
)
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

project("fastrtps")
set(PROJECT_NAME_STYLED "FastRTPS")
set(PROJECT_NAME_LARGE "Fast RTPS")
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
set(${PROJECT_NAME}_DESCRIPTION_SUMMARY "C++ library implementation of RTPS protocol")
set(${PROJECT_NAME}_DESCRIPTION "eProsima ${PROJECT_NAME_LARGE} library provides publication/subscription communication using RTPS protocol.")

message(STATUS "Configuring ${PROJECT_NAME_LARGE}")

###############################################################################
# Version information #
###############################################################################

#If not set, copy over product version from configure.ac
if(NOT PROJECT_MAJOR_VERSION)
file(STRINGS
${PROJECT_SOURCE_DIR}/configure.ac
PROJECT_MAJOR_VERSION_TMP
REGEX "^m4_define\\(\\[?version_major\\]?, *\\[?[0-9]+\\]?\\)"
)
file(STRINGS
${PROJECT_SOURCE_DIR}/configure.ac
PROJECT_MINOR_VERSION_TMP
REGEX "^m4_define\\(\\[?version_minor\\]?, *\\[?[0-9]+\\]?\\)"
)
file(STRINGS
${PROJECT_SOURCE_DIR}/configure.ac
PROJECT_MICRO_VERSION_TMP
REGEX "^m4_define\\(\\[?version_micro\\]?, *\\[?[0-9]+\\]?\\)"
)
file(STRINGS
configure.ac
LIB_MAJOR_VERSION_TMP
REGEX "^m4_define\\(\\[?version_major\\]?, *\\[?[0-9]+\\]?\\)"
)
file(STRINGS
configure.ac
LIB_MINOR_VERSION_TMP
REGEX "^m4_define\\(\\[?version_minor\\]?, *\\[?[0-9]+\\]?\\)"
)
file(STRINGS
configure.ac
LIB_PATCH_VERSION_TMP
REGEX "^m4_define\\(\\[?version_micro\\]?, *\\[?[0-9]+\\]?\\)"
)

string(REGEX REPLACE "m4_define\\(\\[?version_major\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
PROJECT_MAJOR_VERSION
${PROJECT_MAJOR_VERSION_TMP}
)
string(REGEX REPLACE "m4_define\\(\\[?version_minor\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
PROJECT_MINOR_VERSION
${PROJECT_MINOR_VERSION_TMP}
)
string(REGEX REPLACE "m4_define\\(\\[?version_micro\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
PROJECT_MICRO_VERSION
${PROJECT_MICRO_VERSION_TMP}
)
string(REGEX REPLACE "m4_define\\(\\[?version_major\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
LIB_MAJOR_VERSION
${LIB_MAJOR_VERSION_TMP}
)
string(REGEX REPLACE "m4_define\\(\\[?version_minor\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
LIB_MINOR_VERSION
${LIB_MINOR_VERSION_TMP}
)
string(REGEX REPLACE "m4_define\\(\\[?version_micro\\]?, *\\[?([0-9]+)\\]?\\)"
"\\1"
LIB_PATCH_VERSION
${LIB_PATCH_VERSION_TMP}
)

set(LIB_VERSION_STR "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")

###############################################################################
# Project #
###############################################################################
if(CMAKE_VERSION VERSION_LESS 3.0)
project(fastrtps C CXX)
set(PROJECT_VERSION_MAJOR "${LIB_MAJOR_VERSION}")
set(PROJECT_VERSION_MINOR "${LIB_MINOR_VERSION}")
set(PROJECT_VERSION_PATCH "${LIB_PATCH_VERSION}")
set(PROJECT_VERSION "${LIB_VERSION_STR}")
else()
cmake_policy(SET CMP0048 NEW)
project(fastrtps VERSION "${LIB_VERSION_STR}" LANGUAGES C CXX)
endif()

set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_MICRO_VERSION})
set(PROJECT_NAME_STYLED "FastRTPS")
set(PROJECT_NAME_LARGE "Fast RTPS")
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
set(${PROJECT_NAME}_DESCRIPTION_SUMMARY "C++ library implementation of RTPS protocol")
set(${PROJECT_NAME}_DESCRIPTION "eProsima ${PROJECT_NAME_LARGE} library provides publication/subscription communication using RTPS protocol.")

message(STATUS "Configuring ${PROJECT_NAME_LARGE}")
message(STATUS "Version: ${PROJECT_VERSION}")
message(STATUS "To change de version modify the file configure.ac")

###############################################################################
# Generation of windows installers.
###############################################################################
if(WIN32)
option(EPROSIMA_INSTALLER "Activate the creation of a build to create windows installers" OFF)
option(EPROSIMA_INSTALLER_MINION "Informs this is part of an installer" OFF)
endif()
option(EPROSIMA_INSTALLER "Activate the creation of a build to create windows installers" OFF)

###############################################################################
# Warning level
Expand All @@ -103,7 +113,12 @@ if(MSVC OR MSVC_IDE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EPROSIMA_EXTRA_CMAKE_CXX_FLAGS}")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
endif()
endif()

###############################################################################
Expand All @@ -118,7 +133,7 @@ endif()
###############################################################################
# Test system configuration
###############################################################################
include(${PROJECT_SOURCE_DIR}/cmake/dev/check_configuration.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/common/check_configuration.cmake)
check_stdcxx()
check_compile_feature()
check_endianness()
Expand All @@ -143,7 +158,7 @@ else()
set(DOC_DIR "${DATA_INSTALL_DIR}/doc")
endif()
set(DOC_INSTALL_DIR ${DOC_DIR} CACHE PATH "Installation directory for documentation")
if(WIN32)
if(WIN32 AND EPROSIMA_INSTALLER AND IS_TOP_LEVEL)
set(LICENSE_INSTALL_DIR . CACHE PATH "Installation directory for licenses")
else()
set(LICENSE_INSTALL_DIR ${DATA_INSTALL_DIR}/${PROJECT_NAME} CACHE PATH "Installation directory for licenses")
Expand All @@ -153,7 +168,6 @@ endif()
# eProsima build options
###############################################################################
option(EPROSIMA_BUILD "Activate internal building" OFF)
option(MINION "Tells if it is a subproject of a superproject" OFF)

if(EPROSIMA_INSTALLER)
set(EPROSIMA_BUILD ON)
Expand Down Expand Up @@ -186,20 +200,14 @@ option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)
###############################################################################
# Load external projects.
###############################################################################
option(THIRDPARTY "Activate the use of internal thirdparties" OFF)

if(EPROSIMA_BUILD)
set(THIRDPARTY ON)
endif()
include(${PROJECT_SOURCE_DIR}/cmake/common/eprosima_libraries.cmake)

include(${PROJECT_SOURCE_DIR}/cmake/dev/eprosima_libraries.cmake)

find_eprosima_package(fastcdr)
find_eprosima_thirdparty(Asio asio)
find_eprosima_thirdparty(TinyXML2 tinyxml2)
eprosima_find_package(fastcdr REQUIRED)
eprosima_find_thirdparty(Asio asio)
eprosima_find_thirdparty(TinyXML2 tinyxml2)

if(ANDROID)
find_eprosima_thirdparty(android-ifaddrs android-ifaddrs)
eprosima_find_thirdparty(android-ifaddrs android-ifaddrs)
endif()

###############################################################################
Expand Down Expand Up @@ -247,7 +255,7 @@ endif()
###############################################################################
# Testing
###############################################################################
if(EPROSIMA_BUILD_TESTS AND NOT EPROSIMA_INSTALLER AND NOT EPROSIMA_INSTALLER_MINION)
if(EPROSIMA_BUILD_TESTS AND IS_TOP_LEVEL AND NOT EPROSIMA_INSTALLER)
file(TO_CMAKE_PATH "${PROJECT_SOURCE_DIR}/valgrind.supp" MEMORYCHECK_SUPPRESSIONS_FILE)
enable_testing()
include(CTest)
Expand All @@ -264,7 +272,7 @@ add_subdirectory(test/performance)
###############################################################################
option(COMPILE_EXAMPLES "Build example" OFF)

if(EPROSIMA_BUILD)
if(EPROSIMA_BUILD AND IS_TOP_LEVEL AND NOT EPROSIMA_INSTALLER AND NOT EPROSIMA_INSTALLER_MINION)
set(COMPILE_EXAMPLES ON)
endif()

Expand Down Expand Up @@ -362,27 +370,30 @@ endif()
###############################################################################
# Packaging
###############################################################################
# Install external eprosima libraries
install_eprosima_libraries()

# Install licenses
install(FILES ${PROJECT_SOURCE_DIR}/LICENSE
DESTINATION ${LICENSE_INSTALL_DIR}
COMPONENT licenses
)
set(CPACK_COMPONENT_LICENSES_HIDDEN 1)

# Install examples
install(DIRECTORY ${PROJECT_SOURCE_DIR}/examples/C++
DESTINATION examples/
COMPONENT examples
PATTERN "examples/CMakeLists.txt" EXCLUDE
)
set(CPACK_COMPONENTS_ALL headers licenses)

set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "eProsima ${PROJECT_NAME_LARGE} examples")
option(INSTALL_EXAMPLES "Install example" ON)

set(CPACK_COMPONENTS_ALL headers licenses examples)
if(INSTALL_EXAMPLES)
# Install examples
install(DIRECTORY ${PROJECT_SOURCE_DIR}/examples/C++
DESTINATION examples/
COMPONENT examples
PATTERN "examples/CMakeLists.txt" EXCLUDE
)

set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "eProsima ${PROJECT_NAME_LARGE} examples")

set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} examples)
endif()

if(BUILD_JAVA)
install(FILES ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}gen/share/fastrtps/${PROJECT_NAME}gen.jar
Expand Down
6 changes: 0 additions & 6 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@
## INCLUDE(CTest)

set(CTEST_PROJECT_NAME "fastrtps")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "sambaserver.eprosima.com:8000")
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=fastrtps")
set(CTEST_DROP_SITE_CDASH TRUE)
2 changes: 1 addition & 1 deletion Makefile.am.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

SUBDIRS = include src/cpp

@PROJECT_NAME@_licenciasdir = $(datadir)/doc/@PROJECT_NAME@
@PROJECT_NAME@_licenciasdir = $(datadir)/@PROJECT_NAME@
@PROJECT_NAME@_licencias_DATA = LICENSE

@PROJECT_NAME@_scriptdir = $(bindir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,39 @@ macro(check_stdcxx)
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11)
if(SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" CACHE STRING "" FORCE)
check_cxx_compiler_flag(-std=c++14 SUPPORTS_CXX14)
set(HAVE_CXX14 0)
set(HAVE_CXX1Y 0)
set(HAVE_CXX11 0)
set(HAVE_CXX0X 0)
if(SUPPORTS_CXX14)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
set(HAVE_CXX14 1)
set(HAVE_CXX1Y 1)
set(HAVE_CXX11 1)
set(HAVE_CXX0X 1)
else()
set(HAVE_CXX11 0)
check_cxx_compiler_flag(-std=c++0x SUPPORTS_CXX0X)
if(SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" CACHE STRING "" FORCE)
check_cxx_compiler_flag(-std=c++1y SUPPORTS_CXX1Y)
if(SUPPORTS_CXX1Y)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++1y>)
set(HAVE_CXX1Y 1)
set(HAVE_CXX11 1)
set(HAVE_CXX0X 1)
else()
set(HAVE_CXX0X 0)
check_cxx_compiler_flag(-std=c++11 SUPPORTS_CXX11)
if(SUPPORTS_CXX11)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)
set(HAVE_CXX11 1)
set(HAVE_CXX0X 1)
else()
check_cxx_compiler_flag(-std=c++0x SUPPORTS_CXX0X)
if(SUPPORTS_CXX0X)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++0x>)
set(HAVE_CXX0X 1)
else()
set(HAVE_CXX0X 0)
endif()
endif()
endif()
endif()
elseif(MSVC OR MSVC_IDE)
Expand Down
Loading

0 comments on commit 3de840e

Please sign in to comment.